瀏覽代碼

fix(资源管理): 在关闭审核模态框后刷新资源列表数据

通过暴露myResources组件的getListData方法并在resourceManagements中调用,确保审核完成后资源列表能及时更新
tanshanming 6 月之前
父節點
當前提交
e08dc00413
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 3 0
      src/views/myResources/myResources.vue
  2. 3 1
      src/views/resourceManagements/index.vue

+ 3 - 0
src/views/myResources/myResources.vue

@@ -871,6 +871,9 @@
 		getResourceTypeTree()
 		getListData()
 	})
+	defineExpose({
+		getListData
+	})
 </script>
 
 <style scoped>

+ 3 - 1
src/views/resourceManagements/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<div style="overflow-y: auto">
 		<a-layout>
-			<myResources pageType="economize" @handlerAudit="handlerAudit" />
+			<myResources ref="myResourcesRef" pageType="economize" @handlerAudit="handlerAudit" />
 		</a-layout>
 		<a-modal v-model:visible="modalVisible" :title="'资源审核'" width="1210px" :footer="null" :destroyOnClose="true">
 			<resourceDetails ref="resourceDetailsRef" :isState="1" :isAudit="1" @auditComplete="closeModal" />
@@ -19,6 +19,7 @@
 	const resourceDetailsRef = ref(null)
 	const currentAuditData = ref(null)
 	const auditStore = resourceAuditStore()
+	const myResourcesRef = ref(null)
 
 	const handlerAudit = (data) => {
 		currentAuditData.value = data
@@ -28,6 +29,7 @@
 	}
 
 	const closeModal = () => {
+		myResourcesRef.value.getListData()
 		modalVisible.value = false
 	}
 </script>