|
@@ -63,18 +63,37 @@
|
|
</div>
|
|
</div>
|
|
<div class="transfer-container-center">
|
|
<div class="transfer-container-center">
|
|
<div class="inner">
|
|
<div class="inner">
|
|
- <el-button
|
|
|
|
- size="normal"
|
|
|
|
- type="primary"
|
|
|
|
- icon="el-icon-arrow-left"
|
|
|
|
- @click="deleteCheckList"
|
|
|
|
- ></el-button>
|
|
|
|
- <el-button
|
|
|
|
- size="normal"
|
|
|
|
- type="primary"
|
|
|
|
- icon="el-icon-arrow-right"
|
|
|
|
- @click="addCheckList"
|
|
|
|
- ></el-button>
|
|
|
|
|
|
+ <el-tooltip
|
|
|
|
+ effect="light"
|
|
|
|
+ :content="
|
|
|
|
+ isLeftTransferBtn ? '移除不需要的图层' : '不可进行移除操作'
|
|
|
|
+ "
|
|
|
|
+ placement="top-end"
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ size="normal"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-arrow-left"
|
|
|
|
+ @click="deleteCheckList"
|
|
|
|
+ id="leftArrowBtn"
|
|
|
|
+ class="inner-left"
|
|
|
|
+ :class="{ 'allow-cursor': isLeftTransferBtn }"
|
|
|
|
+ ></el-button>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ <el-tooltip
|
|
|
|
+ effect="light"
|
|
|
|
+ :content="isRightTransferBtn ? '添加选中图层' : '不可进行添加操作'"
|
|
|
|
+ placement="top-end"
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ size="normal"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-arrow-right"
|
|
|
|
+ @click="addCheckList"
|
|
|
|
+ class="inner-right"
|
|
|
|
+ :class="{ 'allow-cursor': isRightTransferBtn }"
|
|
|
|
+ ></el-button>
|
|
|
|
+ </el-tooltip>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="transfer-container-right">
|
|
<div class="transfer-container-right">
|
|
@@ -146,15 +165,64 @@ export default {
|
|
transferData: [],
|
|
transferData: [],
|
|
filterText: "",
|
|
filterText: "",
|
|
transferTreeIdMap: new Map(),
|
|
transferTreeIdMap: new Map(),
|
|
- createModelParams: {},
|
|
|
|
|
|
+ createModelParams: {
|
|
|
|
+ // 叠置分析geojson附件
|
|
|
|
+ c_dzfx_file: "",
|
|
|
|
+ // 类型
|
|
|
|
+ c_level: "公开",
|
|
|
|
+ // 是否叠置分析
|
|
|
|
+ c_isOverlay: false,
|
|
|
|
+ // 绑定图层(json图层数组)
|
|
|
|
+ c_bind_layer: "",
|
|
|
|
+ // 用户id
|
|
|
|
+ c_user_id: "",
|
|
|
|
+ // 模型名称
|
|
|
|
+ c_model_name: "",
|
|
|
|
+ },
|
|
|
|
+ checkedKeysArr: [],
|
|
|
|
+ isLeftTransferBtn: false,
|
|
|
|
+ isRightTransferBtn: false,
|
|
|
|
+ allowStyle: {
|
|
|
|
+ cursor: "not-allowed",
|
|
|
|
+ },
|
|
|
|
+ notAllowedStyle: {
|
|
|
|
+ cursor: "pointer",
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
|
|
+ checkedKeysArr: {
|
|
|
|
+ handler(val) {
|
|
|
|
+ if (val.length === 0) {
|
|
|
|
+ // btn.style.cursor = "not-allowed";
|
|
|
|
+ this.isRightTransferBtn = false;
|
|
|
|
+ }
|
|
|
|
+ if (val.length > 0) {
|
|
|
|
+ // btn.style.cursor = "pointer";
|
|
|
|
+ this.isRightTransferBtn = true;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ immediate: true,
|
|
|
|
+ },
|
|
checkedList(val) {
|
|
checkedList(val) {
|
|
|
|
+ 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() {
|
|
created() {
|
|
|
|
+ this.checkedKeysArr = [];
|
|
this.getColumnList();
|
|
this.getColumnList();
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -294,19 +362,38 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
transferCheckChange(data, checked) {
|
|
transferCheckChange(data, checked) {
|
|
|
|
+ if (checked) {
|
|
|
|
+ this.checkedKeysArr.push(data.id);
|
|
|
|
+ } else {
|
|
|
|
+ if (this.checkedKeysArr.includes(data.id)) {
|
|
|
|
+ this.checkedKeysArr = this.checkedKeysArr.filter((v) => {
|
|
|
|
+ return v !== data.id;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// console.log(this.$refs.transferTree.getCheckedKeys(),"getCheckedKeys");
|
|
// console.log(this.$refs.transferTree.getCheckedKeys(),"getCheckedKeys");
|
|
},
|
|
},
|
|
deleteCheckList() {
|
|
deleteCheckList() {
|
|
- if (this.checkedList.length > 0) {
|
|
|
|
|
|
+ // console.log("点击左侧按钮");
|
|
|
|
+ if (
|
|
|
|
+ this.checkedList.length < this.checkArr.length &&
|
|
|
|
+ this.isLeftTransferBtn
|
|
|
|
+ ) {
|
|
|
|
+ console.log("可以进行左移操作");
|
|
|
|
+ this.checkArr = this.checkedList;
|
|
|
|
+ this.isLeftTransferBtn = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.checkedList.length === this.checkArr.length) {
|
|
|
|
+ console.log("不可以进行左移操作");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
addCheckList() {
|
|
addCheckList() {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
if (this.$refs.transferTree) {
|
|
if (this.$refs.transferTree) {
|
|
- console.log(
|
|
|
|
- this.$refs.transferTree.getCheckedKeys(),
|
|
|
|
- "当前选中的keys"
|
|
|
|
- );
|
|
|
|
|
|
+ this.checkedList = this.$refs.transferTree.getCheckedKeys();
|
|
|
|
+ this.checkArr = this.$refs.transferTree.getCheckedKeys();
|
|
|
|
+ console.log("当前选中的keys");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -348,7 +435,7 @@ export default {
|
|
this.$refs.transferTree.setCheckedKeys(this.checkedList);
|
|
this.$refs.transferTree.setCheckedKeys(this.checkedList);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- // this.checkedList = [];
|
|
|
|
|
|
+
|
|
this.inputName = "自定义模型1";
|
|
this.inputName = "自定义模型1";
|
|
},
|
|
},
|
|
saveModel() {
|
|
saveModel() {
|
|
@@ -381,9 +468,6 @@ export default {
|
|
data: this.checkedList,
|
|
data: this.checkedList,
|
|
});
|
|
});
|
|
|
|
|
|
- // let createModel = {
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
// 设置需要添加的参数
|
|
// 设置需要添加的参数
|
|
|
|
|
|
let params = new FormData();
|
|
let params = new FormData();
|
|
@@ -539,6 +623,18 @@ export default {
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
justify-content: space-around;
|
|
justify-content: space-around;
|
|
|
|
+ .inner-left {
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
+ &.allow-cursor {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .inner-right {
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
+ &.allow-cursor {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
&-right {
|
|
&-right {
|
|
@@ -575,8 +671,28 @@ export default {
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
position: relative;
|
|
position: relative;
|
|
left: 0;
|
|
left: 0;
|
|
- // margin-left: 0;
|
|
|
|
- // margin-right: 0;
|
|
|
|
|
|
+ .el-checkbox__input.is-checked + .el-checkbox__label {
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+ .el-checkbox__input.is-checked .el-checkbox__inner::after {
|
|
|
|
+ width: 70%;
|
|
|
|
+ height: 70%;
|
|
|
|
+ background: #74ffff;
|
|
|
|
+ border-radius: 0;
|
|
|
|
+ transform: rotate(0deg) scaleY(1);
|
|
|
|
+ position: static;
|
|
|
|
+ }
|
|
|
|
+ .el-checkbox__inner {
|
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
|
+ background: rgba(0, 170, 255, 0);
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ position: static;
|
|
|
|
+ &::after {
|
|
|
|
+ transition: 0ms;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
/deep/.el-checkbox_label {
|
|
/deep/.el-checkbox_label {
|
|
width: 200px;
|
|
width: 200px;
|