feat: 开站网元授权状态标签字典

This commit is contained in:
TsMask
2024-05-16 14:43:18 +08:00
parent 5be95a7af6
commit 7c54e372e5

View File

@@ -1,8 +1,9 @@
<script setup lang="ts">
import { Modal, TableColumnsType, message } from 'ant-design-vue/lib';
import { defineAsyncComponent, onMounted, reactive, ref, toRaw } from 'vue';
import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
import { fnToStepName, stepState } from '../hooks/useStep';
import useI18n from '@/hooks/useI18n';
import useDictStore from '@/store/modules/dict';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import {
codeNeLicense,
@@ -11,10 +12,14 @@ import {
} from '@/api/ne/neLicense';
import saveAs from 'file-saver';
const { t } = useI18n();
const { getDict } = useDictStore();
const UploadLicenseFile = defineAsyncComponent(
() => import('../../../ne/neLicense/components/UploadLicenseFile.vue')
);
/**字典数据-状态 */
let dictStatus = ref<DictType[]>([]);
/**表格字段列 */
let tableColumns = ref<TableColumnsType>([
{
@@ -100,7 +105,7 @@ function fnModalOpen() {
);
state.neLicenseList = neTypeArr;
} else {
state.neLicenseList = []
state.neLicenseList = [];
}
state.visibleByLicenseFile = !state.visibleByLicenseFile;
@@ -129,6 +134,10 @@ function fnRecordState() {
row.status = '1';
row.serialNum = res.data.sn;
row.expiryDate = res.data.expire;
} else {
row.status = '0';
row.serialNum = '-';
row.expiryDate = '-';
}
}
message.success(t('common.operateOk'), 3);
@@ -193,7 +202,7 @@ function fnGetList() {
if (state.selectedRowKeys.length > 0) {
state.selectedRowKeys = [];
}
state.data = res.rows.filter(s => s.neType !== 'OMC');;
state.data = res.rows.filter(s => s.neType !== 'OMC');
}
state.loading = false;
});
@@ -225,8 +234,15 @@ function fnStepNext(stepName: 'Done') {
}
onMounted(() => {
// 初始字典数据
getDict('ne_license_status')
.then(res => {
dictStatus.value = res;
})
.finally(() => {
fnGetList();
});
});
</script>
<template>
@@ -249,6 +265,11 @@ onMounted(() => {
onChange: fnTableSelectedRowKeys,
}"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<DictTag :options="dictStatus" :value="record.status" />
</template>
</template>
</a-table>
<!-- 授权文件上传框 -->