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: 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 {

View File

@ -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();
}

View File

@ -11,7 +11,13 @@
:value="item.value"
/>
</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
>
</div>
@ -29,7 +35,7 @@
>保存</el-button
>
</div> -->
<div class="data-show" v-if="formData.type == 2">
<!-- <div class="data-show" v-if="formData.type == 2">
<span>选中的数据值</span>
<div class="selected-box">
<template v-show="selectedColorList.length > 0">
@ -50,7 +56,7 @@
<el-button type="primary" size="small" @click="saveSelected"
>保存</el-button
>
</div>
</div> -->
</div>
<iframe
:src="url"