dangerMap.vue 35.5 KB
Newer Older
jianqian's avatar
jianqian committed
1
<template>
2
    <div class="gis" style="padding: 0px;">
jianqian's avatar
jianqian committed
3
        <div id="mapbox">
jianqian's avatar
jianqian committed
4
            <div style="position:absolute;left:-30px;top:10px">
jianqian's avatar
jianqian committed
5 6 7 8 9 10
                <button @click="Mutil.tianSlA()" class="map-botton">卫星地图</button>
                <button @click="Mutil.tianSlB()" class="map-botton">全景地图</button>
            </div>

            <div v-show="isShowVideo" v-drag
                 style="display: none;position:absolute;left:1000px;top:10px;z-index: 30;padding: 5px; background-color: rgba(2, 40, 90, 0.8);width: 400px;height: 255px;border-radius: 5px;border: 1px solid #000;">
jianqian's avatar
jianqian committed
11 12 13 14 15
                <!--<div style="width: 100%;height: 30px;">-->
                    <!--<span style="float: left;color: #fff;font-size: 1rem;">{{deviceVideo.deviceName}}</span>-->
                    <!--<span @click="closeVideo" style="float: right;margin-right: 10px;font-size: 1.5rem;color: #fff;"-->
                          <!--class="el-icon-close"></span>-->
                <!--</div>-->
jianqian's avatar
jianqian committed
16 17 18 19 20 21 22
                <div id="div_video"></div>
            </div>
        </div>
        <div style="">

            <div class="markBox">

jianqian's avatar
jianqian committed
23
                <div @click="mapma" class="markbox-div" ref="material" style="margin-top: 10px;">
jianqian's avatar
jianqian committed
24
                    <div class="markbox-click" ref="maimg" style="width: 30%;height: 100%;float: left;text-align: right;">
jianqian's avatar
jianqian committed
25
                        <img width="30px" src="@/assets/mark/tongxin.png" />
jianqian's avatar
jianqian committed
26 27 28 29 30 31 32 33
                    </div>
                    <div class="markbox-span" ref="zma" style="width: 70%;height: 100%;float: left;text-align: center;line-height: 10px;padding-top: 18px;">
                        <span>通信保障机构<p></p><span style="font-family: 'UnidreamLED';font-size: 1.5rem;">{{DataNum0}}</span></span>
                    </div>

                </div>
                <div @click="mapma1" class="markbox-div" ref="material1">
                    <div class="markbox-click" ref="maimg1" style="width: 30%;height: 100%;float: left;text-align: right;">
jianqian's avatar
jianqian committed
34
                        <img width="30px" src="@/assets/mark/wuzi.png" />
jianqian's avatar
jianqian committed
35 36 37 38 39 40 41
                    </div>
                    <div class="markbox-span" ref="zma1" style="width: 70%;height: 100%;float: left;text-align: center;line-height: 10px;padding-top: 18px;">
                        <span>救援物资<p></p><span style="font-family: 'UnidreamLED';font-size: 1.5rem;">{{DataNum1}}</span></span>
                    </div>
                </div>
                <div @click="mapma2" class="markbox-div" ref="material2">
                    <div class="markbox-click" ref="maimg2" style="width: 30%;height: 100%;float: left;text-align: right;">
jianqian's avatar
jianqian committed
42
                        <img width="30px" src="@/assets/mark/zhuanjia.png" />
jianqian's avatar
jianqian committed
43 44 45 46 47 48 49
                    </div>
                    <div class="markbox-span" ref="zma2" style="width: 70%;height: 100%;float: left;text-align: center;line-height: 10px;padding-top: 18px;">
                        <span>专家资源<p></p><span style="font-family: 'UnidreamLED';font-size: 1.5rem;">{{DataNum2}}</span></span>
                    </div>
                </div>
                <div @click="mapma3" class="markbox-div" ref="material3">
                    <div class="markbox-click" ref="maimg3" style="width: 30%;height: 100%;float: left;text-align: right;">
jianqian's avatar
jianqian committed
50
                        <img width="30px" src="@/assets/mark/jiuyuan.png" />
jianqian's avatar
jianqian committed
51 52 53 54 55 56 57
                    </div>
                    <div class="markbox-span" ref="zma3" style="width: 70%;height: 100%;float: left;text-align: center;line-height: 10px;padding-top: 18px;">
                        <span>救援队伍<p></p><span style="font-family: 'UnidreamLED';font-size: 1.5rem;">{{DataNum3}}</span></span>
                    </div>
                </div>
                <div @click="mapma4" class="markbox-div" ref="material4">
                    <div class="markbox-click" ref="maimg4" style="width: 30%;height: 100%;float: left;text-align: right;">
