Browse Source

reactor:优化虚拟表格缓存和虚拟树形缓存页面空白问题;

zhangchong 1 năm trước cách đây
mục cha
commit
39e354afed

+ 1 - 0
src/views/auxiliary/area/index.vue

@@ -39,6 +39,7 @@
 						fixed
 						:width="width"
 						:height="height"
+            :cache="10"
 					>
 						<template #empty>
 							<Empty />

+ 1 - 0
src/views/knowledge/config/type/index.vue

@@ -39,6 +39,7 @@
 						fixed
 						:width="width"
 						:height="height"
+            :cache="10"
 					>
 						<template #empty>
 							<Empty />

+ 4 - 1
src/views/knowledge/index/index.vue

@@ -236,7 +236,7 @@
 </template>
 
 <script lang="ts" setup name="knowledgeManage">
-import { ref, reactive, onMounted, watch, defineAsyncComponent, nextTick } from 'vue';
+import { ref, reactive, onMounted, watch, defineAsyncComponent, nextTick, onActivated } from 'vue';
 import { ElMessageBox, ElMessage } from 'element-plus';
 import { useRouter } from 'vue-router';
 import type { FormInstance } from 'element-plus';
@@ -531,6 +531,9 @@ onMounted(async () => {
 		treeHeight.value = scrollBarRef.value.wrapRef.clientHeight;
 	});
 });
+onActivated(() => {
+	orgRef.value.setData(state.orgData);
+});
 </script>
 <style lang="scss" scoped>
 .knowledge-index-container {

+ 4 - 1
src/views/knowledge/retrieval/index.vue

@@ -191,7 +191,7 @@
 </template>
 
 <script setup lang="ts" name="knowledgeRetrieval">
-import { onMounted, reactive, ref, watch, nextTick } from 'vue';
+import { onMounted, reactive, ref, watch, nextTick, onActivated } from 'vue';
 import { useRouter } from 'vue-router';
 import { ElMessage } from 'element-plus';
 import { auth } from '/@/utils/authFunction';
@@ -414,6 +414,9 @@ onMounted(async () => {
 		treeHeight.value = scrollBarRef.value.wrapRef.clientHeight;
 	});
 });
+onActivated(() => {
+	orgRef.value.setData(state.orgData);
+});
 </script>
 
 <style scoped lang="scss">

+ 1 - 0
src/views/system/config/dict/index.vue

@@ -76,6 +76,7 @@
 										fixed
 										:width="width"
 										:height="height"
+                    :cache="10"
 									>
 										<template #empty>
 											<Empty />

+ 1 - 0
src/views/system/menu/index.vue

@@ -46,6 +46,7 @@
 						fixed
 						:width="width"
 						:height="height"
+            :cache="10"
 					>
 						<template #empty>
 							<Empty />

+ 1 - 0
src/views/system/organize/index.vue

@@ -41,6 +41,7 @@
 						fixed
 						:width="width"
 						:height="height"
+            :cache="10"
 					>
 						<template #empty>
 							<Empty />

+ 5 - 2
src/views/system/user/index.vue

@@ -11,7 +11,7 @@
 								:data="state.orgData"
 								highlight-current
 								:expand-on-click-node="false"
-								:props="{ children: 'children', label: 'name' }"
+								:props="{ children: 'children', label: 'name',value: 'id' }"
 								@node-click="handleNodeClick"
 								ref="treRef"
 								:filter-method="filterNodeOrg"
@@ -125,7 +125,7 @@
 </template>
 
 <script lang="ts" setup name="systemUser">
-import { computed, defineAsyncComponent, nextTick, onMounted, reactive, ref, watch } from 'vue';
+import {computed, defineAsyncComponent, nextTick, onActivated, onMounted, reactive, ref, watch} from 'vue';
 import type { FormInstance } from 'element-plus';
 import { ElMessage, ElMessageBox } from 'element-plus';
 import { formatDate } from '/@/utils/formatTime';
@@ -295,6 +295,9 @@ onMounted(async () => {
 		treeHeight.value = scrollBarRef.value.wrapRef.clientHeight;
 	});
 });
+onActivated(()=>{
+  treRef.value.setData(state.orgData);
+})
 </script>
 <style lang="scss" scoped>
 .system-user-container {