|
@@ -163,6 +163,7 @@ export default {
|
|
|
filterText: "",
|
|
|
createModelParams: {
|
|
|
title: "",
|
|
|
+ content: "",
|
|
|
// 叠置分析geojson附件
|
|
|
// c_dzfx_file: "",
|
|
|
// 类型 -- 公开:1; 私人: 0
|
|
@@ -183,6 +184,7 @@ export default {
|
|
|
notAllowedStyle: {
|
|
|
cursor: "pointer",
|
|
|
},
|
|
|
+ currentModifiedModelId: "",
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -203,19 +205,15 @@ export default {
|
|
|
let btn = document.getElementById("leftArrowBtn");
|
|
|
if (btn) {
|
|
|
if (val.length === this.checkArr.length) {
|
|
|
- // btn.style.cursor = "not-allowed";
|
|
|
this.isLeftTransferBtn = false;
|
|
|
}
|
|
|
if (val.length < this.checkArr.length) {
|
|
|
- // btn.style.cursor = "pointer";
|
|
|
-
|
|
|
this.isLeftTransferBtn = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- console.log(val, "checkedList");
|
|
|
+ // console.log(val, "checkedList");
|
|
|
},
|
|
|
-
|
|
|
},
|
|
|
created() {
|
|
|
this.checkedKeysArr = [];
|
|
@@ -238,6 +236,8 @@ export default {
|
|
|
this.$bus.$on("updateModel", (node) => {
|
|
|
console.log("监听模型中");
|
|
|
console.log(node, "节点数据");
|
|
|
+ this.currentModifiedModelId = node.data.id;
|
|
|
+ this.overlayBtnChecked = false;
|
|
|
this.$nextTick(() => {
|
|
|
if (this.$refs.transferTree) {
|
|
|
this.$refs.transferTree.setCheckedKeys([]);
|
|
@@ -428,24 +428,24 @@ export default {
|
|
|
console.log(err, "接口请求失败,我的任务 - selectContentList");
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ if (data.mainType === "预设模型") {
|
|
|
+ layerAuthorityMap.set(data.id, "有权限");
|
|
|
+ }
|
|
|
} else {
|
|
|
- console.log(data.id);
|
|
|
- console.log(this.checkedKeysArr, "previous");
|
|
|
if (this.checkedKeysArr.includes(data.id)) {
|
|
|
this.checkedKeysArr = this.checkedKeysArr.filter((v) => {
|
|
|
return v !== data.id;
|
|
|
});
|
|
|
}
|
|
|
- console.log(this.checkedKeysArr, "checkedKeysArr");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // console.log(this.$refs.transferTree.getCheckedKeys(),"getCheckedKeys");
|
|
|
},
|
|
|
// 添加模型
|
|
|
addModel() {
|
|
|
// 设置需要添加的参数
|
|
|
this.createModelParams.title = this.inputName;
|
|
|
+ this.createModelParams.content = this.inputName;
|
|
|
this.createModelParams.c_user_id = localStorage.getItem("USER_ID") || 4;
|
|
|
|
|
|
let newData = this.checkedList.filter((v) => {
|
|
@@ -478,53 +478,44 @@ export default {
|
|
|
this.$message.info("模型保存失败");
|
|
|
});
|
|
|
},
|
|
|
- // 修改模型 -- 需要先删除当前模型再添加新模型
|
|
|
+ // 修改模型 -- 直接调用修改模型接口
|
|
|
modifyModel() {
|
|
|
console.log("这一步是修改模型");
|
|
|
- let deleteParams = {
|
|
|
- id: customModelIdMap.get(this.inputName).id,
|
|
|
+ let newData = this.checkedList.filter((v) => {
|
|
|
+ if (layerAuthorityMap.has(v) && layerAuthorityMap.get(v) === "有权限") {
|
|
|
+ return v;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(this.currentModifiedModelId, "model id");
|
|
|
+ let obj = {
|
|
|
+ id: this.currentModifiedModelId,
|
|
|
+ title: this.inputName,
|
|
|
+ content: this.inputName,
|
|
|
+ c_level: "1",
|
|
|
+ c_bind_layer: JSON.stringify(newData),
|
|
|
+ c_user_id: localStorage.getItem("USER_ID"),
|
|
|
+ };
|
|
|
+ let modifyParams = new FormData();
|
|
|
+ modifyParams = {
|
|
|
columnId: 89,
|
|
|
- state: 4,
|
|
|
+ modelId: 94,
|
|
|
+ content: JSON.stringify(obj),
|
|
|
};
|
|
|
- console.log(deleteParams);
|
|
|
- this.$Post(this.urlsCollection.updateAudit, deleteParams).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- console.log("已删除当前模型");
|
|
|
- if (this.$store.state.customModelsArr.length > 0) {
|
|
|
+ this.$Post(this.urlsCollection.updateContent, modifyParams).then(
|
|
|
+ (res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
this.$store.state.customModelsArr.filter((v) => {
|
|
|
return v.name !== this.inputName;
|
|
|
});
|
|
|
+ this.$store.state.customModelsArr.push({
|
|
|
+ name: this.inputName,
|
|
|
+ data: newData,
|
|
|
+ });
|
|
|
+ this.$message.success("模型修改成功");
|
|
|
+ this.clearDialogVisible();
|
|
|
}
|
|
|
-
|
|
|
- // 设置需要添加的参数
|
|
|
- this.createModelParams.title = this.inputName;
|
|
|
- this.createModelParams.c_user_id =
|
|
|
- localStorage.getItem("USER_ID") || 4;
|
|
|
-
|
|
|
- this.createModelParams.c_bind_layer = JSON.stringify(
|
|
|
- this.checkedList
|
|
|
- );
|
|
|
- let modifyParams = new FormData();
|
|
|
- modifyParams = {
|
|
|
- columnId: 89,
|
|
|
- modelId: 94,
|
|
|
- content: JSON.stringify(this.createModelParams),
|
|
|
- };
|
|
|
-
|
|
|
- this.$Post(this.urlsCollection.addContent, modifyParams).then(
|
|
|
- (modifyRes) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success("模型已修改");
|
|
|
- this.$store.state.customModelsArr.push({
|
|
|
- name: this.inputName,
|
|
|
- data: this.checkedList,
|
|
|
- });
|
|
|
- this.clearDialogVisible();
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
}
|
|
|
- });
|
|
|
+ );
|
|
|
},
|
|
|
deleteCheckList() {
|
|
|
// console.log("点击左侧按钮");
|
|
@@ -626,8 +617,14 @@ export default {
|
|
|
// 执行叠置分析
|
|
|
executeOverlay() {
|
|
|
this.overlayBtnChecked = !this.overlayBtnChecked;
|
|
|
- // alert("正在开发中");
|
|
|
- // console.log("execute overlay");
|
|
|
+ if (this.overlayBtnChecked) {
|
|
|
+ this.clearDialogVisible();
|
|
|
+ this.$message.success("系统已完成叠置分析,数据已保存!");
|
|
|
+ let tagretUrl = `${this.urlsCollection.overlayAnalysis}?modelId=${this.currentModifiedModelId}`;
|
|
|
+ this.$Get(tagretUrl).then((res) => {
|
|
|
+ console.log(JSON.parse(res), "叠置分析的结果");
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
};
|