jianqian's avatar
jianqian committed
58
                        <img width="30px" src="@/assets/mark/binan.png" />
jianqian's avatar
jianqian committed
59 60 61 62 63 64 65
                    </div>
                    <div class="markbox-span" ref="zma4" style="width: 70%;height: 100%;float: left;text-align: center;line-height: 10px;padding-top: 18px;">
                        <span>避难场所<p></p><span style="font-family: 'UnidreamLED';font-size: 1.5rem;">{{DataNum4}}</span></span>
                    </div>
                </div>
                <div @click="mapma5" class="markbox-div" ref="material5">
                    <div class="markbox-click" ref="maimg5" style="width: 30%;height: 100%;float: left;text-align: right;">
jianqian's avatar
jianqian committed
66
                        <img width="30px" src="@/assets/mark/fanghu.png" />
jianqian's avatar
jianqian committed
67 68 69 70 71 72 73
                    </div>
                    <div class="markbox-span" ref="zma5" style="width: 70%;height: 100%;float: left;text-align: center;line-height: 10px;padding-top: 18px;">
                        <span>防护目标<p></p><span style="font-family: 'UnidreamLED';font-size: 1.5rem;">{{DataNum5}}</span></span>
                    </div>
                </div>
                <div @click="mapma6" class="markbox-div" ref="material6">
                    <div class="markbox-click" ref="maimg6" style="width: 30%;height: 100%;float: left;text-align: right;">
jianqian's avatar
jianqian committed
74
                        <img width="30px" src="@/assets/mark/yiliao.png" />
jianqian's avatar
jianqian committed
75 76 77 78 79 80 81
                    </div>
                    <div class="markbox-span" ref="zma6" style="width: 70%;height: 100%;float: left;text-align: center;line-height: 10px;padding-top: 18px;">
                        <span>医疗卫生单位<p></p><span style="font-family: 'UnidreamLED';font-size: 1.5rem;">{{DataNum6}}</span></span>
                    </div>
                </div>
            </div>
        </div>
jianqian's avatar
jianqian committed
82

jianqian's avatar
jianqian committed
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
    </div>
</template>

