Przeglądaj źródła

地图标记模块接口接入

wangkang3 4 lat temu
rodzic
commit
8f7b30e3be

+ 6 - 4
ebc-middle-platform/src/conf/services.js

@ -141,10 +141,12 @@ export default {
141 141
  },
142 142
  mapTag: {
143 143
    GET_TOKEN: '/gisToken/gisToken',
144
    GET_MAP_TAG: '/mapTag/queryMapTagInfo', // 查询地图标记信息
145
    ADD_MAP_TAG: '/mapTag/modifyMapTagInfo', // 新增地图标记信息
146
    DEL_MAP_TAG: '/mapTag/deleteMapTagXyInfo', // 删除地图标记信息
147
    UPD_MAP_TAG: '/mapTag/queryMapTagforModifyInfo' // 查询地图标记信息用作修改
144
    GET_MAP_TAG: '/mapTag/queryPageMapTagInfo', // 查询地图标记信息
145
    GET_ALL_MAP_TAG: '/mapTag/queryAllMapTagInfo', // 查询地图标记信息
146
    GET_ONE_MAP_TAG: '/mapTag/queryOneMapTagInfo', // 查询地图标记信息
147
    ADD_MAP_TAG: '/mapTag/addMapTagInfo', // 新增地图标记信息
148
    DEL_MAP_TAG: '/mapTag/deleteMapTagInfo', // 删除地图标记信息
149
    UPD_MAP_TAG: '/mapTag/modifyMapTagInfo' // 查询地图标记信息用作修改
148 150
  },
