|
@@ -28,15 +28,13 @@
|
|
|
@click="eitem.isshow = !eitem.isshow"
|
|
|
></div>
|
|
|
</div>
|
|
|
- <pie
|
|
|
- v-if="eitem.scxstyle == 0"
|
|
|
+ <scjgContent
|
|
|
+ :ref="`contentRef${eitem.id}`"
|
|
|
v-show="eitem.isshow"
|
|
|
- class="echart"
|
|
|
- :class="`echart${eitem.dataList.length <= 6 ? '' : '_vertical'}`"
|
|
|
- unit="亩"
|
|
|
- @echartClick="(name, iseyes) => echartClick(name, iseyes, i)"
|
|
|
- :ref="`echartRef${eitem.id}`"
|
|
|
- ></pie>
|
|
|
+ :litem="eitem"
|
|
|
+ :piseyes="eitem.iseyes"
|
|
|
+ @mapview="changeDataSources"
|
|
|
+ ></scjgContent>
|
|
|
<el-collapse v-if="eitem.lchildren.length" v-show="eitem.isshow">
|
|
|
<collRecursiveTree
|
|
|
:data="eitem.lchildren"
|
|
@@ -53,7 +51,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import pie from "@/components/echartsTemplate/pie.vue";
|
|
|
+import scjgContent from "./scjgContent.vue";
|
|
|
import collRecursiveTree from "./collRecursiveTree.vue";
|
|
|
import { GetFxjg } from "@/api/ghss/hgxfx.js";
|
|
|
// import hgxfx from "../../../../static/data/ghss/data.js";
|
|
@@ -72,7 +70,7 @@ let colors = [
|
|
|
"#DCFFAF",
|
|
|
];
|
|
|
export default {
|
|
|
- components: { pie, collRecursiveTree },
|
|
|
+ components: { scjgContent, collRecursiveTree },
|
|
|
props: {
|
|
|
scjgObj: {
|
|
|
type: Object,
|
|
@@ -158,21 +156,14 @@ export default {
|
|
|
this.addPolygon(geom, id, color);
|
|
|
}
|
|
|
},
|
|
|
- echartClick(name, iseyes, index) {
|
|
|
- if (this.echarts[index].iseyes) {
|
|
|
- let click = this.echarts[index].dataList.filter((c) => c.name == name);
|
|
|
- if (click.length > 0)
|
|
|
- this.changeDataSources({
|
|
|
- geom: click[0].geom,
|
|
|
- id: click[0].id,
|
|
|
- iseyes,
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
setEchart(data, id) {
|
|
|
this.$nextTick(() => {
|
|
|
let type = data.length <= 6 ? "horizontal" : "vertical";
|
|
|
- this.$refs[`echartRef${id}`][0].setOptions({ data, type });
|
|
|
+ // this.$refs[`contentRef${id}`][0].$refs.echartRef.setOptions({
|
|
|
+ // data,
|
|
|
+ // type,
|
|
|
+ // });
|
|
|
+ this.$refs[`contentRef${id}`][0].setEchart(data, type);
|
|
|
});
|
|
|
},
|
|
|
// 加载GeoJSON数据
|
|
@@ -236,7 +227,7 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
+<style lang="scss">
|
|
|
.scjg {
|
|
|
height: 100%;
|
|
|
overflow-y: auto;
|
|
@@ -295,7 +286,6 @@ export default {
|
|
|
background-image: url("/static/images/ghzc/to_right.png");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.echart {
|
|
|
width: 380px;
|
|
|
height: 220px;
|