| | |
| | | import LeftTreeByMgr from '/@/components/tree/leftTreeByMgr.vue'; |
| | | import { useQueryTable } from '/@/hooks/useQueryTable'; |
| | | import { convertListToTree } from '/@/utils/util'; |
| | | import { OptClassificationMap, classificationEnum } from '/@/views/types/metrics'; |
| | | import item from 'element-plus/es/components/space/src/item'; |
| | | const viewKnowledgeTableRef = ref(); |
| | | const router = useRouter(); |
| | | const route = useRoute(); |
| | |
| | | }); |
| | | if (res?.json_ok) { |
| | | const resData = (res.groups || []) as []; |
| | | state.knowledgeBaseData = convertListToTree(resData, { |
| | | const byParentData = convertListToTree(resData, { |
| | | ID: 'group_id', |
| | | Children: 'Children', |
| | | ParentID: 'p_group_id', |
| | | }); |
| | | const result = []; |
| | | byParentData.forEach((item) => { |
| | | if (item.group_type == OptClassificationMap[classificationEnum.Knowledge]) { |
| | | result.push(item); |
| | | } |
| | | }); |
| | | state.knowledgeBaseData = result; |
| | | if (selectFirst) { |
| | | const firstListTreeNode = state.knowledgeBaseData[0]; |
| | | if (firstListTreeNode) { |