149 151
  equipment: {
150 152
    GET_EQUIPMENT: '/equipment/queryEquipmentInfo', // 查询设备管理信息

+ 9 - 1
ebc-middle-platform/src/modules/layouts/BasicLayout.vue

@ -44,6 +44,7 @@
44 44
<script>
45 45
import GlobalLayout from '../page/GlobalLayout.vue'
46 46
import IpuStomp from '../../ipu-stomp'
47
import services from "../../conf/services";
47 48
export default {
48 49
  name: 'BasicLayout',
49 50
  components: {
@ -60,6 +61,14 @@ export default {
60 61
    }
61 62
  },
62 63
  mounted() {
64
    this.$test
65
        .post(services.mapTag.GET_TOKEN, '')
66
        .then((res) => {
67
          this.$store.commit('setGisToken',res.data.result.ak)
68
        })
69
        .catch((res) => {
70
          // 请求失败处理...
71
        });
63 72
    // 镜屏调用
64 73
    var client
65 74
    var callbacks = {}
@ -77,7 +86,6 @@ export default {
77 86
        url: 'ws://192.168.3.200:7100/stomp',
78 87
        name: 'zhangsan',
79 88
        passcode: '123456',
80
        host: '',
81 89
        UUID: 'zhangsan'
82 90
      },
83 91
      callbacks

+ 385 - 286
ebc-middle-platform/src/modules/orientation/orientation.vue

@ -3,57 +3,96 @@
3 3
    <div class="top-container">
4 4
      <div class="person-info">
5 5
        <div>全部<span class="number">29</span>人</div>
6
        <div><div class="normal"></div>正常<span class="number">26</span>人</div>
7
        <div><div class="off-line"></div>离线<span class="number">2</span>人</div>
8
        <div><div class="sos"></div>SOS<span class="number">1</span>人</div>
9
        <div class="time">当前时间:{{ nowDate|dateFormat }}</div>
6
        <div>
7
          <div class="normal"></div>
8
          正常<span class="number">26</span>人
9
        </div>
10
        <div>
11
          <div class="off-line"></div>
12
          离线<span class="number">2</span>人
13
        </div>
14
        <div>
15
          <div class="sos"></div>
16
          SOS<span class="number">1</span>人
17
        </div>
18
        <div class="time">当前时间:{{ nowDate | dateFormat }}</div>
10 19
      </div>
11 20
      <div class="right-content">
12
        <t-button color="success" icon="map-marker-outline" @click="()=>{trackModal=true}">轨迹</t-button>
21
        <t-button
22
          color="success"
23
          icon="map-marker-outline"
24
          @click="
25
            () => {
26
              trackModal = true;
27
            }
28
          "
29
          >轨迹</t-button
30
        >
13 31
        <div>悬浮窗<t-switch rounded></t-switch></div>
14 32
      </div>
15 33
    </div>
16
    <div id="div1" style="height:100%"></div>
34
    <div id="div1" style="height: 100%"></div>
17 35
    <div class="label">
18 36
      <div class="item">
19 37
        <div>
20
          <div class="sos"></div><div>SOS</div>
38
          <div class="sos"></div>
39
          <div>SOS</div>
21 40
        </div>
22 41
        <div>
23
          <div class="offline"></div><div>离线</div>
42
          <div class="offline"></div>
43
          <div>离线</div>
24 44
        </div>
25 45
        <div>
26
          <div class="outline"></div><div>违规</div>
46
          <div class="outline"></div>
47
          <div>违规</div>
27 48
        </div>
28 49
        <div>
29
          <div class="normal"></div><div>正常</div>
50
          <div class="normal"></div>
51
          <div>正常</div>
30 52
        </div>
31 53
      </div>
32 54
      <div class="item">
33 55
        <div>
34
          <div class="fenji"></div><div>风机</div>
56
          <div class="fenji"></div>
57
          <div>风机</div>
35 58
        </div>
36 59
        <div>
37
          <div class="shengyazhan"></div><div>升压站</div>
60
          <div class="shengyazhan"></div>
61
          <div>升压站</div>
38 62
        </div>
39 63
        <div>
40
          <div class="chuanbo"></div><div>船舶</div>
64
          <div class="chuanbo"></div>
65
          <div>船舶</div>
41 66
        </div>
42 67
      </div>
43 68
      <div class="item">
44 69
        <div>
45
          <div class="zyqy"></div><div>作业区域</div>
70
          <div class="zyqy"></div>
71
          <div>作业区域</div>
46 72
        </div>
47 73
        <div>
48
          <div class="dzwl"></div><div>电子围栏</div>
74
          <div class="dzwl"></div>
75
          <div>电子围栏</div>
49 76
        </div>
50 77
      </div>
51 78
    </div>
52 79
53
    <t-modal :visibled.sync="trackModal" :footer-visibled="false" :mask-closable="false" :width="1200" title="历史轨迹">
80
    <t-modal
81
      :visibled.sync="trackModal"
82
      :footer-visibled="false"
83
      :mask-closable="false"
84
      :width="1200"
85
      title="历史轨迹"
86
    >
54 87
      <div class="track-modal-container">
55 88
        <div class="track-modal-left">
56
          <t-input v-model="trackSearch" icon="search-outline" icon-placement="right" placeholder="请输入姓名或终端编号" style="width: 200px"></t-input>
89
          <t-input
90
            v-model="trackSearch"
91
            icon="search-outline"
92
            icon-placement="right"
93
            placeholder="请输入姓名或终端编号"
94
            style="width: 200px"
95
          ></t-input>
57 96
          <div>
58 97
            <div>张三</div>
59 98
            <div>张三</div>
@ -62,12 +101,27 @@
62 101
          </div>
63 102
        </div>
64 103
        <div class="track-modal-right">
65
          <div style="display:flex">
104
          <div style="display: flex">
66 105
            <t-button-group>
67
              <t-button v-for="(item,index) in trackTimeList" :class="index==trackQueryCondition.currentIndex?'active':''" :key="index" @click="changeTrackTime(index)">{{ item }}</t-button>
106
              <t-button
107
                v-for="(item, index) in trackTimeList"
108
                :class="
109
                  index == trackQueryCondition.currentIndex ? 'active' : ''
110
                "
111
                :key="index"
112
                @click="changeTrackTime(index)"
113
                >{{ item }}</t-button
114
              >
68 115
            </t-button-group>
69
            <t-date-picker v-show="trackQueryCondition.currentIndex===3" v-model="rangeDate" style="width:250px" type="dateRange" placeholder="请选择时间" @date-change="onChangeDate"></t-date-picker>
70
            <div style="display:flex">
116
            <t-date-picker
117
              v-show="trackQueryCondition.currentIndex === 3"
118
              v-model="rangeDate"
119
              style="width: 250px"
120
              type="dateRange"
121
              placeholder="请选择时间"
122
              @date-change="onChangeDate"
123
            ></t-date-picker>
124
            <div style="display: flex">
71 125
              <div>速度</div>
72 126
              <t-select>
73 127
                <t-option>1x</t-option>
@ -75,15 +129,22 @@
75 129
              </t-select>
76 130
            </div>
77 131
            <t-button color="success" icon="video-outline">回放</t-button>
78
            <t-button color="secondary" icon="upload-outline" @click="toExport">导出至Excel</t-button>
79
          </div>
80
          <div id="track-map" style="height:94%">
132
            <t-button color="secondary" icon="upload-outline" @click="toExport"
133
              >导出至Excel</t-button
134
            >
81 135
          </div>
136
          <div id="track-map" style="height: 94%"></div>
82 137
        </div>
83 138
      </div>
84 139
    </t-modal>
85
    <t-modal :visibled.sync="rescueModal" title="指派救援人员" >
86
      <t-form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80" label-position="left">
140
    <t-modal :visibled.sync="rescueModal" title="指派救援人员">
141
      <t-form
142
        ref="formValidate"
143
        :model="formValidate"
144
        :rules="ruleValidate"
145
        :label-width="80"
146
        label-position="left"
147
      >
87 148
        <t-form-item label="救援人员" prop="rescue">
88 149
          <t-select v-model="formValidate.rescue" placeholder="请选择">
89 150
            <t-option>张三</t-option>
@ -100,355 +161,393 @@
100 161
</template>
101 162
102 163
<script>
103
import './orientation.scss'
104
import { forEach, filter, find} from 'lodash'
164
import "./orientation.scss";
165
import { forEach, filter, find } from "lodash";
166
import services from "../../conf/services";
105 167
export default {
106 168
  filters: {
107 169
    dateFormat(value) {
108
      var year = value.getFullYear()
109
      var month = value.getMonth() >= 10 ? value.getMonth() : '0' + value.getMonth()
110
      var day = value.getDate() >= 10 ? value.getDate() : '0' + value.getDate()
111
      var hours = value.getHours() >= 10 ? value.getHours() : '0' + value.getHours()
112
      var minutes = value.getMinutes() >= 10 ? value.getMinutes() : '0' + value.getMinutes()
113
      var seconds = value.getSeconds() >= 10 ? value.getSeconds() : '0' + value.getSeconds()
114
      return year + '.' + month + '.' + day + ' ' + hours + ':' + minutes + ':' + seconds
115
    }
170
      var year = value.getFullYear();
171
      var month =
172
        value.getMonth() >= 10 ? value.getMonth() : "0" + value.getMonth();
173
      var day = value.getDate() >= 10 ? value.getDate() : "0" + value.getDate();
174
      var hours =
175
        value.getHours() >= 10 ? value.getHours() : "0" + value.getHours();
176
      var minutes =
177
        value.getMinutes() >= 10
178
          ? value.getMinutes()
179
          : "0" + value.getMinutes();
180
      var seconds =
181
        value.getSeconds() >= 10
182
          ? value.getSeconds()
183
          : "0" + value.getSeconds();
184
      return (
185
        year +
186
        "." +
187
        month +
188
        "." +
189
        day +
190
        " " +
191
        hours +
192
        ":" +
193
        minutes +
194
        ":" +
195
        seconds
196
      );
197
    },
116 198
  },
117 199
  data() {
118 200
    return {
119 201
      map: null,
120 202
      pointsarr: null,
121
      polylinearr: '122.0352 32.4444,122.0372 32.4444,122.0400 32.4366,122.2922 32.4233',
122
      polygonarr: '122.2302 32.5444,122.2302 32.3444, 122.4302 32.3444,122.4302 32.6044,122.2302 32.5444',
203
      polylinearr:
204
        "122.0352 32.4444,122.0372 32.4444,122.0400 32.4366,122.2922 32.4233",
205
      polygonarr:
206
        "122.2302 32.5444,122.2302 32.3444, 122.4302 32.3444,122.4302 32.6044,122.2302 32.5444",
123 207
      popup: null,
124 208
      shadow: false,
125 209
      dataList: [
126 210
        {
127
          name: '王小明',
128
          number: 'ZDBH0001',
129
          type: '落水告警',
130
          Longitude: '32.4233',
131
          latitude: '122.2922',
132
          alarmTime: '2020.7.10 08:21:43',
133
          newMarkerTime: '2020.7.10 08:21:43',
134
          rescuePerson: '海事局A',
135
          rescueTime: '2020.7.3 11:22:16',
136
          rescueDuration: '10小时39分钟'
211
          name: "王小明",
212
          number: "ZDBH0001",
213
          type: "落水告警",
214
          Longitude: "32.4233",
215
          latitude: "122.2922",
216
          alarmTime: "2020.7.10 08:21:43",
217
          newMarkerTime: "2020.7.10 08:21:43",
218
          rescuePerson: "海事局A",
219
          rescueTime: "2020.7.3 11:22:16",
220
          rescueDuration: "10小时39分钟",
137 221
        },
138 222
        {
139
          name: '王小明1',
140
          number: 'ZDBH0002',
141
          type: '正常',
142
          Longitude: '32.333',
143
          latitude: '122.0822',
144
          alarmTime: '2020.7.10 08:21:43',
145
          newMarkerTime: '2020.7.10 08:21:43',
146
          rescuePerson: '海事局A',
147
          rescueTime: '2020.7.3 11:22:16',
148
          rescueDuration: '10小时39分钟'
223
          name: "王小明1",
224
          number: "ZDBH0002",
225
          type: "正常",
226
          Longitude: "32.333",
227
          latitude: "122.0822",
228
          alarmTime: "2020.7.10 08:21:43",
229
          newMarkerTime: "2020.7.10 08:21:43",
230
          rescuePerson: "海事局A",
231
          rescueTime: "2020.7.3 11:22:16",
232
          rescueDuration: "10小时39分钟",
149 233
        },
150 234
        {
151
          name: '王小明2',
152
          number: 'ZDBH0003',
153
          type: '正常',
154
          Longitude: '32.4444',
155
          latitude: '122.0352',
156
          alarmTime: '2020.7.10 08:21:43',
157
          newMarkerTime: '2020.7.10 08:21:43',
158
          rescuePerson: '海事局A',
159
          rescueTime: '2020.7.3 11:22:16',
160
          rescueDuration: '10小时39分钟'
235
          name: "王小明2",
236
          number: "ZDBH0003",
237
          type: "正常",
238
          Longitude: "32.4444",
239
          latitude: "122.0352",
240
          alarmTime: "2020.7.10 08:21:43",
241
          newMarkerTime: "2020.7.10 08:21:43",
242
          rescuePerson: "海事局A",
243
          rescueTime: "2020.7.3 11:22:16",
244
          rescueDuration: "10小时39分钟",
161 245
        },
162 246
        {
163
          name: '王小明3',
164
          number: 'ZDBH0004',
165
          type: '离线',
166
          Longitude: '32.555',
167
          latitude: '121.0752',
168
          alarmTime: '2020.7.10 08:21:43',
169
          newMarkerTime: '2020.7.10 08:21:43',
170
          rescuePerson: '海事局A',
171
          rescueTime: '2020.7.3 11:22:16',
172
          rescueDuration: '10小时39分钟'
247
          name: "王小明3",
248
          number: "ZDBH0004",
249
          type: "离线",
250
          Longitude: "32.555",
251
          latitude: "121.0752",
252
          alarmTime: "2020.7.10 08:21:43",
253
          newMarkerTime: "2020.7.10 08:21:43",
254
          rescuePerson: "海事局A",
255
          rescueTime: "2020.7.3 11:22:16",
256
          rescueDuration: "10小时39分钟",
173 257
        },
174 258
        {
175
          name: '王小明4',
176
          number: 'ZDBH0005',
177
          type: '落水告警',
178
          Longitude: '32.466',
179
          latitude: '122.04322',
180
          alarmTime: '2020.7.10 08:21:43',
181
          newMarkerTime: '2020.7.10 08:21:43',
182
          rescuePerson: '海事局A',
183
          rescueTime: '2020.7.3 11:22:16',
184
          rescueDuration: '10小时39分钟'
185
        }
259
          name: "王小明4",
260
          number: "ZDBH0005",
261
          type: "落水告警",
262
          Longitude: "32.466",
263
          latitude: "122.04322",
264
          alarmTime: "2020.7.10 08:21:43",
265
          newMarkerTime: "2020.7.10 08:21:43",
266
          rescuePerson: "海事局A",
267
          rescueTime: "2020.7.3 11:22:16",
268
          rescueDuration: "10小时39分钟",
269
        },
186 270
      ],
187 271
      nowDate: new Date(),
188 272
      modal: false,
189 273
      trackModal: false,
190
      trackSearch: '',
191
      trackTimeList: [
192
        '-10min',
193
        '-1h',
194
        '本日',
195
        '自定义'
196
      ],
274
      trackSearch: "",
275
      trackTimeList: ["-10min", "-1h", "本日", "自定义"],
197 276
      trackQueryCondition: {
198
        currentIndex: 0
277
        currentIndex: 0,
199 278
      },
200 279
      trackMap: null,
201
      rangeDate: '',
280
      rangeDate: "",
202 281
      rescueModal: false,
203 282
      formValidate: {
204
        rescue: ''
283
        rescue: "",
205 284
      },
206 285
      ruleValidate: {
207
        rescue: [{
208
          required: true,
209
          message: '救援人员不能为空',
210
          trigger: 'blur'
211
        }]
212
      }
213
    }
286
        rescue: [
287
          {
288
            required: true,
289
            message: "救援人员不能为空",
290
            trigger: "blur",
291
          },
292
        ],
293
      },
294
    };
214 295
  },
