|
@@ -19,76 +19,93 @@
|
|
|
<el-input v-model="filterHot" placeholder="请输入热点名称" class="input-with-select mb10" clearable> </el-input>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
- <el-scrollbar style="height: calc(100% - 140px);'" ref="scrollBarRef" v-loading="state.loading">
|
|
|
- <el-tree-v2
|
|
|
- v-show="state.activeName === '0'"
|
|
|
- :data="state.orgData"
|
|
|
- highlight-current
|
|
|
- :expand-on-click-node="false"
|
|
|
- :props="{ children: 'children', label: 'name' }"
|
|
|
- @node-click="handleNodeClick"
|
|
|
- ref="orgRef"
|
|
|
- :filter-method="filterNode"
|
|
|
- :item-size="40"
|
|
|
- :height="treeHeight"
|
|
|
- empty-text="暂无组织数据"
|
|
|
- >
|
|
|
- <template #default="{ node }">
|
|
|
- <span :title="node.label">{{ node.label }}</span>
|
|
|
- </template>
|
|
|
- </el-tree-v2>
|
|
|
- <el-tree
|
|
|
- :data="state.knowledgeOptions"
|
|
|
- highlight-current
|
|
|
- :expand-on-click-node="false"
|
|
|
- :props="{ children: 'children', label: 'name' }"
|
|
|
- @node-click="handleNodeClick"
|
|
|
- ref="typeRef"
|
|
|
- v-loading="state.loading"
|
|
|
- :filter-node-method="filterNodeType"
|
|
|
- node-key="id"
|
|
|
- :style="state.activeName === '1' ? 'min-width: 100%; display: inline-block' : 'display:none'"
|
|
|
- :default-expanded-keys="state.defaultExpandedTypeKeys"
|
|
|
- >
|
|
|
- </el-tree>
|
|
|
- <el-tree
|
|
|
- node-key="id"
|
|
|
- :load="loadNode"
|
|
|
- lazy
|
|
|
- v-if="lazyShow"
|
|
|
- :props="{
|
|
|
- label: 'hotSpotFullName',
|
|
|
- children: 'children',
|
|
|
- isLeaf: 'hasChild',
|
|
|
- }"
|
|
|
- :filter-node-method="filterNodeHot"
|
|
|
- @node-click="handleNodeClick"
|
|
|
- v-loading="loading"
|
|
|
- highlight-current
|
|
|
- check-strictly
|
|
|
- :expand-on-click-node="false"
|
|
|
- ref="hotRef"
|
|
|
- :style="state.activeName === '2' ? 'min-width: 100%; display: inline-block' : 'display:none'"
|
|
|
- />
|
|
|
- <el-tree
|
|
|
- ref="hotRef"
|
|
|
- :data="state.hotSpotData"
|
|
|
- node-key="id"
|
|
|
- v-else
|
|
|
- default-expand-all
|
|
|
- highlight-current
|
|
|
- :props="{
|
|
|
- label: 'hotSpotFullName',
|
|
|
- children: 'children',
|
|
|
- isLeaf: 'isLeaf',
|
|
|
- }"
|
|
|
- v-loading="loading"
|
|
|
- :filter-node-method="filterNodeHot"
|
|
|
- @node-click="handleNodeClick"
|
|
|
- :expand-on-click-node="false"
|
|
|
- check-strictly
|
|
|
- :style="state.activeName === '2' ? 'min-width: 100%; display: inline-block' : 'display:none'"
|
|
|
- />
|
|
|
+ <el-scrollbar style="height: calc(100% - 140px);'" ref="scrollBarRef">
|
|
|
+ <el-skeleton :loading="state.loading" animated :rows="10" :style="state.activeName === '0' ? 'min-width: 100%; display: inline-block' : 'display:none'">
|
|
|
+ <template #default>
|
|
|
+ <el-tree-v2
|
|
|
+ :data="state.orgData"
|
|
|
+ highlight-current
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ :props="{ children: 'children', label: 'name' }"
|
|
|
+ @node-click="handleNodeClick"
|
|
|
+ ref="orgRef"
|
|
|
+ :filter-method="filterNode"
|
|
|
+ :item-size="40"
|
|
|
+ :height="treeHeight"
|
|
|
+ empty-text="暂无组织数据"
|
|
|
+ :style="state.activeName === '0' ? 'min-width: 100%; display: inline-block' : 'display:none'"
|
|
|
+ >
|
|
|
+ <template #default="{ node }">
|
|
|
+ <span :title="node.label">{{ node.label }}</span>
|
|
|
+ </template>
|
|
|
+ </el-tree-v2>
|
|
|
+ </template>
|
|
|
+ </el-skeleton>
|
|
|
+ <el-skeleton
|
|
|
+ :loading="state.typeLoading"
|
|
|
+ animated
|
|
|
+ :rows="10"
|
|
|
+ :style="state.activeName === '1' ? 'min-width: 100%; display: inline-block' : 'display:none'"
|
|
|
+ >
|
|
|
+ <template #default>
|
|
|
+ <el-tree
|
|
|
+ :data="state.knowledgeOptions"
|
|
|
+ highlight-current
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ :props="{ children: 'children', label: 'name' }"
|
|
|
+ @node-click="handleNodeClick"
|
|
|
+ ref="typeRef"
|
|
|
+ :filter-node-method="filterNodeType"
|
|
|
+ node-key="id"
|
|
|
+ :style="state.activeName === '1' ? 'min-width: 100%; display: inline-block' : 'display:none'"
|
|
|
+ >
|
|
|
+ </el-tree>
|
|
|
+ </template>
|
|
|
+ </el-skeleton>
|
|
|
+ <el-skeleton
|
|
|
+ :loading="state.loading"
|
|
|
+ animated
|
|
|
+ :rows="10"
|
|
|
+ :style="state.activeName === '2' ? 'min-width: 100%; display: inline-block' : 'display:none'"
|
|
|
+ >
|
|
|
+ <template #default>
|
|
|
+ <el-tree
|
|
|
+ node-key="id"
|
|
|
+ :load="loadNode"
|
|
|
+ lazy
|
|
|
+ v-if="lazyShow"
|
|
|
+ :props="{
|
|
|
+ label: 'hotSpotFullName',
|
|
|
+ children: 'children',
|
|
|
+ isLeaf: 'hasChild',
|
|
|
+ }"
|
|
|
+ :filter-node-method="filterNodeHot"
|
|
|
+ @node-click="handleNodeClick"
|
|
|
+ highlight-current
|
|
|
+ check-strictly
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ ref="hotRef"
|
|
|
+ :style="state.activeName === '2' ? 'min-width: 100%; display: inline-block' : 'display:none'"
|
|
|
+ />
|
|
|
+ <el-tree
|
|
|
+ ref="hotRef"
|
|
|
+ :data="state.hotSpotData"
|
|
|
+ node-key="id"
|
|
|
+ v-else
|
|
|
+ default-expand-all
|
|
|
+ highlight-current
|
|
|
+ :props="{
|
|
|
+ label: 'hotSpotFullName',
|
|
|
+ children: 'children',
|
|
|
+ }"
|
|
|
+ :filter-node-method="filterNodeHot"
|
|
|
+ @node-click="handleNodeClick"
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ check-strictly
|
|
|
+ :style="state.activeName === '2' ? 'min-width: 100%; display: inline-block' : 'display:none'"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-skeleton>
|
|
|
</el-scrollbar>
|
|
|
</pane>
|
|
|
<pane class="center-container">
|
|
@@ -238,6 +255,7 @@ const state = reactive<any>({
|
|
|
loading: false, // 加载状态
|
|
|
retrievalList: [], // 检索列表
|
|
|
hotSpotData: [], // 热点数据
|
|
|
+ typeLoading: false, // 知识类型loading
|
|
|
});
|
|
|
const router = useRouter(); // 路由
|
|
|
const topList = ref<EmptyArrayType>([]); // 常用知识前10
|
|
@@ -312,14 +330,24 @@ const filterNodeHot = (value: string, data: any) => {
|
|
|
const getOrgListApi = async () => {
|
|
|
state.loading = true;
|
|
|
try {
|
|
|
- const [orgRes, treeRes] = await Promise.all([getOrgList(), treeList({ IsEnable: true })]);
|
|
|
+ const [orgRes] = await Promise.all([getOrgList()]);
|
|
|
state.orgData = orgRes.result ?? []; //部门
|
|
|
- state.knowledgeOptions = treeRes.result ?? []; // 知识类型
|
|
|
state.loading = false;
|
|
|
} catch (error) {
|
|
|
state.loading = false;
|
|
|
}
|
|
|
};
|
|
|
+// 获取知识分类
|
|
|
+const getKnowledgeType = async () => {
|
|
|
+ state.typeLoading = true;
|
|
|
+ try {
|
|
|
+ const res: any = await treeList({ IsEnable: true });
|
|
|
+ state.knowledgeOptions = res.result ?? [];
|
|
|
+ state.typeLoading = false;
|
|
|
+ } catch (error) {
|
|
|
+ state.typeLoading = false;
|
|
|
+ }
|
|
|
+};
|
|
|
// 点击节点
|
|
|
const handleNodeClick = (data: any) => {
|
|
|
switch (state.activeName) {
|
|
@@ -439,6 +467,7 @@ const resetNode = () => {
|
|
|
queryList();
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
+ getKnowledgeType();
|
|
|
getOrgListApi();
|
|
|
queryList();
|
|
|
querySearchNum();
|