Переглянути джерело

导入成功后,回填表格的查询条件

刘洋 2 роки тому
батько
коміт
972c143d39
3 змінених файлів з 17 додано та 9 видалено
  1. 0 1
      components.d.ts
  2. 7 7
      src/App.vue
  3. 10 1
      src/pages/subjects-manage/index.vue

+ 0 - 1
components.d.ts

@@ -20,7 +20,6 @@ declare module '@vue/runtime-core' {
     ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
     ASpin: typeof import('ant-design-vue/es')['Spin']
     ATable: typeof import('ant-design-vue/es')['Table']
-    ATextarea: typeof import('ant-design-vue/es')['Textarea']
     ATooltip: typeof import('ant-design-vue/es')['Tooltip']
     AUpload: typeof import('ant-design-vue/es')['Upload']
     Block: typeof import('./src/components/block/index.vue')['default']

+ 7 - 7
src/App.vue

@@ -1,11 +1,11 @@
 <template>
-  <a-spin
-    style="z-index: 100000"
-    :tip="mainStore.loading.message"
-    :spinning="mainStore.loading.status"
-  >
-    <router-view></router-view>
-  </a-spin>
+  <!--  <a-spin-->
+  <!--    style="z-index: 100000"-->
+  <!--    :tip="mainStore.loading.message"-->
+  <!--    :spinning="mainStore.loading.status"-->
+  <!--  >-->
+  <router-view></router-view>
+  <!--  </a-spin>-->
 </template>
 
 <script setup lang="ts" name="App">

+ 10 - 1
src/pages/subjects-manage/index.vue

@@ -432,10 +432,15 @@ const querySubjectsList = async () => {
 
 watch(() => query.pageNumber, querySubjectsList);
 
+let modalParamsActive = ref(false);
+
 watch(
   () => query.schoolId,
   () => {
-    query.examId = "";
+    if (!modalParamsActive.value) {
+      query.examId = "";
+      modalParamsActive.value = false;
+    }
     Object.assign(examTableData, { result: [], totalCount: 0 });
     if (query.schoolId) {
       queryExamList("", "list");
@@ -516,6 +521,10 @@ const onImport = async () => {
       });
       mainStore.switchLoading(true, "上传中...");
       await ImportDownloadApi[uploadQuery.type].upload(formData);
+      query.schoolId = uploadQuery.schoolId as string;
+      query.examId = uploadQuery.examId as string;
+      modalParamsActive.value = true;
+      message.success("导入成功");
       querySubjectsList();
       showImportModal.value = false;
       mainStore.switchLoading();