Browse Source

闲置土地判定\文件上传

maxiaoxiao 7 months ago
parent
commit
b923f11f3c

+ 32 - 10
src/api/Idleland.js

@@ -15,11 +15,22 @@ export function GetList(params) {
         params
     })
 }
-export function GetDetail(params) {
+export function GetDetail(id) {
     return request({
-        url: '/apply/tdgy/{id}',
+        url: `/apply/tdgy/${id}`,
+        method: 'get',
+    })
+}
+export function GetConfirmDetail(landId) {
+    return request({
+        url: `/apply/tdgy/idleLandConfirm/${landId}`,
+        method: 'get',
+    })
+}
+export function GetDisposalDetail(landId) {
+    return request({
+        url: `/apply//tdgy/idleLandDisposal/${landId}`,
         method: 'get',
-        params
     })
 }
 export function Confirm(data) {
@@ -36,12 +47,23 @@ export function Disposal(data) {
         data
     })
 }
-// export function GetDetail(params) {
-//     return request({
-//         url: '/apply/tdgy/{id}',
-//         method: 'get',
-//         params
-//     })
-// }
+export function fileUpload(data) {
+    return request({
+        method: 'post',
+        url: '/file/upload',
+        data: data,
+        headers: {
+            'Content-Type': 'application/json;charset=UTF-8'
+        }
+    })
+}
+
+export function idleLandList(data) {
+    return request({
+        url: '/apply/tdgy/idleLandList',
+        method: 'post',
+        data
+    })
+}
 
 

+ 12 - 7
src/views/Idleland/components/config.js

@@ -47,17 +47,22 @@ export const xzForm = [
     }
   ]
 ]
-
+export const reasonList = [
+  { name: "政府原因", code: 0 },
+  { name: "企业原因", code: 1 },
+  { name: "非政府原因和不可抗力", code: 2 },
+  { name: "其他", code: 3 },
+]
 export const TableHeader = [
-  { label: "项目名称", prop: "JGMC" },
-  { label: "面积(亩)", prop: "XQNAME", width: '80px' },
-  { label: "约定动工日期", prop: "type", },
+  { label: "项目名称", prop: "xmmc" },
+  { label: "面积(亩)", prop: "crmj", width: '80px' },
+  { label: "约定动工日期", prop: "ydkgsj", },
   { label: "操作", prop: "PHONE", slot: "action" },
 ]
 export const TableHeader2 = [
-  { label: "土地使用权人", prop: "JGMC", },
-  { label: "面积(亩)", prop: "XQNAME", width: '80px' },
-  { label: "土地证号", prop: "type" },
+  { label: "土地使用权人", prop: "srf", },
+  { label: "面积(亩)", prop: "crmj", width: '80px' },
+  { label: "土地证号", prop: "cqzh" },
   { label: "操作", prop: "PHONE", slot: "action" },
 ]
 

+ 56 - 52
src/views/Idleland/components/details.vue

@@ -18,20 +18,22 @@
           <Info :data="jbxxData"></Info>
         </el-tab-pane>
         <el-tab-pane label="认定信息" name="rdxx" v-if="type != 0">
-          <Info :data="rdData" :fileList="fileList"></Info>
+          <Info :data="rdData" :fileList="rdfileList"></Info>
         </el-tab-pane>
         <el-tab-pane label="处置信息" name="czxx" v-if="type == 2">
-          <Info :data="rdData" :fileList="fileList"></Info>
+          <Info :data="czData" :fileList="czfileList"></Info>
         </el-tab-pane>
       </el-tabs>
     </div>
   </div>
 </template>
   <script>
-import { getYZ, getgeoms } from "../../../api/ghss/gdbh.js";
-import { loadGeoJSON } from "@/utils/MapHelper/help.js";
+import {
+  GetDetail,
+  GetConfirmDetail,
+  GetDisposalDetail,
+} from "@/api/Idleland.js";
 import Info from "./info.vue";
