From 28334b2accccd777d641621525ee7bf05461348a Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 9 Apr 2025 16:31:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BD=91=E5=85=83=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=90=8E=E6=9B=BF=E6=8D=A2=E6=96=87=E4=BB=B6?= =?UTF-8?q?ok=E6=A3=80=E6=9F=A5=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ne/neLicense/components/EditModal.vue | 1 - src/views/ne/neLicense/index.vue | 24 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/views/ne/neLicense/components/EditModal.vue b/src/views/ne/neLicense/components/EditModal.vue index c1e8af42..768f0cea 100644 --- a/src/views/ne/neLicense/components/EditModal.vue +++ b/src/views/ne/neLicense/components/EditModal.vue @@ -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']); diff --git a/src/views/ne/neLicense/index.vue b/src/views/ne/neLicense/index.vue index 70f0f148..9876d314 100644 --- a/src/views/ne/neLicense/index.vue +++ b/src/views/ne/neLicense/index.vue @@ -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'; + } + }); + } } /**