215 296
  computed: {
216 297
    normalData: function () {
217 298
      return filter(this.dataList, function (o) {
218
        return o.type == '正常'
219
      })
299
        return o.type == "正常";
300
      });
220 301
    },
221 302
    alertData: function () {
222 303
      return filter(this.dataList, function (o) {
223
        return o.type == '落水告警'
224
      })
304
        return o.type == "落水告警";
305
      });
225 306
    },
226 307
    offlineData: function () {
227 308
      return filter(this.dataList, function (o) {
228
        return o.type == '离线'
229
      })
230
    }
309
        return o.type == "离线";
310
      });
311
    },
231 312
  },
232 313
  mounted() {
233
    this.initMap('')
234
    this.initTrackMap('')
235
    this.pointsSet()
236
    this.polyline()
237
    this.polygon()
238
    this.map.setZoom(9)
314
    this.initMap();
239 315
    setInterval(() => {
240
      this.nowDate = new Date()
241
    }, 1000)
242
    this.loadFenji()
243
    this.loadchuanbo()
244
    this.loadshengyazhan()
316
      this.nowDate = new Date();
317
    }, 1000);
245 318
  },
246 319
  methods: {
247
    initMap(value) {
248
      if (this.map != null && this.map != '') {
249
        this.map.remove()
320
    initMap() {
321
      if (this.map != null && this.map != "") {
322
        this.map.remove();
250 323
      }
251
      this.map = new Ai.Map('div1', {
252
        ak: 'MTYwMzIMTAwMU1UWXdNekkwTmpBME1EUTFOeU14TnpRdw__',
253
        center: [39.915599, 122.406568]
324
      this.map = new Ai.Map("div1", {
325
        ak: this.$store.getters.getGisToken,
326
        center: [39.915599, 122.406568],
327
      });
328
      var maplayer = null;
329
      maplayer = Ai.TileLayer("http://192.168.74.189:9999/tdtvector");
330
      var la = Ai.WMTSLayer(
331
        "http://192.168.74.216:5071/gisserver/dzht/dzht/wmts",
332
        { opacity: 0.5 }
333
      );
334
      this.map.addLayer(maplayer);
335
      this.map.addLayer(la);
254 336
255
      })
256
      var maplayer = null
257
      maplayer = Ai.TileLayer('http://192.168.74.189:9999/tdtvector')
258
      var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht/dzht/wmts', {opacity: 0.5})
259
      this.map.addLayer(maplayer)
260
      this.map.addLayer(la)
261
262
      Ai.Scale({position: 'bottomright'}).addTo(this.map)
263
      Ai.Zoom({type: 'small'}).addTo(this.map)
264
    },
265
    initTrackMap(value) {
266
      if (this.trackMap != null && this.trackMap != '') {
267
        this.trackMap.remove()
268
      }
269
      this.trackMap = new Ai.Map('track-map', {
270
        ak: 'MTYwMzIMTAwMU1UWXdNekkwTmpBME1EUTFOeU14TnpRdw__',
271
        center: [39.915599, 122.406568]
272
273
      })
274
      var maplayer = null
275
      maplayer = Ai.TileLayer('http://192.168.74.189:9999/tdtvector')
276
      var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht/dzht/wmts', {opacity: 0.5})
277
      this.trackMap.addLayer(maplayer)
278
      this.trackMap.addLayer(la)
279
280
      Ai.Scale({position: 'bottomright'}).addTo(this.trackMap)
281
      Ai.Zoom({type: 'small'}).addTo(this.trackMap)
337
      Ai.Scale({ position: "bottomright" }).addTo(this.map);
338
      Ai.Zoom({ type: "small" }).addTo(this.map);
339
      this.pointsSet();
340
      this.polyline();
341
      this.polygon();
342
      this.map.setZoom(9);
343
      this.loadFenji();
344
      this.loadchuanbo();
345
      this.loadshengyazhan();
282 346
    },
283 347
    pointsSet() {
284
      window.Vue = this
285
      var arr = []
286
      this.pointsLayer = new Ai.FeatureGroup()
287
      var icon = (icon = Ai.IconPulse({ iconSize: [13, 13] }))
348
      window.Vue = this;
349
      var arr = [];
350
      this.pointsLayer = new Ai.FeatureGroup();
351
      var icon = (icon = Ai.IconPulse({ iconSize: [13, 13] }));
288 352
      forEach(this.dataList, (value) => {
289
        var point1
290
        if (value.type == '落水告警') {
291
          point1 = Ai.Point([value.Longitude, value.latitude], {icon: Ai.Icon({
292
            // 设置图标URL路径
293
            iconUrl: '/static/images/worker(1).png',
294
            // 设置图标大小
295
            iconSize: [20, 20],
296
            // 设置点对象和图标的相对偏移量
297
            iconAnchor: [0, 0]
298
          })})
353
        var point1;
354
        if (value.type == "落水告警") {
355
          point1 = Ai.Point([value.Longitude, value.latitude], {
356
            icon: Ai.Icon({
357
              // 设置图标URL路径
358
              iconUrl: "/static/images/worker(1).png",
359
              // 设置图标大小
360
              iconSize: [20, 20],
361
              // 设置点对象和图标的相对偏移量
362
              iconAnchor: [0, 0],
363
            }),
364
          });
299 365
        } else {
300
          point1 = Ai.Point([value.Longitude, value.latitude], {icon: Ai.Icon({
301
            // 设置图标URL路径
302
            iconUrl: '/static/images/worker.png',
303
            // 设置图标大小
304
            iconSize: [20, 20],
305
            // 设置点对象和图标的相对偏移量
306
            iconAnchor: [0, 0]
307
          })})
366
          point1 = Ai.Point([value.Longitude, value.latitude], {
367
            icon: Ai.Icon({
368
              // 设置图标URL路径
369
              iconUrl: "/static/images/worker.png",
370
              // 设置图标大小
371
              iconSize: [20, 20],
372
              // 设置点对象和图标的相对偏移量
373
              iconAnchor: [0, 0],
374
            }),
375
          });
308 376
        }
309
        point1.on('click', (e) => {
310
          console.log(e)
311
          var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="hand-alarm">救援人员</div></div><div class="middle"><div class="row">' +
312
           '<div>终端编号</div>' +
313
           '<div>ZDBH0001</div>' +
314
         '</div>' +
315
         '<div class="row">' +
316
           '<div>最新定位时间</div>' +
317
           '<div>2020.08.13 08:24:32</div>' +
318
         '</div></div></div>' +
319
         '<div style="display:flex;">' +
320
          '<button class="point-out" onClick="window.Vue.rescueModal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
321
          '<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
322
        '</div></div></div>'
323
          var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: true})
324
          // 设置弹出框弹出位置
377
        point1.on("click", (e) => {
378
          console.log(e);
379
          var content =
380
            '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="hand-alarm">救援人员</div></div><div class="middle"><div class="row">' +
381
            "<div>终端编号</div>" +
382
            "<div>ZDBH0001</div>" +
383
            "</div>" +
384
            '<div class="row">' +
385
            "<div>最新定位时间</div>" +
386
            "<div>2020.08.13 08:24:32</div>" +
387
            "</div></div></div>" +
388
            '<div style="display:flex;">' +
389
            '<button class="point-out" onClick="window.Vue.rescueModal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
390
            '<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
391
            "</div></div></div>";
392
          var popup = Ai.Popup({
393
            minWidth: 300,
394
            offset: [0, -10],
395
            autoClose: true,
396
          })
397
            // 设置弹出框弹出位置
325 398
            .setLatLng([value.Longitude, value.latitude])
326
          // 设置弹出框弹出内容
399
            // 设置弹出框弹出内容
327 400
            .setContent(content)
328
            .openOn(this.map)
329
        })
330
        this.pointsLayer.addLayer(point1)
331
        arr.push(point1)
401
            .openOn(this.map);
402
        });
403
        this.pointsLayer.addLayer(point1);
404
        arr.push(point1);
332 405
        // this.pointsarr.push(point1);
333
      })
334
      this.map.addLayer(this.pointsLayer)
335
      this.map.fitBoundsForLayers(arr)
406
      });
407
      this.map.addLayer(this.pointsLayer);
408
      this.map.fitBoundsForLayers(arr);
336 409
    },
