diff --git a/yanzhu-bigscreen/src/views/bimBriefing.vue b/yanzhu-bigscreen/src/views/bimBriefing.vue
index 01a59bd0..770a007b 100644
--- a/yanzhu-bigscreen/src/views/bimBriefing.vue
+++ b/yanzhu-bigscreen/src/views/bimBriefing.vue
@@ -22,7 +22,8 @@
}"
node-key="key"
@check="onCheckTree"
- :data="modelTrees"
+ :load="loadNode"
+ lazy
show-checkbox>
@@ -261,6 +262,72 @@ export default {
this.initEngine();
},
methods: {
+ loadNode(node, resolve) {
+ let that = this;
+ if (node.level == 0) {
+ let nd = [
+ {
+ title: "项目模型",
+ level: 0,
+ type: "root",
+ key: "root",
+ children: [],
+ hadLoad: true,
+ },
+ ];
+
+ resolve(nd);
+ setTimeout(() => {
+ document.querySelectorAll(".bim-briefing .model-tree .el-tree-node")[0].click();
+ }, 1000);
+ } else if (node.level == 1) {
+ let nd = [];
+ that.models.forEach((d) => {
+ let mnd = {
+ title: d.modelName,
+ level: 1,
+ type: "model",
+ hasLoad: false,
+ modelId: d.lightweightName,
+ key: d.lightweightName,
+ externalId: "0",
+ glid: "",
+ children: [],
+ data: d,
+ };
+ nd.push(mnd);
+ });
+ resolve(nd);
+ } else {
+ this.getTreeChildren(node, resolve);
+ }
+ },
+ getTreeChildren(node, resolve) {
+ let that = this;
+ let data = node.data;
+ this.$api.bim.getModelTree(data.modelId, data.glid).then((d) => {
+ let tmps = (d.data || []).map((it) => {
+ let title = it.externalId == 0 ? it.name : it.externalId;
+ title = title.replaceAll('"', "").replaceAll("'", "").replaceAll("\\", "");
+ it.title = title;
+ it.key = it.glid;
+ it.modelId = data.modelId;
+ it.type = "data";
+ it.leaf = +it.externalId != 0;
+ let o = this.convertFeatureInfo(it, data.modelId);
+ return o;
+ });
+ resolve(tmps);
+ });
+ },
+ convertFeatureInfo(o, modelId) {
+ o.modelId = modelId;
+ o.featureId = o.modelId + "^" + o.externalId;
+ o.name = o.name || "";
+ o.name = o.name.replaceAll('"', "").replaceAll("'", "").replaceAll("\\", "");
+ o.info = `[${o.externalId}]${o.groupname}-${o.name}`;
+ return o;
+ },
doSelectMenu(index) {
this.selectMenu = index;
briefingTools.clearEvent(this);
@@ -301,69 +368,77 @@ export default {
break;
}
},
- onCheckTree(node, event) {
+ async onCheckTree(node, event) {
+ let api = bimBriefingApi;
+ let that = this;
if (!this.modelLoaded) {
this.$message.error("模型未加载完成,请稍后重试");
return;
}
- this.playCancle();
let checked = event.checkedNodes.includes(node);
- console.log(node, event, checked);
if (node.type == "root") {
- //bimBriefingApi
- node.children.forEach((m) => {
- if (bimBriefingApi.m_model.has(m.modelId)) {
- bimBriefingApi.Model.remove(m.modelId);
- }
- if (checked) {
- this.addModel(m.modelId);
- }
- });
- } else if (node.type == "model") {
- if (bimBriefingApi.m_model.has(node.modelId)) {
- bimBriefingApi.Model.remove(node.modelId);
- }
if (checked) {
- this.addModel(node.modelId);
- }
- } else {
- if (bimBriefingApi.m_model.size == 0) {
- let modelId = checkNode.modelId;
- this.addModel(modelId, () => {
- this.showItem(node, event, checked);
+ that.models.forEach((it) => {
+ api.Model.setVisible(it.modelId, true);
+ api.Model.original(it.modelId);
});
} else {
- this.showItem(node, event, checked);
+ that.models.forEach((it) => {
+ api.Model.setVisible(it.modelId, false);
+ });
+ }
+ } else if (node.type == "model") {
+ if (checked) {
+ api.Model.setVisible(node.modelId, true);
+ api.Model.original(node.modelId);
+ } else {
+ api.Model.setVisible(node.modelId, false);
+ }
+ } else {
+ let isPartLoad = false;
+ if (event.checkedKeys.length == 1 && checked) {
+ isPartLoad = true;
+ }
+ let selFeatureIds = [];
+ if (node.leaf) {
+ selFeatureIds = [node.featureId];
+ } else {
+ if (!node.leafs) {
+ let leafs = await this.getNodeLeafs(node);
+ node.leafs = leafs;
+ }
+ selFeatureIds = node.leafs.map((f) => f.featureId);
+ }
+ let tmps = selFeatureIds;
+ if (!checked) {
+ this.setFeatueVisible(tmps, false);
+ } else {
+ if (isPartLoad) {
+ api.Model.setVisible(node.modelId, true);
+ api.Model.original(node.modelId);
+ let tmpsIds2 = tmps.splice(0, 1000);
+ api.Feature.showFeatures(tmpsIds2.join("#"));
+ this.setFeatueVisible(tmps, true);
+ } else {
+ this.setFeatueVisible(tmps, true);
+ }
}
}
},
- async showItem(checkNode, event, checked) {
+ setFeatueVisible(featureIds, show) {
+ let len = 1000;
let api = bimBriefingApi;
- api.Model.setVisible(checkNode.modelId, true);
- let externalId = checkNode.externalId;
- if (externalId != 0) {
- if (checked) {
- this.visibleList.push(externalId);
- api.Feature.setVisible(this.visibleList.join("#"), true, checkNode.modelId, false);
- } else {
- this.visibleList = this.visibleList.filter((item) => item !== externalId);
- api.Feature.setVisible(externalId, false, checkNode.modelId);
- }
- } else {
- const res = await this.$api.bim.getTreeAllLeafChild(checkNode.modelId, checkNode.glid);
- let nodes = res.data || [];
- if (nodes.length > 0) {
- if (checked) {
- this.visibleList = MergeArray(nodes, this.visibleList);
- api.Model.setVisible(checkNode.modelId, true);
- api.Feature.setVisible(this.visibleList.join("#"), true, checkNode.modelId, false);
- } else {
- this.visibleList = DelArray(this.visibleList, nodes);
- api.Feature.setVisible(nodes.join("#"), false, checkNode.modelId);
- }
- }
+ let cnt = featureIds.length;
+ for (let i = 0; i < cnt; i += len) {
+ api.Feature.setVisible(featureIds.slice(i, i + len).join("#"), show);
}
},
+ async getNodeLeafs(node) {
+ const res = await this.$api.bim.getTreeAllLeafChild(node.modelId, node.glid);
+ return (res.data || []).map((f) => {
+ return this.convertFeatureInfo(f, node.modelId);
+ });
+ },
arrowRetract() {
if (this.leftShow == true) {
this.rightSrc = "./images/arrow_right_open.png";
@@ -458,10 +533,15 @@ export default {
this.$message.error("暂无模型,请先关联模型");
} else {
this.models.forEach((item) => {
+ item.modelId = item.lightweightName;
+ item.gis = JSON.parse(item.gisJson);
this.addModel(item.lightweightName);
- this.loadModelTree();
this.doSelectMenu(7);
+ setTimeout(() => {
+ this.$refs.tree.setChecked(item.lightweightName, true, true);
+ }, 3000);
});
+ this.treeKey++;
}
});
this.init();
diff --git a/yanzhu-bigscreen/src/views/bimManage.vue b/yanzhu-bigscreen/src/views/bimManage.vue
index 99c33d11..16071f7a 100644
--- a/yanzhu-bigscreen/src/views/bimManage.vue
+++ b/yanzhu-bigscreen/src/views/bimManage.vue
@@ -472,7 +472,8 @@ export default {
}
this.getProjectInfo();
this.costOutputSelectYearAndMonth();
- this.groupByCraftType();
+ //this.groupByCraftType();
+ this.loadAttendanceData();
this.getRootScheduleNode();
this.getFinishRate();
this.selectLastPhotography();
@@ -553,6 +554,60 @@ export default {
this.prj.accumulatedCost = d.totalMonth || 0;
});
},
+ loadAttendanceData() {
+ if (this.selProject.vendorsCode != "uni") {
+ this.loadJhAttendanceData();
+ } else {
+ this.loadUniAttendanceData();
+ }
+ },
+ loadJhAttendanceData() {
+ let data = {
+ id: 0,
+ projectId: this.selProject.id,
+ attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD"),
+ };
+ let ajax = this.$api.detail.groupAllByComany;
+
+ ajax(data).then((d) => {
+ let tmps = d.data || [];
+ const func = (ids) => {
+ let sum = 0;
+ tmps
+ .filter((it) => ids.includes(it.companyTypeId))
+ .map((it) => it.id)
+ .forEach((it) => {
+ sum += it * 1;
+ });
+ return sum;
+ };
+
+
+ this.workerInfo = [
+ { text: "劳务人员", value: func(["4", "5"]) },
+ { text: "监理人员", value: func(["2"]) },
+ { text: "总包人员", value: func(["1"]) },
+ ];
+ console.log(this.attendanceData)
+ });
+ },
+ loadUniAttendanceData() {
+ let ajax = this.$api.detail.groupByCraftType;
+ let posData = {
+ comId: this.selProject.comId,
+ projectId: this.selProject.id,
+ };
+
+ ajax(posData).then((d) => {
+ this.workerInfo = (d.data || []).map((it) => {
+ return {
+ text: it.createBy,
+ value: it.id || 0,
+ id: it.craftType,
+ };
+ });
+ });
+ },
groupByCraftType() {
let ajax = this.$api.detail.groupByCraftType;
let posData = {
@@ -1019,7 +1074,7 @@ export default {
position: absolute;
top: calc(80vh - 50px);
left: 50%;
- margin-left:-170px;
+ margin-left: -170px;
display: flex;
background: #00000080;
border-radius: 10px;
@@ -1078,7 +1133,8 @@ export default {
td,
th {
border: solid 1px #6ea9ab68;
- padding: 4px;
+ padding: 7px 4px;
+ font-size: 12px;
}
th {
color: #b0cfff;
@@ -1380,7 +1436,7 @@ export default {
th {
border: solid 1px #6ea9ab68;
padding: 4px;
- font-size: 12px;
+ font-size: 10px;
}
}
}
@@ -1560,8 +1616,8 @@ export default {
td,
th {
border: solid 1px #6ea9ab68;
- padding: 8px;
- font-size: 24px;
+ padding: 10px;
+ font-size: 20px;
}
}
}
diff --git a/yanzhu-bigscreen/src/views/bimRoaming.vue b/yanzhu-bigscreen/src/views/bimRoaming.vue
index 779a7981..9b5cc605 100644
--- a/yanzhu-bigscreen/src/views/bimRoaming.vue
+++ b/yanzhu-bigscreen/src/views/bimRoaming.vue
@@ -19,10 +19,12 @@
:props="{
children: 'children',
label: 'title',
+ isLeaf: 'leaf',
}"
node-key="key"
@check="onCheckTree"
- :data="modelTrees"
+ :load="loadNode"
+ lazy
show-checkbox>
@@ -112,7 +114,7 @@ export default {
models: [],
treeKey: 0,
modelTrees: [],
- viewPoint:[],
+ viewPoint: [],
treeExpendedKeys: [],
visibleList: [],
viewpointList: [],
@@ -122,9 +124,11 @@ export default {
roamingLoading: true,
selectedRoam: null,
modelLoaded: false,
+ isPlay:false,
};
},
mounted() {
+ window.bimRoaming = this;
this.$store.dispatch("ChangeNav", 702);
this.dpi = this.$dpi();
window.addEventListener("resize", () => {
@@ -144,15 +148,84 @@ export default {
this.initEngine();
},
methods: {
+ loadNode(node, resolve) {
+ let that = this;
+ if (node.level == 0) {
+ let nd = [
+ {
+ title: "项目模型",
+ level: 0,
+ type: "root",
+ key: "root",
+ children: [],
+ hadLoad: true,
+ },
+ ];
+
+ resolve(nd);
+ setTimeout(() => {
+ document.querySelectorAll(".bim-roaming .model-tree .el-tree-node")[0].click();
+ }, 1000);
+ } else if (node.level == 1) {
+ let nd = [];
+ that.models.forEach((d) => {
+ let mnd = {
+ title: d.modelName,
+ level: 1,
+ type: "model",
+ hasLoad: false,
+ modelId: d.lightweightName,
+ key: d.lightweightName,
+ externalId: "0",
+ glid: "",
+ children: [],
+ data: d,
+ };
+ nd.push(mnd);
+ });
+ resolve(nd);
+ } else {
+ this.getTreeChildren(node, resolve);
+ }
+ },
+ getTreeChildren(node, resolve) {
+ let that = this;
+ let data = node.data;
+ this.$api.bim.getModelTree(data.modelId, data.glid).then((d) => {
+ let tmps = (d.data || []).map((it) => {
+ let title = it.externalId == 0 ? it.name : it.externalId;
+ title = title.replaceAll('"', "").replaceAll("'", "").replaceAll("\\", "");
+ it.title = title;
+ it.key = it.glid;
+ it.modelId = data.modelId;
+ it.type = "data";
+ it.leaf = +it.externalId != 0;
+ let o = this.convertFeatureInfo(it, data.modelId);
+ return o;
+ });
+ resolve(tmps);
+ });
+ },
+ convertFeatureInfo(o, modelId) {
+ o.modelId = modelId;
+ o.featureId = o.modelId + "^" + o.externalId;
+ o.name = o.name || "";
+ o.name = o.name.replaceAll('"', "").replaceAll("'", "").replaceAll("\\", "");
+ o.info = `[${o.externalId}]${o.groupname}-${o.name}`;
+ return o;
+ },
playIRPause(data) {
data.play = 2;
+ this.isPlay=false;
bimRoadmApi.Camera.pauseImmersiveRoam(false);
},
playContinue(data) {
data.play = 1;
+ this.isPlay=true;
bimRoadmApi.Camera.pauseImmersiveRoam(true);
},
playCancle(data) {
+ this.isPlay = false;
if (data) {
data.play = 0;
this.selectedRoam = null;
@@ -188,80 +261,93 @@ export default {
api.Camera.startImmersiveRoam([65.702301, 670.785328, 851.817162]);
setTimeout(() => {
this.selectedRoam = data;
+ this.isPlay=true;
api.Camera.playImmersiveRoam({
records: record,
isLoopPlay: this.autoPlay,
complete: function () {
this.selectedRoam = null;
data.play = 0;
+ this.isPlay=false;
},
});
}, 400);
}, 100);
},
- onCheckTree(node, event) {
+ async onCheckTree(node, event) {
+ let api = bimRoadmApi;
+ let that = this;
if (!this.modelLoaded) {
this.$message.error("模型未加载完成,请稍后重试");
return;
}
- this.playCancle();
+ if(this.isPlay){
+ this.playCancle();
+ }
let checked = event.checkedNodes.includes(node);
- console.log(node, event, checked);
if (node.type == "root") {
- //bimRoadmApi
- node.children.forEach((m) => {
- if (bimRoadmApi.m_model.has(m.modelId)) {
- bimRoadmApi.Model.remove(m.modelId);
- }
- if (checked) {
- this.addModel(m.modelId);
- }
- });
- } else if (node.type == "model") {
- if (bimRoadmApi.m_model.has(node.modelId)) {
- bimRoadmApi.Model.remove(node.modelId);
- }
if (checked) {
- this.addModel(node.modelId);
- }
- } else {
- if (bimRoadmApi.m_model.size == 0) {
- let modelId = checkNode.modelId;
- this.addModel(modelId, () => {
- this.showItem(node, event, checked);
+ that.models.forEach((it) => {
+ api.Model.setVisible(it.modelId, true);
+ api.Model.original(it.modelId);
});
} else {
- this.showItem(node, event, checked);
+ that.models.forEach((it) => {
+ api.Model.setVisible(it.modelId, false);
+ });
+ }
+ } else if (node.type == "model") {
+ if (checked) {
+ api.Model.setVisible(node.modelId, true);
+ api.Model.original(node.modelId);
+ } else {
+ api.Model.setVisible(node.modelId, false);
+ }
+ } else {
+ let isPartLoad = false;
+ if (event.checkedKeys.length == 1 && checked) {
+ isPartLoad = true;
+ }
+ let selFeatureIds = [];
+ if (node.leaf) {
+ selFeatureIds = [node.featureId];
+ } else {
+ if (!node.leafs) {
+ let leafs = await this.getNodeLeafs(node);
+ node.leafs = leafs;
+ }
+ selFeatureIds = node.leafs.map((f) => f.featureId);
+ }
+ let tmps = selFeatureIds;
+ if (!checked) {
+ this.setFeatueVisible(tmps, false);
+ } else {
+ if (isPartLoad) {
+ api.Model.setVisible(node.modelId, true);
+ api.Model.original(node.modelId);
+ let tmpsIds2 = tmps.splice(0, 1000);
+ api.Feature.showFeatures(tmpsIds2.join("#"));
+ this.setFeatueVisible(tmps, true);
+ } else {
+ this.setFeatueVisible(tmps, true);
+ }
}
}
},
- async showItem(checkNode, event, checked) {
+ setFeatueVisible(featureIds, show) {
+ let len = 1000;
let api = bimRoadmApi;
- api.Model.setVisible(checkNode.modelId, true);
- let externalId = checkNode.externalId;
- if (externalId != 0) {
- if (checked) {
- this.visibleList.push(externalId);
- api.Feature.setVisible(this.visibleList.join("#"), true, checkNode.modelId, false);
- } else {
- this.visibleList = this.visibleList.filter((item) => item !== externalId);
- api.Feature.setVisible(externalId, false, checkNode.modelId);
- }
- } else {
- const res = await this.$api.bim.getTreeAllLeafChild(checkNode.modelId, checkNode.glid);
- let nodes = (res.data || []).map((item) => item.glid);
- if (nodes.length > 0) {
- if (checked) {
- this.visibleList = MergeArray(nodes, this.visibleList);
- api.Model.setVisible(checkNode.modelId, true);
- api.Feature.setVisible(this.visibleList.join("#"), true, checkNode.modelId, false);
- } else {
- this.visibleList = DelArray(this.visibleList, nodes);
- api.Feature.setVisible(nodes.join("#"), false, checkNode.modelId);
- }
- }
+ let cnt = featureIds.length;
+ for (let i = 0; i < cnt; i += len) {
+ api.Feature.setVisible(featureIds.slice(i, i + len).join("#"), show);
}
},
+ async getNodeLeafs(node) {
+ const res = await this.$api.bim.getTreeAllLeafChild(node.modelId, node.glid);
+ return (res.data || []).map((f) => {
+ return this.convertFeatureInfo(f, node.modelId);
+ });
+ },
arrowRetract() {
if (this.leftShow == true) {
@@ -352,9 +438,14 @@ export default {
this.$modal.error("暂无模型,请先关联模型");
} else {
this.models.forEach((item) => {
+ item.modelId = item.lightweightName;
+ item.gis = JSON.parse(item.gisJson);
this.addModel(item.lightweightName);
- this.loadModelTree();
+ setTimeout(() => {
+ this.$refs.tree.setChecked(item.lightweightName, true, true);
+ }, 3000);
});
+ this.treeKey++;
}
});
this.init();
diff --git a/yanzhu-bigscreen/src/views/projectDetail.vue b/yanzhu-bigscreen/src/views/projectDetail.vue
index fcc224b9..3b43551b 100644
--- a/yanzhu-bigscreen/src/views/projectDetail.vue
+++ b/yanzhu-bigscreen/src/views/projectDetail.vue
@@ -414,6 +414,7 @@
{{ weathers[2].highTemp }} ~ {{ weathers[2].lowTemp }}
+