|
@@ -14,6 +14,7 @@
|
|
|
<el-scrollbar class="left-tree">
|
|
|
<el-tree
|
|
|
:data="options"
|
|
|
+ :props="defaultProps"
|
|
|
highlight-current
|
|
|
show-checkbox
|
|
|
node-key="value"
|
|
@@ -88,12 +89,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { GetFxyzList } from "../../../api/ghss/ghxz.js";
|
|
|
export default {
|
|
|
components: {},
|
|
|
props: {
|
|
|
- dialogVisible: {
|
|
|
- type: Boolean,
|
|
|
- },
|
|
|
tableData: {
|
|
|
type: Array,
|
|
|
},
|
|
@@ -101,25 +100,30 @@ export default {
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ defaultProps: {
|
|
|
+ children: "children",
|
|
|
+ label: "yxyzmc",
|
|
|
+ },
|
|
|
+ dialogVisible: false,
|
|
|
options: [
|
|
|
- {
|
|
|
- value: "控制线",
|
|
|
- label: "规划控制线",
|
|
|
- disabled: false,
|
|
|
- children: [],
|
|
|
- },
|
|
|
- {
|
|
|
- value: "专项规划",
|
|
|
- label: "专项规划",
|
|
|
- disabled: false,
|
|
|
- children: [],
|
|
|
- },
|
|
|
- {
|
|
|
- value: "基础设施",
|
|
|
- label: "兴趣点",
|
|
|
- disabled: false,
|
|
|
- children: [],
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // value: "控制线",
|
|
|
+ // label: "规划控制线",
|
|
|
+ // disabled: false,
|
|
|
+ // children: [],
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // value: "专项规划",
|
|
|
+ // label: "专项规划",
|
|
|
+ // disabled: false,
|
|
|
+ // children: [],
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // value: "基础设施",
|
|
|
+ // label: "兴趣点",
|
|
|
+ // disabled: false,
|
|
|
+ // children: [],
|
|
|
+ // },
|
|
|
],
|
|
|
kxyzList: [
|
|
|
{
|
|
@@ -540,21 +544,50 @@ export default {
|
|
|
selectdialogData: [],
|
|
|
dialogData: [],
|
|
|
conditionList: [
|
|
|
- { label: "范围内", value: "C" },
|
|
|
- { label: "范围外", value: "N" },
|
|
|
- { label: "距离包含", value: "A" },
|
|
|
- { label: "距离不包含", value: "B" },
|
|
|
- { label: "分析", value: "F" },
|
|
|
+ { label: "范围内", value: "identity" },
|
|
|
+ { label: "范围外", value: "n_identity" },
|
|
|
+ { label: "距离包含", value: "contain" },
|
|
|
+ { label: "距离不包含", value: "n_contain" },
|
|
|
+ // { label: "分析", value: "F" },contain,n_contain,相交/不相交::identity,n_identity
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getList();
|
|
|
+ // this.getList();
|
|
|
+ this.GetFxyzList();
|
|
|
+ this.getTreeList();
|
|
|
},
|
|
|
methods: {
|
|
|
close() {
|
|
|
- this.$parent.dialogVisible = false;
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
+ GetFxyzList() {
|
|
|
+ GetFxyzList().then((res) => {
|
|
|
+ this.kxyzList = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ getTreeList() {
|
|
|
+ function arrayToTreeLoop(nodes) {
|
|
|
+ const map = {};
|
|
|
+ const tree = [];
|
|
|
+ for (const node of nodes) {
|
|
|
+ map[node.bsm] = { ...node, children: [] };
|
|
|
+ }
|
|
|
+ for (const node of Object.values(map)) {
|
|
|
+ if (node.parent_bsm === null) {
|
|
|
+ tree.push(node);
|
|
|
+ } else {
|
|
|
+ map[node.parent_bsm].children.push(node);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return tree;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.options = arrayToTreeLoop(this.kxyzList);
|
|
|
+ this.optionsTemp = JSON.parse(JSON.stringify(this.options));
|
|
|
},
|
|
|
+
|
|
|
getList() {
|
|
|
// yzlist().then((res) => {
|
|
|
// if (res.success) {
|
|
@@ -578,16 +611,21 @@ export default {
|
|
|
let tableList = [];
|
|
|
selectdata.forEach((item) => {
|
|
|
tableList.push({
|
|
|
- name: item.label,
|
|
|
- condition: item.yztj,
|
|
|
- id: item.value,
|
|
|
- type: item.type,
|
|
|
+ // name: item.label,
|
|
|
+ // condition: item.yztj,
|
|
|
+ // id: item.value,
|
|
|
+ // type: item.type,
|
|
|
+ // value: "",
|
|
|
+ // sjy: item.sjy,
|
|
|
+ // sjlx: item.sjlx,
|
|
|
+ id: item.bsm,
|
|
|
+ name: item.yxyzmc,
|
|
|
+ condition: item.spatial_type,
|
|
|
value: "",
|
|
|
- sjy: item.sjy,
|
|
|
- sjlx: item.sjlx,
|
|
|
+ sjy: item.has_yxz,
|
|
|
+ sjlx: item.spatial_type,
|
|
|
});
|
|
|
});
|
|
|
- console.log(this.options);
|
|
|
tableList.forEach((item) => {
|
|
|
this.resetTree(this.options, item);
|
|
|
});
|
|
@@ -595,12 +633,11 @@ export default {
|
|
|
return tableList;
|
|
|
},
|
|
|
resetTree(data, item1) {
|
|
|
- console.log(data, item1);
|
|
|
data.forEach((item, index) => {
|
|
|
- if (item.value == item1.id) {
|
|
|
+ if (item.bsm == item1.id) {
|
|
|
data.splice(index, 1);
|
|
|
}
|
|
|
- if (item.children != undefined) {
|
|
|
+ if (item.children != undefined && item.children.length != 0) {
|
|
|
this.resetTree(item.children, item1);
|
|
|
}
|
|
|
});
|
|
@@ -626,12 +663,10 @@ export default {
|
|
|
}
|
|
|
|
|
|
let list = this.$refs.tree.getCheckedNodes().filter((item) => {
|
|
|
- return item.children == undefined;
|
|
|
+ return item.children == undefined || item.children.length == 0;
|
|
|
});
|
|
|
- console.log(list);
|
|
|
list = this.setTable(list);
|
|
|
this.dialogData = [...this.dialogData, ...list];
|
|
|
- console.log(this.dialogData, "this.dialogData");
|
|
|
},
|
|
|
turnRightToLeft() {
|
|
|
if (this.selectdialogData.length == 0) {
|
|
@@ -655,7 +690,6 @@ export default {
|
|
|
this.selectdialogData = val;
|
|
|
},
|
|
|
submit() {
|
|
|
- console.log(this.dialogData);
|
|
|
var sign = true;
|
|
|
this.dialogData.forEach((item) => {
|
|
|
item.type && item.value == "" && (sign = false);
|
|
@@ -664,7 +698,7 @@ export default {
|
|
|
// parent.emit("update:tableData", this.dialogData);
|
|
|
// parent.emit("update:dialogVisible", false);
|
|
|
this.$parent.tableData = this.dialogData;
|
|
|
- this.$parent.dialogVisible = false;
|
|
|
+ this.dialogVisible = false;
|
|
|
} else {
|
|
|
this.$message.warning("请将信息补充完整!");
|
|
|
}
|