|
@@ -19,6 +19,7 @@
|
|
|
show-checkbox
|
|
|
node-key="id"
|
|
|
ref="tree"
|
|
|
+ :default-checked-keys="defaultArr"
|
|
|
></el-tree>
|
|
|
</el-scrollbar>
|
|
|
</el-col>
|
|
@@ -64,7 +65,11 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="defaultValue" label="约束值(m/°)" width="120">
|
|
|
+ <el-table-column
|
|
|
+ prop="defaultValue"
|
|
|
+ label="约束值(m/°)"
|
|
|
+ width="120"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
Onkeyup="this.value=this.value.replace(/[^\d^\.]+/g,'').replace(/^0+(\d)/,'$1').replace(/^\./,'0.').match(/\d+.?\d{0,2}/);this.dispatchEvent(new Event('input'))"
|
|
@@ -113,6 +118,8 @@ export default {
|
|
|
optionsTemp: [],
|
|
|
selectdialogData: [],
|
|
|
dialogData: [],
|
|
|
+ defaultArr: [], //用地类型选中后可选因子默认勾选的值
|
|
|
+ yzTableData: [], //用地类型选中后影响因子对应的值
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -120,8 +127,8 @@ export default {
|
|
|
this.GetFactorList();
|
|
|
},
|
|
|
methods: {
|
|
|
- testInput(val){
|
|
|
-val = Number(val)
|
|
|
+ testInput(val) {
|
|
|
+ val = Number(val);
|
|
|
},
|
|
|
close() {
|
|
|
this.dialogVisible = false;
|
|
@@ -187,9 +194,9 @@ val = Number(val)
|
|
|
// sjlx: item.spatial_type,
|
|
|
// yzbsm: item.bsm,
|
|
|
name: item.name,
|
|
|
- bsm:item.bsm,
|
|
|
- spatial_types:JSONItem.items,
|
|
|
- spatial_type:JSONItem.spatial_type,
|
|
|
+ bsm: item.bsm,
|
|
|
+ spatial_types: JSONItem.items,
|
|
|
+ spatial_type: JSONItem.spatial_type,
|
|
|
hasValue: JSONItem.hasValue, //是否可以填写约束值
|
|
|
defaultValue: Number(JSONItem.defaultValue), //约束值默认值
|
|
|
default: JSONItem.default, //默认选中条件
|
|
@@ -217,7 +224,9 @@ val = Number(val)
|
|
|
if (item.children != undefined && item.children.length == 0) {
|
|
|
if (item.parentNode) {
|
|
|
item.disabled = true;
|
|
|
- this.$refs.tree.setCheckedKeys([]);
|
|
|
+ if (this.$refs.tree) {//用地类型绑定后易出现找不到tree的情况
|
|
|
+ this.$refs.tree.setCheckedKeys([]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (item.children != undefined && item.children.length > 0) {
|
|
@@ -278,10 +287,10 @@ val = Number(val)
|
|
|
},
|
|
|
clearitem(item) {
|
|
|
this.options[0].children = this.options[0].children.filter((item1) => {
|
|
|
- return item.id != '';
|
|
|
+ return item.id != "";
|
|
|
});
|
|
|
this.options[1].children = this.options[1].children.filter((item1) => {
|
|
|
- return item.id != '';//item1.defaultValue
|
|
|
+ return item.id != ""; //item1.defaultValue
|
|
|
});
|
|
|
this.options[0].children.length == 0
|
|
|
? (this.options[0].disabled = true)
|
|
@@ -303,6 +312,20 @@ val = Number(val)
|
|
|
this.dialogData = JSON.parse(JSON.stringify(this.tableData));
|
|
|
this.setData(this.dialogData);
|
|
|
}
|
|
|
+ if (this.defaultArr.length) {
|
|
|
+ this.dialogData.forEach((item) => {
|
|
|
+ this.resetTree(this.options, item);
|
|
|
+ });
|
|
|
+ this.removeChildrenZero(this.options);
|
|
|
+ return this.dialogData;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ yzTableData(oldVal, newVal) {
|
|
|
+ let idArr = [];
|
|
|
+ this.yzTableData.forEach((item) => {
|
|
|
+ idArr.push(item.id);
|
|
|
+ });
|
|
|
+ this.defaultArr = idArr;
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -373,14 +396,14 @@ val = Number(val)
|
|
|
/deep/ .el-input__inner[type="number"] {
|
|
|
-webkit-appearance: none; /* 移除系统默认的外观样式 */
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/* 去除增加/减少数字按钮的样式 */
|
|
|
/deep/ .el-input__inner[type="number"]::-webkit-inner-spin-button,
|
|
|
.el-input__inner[type="number"]::-webkit-outer-spin-button {
|
|
|
-webkit-appearance: none; /* 移除输入框两侧的上下箭头 */
|
|
|
margin: 0; /* 移除上下箭头与文本之间的间隔 */
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/* 去除Firefox浏览器中的一些特定样式 */
|
|
|
/deep/ .el-input__inner[type="number"]::-moz-inner-spin-button {
|
|
|
-moz-appearance: none; /* 移除Firefox中的上下箭头 */
|