From 4b1c2c4024df6b963826ec84f17c9f9e389aa4c4 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 19 Oct 2023 17:38:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BD=91=E5=85=83=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=88=A0=E9=99=A4=EF=BC=8C=E5=88=B7=E6=96=B0=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E5=85=83=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/configManage/neManage/index.vue | 33 +++++++---------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/src/views/configManage/neManage/index.vue b/src/views/configManage/neManage/index.vue index 3aee60bf..9cfc3a0d 100644 --- a/src/views/configManage/neManage/index.vue +++ b/src/views/configManage/neManage/index.vue @@ -24,6 +24,7 @@ import useI18n from '@/hooks/useI18n'; import { FileType } from 'ant-design-vue/lib/upload/interface'; import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; +import useNeInfoStore from '@/store/modules/neinfo'; const { t } = useI18n(); const route = useRoute(); @@ -336,6 +337,8 @@ function fnModalOk() { .finally(() => { hide(); modalState.confirmLoading = false; + // 刷新缓存的网元信息 + useNeInfoStore().fnRefreshNelist(); }); }) .catch(e => { @@ -361,15 +364,6 @@ function fnImportModalOk() { .then(e => { modalState.confirmLoading = true; const hide = message.loading({ content: t('common.loading') }); - // let result = importFile(from); - // if (from.importType === 'local') { - // let formData = new FormData(); - // formData.append('nfType', from.neType); - // formData.append('nfId', from.neId); - // formData.append('file', from.file); - // result = importFile(formData); - // } - importFile(from) .then(res => { if (res.code === RESULT_CODE_SUCCESS) { @@ -394,7 +388,6 @@ function fnImportModalOk() { }); }) .catch(e => { - console.error(e) message.error(t('common.errorFields', { num: e.errorFields.length }), 3); }); } @@ -438,6 +431,8 @@ function fnRecordDelete(row: Record) { duration: 2, }); fnGetList(); + // 刷新缓存的网元信息 + useNeInfoStore().fnRefreshNelist(); } else { message.error({ content: `${res.msg}`, @@ -627,13 +622,6 @@ function typeChange(value: any) { }); }); } - // else if (res.code === RESULT_CODE_SUCCESS && !res.data) { - // message.error({ - // content: `当前网元没有远程服务器备份文件`, - // key: 'importServer', - // duration: 2, - // }); - // } }); } } @@ -641,13 +629,8 @@ function typeChange(value: any) { /**上传前检查或转换压缩 */ function fnBeforeUploadFile(file: FileType) { if (modalState.confirmLoading) return false; - const fileName = file.name; - const suff = fileName.substring(fileName.lastIndexOf('.')); - const isLt60M = file.size / 1024 / 1024 > 60; - if (isLt60M) { - message.error('有效软件文件大小应不小于 60MB', 3); - return false; - } + // const fileName = file.name; + // const suff = fileName.substring(fileName.lastIndexOf('.')); return true; } @@ -664,6 +647,8 @@ function fnUploadFile(up: UploadRequestOption) { onMounted(() => { // 获取列表数据 fnGetList(); + // 刷新缓存的网元信息 + useNeInfoStore().fnRefreshNelist(); });