fix: 网元授权上传后点击ok检查状态

This commit is contained in:
TsMask
2025-04-10 20:34:15 +08:00
parent 7973b179af
commit 5b6520ef5e
3 changed files with 21 additions and 5 deletions

View File

@@ -10,7 +10,6 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { delNeHost, listNeHost } from '@/api/ne/neHost';
import useDictStore from '@/store/modules/dict';
import useI18n from '@/hooks/useI18n';
import { number } from 'echarts';
const { getDict } = useDictStore();
const { t } = useI18n();
const EditModal = defineAsyncComponent(

View File

@@ -14,7 +14,6 @@ import { FileType } from 'ant-design-vue/es/upload/interface';
import { uploadFile } from '@/api/tool/file';
import { useClipboard } from '@vueuse/core';
import saveAs from 'file-saver';
import { number } from 'echarts';
const { copy } = useClipboard({ legacy: true });
const { t } = useI18n();
const emit = defineEmits(['ok', 'cancel', 'update:open']);

View File

@@ -186,10 +186,10 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum;
}
listNeLicense(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
if (res.code === RESULT_CODE_SUCCESS) {
const { total, rows } = res.data;
tablePagination.total = total;
tableState.data = rows.filter((s:any) => s.neType !== 'OMC');
tableState.data = rows.filter((s: any) => s.neType !== 'OMC');
if (
tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -236,9 +236,27 @@ function fnModalVisibleByEdit(licenseId: number) {
* 对话框弹出确认执行函数
* 进行表达规则校验
*/
function fnModalOk() {
function fnModalOk(e: any) {
// 获取列表数据
fnGetList();
// 获取当前行数据
const item = tableState.data.find(
(item: any) => e.neType === item.neType && e.neId === item.neId
);
if (item) {
stateNeLicense(e.neType, e.neId).then(res => {
const row = tableState.data.find(
(item: any) => e.neType === item.neType && e.neId === item.neId
);
if (res.code === RESULT_CODE_SUCCESS) {
row.status = '1';
row.serialNum = res.data.sn;
row.expiryDate = res.data.expire;
} else {
row.status = '0';
}
});
}
}
/**