Bladeren bron

message new style

Michael Wang 3 jaren geleden
bovenliggende
commit
e7e500555d

+ 5 - 6
src/features/courseManagement/CourseManagement.vue

@@ -153,7 +153,7 @@ import { useMainStore } from "@/store";
 import { Course_Type } from "@/types";
 import { downloadFileURL } from "@/utils/utils";
 import { message } from "ant-design-vue";
-import { watch, onMounted, ref, reactive, toRaw } from "vue-demi";
+import { watch, onMounted, ref, reactive, toRaw, h } from "vue-demi";
 
 const store = useMainStore();
 store.currentLocation = "基础管理 / 科目管理";
@@ -312,12 +312,11 @@ async function handleImport() {
     message.success({ content: "导入成功" });
     clickSearch();
   } else {
+    const msg = res.data.failRecords.map((v) =>
+      h("div", `行号:${v.lineNum}, 错误:${v.msg}`)
+    );
     message.error({
-      content:
-        "导入失败 \n" +
-        res.data.failRecords
-          .map((v) => `行号:${v.lineNum}, 错误:${v.msg}`)
-          .join("\n"),
+      content: h("span", ["导入失败", ...msg]),
     });
   }
 }

+ 5 - 5
src/features/paperAnalysis/QuestionTypeDifficulty.vue

@@ -164,6 +164,7 @@ import EventBus from "@/plugins/eventBus";
 import { QuestionGroup } from "@/types";
 import { downloadFileURL } from "@/utils/utils";
 import { message } from "ant-design-vue";
+import { h } from "vue-demi";
 import DifficultyDistriTable from "./DifficultyDistriTable.vue";
 
 const props = defineProps<{ questions: QuestionGroup[]; projectId: number }>();
@@ -212,12 +213,11 @@ async function handleImport() {
     importModalVisible = false;
     message.success({ content: "导入成功" });
   } else {
+    const msg = res.data.failRecords.map((v) =>
+      h("div", `行号:${v.lineNum}, 错误:${v.msg}`)
+    );
     message.error({
-      content:
-        "导入失败 \n" +
-        res.data.failRecords
-          .map((v) => `行号:${v.lineNum}, 错误:${v.msg}`)
-          .join("\n"),
+      content: h("span", ["导入失败", ...msg]),
     });
   }
 }

+ 5 - 5
src/features/paperAnalysis/QuestionTypeDiscrimination.vue

@@ -164,6 +164,7 @@ import EventBus from "@/plugins/eventBus";
 import { QuestionGroup } from "@/types";
 import { downloadFileURL } from "@/utils/utils";
 import { message } from "ant-design-vue";
+import { h } from "vue-demi";
 import DiscriminationDistriTable from "./DiscriminationDistriTable.vue";
 
 const props = defineProps<{ questions: QuestionGroup[]; projectId: number }>();
@@ -212,12 +213,11 @@ async function handleImport() {
     importModalVisible = false;
     message.success({ content: "导入成功" });
   } else {
+    const msg = res.data.failRecords.map((v) =>
+      h("div", `行号:${v.lineNum}, 错误:${v.msg}`)
+    );
     message.error({
-      content:
-        "导入失败 \n" +
-        res.data.failRecords
-          .map((v) => `行号:${v.lineNum}, 错误:${v.msg}`)
-          .join("\n"),
+      content: h("span", ["导入失败", ...msg]),
     });
   }
 }

+ 5 - 6
src/features/projectParamsManagement/ProjectParamsManagement.vue

@@ -109,7 +109,7 @@ import {
 import { useMainStore } from "@/store";
 import { downloadFileURL, goBack } from "@/utils/utils";
 import { message } from "ant-design-vue";
-import { watch, onMounted, ref, reactive, toRaw } from "vue-demi";
+import { watch, onMounted, ref, reactive, toRaw, h } from "vue-demi";
 import { useRoute } from "vue-router";
 
 const store = useMainStore();
@@ -233,12 +233,11 @@ async function handleImport() {
     message.success({ content: "导入成功" });
     clickSearch();
   } else {
+    const msg = res.data.failRecords.map((v) =>
+      h("div", `行号:${v.lineNum}, 错误:${v.msg}`)
+    );
     message.error({
-      content:
-        "导入失败 \n" +
-        res.data.failRecords
-          .map((v) => `行号:${v.lineNum}, 错误:${v.msg}`)
-          .join("\n"),
+      content: h("span", ["导入失败", ...msg]),
     });
   }
 }

+ 5 - 6
src/features/subOrg/SubOrg.vue

@@ -138,7 +138,7 @@ import {
 import { useMainStore } from "@/store";
 import { downloadFileURL } from "@/utils/utils";
 import { message, Modal } from "ant-design-vue";
-import { watch, onMounted, ref, reactive, toRaw } from "vue-demi";
+import { watch, onMounted, ref, reactive, toRaw, h } from "vue-demi";
 
 const store = useMainStore();
 store.currentLocation = "基础管理 / 机构管理";
@@ -303,12 +303,11 @@ async function handleImport() {
     importModalVisible = false;
     message.success({ content: "导入成功" });
   } else {
+    const msg = res.data.failRecords.map((v) =>
+      h("div", `行号:${v.lineNum}, 错误:${v.msg}`)
+    );
     message.error({
-      content:
-        "导入失败 \n" +
-        res.data.failRecords
-          .map((v) => `行号:${v.lineNum}, 错误:${v.msg}`)
-          .join("\n"),
+      content: h("span", ["导入失败", ...msg]),
     });
   }
 }

+ 5 - 6
src/features/userManagement/UserManagement.vue

@@ -180,7 +180,7 @@ import router from "@/router";
 import { useMainStore } from "@/store";
 import { downloadFileURL } from "@/utils/utils";
 import { message, Modal } from "ant-design-vue";
-import { watch, onMounted, ref, reactive, toRaw } from "vue-demi";
+import { watch, onMounted, ref, reactive, toRaw, h } from "vue-demi";
 
 const store = useMainStore();
 store.currentLocation = "基础管理 / 用户管理";
@@ -357,12 +357,11 @@ async function handleImport() {
     message.success({ content: "导入成功" });
     clickSearch();
   } else {
+    const msg = res.data.failRecords.map((v) =>
+      h("div", `行号:${v.lineNum}, 错误:${v.msg}`)
+    );
     message.error({
-      content:
-        "导入失败 \n" +
-        res.data.failRecords
-          .map((v) => `行号:${v.lineNum}, 错误:${v.msg}`)
-          .join("\n"),
+      content: h("span", ["导入失败", ...msg]),
     });
   }
 }