-let layerSources = {};
 export default {
   props: {
     interObj: {
@@ -45,11 +47,13 @@ export default {
     return {
       activeTabs: "jbxx",
       isShallow: false,
-      jbxxData: null,
+      jbxxData: [],
       rdData: [],
+      czData: [],
       tempdataLayerId: null,
       type: 0,
-      fileList: [],
+      rdfileList: [],
+      czfileList: [],
       cellstyle: {
         background: "rgba(10, 25, 38, 0.6)",
         color: "#66b1ff",
@@ -73,59 +77,59 @@ export default {
     handleView(val, type) {
       this.isShallow = true;
       this.type = type;
-      //   getOneDetail({
-      //     bsm: this.interObj.bsm,
-      //     id: val.id,
-      //   }).then((res) => {
-      // this.getAll();
-      //     if (res.statuscode == 200) {
-      //       this.viewsData = res.data;
-      //       this.yzjgData = res.data.yzjg;
-      //       this.jbxxData = Object.keys(res.data.tbxx).map((key) => ({
-      //         name: key,
-      //         value: res.data.tbxx[key],
-      //       }));
-      //     } else {
-      //       this.$message.error(res.message);
-      //     }
-      //   });
-    },
-    flyTo(item) {
-      let id = "h_" + item.id;
-      this.tempdataLayerId = id;
-      loadGeoJSON(item.geom, "#ff0000", { isfly: true }, (data) => {
-        layerSources[id] = data;
-      });
-    },
-    getAll() {
-      getgeoms(this.interObj).then((res) => {
+      GetDetail(val.id).then((res) => {
         if (res.statuscode == 200) {
-          this.tableData = res.data.dataListMap;
-          this.active_tableData(res.data.dataListMap);
+          // this.jbxxData = res.data;
+          Object.keys(res.data).forEach((key) => {
+            this.jbxxData.push({
+              name: key,
+              value: res.data[key],
+            });
+          });
+          this.flyTo(res.data);
         } else {
           this.$message.error(res.message);
         }
       });
-    },
-    active_tableData(newVal) {
-      newVal.forEach((res, index) => {
-        res.type = "图斑上图";
-        if (res.geom)
-          loadGeoJSON(res.geom, "#55A1E3", { isfly: false }, (data) => {
-            layerSources[res.id] = data;
-          });
-      });
-    },
-  },
-  mounted() {},
-  watch: {
-    tempdataLayerId(newVal, oldVal) {
-      if (oldVal && layerSources[oldVal]) {
-        viewer.dataSources.remove(layerSources[oldVal]);
-        layerSources[oldVal] = null;
+      if (type != 0) {
+        this.rdfileList = [];
+        GetConfirmDetail(val.id).then((res) => {
+          if (res.statuscode == 200) {
+            this.rdData = [
+              {
+                name: "认定结论",
+                value: `${res.data.isIdle ? "" : "不"}是闲置土地`,
+              },
+              { name: "闲置时间", value: res.data.idleTime + "天" },
+              { name: "闲置原因", value: res.data.idleReason },
+              { name: "认定时间", value: res.data.confirmTime },
+              { name: "认定情况", value: res.data.confirmBasis },
+            ];
+            this.rdfileList = res.data.file;
+          } else {
+            this.$message.error(res.message);
+          }
+        });
+      }
+      if (type == 2) {
+        this.czfileList = [];
+        GetDisposalDetail(val.id).then((res) => {
+          if (res.statuscode == 200) {
+            this.rdData = [
+              { name: "处置时间", value: res.data.disposalTime },
+              { name: "处置方式", value: res.data.disposalMethod },
+              { name: "处置情况", value: res.data.disposalInfo },
+            ];
+            this.czfileList = res.data.file;
+          } else {
+            this.$message.error(res.message);
+          }
+        });
       }
     },
   },
+  mounted() {},
+  watch: {},
 };
 </script>
   

+ 129 - 71
src/views/Idleland/components/handleModal.vue

@@ -11,8 +11,8 @@
       <div class="content">
         <div v-if="type == 'judge'">
           <el-form :model="ruleForm" ref="ruleForm" label-width="100px">
-            <el-form-item label="认定结论:" prop="rdjl">
-              <el-select v-model="ruleForm.rdjl" size="mini">
+            <el-form-item label="认定结论:" prop="isIdle">
+              <el-select v-model="ruleForm.isIdle" size="mini">
                 <el-option
                   v-for="item in optionList"
                   :key="item.code"
@@ -22,33 +22,48 @@
                 </el-option>
               </el-select>
             </el-form-item>
-            <el-form-item label="闲置原因:" prop="xzyy">
-              <el-input size="mini" v-model="ruleForm.xzyy"></el-input>
+            <el-form-item label="闲置原因:" prop="idleReason">
+              <el-select v-model="ruleForm.idleReason" size="mini">
+                <el-option
+                  v-for="item in reasonList"
+                  :key="item.code"
+                  :label="item.name"
+                  :value="item.name"
+                >
+                </el-option>
+              </el-select>
             </el-form-item>
-            <el-form-item label="闲置时间:" prop="xzsj">
-              <el-date-picker
+            <el-form-item label="闲置时间(天):" prop="idleTime">
+              <el-input
+                size="mini"
+                :min="0"
+                :step="1"
+                v-model="ruleForm.idleTime"
+                type="number"
+              ></el-input>
+              <!-- <el-date-picker
                 size="mini"
-                v-model="ruleForm.xzsj"
+                v-model="ruleForm.idleTime"
                 type="date"
-                value-format="yyyy-MM-dd"
+                value-format="yyyy/MM/dd"
                 placeholder="选择日期"
               >
-              </el-date-picker>
+              </el-date-picker> -->
             </el-form-item>
-            <el-form-item label="认定时间" prop="rdsj">
+            <el-form-item label="认定时间" prop="confirmTime">
               <el-date-picker
                 size="mini"
-                v-model="ruleForm.rdsj"
+                v-model="ruleForm.confirmTime"
                 type="date"
-                value-format="yyyy-MM-dd"
+                value-format="yyyy/MM/dd"
                 placeholder="选择日期"
               >
               </el-date-picker>
             </el-form-item>
-            <el-form-item label="认定依据" prop="rdyj">
+            <el-form-item label="认定依据" prop="confirmBasis">
               <el-input
                 size="mini"
-                v-model="ruleForm.rdyj"
+                v-model="ruleForm.confirmBasis"
                 :rows="3"
                 type="textarea"
               ></el-input>
@@ -56,40 +71,32 @@
           </el-form>
         </div>
         <div v-else>
-          <el-form :model="ruleForm" ref="ruleForm" label-width="100px">
-            <el-form-item label="是否完成处置:" prop="sfwc">
-              <el-select v-model="ruleForm.sfwc" size="mini">
-                <el-option
-                  v-for="item in yesornoList"
-                  :key="item.code"
-                  :label="item.name"
-                  :value="item.code"
-                >
-                </el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="处置时间:" prop="czsj">
+          <el-form :model="dealForm" ref="dealForm" label-width="100px">
+            <el-form-item label="处置时间:" prop="disposalTime">
               <el-date-picker
                 size="mini"
-                v-model="ruleForm.czsj"
+                v-model="dealForm.disposalTime"
                 type="date"
-                value-format="yyyy-MM-dd"
+                value-format="yyyy/MM/dd"
                 placeholder="选择日期"
               >
               </el-date-picker>
+              <div class="tip">
+                说明:如果已处置完毕,请填写处置日期,不填写表示未处置完毕!
+              </div>
             </el-form-item>
-            <el-form-item label="处置方式:" prop="czfs">
+            <el-form-item label="处置方式:" prop="disposalMethod">
               <el-input
                 size="mini"
-                v-model="ruleForm.czfs"
+                v-model="dealForm.disposalMethod"
                 :rows="2"
                 type="textarea"
               ></el-input>
             </el-form-item>
-            <el-form-item label="处置情况:" prop="czqk">
+            <el-form-item label="处置情况:" prop="disposalInfo">
               <el-input
                 size="mini"
-                v-model="ruleForm.czqk"
+                v-model="dealForm.disposalInfo"
                 :rows="2"
                 type="textarea"
               ></el-input>
@@ -106,26 +113,25 @@
               :show-file-list="false"
               :file-list="fileList"
               :limit="1"
-              accept=".zip"
+              accept=".pdf,.jpg, .png"
             >
               <el-button size="mini" type="primary">导入</el-button>
             </el-upload>
           </div>
-
           <el-table :data="tofileList" height="200" style="width: 100%">
             <el-table-column label="序号" width="70px">
               <template slot-scope="scope">{{ scope.$index + 1 }}</template>
             </el-table-column>
             <el-table-column
               show-overflow-tooltip="true"
-              prop="name"
+              prop="fileName"
               label="文件名称"
             >
             </el-table-column>
             <el-table-column label="操作" width="150px">
-              <template :slot-scope="{ row }">
-                <span class="usable" @click="del(row)"> 删除 </span>
-                <span class="usable" @click="download(row)"> 下载查看 </span>
+              <template slot-scope="scope">
+                <span class="usable" @click="del(index)"> 删除 </span>
+                <span class="usable" @click="download(scope.row)">查看</span>
               </template>
             </el-table-column>
           </el-table>
@@ -133,13 +139,15 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submit">保存</el-button>
-        <el-button type="primary" @click="close">关闭</el-button>
+        <el-button @click="close">关闭</el-button>
       </span>
     </el-dialog>
   </div>
 </template>
 
 <script>
+import { Confirm, Disposal, fileUpload } from "@/api/Idleland.js";
+import { reasonList } from "./config.js";
 export default {
   components: {},
   props: {},
@@ -149,16 +157,28 @@ export default {
       type: "judge",
       formData: {},
       optionList: [
-        { code: 0, name: "不是闲置土地" },
-        { code: 1, name: "是闲置土地" },
+        { code: false, name: "不是闲置土地" },
+        { code: true, name: "是闲置土地" },
       ],
-      yesornoList: [
-        { code: 0, name: "是" },
-        { code: 1, name: "否" },
-      ],
-      ruleForm: { rdjl: 0 },
+      reasonList: reasonList,
+      ruleForm: {
+        landId: "",
+        isIdle: true,
+        idleReason: "",
+        idleTime: "",
+        confirmTime: "",
+        confirmBasis: "",
+        files: [],
+      },
+      dealForm: {
+        landId: "",
+        disposalTime: "",
+        disposalMethod: "",
+        disposalInfo: "",
+        files: [],
+      },
       fileList: [],
-      tofileList: [{}],
+      tofileList: [],
     };
   },
   created() {},
@@ -169,29 +189,50 @@ export default {
       this.$emit("close");
     },
     Init(rowdata, type) {
-      this.formData = rowdata;
+      // this.formData = rowdata;
+      this.reset();
+      this.ruleForm.landId = rowdata.id;
+      this.dealForm.landId = rowdata.id;
       this.type = type;
       this.dialogVisible = true;
     },
+    reset() {
+      this.ruleForm = {
+        landId: "",
+        isIdle: true,
+        idleReason: "",
+        idleTime: "",
+        confirmTime: "",
+        confirmBasis: "",
+        files: [],
+      };
+      this.dealForm = {
+        landId: "",
+        disposalTime: "",
+        disposalMethod: "",
+        disposalInfo: "",
+        files: [],
+      };
+      this.tofileList = [];
+    },
     handleChange(file, fileList) {
-      if (fileList.length > 0) {
-        this.fileList = [fileList[fileList.length - 1]]; //这一步,是展示最后一次选择文件
-      }
+      // if (fileList.length > 0) {
+      //   this.fileList = [fileList[fileList.length - 1]]; //这一步,是展示最后一次选择文件
+      // }
+      this.fileList = [];
       const formdata = new FormData();
       formdata.append("file", file.raw);
-      // ShapeUpload(formdata).then((res) => {
-      //   if (res.success) {
-      //   }
-      // });
+      formdata.append("name", file.name);
+      fileUpload(formdata).then((res) => {
+        if (res.code == 200) {
+          this.tofileList.push({ fileName: file.name, fileUrl: res.data.url });
+        }
+      });
     },
     download(obj) {
-      window.open(
-        window.axiosURI +
-          "/analyse/fzss/DownloadReport?filePath=" +
-          `${obj.fxbg}`
-      );
+      window.open(obj.fileUrl);
     },
-    del(item) {
+    del(index) {
       MessageBox.confirm(
         "该操作将会删除此数据且不可恢复,您确定要删除吗?",
         "提示",
@@ -202,19 +243,33 @@ export default {
         }
       )
         .then(() => {
-          Delect({ bsm: item.bsm }).then((res) => {
-            if (res.success) {
-              this.$message.success("删除成功!");
-              this.getFileList();
-            }
-          });
+          this.tofileList.splice(index, 1);
+          // Delect({ bsm: item.bsm }).then((res) => {
+          //   if (res.success) {
+          this.$message.success("删除成功!");
+          //   }
+          // });
         })
         .catch(() => {});
     },
-
-    getFileList() {},
     async submit() {
-      this.close();
+      if (this.type == "judge") {
+        this.ruleForm.files = this.tofileList;
+        Confirm(this.ruleForm).then((res) => {
+          if (res.success) {
+            this.$message.success("判定成功!");
+            this.close();
+          }
+        });
+      } else {
+        this.dealForm.files = this.tofileList;
+        Disposal(this.dealForm).then((res) => {
+          if (res.success) {
+            this.$message.success("处置成功!");
+            this.close();
+          }
+        });
+      }
     },
   },
 };
@@ -227,6 +282,9 @@ export default {
     overflow-y: auto;
     overflow-x: hidden;
     color: #fff;
+    .tip {
+      color: #f56c6c;
+    }
     .fileDiv {
       width: 100%;
       padding-left: 20px;

+ 10 - 2
src/views/Idleland/components/info.vue

@@ -2,8 +2,13 @@
   <div class="inter_result">
     <el-table
       :header-cell-style="cellstyle"
-      :data="data"
-      height="455"
+      :data="
+        data.length > 0
+          ? data.filter((item) => item.name !== 'id' && item.name !== 'geom')
+          : []
+      "
+      height="500"
+      :class="fileList ? '' : 'infotabel'"
       style="width: 100%"
     >
       <el-table-column
@@ -60,4 +65,7 @@ export default {
 </script>
 
 <style>
+.infotabel {
+  height: 100% !important;
+}
 </style>

+ 96 - 58
src/views/Idleland/components/list.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="xzlist">
     <div v-if="type == 1" class="xztype">
-      <span :class="{ usable: rdxz }" @click="changerdxz">
+      <span :class="{ usable: pageObj.isConfirm }" @click="changerdxz">
         认定为闲置未处置情况
       </span>
-      <span :class="{ usable: !rdxz }" @click="changerdxz">
+      <span :class="{ usable: !pageObj.isConfirm }" @click="changerdxz">
         认定为未非闲置情况
       </span>
     </div>
@@ -24,12 +24,12 @@
         ></el-cascader>
       </template>
       <template #type>
-        <el-select v-model="pageObj.placeCode" placeholder="闲置原因">
+        <el-select v-model="pageObj.idleReason" placeholder="闲置原因">
           <el-option
-            v-for="item in optionList"
+            v-for="item in reasonList"
             :key="item.code"
             :label="item.name"
-            :value="item.code"
+            :value="item.name"
           >
           </el-option>
         </el-select>
@@ -51,7 +51,7 @@
       </div>
       <div class="item">
         <p>土地面积(亩)</p>
-        <span>{{ table.mj || 0 }} </span>
+        <span>{{ table.area || 0 }} </span>
       </div>
     </div>
     <tablePage
@@ -81,9 +81,16 @@
 import tablePage from "@/components/mapView/tablePage.vue";
 import customForm from "@/components/mapView/custom-form.vue";
 import handleModal from "./handleModal.vue";
-import { GetList } from "@/api/Idleland.js";
-import { ysForm, xzForm, TableHeader, TableHeader2 } from "./config";
-let dataSources;
+import { GetList, idleLandList } from "@/api/Idleland.js";
+import {
+  ysForm,
+  xzForm,
+  TableHeader,
+  TableHeader2,
+  reasonList,
+} from "./config";
+import { loadGeoJSON } from "@/utils/MapHelper/help.js";
+let geoSources;
 export default {
   components: {
     tablePage,
@@ -102,57 +109,28 @@ export default {
     return {
       pageObj: {
         key: "",
-        xzqh: "4602",
-        xzyy: "",
-        czzt: "",
+        xzqh: "",
+        idleReason: "",
+        isConfirm: true,
         pageNum: 1,
         pageSize: 10,
       },
       datalist: [{}],
       formConfig: ysForm,
       cloumn: TableHeader,
-      optionList: [
-        { name: "政府原因", code: 0 },
-        { name: "企业原因", code: 1 },
-        { name: "非政府原因和不可抗力", code: 2 },
-        { name: "其他", code: 3 },
-      ],
+      reasonList: reasonList,
       table: {
-        data: [
-          { JGMC: "ssmdmm", type: 0, typeN: "正在审核" },
-          {
-            JGMC: "ssmdmm",
-            type: 1,
-            time: "2024/9/3",
-            typeN: "审核通过",
-            url: "snsd",
-            list: [
-              { time: "2024/9/3", jg: "申请通过" },
-              { time: "2024/8/13", jg: "申请通过" },
-            ],
-          },
-          {
-            JGMC: "ssmdmm",
-            type: 2,
-            typeN: "审核不通过",
-            list: [
-              { time: "2024/9/3", jg: "申请通过" },
-              { time: "2024/8/13", jg: "申请通过" },
-            ],
-          },
-          { JGMC: "ssmdmm", type: 3, typeN: "已撤回" },
-        ],
+        data: [],
         total: 20,
       },
       now: "",
-      // 闲置未处置
-      rdxz: true,
     };
   },
   mounted() {
     this.formConfig = this.$props.type == 0 ? ysForm : xzForm;
     this.cloumn = this.$props.type == 0 ? TableHeader : TableHeader2;
-    this.getTableData();
+
+    console.log("s0s-scddcd-s");
   },
   methods: {
     searchFun(page) {
@@ -163,22 +141,75 @@ export default {
       });
     },
     getTableData() {
+      console.log("s0s-s-s", this.$props.type);
       this.$emit("updateParent", "loading", true);
-      // if (this.$props.type == 0) {
-      GetList(this.pageObj).then((res) => {
-        this.$emit("updateParent", "loading", false);
-        this.table = res.data;
+      this.removeGeoJSON();
+      if (this.$props.type == 0) {
+        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);
+        });
+      } else if (this.$props.type == 1) {
+        idleLandList(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);
+        });
+      } else if (this.$props.type == 2) {
+      }
+    },
+    active_tableData(newVal) {
+      newVal.forEach((res, index) => {
+        res.type = "图斑上图";
+        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 = res;
+              });
+            }
+          );
       });
-      // } else if (this.$props.type == "ghxz") {
-      // } else if (this.$props.type == "gdbh") {
-      // }
     },
-    addPolygon(geojson) {},
-    reset() {
-      if (dataSources) viewer.dataSources.remove(dataSources);
-      dataSources = undefined;
+    flyTo(item) {
+      let id = "h_" + item.id;
+      this.tempdataLayerId = id;
+      loadGeoJSON(
+        item.geom || item.st_asewkt,
+        "#ff0000",
+        { isfly: true },
+        (data) => {
+          data.name = "Idleland";
+          geoSources[id] = data;
+        }
+      );
+    },
+    removeGeoJSON() {
+      if (!viewer) return;
+      viewer.entities.removeAll();
+      viewer.dataSources.removeAll();
+      // viewer.dataSources._dataSources.forEach((das) => {
+      //   if (das.name == "Idleland") {viewer.dataSources.remove(das);}
+      // });
     },
+
+    reset() {},
     detail(row) {
+      this.flyTo(row);
       this.bus.$emit("handleView", row, this.$props.type);
     },
     judge(row) {
@@ -188,11 +219,18 @@ export default {
       this.$refs.handleRef.Init(row, "deal");
     },
     changerdxz() {
-      this.rdxz = !this.rdxz;
+      this.pageObj.isConfirm = !this.pageObj.isConfirm;
       this.getTableData();
     },
   },
-  watch: {},
+  watch: {
+    tempdataLayerId(newVal, oldVal) {
+      if (oldVal && geoSources[oldVal]) {
+        viewer.dataSources.remove(geoSources[oldVal]);
+        geoSources[oldVal] = null;
+      }
+    },
+  },
   beforeDestroy() {
     this.pageObj = {
       kssj: "",

+ 14 - 5
src/views/Idleland/components/xzgl.vue

@@ -2,13 +2,13 @@
   <div class="tpwjxm">
     <el-tabs type="border-card" class="xz_box" v-model="activeTabs" stretch>
       <el-tab-pane label="疑似闲置" name="distrust">
-        <List type="0"></List>
+        <List type="0" ref="distrust"></List>
       </el-tab-pane>
       <el-tab-pane label="闲置未处置" name="notHandle">
-        <List type="1"></List>
+        <List type="1" ref="notHandle"></List>
       </el-tab-pane>
       <el-tab-pane label="闲置已处置" name="handled">
-        <List type="2"></List>
+        <List type="2" ref="handled"></List>
       </el-tab-pane>
     </el-tabs>
   </div>
@@ -27,14 +27,23 @@ export default {
       activeTabs: "distrust",
     };
   },
-  mounted() {},
+  mounted() {
+    this.$nextTick(() => {
+      this.$refs.distrust.getTableData();
+    });
+  },
   methods: {
     reset() {
       // if (dataSources) viewer.dataSources.remove(dataSources);
       // dataSources = undefined;
     },
   },
-  watch: {},
+  watch: {
+    activeTabs(newValue) {
+      this.$refs[newValue].getTableData();
+      // this.$refs.tjzl.getData();
+    },
+  },
   beforeDestroy() {
     this.pageObj = {
       kssj: "",