|
@@ -37,13 +37,12 @@
|
|
|
@echartClick="(name, iseyes) => echartClick(name, iseyes, i)"
|
|
|
:ref="`echartRef`"
|
|
|
></pie>
|
|
|
- <!-- <collapseTree
|
|
|
- v-if="eitem.lchildren.length"
|
|
|
- v-show="eitem.isshow"
|
|
|
- :treeData="eitem.lchildren"
|
|
|
- ></collapseTree> -->
|
|
|
<el-collapse v-if="eitem.lchildren.length" v-show="eitem.isshow">
|
|
|
- <recursiveTree :data="eitem.lchildren"></recursiveTree>
|
|
|
+ <collRecursiveTree
|
|
|
+ :data="eitem.lchildren"
|
|
|
+ :piseyes="eitem.iseyes"
|
|
|
+ @mapview="changeDataSources"
|
|
|
+ ></collRecursiveTree>
|
|
|
</el-collapse>
|
|
|
</div>
|
|
|
<!-- <div class="bottomBtns">
|
|
@@ -55,10 +54,9 @@
|
|
|
|
|
|
<script>
|
|
|
import pie from "@/components/echartsTemplate/pie.vue";
|
|
|
-import collapseTree from "./collapseTree.vue";
|
|
|
-import recursiveTree from "./recursive-tree.vue";
|
|
|
+import collRecursiveTree from "./collRecursiveTree.vue";
|
|
|
import { GetFxjg } from "@/api/ghss/hgxfx.js";
|
|
|
-import hgxfx from "../../../../static/data/ghss/data.js";
|
|
|
+// import hgxfx from "../../../../static/data/ghss/data.js";
|
|
|
import parse from "wellknown";
|
|
|
let dataSourceList = {};
|
|
|
let colors = [
|
|
@@ -74,7 +72,7 @@ let colors = [
|
|
|
"#DCFFAF"
|
|
|
];
|
|
|
export default {
|
|
|
- components: { pie, collapseTree, recursiveTree },
|
|
|
+ components: { pie, collRecursiveTree },
|
|
|
props: {
|
|
|
scjgObj: {
|
|
|
type: Object
|
|
@@ -101,31 +99,31 @@ export default {
|
|
|
initData() {
|
|
|
this.echarts = [];
|
|
|
this.$emit("updateParent", "loading", true);
|
|
|
- // GetFxjg({ bsm: this.$props.scjgObj.bsm }).then(res => {
|
|
|
- // if (res.success) {
|
|
|
- hgxfx.jg.data.forEach((e, ei) => {
|
|
|
- let c = e.dataList || [];
|
|
|
- c.map(ci => {
|
|
|
- ci.name = ci.yslx_name || ci.scxname;
|
|
|
- ci.value = this.compute(ci.mj);
|
|
|
- ci.id = ci.yslx || ci.scxbsm;
|
|
|
- ci.geom = ci.geom || (ci.data ? ci.data.geom : "");
|
|
|
- // ci.label = ci.mc_name;
|
|
|
- });
|
|
|
- this.echarts.push({
|
|
|
- id: e.scxbsm,
|
|
|
- label: e.scxname,
|
|
|
- children: c,
|
|
|
- lchildren: e.children || [],
|
|
|
- iseyes: false,
|
|
|
- isshow: false
|
|
|
- });
|
|
|
- if (c.length > 0) this.setEchart(c, ei);
|
|
|
- // if (e.children) console.log(e.children)
|
|
|
+ GetFxjg({ bsm: this.$props.scjgObj.bsm }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ res.data.forEach((e, ei) => {
|
|
|
+ let c = e.dataList || [];
|
|
|
+ c.map(ci => {
|
|
|
+ ci.name = ci.yslx_name || ci.scxname;
|
|
|
+ ci.value = this.compute(ci.mj);
|
|
|
+ ci.id = ci.yslx || ci.scxbsm;
|
|
|
+ ci.geom = ci.geom || (ci.data ? ci.data.geom : "");
|
|
|
+ // ci.label = ci.mc_name;
|
|
|
+ });
|
|
|
+ this.echarts.push({
|
|
|
+ id: e.scxbsm,
|
|
|
+ label: e.scxname,
|
|
|
+ children: c,
|
|
|
+ lchildren: e.children || [],
|
|
|
+ iseyes: false,
|
|
|
+ isshow: false
|
|
|
+ });
|
|
|
+ if (c.length > 0) this.setEchart(c, ei);
|
|
|
+ // if (e.children) console.log(e.children)
|
|
|
+ });
|
|
|
+ this.$emit("updateParent", "loading", false);
|
|
|
+ }
|
|
|
});
|
|
|
- this.$emit("updateParent", "loading", false);
|
|
|
- // }
|
|
|
- // });
|
|
|
},
|
|
|
eyesChaneg(i) {
|
|
|
this.echarts[i].iseyes = !this.echarts[i].iseyes;
|
|
@@ -136,9 +134,22 @@ export default {
|
|
|
this.echarts[i].children.forEach((child, ci) => {
|
|
|
this.changeDataSources({ ...child, iseyes }, colors[ci]);
|
|
|
});
|
|
|
+ this.lchangeDataSources(this.echarts[i].lchildren, iseyes);
|
|
|
// }
|
|
|
// emit("eyesChaneg");
|
|
|
},
|
|
|
+ lchangeDataSources(data, iseyes) {
|
|
|
+ data.forEach((child, ci) => {
|
|
|
+ if (child.dataList) {
|
|
|
+ child.dataList.forEach((ld, li) => {
|
|
|
+ this.changeDataSources({ ...ld, id: ld.yslx, iseyes }, colors[li]);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (child.children) {
|
|
|
+ this.lchangeDataSources(child.children, iseyes);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
changeDataSources({ geom, id, iseyes }, color) {
|
|
|
if (dataSourceList[id]) {
|
|
|
dataSourceList[id].show = iseyes;
|
|
@@ -170,7 +181,7 @@ export default {
|
|
|
// viewer.entities.removeAll();
|
|
|
let scolor = colors
|
|
|
? Cesium.Color.fromCssColorString(colors)
|
|
|
- : Cesium.Color.BLUE;
|
|
|
+ : Cesium.Color.RED;
|
|
|
let fcolor = colors
|
|
|
? Cesium.Color.fromCssColorString(colors)
|
|
|
: Cesium.Color.WHITE;
|