diff --git a/src/views/commonPage/tree.vue b/src/views/commonPage/tree.vue index 6863374..709dc33 100644 --- a/src/views/commonPage/tree.vue +++ b/src/views/commonPage/tree.vue @@ -17,7 +17,16 @@ lazy :load="loadNode" @node-click="handleTargetInfo" + :expand-on-click-node="false" > + @@ -108,15 +117,13 @@ const loadNode = async (node: any, resolve: any) => { }).then((res) => { resolve(res.data); //默认加载第1层 }); + } else if (node.level > 0 && node.level < 4) { //默认展开的层级,需要默认几层就判断一下. resolve(node.data.children); } else if (node.level === 4) { - console.log(node, node.level, "4------"); - // 利用设备中的信息调用接口 - // --------- - // --------- + //懒加载 let res = await treeSecond({ orgID: "8af8470a47aad8e20147aad92e400335", @@ -156,7 +163,6 @@ const loadNode = async (node: any, resolve: any) => { resolve(datanames); } else { resolve([{ name: "暂无数据", leaf: true }]); - console.log(res); //需要将上一级的加号去掉 } } else if (node.level === 5) { console.log(node.parent, node.level); @@ -229,7 +235,7 @@ const emits = defineEmits(["update-node-key"]); ////接收父组件的事件, const handleTargetInfo = (data: TreeData, node: any) => { // targetInfo.resultArr = []; - console.log("zheshishaya111",node.level,data); + console.log("点击的节点",node); if (node.level === 4) { console.log(node.level,'0000',node.key); diff --git a/src/views/pages/CapacityAdjustmentPage/index.vue b/src/views/pages/CapacityAdjustmentPage/index.vue index a852a6c..eb9246c 100644 --- a/src/views/pages/CapacityAdjustmentPage/index.vue +++ b/src/views/pages/CapacityAdjustmentPage/index.vue @@ -399,8 +399,9 @@ const getAllSourceAjust = () => { }; sourcInfoApi(datainput).then((res) => { - console.log(res, "可调资源"); - sourceAjustObj = res.data; + // console.log(res, "可调资源"); + + handelSourceTable(res.data); // tablepvData.value=res?.data }); }; @@ -436,6 +437,7 @@ const getTreeSourceList = async (id: string) => { }; // 处理可调资源数量 功能--- const handelSourceTable = (sourceAjustObj: any) => { + sourceLArr.forEach((item) => { // 将返回数据的length赋值给数组对象 item.number = sourceAjustObj[item.type]?.length || 0; @@ -461,6 +463,7 @@ let sourceLArr = reactive([ ]); const handelSource = (type: string) => { + // 根据type类型获取表格数据 tablepvData.value = []; for (let i in sourceAjustObj[type]) { @@ -1432,6 +1435,7 @@ const styleVar = computed(() => { /* 矩形 */ } .box { + cursor: pointer; display: flex; align-items: center; justify-content: space-evenly; diff --git a/src/views/pages/homePage/runListenPage.vue b/src/views/pages/homePage/runListenPage.vue index fadc2db..acb1de8 100644 --- a/src/views/pages/homePage/runListenPage.vue +++ b/src/views/pages/homePage/runListenPage.vue @@ -393,7 +393,7 @@ - +