wangkang3 4 gadi atpakaļ
vecāks
revīzija
76ef98bf1e

+ 2 - 0
ebc-middle-platform/src/conf/services.js

@ -61,6 +61,7 @@ export default {
61 61
    QUERYMENUBYMENUNAME: '/menu/menuName/:menuName'
62 62
  },
63 63
  organization: {
64
    PERSON_LOCATION: '/device/queryCurrentDeviceLocationInfo',
64 65
    GETTREEALLDATA: '/org/queryOrg', // 获取所有组织数据
65 66
    ORG: '/org', // 新增post,修改put,删除delete子组织
66 67
    GETBYIDSEARCHORG: '/org/orgId/', // 根据ID查组织
@ -149,6 +150,7 @@ export default {
149 150
    UPD_MAP_TAG: '/mapTag/modifyMapTagInfo' // 查询地图标记信息用作修改
150 151
  },
151 152
  equipment: {
153
    GET_ALL_EQUIPMENT: '/equipment/queryAllEquipmentInfo', // 查询所有设备信息
152 154
    GET_EQUIPMENT: '/equipment/queryEquipmentInfo', // 查询设备管理信息
153 155
    ADD_EQUIPMENT: '/equipment/modifyEquipmentInfo', // 新增/修改设备管理信息
154 156
    DEL_EQUIPMENT: '/equipment/deleteEquipmentInfo', // 删除设备管理信息

+ 1 - 0
ebc-middle-platform/src/constants.js

@ -12,3 +12,4 @@ export const RESPONSE_BOUNDARY_PAD = 992 // 响应式布局平板宽度边界值
12 12
export const RESPONSE_BOUNDARY_PHONE = 600 // 响应式布局手机宽度边界值(像素)
13 13
export const LANG_CN = 'zh-CN' // 简体中文
14 14
export const LANG_US = 'en-US' // 美式英文
15
export const GIS_SEA_URL = 'http://192.168.74.189:9999/tdtvector' // 海图地址

+ 12 - 11
ebc-middle-platform/src/modules/layouts/BasicLayout.vue

@ -44,7 +44,8 @@
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
import services from '../../conf/services'
48
import EventBus from '../../bus'
48 49
export default {
49 50
  name: 'BasicLayout',
50 51
  components: {
@ -52,7 +53,7 @@ export default {
52 53
  },
53 54
  data () {
54 55
    return {
55
      modal: true
56
      modal: false
56 57
    }
57 58
  },
58 59
  computed: {
@ -62,20 +63,20 @@ export default {
62 63
  },
63 64
  mounted() {
64 65
    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
        });
66
      .post(services.mapTag.GET_TOKEN, '')
67
      .then((res) => {
68
        this.$store.commit('setGisToken', res.data.result.ak)
69
      })
70
      .catch((res) => {
71
        // 请求失败处理...
72
      })
72 73
    // 镜屏调用
73 74
    var client
74 75
    var callbacks = {}
75 76
    callbacks.onConnected = msg => {
76 77
      console.log('连接成功:' + msg)
77 78
      client.subscribe('zhangsan', msg => {
78
        console.log(msg)
79
        EventBus.$emit('person', msg)
79 80
      })
80 81
    }
81 82
    callbacks.onFailure = msg => {
@ -83,7 +84,7 @@ export default {
83 84
    }
84 85
    client = IpuStomp(
85 86
      {
86
        url: 'ws://192.168.3.200:7100/stomp',
87
        url: 'ws://192.168.137.178:7100/stomp',
87 88
        name: 'zhangsan',
88 89
        passcode: '123456',
89 90
        UUID: 'zhangsan'

+ 43 - 0
ebc-middle-platform/src/modules/orientation/orientation.scss

@ -82,6 +82,7 @@
82 82
        margin-right: 30px;
83 83
        >div{
84 84
          display: flex;
85
          cursor:pointer;
85 86
          .sos{
86 87
            width: 10px;
87 88
            height: 10px;
@ -149,6 +150,12 @@
149 150
            margin-right: 5px;
150 151
          }
151 152
        }
153
        .cancel{
154
          color: #8A959E;
155
          .sos,.offline,.outline,.normal,.zyqy,.dzwl{
156
            background-color: #8A959E;
157
          }
158
        }
152 159
      }
153 160
    }
154 161
}
@ -293,6 +300,42 @@ background: #344979!important;
293 300
      height: 25px;
294 301
      line-height: 25px;
295 302
    }
303
    .normal{
304
      color: #19BB20;
305
      background-color:#1E5962;
306
      margin: 7.5px 0 0 5px;
307
      padding: 0 5px;
308
      font-size: 8px;
309
      height: 25px;
310
      line-height: 25px;
311
    }
312
    .sos{
313
      color:#F5222D;
314
      background-color:#383F72;
315
      margin: 7.5px 0 0 5px;
316
      padding: 0 5px;
317
      font-size: 8px;
318
      height: 25px;
319
      line-height: 25px;
320
    }
321
    .offline{
322
      color: #000000;
323
      background-color:#486083;
324
      margin: 7.5px 0 0 5px;
325
      padding: 0 5px;
326
      font-size: 8px;
327
      height: 25px;
328
      line-height: 25px;
329
    }
330
    .outline{
331
      color: #DA9D23;
332
      background-color:#1E5962;
333
      margin: 7.5px 0 0 5px;
334
      padding: 0 5px;
335
      font-size: 8px;
336
      height: 25px;
337
      line-height: 25px;
338
    }
296 339
  }
297 340
  .middle{
298 341
    padding-left: 20px;

+ 364 - 302
ebc-middle-platform/src/modules/orientation/orientation.vue

@ -26,7 +26,7 @@
26 26
              trackModal = true;
27 27
            }
28 28
          "
29
          >轨迹</t-button
29
        >轨迹</t-button
30 30
        >
31 31
        <div>悬浮窗<t-switch rounded></t-switch></div>
32 32
      </div>
@ -34,43 +34,43 @@
34 34
    <div id="div1" style="height: 100%"></div>
35 35
    <div class="label">
36 36
      <div class="item">
37
        <div>
37
        <div :class="mapShow.sos?'':'cancel'" @click="showOrHide(layer.sosLayer,'sos')">
38 38
          <div class="sos"></div>
39 39
          <div>SOS</div>
40 40
        </div>
41
        <div>
41
        <div :class="mapShow.offLine?'':'cancel'" @click="showOrHide(layer.offLineLayer,'offLine')">
42 42
          <div class="offline"></div>
43 43
          <div>离线</div>
44 44
        </div>
45
        <div>
45
        <div :class="mapShow.outLine?'':'cancel'" @click="showOrHide(layer.outLineLayer,'outLine')">
46 46
          <div class="outline"></div>
47 47
          <div>违规</div>
48 48
        </div>
49
        <div>
49
        <div :class="mapShow.normal?'':'cancel'" @click="showOrHide(layer.normalLayer,'normal')">
50 50
          <div class="normal"></div>
51 51
          <div>正常</div>
52 52
        </div>
53 53
      </div>
54 54
      <div class="item">
55
        <div>
55
        <div :class="mapShow.fenji?'':'cancel'" @click="showOrHide(layer.fenjiLayer,'fenji')">
56 56
          <div class="fenji"></div>
57 57
          <div>风机</div>
58 58
        </div>
59
        <div>
59
        <div :class="mapShow.shengyazhan?'':'cancel'" @click="showOrHide(layer.shengyazhanLayer,'shengyazhan')">
60 60
          <div class="shengyazhan"></div>
61 61
          <div>升压站</div>
62 62
        </div>
63
        <div>
63
        <div :class="mapShow.chuanbo?'':'cancel'" @click="showOrHide(layer.chuanboLayer,'chuanbo')">
64 64
          <div class="chuanbo"></div>
65 65
          <div>船舶</div>
66 66
        </div>
67 67
      </div>
68 68
      <div class="item">
69
        <div>
69
        <div :class="mapShow.zyqy?'':'cancel'" @click="showOrHide(layer.zyqyLayer,'zyqy')">
70 70
          <div class="zyqy"></div>
71 71
          <div>作业区域</div>
72 72
        </div>
73
        <div>
73
        <div :class="mapShow.dzwl?'':'cancel'" @click="showOrHide(layer.dzwlLayer,'dzwl')">
74 74
          <div class="dzwl"></div>
75 75
          <div>电子围栏</div>
76 76
        </div>
@ -110,7 +110,7 @@
110 110
                "
111 111
                :key="index"
112 112
                @click="changeTrackTime(index)"
113
                >{{ item }}</t-button
113
              >{{ item }}</t-button
114 114
              >
115 115
            </t-button-group>
116 116
            <t-date-picker
@ -130,7 +130,7 @@
130 130
            </div>
131 131
            <t-button color="success" icon="video-outline">回放</t-button>
132 132
            <t-button color="secondary" icon="upload-outline" @click="toExport"
133
              >导出至Excel</t-button
133
            >导出至Excel</t-button
134 134
            >
135 135
          </div>
136 136
          <div id="track-map" style="height: 94%"></div>
@ -161,393 +161,455 @@
161 161
</template>
162 162
163 163
<script>
164
import "./orientation.scss";
165
import { forEach, filter, find } from "lodash";
166
import services from "../../conf/services";
164
import './orientation.scss'
165
import { forEach, filter, find } from 'lodash'
166
import services from '../../conf/services'
167
import IpuStomp from '../../ipu-stomp'
168
import EventBus from '../../bus'
167 169
export default {
168 170
  filters: {
169 171
    dateFormat(value) {
170
      var year = value.getFullYear();
172
      var year = value.getFullYear()
171 173
      var month =
172
        value.getMonth() >= 10 ? value.getMonth() : "0" + value.getMonth();
173
      var day = value.getDate() >= 10 ? value.getDate() : "0" + value.getDate();
174
        value.getMonth() >= 10 ? value.getMonth() : '0' + value.getMonth()
175
      var day = value.getDate() >= 10 ? value.getDate() : '0' + value.getDate()
174 176
      var hours =
175
        value.getHours() >= 10 ? value.getHours() : "0" + value.getHours();
177
        value.getHours() >= 10 ? value.getHours() : '0' + value.getHours()
176 178
      var minutes =
177 179
        value.getMinutes() >= 10
178 180
          ? value.getMinutes()
179
          : "0" + value.getMinutes();
181
          : '0' + value.getMinutes()
180 182
      var seconds =
181 183
        value.getSeconds() >= 10
182 184
          ? value.getSeconds()
183
          : "0" + value.getSeconds();
185
          : '0' + value.getSeconds()
184 186
      return (
185 187
        year +
186
        "." +
188
        '.' +
187 189
        month +
188
        "." +
190
        '.' +
189 191
        day +
190
        " " +
192
        ' ' +
191 193
        hours +
192
        ":" +
194
        ':' +
193 195
        minutes +
194
        ":" +
196
        ':' +
195 197
        seconds
196
      );
197
    },
198
      )
199
    }
198 200
  },
199 201
  data() {
200 202
    return {
201 203
      map: null,
202 204
      pointsarr: null,
203 205
      polylinearr:
204
        "122.0352 32.4444,122.0372 32.4444,122.0400 32.4366,122.2922 32.4233",
206
        '122.0352 32.4444,122.0372 32.4444,122.0400 32.4366,122.2922 32.4233',
205 207
      polygonarr:
206
        "122.2302 32.5444,122.2302 32.3444, 122.4302 32.3444,122.4302 32.6044,122.2302 32.5444",
208
        '122.2302 32.5444,122.2302 32.3444, 122.4302 32.3444,122.4302 32.6044,122.2302 32.5444',
207 209
      popup: null,
208 210
      shadow: false,
209 211
      dataList: [
210 212
        {
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分钟",
213
          name: '王小明',
214
          number: 'ZDBH0001',
215
          type: '落水告警',
216
          Longitude: '32.4233',
217
          latitude: '122.2922',
218
          alarmTime: '2020.7.10 08:21:43',
219
          newMarkerTime: '2020.7.10 08:21:43',
220
          rescuePerson: '海事局A',
221
          rescueTime: '2020.7.3 11:22:16',
222
          rescueDuration: '10小时39分钟'
221 223
        },
222 224
        {
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分钟",
225
          name: '王小明1',
226
          number: 'ZDBH0002',
227
          type: '正常',
228
          Longitude: '32.333',
229
          latitude: '122.0822',
230
          alarmTime: '2020.7.10 08:21:43',
231
          newMarkerTime: '2020.7.10 08:21:43',
232
          rescuePerson: '海事局A',
233
          rescueTime: '2020.7.3 11:22:16',
234
          rescueDuration: '10小时39分钟'
233 235
        },
234 236
        {
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分钟",
237
          name: '王小明2',
238
          number: 'ZDBH0003',
239
          type: '正常',
240
          Longitude: '32.4444',
241
          latitude: '122.0352',
242
          alarmTime: '2020.7.10 08:21:43',
243
          newMarkerTime: '2020.7.10 08:21:43',
244
          rescuePerson: '海事局A',
245
          rescueTime: '2020.7.3 11:22:16',
246
          rescueDuration: '10小时39分钟'
245 247
        },
246 248
        {
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分钟",
249
          name: '王小明3',
250
          number: 'ZDBH0004',
251
          type: '离线',
252
          Longitude: '32.555',
253
          latitude: '121.0752',
254
          alarmTime: '2020.7.10 08:21:43',
255
          newMarkerTime: '2020.7.10 08:21:43',
256
          rescuePerson: '海事局A',
257
          rescueTime: '2020.7.3 11:22:16',
258
          rescueDuration: '10小时39分钟'
257 259
        },
258 260
        {
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
        },
261
          name: '王小明4',
262
          number: 'ZDBH0005',
263
          type: '落水告警',
264
          Longitude: '32.466',
265
          latitude: '122.04322',
266
          alarmTime: '2020.7.10 08:21:43',
267
          newMarkerTime: '2020.7.10 08:21:43',
268
          rescuePerson: '海事局A',
269
          rescueTime: '2020.7.3 11:22:16',
270
          rescueDuration: '10小时39分钟'
271
        }
270 272
      ],
271 273
      nowDate: new Date(),
272 274
      modal: false,
273 275
      trackModal: false,
274
      trackSearch: "",
275
      trackTimeList: ["-10min", "-1h", "本日", "自定义"],
276
      trackSearch: '',
277
      trackTimeList: ['-10min', '-1h', '本日', '自定义'],
276 278
      trackQueryCondition: {
277
        currentIndex: 0,
279
        currentIndex: 0
278 280
      },
279 281
      trackMap: null,
280
      rangeDate: "",
282
      rangeDate: '',
281 283
      rescueModal: false,
282 284
      formValidate: {
283
        rescue: "",
285
        rescue: ''
284 286
      },
285 287
      ruleValidate: {
286 288
        rescue: [
287 289
          {
288 290
            required: true,
289
            message: "救援人员不能为空",
290
            trigger: "blur",
291
          },
292
        ],
291
            message: '救援人员不能为空',
292
            trigger: 'blur'
293
          }
294
        ]
295
      },
