فهرست منبع

标记疑点弹窗增加名称并存为全局变量

Bella 2 سال پیش
والد
کامیت
c4d2d838a4

+ 7 - 3
public/static/config/config.js

@@ -32,13 +32,17 @@ var map2DViewer = {
   groups: {},
   // 我的标记
   myLabels: {},
-  overlay:{},
-  analysisGroups:{}
+  overlay: {},
+  analysisGroups: {},
 };
 
 // 存放tree中图层node id
 var treeIdMap = new Map();
 
+// 存放我的标记名称
+// key:疑点名称;data:stringify后的geojson数据
+var myLabelNameMap = new Map();
+
 // 各镇域中心区域位置
 var townLocationMap = new Map();
 townLocationMap.set("全部", [31.105589678244445, 121.72894516017521]);
@@ -53,4 +57,4 @@ var customModelIdMap = new Map();
 var uploadDataIdArr = [];
 
 // 图层有权限与否集合
-var layerAuthorityMap = new Map()
+var layerAuthorityMap = new Map();

+ 6 - 4
src/components/map/MapHolder.vue

@@ -221,6 +221,7 @@ export default {
         $(() => {
           console.log($(`#${str}_id textarea`).val(), "textarea");
           $(`#${str}_id`).css("height", "100%");
+          let geoName = $(`#${str}_id input`).eq(0).val()
           $(`#${str}_id input`).click(e => {
             console.log(e.target.defaultValue);
             switch (e.target.defaultValue) {
@@ -228,7 +229,7 @@ export default {
                 this.cancelBtnEvent();
                 break;
               case "保存":
-                this.saveBtnEvent(str, data, geoType);
+                this.saveBtnEvent(str, data, geoType,geoName);
                 // console.log(str, coord, data);
                 break;
             }
@@ -277,7 +278,7 @@ export default {
      * @data -- 绘制几何体时获取的数据;
      * @geoType 几何体类型 类型: 0 点;1 线;2 面;3 矩形;4 圆形;5 其他;
      */
-    saveBtnEvent(str, data, geoType) {
+    saveBtnEvent(str, data, geoType,geoName) {
       if (localStorage.getItem("USER_ID")) {
         let title = $(`#${str}_id select`).val();
         let des = $(`#${str}_id textarea`).val();
@@ -285,9 +286,10 @@ export default {
         let geometry = publicFun.generateGeoJSON(title, des, geoType, coordinates);
 
         let params = new FormData();
-
+        let newGeojson = JSON.stringify(geometry)
+        myLabelNameMap.set(geoName,newGeojson)
         params = {
-          geojson: JSON.stringify(geometry),
+          geojson: newGeojson,
           type: geoType,
           userId: Number(localStorage.getItem("USER_ID")),
           sourceId: 0

+ 42 - 5
src/components/popup/LabelCasePopup.vue

@@ -1,8 +1,14 @@
 <template>
   <MenuCard class="label-case" :menuData="menuData">
     <div class="label-case-inner">
+      <div class="header">
+        <div class="header-title">名称 :</div>
+        <div class="header-input">
+          <input type="text" />
+        </div>
+      </div>
       <div class="top">
-        <div class="top-title">标记点分类:</div>
+        <div class="top-title">标记点分类 :</div>
         <select class="top-select" v-model="selectVal">
           <option value="土地资源">土地资源</option>
           <option value="林业资源">林业资源</option>
@@ -10,7 +16,7 @@
         </select>
       </div>
       <div class="center">
-        <div class="center-title">描述:</div>
+        <div class="center-title">描述 :</div>
         <div class="center-text">
           <textarea
             placeholder="请输入详细信息"
@@ -38,6 +44,7 @@ export default {
   components: { MenuCard, NewSelect },
   data() {
     return {
+      nameInput: "",
       menuData: {
         type: "chart",
         title: "添加标记",
@@ -46,8 +53,8 @@ export default {
       },
       selectVal: "土地资源",
       textContent: "",
-      id:null,
-      geojson:"",
+      id: null,
+      geojson: "",
     };
   },
   methods: {
@@ -73,6 +80,36 @@ export default {
     font-weight: 300;
     color: #e6e6e6;
     // line-height: 36px;
+    .header {
+      height: 15%;
+      width: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      &-title {
+        width: 37%;
+        height: 100%;
+        line-height: 37px;
+      }
+      &-input {
+        width: 68%;
+        height: 30px;
+        input {
+          height: 24px;
+          background: none;
+          border: 1px solid rgba(230, 230, 230, 0.8);
+          border-radius: 3px;
+          color: #fff;
+          font-size: 14px;
+          width: 165px;
+        }
+        // /deep/.el-input__inner {
+        //   width: 93%;
+        //   font-size: 15px;
+        //   height: 30px;
+        // }
+      }
+    }
     .top {
       height: 15%;
       width: 100%;
@@ -105,7 +142,7 @@ export default {
       }
     }
     .center {
-      height: 65%;
+      height: 50%;
       width: 100%;
       &-title {
         width: 100%;

+ 1 - 1
src/views/ComprehensiveAnalysis.vue

@@ -1544,7 +1544,7 @@ export default {
         }
       }
       &-select {
-        width: 120px;
+        width: 130px;
         position: absolute;
         bottom: 7px;
         right: 35px;