|
@@ -104,17 +104,10 @@
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <!-- <TreeTransfer ref="transferRef">
|
|
|
|
- <el-checkbox-group v-model="checkedList">
|
|
|
|
- <div class="inner-group" v-for="item in checkArr" :key="item">
|
|
|
|
- <el-checkbox :key="item" :label="item"></el-checkbox>
|
|
|
|
- </div>
|
|
|
|
- </el-checkbox-group>
|
|
|
|
- </TreeTransfer> -->
|
|
|
|
-
|
|
|
|
<div
|
|
<div
|
|
v-if="overlayBtnShow"
|
|
v-if="overlayBtnShow"
|
|
class="overlay-container"
|
|
class="overlay-container"
|
|
|
|
+ :class="{ forbidden: forbidOverlayBtn }"
|
|
@click="executeOverlay"
|
|
@click="executeOverlay"
|
|
>
|
|
>
|
|
<div
|
|
<div
|
|
@@ -146,6 +139,7 @@ export default {
|
|
components: {},
|
|
components: {},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ uploadBaseUrl: "http://121.43.55.7:10081/dms",
|
|
classTextToIndex: {},
|
|
classTextToIndex: {},
|
|
overlayBtnChecked: false,
|
|
overlayBtnChecked: false,
|
|
outerDialogVisible: false,
|
|
outerDialogVisible: false,
|
|
@@ -185,17 +179,17 @@ export default {
|
|
cursor: "pointer",
|
|
cursor: "pointer",
|
|
},
|
|
},
|
|
currentModifiedModelId: "",
|
|
currentModifiedModelId: "",
|
|
|
|
+ currentOverlayFile: "",
|
|
|
|
+ forbidOverlayBtn: "",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
checkedKeysArr: {
|
|
checkedKeysArr: {
|
|
handler(val) {
|
|
handler(val) {
|
|
if (val.length === 0) {
|
|
if (val.length === 0) {
|
|
- // btn.style.cursor = "not-allowed";
|
|
|
|
this.isRightTransferBtn = false;
|
|
this.isRightTransferBtn = false;
|
|
}
|
|
}
|
|
if (val.length > 0) {
|
|
if (val.length > 0) {
|
|
- // btn.style.cursor = "pointer";
|
|
|
|
this.isRightTransferBtn = true;
|
|
this.isRightTransferBtn = true;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -235,9 +229,22 @@ export default {
|
|
this.$bus.$off("updateModel");
|
|
this.$bus.$off("updateModel");
|
|
this.$bus.$on("updateModel", (node) => {
|
|
this.$bus.$on("updateModel", (node) => {
|
|
console.log("监听模型中");
|
|
console.log("监听模型中");
|
|
|
|
+ this.overlayBtnChecked = false;
|
|
console.log(node, "节点数据");
|
|
console.log(node, "节点数据");
|
|
|
|
+ if (node.data.c_dzfx_file) {
|
|
|
|
+ console.log("已有叠置分析结果");
|
|
|
|
+ this.forbidOverlayBtn = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!node.data.c_dzfx_file) {
|
|
|
|
+ console.log("未进行叠置分析");
|
|
|
|
+ this.forbidOverlayBtn = false;
|
|
|
|
+ }
|
|
this.currentModifiedModelId = node.data.id;
|
|
this.currentModifiedModelId = node.data.id;
|
|
- this.overlayBtnChecked = false;
|
|
|
|
|
|
+ this.currentOverlayFile = node.data.c_dzfx_file;
|
|
|
|
+ console.log(this.currentModifiedModelId, "currentModifiedModelId");
|
|
|
|
+ console.log(this.currentOverlayFile, "currentOverlayFile");
|
|
|
|
+
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
if (this.$refs.transferTree) {
|
|
if (this.$refs.transferTree) {
|
|
this.$refs.transferTree.setCheckedKeys([]);
|
|
this.$refs.transferTree.setCheckedKeys([]);
|
|
@@ -479,20 +486,16 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 修改模型 -- 直接调用修改模型接口
|
|
// 修改模型 -- 直接调用修改模型接口
|
|
- modifyModel() {
|
|
|
|
|
|
+ modifyModel(type, bindData) {
|
|
console.log("这一步是修改模型");
|
|
console.log("这一步是修改模型");
|
|
- let newData = this.checkedList.filter((v) => {
|
|
|
|
- if (layerAuthorityMap.has(v) && layerAuthorityMap.get(v) === "有权限") {
|
|
|
|
- return v;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+
|
|
console.log(this.currentModifiedModelId, "model id");
|
|
console.log(this.currentModifiedModelId, "model id");
|
|
let obj = {
|
|
let obj = {
|
|
id: this.currentModifiedModelId,
|
|
id: this.currentModifiedModelId,
|
|
title: this.inputName,
|
|
title: this.inputName,
|
|
content: this.inputName,
|
|
content: this.inputName,
|
|
c_level: "1",
|
|
c_level: "1",
|
|
- c_bind_layer: JSON.stringify(newData),
|
|
|
|
|
|
+ c_bind_layer: JSON.stringify(bindData),
|
|
c_user_id: localStorage.getItem("USER_ID"),
|
|
c_user_id: localStorage.getItem("USER_ID"),
|
|
};
|
|
};
|
|
let modifyParams = new FormData();
|
|
let modifyParams = new FormData();
|
|
@@ -509,10 +512,16 @@ export default {
|
|
});
|
|
});
|
|
this.$store.state.customModelsArr.push({
|
|
this.$store.state.customModelsArr.push({
|
|
name: this.inputName,
|
|
name: this.inputName,
|
|
- data: newData,
|
|
|
|
|
|
+ data: bindData,
|
|
});
|
|
});
|
|
- this.$message.success("模型修改成功");
|
|
|
|
this.clearDialogVisible();
|
|
this.clearDialogVisible();
|
|
|
|
+ if (type === "alreadyOverlay") {
|
|
|
|
+ this.$message.success("系统已完成叠置分析,数据已保存!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (type === "notOverlay") {
|
|
|
|
+ this.$message.success("模型修改成功");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
);
|
|
);
|
|
@@ -604,7 +613,15 @@ export default {
|
|
this.$confirm("确认保存吗?").then(() => {
|
|
this.$confirm("确认保存吗?").then(() => {
|
|
// modify -- 改变数组类型
|
|
// modify -- 改变数组类型
|
|
if (this.$store.state.modelStatus === "modify") {
|
|
if (this.$store.state.modelStatus === "modify") {
|
|
- this.modifyModel();
|
|
|
|
|
|
+ let newData = this.checkedList.filter((v) => {
|
|
|
|
+ if (
|
|
|
|
+ layerAuthorityMap.has(v) &&
|
|
|
|
+ layerAuthorityMap.get(v) === "有权限"
|
|
|
|
+ ) {
|
|
|
|
+ return v;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.modifyModel("notOverlay", newData);
|
|
}
|
|
}
|
|
|
|
|
|
// console.log(this.$store.state.customModelsArr, "先获取的模型数据");
|
|
// console.log(this.$store.state.customModelsArr, "先获取的模型数据");
|
|
@@ -617,12 +634,25 @@ export default {
|
|
// 执行叠置分析
|
|
// 执行叠置分析
|
|
executeOverlay() {
|
|
executeOverlay() {
|
|
this.overlayBtnChecked = !this.overlayBtnChecked;
|
|
this.overlayBtnChecked = !this.overlayBtnChecked;
|
|
- if (this.overlayBtnChecked) {
|
|
|
|
- this.clearDialogVisible();
|
|
|
|
- this.$message.success("系统已完成叠置分析,数据已保存!");
|
|
|
|
- let tagretUrl = `${this.urlsCollection.overlayAnalysis}?modelId=${this.currentModifiedModelId}`;
|
|
|
|
|
|
+ if (this.overlayBtnChecked && !this.forbidOverlayBtn) {
|
|
|
|
+ // 进行叠置分析后,叠置分析结果会自动保存
|
|
|
|
+ // 当前勾选的图层并未自动保存,需要重新调用一次保存接口
|
|
|
|
+ let newData = this.checkedList.filter((v) => {
|
|
|
|
+ if (
|
|
|
|
+ layerAuthorityMap.has(v) &&
|
|
|
|
+ layerAuthorityMap.get(v) === "有权限"
|
|
|
|
+ ) {
|
|
|
|
+ return v;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ let bindLayer = newData.join(",");
|
|
|
|
+ let tagretUrl = `${this.urlsCollection.overlayAnalysis}?modelId=${this.currentModifiedModelId}&bindLayer=${bindLayer}`;
|
|
this.$Get(tagretUrl).then((res) => {
|
|
this.$Get(tagretUrl).then((res) => {
|
|
- console.log(JSON.parse(res), "叠置分析的结果");
|
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ console.log(res, "叠置分析的结果");
|
|
|
|
+ let address = this.uploadBaseUrl+res.content;
|
|
|
|
+ this.modifyModel("alreadyOverlay", newData);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -853,6 +883,9 @@ export default {
|
|
justify-content: center;
|
|
justify-content: center;
|
|
position: relative;
|
|
position: relative;
|
|
top: 14px;
|
|
top: 14px;
|
|
|
|
+ &.forbidden {
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
+ }
|
|
&-icon {
|
|
&-icon {
|
|
width: 25px;
|
|
width: 25px;
|
|
height: 25px;
|
|
height: 25px;
|