Forráskód Böngészése

reactor:140 知识库优化和新需求;

zhangchong 4 hónapja
szülő
commit
6474766979

+ 27 - 21
src/views/knowledge/index/YBIndex.vue

@@ -25,11 +25,11 @@
 									</el-input>
 								</el-tab-pane>
 								<el-tab-pane label="热点" name="2" :disabled="state.tableLoading">
-									<el-input v-model="filterHot" placeholder="请填写热点名称" class="input-with-select mb10" clearable> </el-input>
+									<el-input v-model="filterHot" placeholder="请填写热点名称" class="input-with-select mb10" clearable  @input="inputHotspot"> </el-input>
 								</el-tab-pane>
 							</el-tabs>
 							<el-scrollbar style="height: calc(100% - 100px);'" ref="scrollBarRef">
-								<el-skeleton :loading="state.loading" animated :rows="10" v-if="state.activeName === '0'">
+								<el-skeleton :loading="state.orgLoading" animated :rows="10" v-if="state.activeName === '0'">
 									<template #default>
 										<el-auto-resizer>
 											<template #default="{ height, width }">
@@ -78,7 +78,7 @@
 										</el-auto-resizer>
 									</template>
 								</el-skeleton>
-								<el-skeleton :loading="state.loading" animated :rows="10" v-if="state.activeName === '2'">
+								<el-skeleton :loading="state.hotspotLoading" animated :rows="10" v-if="state.activeName === '2'">
 									<template #default>
 										<el-tree
 											node-key="id"
@@ -126,7 +126,7 @@
 						<template v-else>
 							<el-input v-model="filterOrg" placeholder="请填写部门名称" class="input-with-select mb10" clearable @input="onQueryChanged"> </el-input>
 							<el-scrollbar style="height: calc(100% - 60px);'" ref="scrollBarRef">
-								<el-skeleton :loading="state.loading" animated :rows="10">
+								<el-skeleton :loading="state.orgLoading" animated :rows="10">
 									<template #default>
 										<el-auto-resizer>
 											<template #default="{ height, width }">
@@ -420,7 +420,7 @@ import 'splitpanes/dist/splitpanes.css';
 import { useUserInfo } from '@/stores/userInfo';
 import { storeToRefs } from 'pinia';
 import Other from '@/utils/other';
-import { downloadFileByStream } from '@/utils/tools';
+import { debounce, downloadFileByStream } from '@/utils/tools';
 import { useThemeConfig } from '@/stores/themeConfig';
 import { VxeUI } from 'vxe-pc-ui';
 
@@ -461,6 +461,8 @@ const state = reactive<any>({
 	statusOptions: [], //状态数据
 	hotSpotData: [], //热点数据
 	typeLoading: false, // 知识类型loading
+	orgLoading:false,
+	hotspotLoading:false,
 });
 const router = useRouter(); //路由
 const ruleFormRef = ref<FormInstance>(); //表单ref
