fix: BUG修改

This commit is contained in:
kun 2024-01-11 17:50:50 +08:00
parent 89970d51c1
commit c56c50eb86
3 changed files with 44 additions and 23 deletions

View File

@ -91,8 +91,11 @@
// // 往父级传递 // // 往父级传递
// window.parent.postMessage({ msg: dealArr, tip: 'hidden' }); // 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: 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) { function dealArrData(arr) {
arr.map(item => { arr.map((item) => {
if(item.children && item.children.length > 0){ if (item.children && item.children.length > 0) {
dealArrData(item.children) dealArrData(item.children);
} }
dealArr.push({dbId: item.dbId}) dealArr.push({ dbId: item.dbId });
}) });
} }
function renderConfigModel(obvApi) { function renderConfigModel(obvApi) {
console.log(obvApi); console.log(obvApi);
@ -161,17 +167,19 @@
// 构件着色 // 构件着色
if (configValue.colorArr.length > 0) { if (configValue.colorArr.length > 0) {
configValue.colorArr.map((item) => { configValue.colorArr.map((item) => {
let firstIndex = item.color.indexOf(","); if (item.modelId) {
let secondIndex = item.color.indexOf(",", firstIndex + 1); let firstIndex = item.color.indexOf(",");
let thirdIndex = item.color.indexOf(")", -1); let secondIndex = item.color.indexOf(",", firstIndex + 1);
// 构件着色 let thirdIndex = item.color.indexOf(")", -1);
obvApi.setObjectsColor( // 构件着色
[item], obvApi.setObjectsColor(
item.color.substring(4, firstIndex), [item],
item.color.substring(firstIndex + 2, secondIndex), item.color.substring(4, firstIndex),
item.color.substring(secondIndex + 2, thirdIndex), item.color.substring(firstIndex + 2, secondIndex),
1 item.color.substring(secondIndex + 2, thirdIndex),
); 1
);
}
}); });
} }
// else { // else {

View File

@ -89,10 +89,17 @@
} }
function renderConfigModel(obvApi) { function renderConfigModel(obvApi) {
console.log(obvApi); console.log(obvApi);
console.log(configValue.bimComponent);
// 构件着色 // 构件着色
if (configValue.bimComponent.length > 0) { 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 { } else {
obvApi.restoreObjectsColor(); obvApi.restoreObjectsColor();
} }

View File

@ -11,7 +11,13 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<el-button type="primary" size="small" @click="saveSelected" v-if="formData.type == 1" style="margin-left: 10px;" <el-color-picker
v-model="formData.color"
v-if="formData.type == 2"
style="margin-left: 10px;"
color-format="rgb"
></el-color-picker>
<el-button type="primary" size="small" @click="saveSelected" style="margin-left: 10px;"
>保存</el-button >保存</el-button
> >
</div> </div>
@ -29,7 +35,7 @@
>保存</el-button >保存</el-button
> >
</div> --> </div> -->
<div class="data-show" v-if="formData.type == 2"> <!-- <div class="data-show" v-if="formData.type == 2">
<span>选中的数据值</span> <span>选中的数据值</span>
<div class="selected-box"> <div class="selected-box">
<template v-show="selectedColorList.length > 0"> <template v-show="selectedColorList.length > 0">
@ -50,7 +56,7 @@
<el-button type="primary" size="small" @click="saveSelected" <el-button type="primary" size="small" @click="saveSelected"
>保存</el-button >保存</el-button
> >
</div> </div> -->
</div> </div>
<iframe <iframe
:src="url" :src="url"