fix: 网元更新删除,刷新缓存的网元信息
This commit is contained in:
@@ -24,6 +24,7 @@ import useI18n from '@/hooks/useI18n';
|
|||||||
import { FileType } from 'ant-design-vue/lib/upload/interface';
|
import { FileType } from 'ant-design-vue/lib/upload/interface';
|
||||||
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
|
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
|
||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
|
import useNeInfoStore from '@/store/modules/neinfo';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
@@ -336,6 +337,8 @@ function fnModalOk() {
|
|||||||
.finally(() => {
|
.finally(() => {
|
||||||
hide();
|
hide();
|
||||||
modalState.confirmLoading = false;
|
modalState.confirmLoading = false;
|
||||||
|
// 刷新缓存的网元信息
|
||||||
|
useNeInfoStore().fnRefreshNelist();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
@@ -361,15 +364,6 @@ function fnImportModalOk() {
|
|||||||
.then(e => {
|
.then(e => {
|
||||||
modalState.confirmLoading = true;
|
modalState.confirmLoading = true;
|
||||||
const hide = message.loading({ content: t('common.loading') });
|
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)
|
importFile(from)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
@@ -394,7 +388,6 @@ function fnImportModalOk() {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
console.error(e)
|
|
||||||
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
|
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -438,6 +431,8 @@ function fnRecordDelete(row: Record<string, any>) {
|
|||||||
duration: 2,
|
duration: 2,
|
||||||
});
|
});
|
||||||
fnGetList();
|
fnGetList();
|
||||||
|
// 刷新缓存的网元信息
|
||||||
|
useNeInfoStore().fnRefreshNelist();
|
||||||
} else {
|
} else {
|
||||||
message.error({
|
message.error({
|
||||||
content: `${res.msg}`,
|
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) {
|
function fnBeforeUploadFile(file: FileType) {
|
||||||
if (modalState.confirmLoading) return false;
|
if (modalState.confirmLoading) return false;
|
||||||
const fileName = file.name;
|
// const fileName = file.name;
|
||||||
const suff = fileName.substring(fileName.lastIndexOf('.'));
|
// const suff = fileName.substring(fileName.lastIndexOf('.'));
|
||||||
const isLt60M = file.size / 1024 / 1024 > 60;
|
|
||||||
if (isLt60M) {
|
|
||||||
message.error('有效软件文件大小应不小于 60MB', 3);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -664,6 +647,8 @@ function fnUploadFile(up: UploadRequestOption) {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
fnGetList();
|
fnGetList();
|
||||||
|
// 刷新缓存的网元信息
|
||||||
|
useNeInfoStore().fnRefreshNelist();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user