123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- <template>
- <div class="scjg">
- <div>
- <div class="downloadDiv">
- <span>项目名称:{{ ruleForm.name }}</span>
- <el-button type="primary" size="mini" @click="download">
- 导出报告
- </el-button>
- </div>
- <div>分析面积:{{ ruleForm.xzmj }}平方千米</div>
- </div>
- <div v-for="(eitem, i) in echarts" :key="i" class="echars">
- <div class="echartTitle">
- <div class="block-title">{{ eitem.label }}</div>
- <div
- class="eicon"
- :class="eitem.iseyes ? 'eyes' : 'close_eyes'"
- @click="eyesChaneg(i)"
- ></div>
- <div
- class="eicon"
- :class="eitem.isshow ? 'eshow' : 'eclose'"
- @click="eitem.isshow = !eitem.isshow"
- ></div>
- </div>
- <pie v-show="eitem.isshow" class="echart" :ref="`echartRef`"></pie>
- </div>
- <!-- v-show="isshow" -->
- </div>
- </template>
- <script>
- import pie from "@/components/echartsTemplate/pie.vue";
- import hgxfx from "../../../../static/data/ghss/data.js";
- export default {
- components: { pie },
- props: {
- scjgObj: {
- type: Object,
- },
- jgTable: {
- type: Boolean,
- },
- },
- data() {
- return {
- echarts: [
- { label: "现状分析", iseyes: false, isshow: true },
- { label: "三线分析", iseyes: false, isshow: true },
- // { label: "土地利用规划分析", iseyes: false, isshow: false },
- { label: "详细规划分析", iseyes: false, isshow: false },
- ],
- ruleForm: {
- name: "",
- xzmj: "",
- fileList: [],
- },
- dataSources: {},
- };
- },
- mounted() {
- this.ruleForm.name = hgxfx.name;
- this.ruleForm.xzmj = hgxfx.xzmj;
- this.setEchart1();
- this.setEchart2();
- // this.setEchart3();
- this.setEchart4();
- },
- methods: {
- eyesChaneg(i) {
- this.echarts[i].iseyes = !this.echarts[i].iseyes;
- let label = this.echarts[i].label;
- let id = "scjg" + i;
- if (this.dataSources[id]) {
- this.dataSources[id].show = this.echarts[i].iseyes;
- } else this.addPolygon(label, id);
- // emit("eyesChaneg");
- },
- setEchart1() {
- this.$nextTick(() => {
- this.$refs.echartRef[0].setOptions(hgxfx.xzfxlist);
- });
- },
- setEchart2() {
- this.$nextTick(() => {
- this.$refs.echartRef[1].setOptions(hgxfx.sxfxlist);
- });
- },
- setEchart3() {
- this.$nextTick(() => {
- this.$refs.echartRef[2].setOptions(hgxfx.tdlylist);
- });
- },
- setEchart4() {
- this.$nextTick(() => {
- this.$refs.echartRef[2].setOptions(hgxfx.xxghlist);
- });
- },
- // 加载GeoJSON数据
- addPolygon(label, id) {
- let _this = this;
- // viewer.entities.removeAll();
- let polygon = Cesium.GeoJsonDataSource.load(
- `/static/data/ghss/${label}.geojson`,
- { clampToGround: true }
- );
- polygon.then(function (dataSource) {
- // dataSource.id = id;
- // 将数据源添加到Cesium Viewer
- viewer.dataSources.add(dataSource);
- viewer.zoomTo(dataSource);
- _this.dataSources[id] = dataSource;
- // 可以获取实体并进行操作
- // dataSource.entities.values.forEach((entity) => {
- // // 你可以在这里设置实体的属性,例如位置、颜色等
- // // console.log(entity);
- // });
- });
- },
- download() {
- window.open(this.$props.scjgObj.task.fxbg);
- },
- viewReport() {
- window.open(
- this.$props.scjgObj.task.fxbg.replace(".docx", ".pdf"),
- "_blank"
- );
- },
- reset() {
- this.dataSources = {};
- viewer.dataSources.removeAll();
- },
- },
- // watch(
- // () => prop.scjgObj,
- // (newValue, oldValue) => {
- // this.jcfwlist[0].value = newValue.task.fxmj + "m²";
- // nextTick(() => {
- // this.setEcharts(newValue);
- // });
- // }
- // );
- watch: {},
- };
- </script>
- <style lang="scss" scoped>
- .scjg {
- height: 100%;
- overflow-y: auto;
- overflow-x: hidden;
- line-height: 40px;
- .downloadDiv {
- span {
- width: calc(100% - 100px);
- display: inline-block;
- }
- }
- .echars {
- margin-bottom: 10px;
- .echartTitle {
- width: 100%;
- height: 40px;
- display: flex;
- justify-content: space-between;
- background: rgba(38, 38, 38, 0.9);
- margin-right: 10px;
- line-height: 40px;
- .block-title {
- width: calc(100% - 80px);
- }
- .eicon {
- width: 30px;
- height: 30px;
- margin: 5px;
- background-size: 100% 100%;
- }
- .eyes {
- background-image: url("/static/images/ghzc/eyes.png");
- }
- .close_eyes {
- background-image: url("/static/images/ghzc/close_eyes.png");
- }
- .eshow {
- background-image: url("/static/images/ghzc/to_bottom.png");
- }
- .eclose {
- background-image: url("/static/images/ghzc/to_right.png");
- }
- }
- .echart {
- width: 380px;
- height: 150px;
- }
- }
- }
- </style>
|