diff --git a/yanzhu-bigscreen/src/views/bim/bim4DTools.js b/yanzhu-bigscreen/src/views/bim/bim4DTools.js index 69ff6c1a..a4d73db6 100644 --- a/yanzhu-bigscreen/src/views/bim/bim4DTools.js +++ b/yanzhu-bigscreen/src/views/bim/bim4DTools.js @@ -1,3 +1,5 @@ +import bimTools from "./bimTools"; + const options = { taskMapping: { progress: "percent", @@ -192,6 +194,7 @@ function initEngine(that) { showAxes: true, // 是否显示XYZ轴线 }; bim4DApi.Plugin.initNavCube(mapOptions); + bimTools.initBimGis(that, bim4DApi) } ); } @@ -231,6 +234,7 @@ function initLoadModel(that) { item.gis = JSON.parse(item.gisJson); addModel(that, item.lightweightName); }); + bimTools.initLoadModel(that, bim4DApi) } }); } @@ -242,7 +246,7 @@ function addModel(that, modelId, cb) { api.Model.add( url, modelId, - () => {}, + () => { }, () => { cb && cb(); console.log("加载模型成功"); @@ -255,11 +259,11 @@ function addModel(that, modelId, cb) { }); } that.modelLoaded = true; - let fnInit=()=>{ - if(that.planLoaded){ - that.initPlay(); - }else{ - setTimeout(fnInit,100); + let fnInit = () => { + if (that.planLoaded) { + that.initPlay(); + } else { + setTimeout(fnInit, 100); } }; fnInit(); @@ -286,7 +290,7 @@ function showBim(that, index) { }); } } - console.log(index,showFeatureIds,currFeatureIds) + console.log(index, showFeatureIds, currFeatureIds) if (showFeatureIds.length > 0) { setFeatueVisible(showFeatureIds, true); } diff --git a/yanzhu-bigscreen/src/views/bim/bimTools.js b/yanzhu-bigscreen/src/views/bim/bimTools.js new file mode 100644 index 00000000..e911b42d --- /dev/null +++ b/yanzhu-bigscreen/src/views/bim/bimTools.js @@ -0,0 +1,94 @@ +function initBimCfg(that) { + if (!that.bimCfg) { + that.bimCfg = {} + } + if (!that.hideParts) { + that.hideParts = []; + } + let config = that.$tryToJson(that.selProject?.bimConfig, {}) + that.bimCfg.background = config.background || '' + that.bimCfg.showGis = config.showGis || false + that.bimCfg.clientApi = config.clientApi || false +} + +function initBimGis(that, api) { + if (that.bimCfg.showGis) { + api.Public.setGisState(true); + api.Public.setTerrainState(false, "http://113.201.2.107:9304/layer.json", false) + api.Public.setGisState(true); + } else if (that.bimCfg.background) { + api.Public.setGisState(false, that.bimCfg.background); + } +} + +function initLoadModel(that, api) { + let fnInit = () => { + if (api.m_model.size > 0) { + setTimeout(() => { + initModelPosition(that, api) + }, 1000) + } else { + setTimeout(fnInit, 1000); + } + } + fnInit(); +} + +function initModelPosition(that, api) { + that.models.forEach(modelInfo => { + if (modelInfo) { + let modelId = modelInfo.lightweightName + let cfg = that.$tryToJson(modelInfo.bimConfig, {}); + let x = cfg?.x || 0; + let y = cfg?.y || 0; + let z = cfg?.z || 0; + let rotateZ = cfg?.rotateZ || 0; + if (x * 1 + y * 1 + z * 1 != 0) { + console.log("移动模型", modelId, x, y, z) + api.Model.moveToPosition([x, y, z], 0, modelId) + } + if (rotateZ * 1 != 0) { + api.Model.rotate(0, 0, rotateZ, modelId) + } + if (cfg && cfg.hideParts) { + cfg.hideParts.forEach(it => { + that.hideParts.push(it); + }) + } + setTimeout(() => { + api.Model.location(modelId); + setTimeout(() => { + that.resetScene(); + }, 1000); + }, 1000); + } + initHideParts(that, api) + }); +} + + +function initHideParts(that, api) { + let hideCnt = 0; + let hideFn = () => { + hideCnt++; + if (hideCnt > 30) { + return; + } + setTimeout(() => { + let featureIds = (that.hideParts || []).map(it => it.featureId); + if (featureIds.length > 0) { + api.Feature.setVisible(featureIds.join("#"), false); + } + hideFn(); + }, 100) + }; + hideFn(); +} + +export default { + initBimCfg, + initBimGis, + initLoadModel, + initModelPosition, + initHideParts +} \ No newline at end of file diff --git a/yanzhu-bigscreen/src/views/bim4DSimulation.vue b/yanzhu-bigscreen/src/views/bim4DSimulation.vue index 33d85439..baa56f3a 100644 --- a/yanzhu-bigscreen/src/views/bim4DSimulation.vue +++ b/yanzhu-bigscreen/src/views/bim4DSimulation.vue @@ -73,6 +73,7 @@ import debounce from "lodash.debounce"; import ganttElastic from "gantt-elastic"; import ganttHeader from "gantt-elastic-header"; import bim4DTools from "./bim/bim4DTools"; +import bimTools from "./bim/bimTools"; export default { components: { @@ -167,6 +168,7 @@ export default { }, initEngine() { this.elId++; + bimTools.initBimCfg(this); setTimeout(() => { bim4DTools.initEngine(this); }, 10); diff --git a/yanzhu-bigscreen/src/views/bimBriefing.vue b/yanzhu-bigscreen/src/views/bimBriefing.vue index 9601d51c..53b6574b 100644 --- a/yanzhu-bigscreen/src/views/bimBriefing.vue +++ b/yanzhu-bigscreen/src/views/bimBriefing.vue @@ -12,19 +12,10 @@ 模型结构树
- +
@@ -119,7 +110,8 @@
{{ item.show ? "隐藏" : "显示" }}
{{ item.id }}
-
+
+
@@ -227,6 +219,8 @@ import debounce from "lodash.debounce"; import { MergeArray, DelArray } from "@/utils/tools"; import briefingTools from "./bim/briefingTools"; import SvgIcon from "@/components/SvgIcon.vue"; +import BimTools from './bim/bimTools' +import bimTools from "./bim/bimTools"; export default { components: { SvgIcon }, name: "BimBriefing", @@ -288,7 +282,7 @@ export default { }); this.hideFeatureIds = []; }) - .catch(() => {}); + .catch(() => { }); }, changeSwitch(item) { let api = bimBriefingApi; @@ -371,10 +365,10 @@ export default { }, doSelectMenu(index) { this.selectMenu = index; - if(index==0){ + if (index == 0) { briefingTools.clearEvent(this); this.showClipping = false; - briefingTools.clearSelectFeature(this); + briefingTools.clearSelectFeature(this); } switch (index) { case 0: @@ -513,6 +507,7 @@ export default { this.viewPoint = []; this.info = []; this.attributeInformation = ""; + bimTools.initBimCfg(this); setTimeout(() => { this.loadEngine(); }, 10); @@ -566,11 +561,12 @@ export default { showAxes: true, // 是否显示XYZ轴线 }; bimBriefingApi.Plugin.initNavCube(mapOptions); + bimTools.initBimGis(this, bimBriefingApi) } ); }, initLoadModel() { - this.$api.bim.getDefaultViewPoint(this.selProject.id, 1).then((d) => { + this.$api.bim.getDefaultViewPoint(this.selProject.id, 1).then((d) => { let pt = ""; if (d.data && d.data.length > 0) { pt = d.data[0].viewPosition; @@ -608,11 +604,12 @@ export default { }, 3000); }); this.treeKey++; + bimTools.initLoadModel(this, bimBriefingApi) } }); this.init(); }, - init() {}, + init() { }, loadModelTree() { this.modelTrees = [ { @@ -675,17 +672,17 @@ export default { }, addModel(modelId, cb) { let url = `${window.config.modelUrl}/Tools/output/model/${modelId}/root.glt`; - let api=bimBriefingApi + let api = bimBriefingApi console.log(modelId, url); api.Model.add( url, modelId, - () => {}, + () => { }, () => { cb && cb(); console.log("加载模型成功"); setTimeout(() => { - if (this.viewPoint) { + if (this.viewPoint) { api.Camera.setViewPort(this.viewPoint); } else { api.Camera.getViewPort((p) => { @@ -715,30 +712,37 @@ export default { .bim-briefing { height: 100%; position: relative; + #bimBriefing { height: 100%; + #bimBriefingContainer { height: 100%; } } + .div-left { top: 10vh; left: 5%; position: absolute; height: 70vh; width: 14%; + &.isHide { left: 0%; wdith: 0%; + #arrowLeft { left: 0px !important; } } + #arrowLeft { top: calc(50% - 50px); right: -21px; left: unset !important; } + .div-row { height: 100%; } @@ -750,45 +754,56 @@ export default { position: absolute; height: 70vh; width: 14%; + &.isHide { right: 0%; width: 0%; } + #arrowRight { top: calc(50% - 50px); left: -21px; } + .div-row { &.r33 { height: 180px; } + &.r66 { height: calc(100% - 180px); } + &.r100 { height: 100%; } } + .clear-all-btn { margin: 10px; } + .hide-list { height: calc(100% - 60px); overflow-y: auto; padding: 0px 10px; + .hide-item { font-size: 12px; display: flex; margin-bottom: 8px; align-items: center; + .hide-item-state { color: #e4e7edcc; } + .hide-item-id { flex-grow: 1; margin: 0px 10px; color: #22d3f4; } + .hide-item-delete { font-size: 20px; color: #48f800; @@ -799,14 +814,17 @@ export default { .data-content { height: 100%; + .div-row { border: solid 1px #75fbfdaa; background-color: #06445b81; + .row-title { background: linear-gradient(0deg, #105696, #c0dafb00, #1765ae); padding-left: 10px; height: 36px; line-height: 36px; + .svg-icon { fill: #75fbfd; } @@ -822,23 +840,28 @@ export default { display: flex; background: #00000080; border-radius: 10px; + .tool-item { display: flex; flex-flow: column; padding: 10px; align-items: center; cursor: pointer; + &.is-selected { .icon { background: #097fca94; + .svg-icon { fill: #75fbfd; } } + .sp-text { color: #75fbfd; } } + .icon { width: 30px; height: 30px; @@ -847,11 +870,13 @@ export default { justify-content: center; align-items: center; border-radius: 15px; + .svg-icon { width: 20px; height: 20px; } } + .sp-text { margin-top: 4px; font-size: 12px; @@ -862,21 +887,26 @@ export default { .model-tree { height: calc(100% - 36px); overflow-y: auto; + .el-tree { background: transparent; color: #eee; + .el-checkbox { color: #45fdfe; } + .el-tree-node { &:focus { - & > .el-tree-node__content { + &>.el-tree-node__content { background: #3489d966; + &:hover { background: #3489d966; } } } + .el-tree-node__content:hover { background: #3489d966; } @@ -888,19 +918,24 @@ export default { height: calc(100% - 46px); overflow-y: auto; padding-bottom: 10px; + .model-property-nav { text-align: left; margin: 8px; } + .model-property-list { padding: 0px 10px; } + .info-list { padding: 10px; } } + .model-progress { padding: 10px; + .el-progress-bar { .el-progress-bar__innerText { color: #fff !important; @@ -915,17 +950,22 @@ export default { text-align: center; color: #edffff85; } + .group-info { padding: 4px 0px; + .svg-icon { fill: #45fdfe; } + span { font-size: 14px; } } + .my-table { border-collapse: collapse; + td, th { border: solid 1px #0e0f0f88; @@ -934,19 +974,23 @@ export default { font-size: 12px; text-align: left; } + th { color: #22d3f4; } } + @media (min-width: 2561px) { .data-content { .div-row { &.r33 { height: 210px; } + &.r66 { height: calc(100% - 210px); } + .row-title { height: 48px; line-height: 48px; @@ -954,36 +998,45 @@ export default { } } } + .div-right { .clear-all-btn { font-size: 20px; margin: 12px; } + .hide-list { height: calc(100% - 80px); + .hide-item { font-size: 20px; margin-bottom: 12px; + .hide-item-delete { font-size: 24px; } } } } + .div-tools { margin-left: -300px; border-radius: 10px; + .tool-item { padding: 10px 20px; + .icon { width: 60px; height: 60px; border-radius: 30px; + .svg-icon { width: 40px; height: 40px; } } + .sp-text { margin-top: 10px; font-size: 24px; @@ -994,18 +1047,23 @@ export default { .model-tree { .el-tree { font-size: 24px; + .el-tree-node__content { height: 36px; } + .el-tree-node__expand-icon { font-size: 24px; } + .el-checkbox { font-size: 24px; } + .el-tree-node__label { font-size: 24px; } + .el-tree__empty-text { font-size: 24px; } @@ -1017,6 +1075,7 @@ export default { width: 30px; height: 30px; } + span { font-size: 20px; position: relative; @@ -1025,6 +1084,7 @@ export default { } .my-table { + td, th { font-size: 20px; diff --git a/yanzhu-bigscreen/src/views/bimManage.vue b/yanzhu-bigscreen/src/views/bimManage.vue index 28e03372..f86c848e 100644 --- a/yanzhu-bigscreen/src/views/bimManage.vue +++ b/yanzhu-bigscreen/src/views/bimManage.vue @@ -393,7 +393,7 @@ export default { showGis: false, clientApi: false, }, - hideParts: [] + hideParts: [],//后台配置的隐藏 }; }, beforeDestroy() { diff --git a/yanzhu-bigscreen/src/views/bimRoaming.vue b/yanzhu-bigscreen/src/views/bimRoaming.vue index 958cb5f8..b30b24e8 100644 --- a/yanzhu-bigscreen/src/views/bimRoaming.vue +++ b/yanzhu-bigscreen/src/views/bimRoaming.vue @@ -12,20 +12,11 @@ 模型结构树
- +
@@ -43,7 +34,8 @@
暂无数据
-
+
{{ item.name }} @@ -72,7 +64,9 @@
暂无数据
-
+
@@ -102,6 +96,7 @@