maxiaoxiao 7 月之前
父節點
當前提交
92f6e18dd7

+ 0 - 1
src/components/echartsTemplate/sankey.vue

@@ -57,7 +57,6 @@ export default {
         // var dom = document.getElementById("sankey_echart");
         this.myChart = echarts.init(this.$refs.echart);
       }
-      console.log(option, "--", data, links);
       option.series.data = data;
       option.series.links = links;
       this.myChart.setOption(option);

+ 31 - 36
src/views/LandConsolidation/components/qhdb.vue

@@ -7,7 +7,7 @@
         v-model="tab1"
         placeholder="请选择"
         :popper-append-to-body="false"
-        @change="changeCharts"
+        @change="getData"
       >
         <el-option
           v-for="item in dboptions"
@@ -21,7 +21,7 @@
         v-model="tab"
         placeholder="请选择"
         :popper-append-to-body="false"
-        @change="changeCharts"
+        @change="Getqhdb"
       >
         <el-option
           v-for="item in options"
@@ -51,7 +51,7 @@ export default {
       jdData: {
         legend_data: ["整治前", "整治后", "变化率"],
         x_data: [],
-        yAxis: [{ name: "面积(公顷)" }, { name: "变化率(%)" }],
+        yAxis: [{ name: "面积(公顷)" }, { name: "变化面积(公顷)" }],
         legendmap: [{ type: "bar" }, { type: "bar" }, { type: "line" }],
         params: {},
         region: "",
@@ -61,20 +61,18 @@ export default {
         { name: "地类流向", value: 1 },
       ],
       options: [
-        { name: "试点区域", value: 0 },
-        { name: "整治区域", value: 1 },
+        { name: "试点区域", value: "sd" },
+        { name: "整治区域", value: "zz" },
       ],
       tab1: 0,
-      tab: 0,
+      tab: "sd",
     };
   },
   components: {
     barAndLine,
     sankey,
   },