337 410
    polyline() {
338
      var polylineLayer = new Ai.FeatureGroup()
411
      var polylineLayer = new Ai.FeatureGroup();
339 412
      // 线绘制
340
      var lineWktStr =
341
        'LINESTRING ( ' + this.polylinearr + ')'
413
      var lineWktStr = "LINESTRING ( " + this.polylinearr + ")";
342 414
      var polyline = new Ai.Polyline(lineWktStr, {
343
        color: 'green',
344
        opacity: 1.0
345
      })
415
        color: "green",
416
        opacity: 1.0,
417
      });
346 418
      // this.polylinearr.arr(polyline);
347
      polylineLayer.addLayer(polyline)
348
      this.map.addLayer(polylineLayer)
419
      polylineLayer.addLayer(polyline);
420
      this.map.addLayer(polylineLayer);
349 421
    },
350 422
    polygon() {
351
      var polygonLayer = new Ai.FeatureGroup()
423
      var params = new FormData()
424
      // params.append('data', JSON.stringify({
425
      //   pageNum: pageNum,
426
      //   pageSize: pageSize,
427
      //   mapTagName: MAP_TAG_NAME
428
      // }))
429
      this.$test.post(services.mapTag.GET_ALL_MAP_TAG, params
430
      ).then(res => {
431
        // 请求成功处理...
432
        res.data.dataList.forEach(e => {
433
          if(e.MAP_TAG_TYPE === 1){
434
            console.log(e.MAP_TAG_SHAPE)
435
          }
436
        })
437
      }).catch(res => {
438
        // 请求失败处理...
439
      })
440
      var polygonLayer = new Ai.FeatureGroup();
352 441
      // 面绘制
353
      var coverWktStr =
354
        'POLYGON ((' + this.polygonarr + '))'
355
      var polygon = Ai.Polygon(coverWktStr, { color: 'red', opacity: 1.0, weight: 0 })
442
      var coverWktStr = "POLYGON ((" + this.polygonarr + "))";
443
      var polygon = Ai.Polygon(coverWktStr, {
444
        color: "red",
445
        opacity: 1.0,
446
        weight: 0,
447
      });
356 448
      // this.polygonarr.arr(polygon);
357
      polygonLayer.addLayer(polygon)
358
      this.map.addLayer(polygonLayer)
449
      polygonLayer.addLayer(polygon);
450
      this.map.addLayer(polygonLayer);
359 451
    },
