From e556182b998fdba960ee9fac00e7868dd514033a Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Fri, 25 Mar 2022 14:01:06 +0800
Subject: [PATCH] +底图加字段

---
 src/views/hd/baseMap.vue |   70 ++++++++++++++++++++++++-----------
 1 files changed, 48 insertions(+), 22 deletions(-)

diff --git a/src/views/hd/baseMap.vue b/src/views/hd/baseMap.vue
index e76c086..7a168e3 100644
--- a/src/views/hd/baseMap.vue
+++ b/src/views/hd/baseMap.vue
@@ -34,17 +34,17 @@
       <template slot-scope="{ type, disabled }" slot="haveBaseMapForm">
         <div class="inputInline" v-show="!notSet">
           <el-input
-            v-model="chouseBaseMapTypeOnce"
+            v-model="chouseBaseMapNameOnce"
             placeholder="底图名称"
             class="inputInlineType"
           ></el-input>
           <el-input
-            placeholder="请输入底图地址"
+            placeholder="请输入底图地址,示例:http://t3.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0"
             v-model="mapServiceValueOnce"
             class="input-with-select"
           >
             <!-- <el-select
-            v-model="chouseBaseMapTypeOnce"
+            v-model="chouseBaseMapNameOnce"
             slot="prepend"
             placeholder="请选择"
           >
@@ -91,7 +91,7 @@
   data() {
     return {
       mapServiceValueOnce: "",
-      chouseBaseMapTypeOnce: "XYZ",
+      chouseBaseMapNameOnce: "",
       form: {},
       query: {},
       loading: true,
@@ -138,6 +138,29 @@
               },
             ],
           },
+          {
+            label: "底图数量",
+            prop: "addressNum",
+            viewDisply: false,
+            addDisplay: false,
+            editDisply: false,
+          },
+          {
+            label: "创建时间",
+            prop: "createtime",
+            viewDisply: false,
+            addDisplay: false,
+            // hide: true,
+            editDisply: false,
+          },
+          {
+            label: "修改时间",
+            prop: "updatetime",
+            viewDisply: false,
+            addDisplay: false,
+            // hide: true,
+            editDisply: false,
+          },
           // {
           //   label: "活动地点",
           //   viewDisply:false,
@@ -176,6 +199,7 @@
           {
             label: "专题底图",
             hide: true,
+            viewDisply: false,
             prop: "haveBaseMap",
             component: "AvueUeditor",
             // options: {
@@ -266,6 +290,7 @@
     addMapServices(val) {
       if (val == 1) {
         this.mapServiceValueOnce = "";
+        this.chouseBaseMapNameOnce = "";
       }
       if (this.mapServiceValueOnce == "") {
         this.$message({
@@ -274,28 +299,29 @@
         });
         return;
       }
-      if (this.chouseBaseMapTypeOnce == "") {
+      if (this.chouseBaseMapNameOnce == "") {
         this.$message({
-          message: "请输入地图服务类型",
+          message: "请输入地图服务名称",
           type: "warning",
         });
         return;
       }
-      // console.log(this.mapServiceValue, this.chouseBaseMapType);
+      // console.log(this.mapServiceValue, this.chouseBasemapname);
       // this.form["haveBaseMap"] = this.mapServiceValueOnce;
       //传入控制地图层 转store
       // this.$refs.baseMapMap.addService({
-      //   type: this.chouseBaseMapType,
+      //   type: this.chouseBasemapname,
       //   service: this.mapServiceValue,
       // });
       let that = this;
       this.$store.commit("setMapServiceValue", {
-        type: that.chouseBaseMapTypeOnce,
+        name: that.chouseBaseMapNameOnce,
         service: that.mapServiceValueOnce,
         show: true,
         layer: null,
       });
       this.mapServiceValueOnce = "";
+      this.chouseBaseMapNameOnce = "";
     },
     setMapData(val) {
       this.LineData = val[0];
@@ -310,20 +336,20 @@
         loading();
         return;
       }
-      let types = "",
+      let names = "",
         urls = "",
         leng = this.mapServiceValue.length - 1;
       for (let k in this.mapServiceValue) {
-        types += this.mapServiceValue[k].type;
+        names += this.mapServiceValue[k].name;
         urls += this.mapServiceValue[k].service;
         if (k != leng) {
-          types += ",";
+          names += ",";
           urls += ",";
         }
       }
       let data = {
         hdid: row.hdid,
-        maptype: types,
+        mapname: names,
         mapurl: urls,
       };
       // console.log(data);
@@ -382,18 +408,18 @@
         loading();
         return;
       }
-      let types = "",
+      let names = "",
         urls = "",
         leng = this.mapServiceValue.length - 1;
       for (let k in this.mapServiceValue) {
-        types += this.mapServiceValue[k].type;
+        names += this.mapServiceValue[k].name;
         urls += this.mapServiceValue[k].service;
         if (k != leng) {
-          types += ",";
+          names += ",";
           urls += ",";
         }
       }
-      row.maptype = types;
+      row.mapname = names;
       row.mapurl = urls;
       // console.log(row);
       // loading();
@@ -492,15 +518,15 @@
           this.form = res.data.data;
           console.log(res);
           //解析数据
-          let types = this.form.maptype.split(","),
+          let names = this.form.mapname.split(","),
             urls = this.form.mapurl.split(",");
-          console.log(types);
+          console.log(names);
           console.log(urls);
 
-          for (let k in types) {
+          for (let k in names) {
             setTimeout(() => {
               this.$store.commit("setMapServiceValue", {
-                type: types[k],
+                name: names[k],
                 service: urls[k],
                 show: true,
                 layer: null,
@@ -574,7 +600,7 @@
         this.page.total = data.total;
         this.data = data.records;
         for (let k in this.data) {
-          this.data[k]["haveBaseMap"] = this.data[k].maptype;
+          this.data[k]["addressNum"] = this.data[k].mapname.split(",").length;
         }
         this.loading = false;
         this.selectionClear();

--
Gitblit v1.9.3