@@ -500,36 +502,40 @@ const filterHot = ref('');
 const hotRef = ref<RefType>();
 watch(filterHot, (val) => {
 	if (val) {
-
-		state.typeLoading = true;
 		lazyShow.value = false; //当填写框有值时关闭懒加载
+	} else if (val == '' || val == ' ' || val == null) {
+		lazyShow.value = true; // 懒加载树显示
+	}
+});
+const filterNodeHot = (value: string, data: any) => {
+	if (!value) return true;
+	return data.hotSpotName.includes(value);
+};
+const inputHotspot = debounce((val:string)=>{
+	state.hotspotLoading = true;
+	if (val) {
 		knowledgeHotSpotSearch({name:val,Attribution:state.queryParams.Attribution})
 			.then((res) => {
 				//获取后端搜索的数据
 				state.hotSpotData.length = 0;
 				state.hotSpotData = res.result ?? [];
-				hotRef.value?.filter(val);
-				state.typeLoading = false;
+				state.hotspotLoading = false;
 			})
 			.catch((e) => {
 				console.log(e);
-				state.typeLoading = false;
+				state.hotspotLoading = false;
 			});
 	} else if (val == '' || val == ' ' || val == null) {
-		lazyShow.value = true; // 懒加载树显示
+		state.hotspotLoading = false;
 	}
-});
-const filterNodeHot = (value: string, data: any) => {
-	if (!value) return true;
-	return data.hotSpotName.includes(value);
-};
+},500)
 // 热点分类懒加载
 const lazyShow = ref(true);
 const loadNode = async (node: any, resolve: any) => {
 	try {
 		if (node.isLeaf) return resolve([]);
-		const res: any = await knowledgeHotSpotList({ id: node.data.id ? node.data.id : null,Attribution:state.queryParams.Attribution });
-		resolve(res.result);
+		const {result} = await knowledgeHotSpotList({ id: node.data.id ? node.data.id : null,Attribution:state.queryParams.Attribution });
+		resolve(result);
 	} catch (error) {
 		resolve([]);
 	}
@@ -566,13 +572,13 @@ const handleQuery = () => {
 // 获取所有组织结构 和基础数据
 const exportType = ref<EmptyArrayType>([]);
 const getOrgListApi = async () => {
-	state.loading = true;
+	state.orgLoading = true;
 	try {
 		const { result } = await knowledgeDepartmentList({ Attribution: state.queryParams.Attribution });
 		state.orgData = result ?? []; //部门
-		state.loading = false;
+		state.orgLoading = false;
 	} catch (error) {
-		state.loading = false;
+		state.orgLoading = false;
 	}
 };
 // 获取知识分类

+ 73 - 44
src/views/knowledge/index/ZGIndex.vue

@@ -14,11 +14,11 @@
 								</el-input>
 							</el-tab-pane>
 							<el-tab-pane label="热点" name="2" :disabled="state.tableLoading">
-								<el-input v-model="filterHot" placeholder="请填写热点名称" class="input-with-select mb10" clearable> </el-input>
+								<el-input v-model="filterHot" placeholder="请填写热点名称" class="input-with-select mb10" clearable @input="inputHotspot"> </el-input>
 							</el-tab-pane>
 						</el-tabs>
 						<el-scrollbar style="height: calc(100% - 100px);'" ref="scrollBarRef">
-							<el-skeleton :loading="state.loading" animated :rows="10" v-if="state.activeName === '0'">
+							<el-skeleton :loading="state.orgLoading" animated :rows="10" v-if="state.activeName === '0'">
 								<template #default>
 									<el-auto-resizer>
 										<template #default="{ height, width }">
@@ -35,7 +35,7 @@
 												:height="height"
 											>
 												<template #default="{ node }">
-													<text-tooltip :content="node.label" effect="dark" placement="top"></text-tooltip>
+													<text-tooltip :content="node.label+'('+node.data.knowledgeNum+')'" effect="dark" placement="top"></text-tooltip>
 												</template>
 											</el-tree-v2>
 										</template>
@@ -67,7 +67,7 @@
 									</el-auto-resizer>
 								</template>
 							</el-skeleton>
-							<el-skeleton :loading="state.loading" animated :rows="10" v-if="state.activeName === '2'">
+							<el-skeleton :loading="state.hotspotLoading" animated :rows="10" v-if="state.activeName === '2'">
 								<template #default>
 									<el-tree
 										node-key="id"
@@ -85,7 +85,10 @@
 										check-strictly
 										:expand-on-click-node="false"
 										ref="hotRef"
-									/>
+									>	<template #default="{ node }">
+										<text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
+									</template>
+									</el-tree>
 									<el-tree
 										ref="hotRef"
 										:data="state.hotSpotData"
@@ -101,7 +104,11 @@
 										@node-click="handleNodeClick"
 										:expand-on-click-node="false"
 										check-strictly
-									/>
+									>
+										<template #default="{ node }">
+											<text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
+										</template>
+									</el-tree>
 								</template>
 							</el-skeleton>
 						</el-scrollbar>
@@ -369,14 +376,14 @@ import {
 	knowledgeDetailExport,
 } from '@/api/knowledge';
 import { getOrgListByUser } from '@/api/system/organize';
-import { treeList } from '@/api/knowledge/type';
+import { knowledgeDepartmentList, knowledgeHotSpotList, knowledgeHotSpotSearch, treeList } from '@/api/knowledge/type';
 import { hotSpotSearch, hotSpotType } from '@/api/business/order';
 import { Splitpanes, Pane } from 'splitpanes';
 import 'splitpanes/dist/splitpanes.css';
 import { useUserInfo } from '@/stores/userInfo';
 import { storeToRefs } from 'pinia';
 import Other from '@/utils/other';
-import { downloadFileByStream } from '@/utils/tools';
+import { debounce, downloadFileByStream, throttle } from '@/utils/tools';
 import { useThemeConfig } from '@/stores/themeConfig';
 import { VxeUI } from 'vxe-pc-ui';
 
@@ -387,6 +394,14 @@ const TextTooltip = defineAsyncComponent(() => import('@/components/TextTooltip/
 const ToEnd = defineAsyncComponent(() => import('@/views/knowledge/index/components/To-end.vue')); // 批量审批
 const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
 
+const router = useRouter(); //路由
+const ruleFormRef = ref<FormInstance>(); //表单ref
+const horizontal = ref(false);
+const storesUserInfo = useUserInfo();
+const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
+const storesThemeConfig = useThemeConfig();
+const { themeConfig } = storeToRefs(storesThemeConfig);
+
 // 定义变量内容
 const state = reactive<any>({
 	queryParams: {
@@ -401,6 +416,7 @@ const state = reactive<any>({
 		Summary: null, //摘要
 		ModuleCode: '',
 		NewDraftsStatus: -1,
+		Attribution: userInfos.value.isCenter ? '中心知识库' : '部门知识库',
 	},
 	activeName: '1', //tab切换 默认知识分类
 	tableData: [], //表格数据
@@ -411,15 +427,11 @@ const state = reactive<any>({
 	knowledgeOptions: [], //知识库类型数据
 	statusOptions: [], //状态数据
 	hotSpotData: [], //热点数据
+	hotspotLoading:false, // 热点loading
+	orgLoading:false, // 部门loading
 	typeLoading: false, // 知识类型loading
 });
-const router = useRouter(); //路由
-const ruleFormRef = ref<FormInstance>(); //表单ref
-const horizontal = ref(false);
-const storesUserInfo = useUserInfo();
-const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
-const storesThemeConfig = useThemeConfig();
-const { themeConfig } = storeToRefs(storesThemeConfig);
+
 // 部门查询
 const filterOrg = ref('');
 const orgRef = ref<RefType>();
@@ -456,31 +468,39 @@ const hotRef = ref<RefType>();
 watch(filterHot, (val) => {
 	if (val) {
 		lazyShow.value = false; //当填写框有值时关闭懒加载
-		hotSpotSearch(val)
+	} else if (val == '' || val == ' ' || val == null) {
+		lazyShow.value = true; // 懒加载树显示
+	}
+});
+const filterNodeHot = (value: string, data: any) => {
+	if (!value) return true;
+	return data.hotSpotName.includes(value);
+};
+const lazyShow = ref(true);
+const inputHotspot = debounce((val:string)=>{
+	state.hotspotLoading = true;
+	if (val) {
+		knowledgeHotSpotSearch({name:val,Attribution:state.queryParams.Attribution})
 			.then((res) => {
 				//获取后端搜索的数据
 				state.hotSpotData.length = 0;
 				state.hotSpotData = res.result ?? [];
-				hotRef.value!.filter(val);
+				state.hotspotLoading = false;
 			})
 			.catch((e) => {
 				console.log(e);
+				state.hotspotLoading = false;
 			});
 	} else if (val == '' || val == ' ' || val == null) {
-		lazyShow.value = true; // 懒加载树显示
+		state.hotspotLoading = false;
 	}
-});
-const filterNodeHot = (value: string, data: any) => {
-	if (!value) return true;
-	return data.hotSpotName.includes(value);
-};
+},500)
 // 热点分类懒加载
-const lazyShow = ref(true);
 const loadNode = async (node: any, resolve: any) => {
 	try {
 		if (node.isLeaf) return resolve([]);
-		const res: any = await hotSpotType({ id: node.data.id ? node.data.id : null });
-		resolve(res.result);
+		const {result} = await knowledgeHotSpotList({ id: node.data.id ? node.data.id : null,Attribution:state.queryParams.Attribution });
+		resolve(result);
 	} catch (error) {
 		resolve([]);
 	}
@@ -499,19 +519,38 @@ const handleQuery = () => {
 // 获取所有组织结构 和基础数据
 const exportType = ref<EmptyArrayType>([]);
 const getOrgListApi = async () => {
-	state.loading = true;
+	state.orgLoading = true;
+	try {
+		const { result } = await knowledgeDepartmentList({ Attribution: state.queryParams.Attribution });
+		state.orgData = result ?? []; //部门
+		state.orgLoading = false;
+	} catch (error) {
+		state.orgLoading = false;
+	}
+};
+// 获取知识分类
+const getKnowledgeType = async () => {
+	state.typeLoading = true;
+	try {
+		const { result } = await treeList({ IsEnable: true,Attribution: state.queryParams.Attribution });
+		state.knowledgeOptions = result ?? [];
+		state.typeLoading = false;
+	} catch (error) {
+		state.typeLoading = false;
+	}
+};
+const getBaseDataFn = async () => {
 	try {
-		const res: any = await Promise.all([getOrgListByUser(), baseData()]);
-		state.orgData = res[0].result ?? []; //部门
-		state.statusOptions = res[1].result?.tabNames ?? []; // 列表状态
-		exportType.value = res[1].result?.fileType ?? []; // 导出文件类型
-		state.tabNewDraftsNames = res[1].result?.tabNewDraftsNames.map((item: any) => {
+		const { result } = await baseData();
+		state.statusOptions = result?.tabNames ?? []; // 列表状态
+		exportType.value = result?.fileType ?? []; // 导出文件类型
+		state.tabNewDraftsNames = result?.tabNewDraftsNames.map((item: any) => {
 			return {
 				label: item.value,
 				value: item.key,
 			};
 		});
-		state.tabAuditingNames = res[1].result?.tabAuditingNames.map((item: any) => {
+		state.tabAuditingNames = result?.tabAuditingNames.map((item: any) => {
 			return {
 				label: item.value,
 				value: item.key,
@@ -522,17 +561,6 @@ const getOrgListApi = async () => {
 		state.loading = false;
 	}
 };
-// 获取知识分类
-const getKnowledgeType = async () => {
-	state.typeLoading = true;
-	try {
-		const { result } = await treeList({ IsEnable: true });
-		state.knowledgeOptions = result ?? [];
-		state.typeLoading = false;
-	} catch (error) {
-		state.typeLoading = false;
-	}
-};
 /** 获取知识列表 */
 const requestParams = ref<EmptyObjectType>({});
 const queryList = () => {
@@ -796,6 +824,7 @@ onMounted(() => {
 	if (tableRef.value && toolbarRef.value) {
 		tableRef.value.connect(toolbarRef.value);
 	}
+	getBaseDataFn();
 	getKnowledgeType();
 	getOrgListApi();
 });

+ 25 - 18
src/views/knowledge/retrieval/YBRetrieval.vue

@@ -21,7 +21,7 @@
 									</el-input>
 								</el-tab-pane>
 								<el-tab-pane label="热点" name="2" :disabled="centerLoading">
-									<el-input v-model="filterHot" placeholder="请填写热点名称" class="input-with-select mb10" clearable> </el-input>
+									<el-input v-model="filterHot" placeholder="请填写热点名称" class="input-with-select mb10" clearable @input="inputHotspot"> </el-input>
 								</el-tab-pane>
 							</el-tabs>
 							<el-scrollbar style="height: calc(100% - 160px);'" ref="scrollBarRef">
@@ -49,7 +49,7 @@
 										</el-auto-resizer>
 									</template>
 								</el-skeleton>
-								<el-skeleton :loading="state.loading" animated :rows="10" v-if="state.activeName === '2'">
+								<el-skeleton :loading="state.hotspotLoading" animated :rows="10" v-if="state.activeName === '2'">
 									<template #default>
 										<el-tree
 											node-key="id"
@@ -99,7 +99,7 @@
 						<template v-else>
 							<el-input v-model="filterOrg" placeholder="请填写部门名称" class="input-with-select mb10" clearable @input="onQueryChanged"> </el-input>
 							<el-scrollbar style="height: calc(100% - 100px);'" ref="scrollBarRef">
-								<el-skeleton :loading="state.loading" animated :rows="10">
+								<el-skeleton :loading="state.orgLoading" animated :rows="10">
 									<template #default>
 										<el-auto-resizer>
 											<template #default="{ height, width }">
@@ -268,10 +268,9 @@
 import { onMounted, reactive, ref, watch, defineAsyncComponent } from 'vue';
 import { useRouter } from 'vue-router';
 import { knowledgeRetrieval, searchNumList, knowledgeRetrievalBaseData } from '@/api/knowledge/retrieval';
-import { hotSpotSearch, hotSpotType } from '@/api/business/order';
 import { knowledgeDepartmentList, knowledgeHotSpotList, knowledgeHotSpotSearch, treeList } from '@/api/knowledge/type';
 import { formatDate } from '@/utils/formatTime';
-import { throttle } from '@/utils/tools';
+import { debounce, throttle } from '@/utils/tools';
 import { Splitpanes, Pane } from 'splitpanes';
 import 'splitpanes/dist/splitpanes.css';
 import { useUserInfo } from '@/stores/userInfo';
@@ -302,6 +301,8 @@ const state = reactive<any>({
 	hotSpotData: [], // 热点数据
 	typeLoading: false, // 知识类型loading
 	hotWordsList: [], // 获取热词
+	hotspotLoading:false,
+	orgLoading:false
 });
 const router = useRouter(); // 路
 const topList = ref<EmptyArrayType>([]); // 常用知识前10
@@ -343,28 +344,34 @@ const onQueryChangedType = (query: string) => {
 const filterHot = ref('');
 const hotRef = ref<RefType>();
 watch(filterHot, (val) => {
-	state.typeLoading = true;
 	if (val) {
 		lazyShow.value = false;
+	} else if (val == '' || val == ' ' || val == null) {
+		lazyShow.value = true; // 懒加载树显示
+	}
+});
+const filterNodeHot = (value: string, data: any) => {
+	if (!value) return true;
+	return data.hotSpotName.includes(value);
+};
+const inputHotspot = debounce((val:string)=>{
+	state.hotspotLoading = true;
+	if (val) {
 		knowledgeHotSpotSearch({name:val,Attribution:state.queryParams.Attribution})
 			.then((res) => {
+				//获取后端搜索的数据
 				state.hotSpotData.length = 0;
 				state.hotSpotData = res.result ?? [];
-				state.typeLoading = false;
-				hotRef.value?.filter(val);
+				state.hotspotLoading = false;
 			})
 			.catch((e) => {
-				state.typeLoading = false;
 				console.log(e);
+				state.hotspotLoading = false;
 			});
 	} else if (val == '' || val == ' ' || val == null) {
-		lazyShow.value = true; // 懒加载树显示
+		state.hotspotLoading = false;
 	}
-});
-const filterNodeHot = (value: string, data: any) => {
-	if (!value) return true;
-	return data.hotSpotName.includes(value);
-};
+},500)
 // 热点分类懒加载
 const lazyShow = ref(true);
 const loadNode = async (node: any, resolve: any) => {
@@ -378,13 +385,13 @@ const loadNode = async (node: any, resolve: any) => {
 };
 // 获取所有组织结构 和基础数据
 const getOrgListApi = async () => {
-	state.loading = true;
+	state.orgLoading = true;
 	try {
 		const {result} = await  knowledgeDepartmentList({ Attribution: state.queryParams.Attribution })
 		state.orgData = result ?? []; //部门
-		state.loading = false;
+		state.orgLoading = false;
 	} catch (error) {
-		state.loading = false;
+		state.orgLoading = false;
 	}
 };
 // 获取知识分类

+ 48 - 33
src/views/knowledge/retrieval/ZGRetrieval.vue

@@ -19,11 +19,11 @@
 								</el-input>
 							</el-tab-pane>
 							<el-tab-pane label="热点" name="2" :disabled="centerLoading">
-								<el-input v-model="filterHot" placeholder="请填写热点名称" class="input-with-select mb10" clearable> </el-input>
+								<el-input v-model="filterHot" placeholder="请填写热点名称" class="input-with-select mb10" clearable @input="inputHotspot"> </el-input>
 							</el-tab-pane>
 						</el-tabs>
 						<el-scrollbar style="height: calc(100% - 160px);'" ref="scrollBarRef">
-							<el-skeleton :loading="state.loading" animated :rows="10" v-if="state.activeName === '0'">
+							<el-skeleton :loading="state.orgLoading" animated :rows="10" v-if="state.activeName === '0'">
 								<template #default>
 									<el-auto-resizer>
 										<template #default="{ height, width }">
@@ -40,7 +40,7 @@
 												:height="height"
 											>
 												<template #default="{ node }">
-													<text-tooltip :content="node.label" effect="dark" placement="top"></text-tooltip>
+													<text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
 												</template>
 											</el-tree-v2>
 										</template>
@@ -71,7 +71,7 @@
 									</el-auto-resizer>
 								</template>
 							</el-skeleton>
-							<el-skeleton :loading="state.loading" animated :rows="10" v-if="state.activeName === '2'">
+							<el-skeleton :loading="state.hotspotLoading" animated :rows="10" v-if="state.activeName === '2'">
 								<template #default>
 									<el-tree
 										node-key="id"
@@ -89,7 +89,10 @@
 										check-strictly
 										:expand-on-click-node="false"
 										ref="hotRef"
-									/>
+									>	<template #default="{ node }">
+										<text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
+									</template>
+									</el-tree>
 									<el-tree
 										ref="hotRef"
 										:data="state.hotSpotData"
@@ -105,7 +108,10 @@
 										@node-click="handleNodeClick"
 										:expand-on-click-node="false"
 										check-strictly
-									/>
+									>	<template #default="{ node }">
+										<text-tooltip :content="node.label + '(' + node.data.knowledgeNum + ')'" effect="dark" placement="top"></text-tooltip>
+									</template>
+									</el-tree>
 								</template>
 							</el-skeleton>
 						</el-scrollbar>
@@ -252,11 +258,9 @@
 import { onMounted, reactive, ref, watch, defineAsyncComponent } from 'vue';
 import { useRouter } from 'vue-router';
 import { knowledgeRetrieval, searchNumList, knowledgeRetrievalBaseData } from '@/api/knowledge/retrieval';
-import { hotSpotSearch, hotSpotType } from '@/api/business/order';
-import { getOrgListByUser } from '@/api/system/organize';
-import { treeList } from '@/api/knowledge/type';
+import { knowledgeDepartmentList, knowledgeHotSpotList, knowledgeHotSpotSearch, treeList } from '@/api/knowledge/type';
 import { formatDate } from '@/utils/formatTime';
-import { throttle } from '@/utils/tools';
+import { debounce, throttle } from '@/utils/tools';
 import { Splitpanes, Pane } from 'splitpanes';
 import 'splitpanes/dist/splitpanes.css';
 import { useUserInfo } from '@/stores/userInfo';
@@ -265,12 +269,15 @@ import { getKnowledgeHotWordsList } from '@/api/knowledge/hotWords';
 
 const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
 const TextTooltip = defineAsyncComponent(() => import('@/components/TextTooltip/index.vue'));
+const router = useRouter(); // 路由
+const storesUserInfo = useUserInfo();
+const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
 const state = reactive<any>({
 	queryParams: {
 		// 查询条件
 		PageIndex: 1, // 当前页
 		PageSize: 10, // 每页条数
-		Attribution: ' ',
+		Attribution: userInfos.value.isCenter ? ' ' : '部门知识库',
 		Keyword: null, // 关键词
 		RetrievalType: 0, // 检索类型
 		Sort: '1',
@@ -283,11 +290,10 @@ const state = reactive<any>({
 	retrievalList: [], // 检索列表
 	hotSpotData: [], // 热点数据
 	typeLoading: false, // 知识类型loading
+	hotspotLoading:false,
+	orgLoading:false,
 	hotWordsList: [], // 获取热词
 });
-const router = useRouter(); // 路由
-const storesUserInfo = useUserInfo();
-const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
 const topList = ref<EmptyArrayType>([]); // 常用知识前10
 const handleClick = () => {
 	handleQuery();
@@ -328,51 +334,60 @@ const hotRef = ref<RefType>();
 watch(filterHot, (val) => {
 	if (val) {
 		lazyShow.value = false;
-		hotSpotSearch(val)
+	} else if (val == '' || val == ' ' || val == null) {
+		lazyShow.value = true; // 懒加载树显示
+	}
+});
+const filterNodeHot = (value: string, data: any) => {
+	if (!value) return true;
+	return data.hotSpotName.includes(value);
+};
+const inputHotspot = debounce((val:string)=>{
+	state.hotspotLoading = true;
+	if (val) {
+		knowledgeHotSpotSearch({name:val,Attribution:state.queryParams.Attribution})
 			.then((res) => {
+				//获取后端搜索的数据
 				state.hotSpotData.length = 0;
 				state.hotSpotData = res.result ?? [];
-				hotRef.value!.filter(val);
+				state.hotspotLoading = false;
 			})
 			.catch((e) => {
 				console.log(e);
+				state.hotspotLoading = false;
 			});
 	} else if (val == '' || val == ' ' || val == null) {
-		lazyShow.value = true; // 懒加载树显示
+		state.hotspotLoading = false;
 	}
-});
-const filterNodeHot = (value: string, data: any) => {
-	if (!value) return true;
-	return data.hotSpotName.includes(value);
-};
+},500)
 // 热点分类懒加载
 const lazyShow = ref(true);
 const loadNode = async (node: any, resolve: any) => {
 	try {
 		if (node.isLeaf) return resolve([]);
-		const res: any = await hotSpotType({ id: node.data.id ? node.data.id : null });
-		resolve(res.result);
+		const {result} = await knowledgeHotSpotList({ id: node.data.id ? node.data.id : null,Attribution:state.queryParams.Attribution });
+		resolve(result);
 	} catch (error) {
 		resolve([]);
 	}
 };
 // 获取所有组织结构 和基础数据
 const getOrgListApi = async () => {
-	state.loading = true;
+	state.orgLoading = true;
 	try {
-		const [orgRes] = await Promise.all([getOrgListByUser()]);
-		state.orgData = orgRes.result ?? []; //部门
-		state.loading = false;
+		const { result } = await knowledgeDepartmentList({ Attribution: state.queryParams.Attribution });
+		state.orgData = result ?? []; //部门
+		state.orgLoading = false;
 	} catch (error) {
-		state.loading = false;
+		state.orgLoading = false;
 	}
 };
 // 获取知识分类
 const getKnowledgeType = async () => {
 	state.typeLoading = true;
 	try {
-		const res: any = await treeList({ IsEnable: true });
-		state.knowledgeOptions = res.result ?? [];
+		const { result } = await treeList({ IsEnable: true,Attribution: state.queryParams.Attribution });
+		state.knowledgeOptions = result ?? [];
 		state.typeLoading = false;
 	} catch (error) {
 		state.typeLoading = false;
@@ -494,8 +509,8 @@ const resetNode = () => {
 // 获取热词
 const getHotWords = async () => {
 	try {
-		const res: any = await getKnowledgeHotWordsList({ PageIndex: 1, PageSize: 10, IsEnable: true });
-		state.hotWordsList = res.result?.items ?? [];
+		const {result} = await getKnowledgeHotWordsList({ PageIndex: 1, PageSize: 10, IsEnable: true });
+		state.hotWordsList = result?.items ?? [];
 	} catch (error) {
 		console.log(error);
 	}