296
      layer: {
297
        dzwlLayer: new Ai.FeatureGroup(),
298
        zyqyLayer: new Ai.FeatureGroup(),
299
        fenjiLayer: new Ai.FeatureGroup(),
300
        chuanboLayer: new Ai.FeatureGroup(),
301
        shengyazhanLayer: new Ai.FeatureGroup(),
302
        sosLayer: new Ai.FeatureGroup(),
303
        offLineLayer: new Ai.FeatureGroup(),
304
        outLineLayer: new Ai.FeatureGroup(),
305
        normalLayer: new Ai.FeatureGroup()
293 306
      },
294
    };
307
      mapShow: {
308
        dzwl: true,
309
        zyqy: true,
310
        fenji: true,
311
        chuanbo: true,
312
        shengyazhan: true,
313
        sos: true,
314
        offLine: true,
315
        outLine: true,
316
        normal: true
317
      },
318
      fitBounds: []
319
    }
295 320
  },
296 321
  computed: {
297 322
    normalData: function () {
298 323
      return filter(this.dataList, function (o) {
299
        return o.type == "正常";
300
      });
324
        return o.type == '正常'
325
      })
301 326
    },
302 327
    alertData: function () {
303 328
      return filter(this.dataList, function (o) {
304
        return o.type == "落水告警";
305
      });
329
        return o.type == '落水告警'
330
      })
