Przeglądaj źródła

动态数据的接口与数据接入,关于列表展示方面的字段调整

lkk 7 miesięcy temu
rodzic
commit
e9574bfce7
2 zmienionych plików z 78 dodań i 10 usunięć
  1. 31 0
      src/api/supervise/pcsj.js
  2. 47 10
      src/views/remote/farmland/index.vue

+ 31 - 0
src/api/supervise/pcsj.js

@@ -139,4 +139,35 @@ export function updateYwlxField(data) {
     method: 'put',
     data: data
   })
+}
+
+//查询图斑列表信息列表map
+export function getXqListMap(query) {
+  return request({
+    url: '/apply/supervise/xq/list.map',
+    method: 'get',
+    params: query
+  })
+}
+//查询图斑列表信息列表key
+export function getXqListKey(query) {
+  return request({
+    url: '/apply/supervise/xq/list.key',
+    method: 'get',
+    params: query
+  })
+}
+export function getXqIdMap(query) {
+  return request({
+    url: '/apply/supervise/xq/id.map',
+    method: 'get',
+    params: query
+  })
+}
+export function getXqIdKey(query) {
+  return request({
+    url: '/apply/supervise/xq/id.key',
+    method: 'get',
+    params: query
+  })
 }

+ 47 - 10
src/views/remote/farmland/index.vue

@@ -37,9 +37,9 @@
             <span>{{ newObj.spotsarea }}</span>
           </div>
         </div>
-        <el-table :data="tableData" border style="width: 100%">
+        <el-table :data="tableData" border style="width: 100%" @row-click="tableClick">
           <!-- @cell-click="tableClick" -->
-          <el-table-column prop="jcbh" label="监测编号" width="220">
+          <!-- <el-table-column prop="jcbh" label="监测编号" width="220">
             <template slot-scope="scope">
               <span style="cursor: pointer" @click="tableClick(scope.row)">{{
                 scope.row.jcbh
@@ -53,6 +53,12 @@
             label="监测面积(亩)"
             show-overflow-tooltip
           >
+          </el-table-column> -->
+          <el-table-column
+            :prop="templateList[i]"
+            :label="templateList[i]"
+            show-overflow-tooltip v-for="(item,i) in templateList" :key="i"
+          >
           </el-table-column>
           <el-table-column label="操作" align="center">
             <template slot-scope="scope">
@@ -84,7 +90,15 @@
 import MapView from "../MapView.vue";
 import CustomDetails from "@/components/custom-detailsInfo.vue";
 import parse from "wellknown";
-import { getPcsj, listPcsjXQList, getPcsjXQ } from "@/api/supervise/pcsj";
+import {
+  getPcsj,
+  listPcsjXQList,
+  getPcsjXQ,
+  getXqListMap,
+  getXqListKey,
+  getXqIdMap,
+  getXqIdKey,
+} from "@/api/supervise/pcsj";
 import { detailInfos } from "./config";
 import "ol/ol.css";
 // import { get as getProjection, transform } from "ol/proj.js";
@@ -143,6 +157,7 @@ export default {
       dialogVisible: false,
       infoObj: {},
       detailInfos: detailInfos,
+      templateList: [],
     };
   },
   mounted() {
@@ -151,11 +166,34 @@ export default {
       getPcsj(this.$route.query.id).then((response) => {
         this.newObj = response.data;
       });
-      this.getList();
+      this.getTemplate();
+      // this.getList();
     });
   },
 
   methods: {
+    //动态获取设置的模版字段
+    getTemplate() {
+      let arr = ["中心点经度", "中心点纬度", "前时相", "后时相","空间信息","geom"];
+      getXqListKey({ pcsjid: this.$route.query.id }).then((res) => {
+        res.data.forEach((i) => {
+          if (!arr.includes(i)) {
+            this.templateList.push(i)
+          }
+        });
+      });
+
+      getXqListMap({ pcsjid: this.$route.query.id }).then((res) => {
+        this.tableData = res.rows;
+        this.total = res.total;
+        this.initVectorLayer("mapDiv");
+        this.initVectorLayer("mapCon1");
+        this.initVectorLayer("mapCon2");
+        this.addGeoJson("mapDiv");
+        this.addGeoJson("mapCon1");
+        this.addGeoJson("mapCon2");
+      });
+    },
     handleDownload() {
       const zipfile = this.newObj.proxypath + ".zip";
       window.open(`${zipfile}`);
@@ -163,8 +201,10 @@ export default {
     tableClick(row) {
       removeWebGLTile("mapCon1");
       removeWebGLTile("mapCon2");
-      let urlQsx = this.newObj.proxypath + row.qsxtif;
-      let urlHsx = this.newObj.proxypath + row.hsxtif;
+      // let urlQsx = this.newObj.proxypath + row.qsxtif;
+      // let urlHsx = this.newObj.proxypath + row.hsxtif;
+      let urlQsx = this.newObj.proxypath + row["前时相对应影像数据"];
+      let urlHsx = this.newObj.proxypath + row["后时相对应影像数据"];
       if (this.nowObj.id != row.id) {
         this.maptype = "split";
         this.nowObj = row;
@@ -181,8 +221,6 @@ export default {
       listPcsjXQList(this.queryParams).then((response) => {
         this.tableData = response.rows;
         this.total = response.total;
-        // this.open = true;
-        // this.title = "修改监管批次数据";
         this.initVectorLayer("mapDiv");
         this.initVectorLayer("mapCon1");
         this.initVectorLayer("mapCon2");
@@ -201,7 +239,6 @@ export default {
       this.drawer = false;
     },
     test(item) {
-      console.log(item, "---------------------");
       window.map["mapCon1"].removeLayer(this.itemObj);
       window.map["mapCon2"].removeLayer(this.itemObj);
 
@@ -232,7 +269,7 @@ export default {
         //   callback: null,
         // });
         window.map["mapCon1"].getView().animate({
-          center: [item.lzb, item.bzb],
+          center: [item['中心点经度'], item['中心点纬度']],
           zoom: 17,
           duration: 2000, // 动画持续时间,单位毫秒
         });