From fdafdcd16e7ac17c0c9f16ca7a53ce44c1bb640d Mon Sep 17 00:00:00 2001 From: "lj7788@126.com" Date: Tue, 8 Jul 2025 19:30:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=A2=E8=B1=A1=E8=BF=9B=E5=BA=A6=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yanzhu-bigscreen/src/api/planSchedule.js | 11 +- .../src/assets/icons/svg/city.svg | 2 +- yanzhu-bigscreen/src/views/bimManage.vue | 180 +++++++++++++- yanzhu-bigscreen/vue.config.js | 7 + .../yanzhu/manage/mapper/ProPlanMapper.java | 5 + .../resources/mapper/manage/ProPlanMapper.xml | 21 ++ .../manage/controller/ProPlanController.java | 10 + .../manage/service/IProPlanService.java | 5 + .../service/impl/ProPlanServiceImpl.java | 10 +- .../src/views/manage/schedule/index.vue | 220 ++++-------------- .../src/views/trouble/problemmodify/index.vue | 4 +- .../trouble/problemmodifyQuality/index.vue | 4 +- 12 files changed, 288 insertions(+), 191 deletions(-) diff --git a/yanzhu-bigscreen/src/api/planSchedule.js b/yanzhu-bigscreen/src/api/planSchedule.js index 5307cb0f..e28eeb8e 100644 --- a/yanzhu-bigscreen/src/api/planSchedule.js +++ b/yanzhu-bigscreen/src/api/planSchedule.js @@ -17,7 +17,16 @@ const findAllSchedule = (data) => { }); }; +//查询计划进度 +const findPlanProgress=projectId=>{ + return request({ + url: `/manage/plan/findPlanProgress/${projectId}`, + method: "get", + }); +} + export default { findAllPlanDatas, - findAllSchedule + findAllSchedule, + findPlanProgress }; diff --git a/yanzhu-bigscreen/src/assets/icons/svg/city.svg b/yanzhu-bigscreen/src/assets/icons/svg/city.svg index 6e184d60..4cc7575e 100644 --- a/yanzhu-bigscreen/src/assets/icons/svg/city.svg +++ b/yanzhu-bigscreen/src/assets/icons/svg/city.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/yanzhu-bigscreen/src/views/bimManage.vue b/yanzhu-bigscreen/src/views/bimManage.vue index 16c1d311..89065819 100644 --- a/yanzhu-bigscreen/src/views/bimManage.vue +++ b/yanzhu-bigscreen/src/views/bimManage.vue @@ -190,6 +190,17 @@ +
+
+ + 形象进度 +
+ +
+ + 整体模型 +
+
@@ -223,6 +234,25 @@ 电箱监控
+
+
+ + 提前完工 +
+
+ + 正常完工 +
+
+ + 延迟完工 +
+
+ + 正在施工 +
+ +
@@ -346,6 +376,9 @@ export default { power: false, //电箱监控 }, menuShowCount: 0, + isClient: false, + modelLoadSuccess: false, //模型加载成功 + mode: "model", //显示模式 model-整体模型 plan-形象进度 }; }, beforeDestroy() { @@ -722,7 +755,8 @@ export default { this.elId++; this.activeMenu = 0; setTimeout(() => { - if (localStorage.getItem("BimClient")) { + this.isClient = localStorage.getItem("BimClient"); + if (this.isClient) { this.loadEngine2(); } else { this.loadEngine(); @@ -827,7 +861,13 @@ export default { projectId: this.selProject.id, }) .then((d) => { - this.models = d.rows || []; + this.models = (d.rows || []).map((it) => { + it.modelId = it.lightweightName; + it.visible = false; + it.checked = true; + it.gis = this.$tryToJson(it.gisJson || "{}", {}); + return it; + }); if (this.models.length == 0) { this.$message.error("暂无模型,请先关联模型"); } else { @@ -839,6 +879,9 @@ export default { }, addModel(modelId, cb) { let url = `${window.config.modelUrl}/Tools/output/model/${modelId}/root.glt`; + if (this.isClient) { + url = `/bimdata/Tools/output/model/${modelId}/root.glt`; + } let api = bimMgrApi; console.log(modelId, url); api.Model.add( @@ -850,17 +893,85 @@ export default { console.log("加载模型成功"); this.loadDevicePosition(); setTimeout(() => { - if (this.viewPoint) { - api.Camera.setViewPort(this.viewPoint); + if (this.isClient) { } else { - api.Camera.getViewPort((p) => { - this.viewPoint = p; - }); + if (this.viewPoint) { + api.Camera.setViewPort(this.viewPoint); + } else { + api.Camera.getViewPort((p) => { + this.viewPoint = p; + }); + } } + this.modelLoadSuccess = true; }, 1000); } ); }, + changeMode(mode) { + if (!this.modelLoadSuccess) { + this.$message.error("模型加载中,请稍后"); + return; + } + if (mode == this.mode) { + return; + } + this.mode = mode; + let api = bimMgrApi; + if (mode == "model") { + this.models.forEach((it) => { + api.Model.original(it.lightweightName); + api.Model.setAlpha(it.lightweightName,1); + }); + this.resetScene(); + } else { + this.$api.planSchedule.findPlanProgress(this.selProject.id).then((d) => { + let datas = d.data || []; + let beforeData = []; //提前完工 + let afterData = []; //延迟完工 + let processData = []; //进行中 + let standData = []; //正常完工 + let allData = []; + datas.forEach((it) => { + let planFinishDate = it.planFinishDate; + let finishDate = it.finishDate; + it.bim = this.$tryToJson(it.bimId, []); + if (finishDate == "2000-01-01") { + it.bim.forEach((item) => { + processData.push(item); + allData.push(item); + }); + } else if (planFinishDate == finishDate) { + it.bim.forEach((item) => { + standData.push(item); + allData.push(item); + }); + } else if (this.$dt(planFinishDate) < this.$dt(finishDate)) { + it.bim.forEach((item) => { + afterData.push(item); + allData.push(item); + }); + } else { + it.bim.forEach((item) => { + beforeData.push(item); + allData.push(item); + }); + } + }); + //console.log("====>",beforeData,afterData,processData,standData); + if (allData.length > 0) { + allData=allData.map(item=>item.featureId); + this.models.forEach(model=>{ + api.Model.setAlpha(model.lightweightName,0.5); + }); + api.Feature.setColor(beforeData.map((it) => it.featureId).join("#"), "rgba(59, 255, 0,1)"); + api.Feature.setColor(standData.map((it) => it.featureId).join("#"), "rgba(255,255,255,1)"); + api.Feature.setColor(processData.map((it) => it.featureId).join("#"), "rgba(0,0, 255,1)"); + api.Feature.setColor(afterData.map((it) => it.featureId).join("#"), "rgba(250, 0, 0,1)"); + } + }); + } + }, resetScene() { bimMgrApi.Camera.stopImmersiveRoam(); bimMgrApi.Model.location(bimMgrApi.m_model.keys().toArray()[0]); @@ -1087,6 +1198,61 @@ export default { } } } + .div-mode { + position: absolute; + top: calc(80vh - 110px); + left: 50%; + display: flex; + padding: 10px 0px; + background: #00000080; + border-radius: 10px; + margin-left: -125px; + .mode-item { + display: flex; + align-items: center; + font-size: 14px; + line-height: 30px; + margin: 0px 10px; + background: #05798754; + padding: 0px 10px; + border-radius: 13px; + cursor: pointer; + &.is-active { + background: #097fca94; + color: #75fbfd; + border: solid 1px #75fbfd; + .svg-icon { + fill: #75fbfd; + } + } + .svg-icon { + width: 24px; + height: 24px; + margin-right: 4px; + } + } + } + .plan-chart{ + position: absolute; + top: calc(80vh - 110px); + right: 40px; + &.isShow{ + right:calc(20% + 140px); + } + .plan-item{ + display: flex; + font-size:12px; + margin-bottom: 10px; + span{ + display:block; + &:first-child{ + width:15px; + height:15px; + margin-right:4px; + } + } + } + } .div-tools { position: absolute; top: calc(80vh - 50px); diff --git a/yanzhu-bigscreen/vue.config.js b/yanzhu-bigscreen/vue.config.js index 24a28b42..459251f9 100644 --- a/yanzhu-bigscreen/vue.config.js +++ b/yanzhu-bigscreen/vue.config.js @@ -46,6 +46,13 @@ module.exports = defineConfig({ "^/cesium": "/", }, }, + "/bimdata": { + target: `http://62.234.3.186/bimdata/`, + changeOrigin: true, + pathRewrite: { + "^/bimdata": "/", + }, + }, "/cdn": { target: `http://62.234.3.186/cdn/`, changeOrigin: true, diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProPlanMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProPlanMapper.java index f968fe7c..1e2f53a0 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProPlanMapper.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProPlanMapper.java @@ -135,4 +135,9 @@ public interface ProPlanMapper * 查询计划任务数据 */ public List findAllPlanDatasByProId(Long proId); + + /** + * 查询计划进度 + */ + public List findPlanProgress(Long proId); } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProPlanMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProPlanMapper.xml index 235adaa0..ecfcd361 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProPlanMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProPlanMapper.xml @@ -303,6 +303,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +