修改计划绑定
parent
1a947a0457
commit
dc068003f7
|
@ -1,5 +1,11 @@
|
||||||
import { modelTreeAllChild } from "@/api/bim/bim";
|
import { modelTreeAllChild } from "@/api/bim/bim";
|
||||||
import { getModelTree, getTreeAllLeafChild, getModelFeatureInfo, getModelFeatureInfos, modelTreeAllLeafChildByGlids } from "@/api/bim/bimModel";
|
import {
|
||||||
|
getModelTree,
|
||||||
|
getTreeAllLeafChild,
|
||||||
|
getModelFeatureInfo,
|
||||||
|
getModelFeatureInfos,
|
||||||
|
modelTreeAllLeafChildByGlids,
|
||||||
|
} from "@/api/bim/bimModel";
|
||||||
import { MergeArray, DelArray } from "@/utils/index";
|
import { MergeArray, DelArray } from "@/utils/index";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
function selectFeature(that, featureId) {
|
function selectFeature(that, featureId) {
|
||||||
|
@ -123,56 +129,62 @@ function initBim(that) {
|
||||||
let tmps = that.allBimData.filter((it) => it.id == that.plan.id);
|
let tmps = that.allBimData.filter((it) => it.id == that.plan.id);
|
||||||
if (tmps.length > 0) {
|
if (tmps.length > 0) {
|
||||||
tmps[0].bim.forEach((it) => {
|
tmps[0].bim.forEach((it) => {
|
||||||
if (that.allFeatures.filter((f) => f.featureId == it.featureId).length == 0) {
|
if (
|
||||||
|
that.allFeatures.filter((f) => f.featureId == it.featureId).length == 0
|
||||||
|
) {
|
||||||
that.allFeatures.push(it);
|
that.allFeatures.push(it);
|
||||||
}
|
}
|
||||||
selectFeature(that, it.featureId);
|
selectFeature(that, it.featureId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
tmps = that.allBimData.filter((it) => it.id != that.plan.id);
|
tmps = that.allBimData.filter((it) => it.id != that.plan.id);
|
||||||
tmps.forEach((it) => {
|
// 合并that.readlyParts和tmps中的featureId并去重
|
||||||
it.bim.forEach((it) => {
|
const tmpsFeatureIds = tmps.flatMap((item) =>
|
||||||
if (that.readlyParts.filter((f) => f.featureId == it.featureId).length == 0) {
|
item.bim.map((b) => b.featureId)
|
||||||
that.readlyParts.push(it.featureId);
|
);
|
||||||
}
|
that.readlyParts = [...new Set([...that.readlyParts, ...tmpsFeatureIds])];
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSelectFeatureIds(that) {
|
function getSelectFeatureIds(that) {
|
||||||
let tmps = that.allBimData.filter((it) => it.id == that.plan.id);
|
let tmps = that.allBimData.filter((it) => it.id == that.plan.id);
|
||||||
if (tmps.length > 0) {
|
if (tmps.length > 0) {
|
||||||
return tmps[0].bim || [];
|
return (tmps[0].bim || []).map((it) => it.featureId);
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
function addAllModels(that, cb) {
|
function addAllModels(that, cb) {
|
||||||
let api = bimSelectionDlgApi;
|
let api = bimSelectionDlgApi;
|
||||||
loadModels(that);
|
loadModels(that);
|
||||||
setTimeout(() => {
|
let func = () => {
|
||||||
that.models.forEach(model => {
|
if (that.loadedModelCount == that.models.length) {
|
||||||
api.Model.setVisible(model.modelId, true);
|
|
||||||
api.Model.original(model.modelId);
|
|
||||||
that.$refs.tree.setChecked(model.modelId, true, true)
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
cb && cb();
|
that.models.forEach((model) => {
|
||||||
}, 400)
|
api.Model.setVisible(model.modelId, true);
|
||||||
});
|
api.Model.original(model.modelId);
|
||||||
}, 1000)
|
that.$refs.tree.setChecked(model.modelId, true, true);
|
||||||
|
setTimeout(() => {
|
||||||
|
cb && cb();
|
||||||
|
}, 400);
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
setTimeout(func, 100);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
func();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载部分模型(计划中绑定的模型)
|
// 加载部分模型(计划中绑定的模型)
|
||||||
function partLoadModel(that) {
|
function partLoadModel(that) {
|
||||||
let featureIds = getSelectFeatureIds(that);
|
|
||||||
let api = bimSelectionDlgApi;
|
let api = bimSelectionDlgApi;
|
||||||
addAllModels(that, () => {
|
addAllModels(that, () => {
|
||||||
|
let featureIds = getSelectFeatureIds(that);
|
||||||
if (featureIds.length > 0) {
|
if (featureIds.length > 0) {
|
||||||
let tmps=featureIds.map(it=>it);
|
let tmps = featureIds.map((it) => it);
|
||||||
let tmpsIds2 = tmps.splice(0, 1000);
|
let tmpsIds2 = tmps.splice(0, 500);
|
||||||
api.Feature.showFeatures(tmpsIds2.join("#"));
|
api.Feature.showFeatures(tmpsIds2.join("#"));
|
||||||
setFeatueVisible(tmps, true);
|
setFeatueVisible(tmps, true);
|
||||||
initBim(that)
|
initBim(that);
|
||||||
api.Feature.setColor(featureIds.join("#"), "rgba(255,0,255,1)");
|
api.Feature.setColor(featureIds.join("#"), "rgba(255,0,255,1)");
|
||||||
that.$message.info("模型加载完成");
|
that.$message.info("模型加载完成");
|
||||||
that.bimLoaded = true;
|
that.bimLoaded = true;
|
||||||
|
@ -191,74 +203,7 @@ function partLoadModel(that) {
|
||||||
};
|
};
|
||||||
func();
|
func();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
|
||||||
// 加载部分模型(计划中绑定的模型)
|
|
||||||
function partLoadModelxxx(that) {
|
|
||||||
let featureInfos = getSelectFeatureIds(that);
|
|
||||||
let api = bimSelectionDlgApi;
|
|
||||||
let obj = {};
|
|
||||||
for (let i = 0; i < featureInfos.length; i++) {
|
|
||||||
let it = featureInfos[i].featureId;
|
|
||||||
let tmps = it.split("^");
|
|
||||||
let modelId = tmps[0];
|
|
||||||
if (!obj[modelId]) {
|
|
||||||
obj[modelId] = [];
|
|
||||||
}
|
|
||||||
obj[modelId].push(it);
|
|
||||||
}
|
|
||||||
for (let modelId in obj) {
|
|
||||||
let tmps = that.models.filter((it) => it.modelId == modelId);
|
|
||||||
setTimeout(() => {
|
|
||||||
that.$refs.tree.setChecked(modelId, true, true);
|
|
||||||
}, 3000);
|
|
||||||
if (tmps.length > 0) {
|
|
||||||
let url = `${window.config.modelUrl}/Tools/output/model/${modelId}/root.glt`;
|
|
||||||
that.partLoad = true;
|
|
||||||
api.Model.addPart(
|
|
||||||
url,
|
|
||||||
modelId,
|
|
||||||
obj[modelId].join("#"),
|
|
||||||
(res) => { },
|
|
||||||
(res) => {
|
|
||||||
setTimeout(() => {
|
|
||||||
if (that.viewPoint) {
|
|
||||||
api.Camera.setViewPort(that.viewPoint);
|
|
||||||
} else {
|
|
||||||
api.Camera.getViewPort((p) => {
|
|
||||||
that.viewPoint = p;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
that.$message.info("模型加载完成");
|
|
||||||
that.bimLoaded = true;
|
|
||||||
that.doMenu(2);
|
|
||||||
initBim(that);
|
|
||||||
},
|
|
||||||
{
|
|
||||||
FlyTo: true,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (featureInfos.length == 0) {
|
|
||||||
setTimeout(() => {
|
|
||||||
that.$refs.tree.setChecked("root", true, true);
|
|
||||||
}, 3000);
|
|
||||||
|
|
||||||
loadModels(that);
|
|
||||||
initBim(that);
|
|
||||||
let func = () => {
|
|
||||||
if (that.loadedModelCount == that.models.length) {
|
|
||||||
setTimeout(() => {
|
|
||||||
setFeatueShowOrHide(that, []);
|
|
||||||
}, 1000);
|
|
||||||
} else {
|
|
||||||
setTimeout(func, 100);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
func();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//构建树形数据
|
//构建树形数据
|
||||||
|
@ -343,7 +288,10 @@ async function setTreeNodeChecked(that, node, event) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let isPartLoad = false;
|
let isPartLoad = false;
|
||||||
if (!that.models.find((d) => d.modelId == node.modelId).visible && checked) {
|
if (
|
||||||
|
!that.models.find((d) => d.modelId == node.modelId).visible &&
|
||||||
|
checked
|
||||||
|
) {
|
||||||
isPartLoad = true;
|
isPartLoad = true;
|
||||||
}
|
}
|
||||||
let selFeatureIds = [];
|
let selFeatureIds = [];
|
||||||
|
@ -447,9 +395,12 @@ function loadModels(that) {
|
||||||
that.loadedModelCount = 0;
|
that.loadedModelCount = 0;
|
||||||
modelIds.forEach((modelId) => {
|
modelIds.forEach((modelId) => {
|
||||||
if (!api.m_model.has(modelId)) {
|
if (!api.m_model.has(modelId)) {
|
||||||
cnt++;
|
that.addModel(modelId, () => {
|
||||||
that.addModel(modelId);
|
cnt++;
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
that.loadedModelCount++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return cnt;
|
return cnt;
|
||||||
|
@ -505,7 +456,9 @@ function loadNode(that, node, resolve) {
|
||||||
|
|
||||||
resolve(nd);
|
resolve(nd);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.querySelectorAll(".bim-selection-dialog .model-tree .el-tree-node")[0].click();
|
document
|
||||||
|
.querySelectorAll(".bim-selection-dialog .model-tree .el-tree-node")[0]
|
||||||
|
.click();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else if (node.level == 1) {
|
} else if (node.level == 1) {
|
||||||
let nd = [];
|
let nd = [];
|
||||||
|
@ -535,14 +488,20 @@ function getTreeChildren(that, node, resolve) {
|
||||||
getModelTree(data.modelId, data.glid).then((d) => {
|
getModelTree(data.modelId, data.glid).then((d) => {
|
||||||
let tmps = (d.data || []).map((it) => {
|
let tmps = (d.data || []).map((it) => {
|
||||||
let title = it.externalId == 0 ? it.name : it.externalId;
|
let title = it.externalId == 0 ? it.name : it.externalId;
|
||||||
title = title.replaceAll('"', "").replaceAll("'", "").replaceAll("\\", "");
|
title = title
|
||||||
|
.replaceAll('"', "")
|
||||||
|
.replaceAll("'", "")
|
||||||
|
.replaceAll("\\", "");
|
||||||
it.title = title;
|
it.title = title;
|
||||||
it.key = it.glid;
|
it.key = it.glid;
|
||||||
it.modelId = data.modelId;
|
it.modelId = data.modelId;
|
||||||
it.type = "data";
|
it.type = "data";
|
||||||
it.leaf = +it.externalId != 0;
|
it.leaf = +it.externalId != 0;
|
||||||
let o = convertFeatureInfo(it, data.modelId);
|
let o = convertFeatureInfo(it, data.modelId);
|
||||||
if (that.allFeatures.filter((item) => item.featureId == it.featureId).length == 0) {
|
if (
|
||||||
|
that.allFeatures.filter((item) => item.featureId == it.featureId)
|
||||||
|
.length == 0
|
||||||
|
) {
|
||||||
that.allFeatures.push({
|
that.allFeatures.push({
|
||||||
featureId: it.featureId,
|
featureId: it.featureId,
|
||||||
info: it.info,
|
info: it.info,
|
||||||
|
@ -602,7 +561,11 @@ async function selectTreeData(that) {
|
||||||
featureId: o.featureId,
|
featureId: o.featureId,
|
||||||
info: o.info,
|
info: o.info,
|
||||||
});
|
});
|
||||||
if (!that.selectItems.find((it) => it.featureId == o.featureId) && !that.readlyParts.includes(o.featureId) && !that.hideParts.includes(o.featureId)) {
|
if (
|
||||||
|
!that.selectItems.find((it) => it.featureId == o.featureId) &&
|
||||||
|
!that.readlyParts.includes(o.featureId) &&
|
||||||
|
!that.hideParts.includes(o.featureId)
|
||||||
|
) {
|
||||||
that.selectItems.push(o);
|
that.selectItems.push(o);
|
||||||
api.Feature.setColor(o.featureId, "rgba(255,0,255,1)");
|
api.Feature.setColor(o.featureId, "rgba(255,0,255,1)");
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,15 +136,12 @@ function initBim(that) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
tmps = that.allBimData.filter((it) => it.id != that.plan.id);
|
tmps = that.allBimData.filter((it) => it.id != that.plan.id);
|
||||||
tmps.forEach((it) => {
|
|
||||||
it.bim.forEach((it) => {
|
// 合并that.readlyParts和tmps中的featureId并去重
|
||||||
if (
|
const tmpsFeatureIds = tmps.flatMap((item) =>
|
||||||
that.readlyParts.filter((f) => f.featureId == it.featureId).length == 0
|
item.bim.map((b) => b.featureId)
|
||||||
) {
|
);
|
||||||
that.readlyParts.push(it.featureId);
|
that.readlyParts = [...new Set([...that.readlyParts, ...tmpsFeatureIds])];
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//构建树形数据
|
//构建树形数据
|
||||||
|
@ -536,13 +533,13 @@ function resetModel(that, cb) {
|
||||||
that.readlyParts = [];
|
that.readlyParts = [];
|
||||||
that.hideFeatures = [];
|
that.hideFeatures = [];
|
||||||
that.allBimData = that.planList.filter((d) => d.hasBim);
|
that.allBimData = that.planList.filter((d) => d.hasBim);
|
||||||
that.models.forEach(model => {
|
that.models.forEach((model) => {
|
||||||
api.Model.setVisible(model.modelId, true);
|
api.Model.setVisible(model.modelId, true);
|
||||||
api.Model.original(model.modelId);
|
api.Model.original(model.modelId);
|
||||||
that.$refs.tree.setChecked(model.modelId, true, true)
|
that.$refs.tree.setChecked(model.modelId, true, true);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
cb && cb();
|
cb && cb();
|
||||||
}, 1000)
|
}, 1000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,7 +554,7 @@ function showPlanFeatchure(that) {
|
||||||
let tmpsIds2 = featureIds.splice(0, 1000);
|
let tmpsIds2 = featureIds.splice(0, 1000);
|
||||||
api.Feature.showFeatures(tmpsIds2.join("#"));
|
api.Feature.showFeatures(tmpsIds2.join("#"));
|
||||||
setFeatueVisible(featureIds, true);
|
setFeatueVisible(featureIds, true);
|
||||||
initBim(that)
|
initBim(that);
|
||||||
//that.selectItems = that.plan.bim.map((it) => it);
|
//that.selectItems = that.plan.bim.map((it) => it);
|
||||||
|
|
||||||
featureIds = that.plan.bim.map((it) => it.featureId);
|
featureIds = that.plan.bim.map((it) => it.featureId);
|
||||||
|
@ -567,8 +564,8 @@ function showPlanFeatchure(that) {
|
||||||
that.selectItems = [];
|
that.selectItems = [];
|
||||||
//未绑定BIM模型 显示所有可以绑定的构件
|
//未绑定BIM模型 显示所有可以绑定的构件
|
||||||
|
|
||||||
initBim(that)
|
initBim(that);
|
||||||
setFeatueVisible(that.readlyParts, false)
|
setFeatueVisible(that.readlyParts, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -577,7 +574,6 @@ export default {
|
||||||
selectSingle,
|
selectSingle,
|
||||||
initBim,
|
initBim,
|
||||||
clearAllSelection,
|
clearAllSelection,
|
||||||
partLoadModel,
|
|
||||||
buildTreeData,
|
buildTreeData,
|
||||||
onCheckTree,
|
onCheckTree,
|
||||||
boxSelection,
|
boxSelection,
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="show" append-to-body :close-on-click-modal="false" :close-on-press-escape="false" :title="title" modal-class="bim-selection-dialog">
|
<el-dialog
|
||||||
|
v-model="show"
|
||||||
|
append-to-body
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
:title="title"
|
||||||
|
modal-class="bim-selection-dialog"
|
||||||
|
>
|
||||||
<div id="bimSelectionDlg">
|
<div id="bimSelectionDlg">
|
||||||
<div id="bimSelectionDlgContainer" class="bimSelectionDlgContainer"></div>
|
<div id="bimSelectionDlgContainer" class="bimSelectionDlgContainer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,12 +28,17 @@
|
||||||
@check="onCheckTree"
|
@check="onCheckTree"
|
||||||
:load="loadNode"
|
:load="loadNode"
|
||||||
lazy
|
lazy
|
||||||
show-checkbox></el-tree>
|
show-checkbox
|
||||||
|
></el-tree>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="已关联" name="a2">
|
<el-tab-pane label="已关联" name="a2">
|
||||||
<div class="sel-list scroll" :key="selEl">
|
<div class="sel-list scroll" :key="selEl">
|
||||||
<div v-for="(it, idx) in selectItems" :key="idx" class="div-sel-item">
|
<div
|
||||||
|
v-for="(it, idx) in selectItems"
|
||||||
|
:key="idx"
|
||||||
|
class="div-sel-item"
|
||||||
|
>
|
||||||
<el-tooltip placement="bottom" :content="it.info">
|
<el-tooltip placement="bottom" :content="it.info">
|
||||||
<div class="sel-item-info">{{ it.info }}</div>
|
<div class="sel-item-info">{{ it.info }}</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
@ -39,7 +51,11 @@
|
||||||
<el-button @click="delAllDelList">删除所有</el-button>
|
<el-button @click="delAllDelList">删除所有</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="sel-list scroll hide-list" :key="hideEl">
|
<div class="sel-list scroll hide-list" :key="hideEl">
|
||||||
<div v-for="(it, idx) in getSelectItems(hideParts)" :key="idx" class="div-sel-item">
|
<div
|
||||||
|
v-for="(it, idx) in getSelectItems(hideParts)"
|
||||||
|
:key="idx"
|
||||||
|
class="div-sel-item"
|
||||||
|
>
|
||||||
<el-tooltip placement="bottom" :content="it.info">
|
<el-tooltip placement="bottom" :content="it.info">
|
||||||
<div class="sel-item-info">{{ it.info }}</div>
|
<div class="sel-item-info">{{ it.info }}</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
@ -49,40 +65,68 @@
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div class="div-icon">
|
<div class="div-icon">
|
||||||
<el-icon v-show="leftExpend" @click="leftExpend = false"><ArrowUpBold /></el-icon>
|
<el-icon v-show="leftExpend" @click="leftExpend = false"
|
||||||
<el-icon v-show="!leftExpend" @click="leftExpend = true"><ArrowDownBold /></el-icon>
|
><ArrowUpBold
|
||||||
|
/></el-icon>
|
||||||
|
<el-icon v-show="!leftExpend" @click="leftExpend = true"
|
||||||
|
><ArrowDownBold
|
||||||
|
/></el-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="bimLoaded">
|
<div v-show="bimLoaded">
|
||||||
<div class="footer-box" v-if="models.length > 0">
|
<div class="footer-box" v-if="models.length > 0">
|
||||||
<el-tooltip placement="top" content="主视图">
|
<el-tooltip placement="top" content="主视图">
|
||||||
<div class="footer-btn" @click="doMenu(0)" :class="activeMenu == 0 ? 'is-active' : ''">
|
<div
|
||||||
|
class="footer-btn"
|
||||||
|
@click="doMenu(0)"
|
||||||
|
:class="activeMenu == 0 ? 'is-active' : ''"
|
||||||
|
>
|
||||||
<svg-icon icon-class="home" />
|
<svg-icon icon-class="home" />
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip placement="top" content="取消所有关联">
|
<el-tooltip placement="top" content="取消所有关联">
|
||||||
<div class="footer-btn" @click="doMenu(1)" :class="activeMenu == 1 ? 'is-active' : ''">
|
<div
|
||||||
|
class="footer-btn"
|
||||||
|
@click="doMenu(1)"
|
||||||
|
:class="activeMenu == 1 ? 'is-active' : ''"
|
||||||
|
>
|
||||||
<svg-icon icon-class="cancel" />
|
<svg-icon icon-class="cancel" />
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip placement="top" content="点选">
|
<el-tooltip placement="top" content="点选">
|
||||||
<div class="footer-btn" @click="doMenu(2)" :class="activeMenu == 2 ? 'is-active' : ''">
|
<div
|
||||||
|
class="footer-btn"
|
||||||
|
@click="doMenu(2)"
|
||||||
|
:class="activeMenu == 2 ? 'is-active' : ''"
|
||||||
|
>
|
||||||
<svg-icon icon-class="pointselect" />
|
<svg-icon icon-class="pointselect" />
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip placement="top" content="框选">
|
<el-tooltip placement="top" content="框选">
|
||||||
<div class="footer-btn" @click="doMenu(3)" :class="activeMenu == 3 ? 'is-active' : ''">
|
<div
|
||||||
|
class="footer-btn"
|
||||||
|
@click="doMenu(3)"
|
||||||
|
:class="activeMenu == 3 ? 'is-active' : ''"
|
||||||
|
>
|
||||||
<svg-icon icon-class="boundselect" />
|
<svg-icon icon-class="boundselect" />
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip placement="top" content="全选树上所有已选择构件">
|
<el-tooltip placement="top" content="全选树上所有已选择构件">
|
||||||
<div class="footer-btn" @click="doMenu(5)" :class="activeMenu == 5 ? 'is-active' : ''">
|
<div
|
||||||
|
class="footer-btn"
|
||||||
|
@click="doMenu(5)"
|
||||||
|
:class="activeMenu == 5 ? 'is-active' : ''"
|
||||||
|
>
|
||||||
<svg-icon icon-class="skill" />
|
<svg-icon icon-class="skill" />
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip placement="top" content="隐藏构件">
|
<el-tooltip placement="top" content="隐藏构件">
|
||||||
<div class="footer-btn" @click="doMenu(4)" :class="activeMenu == 4 ? 'is-active' : ''">
|
<div
|
||||||
|
class="footer-btn"
|
||||||
|
@click="doMenu(4)"
|
||||||
|
:class="activeMenu == 4 ? 'is-active' : ''"
|
||||||
|
>
|
||||||
<svg-icon icon-class="hide" />
|
<svg-icon icon-class="hide" />
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
@ -90,7 +134,15 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="div-mode">
|
<div class="div-mode">
|
||||||
<el-switch v-model="showMode" class="ml-2" inline-prompt active-text="显示模式" inactive-text="隐藏模式" @change="doModeChange" style="--el-switch-off-color: #336699" />
|
<el-switch
|
||||||
|
v-model="showMode"
|
||||||
|
class="ml-2"
|
||||||
|
inline-prompt
|
||||||
|
active-text="显示模式"
|
||||||
|
inactive-text="隐藏模式"
|
||||||
|
@change="doModeChange"
|
||||||
|
style="--el-switch-off-color: #336699"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
|
@ -104,7 +156,11 @@
|
||||||
import useUserStore from "@/store/modules/user";
|
import useUserStore from "@/store/modules/user";
|
||||||
import { listBimModel } from "@/api/bim/bimModel";
|
import { listBimModel } from "@/api/bim/bimModel";
|
||||||
import bimTools from "./bimSelectTools2";
|
import bimTools from "./bimSelectTools2";
|
||||||
import { updateBimInfo, getPlanAllBimInfo, getDefaultViewPoint } from "@/api/bim/bim";
|
import {
|
||||||
|
updateBimInfo,
|
||||||
|
getPlanAllBimInfo,
|
||||||
|
getDefaultViewPoint,
|
||||||
|
} from "@/api/bim/bim";
|
||||||
import { ElMessage, ElMessageBox, ElStep } from "element-plus";
|
import { ElMessage, ElMessageBox, ElStep } from "element-plus";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
@ -170,7 +226,10 @@ export default {
|
||||||
},
|
},
|
||||||
doModeChange() {
|
doModeChange() {
|
||||||
let api = bimSelectionDlgApi;
|
let api = bimSelectionDlgApi;
|
||||||
api.Feature.setVisible(this.selectItems.map((f) => f.featureId).join("#"), this.showMode);
|
api.Feature.setVisible(
|
||||||
|
this.selectItems.map((f) => f.featureId).join("#"),
|
||||||
|
this.showMode
|
||||||
|
);
|
||||||
},
|
},
|
||||||
delSelectItem(idx) {
|
delSelectItem(idx) {
|
||||||
this.$modal.confirm("确定删除吗?").then(() => {
|
this.$modal.confirm("确定删除吗?").then(() => {
|
||||||
|
@ -192,7 +251,8 @@ export default {
|
||||||
doSave() {
|
doSave() {
|
||||||
updateBimInfo({
|
updateBimInfo({
|
||||||
id: this.plan.id,
|
id: this.plan.id,
|
||||||
text: this.selectItems.length > 0 ? JSON.stringify(this.selectItems) : "",
|
text:
|
||||||
|
this.selectItems.length > 0 ? JSON.stringify(this.selectItems) : "",
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
ElMessage.success("保存成功");
|
ElMessage.success("保存成功");
|
||||||
|
@ -235,8 +295,8 @@ export default {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showDialog(plan) {
|
showDialog(plan, planList) {
|
||||||
window.bimDlg = this;
|
window.bimDlg2 = this;
|
||||||
this.plan = plan;
|
this.plan = plan;
|
||||||
this.show = true;
|
this.show = true;
|
||||||
this.activeTab = "a1";
|
this.activeTab = "a1";
|
||||||
|
@ -261,12 +321,13 @@ export default {
|
||||||
this.showMode = true;
|
this.showMode = true;
|
||||||
this.loadedModelCount = 0;
|
this.loadedModelCount = 0;
|
||||||
|
|
||||||
getPlanAllBimInfo(this.plan.projectId).then((res) => {
|
this.allBimData = planList
|
||||||
this.allBimData = (res.data || []).map((it) => {
|
.map((it) => {
|
||||||
it.bim = this.$tryToJson(it.bimId || "[]", []);
|
it.bim = this.$tryToJson(it.bimId || "[]", []);
|
||||||
return it;
|
return it;
|
||||||
});
|
})
|
||||||
});
|
.filter((d) => d.bim && d.bim.length > 0);
|
||||||
|
|
||||||
this.initEngine();
|
this.initEngine();
|
||||||
},
|
},
|
||||||
initEngine() {
|
initEngine() {
|
||||||
|
@ -362,6 +423,9 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
initPlan() {
|
||||||
|
bimTools.partLoadModel(this);
|
||||||
|
},
|
||||||
addModel(modelId, cb) {
|
addModel(modelId, cb) {
|
||||||
let url = `${window.config.modelUrl}/Tools/output/model/${modelId}/root.glt`;
|
let url = `${window.config.modelUrl}/Tools/output/model/${modelId}/root.glt`;
|
||||||
this.models.find((d) => d.modelId == modelId).visible = true;
|
this.models.find((d) => d.modelId == modelId).visible = true;
|
||||||
|
@ -373,7 +437,6 @@ export default {
|
||||||
() => {
|
() => {
|
||||||
cb && cb();
|
cb && cb();
|
||||||
console.log("加载模型成功");
|
console.log("加载模型成功");
|
||||||
this.loadedModelCount++;
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.viewPoint) {
|
if (this.viewPoint) {
|
||||||
api.Camera.setViewPort(this.viewPoint);
|
api.Camera.setViewPort(this.viewPoint);
|
||||||
|
@ -385,6 +448,7 @@ export default {
|
||||||
this.$message.info("模型加载完成");
|
this.$message.info("模型加载完成");
|
||||||
this.bimLoaded = true;
|
this.bimLoaded = true;
|
||||||
this.doMenu(2);
|
this.doMenu(2);
|
||||||
|
this.loadedModelCount++;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -550,6 +614,9 @@ export default {
|
||||||
.el-checkbox {
|
.el-checkbox {
|
||||||
color: #45fdfe;
|
color: #45fdfe;
|
||||||
}
|
}
|
||||||
|
.el-text {
|
||||||
|
color: #eee;
|
||||||
|
}
|
||||||
.el-tree-node {
|
.el-tree-node {
|
||||||
&:focus {
|
&:focus {
|
||||||
& > .el-tree-node__content {
|
& > .el-tree-node__content {
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
modal-class="bim-selection-dialog3"
|
modal-class="bim-selection-dialog3"
|
||||||
>
|
>
|
||||||
<div id="bimSelectionDlg">
|
<div id="bimSelectionDlg">
|
||||||
<div id="bimSelectionDlgContainer" class="bimSelectionDlgContainer"></div>
|
<div
|
||||||
|
id="bimSelectionDlgContainer3"
|
||||||
|
class="bimSelectionDlgContainer"
|
||||||
|
></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="div-left" :class="{ 'is-hide': !leftExpend }">
|
<div class="div-left" :class="{ 'is-hide': !leftExpend }">
|
||||||
<div class="div-left-title">
|
<div class="div-left-title">
|
||||||
|
@ -309,22 +312,22 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
doSave() {
|
doSave() {
|
||||||
if(!this.plan){
|
if (!this.plan) {
|
||||||
ElMessage.error("请选择计划");
|
ElMessage.error("请选择计划");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let text=
|
let text =
|
||||||
this.selectItems.length > 0 ? JSON.stringify(this.selectItems) : ""
|
this.selectItems.length > 0 ? JSON.stringify(this.selectItems) : "";
|
||||||
updateBimInfo({
|
updateBimInfo({
|
||||||
id: this.plan.id,
|
id: this.plan.id,
|
||||||
text:text,
|
text: text,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.plan.bimId=text;
|
this.plan.bimId = text;
|
||||||
this.plan.bim=this.$tryToJson(text||"[]",[]);
|
this.plan.bim = this.$tryToJson(text || "[]", []);
|
||||||
this.plan.hasBim=this.plan && this.plan.bim.length>0;
|
this.plan.hasBim = this.plan && this.plan.bim.length > 0;
|
||||||
ElMessage.success("保存成功");
|
ElMessage.success("保存成功");
|
||||||
bimTools.showPlanFeatchure(this)
|
bimTools.showPlanFeatchure(this);
|
||||||
this.$emit("success");
|
this.$emit("success");
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error("保存失败");
|
ElMessage.error("保存失败");
|
||||||
|
@ -409,7 +412,7 @@ export default {
|
||||||
serverIP: window.config.serverIP, //服务ip地址
|
serverIP: window.config.serverIP, //服务ip地址
|
||||||
port: window.config.port, //HTTP端口
|
port: window.config.port, //HTTP端口
|
||||||
useHttps: window.config.useHttps, //使用Https
|
useHttps: window.config.useHttps, //使用Https
|
||||||
container: "bimSelectionDlgContainer", //[必须]容器id
|
container: "bimSelectionDlgContainer3", //[必须]容器id
|
||||||
secretKey: window.config.secretKey,
|
secretKey: window.config.secretKey,
|
||||||
openEarth: window.config.openEarth, //[可选]开启Gis场景
|
openEarth: window.config.openEarth, //[可选]开启Gis场景
|
||||||
bgColor: window.config.bgColor, //[可选]bim场景背景色, 传值即为纯色天空盒
|
bgColor: window.config.bgColor, //[可选]bim场景背景色, 传值即为纯色天空盒
|
||||||
|
@ -487,7 +490,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.models.forEach((it) => {
|
this.models.forEach((it) => {
|
||||||
this.addModel(it.modelId, () => {
|
this.addModel(it.modelId, () => {
|
||||||
this.$refs.tree.setChecked(it.modelId, true,true);
|
this.$refs.tree.setChecked(it.modelId, true, true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,7 +288,7 @@ function getList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleBim(row) {
|
function handleBim(row) {
|
||||||
bimDlg.value.showDialog(row);
|
bimDlg.value.showDialog(row, data.planAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleBindBim() {
|
function handleBindBim() {
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default defineConfig(({ mode, command }) => {
|
||||||
// 部署生产环境和开发环境下的URL。
|
// 部署生产环境和开发环境下的URL。
|
||||||
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
||||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||||
base: VITE_APP_ENV === "production" ? "/xd/" : "./xd/",
|
base: VITE_APP_ENV === "production" ? "./" : "./",
|
||||||
plugins: createVitePlugins(env, command === "build"),
|
plugins: createVitePlugins(env, command === "build"),
|
||||||
resolve: {
|
resolve: {
|
||||||
// https://cn.vitejs.dev/config/#resolve-alias
|
// https://cn.vitejs.dev/config/#resolve-alias
|
||||||
|
@ -44,7 +44,10 @@ export default defineConfig(({ mode, command }) => {
|
||||||
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
||||||
},
|
},
|
||||||
"/statics": {
|
"/statics": {
|
||||||
target: VITE_APP_ENV === "production" ? "http://62.234.3.186" : `http://localhost:9300`,
|
target:
|
||||||
|
VITE_APP_ENV === "production"
|
||||||
|
? "http://62.234.3.186"
|
||||||
|
: `http://localhost:9300`,
|
||||||
//target: 'http://62.234.3.186',
|
//target: 'http://62.234.3.186',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
|
|
Loading…
Reference in New Issue