Explorar o código

🎨 增加审核页用户登录变更后刷新

快乐的梦鱼 hai 2 semanas
pai
achega
19a2cfa53f
Modificáronse 2 ficheiros con 19 adicións e 3 borrados
  1. 12 3
      src/pages/admin.vue
  2. 7 0
      src/pages/collect/assessment/evaluation-form-list.vue

+ 12 - 3
src/pages/admin.vue

@@ -16,6 +16,7 @@
           </template>
           <a-tab-pane key="1" tab="传承人列表">
             <CommonListBlock 
+              ref="listRef"
               :showTotal="true"
               :rowCount="1"
               :rowType="5"
@@ -53,6 +54,7 @@
           </a-tab-pane>
           <a-tab-pane key="2" tab="非遗项目列表">
             <CommonListBlock 
+              ref="listRef"
               :showTotal="true"
               :rowCount="1"
               :rowType="5"
@@ -95,6 +97,7 @@
             </div>
 
             <CommonListBlock 
+              ref="listRef"
               :showTotal="true"
               :rowCount="1"
               :rowType="5"
@@ -121,6 +124,7 @@
           </a-tab-pane> -->
           <a-tab-pane key="9" tab="传承协议签署">
             <CommonListBlock
+              ref="listRef"
               :show-total="true"
               :row-count="1"
               :row-type="5"
@@ -147,13 +151,14 @@
             </CommonListBlock>
           </a-tab-pane>
           <a-tab-pane key="8" tab="自查评估表">
-            <EvaluationFormList />
+            <EvaluationFormList ref="listRef" />
           </a-tab-pane>
           <a-tab-pane v-if="false" key="4" tab="重点区域">
             <div class="flex justify-end">
               <a-button type="primary" :disabled="true" @click="router.push({ name: 'FormWork' })">+ 新增</a-button>
             </div>
             <CommonListBlock 
+              ref="listRef"
               :showTotal="true"
               :rowCount="1"
               :rowType="5"
@@ -179,7 +184,7 @@
 </template>
 
 <script setup lang="ts">
-import { computed, h, onMounted, ref, watch } from 'vue';
+import { computed, onMounted, ref, watch } from 'vue';
 import { useRoute, useRouter } from 'vue-router';
 import { useAuthStore } from '@/stores/auth';
 import { message, Modal } from 'ant-design-vue';
@@ -202,6 +207,7 @@ const route = useRoute();
 const authStore = useAuthStore();
 const activeKey = ref(route.query.tab as string || '1');
 const inheritorData = ref<GetContentListItem[]>([]);
+const listRef = ref<any>(null);
 
 onMounted(() => {
   switch (activeKey.value) {
@@ -213,6 +219,10 @@ onMounted(() => {
   }
 });
 
+watch(() => authStore.userId, () => {
+  listRef.value?.reload();
+});
+
 const { variable: lastValueCategory } = useMemorizeVar('categoryLastSelectValue', 0);
 const { variable: lastValueStatus } = useMemorizeVar('statusLastSelectValue', -10);
 const { variable: lastAgreementProgress } = useMemorizeVar('adminUserAgreementProgress', -100);
@@ -456,5 +466,4 @@ function handleGoWorks(item: GetContentListItem) {
     ichId: item.id,
   } })
 }
-
 </script>

+ 7 - 0
src/pages/collect/assessment/evaluation-form-list.vue

@@ -2,6 +2,7 @@
   <a-tabs v-model:activeKey="activeKey" centered type="card">
     <a-tab-pane key="1" tab="传承人列表">
       <CommonListBlock
+        ref="listRef"
         :show-total="true"
         :row-count="1"
         :row-type="5"
@@ -61,6 +62,7 @@
     </a-tab-pane>
     <a-tab-pane key="2" tab="审核记录">
       <CommonListBlock
+        ref="listRef"
         :show-total="true"
         :row-count="1"
         :row-type="5"
@@ -123,6 +125,7 @@ import { GROUP_TO_REVIEW_PROGRESS } from './composeables/GroupData';
 const router = useRouter();
 
 const activeKey = ref('1');
+const listRef = ref<any>(null);
 
 const showDownloadModal = ref(false);
 const downloading = ref(false);
@@ -297,4 +300,8 @@ function openDownloadModal() {
   downloadProgress.value = lastSelfAssessmentProgress.value;
   showDownloadModal.value = true;
 }
+
+defineExpose({
+  reload: () => listRef.value?.reload(),
+})
 </script>