360 452
    showSlip() {
361
      this.visible = true
453
      this.visible = true;
362 454
    },
363 455
    showPopup(number) {
364
      if (this.popup != null && this.popup != '') {
365
        this.popup.closePopup()
366
        this.popup.remove()
456
      if (this.popup != null && this.popup != "") {
457
        this.popup.closePopup();
458
        this.popup.remove();
367 459
      }
368 460
      var data = find(this.dataList, (o) => {
369
        return o.number == number
370
      })
371
      if (data != null && data != '') {
372
        var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="hand-alarm">救援人员</div></div><div class="middle"><div class="row">' +
373
           '<div>终端编号</div>' +
374
           '<div>ZDBH0001</div>' +
375
         '</div>' +
376
         '<div class="row">' +
377
           '<div>最新定位时间</div>' +
378
           '<div>2020.08.13 08:24:32</div>' +
379
         '</div></div></div>' +
380
         '<div style="display:flex;">' +
461
        return o.number == number;
462
      });
463
      if (data != null && data != "") {
464
        var content =
465
          '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="hand-alarm">救援人员</div></div><div class="middle"><div class="row">' +
466
          "<div>终端编号</div>" +
467
          "<div>ZDBH0001</div>" +
468
          "</div>" +
469
          '<div class="row">' +
470
          "<div>最新定位时间</div>" +
471
          "<div>2020.08.13 08:24:32</div>" +
472
          "</div></div></div>" +
473
          '<div style="display:flex;">' +
381 474
          '<button class="point-out" onClick="window.Vue.modal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
382 475
          '<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
383
        '</div></div></div>'
384
        this.popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
385
        // 设置弹出框弹出位置
386
          .setLatLng({lat: data.Longitude, lng: data.latitude})
387
        // 设置弹出框弹出内容
476
          "</div></div></div>";
477
        this.popup = Ai.Popup({
478
          minWidth: 300,
479
          offset: [0, -10],
480
          autoClose: false,
481
        })
482
          // 设置弹出框弹出位置
483
          .setLatLng({ lat: data.Longitude, lng: data.latitude })
484
          // 设置弹出框弹出内容
388 485
          .setContent(content)
389
          .openOn(this.map)
486
          .openOn(this.map);
390 487
      }
391 488
    },
392 489
    loadFenji() {
393
      var point = Ai.Point([29.86089241772908, 122.09930419921876], {icon: Ai.Icon({
394
        // 设置图标URL路径
395
        iconUrl: '/static/images/风机.png',
396
        // 设置图标大小
397
        iconSize: [20, 20],
398
        // 设置点对象和图标的相对偏移量
399
        iconAnchor: [0, 0]
400
      })})
401
      this.pointsLayer.addLayer(point)
402
      this.map.addLayer(this.pointsLayer)
490
      var point = Ai.Point([29.86089241772908, 122.09930419921876], {
491
        icon: Ai.Icon({
492
          // 设置图标URL路径
493
          iconUrl: "/static/images/风机.png",
494
          // 设置图标大小
495
          iconSize: [20, 20],
496
          // 设置点对象和图标的相对偏移量
497
          iconAnchor: [0, 0],
498
        }),
499
      });
500
      this.pointsLayer.addLayer(point);
501
      this.map.addLayer(this.pointsLayer);
403 502
    },
404 503
    loadchuanbo() {
405
      var point = Ai.Point([29.960892, 122.09930419921876], {icon: Ai.Icon({
406
        // 设置图标URL路径
407
        iconUrl: '/static/images/船舶.png',
408
        // 设置图标大小
409
        iconSize: [20, 20],
410
        // 设置点对象和图标的相对偏移量
411
        iconAnchor: [0, 0]
412
      })})
413
      this.pointsLayer.addLayer(point)
414
      this.map.addLayer(this.pointsLayer)
504
      var point = Ai.Point([29.960892, 122.09930419921876], {
505
        icon: Ai.Icon({
506
          // 设置图标URL路径
507
          iconUrl: "/static/images/船舶.png",
508
          // 设置图标大小
509
          iconSize: [20, 20],
510
          // 设置点对象和图标的相对偏移量
511
          iconAnchor: [0, 0],
512
        }),
513
      });
514
      this.pointsLayer.addLayer(point);
515
      this.map.addLayer(this.pointsLayer);
415 516
    },
