|
@@ -0,0 +1,365 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="fxjg">
|
|
|
|
+ <div class="downloadDiv">
|
|
|
|
+ <div>
|
|
|
|
+ <span class="xmmc">
|
|
|
|
+ 项目名称:
|
|
|
|
+ <span class="text">{{ scjgObj.xmmc }}</span>
|
|
|
|
+ </span>
|
|
|
|
+ <div
|
|
|
|
+ class="eicon"
|
|
|
|
+ :class="isshowAll ? 'eyes' : 'close_eyes'"
|
|
|
|
+ @click="allChange('all')"
|
|
|
|
+ ></div>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ 预检分析面积:
|
|
|
|
+ <span class="text">{{ compute(scjgObj.fxmj) }}亩</span>
|
|
|
|
+ <span class="export" @click="download">导出报告</span>
|
|
|
|
+ </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>
|
|
|
|
+ <scjgContent
|
|
|
|
+ :ref="`contentRef${eitem.id}`"
|
|
|
|
+ v-show="eitem.isshow"
|
|
|
|
+ :litem="eitem"
|
|
|
|
+ :piseyes="eitem.iseyes"
|
|
|
|
+ @mapview="changeDataSources"
|
|
|
|
+ ></scjgContent>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- <div class="bottomBtns">
|
|
|
|
+ <span></span>
|
|
|
|
+ <span class="sureBtn" @click="download">导出报告</span>
|
|
|
|
+ </div> -->
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import scjgContent from "../../complianceAnalysis/components/scjgContent.vue";
|
|
|
|
+// import collRecursiveTree from "./collRecursiveTree.vue";
|
|
|
|
+import { GetFxjg } from "@/api/ghss/hgxfx.js";
|
|
|
|
+
|
|
|
|
+import parse from "wellknown";
|
|
|
|
+let dataSourceList = {};
|
|
|
|
+let colors = [
|
|
|
|
+ "#62ADED",
|
|
|
|
+ "#DFE15A",
|
|
|
|
+ "#6EDC8D",
|
|
|
|
+ "#00A42E",
|
|
|
|
+ "#F9B447",
|
|
|
|
+ "#7F4FE5",
|
|
|
|
+ "#FF6969",
|
|
|
|
+ "#27CED9",
|
|
|
|
+ "#DF56F5",
|
|
|
|
+ "#DCFFAF",
|
|
|
|
+];
|
|
|
|
+export default {
|
|
|
|
+ components: { scjgContent },
|
|
|
|
+ props: {
|
|
|
|
+ scjgObj: {
|
|
|
|
+ type: Object,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ echarts: [],
|
|
|
|
+ ruleForm: {
|
|
|
|
+ name: "",
|
|
|
|
+ xzmj: "",
|
|
|
|
+ fileList: [],
|
|
|
|
+ },
|
|
|
|
+ tempdataSourcesId: null,
|
|
|
|
+ fileid: 1,
|
|
|
|
+ reflist: {},
|
|
|
|
+ isshowAll: false,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ // this.initData();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ compute(mj) {
|
|
|
|
+ return mj ? (mj * 0.0015).toFixed(2) : 0;
|
|
|
|
+ },
|
|
|
|
+ addrefs(key, ref) {
|
|
|
|
+ this.reflist[key] = ref;
|
|
|
|
+ },
|
|
|
|
+ initData() {
|
|
|
|
+ console.log("----", this.$props.scjgObj);
|
|
|
|
+ this.echarts = [];
|
|
|
|
+ this.$emit("updateParent", "loading", true);
|
|
|
|
+ this.addPolygon(this.$props.scjgObj.geom, "all", "#ff0000", true);
|
|
|
|
+ GetFxjg({ bsm: this.$props.scjgObj.bsm }).then((res) => {
|
|
|
|
+ if (res.success) {
|
|
|
|
+ res.data.push({
|
|
|
|
+ bsm: "2d3f76707b4949cf9d55fdc2a1e3f36f",
|
|
|
|
+ children: [],
|
|
|
|
+ dataList: [],
|
|
|
|
+ jsf: 0,
|
|
|
|
+ rwbsm: "61581601570e45739bb47737ddf7379b",
|
|
|
|
+ scxbsm: "QHBH",
|
|
|
|
+ scxname: "整治前后土地利用结构变化",
|
|
|
|
+ scxstyle: 2,
|
|
|
|
+ });
|
|
|
|
+ res.data.push({
|
|
|
|
+ bsm: "2d3f76707b4949cf9d55fdc2a1e3f36f",
|
|
|
|
+ children: [],
|
|
|
|
+ dataList: [],
|
|
|
|
+ jsf: 0,
|
|
|
|
+ rwbsm: "61581601570e45739bb47737ddf7379b",
|
|
|
|
+ scxbsm: "XZGD",
|
|
|
|
+ scxname: "新增耕地",
|
|
|
|
+ scxstyle: 3,
|
|
|
|
+ area: 20,
|
|
|
|
+ area2: 2,
|
|
|
|
+ });
|
|
|
|
+ res.data.forEach((e) => {
|
|
|
|
+ let c = e.dataList || [];
|
|
|
|
+ c.map((ci) => {
|
|
|
|
+ ci.name = ci.yslx_name || ci.scxname;
|
|
|
|
+ // ci.value = this.compute(ci.mj);
|
|
|
|
+ ci.value = ci.mj;
|
|
|
|
+ ci.geom = ci.geom || "";
|
|
|
|
+ // ci.label = ci.mc_name;
|
|
|
|
+ });
|
|
|
|
+ this.echarts.push({
|
|
|
|
+ id: e.scxbsm,
|
|
|
|
+ label: e.scxname,
|
|
|
|
+ dataList: e.dataList,
|
|
|
|
+ lchildren: e.children || [],
|
|
|
|
+ iseyes: false,
|
|
|
|
+ isshow: false,
|
|
|
|
+ scxstyle: e.scxstyle,
|
|
|
|
+ });
|
|
|
|
+ if (e.scxstyle == 0) this.setEchart(c, e.scxbsm);
|
|
|
|
+ else if (e.scxstyle == 2) {
|
|
|
|
+ let jdData = {
|
|
|
|
+ legend_data: ["整治前", "整治后", "变化率"],
|
|
|
|
+ legendmap: [{ type: "bar" }, { type: "bar" }, { type: "line" }],
|
|
|
|
+ x_data: ["-sss-"],
|
|
|
|
+ params: {},
|
|
|
|
+ region: "",
|
|
|
|
+ result: [[10], [1], [10]],
|
|
|
|
+ };
|
|
|
|
+ this.setEchart(jdData, e.scxbsm);
|
|
|
|
+ }
|
|
|
|
+ if (e.children) this.lForEach(e.children, "echart");
|
|
|
|
+ });
|
|
|
|
+ this.$emit("updateParent", "loading", false);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ allChange(id) {
|
|
|
|
+ this.isshowAll = !this.isshowAll;
|
|
|
|
+ if (dataSourceList[id]) {
|
|
|
|
+ dataSourceList[id].show = this.isshowAll;
|
|
|
|
+ } else {
|
|
|
|
+ this.addPolygon(this.$props.scjgObj.geom, "all", "#ff0000", true);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ eyesChaneg(i) {
|
|
|
|
+ this.echarts[i].iseyes = !this.echarts[i].iseyes;
|
|
|
|
+ // if (i == 0 || i == 2) {
|
|
|
|
+ // this.changeDataSources(this.echarts[i]);
|
|
|
|
+ // } else {
|
|
|
|
+ let iseyes = this.echarts[i].iseyes;
|
|
|
|
+ if (this.echarts[i].dataList)
|
|
|
|
+ this.echarts[i].dataList.forEach((child, ci) => {
|
|
|
|
+ this.changeDataSources({ ...child, iseyes }, colors[ci]);
|
|
|
|
+ });
|
|
|
|
+ this.lForEach(this.echarts[i].lchildren, "sources", iseyes);
|
|
|
|
+ // }
|
|
|
|
+ // emit("eyesChaneg");
|
|
|
|
+ },
|
|
|
|
+ lForEach(data, fun, iseyes) {
|
|
|
|
+ data.forEach((child) => {
|
|
|
|
+ if (child.dataList) {
|
|
|
|
+ child.dataList.forEach((ld, li) => {
|
|
|
|
+ if (fun == "sources")
|
|
|
|
+ this.changeDataSources({ ...ld, iseyes }, "#62ADED");
|
|
|
|
+ else {
|
|
|
|
+ ld.name = ld.yslx_name;
|
|
|
|
+ ld.value = ld.mj;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if (child.children) {
|
|
|
|
+ this.lForEach(child.children, fun, iseyes);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (
|
|
|
|
+ fun == "echart" &&
|
|
|
|
+ child.scxstyle == 0 &&
|
|
|
|
+ child.scxbsm.indexOf("GGFWSS") >= 0
|
|
|
|
+ ) {
|
|
|
|
+ child.id = child.scxbsm;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.setEchart(child.dataList, child.id, child.id);
|
|
|
|
+ }, 200);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ changeDataSources({ geom, id, iseyes, iszoom }, color) {
|
|
|
|
+ if (iszoom) {
|
|
|
|
+ this.zoomTo(id, geom);
|
|
|
|
+ } else if (dataSourceList[id]) {
|
|
|
|
+ dataSourceList[id].show = iseyes;
|
|
|
|
+ this.tempdataSourcesId = null;
|
|
|
|
+ } else if (geom) {
|
|
|
|
+ this.addPolygon(geom, id, color);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ zoomTo(id, geom) {
|
|
|
|
+ let zid = "zoom" + id;
|
|
|
|
+ if (!dataSourceList[zid]) {
|
|
|
|
+ this.tempdataSourcesId = zid;
|
|
|
|
+ this.addPolygon(geom, zid, "#ff0000");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ setEchart(data, id, childid) {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ let type = null;
|
|
|
|
+ if (!data.legend_data)
|
|
|
|
+ type = data.length <= 6 ? "horizontal" : "vertical";
|
|
|
|
+ if (!childid) this.$refs[`contentRef${id}`][0].setEchart(data, type);
|
|
|
|
+ else {
|
|
|
|
+ this.reflist[`contentRef${id}`].setEchart(data, type, childid);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 加载GeoJSON数据
|
|
|
|
+ addPolygon(geom, id, colors, fillreset) {
|
|
|
|
+ let geojson = parse(geom);
|
|
|
|
+ console.log("---", geojson.type);
|
|
|
|
+ let _this = this;
|
|
|
|
+ // viewer.entities.removeAll();
|
|
|
|
+ let scolor = colors
|
|
|
|
+ ? Cesium.Color.fromCssColorString(colors)
|
|
|
|
+ : Cesium.Color.RED;
|
|
|
|
+ let fcolor =
|
|
|
|
+ colors && !fillreset
|
|
|
|
+ ? Cesium.Color.fromCssColorString(colors)
|
|
|
|
+ : Cesium.Color.WHITE;
|
|
|
|
+
|
|
|
|
+ let polygon = Cesium.GeoJsonDataSource.load(geojson, {
|
|
|
|
+ clampToGround: true,
|
|
|
|
+ stroke: scolor,
|
|
|
|
+ fill: fcolor.withAlpha(0.3), //注意:颜色必须大写,即不能为blue
|
|
|
|
+ strokeWidth: 5,
|
|
|
|
+ });
|
|
|
|
+ polygon.then(function (dataSource) {
|
|
|
|
+ // dataSource.id = id;
|
|
|
|
+ // 将数据源添加到Cesium Viewer
|
|
|
|
+ viewer.dataSources.add(dataSource);
|
|
|
|
+ viewer.zoomTo(dataSource);
|
|
|
|
+ dataSourceList[id] = dataSource;
|
|
|
|
+ if (id == "all") _this.isshowAll = true;
|
|
|
|
+ if (!geojson.type.includes("Polygon")) {
|
|
|
|
+ dataSource.entities.values.forEach((entity, ei) => {
|
|
|
|
+ if (entity.billboard) {
|
|
|
|
+ entity.billboard = new Cesium.BillboardGraphics({
|
|
|
|
+ image: "@/.././static/images/flypng/hos_point.png",
|
|
|
|
+ height: 40,
|
|
|
|
+ width: 40,
|
|
|
|
+ scale: 1.0,
|
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, -16),
|
|
|
|
+ });
|
|
|
|
+ // entity.point = {
|
|
|
|
+ // pixelsize: 20,
|
|
|
|
+ // color: Cesium.Color.fromCssColorString(colors),
|
|
|
|
+ // };
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ download() {
|
|
|
|
+ // window.open(this.$props.scjgObj.fxbg); //this.$props.scjgObj.task.fxbg
|
|
|
|
+ window.open(
|
|
|
|
+ window.axiosURI +
|
|
|
|
+ "/analyse/fzss/DownloadReport?filePath=" +
|
|
|
|
+ `${this.$props.scjgObj.fxbg}`
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ viewReport() {
|
|
|
|
+ window.open(this.$props.scjgObj.fxbg.replace(".docx", ".pdf"), "_blank");
|
|
|
|
+ },
|
|
|
|
+ reset() {
|
|
|
|
+ if (Object.keys(dataSourceList).length) viewer.dataSources.removeAll();
|
|
|
|
+ dataSourceList = {};
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // watch(
|
|
|
|
+ // () => prop.scjgObj,
|
|
|
|
+ // (newValue, oldValue) => {
|
|
|
|
+ // this.jcfwlist[0].value = newValue.task.fxmj + "m²";
|
|
|
|
+ // nextTick(() => {
|
|
|
|
+ // this.setEcharts(newValue);
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // );
|
|
|
|
+ watch: {
|
|
|
|
+ // scjgObj(newValue) {
|
|
|
|
+ // this.initData();
|
|
|
|
+ // },
|
|
|
|
+ //监听区域id的变化,用于删除上一次点击生成的geojson区域面
|
|
|
|
+ tempdataSourcesId(newVal, oldVal) {
|
|
|
|
+ if (oldVal) {
|
|
|
|
+ viewer.dataSources.remove(dataSourceList[oldVal]);
|
|
|
|
+ dataSourceList[oldVal] = undefined;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ beforeDestroy() {
|
|
|
|
+ viewer.entities.removeAll();
|
|
|
|
+ viewer.dataSources.removeAll();
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss">
|
|
|
|
+.fxjg {
|
|
|
|
+ height: 100%;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+ padding-right: 10px;
|
|
|
|
+ line-height: 40px;
|
|
|
|
+ .downloadDiv {
|
|
|
|
+ position: relative;
|
|
|
|
+ .xmmc {
|
|
|
|
+ width: calc(100% - 60px);
|
|
|
|
+ display: inline-block;
|
|
|
|
+ }
|
|
|
|
+ .export {
|
|
|
|
+ width: 95px;
|
|
|
|
+ height: 28px;
|
|
|
|
+ background: #0f7ac8;
|
|
|
|
+ text-align: center;
|
|
|
|
+ line-height: 32px;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 2px;
|
|
|
|
+ bottom: 6px;
|
|
|
|
+ }
|
|
|
|
+ .text {
|
|
|
|
+ color: #cddeeb;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|