306 331
    },
307 332
    offlineData: function () {
308 333
      return filter(this.dataList, function (o) {
309
        return o.type == "离线";
310
      });
311
    },
334
        return o.type == '离线'
335
      })
336
    }
312 337
  },
313 338
  mounted() {
314
    this.initMap();
339
    this.initMap()
340
    this.initTrackMap()
315 341
    setInterval(() => {
316
      this.nowDate = new Date();
317
    }, 1000);
342
      this.nowDate = new Date()
343
    }, 1000)
344
    EventBus.$on('person', (msg) => {
345
      this.changeLocation(msg)
346
    })
318 347
  },
319 348
  methods: {
349
    changeLocation(msg) {
350
      var obj = JSON.parse(msg.body)
351
      this.layer.normalLayer.eachLayer((e) => {
352
        console.log(e)
353
        if (e.options.id == obj.deviceId) {
354
          console.log(obj.latitude, obj.longitude)
355
          e.setLatLng([obj.latitude, obj.longitude])
356
        }
357
      })
358
    },
320 359
    initMap() {
321
      if (this.map != null && this.map != "") {
322
        this.map.remove();
360
      if (this.map != null && this.map != '') {
361
        this.map.remove()
323 362
      }
324
      this.map = new Ai.Map("div1", {
363
      this.map = new Ai.Map('div1', {
325 364
        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");
365
        center: [39.915599, 122.406568]
366
      })
367
      var maplayer
368
      maplayer = Ai.TileLayer('http://192.168.74.189:9999/tdtvector')
330 369
      var la = Ai.WMTSLayer(
331
        "http://192.168.74.216:5071/gisserver/dzht/dzht/wmts",
370
        'http://192.168.74.216:5071/gisserver/dzht/dzht/wmts',
332 371
        { opacity: 0.5 }
333
      );
334
      this.map.addLayer(maplayer);
335
      this.map.addLayer(la);
372
      )
373
      this.map.addLayer(maplayer)
374
      this.map.addLayer(la)
336 375
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();
346
    },
347
    pointsSet() {
348
      window.Vue = this;
349
      var arr = [];
350
      this.pointsLayer = new Ai.FeatureGroup();
351
      var icon = (icon = Ai.IconPulse({ iconSize: [13, 13] }));
352
      forEach(this.dataList, (value) => {
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
          });
365
        } else {
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
          });
376
        }
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
            // 设置弹出框弹出位置
398
            .setLatLng([value.Longitude, value.latitude])
399
            // 设置弹出框弹出内容
400
            .setContent(content)
401
            .openOn(this.map);
402
        });
403
        this.pointsLayer.addLayer(point1);
404
        arr.push(point1);
405
        // this.pointsarr.push(point1);
406
      });
407
      this.map.addLayer(this.pointsLayer);
408
      this.map.fitBoundsForLayers(arr);
376
      Ai.Scale({ position: 'bottomright' }).addTo(this.map)
377
      Ai.Zoom({ type: 'small' }).addTo(this.map)
378
      // this.polyline()
379
      this.polygon()
380
      this.loadEquipment()
381
      this.loadPerson()
409 382
    },
410 383
    polyline() {
411
      var polylineLayer = new Ai.FeatureGroup();
384
      var polylineLayer = new Ai.FeatureGroup()
412 385
      // 线绘制
413
      var lineWktStr = "LINESTRING ( " + this.polylinearr + ")";
386
      var lineWktStr = 'LINESTRING ( ' + this.polylinearr + ')'
414 387
      var polyline = new Ai.Polyline(lineWktStr, {
415
        color: "green",
416
        opacity: 1.0,
417
      });
388
        color: 'green',
389
        opacity: 1.0
390
      })
418 391
      // this.polylinearr.arr(polyline);
419
      polylineLayer.addLayer(polyline);
420
      this.map.addLayer(polylineLayer);
392
      polylineLayer.addLayer(polyline)
393
      this.map.addLayer(polylineLayer)
421 394
    },
422
    polygon() {
395
    polygon() { // 加载地图围栏
423 396
      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
          }
397
      this.$test
398
        .post(services.mapTag.GET_ALL_MAP_TAG, params)
399
        .then((res) => {
400
          // 请求成功处理...
401
          res.data.dataList.forEach((e) => {
402
            if (e.MAP_TAG_TYPE === '1') { // 电子围栏
403
              var polygon = Ai.Polygon(e.MAP_TAG_SHAPE, {
404
                color: '#A74B5C',
405
                opacity: 1.0,
406
                weight: 0
407
              })
408
              this.layer.dzwlLayer.addLayer(polygon)
409
              // this.fitBounds.push(polygon)
410
            } else if (e.MAP_TAG_TYPE === '2') { // 作业区域
411
              var polygon = Ai.Polygon(e.MAP_TAG_SHAPE, {
412
                color: '#438D65',
413
                opacity: 1.0,
414
                weight: 0
415
              })
416
              this.layer.zyqyLayer.addLayer(polygon)
417
              // this.fitBounds.push(polygon)
418
            }
419
          })
420
          this.map.addLayer(this.layer.dzwlLayer)
421
          this.map.addLayer(this.layer.zyqyLayer)
422
          // console.log(this.fitBounds)
423
          // this.map.fitBoundsForLayers(this.fitBounds)
424
        })
425
        .catch((res) => {
426
          // 请求失败处理...
436 427
        })
437
      }).catch(res => {
438
        // 请求失败处理...
439
      })
440
      var polygonLayer = new Ai.FeatureGroup();
441
      // 面绘制
442
      var coverWktStr = "POLYGON ((" + this.polygonarr + "))";
443
      var polygon = Ai.Polygon(coverWktStr, {
444
        color: "red",
445
        opacity: 1.0,
446
        weight: 0,
447
      });
448
      // this.polygonarr.arr(polygon);
449
      polygonLayer.addLayer(polygon);
450
      this.map.addLayer(polygonLayer);
451 428
    },
452 429
    showSlip() {
453
      this.visible = true;
430
      this.visible = true
454 431
    },
455
    showPopup(number) {
456
      if (this.popup != null && this.popup != "") {
457
        this.popup.closePopup();
458
        this.popup.remove();
459
      }
460
      var data = find(this.dataList, (o) => {
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;">' +
474
          '<button class="point-out" onClick="window.Vue.modal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
475
          '<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
476
          "</div></div></div>";
477
        this.popup = Ai.Popup({
478
          minWidth: 300,
479
          offset: [0, -10],
480
          autoClose: false,
432
    loadEquipment() { // 加载地图设备
433
      var params = new FormData()
434
      this.$test
435
        .post(services.equipment.GET_ALL_EQUIPMENT, params)
436
        .then((res) => {
437
          // 请求成功处理...
438
          console.log(res.data)
439
          res.data.dataList.forEach((e) => {
440
            if (e.FACILITY_TYPE === '001') { // 船舶
441
              this.layer.chuanboLayer.addLayer(Ai.Point([e.LATITUDE, e.LONGITUDE], {
442
                icon: Ai.Icon({
443
                  // 设置图标URL路径
444
                  iconUrl: '/static/images/船舶.png',
445
                  // 设置图标大小
446
                  iconSize: [20, 20],
447
                  // 设置点对象和图标的相对偏移量
448
                  iconAnchor: [0, 0]
449
                })
450
              }))
451
            } else if (e.FACILITY_TYPE === '002') { // 风机
452
              this.layer.fenjiLayer.addLayer(Ai.Point([e.LATITUDE, e.LONGITUDE], {
453
                icon: Ai.Icon({
454
                  // 设置图标URL路径
455
                  iconUrl: '/static/images/风机.png',
456
                  // 设置图标大小
457
                  iconSize: [20, 20],
458
                  // 设置点对象和图标的相对偏移量
459
                  iconAnchor: [0, 0]
460
                })
461
              }))
462
            } else if (e.FACILITY_TYPE === '003') { // 升压站
463
              this.layer.shengyazhanLayer.addLayer(Ai.Point([e.LATITUDE, e.LONGITUDE], {
464
                icon: Ai.Icon({
465
                  // 设置图标URL路径
466
                  iconUrl: '/static/images/升压站画面.png',
467
                  // 设置图标大小
468
                  iconSize: [20, 20],
469
                  // 设置点对象和图标的相对偏移量
470
                  iconAnchor: [0, 0]
471
                })
472
              }))
473
            }
474
          })
475
          this.map.addLayer(this.layer.chuanboLayer)
476
          this.map.addLayer(this.layer.fenjiLayer)
477
          this.map.addLayer(this.layer.shengyazhanLayer)
478
        })
479
        .catch((res) => {
480
          // 请求失败处理...
481 481
        })
482
          // 设置弹出框弹出位置
483
          .setLatLng({ lat: data.Longitude, lng: data.latitude })
484
          // 设置弹出框弹出内容
485
          .setContent(content)
486
          .openOn(this.map);
487
      }
488
    },
489
    loadFenji() {
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);
502 482
    },
503
    loadchuanbo() {
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);
483
    loadPerson() { // 加载地图人员
484
      var params = new FormData()
485
      this.$test
486
        .post(services.organization.PERSON_LOCATION, params)
487
        .then((res) => {
488
          console.log(res.data)
489
          var layer
490
          res.data.dataList.forEach((e) => {
491
            var icon, tips
492
            var callHelp = ''
493
            if (e.LOCATION_STATUS === '0') {
494
              icon = '/static/images/normalworker.png'
495
              layer = this.layer.normalLayer
496
              tips = '<div class="normal">正常</div>'
497
            } else if (e.LOCATION_STATUS === '1') {
498
              icon = '/static/images/offlineworker.png'
499
              layer = this.layer.offLineLayer
500
              tips = '<div class="offline">离线</div>'
501
            } else if (e.LOCATION_STATUS === '2') {
502
              icon = '/static/images/outlineworker.png'
503
              layer = this.layer.outLineLayer
504
              tips = '<div class="outline">违规</div>'
505
            } else if (e.LOCATION_STATUS === '3' || e.LOCATION_STATUS === '4') {
506
              icon = '/static/images/sosworker.png'
507
              layer = this.layer.sosLayer
508
              tips = '<div class="sos">SOS</div>'
509
              callHelp = '<div style="display:flex;">' +
510
                  '<button class="point-out" onClick="window.Vue.rescueModal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
511
                  '<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
512
                  '</div>'
513
            }
514
            var point = Ai.Point([e.LATITUDE, e.LONGITUDE], {
515
              icon: Ai.Icon({
516
                // 设置图标URL路径
517
                iconUrl: icon,
518
                // 设置图标大小
519
                iconSize: [20, 20],
520
                // 设置点对象和图标的相对偏移量
521
                iconAnchor: [0, 0]
522
              }),
523
              id: e.DEVICE_NO
524
            })
525
            point.on('click', (pointE) => {
526
              var content =
527
                  '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>' + e.PARTY_NAME + '</div>' + tips + '</div><div class="middle"><div class="row">' +
528
                  '<div>终端编号</div>' +
529
                  '<div>' + e.DEVICE_NO + '</div>' +
530
                  '</div>' +
531
                  '<div class="row">' +
532
                  '<div>经度</div>' +
533
                  '<div>' + e.LONGITUDE + '</div>' +
534
                  '</div>' +
535
                  '<div class="row">' +
536
                  '<div>纬度</div>' +
537
                  '<div>' + e.LATITUDE + '</div>' +
538
                  '</div>' +
539
                  '<div class="row">' +
540
                  '<div>最新定位时间</div>' +
541
                  '<div>' + e.LOCATION_DATE + '</div>' +
542
                  '</div></div></div>' + callHelp +
543
                  '</div></div>'
544
              Ai.Popup({
545
                minWidth: 300,
546
                offset: [0, -10],
547
                autoClose: true
548
              })
549
                // 设置弹出框弹出位置
550
                .setLatLng(point.getLatLng())
551
                // 设置弹出框弹出内容
552
                .setContent(content)
553
                .openOn(this.map)
554
            })
555
            layer.addLayer(point)
556
          })
557
          this.map.addLayer(this.layer.sosLayer)
558
          this.map.addLayer(this.layer.outLineLayer)
559
          this.map.addLayer(this.layer.offLineLayer)
560
          this.map.addLayer(this.layer.normalLayer)
561
          this.map.fitBoundsForLayers(this.layer.normalLayer)
562
        })
563
        .catch((res) => {
564
          // 请求失败处理...
565
        })
516 566
    },
517
    loadshengyazhan() {
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);
567
    showOrHide(layer, type) {
568
      if (this.map.hasLayer(layer)) {
569
        this.map.removeLayer(layer)
570
        this.mapShow[type] = false
571
      } else {
572
        this.map.addLayer(layer)
573
        this.mapShow[type] = true
574
      }
530 575
    },
531 576
    changeTrackTime(index) {
532
      this.trackQueryCondition.currentIndex = index;
577
      this.trackQueryCondition.currentIndex = index
578
    },
579
    initTrackMap() {
580
      if (this.trackMap != null && this.trackMap != '') {
581
        this.trackMap.remove()
582
      }
583
      this.trackMap = new Ai.Map('track-map', {
584
        ak: this.$store.getters.getGisToken,
585
        center: [39.915599, 122.406568]
586
      })
587
      var maplayer = null
588
      maplayer = Ai.TileLayer('http://192.168.74.189:9999/tdtvector')
589
      var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht/dzht/wmts', {opacity: 0.5})
590
      this.trackMap.addLayer(maplayer)
591
      this.trackMap.addLayer(la)
592
593
      Ai.Scale({position: 'bottomright'}).addTo(this.trackMap)
594
      Ai.Zoom({type: 'small'}).addTo(this.trackMap)
533 595
    },
534 596
    onChangeDate() {},
535 597
    toExport() {},
536 598
    close(item) {
537 599
      this.$Confirm.confirm({
538
        title: "确认要关闭张三落水报警吗?",
539
        content: "关闭后将不再进行报警显示",
600
        title: '确认要关闭张三落水报警吗?',
601
        content: '关闭后将不再进行报警显示',
540 602
        ok: () => {
541
          console.log("点击了确定");
603
          console.log('点击了确定')
542 604
        },
543 605
        cancel: () => {
544
          console.log("点击了取消");
545
        },
546
      });
606
          console.log('点击了取消')
607
        }
608
      })
547 609
    },
548 610
    cancel() {
549
      this.rescueModal = false;
550
    },
551
  },
552
};
611
      this.rescueModal = false
612
    }
613
  }
614
}
553 615
</script>

+ 313 - 169
ebc-middle-platform/src/modules/system-management/map-mark.vue

@ -6,20 +6,37 @@
6 6
          <div class="label-content">
7 7
            <div class="label">标记名称:</div>
8 8
            <div class="input-rule">
9
              <t-input v-model="queryCondition.userName" placeholder="请输入..."></t-input>
9
              <t-input
10
                v-model="queryCondition.userName"
11
                placeholder="请输入..."
12
              ></t-input>
10 13
            </div>
11 14
          </div>
12 15
          <div class="btns">
13
            <t-button color="secondary" class="reset-btn" @click="onReset">重置</t-button>
14
            <t-button color="success" icon="search-outline" @click="onSearch">查询</t-button>
15
            <t-button color="secondary" icon="upload-outline" @click="toExport">导出至Excel</t-button>
16
            <t-button color="secondary" class="reset-btn" @click="onReset"
17
            >重置</t-button
18
            >
19
            <t-button color="success" icon="search-outline" @click="onSearch"
20
            >查询</t-button
21
            >
22
            <t-button color="secondary" icon="upload-outline" @click="toExport"
23
            >导出至Excel</t-button
24
            >
16 25
          </div>
17 26
        </div>
18 27
        <div class="btns">
19
          <t-button color="success" icon="plus-outline" @click="markModal(1)">考勤区域</t-button>
20
          <t-button color="success" icon="plus-outline" @click="markModal(2)">作业区域</t-button>
21
          <t-button color="success" icon="plus-outline" @click="markModal(3)">电子围栏</t-button>
22
          <t-button color="success" icon="plus-outline" @click="markModal(4)">定点</t-button>
28
          <t-button color="success" icon="plus-outline" @click="markModal(1)"
29
          >考勤区域</t-button
30
          >
31
          <t-button color="success" icon="plus-outline" @click="markModal(2)"
32
          >作业区域</t-button
33
          >
34
          <t-button color="success" icon="plus-outline" @click="markModal(3)"
35
          >电子围栏</t-button
36
          >
37
          <t-button color="success" icon="plus-outline" @click="markModal(4)"
38
          >定点</t-button
39
          >
23 40
        </div>
24 41
      </div>
25 42
    </div>
@ -28,86 +45,140 @@
28 45
        <t-table-column prop="MAP_TAG_NAME" label="标记名称"></t-table-column>
29 46
        <t-table-column label="类型">
30 47
          <template slot-scope="scope">
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>
48
            <div v-if="scope.row.MAP_TAG_TYPE == 1">考勤区域</div>
49
            <div v-if="scope.row.MAP_TAG_TYPE == 2">作业区域</div>
50
            <div v-if="scope.row.MAP_TAG_TYPE == 3">电子围栏</div>
51
            <div v-if="scope.row.MAP_TAG_TYPE == 4">定点</div>
35 52
          </template>
36 53
        </t-table-column>
37
        <t-table-column :formatter="timestampToTime" prop="CREATE_DATE" label="创建时间"></t-table-column>
38 54
        <t-table-column
39
          fixed="right"
40
          label="操作"
41
          width="120"
42
        >
55
          :formatter="timestampToTime"
56
          prop="CREATE_DATE"
57
          label="创建时间"
58
        ></t-table-column>
59
        <t-table-column fixed="right" label="操作" width="120">
43 60
          <template slot-scope="scope">
44
            <a href="javascript:void(0)" size="sm" @click="handleClick(scope.row)">编辑</a>
61
            <a
62
              href="javascript:void(0)"
63
              size="sm"
64
              @click="handleClick(scope.row)"
65
            >编辑</a
66
            >
45 67
            <span class="mod-line">|</span>
46
            <a href="javascript:void(0)" size="sm" @click="remove(scope.row)">删除</a>
68
            <a href="javascript:void(0)" size="sm" @click="remove(scope.row)"
69
            >删除</a
70
            >
47 71
          </template>
48 72
        </t-table-column>
49 73
      </t-table>
50
      <t-pager :total="table.pager.total" :current.sync="table.pager.currentPage"
51
               :page-size.sync="table.pager.size"
52
               :sizer-range="[20,50,100]"
53
               class="px-24 pt-16 float-right"
54
               show-elevator show-sizer
55
               @on-size-change="onSizeChange"
56
               @on-change="onPagerChange">
74
      <t-pager
75
        :total="table.pager.total"
76
        :current.sync="table.pager.currentPage"
77
        :page-size.sync="table.pager.size"
78
        :sizer-range="[20, 50, 100]"
79
        class="px-24 pt-16 float-right"
80
        show-elevator
81
        show-sizer
82
        @on-size-change="onSizeChange"
83
        @on-change="onPagerChange"
84
      >
57 85
      </t-pager>
58 86
    </div>
59
    <t-modal :visibled.sync="addMark" :ok="submitMark" :cancel="cancel" class="modal" title="地图标记" ok-text="保存" width="80%" >
87
    <t-modal
88
      :visibled.sync="addMark"
89
      :ok="submitMark"
90
      :cancel="cancel"
91
      class="modal"
92
      title="地图标记"
93
      ok-text="保存"
94
      width="80%"
95
    >
60 96
      <div class="top">
61 97
        <div>
62 98
          <div class="label">标记类型:</div>
63 99
          <div class="input-rule">
64 100
            <t-select v-model="markType" width="200" placeholder="请输入...">
65
              <t-option v-for="item in markTypes" :key="item.id" :value="item.id">{{ item.type }}</t-option>
101
              <t-option
102
                v-for="item in markTypes"
103
                :key="item.id"
104
                :value="item.id"
105
              >{{ item.type }}</t-option
106
              >
66 107
            </t-select>
67 108
          </div>
68 109
        </div>
69 110
        <div>
70 111
          <div class="label">标记名称:</div>
71 112
          <div class="input-rule">
72
            <t-input v-model="markName" placeholder="请输入..." style="width: 200px"></t-input>
113
            <t-input
114
              v-model="markName"
115
              placeholder="请输入..."
116
              style="width: 200px"
117
            ></t-input>
73 118
          </div>
74 119
        </div>
120
        <div v-show="markType == 4">
121
          <div class="label">停留时长:</div>
122
          <div class="input-rule">
123
            <t-input
124
              v-model="residenceTimeLength"
125
              placeholder="请输入..."
126
              style="width: 100px"
127
            ></t-input>
128
          </div>
129
          <div class="label">min</div>
130
        </div>
75 131
      </div>
76 132
      <div class="content">
77 133
        <div class="left">
78 134
          <div class="header">
79 135
            <div>坐标列表</div>
80 136
            <div class="import-down">
81
              <a href="javascript:void(0)" size="sm" @click="handleFile1()">导入</a>
82
              <input id="file" type="file"
83
                     accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
84
                     style="display:none" @change="handleFile($event)" >
137
              <a href="javascript:void(0)" size="sm" @click="handleFile1()"
138
              >导入</a
139
              >
140
              <input
141
                id="file"
142
                type="file"
143
                accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
144
                style="display: none"
145
                @change="handleFile($event)"
146
              />
85 147
              <span class="mod-line">|</span>
86
              <a href="javascript:void(0)" size="sm" @click="downloadTemplate()">下载模板</a>
148
              <a href="javascript:void(0)" size="sm" @click="downloadTemplate()"
149
              >下载模板</a
150
              >
87 151
            </div>
88 152
          </div>
89 153
          <div>
90 154
            <t-table :data="modalData" size="sm" height="500">
91
              <t-table-column align="center" type="index" label="坐标名称"></t-table-column>
92
              <t-table-column align="center" prop="lng" label="经度"></t-table-column>
93
              <t-table-column align="center" prop="lat" label="纬度"></t-table-column>
155
              <t-table-column
156
                align="center"
157
                type="index"
158
                label="坐标名称"
159
              ></t-table-column>
160
              <t-table-column
161
                align="center"
162
                prop="lng"
163
                label="经度"
164
              ></t-table-column>
165
              <t-table-column
166
                align="center"
167
                prop="lat"
168
                label="纬度"
169
              ></t-table-column>
94 170
            </t-table>
95 171
          </div>
96 172
          <div class="explain">
97 173
            <div class="title">说明</div>
98
            <div>
99
              1、可在地图中点击绘制对应区域
100
            </div>
174
            <div>1、可在地图中点击绘制对应区域</div>
101 175
            <div>
102 176
              2、可编辑坐标列表中的经纬度值调整对应点坐标,对应点在地图中处于选中态
103 177
            </div>
104
            <div>
105
              3、导入将清空已绘制信息
106
            </div>
178
            <div>3、导入将清空已绘制信息</div>
107 179
          </div>
108 180
        </div>
109
        <div id="modalMap" class="right">
110
        </div>
181
        <div id="modalMap" class="right"></div>
111 182
      </div>
112 183
    </t-modal>
113 184
  </div>