416 517
    loadshengyazhan() {
417
      var point = Ai.Point([29.86089241772908, 122.1993], {icon: Ai.Icon({
418
        // 设置图标URL路径
419
        iconUrl: '/static/images/升压站画面.png',
420
        // 设置图标大小
421
        iconSize: [20, 20],
422
        // 设置点对象和图标的相对偏移量
423
        iconAnchor: [0, 0]
424
      })})
425
      this.pointsLayer.addLayer(point)
426
      this.map.addLayer(this.pointsLayer)
518
      var point = Ai.Point([29.86089241772908, 122.1993], {
519
        icon: Ai.Icon({
520
          // 设置图标URL路径
521
          iconUrl: "/static/images/升压站画面.png",
522
          // 设置图标大小
523
          iconSize: [20, 20],
524
          // 设置点对象和图标的相对偏移量
525
          iconAnchor: [0, 0],
526
        }),
527
      });
528
      this.pointsLayer.addLayer(point);
529
      this.map.addLayer(this.pointsLayer);
427 530
    },
428 531
    changeTrackTime(index) {
429
      this.trackQueryCondition.currentIndex = index
430
    },
431
    onChangeDate() {
432
433
    },
434
    toExport() {
435
532
      this.trackQueryCondition.currentIndex = index;
436 533
    },
534
    onChangeDate() {},
535
    toExport() {},
437 536
    close(item) {
438 537
      this.$Confirm.confirm({
439
        title: '确认要关闭张三落水报警吗?',
440
        content: '关闭后将不再进行报警显示',
538
        title: "确认要关闭张三落水报警吗?",
539
        content: "关闭后将不再进行报警显示",
441 540
        ok: () => {
442
          console.log('点击了确定')
541
          console.log("点击了确定");
443 542
        },
444 543
        cancel: () => {
445
          console.log('点击了取消')
446
        }
447
      })
544
          console.log("点击了取消");
545
        },
546
      });
448 547
    },
449 548
    cancel() {
450
      this.rescueModal = false
451
    }
452
  }
453
}
549
      this.rescueModal = false;
550
    },
551
  },
552
};
454 553
</script>

+ 99 - 126
ebc-middle-platform/src/modules/system-management/map-mark.vue

@ -28,17 +28,17 @@
28 28
        <t-table-column prop="MAP_TAG_NAME" label="标记名称"></t-table-column>
29 29
        <t-table-column label="类型">
30 30
          <template slot-scope="scope">
31
            <el-tag v-if="scope.row.MAP_TAG_TYPE==1">考勤区域</el-tag>
32
            <el-tag v-if="scope.row.MAP_TAG_TYPE==2">作业区域</el-tag>
33
            <el-tag v-if="scope.row.MAP_TAG_TYPE==3">电子围栏</el-tag>
34
            <el-tag v-if="scope.row.MAP_TAG_TYPE==4">定点</el-tag>
31
            <div v-if="scope.row.MAP_TAG_TYPE==1">考勤区域</div>
32
            <div v-if="scope.row.MAP_TAG_TYPE==2">作业区域</div>
33
            <div v-if="scope.row.MAP_TAG_TYPE==3">电子围栏</div>
34
            <div v-if="scope.row.MAP_TAG_TYPE==4">定点</div>
35 35
          </template>
36 36
        </t-table-column>
37
        <t-table-column prop="CREATE_DATE":formatter="timestampToTime" label="创建时间"></t-table-column>
37
        <t-table-column :formatter="timestampToTime" prop="CREATE_DATE" label="创建时间"></t-table-column>
38 38
        <t-table-column
39
            fixed="right"
40
            label="操作"
41
            width="120"
39
          fixed="right"
40
          label="操作"
41
          width="120"
42 42
        >
43 43
          <template slot-scope="scope">
44 44
            <a href="javascript:void(0)" size="sm" @click="handleClick(scope.row)">编辑</a>
@ -79,9 +79,9 @@
79 79
            <div>坐标列表</div>
80 80
            <div class="import-down">
81 81
              <a href="javascript:void(0)" size="sm" @click="handleFile1()">导入</a>
82
              <input type="file" @change="handleFile($event)"
82
              <input id="file" type="file"
83 83
                     accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
84
                     style="display:none" id="file" >
84
                     style="display:none" @change="handleFile($event)" >
85 85
              <span class="mod-line">|</span>
86 86
              <a href="javascript:void(0)" size="sm" @click="downloadTemplate()">下载模板</a>
87 87
            </div>
@ -163,57 +163,48 @@ export default {
163 163
    this.getList(1, 20, '')
164 164
  },