-  mounted() {
-    this.getData();
-  },
+  mounted() {},
   methods: {
     contrast() {
       this.$emit("contrast");
@@ -88,20 +86,22 @@ export default {
     },
     getData() {
       this.$emit("updateParent", "loading", true);
-      this.Getqhdb();
+      if (this.tab1 == 0) {
+        this.Getqhdb();
+      } else this.Getlinks();
     },
     Getqhdb() {
       this.jdData.x_data = [];
       this.jdData.result = [[], [], []];
       QueryList({
-        jscType: "qytuzz_sdzl_tdlyqhdb_dlbh_sd",
+        jscType: `qytuzz_sdzl_tdlyqhdb_dlbh_${this.tab}`,
         id: this.region,
       }).then((res) => {
         res.data.forEach((jdData) => {
           this.jdData.x_data.push(jdData.dlbmmc);
           this.jdData.result[0].push(jdData.qtbdlmj.toFixed(2));
           this.jdData.result[1].push(jdData.htbdlmj.toFixed(2));
-          this.jdData.result[2].push((jdData.bhl * 100).toFixed(2));
+          this.jdData.result[2].push(jdData.bhl.toFixed(2));
         });
         this.setEchart(this.jdData, 1);
         this.$emit("updateParent", "loading", false);
@@ -110,34 +110,29 @@ export default {
     Getlinks() {
       let data = [],
         links = [];
-      district(this.params).then((res) => {
-        // res.data.forEach((jdData) => {
-        // });
-        data = [
-          { name: "a" },
-          { name: "b" },
-          { name: "a1" },
-          { name: "a2" },
-          { name: "b1" },
-          { name: "c" },
-        ];
-        links = [
-          { source: "a", target: "a1", value: 5 },
-          { source: "a", target: "a2", value: 3 },
-          { source: "b", target: "b1", value: 8 },
-          { source: "a", target: "b1", value: 3 },
-          { source: "b1", target: "a1", value: 1 },
-          { source: "b1", target: "c", value: 2 },
-        ];
+      QueryList({
+        jscType: `qytuzz_sdzl_tdlyqhdb_dllx_${this.tab}`,
+        id: this.region,
+      }).then((res) => {
+        res.data.forEach((lxdata) => {
+          if (lxdata.geom_area) {
+            if (!data.find((i) => i.name == lxdata.qdlbm))
+              data.push({ name: lxdata.qdlbm });
+            if (!data.find((i) => i.name == lxdata.hdlbm))
+              data.push({ name: lxdata.hdlbm });
+            links.push({
+              source: lxdata.qdlbm,
+              target: lxdata.hdlbm,
+              value: lxdata.geom_area,
+            });
+          }
+        });
+
         this.setEchart(data, 2, links);
         this.$emit("updateParent", "loading", false);
       });
     },
-    changeCharts(e) {
-      if (this.tab1 == 0) {
-        this.GetDistrict();
-      } else this.Getlinks();
-    },
+    changeCharts(e) {},
     setEchart(data, id, links) {
       this.$nextTick(() => {
         this.$refs[`echartRef${id}`].setOptions(data, links);

+ 244 - 0
src/views/LandConsolidation/components/xzlist.vue

@@ -0,0 +1,244 @@
+<template>
+  <div class="xzlist">
+    <custom-form ref="formRef" :model="pageObj" :config="formConfig">
+      <template #action>
+        <el-button
+          size="mini"
+          type="primary"
+          icon="el-icon-search"
+          @click="searchFun"
+        >
+        </el-button>
+      </template>
+    </custom-form>
+    <tablePage
+      class="tablePage"
+      :cloumn="cloumn"
+      :table="table"
+      :indexed="false"
+      layout="prev, pager,next"
+      ref="tableDialogRef"
+      @currentChange="searchFun"
+    >
+      <template #mj="{ row }">
+        {{ Number(row.crmj).toFixed(2) }}
+      </template>
+      <template #action="{ row }">
+        <span class="usable" @click="detail(row)">详情</span>
+      </template>
+    </tablePage>
+  </div>
+</template>
+
+<script>
+import tablePage from "@/components/mapView/tablePage.vue";
+import customForm from "@/components/mapView/custom-form.vue";
+
+import { GetList } from "@/api/Idleland.js";
+import { xzForm, xzTableHeader } from "./config";
+import { loadGeoJSON } from "@/utils/MapHelper/help.js";
+let geoSources = {};
+export default {
+  components: {
+    tablePage,
+    customForm,
+  },
+  props: {
+    type: {
+      type: String,
+    },
+    recordBsm: {
+      type: String,
+    },
+  },
+  data() {
+    return {
+      pageObj: {
+        key: "",
+        xzqh: "",
+        idleReason: "",
+        isConfirm: true,
+        pageNum: 1,
+        pageSize: 10,
+        isDisposal: false,
+        startTime: "",
+        endTime: "",
+      },
+      formConfig: xzForm,
+      cloumn: xzTableHeader,
+
+      table: {
+        data: [{}],
+        total: 20,
+      },
+      now: "",
+      tempdataLayerId: "",
+    };
+  },
+  mounted() {
+    this.reset();
+  },
+  methods: {
+    cockpit() {
+      this.$emit("cockpit");
+    },
+    searchFun(page = {}) {
+      this.getTableData({
+        ...this.pageObj,
+        pageNum: page.pageIndex || 1,
+        pageSize: page.size || 10,
+      });
+    },
+    getTableData() {
+      this.$emit("updateParent", "loading", true);
+      this.removeGeoJSON();
+      GetList(this.pageObj).then((res) => {
+        this.$emit("updateParent", "loading", false);
+        this.table = {
+          ...res.data,
+          total: res.data.count,
+          data: res.data.list,
+        };
+        this.active_tableData(res.data.list);
+      });
+    },
+    tableRowClassName({ row, rowIndex }) {
+      // if (rowIndex === this.scrollTop_index) {
+      //   return "warning-row";
+      // }
+      // return "";
+    },
+    active_tableData(newVal) {
+      newVal.forEach((res, index) => {
+        if (res.geom || res.st_asewkt)
+          loadGeoJSON(
+            res.geom || res.st_asewkt,
+            "#55A1E3",
+            { isfly: false },
+            (data) => {
+              geoSources[res.id] = data;
+              data.name = "Idleland";
+              data.entities.values.forEach((entity) => {
+                entity.properties = { type: "图斑上图", id: res.id };
+              });
+            }
+          );
+      });
+    },
+    flyTo(item) {
+      let id = "h_" + item.id;
+      this.tempdataLayerId = id;
+      if (geoSources[id]) return;
+      loadGeoJSON(
+        item.geom || item.st_asewkt,
+        "#ff0000",
+        { isfly: true },
+        (data) => {
+          data.name = "Idleland";
+          geoSources[id] = data;
+          data.entities.values.forEach((entity) => {
+            entity.properties = { type: "图斑上图", id: item.id };
+          });
+        }
+      );
+    },
+    removeGeoJSON() {
+      if (!window.viewer) return;
+      viewer.entities.removeAll();
+      viewer.dataSources.removeAll();
+      // viewer.dataSources._dataSources.forEach((das) => {
+      //   if (das.name == "Idleland") {viewer.dataSources.remove(das);}
+      // });
+    },
+
+    reset(xzqh) {
+      this.pageObj = {
+        key: "",
+        xzqh,
+        idleReason: "",
+        isConfirm: this.$props.type != 0,
+        pageNum: 1,
+        pageSize: 10,
+        isDisposal: this.$props.type == 2,
+        // startTime: store.state.cockpit_date[0],
+        // endTime: store.state.cockpit_date[1],
+      };
+    },
+    detail(row) {
+      this.flyTo(row);
+      this.bus.$emit("handleView", row, "耕地");
+    },
+
+    changerdxz() {
+      this.pageObj.isConfirm = !this.pageObj.isConfirm;
+      this.searchFun();
+    },
+  },
+  watch: {
+    tempdataLayerId(newVal, oldVal) {
+      if (oldVal && geoSources[oldVal]) {
+        viewer.dataSources.remove(geoSources[oldVal]);
+        geoSources[oldVal] = null;
+      }
+    },
+  },
+  beforeDestroy() {},
+};
+</script>
+
+<style lang="scss" scoped>
+.xzlist {
+  width: 100%;
+  height: 100%;
+
+  .content {
+    width: 100%;
+    height: 50px;
+    margin: 10px 0;
+    background: #2e5a70;
+    border-radius: 5px;
+    padding-top: 5px;
+    .item {
+      width: 48%;
+      height: 100%;
+      display: inline-block;
+      position: relative;
+
+      text-align: center;
+      span {
+        font-family: "Arial Negreta", "Arial Normal", "Arial";
+        font-weight: 700;
+        font-style: normal;
+        color: #68f4fb;
+      }
+    }
+  }
+  .tablePage {
+    height: calc(100% - 120px);
+  }
+  .tip {
+    color: #f56c6c;
+  }
+  .xztype {
+    display: flex;
+    margin: 5px 0;
+    align-items: center;
+    justify-content: space-between;
+    span {
+      display: inline-block;
+      border: 1px solid #3f93f5;
+      border-radius: 5px;
+      padding: 0 10px;
+      line-height: 30px;
+    }
+  }
+}
+</style>
+
+<style lang="scss">
+.xzlist {
+  .el-col {
+    padding-right: 0 !important;
+  }
+}
+</style>