<script lang="ts">
    import {
        Component,
        Vue,
        Provide
    } from "vue-property-decorator";
    import METHOD from "@/utils/methods";
    import "@/utils/directive.js";
    import {
        Icon
    } from "element-ui";
    import "@/utils/VamapLoad.ts";
    import DrawTool from "@/components/drawTool.vue";
    import Search from "@/components/search.vue";
    import Mutil from "@/utils/mapUtil.js";
    import METHOD from "@/utils/methods";
    import QyMaptwo from './qyMaptwo.vue';
    import vueDrag from 'vue-dragging'
    import { Component, Vue, Provide, Prop, Watch } from "vue-property-decorator";
    Vue.use(vueDrag)
    @Component({
        components: {
            DrawTool,
            Search,
            QyMaptwo
        },
    })
    export default class GIS extends Vue {


        @Provide() Mutil: any;
        @Provide() mapLoadDone = false;
        @Provide() MAP: any;
        @Provide() isShowVideo: boolean = false;
        @Provide() player: any;
        @Provide() mapOption = {
            plugin: [{
                pName: "MapType",
                defaultType: 1,
            },
                {
                    pName: "ToolBar",
                },
            ],
            center: [115, 28],
            zoom: 10,
            events: {},
        };
        @Provide() searchData: any = {
            type: "0",
        };
        /* 地图 */
        @Provide() markers: any = [];
        @Provide() markers0: any = [];
        @Provide() markers1: any = [];
        @Provide() markers2: any = [];
        @Provide() markers3: any = [];
        @Provide() markers4: any = [];
        @Provide() markers5: any = [];
        @Provide() markers6: any = [];
        @Provide() mapData: any = [];
        @Provide() windowsArr: any = [];
        @Provide() windowsArr0: any = [];
        @Provide() windowsArr1: any = [];
        @Provide() windowsArr2: any = [];
        @Provide() windowsArr3: any = [];
        @Provide() windowsArr4: any = [];
        @Provide() windowsArr5: any = [];
        @Provide() windowsArr6: any = [];
        @Provide() DataNum0: any = 0;
        @Provide() DataNum1: any = 0;
        @Provide() DataNum2: any = 0;
        @Provide() DataNum3: any = 0;
        @Provide() DataNum4: any = 0;
        @Provide() DataNum5: any = 0;
        @Provide() DataNum6: any = 0;
        @Provide() currentWindow: any = "";
        // @Provide() searchOption: any = {
        //     city: "石家庄",
        //     citylimit: true,
        // };
        @Provide() PAGE: any = {
            page: 1,
            size: 1000
        };
        @Provide() materialData: any = [];
        @Provide() lastVideoPlayId: any = "";
        @Provide() markersB: any = [];
        @Provide() dialogVisible1: Boolean = false;
        @Provide() dialogVisible2: Boolean = false;
        @Provide() toolobj: any;
        @Provide() mouseTool: any; //测量工具
        @Provide() toolVisble: boolean = false;
        @Provide() tjNumberObj: any = {};
        @Provide() deviceVideo: any = {};
        @Provide() qiyeVisble: boolean = true;
        @Provide() wxyVisble: boolean = true;
        @Provide() shipinVisble: boolean = true;
        @Provide() maVisble: boolean = true;
        @Provide() ma1Visble: boolean = true;
        @Provide() ma2Visble: boolean = true;
        @Provide() ma3Visble: boolean = true;
        @Provide() ma4Visble: boolean = true;
        @Provide() ma5Visble: boolean = true;
        @Provide() ma6Visble: boolean = true;
        @Provide() weihaiVisble: boolean = true;
        @Provide() yinhuanVisble: boolean = true;
        @Provide() treecheckedObj: any = {};
        @Provide() goods: any = {};
        @Provide() trouble: any = {};

        getMaterial(){
            let that = this;
            var param = Object.assign({}, that.PAGE, );
            METHOD.axiosPost(
                that,
                `/material/materialInfoList`,
                param,
                function (res: any) {
                    that.materialData = res.data;
                    if (res.code == 0&& res.data.pageData.length > 0) {
                        that.matermapData = res.data.pageData;
                        var matermapData0 =[];
                        var matermapData1 =[];
                        var matermapData2 =[];
                        var matermapData3 =[];
                        var matermapData4 =[];
                        var matermapData5 =[];
                        var matermapData6 =[];

                        let latSum = 0;
                        let lngSum = 0;
                        that.matermapData.forEach((ele: any, index: any) => {
                            if(ele.materialType=="救援物资"){
                                that.addMaterialMark1(ele, index);
                                matermapData1.push(ele)
                            }else if(ele.materialType=="专家资源"){
                                that.addMaterialMark2(ele, index);
                                matermapData2.push(ele)
                            }else if(ele.materialType=="救援队伍"){
                                that.addMaterialMark3(ele, index);
                                matermapData3.push(ele)
                            }else if(ele.materialType=="避难场所"){
                                that.addMaterialMark4(ele, index);
                                matermapData4.push(ele)
                            }else if(ele.materialType=="防护目标"){
                                that.addMaterialMark5(ele, index);
                                matermapData5.push(ele)
                            }else if(ele.materialType=="医疗卫生单位"){
                                that.addMaterialMark6(ele, index);
                                matermapData6.push(ele)
                            }else {
                                that.addMaterialMark(ele, index);
                                matermapData0.push(ele)
                            }
                            //that.addMark(ele,index);
                            lngSum += ele.longitude;
                            latSum += ele.latitude;
                        });
                        that.matermapData0 = matermapData0;
                        that.matermapData1 = matermapData1;
                        that.matermapData2 = matermapData2;
                        that.matermapData3 = matermapData3;
                        that.matermapData4 = matermapData4;
                        that.matermapData5 = matermapData5;
                        that.matermapData6 = matermapData6;
                        that.DataNum0 = matermapData0.length;
                        that.DataNum1 = matermapData1.length;
                        that.DataNum2 = matermapData2.length;
                        that.DataNum3 = matermapData3.length;
                        that.DataNum4 = matermapData4.length;
                        that.DataNum5 = matermapData5.length;
                        that.DataNum6 = matermapData6.length;
                        let center = [
                            lngSum / that.matermapData.length,
                            latSum / that.matermapData.length,
                        ];
                        that.Mutil.setViewF({
                            center: center
                        })
                    }
                }
            );
        }
        getMaterialWindow(id: string) {
            let that = this;
            (window as any).checkDetail = function (param: string) {
                that.$router.push({
                    path: "/EnDetail",
                    query: {
                        enterpriseId: param
                    }
                });
            };

            let obj = that.materialData.pageData[id-1],
                html =
                    `<div class="windowDg"><h3>应急资源详细信息</h3>` +
                    `<p><span>资源名称:</span>${obj.materialName}</p>` +
                    `<p><span>资源类型:</span>${obj.materialType}</p>` +
                    `<p><span>数量:</span>${obj.num}</p>` +
                    `<p><span>地址:</span>${obj.address}</p>` +
                    `<p><span>联系人:</span>${obj.contacts}</p>` +
                    `<p><span>联系方式:</span>${obj.phone}</p>` +
                    `</div>`;
            that.Mutil.addPopup(html, obj.id, obj.longitude, obj.latitude)

        }

        //关闭视频方法
        closeVideo() {
            if (this.lastVideoPlayId != "") {
                this.player.stop('http://27.128.189.137:18000/flv/hls/' + this.lastVideoPlayId + '.flv', 1);
            }
            this.isShowVideo = false;
        }
        addMaterialMark(obj: any, index: any) {
            let icon,
                that = this;
jianqian's avatar
jianqian committed
305
            icon = require("@/assets/mark/tongxin1.png");
jianqian's avatar
jianqian committed
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
            let option = {
                position: [Number(obj.longitude), Number(obj.latitude)],
                content: ` <img src="${icon}" width="25">`,
                label: {
                    content: obj.materialName,
                    offset: [28, -7]
                },
                offset: [-13, -2],
                events: {
                    click: (e: any) => {
                        that.windowsArr0.forEach((ele: any) => {
                            // console.log(ele,"ele")
                            ele.visible = false;
                        });
                        that.$nextTick(() => {
                            // console.log(ele,"ele")
                            that.currentWindow = that.windowsArr0[index];
                            that.currentWindow.visible = true;
                        });
                    },
                },
                visible: true,
            };
            that.Mutil.addMarkerToMap(
                'material',
                obj.materialName,
                icon,
                [obj.longitude, obj.latitude],
                0.4,
                index+1
            );
jianqian's avatar
jianqian committed
337
            this.Mutil.visibleMarks(false, "material");
jianqian's avatar
jianqian committed
338 339 340 341
        }
        addMaterialMark1(obj: any, index: any) {
            let icon,
                that = this;
jianqian's avatar
jianqian committed
342
            icon = require("@/assets/mark/wuzi1.png");
jianqian's avatar
jianqian committed
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
            let option = {
                position: [Number(obj.longitude), Number(obj.latitude)],
                content: ` <img src="${icon}" width="25">`,
                label: {
                    content: obj.materialName,
                    offset: [28, -7]
                },
                offset: [-13, -2],
                events: {
                    click: (e: any) => {
                        that.windowsArr1.forEach((ele: any) => {
                            // console.log(ele,"ele")
                            ele.visible = false;
                        });
                        that.$nextTick(() => {
                            // console.log(ele,"ele")
                            that.currentWindow = that.windowsArr1[index];
                            that.currentWindow.visible = true;
                        });
                    },
                },
                visible: true,
            };
            that.Mutil.addMarkerToMap(
                'material1',
                obj.materialName,
                icon,
                [obj.longitude, obj.latitude],
                0.4,
                index+1
            );
jianqian's avatar
jianqian committed
374
            this.Mutil.visibleMarks(false, "material1");
jianqian's avatar
jianqian committed
375 376 377 378
        }
        addMaterialMark2(obj: any, index: any) {
            let icon,
                that = this;
jianqian's avatar
jianqian committed
379
            icon = require("@/assets/mark/zhuanjia1.png");
jianqian's avatar
jianqian committed
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410
            let option = {
                position: [Number(obj.longitude), Number(obj.latitude)],
                content: ` <img src="${icon}" width="25">`,
                label: {
                    content: obj.materialName,
                    offset: [28, -7]
                },
                offset: [-13, -2],
                events: {
                    click: (e: any) => {
                        that.windowsArr2.forEach((ele: any) => {
                            // console.log(ele,"ele")
                            ele.visible = false;
                        });
                        that.$nextTick(() => {
                            // console.log(ele,"ele")
                            that.currentWindow = that.windowsArr2[index];
                            that.currentWindow.visible = true;
                        });
                    },
                },
                visible: true,
            };
            that.Mutil.addMarkerToMap(
                'material2',
                obj.materialName,
                icon,
                [obj.longitude, obj.latitude],
                0.4,
                index+1
            );
jianqian's avatar
jianqian committed
411
            this.Mutil.visibleMarks(false, "material2");
jianqian's avatar
jianqian committed
412 413 414 415
        }
        addMaterialMark3(obj: any, index: any) {
            let icon,
                that = this;
jianqian's avatar
jianqian committed
416
            icon = require("@/assets/mark/jiuyuan1.png");
jianqian's avatar
jianqian committed
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447
            let option = {
                position: [Number(obj.longitude), Number(obj.latitude)],
                content: ` <img src="${icon}" width="25">`,
                label: {
                    content: obj.materialName,
                    offset: [28, -7]
                },
                offset: [-13, -2],
                events: {
                    click: (e: any) => {
                        that.windowsArr3.forEach((ele: any) => {
                            // console.log(ele,"ele")
                            ele.visible = false;
                        });
                        that.$nextTick(() => {
                            // console.log(ele,"ele")
                            that.currentWindow = that.windowsArr3[index];
                            that.currentWindow.visible = true;
                        });
                    },
                },
                visible: true,
            };
            that.Mutil.addMarkerToMap(
                'material3',
                obj.materialName,
                icon,
                [obj.longitude, obj.latitude],
                0.4,
                index+1
            );
jianqian's avatar
jianqian committed
448
            this.Mutil.visibleMarks(false, "material3");
jianqian's avatar
jianqian committed
449 450 451 452
        }
        addMaterialMark4(obj: any, index: any) {
            let icon,
                that = this;
jianqian's avatar
jianqian committed
453
            icon = require("@/assets/mark/binan1.png");
jianqian's avatar
jianqian committed
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484
            let option = {
                position: [Number(obj.longitude), Number(obj.latitude)],
                content: ` <img src="${icon}" width="25">`,
                label: {
                    content: obj.materialName,
                    offset: [28, -7]
                },
                offset: [-13, -2],
                events: {
                    click: (e: any) => {
                        that.windowsArr4.forEach((ele: any) => {
                            // console.log(ele,"ele")
                            ele.visible = false;
                        });
                        that.$nextTick(() => {
                            // console.log(ele,"ele")
                            that.currentWindow = that.windowsArr4[index];
                            that.currentWindow.visible = true;
                        });
                    },
                },
                visible: true,
            };
            that.Mutil.addMarkerToMap(
                'material4',
                obj.materialName,
                icon,
                [obj.longitude, obj.latitude],
                0.4,
                index+1
            );
jianqian's avatar
jianqian committed
485
            this.Mutil.visibleMarks(false, "material4");
jianqian's avatar
jianqian committed
486 487 488 489
        }
        addMaterialMark5(obj: any, index: any) {
            let icon,
                that = this;
jianqian's avatar
jianqian committed
490
            icon = require("@/assets/mark/fanghu1.png");
jianqian's avatar
jianqian committed
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521
            let option = {
                position: [Number(obj.longitude), Number(obj.latitude)],
                content: ` <img src="${icon}" width="25">`,
                label: {
                    content: obj.materialName,
                    offset: [28, -7]
                },
                offset: [-13, -2],
                events: {
                    click: (e: any) => {
                        that.windowsArr5.forEach((ele: any) => {
                            // console.log(ele,"ele")
                            ele.visible = false;
                        });
                        that.$nextTick(() => {
                            // console.log(ele,"ele")
                            that.currentWindow = that.windowsArr5[index];
                            that.currentWindow.visible = true;
                        });
                    },
                },
                visible: true,
            };
            that.Mutil.addMarkerToMap(
                'material5',
                obj.materialName,
                icon,
                [obj.longitude, obj.latitude],
                0.4,
                index+1
            );
jianqian's avatar
jianqian committed
522
            this.Mutil.visibleMarks(false, "material5");
jianqian's avatar
jianqian committed
523 524 525 526
        }
        addMaterialMark6(obj: any, index: any) {
            let icon,
                that = this;
jianqian's avatar
jianqian committed
527
            icon = require("@/assets/mark/yiliao1.png");
jianqian's avatar
jianqian committed
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558
            let option = {
                position: [Number(obj.longitude), Number(obj.latitude)],
                content: ` <img src="${icon}" width="25">`,
                label: {
                    content: obj.materialName,
                    offset: [28, -7]
                },
                offset: [-13, -2],
                events: {
                    click: (e: any) => {
                        that.windowsArr6.forEach((ele: any) => {
                            // console.log(ele,"ele")
                            ele.visible = false;
                        });
                        that.$nextTick(() => {
                            // console.log(ele,"ele")
                            that.currentWindow = that.windowsArr6[index];
                            that.currentWindow.visible = true;
                        });
                    },
                },
                visible: true,
            };
            that.Mutil.addMarkerToMap(
                'material6',
                obj.materialName,
                icon,
                [obj.longitude, obj.latitude],
                0.4,
                index+1
            );
jianqian's avatar
jianqian committed
559
            this.Mutil.visibleMarks(false, "material6");
jianqian's avatar
jianqian committed
560 561 562 563
        }
        addMark(obj: any, index: any) {
            let icon,
                that = this;
zhangjianqian's avatar
zhangjianqian committed
564
            icon = require("@/assets/mark/markmapqy.png");
jianqian's avatar
jianqian committed
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655
            let option = {
                position: [Number(obj.longitude), Number(obj.latitude)],
                content: ` <img src="${icon}" width="25">`,
                label: {
                    content: obj.unitName,
                    offset: [28, -7]
                },
                offset: [-13, -2],
                events: {
                    click: (e: any) => {
                        that.windowsArr.forEach((ele: any) => {
                            // console.log(ele,"ele")
                            ele.visible = false;
                        });
                        that.$nextTick(() => {
                            // console.log(ele,"ele")
                            that.currentWindow = that.windowsArr[index];
                            that.currentWindow.visible = true;
                        });
                    },
                },
                visible: true,
            };
            that.Mutil.addMarkerToMap(
                'qiye',
                obj.unitName,
                icon,
                [obj.longitude, obj.latitude],
                0.4,
                obj.enterpriseId
            );
        }
        change(v: any) {
            let that = this;
            that.matermapData.forEach((ele: any, index: any) => {
                if (ele.dataType == v || v == 0) {
                    that.markers0[index].visible = true;
                } else {
                    that.markers0[index].visible = false;
                }
            });
            that.matermapData1.forEach((ele: any, index: any) => {
                if (ele.dataType == v || v == 0) {
                    that.markers1[index].visible = true;
                } else {
                    that.markers1[index].visible = false;
                }
            });
            that.matermapData2.forEach((ele: any, index: any) => {
                if (ele.dataType == v || v == 0) {
                    that.markers2[index].visible = true;
                } else {
                    that.markers2[index].visible = false;
                }
            });
            that.matermapData3.forEach((ele: any, index: any) => {
                if (ele.dataType == v || v == 0) {
                    that.markers3[index].visible = true;
                } else {
                    that.markers3[index].visible = false;
                }
            });
            that.matermapData4.forEach((ele: any, index: any) => {
                if (ele.dataType == v || v == 0) {
                    that.markers4[index].visible = true;
                } else {
                    that.markers4[index].visible = false;
                }
            });
            that.matermapData5.forEach((ele: any, index: any) => {
                if (ele.dataType == v || v == 0) {
                    that.markers5[index].visible = true;
                } else {
                    that.markers5[index].visible = false;
                }
            });
            that.matermapData6.forEach((ele: any, index: any) => {
                if (ele.dataType == v || v == 0) {
                    that.markers6[index].visible = true;
                } else {
                    that.markers6[index].visible = false;
                }
            });
        }

        /* 搜索 */
        getMaterialinfo(maid: any) {
            let that = this;
            that.getMaterialWindow(maid);
        }
        created() {
656
            //this.getMaterial();
jianqian's avatar
jianqian committed
657 658 659 660 661 662 663
        }
        cancel(){
            this.goods={};
            this.trouble={};
            this.dialogVisible1 = false;
            this.dialogVisible2 = false;
        }
664
        async mounted() {
jianqian's avatar
jianqian committed
665 666 667 668 669 670 671

            let that = this;

            that.player = new WasmPlayer(null, "div_video", null);
            that.mapLoadDone = true;
            that.Mutil = new Mutil("mapbox");
            that.MAP = that.Mutil.MAP;
jianqian's avatar
jianqian committed
672
            await this.Mutil.getBoundaries("行唐")
jianqian's avatar
jianqian committed
673 674 675 676 677 678 679 680 681 682 683 684
            that.Mutil.mapSelectBind((evt: any) => {
                //这是地图marker点击回调监听
                /*if (evt.selected[0].get('type') === 'qiye') {
                    that.Mutil.closeAllOverlays();
                    let id = evt.selected[0].get('did');
                    if (id) that.getPopcon(id);
                } */
                    that.Mutil.closeAllOverlays();
                    let id = evt.selected[0].get('did');
                    if (id) that.getMaterialinfo(id);

            })
685

jianqian's avatar
jianqian committed
686
            this.getStatiData();
687 688
            this.getMaterial();

jianqian's avatar
jianqian committed
689 690 691 692
        }

        mapma(){
            if (this.maVisble) {
jianqian's avatar
jianqian committed
693
                this.Mutil.visibleMarks(true, "material");
jianqian's avatar
jianqian committed
694 695 696 697
                this.maVisble = false;
                this.$refs.material.style.background = "#24BBC7";
                this.$refs.zma.lastChild.style.color = "#013056";
            } else {
jianqian's avatar
jianqian committed
698
                this.Mutil.visibleMarks(false, "material");
jianqian's avatar
jianqian committed
699 700 701 702 703 704 705 706
                this.maVisble = true;
                this.$refs.material.style.background = "RGBA(5, 52, 82, 0.7)";
                this.$refs.zma.lastChild.style.color = "#fff";
            }

        }
        mapma1(){
            if (this.ma1Visble) {
jianqian's avatar
jianqian committed
707
                this.Mutil.visibleMarks(true, "material1");
jianqian's avatar
jianqian committed
708 709 710 711
                this.ma1Visble = false;
                this.$refs.material1.style.background = "#24BBC7";
                this.$refs.zma1.lastChild.style.color = "#013056";
            } else {
jianqian's avatar
jianqian committed
712
                this.Mutil.visibleMarks(false, "material1");
jianqian's avatar
jianqian committed
713 714 715 716 717 718 719
                this.ma1Visble = true;
                this.$refs.material1.style.background = "RGBA(5, 52, 82, 0.7)";
                this.$refs.zma1.lastChild.style.color = "#fff";
            }
        }
        mapma2(){
            if (this.ma2Visble) {
jianqian's avatar
jianqian committed
720
                this.Mutil.visibleMarks(true, "material2");
jianqian's avatar
jianqian committed
721 722 723 724
                this.ma2Visble = false;
                this.$refs.material2.style.background = "#24BBC7";
                this.$refs.zma2.lastChild.style.color = "#013056";
            } else {
jianqian's avatar
jianqian committed
725
                this.Mutil.visibleMarks(false, "material2");
jianqian's avatar
jianqian committed
726 727 728 729 730 731 732
                this.ma2Visble = true;
                this.$refs.material2.style.background = "RGBA(5, 52, 82, 0.7)";
                this.$refs.zma2.lastChild.style.color = "#fff";
            }
        }
        mapma3(){
            if (this.ma3Visble) {
jianqian's avatar
jianqian committed
733
                this.Mutil.visibleMarks(true, "material3");
jianqian's avatar
jianqian committed
734 735 736 737
                this.ma3Visble = false;
                this.$refs.material3.style.background = "#24BBC7";
                this.$refs.zma3.lastChild.style.color = "#013056";
            } else {
jianqian's avatar
jianqian committed
738
                this.Mutil.visibleMarks(false, "material3");
jianqian's avatar
jianqian committed
739 740 741 742 743 744 745
                this.ma3Visble = true;
                this.$refs.material3.style.background = "RGBA(5, 52, 82, 0.7)";
                this.$refs.zma3.lastChild.style.color = "#fff";
            }
        }
        mapma4() {
            if (this.ma4Visble) {
jianqian's avatar
jianqian committed
746
                this.Mutil.visibleMarks(true, "material4");
jianqian's avatar
jianqian committed
747 748 749 750
                this.ma4Visble = false;
                this.$refs.material4.style.background = "#24BBC7";
                this.$refs.zma4.lastChild.style.color = "#013056";
            } else {
jianqian's avatar
jianqian committed
751
                this.Mutil.visibleMarks(false, "material4");
jianqian's avatar
jianqian committed
752 753 754 755 756 757 758
                this.ma4Visble = true;
                this.$refs.material4.style.background = "RGBA(5, 52, 82, 0.7)";
                this.$refs.zma4.lastChild.style.color = "#fff";
            }
        }
        mapma5() {
            if (this.ma5Visble) {
jianqian's avatar
jianqian committed
759
                this.Mutil.visibleMarks(true, "material5");
jianqian's avatar
jianqian committed
760 761 762 763
                this.ma5Visble = false;
                this.$refs.material5.style.background = "#24BBC7";
                this.$refs.zma5.lastChild.style.color = "#013056";
            } else {
jianqian's avatar
jianqian committed
764
                this.Mutil.visibleMarks(false, "material5");
jianqian's avatar
jianqian committed
765 766 767 768 769 770 771
                this.ma5Visble = true;
                this.$refs.material5.style.background = "RGBA(5, 52, 82, 0.7)";
                this.$refs.zma5.lastChild.style.color = "#fff";
            }
        }
        mapma6() {
            if (this.ma6Visble) {
jianqian's avatar
jianqian committed
772
                this.Mutil.visibleMarks(true, "material6");
jianqian's avatar
jianqian committed
773 774 775 776
                this.ma6Visble = false;
                this.$refs.material6.style.background = "#24BBC7";
                this.$refs.zma6.lastChild.style.color = "#013056";
            } else {
jianqian's avatar
jianqian committed
777
                this.Mutil.visibleMarks(false, "material6");
jianqian's avatar
jianqian committed
778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878
                this.ma6Visble = true;
                this.$refs.material6.style.background = "RGBA(5, 52, 82, 0.7)";
                this.$refs.zma6.lastChild.style.color = "#fff";
            }
        }
        // mapbox(){
        //     let that = this;
        //     that.Mutil.closeAllOverlays();
        // }
        // editFun(row: any) {
        //     this.dialogTit = "编辑";
        //     this.formData = Object.assign({}, row);
        //     this.zjKey++;
        //     this.dialogVisible = true;
        // }
        getStatiData() {
            let that = this;
            METHOD.axiosPost(
                that,
                `/dataStatistics/managerDataStatistics`,
                { cityId: "", countyId: "", provinceId: "" },
                function (res: any) {
                    if (res.code == 0) {

                        if (res.code == 0 && res.data.goodsList.length > 0) {
                            that.wxymapData = res.data.goodsList;
                            let wxylatSum = 0;
                            let wxylngSum = 0;
                            that.wxymapData.forEach((ele: any, index: any) => {
                                wxylngSum += ele.longitude;
                                wxylatSum += ele.latitude;
                            });
                            let center = [
                                wxylngSum / that.wxymapData.length,
                                wxylatSum / that.wxymapData.length,
                            ];
                            that.Mutil.setViewF({
                                center: center
                            })
                        }
                    }
                }
            );
        }
    }
