fix: BUG修改

This commit is contained in:
kun 2023-12-11 10:59:39 +08:00
parent c96d56b4c6
commit 3caa9a8bd1

View File

@ -11,7 +11,11 @@
}
</style>
<body>
<div id="viewer" style="width: 100%; height: 95vh" class="my-obv-viewer"></div>
<div
id="viewer"
style="width: 100%; height: 95vh"
class="my-obv-viewer"
></div>
<script
src="https://api.cloud.pkpm.cn/bimviewer/viewer/v5/obv.js"
type="text/javascript"
@ -75,24 +79,26 @@
);
// 监听相机改变
obvApi.addEventListener(OBV.ViewerEventTypes.V3dCameraChangeEvent, (event) => {
console.log('V3dCameraChangeEvent', event);
obvApi.addEventListener(
OBV.ViewerEventTypes.V3dCameraChangeEvent,
(event) => {
console.log("V3dCameraChangeEvent", event);
// 操作模型
renderConfigModel(obvApi);
});
}
);
}
function renderConfigModel(obvApi) {
console.log(obvApi);
console.log(configValue.hideArr);
let arr = [{"modelId":1,"dbId":6103}]
// 隐藏构件
if(configValue.hideArr.length > 0){
if (configValue.hideArr.length > 0) {
obvApi.hide(configValue.hideArr);
} else {
obvApi.showAll();
}
// 构件着色
if(configValue.colorArr.length > 0){
if (configValue.colorArr.length > 0) {
configValue.colorArr.map((item) => {
let firstIndex = item.color.indexOf(",");
let secondIndex = item.color.indexOf(",", firstIndex + 1);