fix: 文件上传后关闭窗口复位上传结果
This commit is contained in:
@@ -99,6 +99,7 @@ function fnModalOk() {
|
||||
function fnModalCancel() {
|
||||
modalState.visibleByMoreFile = false;
|
||||
modalState.confirmLoading = false;
|
||||
modalState.from = [];
|
||||
modalState.uploadFiles = [];
|
||||
emit('cancel');
|
||||
emit('update:visible', false);
|
||||
@@ -118,16 +119,25 @@ function fnBeforeUploadFile(file: FileType) {
|
||||
);
|
||||
return Upload.LIST_IGNORE;
|
||||
}
|
||||
|
||||
// 取网元类型判断是否支持
|
||||
let neType = '';
|
||||
const neTypeIndex = fileName.indexOf('-');
|
||||
if (neTypeIndex !== -1) {
|
||||
neType = fileName.substring(0, neTypeIndex).toUpperCase();
|
||||
}
|
||||
if (!NE_TYPE_LIST.includes(neType)) {
|
||||
message.error(fileName + ' 未解析出对应的网元类型', 3);
|
||||
return Upload.LIST_IGNORE;
|
||||
}
|
||||
// 根据给定的软件名取版本号 ims-r2.2312.x-ub22.deb
|
||||
let version = '';
|
||||
const matches = fileName.match(/([0-9.]+[0-9x]+)/);
|
||||
if (matches) {
|
||||
version = matches[0];
|
||||
}
|
||||
let neType = '';
|
||||
const neTypeIndex = fileName.indexOf('-');
|
||||
if (neTypeIndex !== -1) {
|
||||
neType = fileName.substring(0, neTypeIndex).toUpperCase();
|
||||
} else {
|
||||
message.error(fileName + ' 未解析出对应的版本号', 3);
|
||||
return Upload.LIST_IGNORE;
|
||||
}
|
||||
|
||||
// 批量文件信息
|
||||
@@ -215,6 +225,7 @@ onMounted(() => {});
|
||||
<a-form-item
|
||||
:label="`Upload File (Max: ${NE_TYPE_LIST.length})`"
|
||||
name="file"
|
||||
help="仅支持文件名称解析如:网元类型-版本号-操作系统.文件格式"
|
||||
>
|
||||
<a-upload
|
||||
name="file"
|
||||
|
||||
Reference in New Issue
Block a user