| | |
| | | import Authheader from '@/views/authority/components/authheader.vue'; |
| | | import router from "@/router"; |
| | | import { queryCanvasList } from "@/api/Agent"; |
| | | import { getUserResources } from "@/utils/auth"; |
| | | import { forEach } from "lodash"; |
| | | |
| | | let treeDataMenu = ref([]); |
| | | let checkedKeysMenu = ref([]); |
| | |
| | | }; |
| | | |
| | | |
| | | let userResources = JSON.parse(getUserResources()); |
| | | const isExist = (val): boolean => { |
| | | let isok = false; |
| | | userResources.forEach((r) => { |
| | | if (val == r.menuId) { |
| | | isok = true; |
| | | } |
| | | }); |
| | | return isok; |
| | | }; |
| | | const removeChild = (nodes,newT) => { |
| | | nodes.forEach((child) => { |
| | | if (isExist(child.menuId)){ |
| | | newT.push(child); |
| | | let nt = []; |
| | | if (child.children?.length > 0) { |
| | | removeChild(child.children, nt); |
| | | child.children = nt; |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const MenuData = async (key) => { |
| | | await ResourceList(key).then((res) => { |
| | | let newTree=[] |
| | | removeChild(res.rows,newTree) |
| | | treeDataMenu.value = [...res.rows]; |
| | | }); |
| | | }; |
| | | |
| | | KnowledgeList().then((res) => { |
| | | knowledgeList.value = res.rows; |
| | | knowledgeList.value = res.data; |
| | | }); |
| | | |
| | | DialogList().then((res) => { |
| | | DialogsList.value = res.rows; |
| | | DialogsList.value = res.data; |
| | | }); |
| | | queryCanvasList(null).then((canvas) => { |
| | | AgentList= canvas.data |