@ -119,8 +190,7 @@ export default {
119 190
  data() {
120 191
    return {
121 192
      table: {
122
        data: [
123
        ],
193
        data: [],
124 194
        pager: {
125 195
          currentPage: 1,
126 196
          size: 5,
@ -135,6 +205,7 @@ export default {
135 205
      addMark: false,
136 206
      update: false,
137 207
      markName: '',
208
      residenceTimeLength: '',
138 209
      markType: 1,
139 210
      markTypes: [
140 211
        {
@ -164,26 +235,28 @@ export default {
164 235
  },
165 236
  mounted() {
166 237
    // 请求成功处理...
167
    let ak = this.$store.getters.getGisToken
168 238
    this.map = new Ai.Map('modalMap', {
169
      ak: ak,
239
      ak: this.$store.getters.getGisToken,
170 240
      center: [39.915599, 116.406568],
171 241
      zoom: 5
172 242
    })
173 243
    var maplayer = null
174 244
    maplayer = Ai.TileLayer('http://192.168.74.189:9999/tdtvector')
175 245
    this.map.addLayer(maplayer)
176
    var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht/dzht/wmts', {opacity: 0.5})
246
    var la = Ai.WMTSLayer(
247
      'http://192.168.74.216:5071/gisserver/dzht/dzht/wmts',
248
      { opacity: 0.5 }
249
    )
177 250
    this.map.addLayer(la)
178 251
    var options = {
179
      guideLayers: []// 导向(吸附)图层对象,当距离相隔很近的时候会与导向对象重合
252
      guideLayers: [] // 导向(吸附)图层对象,当距离相隔很近的时候会与导向对象重合
180 253
    }
181
    this.polygonDrawer = Ai.DrawPolygon(this.map, options)// 初始化多边形绘制工具
182
    this.polygonDrawer.enable()// 激活多边形绘制工具
254
    this.polygonDrawer = Ai.DrawPolygon(this.map, options) // 初始化多边形绘制工具
255
    this.polygonDrawer.enable() // 激活多边形绘制工具
183 256
    this.map.on(AiDrawEvent.CREATED, (e) => {
184 257
      // debugger
185 258
      console.log(1)
186
      this.layer = this.polygonDrawer.polygon(e)// 获取多边形信息
259
      this.layer = this.polygonDrawer.polygon(e) // 获取多边形信息
187 260
      // console.log(this.polygonDrawer.getPoints())
188 261
      this.modalData = this.layer._latlngs[0]
189 262
      this.polygonDrawer.editing(this.layer)
@ -194,20 +267,25 @@ export default {
194 267
  methods: {
195 268
    getList(pageNum, pageSize, MAP_TAG_NAME) {
196 269
      var params = new FormData()
197
      params.append('data', JSON.stringify({
198
        pageNum: pageNum,
199
        pageSize: pageSize,
200
        mapTagName: MAP_TAG_NAME
201
      }))
202
      this.$test.post(services.mapTag.GET_MAP_TAG, params
203
      ).then(res => {
204
        // 请求成功处理...
205
        this.table.data = res.data.dataList
206
        this.table.pager.total = res.data.dataNum
207
        this.table.pager.currentPage = pageNum
208
      }).catch(res => {
209
        // 请求失败处理...
210
      })
270
      params.append(
271
        'data',
272
        JSON.stringify({
273
          pageNum: pageNum,
274
          pageSize: pageSize,
275
          mapTagName: MAP_TAG_NAME
276
        })
277
      )
278
      this.$test
279
        .post(services.mapTag.GET_MAP_TAG, params)
280
        .then((res) => {
281
          // 请求成功处理...
282
          this.table.data = res.data.dataList
283
          this.table.pager.total = res.data.dataNum
284
          this.table.pager.currentPage = pageNum
285
        })
286
        .catch((res) => {
287
          // 请求失败处理...
288
        })
211 289
    },
212 290
    onChange(value) {
213 291
      console.log('date change:' + value)
@ -222,26 +300,33 @@ export default {
222 300
    toExport() {
223 301
      var params = new FormData()
224 302
      var name = this.queryCondition.userName
225
      params.append('data', JSON.stringify({
226
        params: {
227
          MAP_TAG_NAME: name
228
        }
229
      }))
303
      params.append(
304
        'data',
305
        JSON.stringify({
306
          params: {
307
            MAP_TAG_NAME: name
308
          }
309
        })
310
      )
230 311
      // window.open('http://localhost:8088/ipu/ExportToExcel/exportMapTagInfoToExcel?data=' + params)
231 312
      //
232
      this.$test.post(services.excel.EXPROT_MAP_TAG, params
233
      ).then(res => {
234
        // 请求成功处理...
235
        // debugger
236
        console.log(res)
237
        this.downloadDoc(res.data)
238
      }).catch(res => {
239
        // 请求失败处理...
240
      })
313
      this.$test
314
        .post(services.excel.EXPROT_MAP_TAG, params)
315
        .then((res) => {
316
          // 请求成功处理...
317
          // debugger
318
          console.log(res)
319
          this.downloadDoc(res.data)
320
        })
321
        .catch((res) => {
322
          // 请求失败处理...
323
        })
241 324
    },
242 325
    downloadDoc(response) {
243 326
      // debugger
244
      var blob = new Blob([response], {type: 'application/vnd.ms-excel;charset=utf-8'})
327
      var blob = new Blob([response], {
328
        type: 'application/vnd.ms-excel;charset=utf-8'
329
      })
245 330
      var downloadElement = document.createElement('a')
246 331
      var href = window.URL.createObjectURL(blob) // 创建下载的链接
247 332
      downloadElement.href = href
@ -257,12 +342,17 @@ export default {
257 342
      this.update = false
258 343
      this.updateId = null
259 344
      this.markName = ''
345
      this.residenceTimeLength = ''
346
      this.modalData = []
260 347
      this.polygonDrawer.enable()
261 348
    },
262
    timestampToTime (cjsj) {
349
    timestampToTime(cjsj) {
263 350
      var date = new Date(cjsj.CREATE_DATE) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
264 351
      var Y = date.getFullYear() + '-'
265
      var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
352
      var M =
353
        (date.getMonth() + 1 < 10
354
          ? '0' + (date.getMonth() + 1)
355
          : date.getMonth() + 1) + '-'
266 356
      var D = date.getDate() + ' '
267 357
      var h = date.getHours() + ':'
268 358
      var m = date.getMinutes() + ':'
@ -286,6 +376,14 @@ export default {
286 376
        return false
287 377
      }
288 378
379
      if (this.markType === 4 && !this.residenceTimeLength) {
380
        this.$Confirm.warning({
381
          title: '提示',
382
          content: '请输入停留时长'
383
        })
384
        return false
385
      }
386
289 387
      let arr = ''
290 388
      for (let i = 0; i < this.modalData.length; i++) {
291 389
        arr = arr + (this.modalData[i].lng + ' ' + this.modalData[i].lat + ',')
@ -293,45 +391,66 @@ export default {
293 391
      arr = arr + (this.modalData[0].lng + ' ' + this.modalData[0].lat)
294 392
      var params = new FormData()
295 393
      if (this.update) {
296
        params.append('data', JSON.stringify({
394
        params.append(
395
          'data',
396
          JSON.stringify({
297 397
            mapTagName: this.markName,
298 398
            mapTagType: this.markType,
399
            residenceTimeLength: this.residenceTimeLength,
299 400
            mapTagShape: arr,
300 401
            mapTagId: this.updateId
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
      })
402
          })
403
        )
404
        this.$test
405
          .post(services.mapTag.UPD_MAP_TAG, params)
406
          .then((res) => {
407
            // 请求成功处理...
408
            this.getList(
409
              this.table.pager.currentPage,
410
              this.table.pager.size,
411
              this.queryCondition.userName
412
            )
413
            this.polygonDrawer.disable()
414
            this.modalData = []
415
            this.markName = ''
416
            this.$Message.success('操作成功')
417
            this.map.removeLayer(this.layer)
418
            this.update = false
419
          })
420
          .catch((res) => {
421
            // 请求失败处理...
422
          })
315 423
      } else {
316
        params.append('data', JSON.stringify({
317
          mapTagName: this.markName,
318
          mapTagType: this.markType,
319
          mapTagShape: arr
320
        }))
321
      
322
      this.update = false
323
      this.$test.post(services.mapTag.ADD_MAP_TAG, params
324
      ).then(res => {
325
        // 请求成功处理...
326
        this.$Message.success('操作成功')
327
        this.map.removeLayer(this.layer)
328
        this.polygonDrawer.disable()
329
        this.modalData = []
330
        this.markName = ''
331
        this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.userName)
332
      }).catch(res => {
333
        // 请求失败处理...
334
      })
424
        params.append(
425
          'data',
426
          JSON.stringify({
427
            mapTagName: this.markName,
428
            mapTagType: this.markType,
429
            residenceTimeLength: this.residenceTimeLength,
430
            mapTagShape: arr
431
          })
432
        )
433
434
        this.update = false
435
        this.$test
436
          .post(services.mapTag.ADD_MAP_TAG, params)
437
          .then((res) => {
438
            // 请求成功处理...
439
            this.$Message.success('操作成功')
440
            this.map.removeLayer(this.layer)
441
            this.polygonDrawer.disable()
442
            this.modalData = []
443
            this.markName = ''
444
            this.residenceTimeLength = ''
445
            this.getList(
446
              this.table.pager.currentPage,
447
              this.table.pager.size,
448
              this.queryCondition.userName
449
            )
450
          })
451
          .catch((res) => {
452
            // 请求失败处理...
453
          })
335 454
      }
336 455
    },
337 456
    getTime() {
@ -360,46 +479,49 @@ export default {
360 479
    },
361 480
    handleClick(row) {
362 481
      var params = new FormData()
363
      params.append('data', JSON.stringify({
364
        mapTagId: row.MAP_TAG_ID
365
      }))
366
      this.$test.post(services.mapTag.GET_ONE_MAP_TAG, params
367
      ).then(res => {
368
        // 请求成功处理...
369
        this.modalData = []
370
        var coverWktStr_blue = res.data.resultData.MAP_TAG_SHAPE
371
        console.log(res.data.resultData.MAP_TAG_SHAPE)
372
        var coverLayer_blue = new Ai.Polygon(coverWktStr_blue)
373
        // this.map.addLayer(coverLayer_blue)
374
        // 面设为编辑状态
375
        coverLayer_blue.snapediting = new Ai.PolylineSnap(this.map, coverLayer_blue)
376
        coverLayer_blue.snapediting.enable()
377
        this.layer = coverLayer_blue
378
        this.map.addLayer(coverLayer_blue)
379
        this.polygonDrawer.editing(this.layer)
380
        this.modalData = coverLayer_blue._latlngs[0]
381
        this.polygonDrawer.disable()
382
      }).catch(res => {
383
        // 请求失败处理...
384
      })
482
      params.append(
483
        'data',
484
        JSON.stringify({
485
          mapTagId: row.MAP_TAG_ID
486
        })
487
      )
488
      this.$test
489
        .post(services.mapTag.GET_ONE_MAP_TAG, params)
490
        .then((res) => {
491
          // 请求成功处理...
492
          this.modalData = []
493
          var coverWktStr_blue = res.data.resultData.MAP_TAG_SHAPE
494
          console.log(res.data.resultData.MAP_TAG_SHAPE)
495
          var coverLayer_blue = new Ai.Polygon(coverWktStr_blue)
496
          // this.map.addLayer(coverLayer_blue)
497
          // 面设为编辑状态
498
          coverLayer_blue.snapediting = new Ai.PolylineSnap(
499
            this.map,
500
            coverLayer_blue
501
          )
502
          coverLayer_blue.snapediting.enable()
503
          this.layer = coverLayer_blue
504
          this.map.addLayer(coverLayer_blue)
505
          this.polygonDrawer.editing(this.layer)
506
          this.modalData = coverLayer_blue._latlngs[0]
507
          this.polygonDrawer.disable()
508
        })
509
        .catch((res) => {
510
          // 请求失败处理...
511
        })
385 512
      this.markName = row.MAP_TAG_NAME
386 513
      this.markType = parseInt(row.MAP_TAG_TYPE)
387 514
      this.updateId = row.MAP_TAG_ID
515
      this.residenceTimeLength = row.RESIDENCE_TIME_LENGTH
388 516
      this.addMark = true
389 517
      this.update = true
390 518
      this.polygonDrawer.enable()
391 519
    },
392 520
    downloadTemplate() {
393 521
      // 1. 准备js数组
394
      const arr = [
395
        ['序号', '经度', '纬度']
396
      ]
522
      const arr = [['序号', '经度', '纬度']]
397 523
      for (let i = 0; i < this.modalData.length; i++) {
398
        let g = [
399
          i + 1,
400
          this.modalData[i].lng + '',
401
          this.modalData[i].lat + ''
402
        ]
524
        let g = [i + 1, this.modalData[i].lng + '', this.modalData[i].lat + '']
403 525
        console.log(g)
404 526
        arr.push(g)
405 527
      }
@ -409,7 +531,7 @@ export default {
409 531
      // 先组装wookbook数据格式
410 532
      let workbook = {
411 533
        SheetNames: ['test'], // 总表名
412
        Sheets: {test: sheet} // test是表名
534
        Sheets: { test: sheet } // test是表名
413 535
      }
414 536
      // 下载表格
415 537
      XLSX.writeFile(workbook, '新增标记模板' + this.getTime() + '.xlsx')
@ -424,14 +546,16 @@ export default {
424 546
      var f = files[0]
425 547
      var reader = new FileReader()
426 548
      // debugger
427
      reader.onload = function(e) {
549
      reader.onload = function (e) {
428 550
        // debugger
429 551
        var data = new Uint8Array(e.target.result)
430
        var workbook = XLSX.read(data, {type: 'array'})
552
        var workbook = XLSX.read(data, { type: 'array' })
431 553
        /* DO SOMETHING WITH workbook HERE */
432 554
        // console.log(workbook)
433 555
        /* 其中workbook.SheetNames[0]是表名下对应的数据 sheet数据 */
434
        let arr = XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]])
556
        let arr = XLSX.utils.sheet_to_json(
557
          workbook.Sheets[workbook.SheetNames[0]]
558
        )
435 559
        that.modalData = []
436 560
        var coverWktStr_blue = 'POLYGON (( '
437 561
        for (let i = 0; i < arr.length; i++) {
@ -441,15 +565,26 @@ export default {
441 565
          })
442 566
          coverWktStr_blue += arr[i]['经度'] + ' ' + arr[i]['纬度'] + ','
443 567
        }
444
        that.map.setView([parseFloat(arr[0]['纬度']), parseFloat(arr[0]['经度'])], 5)// 地图定位
568
        that.map.setView(
569
          [parseFloat(arr[0]['纬度']), parseFloat(arr[0]['经度'])],
570
          5
571
        ) // 地图定位
445 572
        // that.map.center =  []
446 573
        // debugger
447
        coverWktStr_blue = coverWktStr_blue.substring(0, coverWktStr_blue.length - 1)
574
        coverWktStr_blue = coverWktStr_blue.substring(
575
          0,
576
          coverWktStr_blue.length - 1
577
        )
448 578
        coverWktStr_blue += '))'
449
        var coverLayer_blue = new Ai.Polygon(coverWktStr_blue, {color: 'red'})
579
        var coverLayer_blue = new Ai.Polygon(coverWktStr_blue, {
580
          color: 'red'
581
        })
450 582
        that.map.addLayer(coverLayer_blue)
451 583
        // 面设为编辑状态
452
        coverLayer_blue.snapediting = new Ai.PolylineSnap(that.map, coverLayer_blue)
584
        coverLayer_blue.snapediting = new Ai.PolylineSnap(
585
          that.map,
586
          coverLayer_blue
587
        )
453 588
        coverLayer_blue.snapediting.enable()
454 589
        that.layer = coverLayer_blue
455 590
        that.map.addLayer(coverLayer_blue)
@ -466,19 +601,28 @@ export default {
466 601
        content: '删除后不可恢复,确认删除吗?',
467 602
        ok: function () {
468 603
          var params = new FormData()
469
          params.append('data', JSON.stringify({
470
            mapTagId: row.MAP_TAG_ID
471
          }))
604
          params.append(
605
            'data',
606
            JSON.stringify({
607
              mapTagId: row.MAP_TAG_ID
608
            })
609
          )
472 610
          // debugger
473
          this.$test.post(services.mapTag.DEL_MAP_TAG, params
474
          ).then(res => {
475
            // 请求成功处理...
476
            // debugger
477
            this.$Message.success('操作成功')
478
            that.getList(that.table.pager.currentPage, that.table.pager.size, that.queryCondition.userName)
479
          }).catch(res => {
480
            // 请求失败处理...
481
          })
611
          this.$test
612
            .post(services.mapTag.DEL_MAP_TAG, params)
613
            .then((res) => {
614
              // 请求成功处理...
615
              // debugger
616
              this.$Message.success('操作成功')
617
              that.getList(
618
                that.table.pager.currentPage,
619
                that.table.pager.size,
620
                that.queryCondition.userName
621
              )
622
            })
623
            .catch((res) => {
624
              // 请求失败处理...
625
            })
482 626
        }
483 627
      }
484 628
      this.$Confirm.confirm(confirm)

+ 2 - 2
ebc-middle-platform/src/store.js

@ -78,7 +78,7 @@ const store = new Vuex.Store({
78 78
    setTitle(state, newTitle) {
79 79
      state.currentTitle = newTitle || ''
80 80
    },
81
    setGisToken(state, token){
81
    setGisToken(state, token) {
82 82
      state.gistoken = token
83 83
    }
84 84
  },
@ -106,7 +106,7 @@ const store = new Vuex.Store({
106 106
        return 'EN'
107 107
      }
108 108
    },
109
    getGisToken(state){
109
    getGisToken(state) {
110 110
      return state.gistoken
111 111
    }
112 112
  },

BIN
ebc-middle-platform/static/images/Alarm.png


BIN
ebc-middle-platform/static/images/normalworker.png


BIN
ebc-middle-platform/static/images/offlineworker.png


ebc-middle-platform/static/images/worker(1).png → ebc-middle-platform/static/images/outlineworker.png


ebc-middle-platform/static/images/worker.png → ebc-middle-platform/static/images/sosworker.png


BIN
ebc-middle-platform/static/images/升压站画面.png


BIN
ebc-middle-platform/static/images/船舶.png


BIN
ebc-middle-platform/static/images/风机.png