165 165
  mounted() {
166
    this.$test.post(services.mapTag.GET_TOKEN, ''
167
    ).then(res => {
168
      // 请求成功处理...
169
      let ak = res.data.result.ak
170
      this.map = new Ai.Map('modalMap', {
171
        ak: ak,
172
        center: [39.915599, 116.406568],
173
        zoom: 5
174
      })
175
      var maplayer = null
176
      maplayer = Ai.TileLayer('http://192.168.74.189:9999/tdtvector')
177
      this.map.addLayer(maplayer)
178
      var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht/dzht/wmts',{opacity:0.5});
179
      this.map.addLayer(la);
180
      var options = {
181
        guideLayers: []// 导向(吸附)图层对象,当距离相隔很近的时候会与导向对象重合
182
      }
183
      this.polygonDrawer = Ai.DrawPolygon(this.map, options)// 初始化多边形绘制工具
184
      this.polygonDrawer.enable()// 激活多边形绘制工具
185
      this.map.on(AiDrawEvent.CREATED, (e) => {
186
        debugger
187
        console.log(1)
188
        this.layer = this.polygonDrawer.polygon(e)// 获取多边形信息
189
        // console.log(this.polygonDrawer.getPoints())
190
        this.modalData = this.layer._latlngs[0]
191
        this.polygonDrawer.editing(this.layer)
192
        this.polygonDrawer.disable()
193
        this.map.addLayer(this.layer)
194
      })
195
    }).catch(res => {
196
      // 请求失败处理...
166
    // 请求成功处理...
167
    let ak = this.$store.getters.getGisToken
168
    this.map = new Ai.Map('modalMap', {
169
      ak: ak,
170
      center: [39.915599, 116.406568],
171
      zoom: 5
172
    })
173
    var maplayer = null
174
    maplayer = Ai.TileLayer('http://192.168.74.189:9999/tdtvector')
175
    this.map.addLayer(maplayer)
176
    var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht/dzht/wmts', {opacity: 0.5})
177
    this.map.addLayer(la)
178
    var options = {
179
      guideLayers: []// 导向(吸附)图层对象,当距离相隔很近的时候会与导向对象重合
180
    }
181
    this.polygonDrawer = Ai.DrawPolygon(this.map, options)// 初始化多边形绘制工具
182
    this.polygonDrawer.enable()// 激活多边形绘制工具
183
    this.map.on(AiDrawEvent.CREATED, (e) => {
184
      // debugger
185
      console.log(1)
186
      this.layer = this.polygonDrawer.polygon(e)// 获取多边形信息
187
      // console.log(this.polygonDrawer.getPoints())
188
      this.modalData = this.layer._latlngs[0]
189
      this.polygonDrawer.editing(this.layer)
190
      this.polygonDrawer.disable()
191
      this.map.addLayer(this.layer)
197 192
    })
198 193
  },
199
  // watch: {
200
  // },
201 194
  methods: {
202 195
    getList(pageNum, pageSize, MAP_TAG_NAME) {
203 196
      var params = new FormData()
204 197
      params.append('data', JSON.stringify({
205
        params: {
206
          pageNum: pageNum,
207
          pageSize: pageSize,
208
          MAP_TAG_NAME: MAP_TAG_NAME
209
        }
198
        pageNum: pageNum,
199
        pageSize: pageSize,
200
        mapTagName: MAP_TAG_NAME
210 201
      }))
211 202
      this.$test.post(services.mapTag.GET_MAP_TAG, params
212 203
      ).then(res => {
213 204
        // 请求成功处理...
214
        this.table.data = res.data.result.list
215
        this.table.pager.total = res.data.result.total
216
        this.table.pager.currentPage = res.data.result.pageNum
205
        this.table.data = res.data.dataList
206
        this.table.pager.total = res.data.dataNum
207
        this.table.pager.currentPage = pageNum
217 208
      }).catch(res => {
218 209
        // 请求失败处理...
219 210
      })
@ -241,7 +232,7 @@ export default {
241 232
      this.$test.post(services.excel.EXPROT_MAP_TAG, params
242 233
      ).then(res => {
243 234
        // 请求成功处理...
244
        debugger
235
        // debugger
245 236
        console.log(res)
246 237
        this.downloadDoc(res.data)
247 238
      }).catch(res => {
@ -249,16 +240,16 @@ export default {
249 240
      })
250 241
    },
251 242
    downloadDoc(response) {
252
      debugger
253
      var blob = new Blob([response], {type: 'application/vnd.ms-excel;charset=utf-8'});
254
      var downloadElement = document.createElement('a');
255
      var href = window.URL.createObjectURL(blob); // 创建下载的链接
256
      downloadElement.href = href;
257
      downloadElement.download = '表格'+'.xls'; // 下载后文件名
258
      document.body.appendChild(downloadElement);
259
      downloadElement.click(); // 点击下载
260
      document.body.removeChild(downloadElement); // 下载完成移除元素
261
      window.URL.revokeObjectURL(href); // 释放掉blob对象
243
      // debugger
244
      var blob = new Blob([response], {type: 'application/vnd.ms-excel;charset=utf-8'})
245
      var downloadElement = document.createElement('a')
246
      var href = window.URL.createObjectURL(blob) // 创建下载的链接
247
      downloadElement.href = href
248
      downloadElement.download = '表格' + '.xls' // 下载后文件名
249
      document.body.appendChild(downloadElement)
250
      downloadElement.click() // 点击下载
251
      document.body.removeChild(downloadElement) // 下载完成移除元素
252
      window.URL.revokeObjectURL(href) // 释放掉blob对象
262 253
    },
263 254
    markModal(typeId) {
264 255
      this.markType = typeId
@ -269,14 +260,14 @@ export default {
269 260
      this.polygonDrawer.enable()
270 261
    },
271 262
    timestampToTime (cjsj) {
272
      var date = new Date(cjsj.CREATE_DATE) //时间戳为10位需*1000,时间戳为13位的话不需乘1000
263
      var date = new Date(cjsj.CREATE_DATE) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
273 264
      var Y = date.getFullYear() + '-'
274
      var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'
265
      var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
275 266
      var D = date.getDate() + ' '
276 267
      var h = date.getHours() + ':'
277 268
      var m = date.getMinutes() + ':'
278 269
      var s = date.getSeconds()
279
      return Y+M+D+h+m+s
270
      return Y + M + D + h + m + s
280 271
    },
281 272
    submitMark() {
282 273
      if (this.modalData.length == 0) {
@ -286,7 +277,7 @@ export default {
286 277
        })
287 278
        return false
288 279
      }
289
      debugger
280
      // debugger
290 281
      if (this.markName === '') {
291 282
        this.$Confirm.warning({
292 283
          title: '提示',
@ -295,44 +286,39 @@ export default {
295 286
        return false
296 287
      }
297 288
298
      let arr = []
289
      let arr = ''
299 290
      for (let i = 0; i < this.modalData.length; i++) {
300
        let g = {
301
          XY_NAME: i + 1,
302
          LONGITUDE: this.modalData[i].lng,
303
          LATITUDE: this.modalData[i].lat
304
        }
305
        arr.push(g)
291
        arr = arr + (this.modalData[i].lng + ' ' + this.modalData[i].lat + ',')
306 292
      }
293
      arr = arr + (this.modalData[0].lng + ' ' + this.modalData[0].lat)
307 294
      var params = new FormData()
308 295
      if (this.update) {
309 296
        params.append('data', JSON.stringify({
310
          params: {
311
            MAP_TAG_NAME: this.markName,
312
            MAP_TAG_TYPE: this.markType,
313
            CREATE_DATE: this.getTime(),
314
            MAP_TAG_ID: this.updateId,
315
            MAP_TAG_CONTENT: {
316
              xingzhuang: 'yuanxing',
317
              yuanxin: 'yuanxin'
318
            },
319
            EBC_MAP_TAG_XY: arr
320
          }
297
            mapTagName: this.markName,
298
            mapTagType: this.markType,
299
            mapTagShape: arr,
300
            mapTagId: this.updateId
321 301
        }))
302
        this.$test.post(services.mapTag.UPD_MAP_TAG, params
303
      ).then(res => {
304
        // 请求成功处理...
305
        this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.userName)
306
        this.polygonDrawer.disable()
307
        this.modalData = []
308
        this.markName = ''
309
        this.$Message.success('操作成功')
310
        this.map.removeLayer(this.layer)
311
        this.update = false
312
      }).catch(res => {
313
        // 请求失败处理...
314
      })
322 315
      } else {
323 316
        params.append('data', JSON.stringify({
324
          params: {
325
            MAP_TAG_NAME: this.markName,
326
            MAP_TAG_TYPE: this.markType,
327
            CREATE_DATE: this.getTime(),
328
            MAP_TAG_CONTENT: {
329
              xingzhuang: 'yuanxing',
330
              yuanxin: 'yuanxin'
331
            },
332
            EBC_MAP_TAG_XY: arr
333
          }
317
          mapTagName: this.markName,
318
          mapTagType: this.markType,
319
          mapTagShape: arr
334 320
        }))
335
      }
321
      
336 322
      this.update = false
337 323
      this.$test.post(services.mapTag.ADD_MAP_TAG, params
338 324
      ).then(res => {
@ -346,6 +332,7 @@ export default {
346 332
      }).catch(res => {
347 333
        // 请求失败处理...
348 334
      })
335
      }
349 336
    },
350 337
    getTime() {
351 338
      var date = new Date()
@ -374,38 +361,24 @@ export default {
374 361
    handleClick(row) {
375 362
      var params = new FormData()
376 363
      params.append('data', JSON.stringify({
377
        params: {
378
          MAP_TAG_ID: row.MAP_TAG_ID
379
        }
364
        mapTagId: row.MAP_TAG_ID
380 365
      }))
381
      this.$test.post(services.mapTag.UPD_MAP_TAG, params
366
      this.$test.post(services.mapTag.GET_ONE_MAP_TAG, params
382 367
      ).then(res => {
383 368
        // 请求成功处理...
384
        let arr = res.data.result.mapTagXyList
385 369
        this.modalData = []
386
        var coverWktStr_blue = 'POLYGON (( '
387
        for (let i = 0; i < arr.length; i++) {
388
          // this.modalData.push({
389
          //   lng: parseFloat(arr[i]['LONGITUDE']),
390
          //   lat: parseFloat(arr[i]['LATITUDE'])
391
          // })
392
          coverWktStr_blue += arr[i]['LONGITUDE'] + ' ' + arr[i]['LATITUDE'] + ','
393
        }
394
        this.map.setView([parseFloat(arr[0]['LATITUDE']),  parseFloat(arr[0]['LONGITUDE'])], 5);//地图定位
395
        // that.map.center =  []
396
        debugger;
397
        coverWktStr_blue = coverWktStr_blue.substring(0,coverWktStr_blue.length-1)
398
        coverWktStr_blue += '))'
370
        var coverWktStr_blue = res.data.resultData.MAP_TAG_SHAPE
371
        console.log(res.data.resultData.MAP_TAG_SHAPE)
399 372
        var coverLayer_blue = new Ai.Polygon(coverWktStr_blue)
400
        this.map.addLayer(coverLayer_blue)
401
        //面设为编辑状态
373
        // this.map.addLayer(coverLayer_blue)
374
        // 面设为编辑状态
402 375
        coverLayer_blue.snapediting = new Ai.PolylineSnap(this.map, coverLayer_blue)
403 376
        coverLayer_blue.snapediting.enable()
404 377
        this.layer = coverLayer_blue
405 378
        this.map.addLayer(coverLayer_blue)
379
        this.polygonDrawer.editing(this.layer)
406 380
        this.modalData = coverLayer_blue._latlngs[0]
407 381
        this.polygonDrawer.disable()
408
409 382
      }).catch(res => {
410 383
        // 请求失败处理...
411 384
      })
@ -450,9 +423,9 @@ export default {
450 423
      var files = e.target.files
451 424
      var f = files[0]
452 425
      var reader = new FileReader()
453
      debugger
426
      // debugger
454 427
      reader.onload = function(e) {
455
        debugger
428
        // debugger
456 429
        var data = new Uint8Array(e.target.result)
457 430
        var workbook = XLSX.read(data, {type: 'array'})
458 431
        /* DO SOMETHING WITH workbook HERE */
@ -468,14 +441,14 @@ export default {
468 441
          })
469 442
          coverWktStr_blue += arr[i]['经度'] + ' ' + arr[i]['纬度'] + ','
470 443
        }
471
        that.map.setView([parseFloat(arr[0]['纬度']),  parseFloat(arr[0]['经度'])], 5);//地图定位
444
        that.map.setView([parseFloat(arr[0]['纬度']), parseFloat(arr[0]['经度'])], 5)// 地图定位
472 445
        // that.map.center =  []
473
        debugger;
474
        coverWktStr_blue = coverWktStr_blue.substring(0,coverWktStr_blue.length-1)
446
        // debugger
447
        coverWktStr_blue = coverWktStr_blue.substring(0, coverWktStr_blue.length - 1)
475 448
        coverWktStr_blue += '))'
476 449
        var coverLayer_blue = new Ai.Polygon(coverWktStr_blue, {color: 'red'})
477 450
        that.map.addLayer(coverLayer_blue)
478
        //面设为编辑状态
451
        // 面设为编辑状态
479 452
        coverLayer_blue.snapediting = new Ai.PolylineSnap(that.map, coverLayer_blue)
480 453
        coverLayer_blue.snapediting.enable()
481 454
        that.layer = coverLayer_blue
@ -483,7 +456,7 @@ export default {
483 456
        that.modalData = coverLayer_blue._latlngs[0]
484 457
        that.polygonDrawer.disable()
485 458
      }
486
      debugger
459
      // debugger
487 460
      reader.readAsArrayBuffer(f)
488 461
    },
489 462
    remove(row) {
@ -494,13 +467,13 @@ export default {
494 467
        ok: function () {
495 468
          var params = new FormData()
496 469
          params.append('data', JSON.stringify({
497
            MAP_TAG_ID: row.MAP_TAG_ID
470
            mapTagId: row.MAP_TAG_ID
498 471
          }))
499
          debugger
472
          // debugger
500 473
          this.$test.post(services.mapTag.DEL_MAP_TAG, params
501 474
          ).then(res => {
502 475
            // 请求成功处理...
503
            debugger
476
            // debugger
504 477
            this.$Message.success('操作成功')
505 478
            that.getList(that.table.pager.currentPage, that.table.pager.size, that.queryCondition.userName)
506 479
          }).catch(res => {

+ 8 - 1
ebc-middle-platform/src/store.js

@ -57,7 +57,8 @@ const store = new Vuex.Store({
57 57
  state: {
58 58
    currentTitle: '',
59 59
    screenIsLocked: false,
60
    lang: 'zh-CN'
60
    lang: 'zh-CN',
61
    gistoken: ''
61 62
  },
62 63
  mutations: {
63 64
    // 改变语言
@ -76,6 +77,9 @@ const store = new Vuex.Store({
76 77
    },
77 78
    setTitle(state, newTitle) {
78 79
      state.currentTitle = newTitle || ''
80
    },
81
    setGisToken(state, token){
82
      state.gistoken = token
79 83
    }
80 84
  },
81 85
  getters: {
@ -101,6 +105,9 @@ const store = new Vuex.Store({
101 105
      } else {
102 106
        return 'EN'
103 107
      }
108
    },
109
    getGisToken(state){
110
      return state.gistoken
104 111
    }
105 112
  },
106 113
  modules: {