| | |
| | | <template> |
| | | <div class="kinematic"> |
| | | <h2>运动学模型</h2> |
| | | <div class="modelContainer"> |
| | | <el-config-provider :locale="zhCn"> |
| | | <el-container class="common-layout"> |
| | | <el-header height="60px"> |
| | | <Header @selectMenu="handMenu" /> |
| | | </el-header> |
| | | <el-container> |
| | | <el-aside width="240px"> |
| | | <TreeMenu |
| | | :menuItem="menuItem" |
| | | :modelTreeData="modelTreeData" |
| | | :storeInfo="storeInfo" |
| | | /> |
| | | </el-aside> |
| | | <el-main> |
| | | <RouterView /> |
| | | </el-main> |
| | | </el-container> |
| | | </el-container> |
| | | </el-config-provider> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import Header from "@/layout/components/Header.vue"; |
| | | import TreeMenu from "@/components/TreeMenu.vue"; |
| | | import { ElConfigProvider } from "element-plus"; |
| | | import zhCn from "element-plus/es/locale/lang/zh-cn"; |
| | | import { inject, onMounted, ref, watch } from "vue"; |
| | | const MG: any = inject("MG"); |
| | | const toolClass: any = inject("toolClass"); |
| | | const menuItem = ref("model"); |
| | | |
| | | const storeInfo = ref({}); |
| | | const modelTreeData = ref([]); |
| | | const handMenu = (key: string) => { |
| | | console.log(key, "key"); |
| | | menuItem.value = key; |
| | | }; |
| | | import { curStoreInfo } from "@/store/index"; |
| | | const seleStore = curStoreInfo(); |
| | | |
| | | onMounted(async () => { |
| | | MG.dps5.GetStoreList().then(async (res: any) => { |
| | | if (res && res.length > 0) { |
| | | const curList = res.map((item) => { |
| | | return { |
| | | ...item, |
| | | ...item.resourceStoreLinkDto.resourceStore, |
| | | storeId: item.resourceStoreLinkDto.resourceStore.id, |
| | | }; |
| | | }); |
| | | const RepositoryList = await MG.dps5.GetStoreRepositoryList({ |
| | | storeIds: [curList[0].storeId], |
| | | }); |
| | | for (let i = 0; i < curList.length; i++) { |
| | | const storeItem = curList[i]; |
| | | const dataList = RepositoryList[i]; |
| | | const datas = dataList.map((item) => { |
| | | return { |
| | | ...item.resourceStoreAndRepositoryLinkDto.repository, |
| | | icon: item.resourceStoreAndRepositoryLinkDto.repository.icon, |
| | | storeId: item.resourceStoreAndRepositoryLinkDto.store.id, |
| | | linkId: item.resourceStoreAndRepositoryLinkDto.id, |
| | | linkType: item.resourceStoreAndRepositoryLinkDto.linkType, |
| | | linkOrder: item.resourceStoreAndRepositoryLinkDto.order, |
| | | childrenCount: |
| | | item.resourceStoreAndRepositoryLinkDto.repository.rootChannel |
| | | .childrenCount, |
| | | }; |
| | | }); |
| | | storeItem.repositoryList = datas; |
| | | } |
| | | console.log(curList, "curList"); |
| | | console.log(toolClass, "toolClass"); |
| | | const temp_store = { |
| | | storeId: curList[0].storeId, |
| | | storeData: curList[0], |
| | | repositoryId: curList[0].repositoryList[0].id, |
| | | repositoryData: curList[0].repositoryList[0], |
| | | }; |
| | | storeInfo.value = temp_store; |
| | | seleStore.setStoreInfo(temp_store); |
| | | // getTableData(); |
| | | } |
| | | }); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .kinematic { |
| | | padding: 20px; |
| | | .modelContainer { |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: #fff; |
| | | } |
| | | </style> |
| | | </style> |