优化任务计划性能
parent
c2e66dd1ae
commit
7451283d13
|
@ -124,7 +124,8 @@ function initBim(that) {
|
|||
if (that.plan) {
|
||||
planId = that.plan.id;
|
||||
}
|
||||
let tmps = that.allBimData.filter((it) => it.id == planId);
|
||||
//let tmps = [that.plan]//that.allBimData.filter((it) => it.id == planId);
|
||||
let tmps =that.allBimData.filter((it) => it.id == planId);
|
||||
if (tmps.length > 0) {
|
||||
tmps[0].bim.forEach((it) => {
|
||||
if (
|
||||
|
@ -516,7 +517,7 @@ function makePlanTree(that) {
|
|||
datas.forEach((data) => {
|
||||
data.checked = false;
|
||||
data.bim = that.$tryToJson(data.bimId || "[]", []);
|
||||
data.hasBim = data.bim && data.bim.length > 0;
|
||||
data.hasBim = data.bimId && data.bimId.length > 0;
|
||||
data.children = that.planList.filter((it) => it.parentId == data.taskId);
|
||||
func(data.children);
|
||||
});
|
||||
|
|
|
@ -1,47 +1,24 @@
|
|||
<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-dialog3"
|
||||
>
|
||||
<el-dialog v-model="show" append-to-body :close-on-click-modal="false" :close-on-press-escape="false" :title="title"
|
||||
modal-class="bim-selection-dialog3">
|
||||
<div id="bimSelectionDlg">
|
||||
<div
|
||||
id="bimSelectionDlgContainer3"
|
||||
class="bimSelectionDlgContainer"
|
||||
></div>
|
||||
<div id="bimSelectionDlgContainer3" class="bimSelectionDlgContainer"></div>
|
||||
</div>
|
||||
<div class="div-left" :class="{ 'is-hide': !leftExpend }">
|
||||
<div class="div-left-title">
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="结构树" name="a1">
|
||||
<div class="model-tree scroll" :key="treeKey">
|
||||
<el-tree
|
||||
:key="treeKey"
|
||||
ref="tree"
|
||||
:default-expanded-keys="treeExpendedKeys"
|
||||
:props="{
|
||||
children: 'children',
|
||||
label: 'title',
|
||||
isLeaf: 'leaf',
|
||||
}"
|
||||
node-key="key"
|
||||
@check="onCheckTree"
|
||||
:load="loadNode"
|
||||
lazy
|
||||
show-checkbox
|
||||
></el-tree>
|
||||
<el-tree :key="treeKey" ref="tree" :default-expanded-keys="treeExpendedKeys" :props="{
|
||||
children: 'children',
|
||||
label: 'title',
|
||||
isLeaf: 'leaf',
|
||||
}" node-key="key" @check="onCheckTree" :load="loadNode" lazy show-checkbox></el-tree>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="已关联" name="a2">
|
||||
<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">
|
||||
<div class="sel-item-info">{{ it.info }}</div>
|
||||
</el-tooltip>
|
||||
|
@ -54,11 +31,7 @@
|
|||
<el-button @click="delAllDelList">删除所有</el-button>
|
||||
</div>
|
||||
<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">
|
||||
<div class="sel-item-info">{{ it.info }}</div>
|
||||
</el-tooltip>
|
||||
|
@ -88,32 +61,18 @@
|
|||
<span v-else>无选择数据</span>
|
||||
</div>
|
||||
<div class="plan-tree scroll" :key="planTreeKey" v-if="showPlan">
|
||||
<el-tree
|
||||
ref="planTree"
|
||||
:data="planTree"
|
||||
node-key="id"
|
||||
:props="{
|
||||
children: 'children',
|
||||
label: 'taskName',
|
||||
isLeaf: 'leaf',
|
||||
}"
|
||||
default-expand-all
|
||||
>
|
||||
<el-tree ref="planTree" :data="planTree" node-key="id" :props="{
|
||||
children: 'children',
|
||||
label: 'taskName',
|
||||
isLeaf: 'leaf',
|
||||
}" default-expand-all>
|
||||
<template #default="{ node, data }">
|
||||
<span class="custom-tree-node" @click="nodeClick(node, data)">
|
||||
<span>{{ node.label }}</span>
|
||||
<span
|
||||
v-if="node.isLeaf"
|
||||
class="bind-bim"
|
||||
:class="{ 'has-bim': data.hasBim }"
|
||||
>
|
||||
<span v-if="node.isLeaf" class="bind-bim" :class="{ 'has-bim': data.hasBim }">
|
||||
<svg-icon icon-class="position" style="cursor: pointer" />
|
||||
[{{ data.hasBim ? "已" : "未" }}绑定]
|
||||
<svg-icon
|
||||
v-if="data.checked"
|
||||
icon-class="checkbox"
|
||||
style="cursor: pointer"
|
||||
/>
|
||||
<svg-icon v-if="data.checked" icon-class="checkbox" style="cursor: pointer" />
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
|
@ -123,65 +82,37 @@
|
|||
<div v-show="bimLoaded">
|
||||
<div class="footer-box" v-if="models.length > 0">
|
||||
<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" />
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<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" />
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<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" />
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<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" />
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<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" />
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<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" />
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-tooltip placement="top" content="保存绑定">
|
||||
<div
|
||||
class="footer-btn"
|
||||
@click="doMenu(6)"
|
||||
:class="activeMenu == 6 ? 'is-active' : ''"
|
||||
>
|
||||
<div class="footer-btn" @click="doMenu(6)" :class="activeMenu == 6 ? 'is-active' : ''">
|
||||
<svg-icon icon-class="save" />
|
||||
</div>
|
||||
</el-tooltip>
|
||||
|
@ -189,15 +120,8 @@
|
|||
</div>
|
||||
|
||||
<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>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -207,10 +131,12 @@ import { listBimModel } from "@/api/bim/bimModel";
|
|||
import bimTools from "./bimSelectTools3";
|
||||
import {
|
||||
updateBimInfo,
|
||||
getPlanAllBimInfo,
|
||||
getDefaultViewPoint,
|
||||
} from "@/api/bim/bim";
|
||||
import { ElMessage, ElMessageBox, ElStep } from "element-plus";
|
||||
import {
|
||||
getPlan,listPlan
|
||||
} from "@/api/manage/plan";
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -266,8 +192,19 @@ export default {
|
|||
this.planList.forEach((it) => {
|
||||
it.checked = it == data;
|
||||
});
|
||||
this.plan = data;
|
||||
bimTools.showPlanFeatchure(this);
|
||||
if (!data.hasLoadBim) {
|
||||
getPlan(data.id).then((response) => {
|
||||
data.bimId = response.data.bimId;
|
||||
data.bim = this.$tryToJson(data.bimId || "[]", []);
|
||||
data.hasBim = data.bim && data.bim.length > 0;
|
||||
data.hadLoadBim = true;
|
||||
this.plan = data;
|
||||
bimTools.showPlanFeatchure(this);
|
||||
});
|
||||
} else {
|
||||
this.plan = data;
|
||||
bimTools.showPlanFeatchure(this);
|
||||
}
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
bimTools.loadNode(this, node, resolve);
|
||||
|
@ -325,7 +262,7 @@ export default {
|
|||
if (res.success) {
|
||||
this.plan.bimId = text;
|
||||
this.plan.bim = this.$tryToJson(text || "[]", []);
|
||||
this.plan.hasBim = this.plan && this.plan.bim.length > 0;
|
||||
this.plan.hasBim = text && text.length > 0;
|
||||
ElMessage.success("保存成功");
|
||||
bimTools.showPlanFeatchure(this);
|
||||
this.$emit("success");
|
||||
|
@ -397,9 +334,26 @@ export default {
|
|||
this.loadedModelCount = 0;
|
||||
|
||||
bimTools.makePlanTree(this);
|
||||
this.allBimData = this.planList.filter((d) => d.hasBim);
|
||||
//this.allBimData = this.planList.filter((d) => d.hasBim);
|
||||
this.loadAllBimData();
|
||||
this.initEngine();
|
||||
},
|
||||
loadAllBimData() {
|
||||
let postData={
|
||||
projectId: this.currentPrjId,
|
||||
pageNum:1,
|
||||
pageSize:10000
|
||||
};
|
||||
listPlan(postData).then((d) => {
|
||||
let tmps = (d.data || []).filter(it=>it.bmId).map(it=>{
|
||||
it.bim=this.$tryToJson(it.bimId||"[]",[]);
|
||||
it.hasBim=it.bim && it.bim.length>0;
|
||||
return it;
|
||||
});
|
||||
this.allBimData=tmps.filter(item=>item.hasBim);
|
||||
this.$message.info("数据准备就绪!");
|
||||
});
|
||||
},
|
||||
initEngine() {
|
||||
this.elId++;
|
||||
setTimeout(() => {
|
||||
|
@ -503,7 +457,7 @@ export default {
|
|||
api.Model.add(
|
||||
url,
|
||||
modelId,
|
||||
() => {},
|
||||
() => { },
|
||||
() => {
|
||||
cb && cb();
|
||||
console.log("加载模型成功");
|
||||
|
@ -568,18 +522,23 @@ export default {
|
|||
&.plan-list {
|
||||
left: unset;
|
||||
right: 96px;
|
||||
|
||||
&.plan-hide {
|
||||
height: 40px;
|
||||
|
||||
.plan-tree-icon {
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
.plan-info {
|
||||
color: #fff;
|
||||
line-height: 40px;
|
||||
padding-left: 20px;
|
||||
|
||||
.bind-bim {
|
||||
color: #2cff00;
|
||||
|
||||
&.has-bim {
|
||||
color: #edfd06;
|
||||
font-weight: bold;
|
||||
|
@ -587,12 +546,14 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.plan-tree-icon {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
z-index: 999;
|
||||
cursor: pointer;
|
||||
|
||||
.svg-icon {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
|
@ -622,6 +583,7 @@ export default {
|
|||
}
|
||||
|
||||
.el-tabs__nav-wrap {
|
||||
|
||||
.el-tabs__nav-prev,
|
||||
.el-tabs__nav-next {
|
||||
display: none;
|
||||
|
@ -735,9 +697,11 @@ export default {
|
|||
.plan-tree {
|
||||
height: calc(100% - 0px);
|
||||
}
|
||||
|
||||
.model-tree {
|
||||
height: calc(100% - 36px);
|
||||
}
|
||||
|
||||
.model-tree,
|
||||
.plan-tree {
|
||||
overflow-y: auto;
|
||||
|
@ -749,28 +713,33 @@ export default {
|
|||
.el-checkbox {
|
||||
color: #45fdfe;
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.bind-bim {
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
color: #2cff00;
|
||||
|
||||
&.has-bim {
|
||||
color: #edfd06;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.svg-icon {
|
||||
color: #45fdfe;
|
||||
}
|
||||
}
|
||||
|
||||
.el-text {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.el-tree-node {
|
||||
&:focus {
|
||||
& > .el-tree-node__content {
|
||||
&>.el-tree-node__content {
|
||||
background: #3489d966;
|
||||
|
||||
&:hover {
|
||||
|
|
|
@ -196,9 +196,16 @@ function getList() {
|
|||
}
|
||||
|
||||
function handleBim(row) {
|
||||
if(row.hasLoadBim){
|
||||
bimDlg.value.showDialog(row, data.planAll);
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
getPlan(row.id).then((response) => {
|
||||
row.bimId = response.data.bimId;
|
||||
row.hadLoadBim=true;
|
||||
row.bim = this.$tryToJson(row.bimId || "[]", []);
|
||||
row.hasBim =row.bimId && row.bimId.length > 0;
|
||||
loading.value = false;
|
||||
bimDlg.value.showDialog(row, data.planAll);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue