|
@@ -217,7 +217,7 @@ const initProject = {
|
|
|
const projectObj = reactive({ ...initProject });
|
|
|
|
|
|
/** <handleImport> */
|
|
|
-let importModalVisible = ref<boolean>(false);
|
|
|
+let importModalVisible = $ref<boolean>(false);
|
|
|
async function handleImport() {
|
|
|
const files = (document.querySelector("#file-input") as HTMLInputElement)
|
|
|
.files;
|
|
@@ -227,8 +227,20 @@ async function handleImport() {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- await importProjectParams(projectId, fileToImport);
|
|
|
- message.success({ content: "导入成功" });
|
|
|
+ const res = await importProjectParams(projectId, fileToImport);
|
|
|
+ if (!res.data.hasError) {
|
|
|
+ importModalVisible = false;
|
|
|
+ message.success({ content: "导入成功" });
|
|
|
+ clickSearch();
|
|
|
+ } else {
|
|
|
+ message.error({
|
|
|
+ content:
|
|
|
+ "导入失败 \n" +
|
|
|
+ res.data.failRecords
|
|
|
+ .map((v) => `行号:${v.lineNum}, 错误:${v.msg}`)
|
|
|
+ .join("\n"),
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
/** </handleImport> */
|
|
|
|