diff --git a/public/bimBase.html b/public/bimBase.html index e4626aab..de4633a9 100644 --- a/public/bimBase.html +++ b/public/bimBase.html @@ -91,8 +91,11 @@ // // 往父级传递 // window.parent.postMessage({ msg: dealArr, tip: 'hidden' }); // }); - // 往父级传递 - window.parent.postMessage({ msg: event.nodeIdArray, tip: 'hidden' }); + // 往父级传递 + window.parent.postMessage({ + msg: event.nodeIdArray, + tip: "hidden", + }); } ); // 设置监听事件(主要用于模型树显示) @@ -111,7 +114,10 @@ // window.parent.postMessage({ msg: dealArr, tip: 'hidden' }); // }); // 往父级传递 - window.parent.postMessage({ msg: event.nodeIdArray, tip: 'show' }); + window.parent.postMessage({ + msg: event.nodeIdArray, + tip: "show", + }); } ); } @@ -140,12 +146,12 @@ } // 处理数据 function dealArrData(arr) { - arr.map(item => { - if(item.children && item.children.length > 0){ - dealArrData(item.children) + arr.map((item) => { + if (item.children && item.children.length > 0) { + dealArrData(item.children); } - dealArr.push({dbId: item.dbId}) - }) + dealArr.push({ dbId: item.dbId }); + }); } function renderConfigModel(obvApi) { console.log(obvApi); @@ -161,17 +167,19 @@ // 构件着色 if (configValue.colorArr.length > 0) { configValue.colorArr.map((item) => { - let firstIndex = item.color.indexOf(","); - let secondIndex = item.color.indexOf(",", firstIndex + 1); - let thirdIndex = item.color.indexOf(")", -1); - // 构件着色 - obvApi.setObjectsColor( - [item], - item.color.substring(4, firstIndex), - item.color.substring(firstIndex + 2, secondIndex), - item.color.substring(secondIndex + 2, thirdIndex), - 1 - ); + if (item.modelId) { + let firstIndex = item.color.indexOf(","); + let secondIndex = item.color.indexOf(",", firstIndex + 1); + let thirdIndex = item.color.indexOf(")", -1); + // 构件着色 + obvApi.setObjectsColor( + [item], + item.color.substring(4, firstIndex), + item.color.substring(firstIndex + 2, secondIndex), + item.color.substring(secondIndex + 2, thirdIndex), + 1 + ); + } }); } // else { diff --git a/public/bimBaseProgressModel.html b/public/bimBaseProgressModel.html index 5c06c8c1..808bc964 100644 --- a/public/bimBaseProgressModel.html +++ b/public/bimBaseProgressModel.html @@ -89,10 +89,17 @@ } function renderConfigModel(obvApi) { console.log(obvApi); + console.log(configValue.bimComponent); // 构件着色 if (configValue.bimComponent.length > 0) { // 构件着色 - obvApi.setObjectsColor(configValue.bimComponent, 51, 122, 183, 1); + configValue.bimComponent.map((item) => { + if(item.modelId){ + // 构件着色 + obvApi.setObjectsColor([item], 51, 122, 183, 1); + } + }); + // obvApi.setObjectsColor(configValue.bimComponent, 51, 122, 183, 1); } else { obvApi.restoreObjectsColor(); } diff --git a/src/views/projectFront/BIMBASECenter/overviewTwo.vue b/src/views/projectFront/BIMBASECenter/overviewTwo.vue index 102beba3..de7c237b 100644 --- a/src/views/projectFront/BIMBASECenter/overviewTwo.vue +++ b/src/views/projectFront/BIMBASECenter/overviewTwo.vue @@ -11,7 +11,13 @@ :value="item.value" /> - + 保存 @@ -29,7 +35,7 @@ >保存 --> -
+