</script>

<style lang="scss">
    @import "@/utils/public.scss";

    .map-botton {
        width: 100px;
        height: 50px;
        outline: none;
        z-index: 10;
        position: absolute;
    }

    .gengxin {
        text-align: center;
        color: #fff;
    }

    .map-botton:nth-child(1) {
        left: 50px;
    }

    .map-botton:nth-child(2) {
        left: 160px;
    }

    .map-botton:nth-child(3) {
        left: 270px;
    }

    #mapbox {
        width: 100%;
        height: 100%;
        position: relative;
    }

    .gis {
        position: relative;
        overflow: hidden;
    }

    /* .div-isShowVideo{
    width: 200px;
    height: 350px;
} */
    /* .div-isShowVideo .divspan{
    width: 100%;
    height: 20px;
} */
    .markBox {
        z-index: 30;
        width: 185px;
        height: 100%;
        background: url('../../assets/z3.png') 100% 100%;
        position: absolute;
        top: -0px;
879
        right: 0px;
jianqian's avatar
jianqian committed
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919
    }

    .markBox .markbox-div {
        width: 100%;
        height: 70px;
        text-align: center;
        background-color: RGBA(17, 59, 89, 0.7);
        font-size: 100% 100%;
        margin-top: 30px;
        cursor:pointer;
    }

    .markbox-span {
        float: right;
        text-align: center;
        font-size: 15px;
        /* font-family: 'UnidreamLED'; */
        color: #fff;
    }

    .markbox-click img {
        /* width: 30px; */
        margin-top: 17px;
    }

    .show-box {
        position: absolute !important;
        z-index: 9;
        /* background: rgba(204, 204, 204, 0.7); */
        top: 4px;
        right: 10px;
    }

    .search-box {
        position: absolute !important;
        top: 14px;
        left: 80px;
    }

    .ol-zoom {
jianqian's avatar
jianqian committed
920 921
        top: 10px;
        left: 250px !important;
jianqian's avatar
jianqian committed
922 923
    }
</style>