From 7451283d1346ba2bb170f756db4396a54d0d5991 Mon Sep 17 00:00:00 2001 From: "lj7788@126.com" Date: Fri, 25 Jul 2025 10:56:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/manage/plan/bimSelectTools3.js | 5 +- .../views/manage/plan/bimSelectionDialog3.vue | 189 ++++++++---------- .../src/views/manage/plan/index.vue | 7 + 3 files changed, 89 insertions(+), 112 deletions(-) diff --git a/yanzhu-ui-vue3/src/views/manage/plan/bimSelectTools3.js b/yanzhu-ui-vue3/src/views/manage/plan/bimSelectTools3.js index 9440a431..5e6a53d0 100644 --- a/yanzhu-ui-vue3/src/views/manage/plan/bimSelectTools3.js +++ b/yanzhu-ui-vue3/src/views/manage/plan/bimSelectTools3.js @@ -124,7 +124,8 @@ function initBim(that) { if (that.plan) { planId = that.plan.id; } - let tmps = that.allBimData.filter((it) => it.id == planId); + //let tmps = [that.plan]//that.allBimData.filter((it) => it.id == planId); + let tmps =that.allBimData.filter((it) => it.id == planId); if (tmps.length > 0) { tmps[0].bim.forEach((it) => { if ( @@ -516,7 +517,7 @@ function makePlanTree(that) { datas.forEach((data) => { data.checked = false; data.bim = that.$tryToJson(data.bimId || "[]", []); - data.hasBim = data.bim && data.bim.length > 0; + data.hasBim = data.bimId && data.bimId.length > 0; data.children = that.planList.filter((it) => it.parentId == data.taskId); func(data.children); }); diff --git a/yanzhu-ui-vue3/src/views/manage/plan/bimSelectionDialog3.vue b/yanzhu-ui-vue3/src/views/manage/plan/bimSelectionDialog3.vue index d6de02ff..12874ff5 100644 --- a/yanzhu-ui-vue3/src/views/manage/plan/bimSelectionDialog3.vue +++ b/yanzhu-ui-vue3/src/views/manage/plan/bimSelectionDialog3.vue @@ -1,47 +1,24 @@ @@ -207,10 +131,12 @@ import { listBimModel } from "@/api/bim/bimModel"; import bimTools from "./bimSelectTools3"; import { updateBimInfo, - getPlanAllBimInfo, getDefaultViewPoint, } from "@/api/bim/bim"; -import { ElMessage, ElMessageBox, ElStep } from "element-plus"; +import { + getPlan,listPlan +} from "@/api/manage/plan"; +import { ElMessage } from "element-plus"; export default { data() { return { @@ -266,8 +192,19 @@ export default { this.planList.forEach((it) => { it.checked = it == data; }); - this.plan = data; - bimTools.showPlanFeatchure(this); + if (!data.hasLoadBim) { + getPlan(data.id).then((response) => { + data.bimId = response.data.bimId; + data.bim = this.$tryToJson(data.bimId || "[]", []); + data.hasBim = data.bim && data.bim.length > 0; + data.hadLoadBim = true; + this.plan = data; + bimTools.showPlanFeatchure(this); + }); + } else { + this.plan = data; + bimTools.showPlanFeatchure(this); + } }, loadNode(node, resolve) { bimTools.loadNode(this, node, resolve); @@ -325,7 +262,7 @@ export default { if (res.success) { this.plan.bimId = text; this.plan.bim = this.$tryToJson(text || "[]", []); - this.plan.hasBim = this.plan && this.plan.bim.length > 0; + this.plan.hasBim = text && text.length > 0; ElMessage.success("保存成功"); bimTools.showPlanFeatchure(this); this.$emit("success"); @@ -397,9 +334,26 @@ export default { this.loadedModelCount = 0; bimTools.makePlanTree(this); - this.allBimData = this.planList.filter((d) => d.hasBim); + //this.allBimData = this.planList.filter((d) => d.hasBim); + this.loadAllBimData(); this.initEngine(); }, + loadAllBimData() { + let postData={ + projectId: this.currentPrjId, + pageNum:1, + pageSize:10000 + }; + listPlan(postData).then((d) => { + let tmps = (d.data || []).filter(it=>it.bmId).map(it=>{ + it.bim=this.$tryToJson(it.bimId||"[]",[]); + it.hasBim=it.bim && it.bim.length>0; + return it; + }); + this.allBimData=tmps.filter(item=>item.hasBim); + this.$message.info("数据准备就绪!"); + }); + }, initEngine() { this.elId++; setTimeout(() => { @@ -503,7 +457,7 @@ export default { api.Model.add( url, modelId, - () => {}, + () => { }, () => { cb && cb(); console.log("加载模型成功"); @@ -568,18 +522,23 @@ export default { &.plan-list { left: unset; right: 96px; + &.plan-hide { height: 40px; + .plan-tree-icon { right: 5px; top: 5px; } + .plan-info { color: #fff; line-height: 40px; padding-left: 20px; + .bind-bim { color: #2cff00; + &.has-bim { color: #edfd06; font-weight: bold; @@ -587,12 +546,14 @@ export default { } } } + .plan-tree-icon { position: absolute; right: 10px; top: 10px; z-index: 999; cursor: pointer; + .svg-icon { width: 30px; height: 30px; @@ -622,6 +583,7 @@ export default { } .el-tabs__nav-wrap { + .el-tabs__nav-prev, .el-tabs__nav-next { display: none; @@ -735,9 +697,11 @@ export default { .plan-tree { height: calc(100% - 0px); } + .model-tree { height: calc(100% - 36px); } + .model-tree, .plan-tree { overflow-y: auto; @@ -749,28 +713,33 @@ export default { .el-checkbox { color: #45fdfe; } + .custom-tree-node { cursor: pointer; } + .bind-bim { cursor: pointer; font-size: 12px; color: #2cff00; + &.has-bim { color: #edfd06; font-weight: bold; } + .svg-icon { color: #45fdfe; } } + .el-text { color: #fff; } .el-tree-node { &:focus { - & > .el-tree-node__content { + &>.el-tree-node__content { background: #3489d966; &:hover { diff --git a/yanzhu-ui-vue3/src/views/manage/plan/index.vue b/yanzhu-ui-vue3/src/views/manage/plan/index.vue index 2f33067c..5dc947be 100644 --- a/yanzhu-ui-vue3/src/views/manage/plan/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/plan/index.vue @@ -196,9 +196,16 @@ function getList() { } function handleBim(row) { + if(row.hasLoadBim){ + bimDlg.value.showDialog(row, data.planAll); + return; + } loading.value = true; getPlan(row.id).then((response) => { row.bimId = response.data.bimId; + row.hadLoadBim=true; + row.bim = this.$tryToJson(row.bimId || "[]", []); + row.hasBim =row.bimId && row.bimId.length > 0; loading.value = false; bimDlg.value.showDialog(row, data.planAll); });