@@ -57,37 +50,31 @@ export default {
mode: "show",
form: {
url:"",
- deptId: "",
- app_key: "",
+ userId: "",
+ chinaKey: "",
projectId: "",
- app_secret:""
},
rules: {
- url: {
- required: true,
- message: "请输入服务地址",
- trigger: "blur",
- },
- deptId: {
+ userId: {
required: true,
message: "请输入用户ID",
trigger: "blur",
},
- app_key: {
+ chinaKey: {
required: true,
message: "请输入配置key",
trigger: "blur",
},
- app_secret: {
- required: true,
- message: "请输入配置密钥",
- trigger: "blur",
- },
projectId: {
required: true,
message: "请输入项目ID",
trigger: "blur",
},
+ url: {
+ required: true,
+ message: "请输入服务地址",
+ trigger: "blur",
+ },
},
};
},
@@ -106,10 +93,9 @@ export default {
methods: {
doEdit() {
this.mode = "edit";
- this.form.deptId = this.cfgInfo?.deptId || "";
- this.form.app_key = this.cfgInfo?.app_key || "";
+ this.form.userId = this.cfgInfo?.userId || "";
+ this.form.chinaKey = this.cfgInfo?.chinaKey || "";
this.form.projectId = this.cfgInfo?.projectId || "";
- this.form.app_secret = this.cfgInfo?.app_secret || "";
this.form.url = this.cfgInfo?.url || "";
},
doSave() {
@@ -151,10 +137,9 @@ export default {
if (this.cfgData) {
this.cfgInfo = this.$tryToJson(this.cfgData.paramData, null);
}
- this.form.deptId = this.cfgInfo?.deptId || "未配置";
- this.form.app_key = this.cfgInfo?.app_key || "未配置";
+ this.form.userId = this.cfgInfo?.userId || "未配置";
+ this.form.chinaKey = this.cfgInfo?.chinaKey || "未配置";
this.form.projectId = this.cfgInfo?.projectId || "未配置";
- this.form.app_secret = this.cfgInfo?.app_secret || "未配置";
this.form.url = this.cfgInfo?.url || "未配置";
cb && cb();
});
diff --git a/yanzhu-ui-vue3/src/views/manage/plan/bimSelectTools3.js b/yanzhu-ui-vue3/src/views/manage/plan/bimSelectTools3.js
index c60036a9..d9afa993 100644
--- a/yanzhu-ui-vue3/src/views/manage/plan/bimSelectTools3.js
+++ b/yanzhu-ui-vue3/src/views/manage/plan/bimSelectTools3.js
@@ -126,7 +126,11 @@ function clearAllSelection(that) {
}
function initBim(that) {
- let tmps = that.allBimData.filter((it) => it.id == that.plan.id);
+ let planId = -1;
+ if (that.plan) {
+ planId = that.plan.id;
+ }
+ let tmps = that.allBimData.filter((it) => it.id == planId);
if (tmps.length > 0) {
tmps[0].bim.forEach((it) => {
if (
@@ -183,7 +187,7 @@ function partLoadModel(that) {
url,
modelId,
obj[modelId].join("#"),
- (res) => {},
+ (res) => { },
(res) => {
setTimeout(() => {
if (that.viewPoint) {
@@ -608,22 +612,47 @@ function makePlanTree(that) {
that.planTreeKey++;
}
+function resetModel(that, cb) {
+ let api = bimSelectionDlgApi;
+ that.hideParts = [];
+ that.readlyParts = [];
+ that.hideFeatures = [];
+ that.allBimData = that.planList.filter((d) => d.hasBim);
+ that.models.forEach(model => {
+ api.Model.setVisible(model.modelId, true);
+ api.Model.original(model.modelId);
+ that.$refs.tree.setChecked(model.modelId, true, true)
+ setTimeout(() => {
+ cb && cb();
+ }, 1000)
+ });
+}
+
//根据选择的计划显示构件
function showPlanFeatchure(that) {
let api = bimSelectionDlgApi;
- if (that.plan.hasBim) {
- //已绑定BIM模型 显示已绑定的构件
- let featureIds = that.plan.bim.map((it) => it.featureId);
- if (featureIds.length > 0) {
- let tmpsIds2 = featureIds.splice(0, 1000);
- api.Feature.showFeatures(tmpsIds2.join("#"));
- that.selectItems = that.plan.bim.map((it) => it);
- featureIds = that.plan.bim.map((it) => it.featureId);
- api.Feature.setColor(featureIds.join("#"), "rgba(255,0,255,1)");
+ resetModel(that, () => {
+ if (that.plan.hasBim) {
+ //已绑定BIM模型 显示已绑定的构件
+ let featureIds = that.plan.bim.map((it) => it.featureId);
+ if (featureIds.length > 0) {
+ let tmpsIds2 = featureIds.splice(0, 1000);
+ api.Feature.showFeatures(tmpsIds2.join("#"));
+ setFeatueVisible(featureIds, true);
+ initBim(that)
+ //that.selectItems = that.plan.bim.map((it) => it);
+
+ featureIds = that.plan.bim.map((it) => it.featureId);
+ api.Feature.setColor(featureIds.join("#"), "rgba(255,0,255,1)");
+ }
+ } else {
+ that.selectItems = [];
+ //未绑定BIM模型 显示所有可以绑定的构件
+
+ initBim(that)
+ setFeatueVisible(that.readlyParts,false)
}
- } else {
- //未绑定BIM模型 显示所有可以绑定的构件
- }
+ });
}
export default {
diff --git a/yanzhu-ui-vue3/src/views/manage/plan/bimSelectionDialog3.vue b/yanzhu-ui-vue3/src/views/manage/plan/bimSelectionDialog3.vue
index 537e3e57..471c92d7 100644
--- a/yanzhu-ui-vue3/src/views/manage/plan/bimSelectionDialog3.vue
+++ b/yanzhu-ui-vue3/src/views/manage/plan/bimSelectionDialog3.vue
@@ -309,14 +309,22 @@ export default {
});
},
doSave() {
+ if(!this.plan){
+ ElMessage.error("请选择计划");
+ return;
+ }
+ let text=
+ this.selectItems.length > 0 ? JSON.stringify(this.selectItems) : ""
updateBimInfo({
id: this.plan.id,
- text:
- this.selectItems.length > 0 ? JSON.stringify(this.selectItems) : "",
+ text:text,
}).then((res) => {
if (res.success) {
+ this.plan.bimId=text;
+ this.plan.bim=this.$tryToJson(text||"[]",[]);
+ this.plan.hasBim=this.plan && this.plan.bim.length>0;
ElMessage.success("保存成功");
- this.show = false;
+ bimTools.showPlanFeatchure(this)
this.$emit("success");
} else {
ElMessage.error("保存失败");
@@ -353,6 +361,9 @@ export default {
case 5:
bimTools.selectTreeData(this);
break;
+ case 6:
+ this.doSave();
+ break;
}
},
showDialog(planList) {
@@ -476,10 +487,9 @@ export default {
} else {
this.models.forEach((it) => {
this.addModel(it.modelId, () => {
- this.$refs.tree.setChecked(it.modelId, true);
+ this.$refs.tree.setChecked(it.modelId, true,true);
});
});
- this.$refs.tree.setChecked("root", true);
}
});
},
@@ -655,7 +665,7 @@ export default {
position: absolute;
bottom: 6vh;
left: 50%;
- margin-left: -120px;
+ margin-left: -140px;
background: #274754;
border-radius: 4px;