index.vue 27.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 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 305 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 337 338 339 340 341 342 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 374 375 376 377 378 379 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 411 412 413 414 415 416 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 448 449 450 451 452 453 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 485 486 487 488 489 490 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 522 523 524 525 526 527 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 559 560 561 562 563 564 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 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 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
<template>
  <div class="container">
    <div class="searchSty">
      <el-form :inline="true" style="display: flex; justify-content: space-between" :model="queryForm"
               class="demo-form-inline">
        <div>
          <el-form-item label="企业:">
            <el-select v-model="queryForm.qyId" @change="handleQyChange" placeholder="请选择">
              <el-option v-for="item in qyOption" :key="item.qyId" :label="item.qymc" :value="item.qyId">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="气站:">
            <el-select v-model="queryForm.qzId" placeholder="请选择">
              <el-option v-for="item in qzOption" :key="item.qzId" :label="item.qzmc" :value="item.qzId">
              </el-option>
            </el-select>
          </el-form-item>
        </div>
        <el-form-item>
          <el-button type="primary" icon="el-icon-refresh"
                     style="border: 1px solid #5875eb; background: #ffffff; color: #5875eb; border-radius: 5px;"
                     @click="handleReset" plain>重置
          </el-button>
          <el-button type="primary" style="background: #5875eb; border: 1px solid #5875eb; border-radius: 5px;"
                     icon="el-icon-search" @click="handleSearch"> 查询
          </el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="mapSty" v-loading="loading">
      <div id="mapContainer"
           class="map"
           tabindex="0">
      </div>
    </div>
    <div ref="companyInfoData"
         v-if="companyInfoDataVisible"
         class="custom-info input-card content-window-card">
      <div class="info-top" style="display: flex; justify-content: space-between;align-items: center">
        <div>
          <span style="color: #ffffff;">企业信息</span>
        </div>
        <div @click="closeInfoWindow" style="display: flex;align-items: center">
          <i class="el-icon-close" style="color: #ffffff; font-size: 20px;cursor: pointer; " ></i>
        </div>
      </div>
      <div class="info-middle"
           style="background-color: white;">
        <el-row>
          <el-col :span="24" v-for="(item,index) in companyInfoList1" :key="'company'+index" >
            <el-col :span="12" v-for="(bitem,index) in item" :key="bitem.name">
              <div class="info-div" style="display: flex" v-if="bitem.type!== 'img'">
                <div style="text-align: right;width: 140px;">
                  {{bitem.name}}:
                </div>
                <div class="info-span" style="flex: 1">{{bitem.value}}</div>
              </div>
            </el-col>
          </el-col>
        </el-row>
      </div>
      <div class="info-bottom" style="position: relative; top: 0px; margin: 0px auto;"><img src="https://webapi.amap.com/images/sharp.png"></div>
    </div>
    <div ref="gasStationInfoData"
         v-if="gasStationInfoVisible"
         class="custom-info input-card content-window-card">
      <div class="info-top" style="display: flex; justify-content: space-between;align-items: center">
        <div>
          <span style="color: #ffffff;">气站信息</span>
        </div>
        <div @click="closeInfoWindow" style="display: flex;align-items: center">
          <i class="el-icon-close" style="color: #ffffff; font-size: 20px;cursor: pointer; " ></i>
        </div>
      </div>
      <div class="info-middle"
           style="background-color: white;">
        <el-row>
          <el-col :span="24" v-for="(item,index) in gasStationInfoList1" :key="'gas'+index" >
            <el-col :span="12" v-for="(bitem,index) in item" :key="bitem.name">
              <div class="info-div" style="display: flex" v-if="bitem.type!== 'img'">
                <div style="text-align: right;width: 170px;">
                  {{bitem.name}}:
                </div>
                <div class="info-span" style="flex: 1">{{bitem.value}}</div>
              </div>
              <div v-else class="info-div" style="display: flex">
                <div style="text-align: right;width: 170px;">
                  {{bitem.name}}:
                </div>
                <div class="info-span" style="flex: 1" v-if="bitem.value!=='— —'">
                  <el-image
                    alt="Loading..."
                    style="width: 100px; height: 100px"
                    :src="bitem.value"
                    :preview-src-list="[bitem.value]" >
                    <div slot="error" class="image-slot">
                      加载中....
                    </div>
                  </el-image>
                </div>
                <div class="info-span" style="flex: 1" v-else>{{bitem.value}}</div>
              </div>
            </el-col>
          </el-col>
        </el-row>
      </div>
      <div class="info-bottom" style="position: relative; top: 0px; margin: 0px auto;"><img src="https://webapi.amap.com/images/sharp.png"></div>
    </div>
  </div>
</template>
<script>
import { getEnterpriseMapPoint,getMapPointDetailInfo } from '@/api/gasMap.js'
import { getCurrentEnterpriseAndStation } from '@/api/common.js'
import AMapLoader from '@amap/amap-jsapi-loader';
import iconImg from '@/assets/images/气瓶图标.png'
import gasStationImg from '@/assets/qpxx/gasStation.png'
import gasStationImgHigh from '@/assets/qpxx/gasStation-high.png'
import companyImg from '@/assets/qpxx/company.png'
import companyImgHigh from '@/assets/qpxx/company-high.png'
import iconImg1 from '@/assets/images/气瓶图标1.png'


export default {
  name: "index",
  data() {
    return {
      reference:{},
      queryForm: {
        qzId: "",  //气站id
        qyId: "" //企业id
      },
      // 控制渲染条件 如果不用v-if会报错 具体可自行尝试
      showPop: false,
      // 保存当前激活的refrence id
      activeId:'',
      qyOption: [],
      allOption:[],
      qzOption: [],
      companyInfoList1:[],
      companyInfoList: [
        {
          name: '企业名称',
          value: '孝感市孝南区丰光储龙液化气有限公司储龙液化气有限公司储龙液化气',
          key:'fQymc'
        },
        {
          name: '企业简称',
          value: '孝聚能燃气',
          key:'fQyjc'
        },
        {
          name: '负责人',
          value: '张三',
          key:'fZjlxm'
        },
        {
          name: '联系电话',
          value: '1810000031',
          key:'fZjldh'
        },
        {
          name: '燃气经营许可证编号',
          value: '鄂20240900009P',
          key:'rqjyxkzbh'
        },
        {
          name: '经营范围',
          value:'孝感城区',
          key:'fJyfg',
        },
        {
          name: '统一社会信用代码',
          value: 'Y914209025769554598',
          key:'fTyshxydm'
        },
        {
          name: '地址',
          value:'华仕顿容器制造有限公司',
          key:'fQydz',
        },
        {
          name: '许可证有效期限',
          value: '2021年7月1号',
          key:'xkzyxqx'
        },
        {
          name: '状态',
          value:'正常营业',
          key:'fZt',
        }],
      gasStationInfoList1:[],
      gasStationInfoList: [
        {
          name: '气站名称',
          value: '汉川刘家隔镇液化石油气站',
          key:'fCzmc'
        },
        {
          name: '企业简称',
          value:'刘家隔镇液化气站',
          key:'fCzjc',
        },
        {
          name: '气站地址',
          value:'孝感市汉川市城隍镇八古村拐弯处直行200米',
          key:'fXxdz',
        },
        {
          name: '气站类型',
          value: '供应站',
          key:'fCzlx'
        },
        {
          name: '所属企业',
          value:'孝感市孝南区丰光储龙液化气有限公司',
          key:'fSsqymc',
        },
        {
          name: '气站标签',
          value: '配送、自提',
          key:'qzbq'
        },
        {
          name: '经营类别',
          value:'瓶装燃气(LPG)',
          key:'jylb',
        },
        {
          name: '企业地址',
          value: '华仕顿容器制造有限公司',
          key:'dz'
        },
        {
          name: '营业时间',
          value:'09:00 ~ 20:00',
          key:'fYykssj',
        },
        {
          name: '状态',
          value: '正常营业',
          key:'zt'
        },
        {
          name: '负责人',
          value: '张三',
          key:'fFzrmc'
        },
        {
          name: '负责人联系电话',
          value: '1810000081',
          key:'fFzrlxfs'
        },
        {
          name: '技术负责人',
          value:'张三',
          key:'fJsfzrmc',
        },
        {
          name: '技术负责人联系电话',
          value: '1810000081',
          key:'fJsfzrlxfs'
        },
        {
          name: '主要设备',
          value: '焊接气瓶',
          key:'zysb'
        },
        {
          name: '统一社会信用代码',
          value: 'Y914209025769554598',
          key:'tyshxydm'
        },
        {
          name: '充装许可证',
          value:'TS4242K20',
          key:'fCzxkz',
          type:'img'
        },
        {
          name: '充装许可证有效期限',
          value: '2021年7月1号',
          key:'czxkzyxqx'
        },
        {
          name: '燃气经营许可证',
          value: '鄂202209200000156',
          key:'fRqjyxkz',
          type:'img'
        },
        {
          name: '燃气经营许可证有效期限',
          value: '2021年7月1号',
          key:'rqjyxkzyxqx'
        },
        {
          name: '发证机关',
          value:'孝南区市场',
          key:'fzjg',
        },
        {
          name: '储存量(立方)',
          value: '200',
          key:'czl'
        },
      ],
      marker:null,
      markers:[],
      clickMapId:'',
      companyInfoDataVisible:false,
      gasStationInfoVisible:false,
      map: null, //地图
      pointData: [],
      centerPoint:[114.347441, 30.50438],
      currentObj:{},
      loading:false
    }
  },
  mounted() {

  },
  created () {
    this.initData();
  },
  methods: {
    initData(){
      this.getEnterpriseAndStationList();
      this.getMarkPoint();
    },
    //获取企业和气站数据
    async getEnterpriseAndStationList(){
      await getCurrentEnterpriseAndStation().then((res)=>{
        console.log('打印当前气站和企业信息数据====',res);
        const { value } = res;
        if(value.length>0){
          this.allOption = value;
          this.qyOption = value?value.map((item)=>{
            return {
              qyId:item.qyId,
              qymc:item.qymc
            }
          }):[];
          console.log('打印 this.qyOption ', this.qyOption );
          console.log('打印 this.allOption ', this.allOption );
        }
      })
    },
    //选择企业的数据
    handleQyChange(val){
      this.qzOption =[];
      this.queryForm.qzId ='';
      this.qzOption = this.allOption.filter((item)=>item.qyId == val)[0].qzxxList;
    },
    //查询按钮
    handleSearch() {
      this.loading = true;
      this.pointData = [];
      this.markers = [];
      this.companyInfoDataVisible = false;
      this.gasStationInfoVisible = false;
      this.getMarkPoint();
    },
    //重置按钮
    handleReset() {
      this.qzOption = [];
      this.queryForm.qzId = '';
      this.queryForm.qyId = '';
      this.handleSearch();
    },
    async getMarkPoint(){
      this.loading = true;
      let params ={
        qzId:this.queryForm.qzId,
        qyId: this.queryForm.qyId,
      }
      await getEnterpriseMapPoint(params).then((res)=>{
        let { code, value} = res;
        if(!value){
         this.loading = false;
         return 
        }
        if(code == 200){
          const { qyxxList, qzxxList } = value;
          let pointDataArray =[]
          qyxxList.length>0?qyxxList.map((item)=>{
            if(item.current){
              this.centerPoint= [item.fJd, item.fWd]
            }
            pointDataArray.push({
              ...item,
              type:'qy',
              isActive:false
            })
          }):[];
          qzxxList.length>0?qzxxList.map((item)=>{
            if(item.current){
              this.centerPoint= [item.fJd, item.fWd]
            }
            pointDataArray.push({
              ...item,
              type:'qz',
              isActive:false
            })
          }):[];
          console.log('打印value====>', pointDataArray);
          this.pointData = pointDataArray;
          console.log('打印pointData',this.pointData);
          this.centerPoint=[pointDataArray[0].fJd,pointDataArray[0].fWd]
          this.initMap();
        }
      })
    },
    //获取地图数据
    initMap() {
      AMapLoader.reset();
      AMapLoader.load({
        "key": "331eb7ad61de4d49e14bef6afd11b54d",// 申请好的Web端开发者Key,首次调用 load 时必填
        "version": "2.0",   // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
        "plugins": ['AMap.ToolBar', 'AMap.Driving'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
        "AMapUI": {
          "version": "1.1",
          "plugins": []
        },
        Loca: {
          version: '2.0' //数据可视化
        }
      }).then((AMap) => {
        console.log("初始化地图",this.map);
          // this.map = new AMap.Map('mapContainer', {//设置地图容器id
          //   viewMode: '2D', //是否为3D地图模式
          //   zoom: 15, //初始化地图层级
          //   center: this.centerPoint,//初始化地图中心点
          // });
        // ===========天地图代码==============
        if(!this.map){
          // 防止二次初始化导致拖拽失效
          this.map = new T.Map('mapContainer',{
            projection: 'EPSG:900913' 
          });
        }
        this.map.centerAndZoom(new T.LngLat(this.centerPoint[0], this.centerPoint[1]), 15);
        //允许鼠标双击放大地图
        this.map.enableScrollWheelZoom();
        let arr =[];

        for (let i = 0; i < this.pointData.length; i++) {
          // 引入本地图片
          const localIcon = new T.Icon({
            iconUrl: this.pointData[i].type=='qy'?companyImg:gasStationImg,
            iconSize: new T.Point(30, 34),
            iconAnchor: new T.Point(30, 34),
          });
          //向地图上添加自定义标注
          if(this.pointData[i].fJd && this.pointData[i].fWd){
            this.marker = new T.Marker(new T.LngLat(this.pointData[i].fJd, this.pointData[i].fWd), {icon: localIcon});
            arr.push( Object.assign(this.pointData[i], {
              mapId: this.pointData[i].id,
            }))
            this.marker['arr'] = arr;
            this.marker['isActive'] = this.pointData[i].isActive;
            this.marker['type'] = this.pointData[i].type;
            this.marker['tid'] = this.pointData[i].id
            this.marker.addEventListener("click", this.markerClick.bind(null,this.marker));
            this.markers.push(this.marker);
            this.map.addOverLay(this.marker);
          }
        }
        this.loading = false;
        console.log('所有makers点',this.markers);
        // ===========天地图代码==============


        //信息窗口实例
        //循环所有的标记点
        // console.log('打印pointData',this.pointData);
        // let arr =[];
        // for (let i = 0; i < this.pointData.length; i++) {
        //   // 引入本地图片
        //   const localIcon = new AMap.Icon({
        //     size: new AMap.Size(30, 34), // 图标尺寸
        //     image: this.pointData[i].type=='qy'?companyImg:gasStationImg, // 图片的URL
        //     imageSize: new AMap.Size(30, 34), // 图标所用图片大小
        //   });
        //   var marker = new AMap.Marker({
        //     position: [this.pointData[i].fJd, this.pointData[i].fWd],
        //     map: this.map,
        //     icon:localIcon,
        //     offset: new AMap.Pixel(-15, -20),
        //   });
        //   arr.push( Object.assign(this.pointData[i], {
        //     mapId: marker._amap_id,
        //   }))
        //   // 将创建的点标记添加到已有的地图实例+
        //   marker['arr'] = arr;
        //   marker['isActive'] = this.pointData[i].isActive;
        //   marker['type'] = this.pointData[i].type;
        //   this.map.add([marker]);
        //   marker.on("click", this.markerClick);
        //   this.markers.push(marker);
        //   marker.emit('click', {target: marker});
        // }


        // AMap.plugin('AMap.DistrictSearch', function () {
        //   //创建行政区查询对象
        //   var options = {
        //     subdistrict: 0, //获取边界不需要返回下级行政区
        //     extensions: 'all',//返回行政区边界坐标组等具体信息
        //     level: 'province'//查询行政级别为省
        //   };
        //   var district = new AMap.DistrictSearch(options);
        //   district.search('湖北省', function (status, result) {
        //     // console.log('打印status', status);
        //     // 获取湖北省的边界信息
        //     var bounds = result.districtList[0].boundaries
        //     var polygons = [];
        //     if (bounds) {
        //       for (var i = 0, l = bounds.length; i < l; i++) {
        //         //生成行政区划polygon
        //         var polygon = new AMap.Polygon({
        //           map: this.map,
        //           strokeWeight: 1,
        //           path: bounds[i],
        //           fillOpacity: 0.7,
        //           fillColor: '#CCF3FF',
        //           strokeColor: '#CC66CC'
        //         })
        //         polygons.push(polygon)
        //       }
        //       // 地图自适应
        //       this.map.setFitView()
        //     }
        //   });
        // })
      }).catch(e => {
        console.log(e);
      });
    },
    //点击点标记事件
  async  markerClick(event,e) {
    console.log("event",event);
    console.log('打印e',e.target);
    // return
    let arrNew = e.target.arr.filter((x) => x.id == e.target.tid);
    console.log('打印arrNew[0]',arrNew[0]);
      // 引入本地图片
      // if (!e.target.isActive) {
      //   e.target.isActive = true;
      //   this.companyInfoDataVisible = false;
      //   this.gasStationInfoVisible = false;
      //   this.clickMapId = '';
      // } else {
        // this.clickMapId = e.target._amap_id;
        this.clickMapId = e.target.tid;
        console.log("true",this.clickMapId);
        switch  (e.target.type){
          case 'qy':
            this.companyInfoDataVisible = true;
            this.companyInfoList = await this.$assignValues(arrNew[0], this.companyInfoList);
            this.companyInfoList1 = await this.$createDoubleArray(this.companyInfoList,2);
            console.log("企业1",this.companyInfoList);
            console.log("企业2",this.companyInfoList1);
            break;
          case 'qz':
            this.gasStationInfoVisible = true;
            this.gasStationInfoList = await this.$assignValues(arrNew[0], this.gasStationInfoList);
            console.log("气站",this.gasStationInfoList);
            this.gasStationInfoList.map(async (item)=>{
              if(item.type == 'img' && item.value !=='— —'){
                console.log('打印item', item);
                let gasStationImg = JSON.parse(item.value);
                console.log('打印gasStationImg', gasStationImg);
                let gasStationUrl = await this.$getPhotoUrl(gasStationImg[0].response.fileId);
                item.value = gasStationUrl;
                console.log('打印gasStationUrl===', gasStationUrl);
              }
            })
            this.gasStationInfoList1 = await this.$createDoubleArray(this.gasStationInfoList,2);
            break;
        }
      // }
      // this.markers.forEach((marker) => {
      //   const newIcon = new AMap.Icon({
      //     size: new AMap.Size(30, 34), // 图标尺寸
      //     image: marker.type=='qy'?companyImgHigh:gasStationImgHigh, // 图片的URL
      //     imageSize: new AMap.Size(30, 34), // 图标所用图片大小
      //   });
      //   const oldIcon = new AMap.Icon({
      //     size: new AMap.Size(30, 34), // 图标尺寸
      //     image: marker.type=='qy'?companyImg:gasStationImg, // 图片的URL
      //     imageSize: new AMap.Size(30, 34), // 图标所用图片大小
      //   });
      //   if (marker._amap_id !== this.clickMapId) {
      //     marker.isActive = true;
      //     marker.setIcon(oldIcon);
      //   }else{
      //     marker.isActive = false;
      //     console.log('打印marker',marker);
      //     marker.setIcon(newIcon);
      //   }
      // });
      this.markers.forEach((marker) => {
        const newIcon = new T.Icon({
          iconSize: T.Point(30, 34), // 图标尺寸
          iconUrl: marker.type=='qy'?companyImgHigh:gasStationImgHigh, // 图片的URL
          iconAnchor: T.Point(30, 34), // 图标所用图片大小
        });
        const oldIcon = new T.Icon({
          iconSize: T.Point(30, 34), // 图标尺寸
          iconUrl: marker.type=='qy'?companyImg:gasStationImg, // 图片的URL
          iconAnchor: T.Point(30, 34), // 图标所用图片大小
        });
        if (marker.tid !== this.clickMapId) {
          // marker.isActive = true;
          marker.setIcon(oldIcon);
        }else{
          // marker.isActive = false;
          console.log('打印marker',marker);
          marker.setIcon(newIcon);
        }
      });
    // console.log('打印arrNew[0]',arrNew[0])
      // infoWindow.setContent(e.target.content);
    if(!e.target.isActive){
      // 如果已选中,则不做处理
      let content = e.target.type=='qy'?this.$refs.companyInfoData: this.$refs.gasStationInfoData;
      var lnglat = new T.LngLat(e.lnglat.lng, e.lnglat.lat);
      console.log("content",content);
      console.log("lnglat",lnglat);
      var infoWin = new T.InfoWindow();
      infoWin.setLngLat(lnglat);
      infoWin.setContent(content);
      this.map.openInfoWindow(content,lnglat);
      this.map.panTo(lnglat);
      // this.map.centerAndZoom(lnglat);
      this.map.checkResize(); 
      // infoWindow.open(this.map, e.target.getPosition());
    }
      // 更新选中的标记点
      // 设置当前点击的标记点样式
      // e.target.setIcon(newIcon); // 或者其他方法来重置样式
    },
    // async getPointDetailInfo(fqptm,e){
    //   let params ={
    //     qptm:fqptm
    //   }
    //   await getMapPointDetailInfo(params).then(async(res)=>{
    //     console.log('打印res',res);
    //     const { value} = res;
    //     const {qpdqlzs,qpOrderInfoVO} = value;
    //     var infoWindow = this.createInfoWindow();
    //     infoWindow.open(this.map, e.target.getPosition());
    //     this.devInfoList = await this.$assignValues(value, this.devInfoList);
    //     this.nodeList = await this.$createDoubleArray(qpdqlzs,5);
    //     console.log('打印this.nodeList', this.nodeList);
    //     if(!qpOrderInfoVO){
    //       this.orderHolderInfoList1 =[];
    //     }else{
    //       this.gasStationInfoList =  await this.$assignValues(qpOrderInfoVO, this.orderHolderInfoList);
    //       this.orderHolderInfoList1 = await this.$createDoubleArray(this.orderHolderInfoList,2);
    //     }
    //     this.devInfoList1  = await this.$createDoubleArray(this.devInfoList,2);
    //   })
    // },
    //4.构建自定义窗体
    createInfoWindow(val) {
      console.log('打印val', val);
      let infoWindowData = new AMap.InfoWindow({
        isCustom: true, //使用自定义窗体
        content: val.type=='qy'?this.$refs.companyInfoData: this.$refs.gasStationInfoData,
        // content: this.getContent(),
        offset: new AMap.Pixel(-180, -50),
      })
      console.log("infoWindowData",infoWindowData);
      return infoWindowData
    },
    closeInfoWindow(e) {
      // 引入本地图片
      this.markers.forEach((marker) => {
        console.log('打印marker', marker);
        // const oldIcon = new AMap.Icon({
        //   size: new AMap.Size(30, 34), // 图标尺寸
        //   image:marker.type=='qy'?companyImg:gasStationImg, // 图片的URL
        //   imageSize: new AMap.Size(30, 34), // 图标所用图片大小
        // });
        const oldIcon = new T.Icon({
          iconSize: T.Point(30, 34), // 图标尺寸
          iconUrl:marker.type=='qy'?companyImg:gasStationImg, // 图片的URL
          iconAnchor: T.Point(30, 34), // 图标所用图片大小
        });
        if (marker.tid == this.clickMapId) {
          marker.isActive = true;
          marker.setIcon(oldIcon);
        }
      });
      this.clickMapId = '';
      // this.map.clearInfoWindow();
      this.map.closeInfoWindow();
    },
  }
}

</script>
<style lang="scss">
.popoverSty.el-popover {
  background: #ec661e;
  //border-color: #000022;
  border: 1px solid #ec661e !important;
  border-radius: 10px;
  opacity: 0.92;
  color: #fff;
}
/* 下方是去除三角箭头的代码 */
.popoverSty.el-popper[x-placement^=top] .popper__arrow::after {
  border-top-color: #ec661e !important;
}
</style>
<style lang="scss" scoped>

::v-deep .tdt-infowindow-content-wrapper{
  box-shadow:none;
  background:rgba(255, 255, 255, 0);
}

::v-deep .tdt-infowindow-close-button{
  display: none;
}

::v-deep .tdt-infowindow-tip-container{
  display: none;
}

::v-deep .tdt-infowindow{
  bottom: 40px !important;
  left: -360px !important;
}

#mapContainer {
  min-width: 865px;
  min-height: 630px;
}

.container {
  .searchSty {
    background: #ffffff;
    padding: 0 20px;
    padding-top: 20px;
  }

  .mapSty {
    padding: 20px;
    margin-top: 20px;
    background: #ffffff;
  }
  .labelSty{
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 10px;
  }
  .completeSty{
    background-color: #ea5504;
  }
  .uncompleteSty{
    background-color: #ccd0e5;
  }
  .textSty{
    white-space: nowrap; /* 设置为单行 */
    max-width: 200px; /* 设置最大宽度 */
    overflow: hidden; /* 隐藏超出部分的内容 */
    text-overflow: ellipsis; /* 显示省略号 */
  }
}
.content-window-card {
  position: relative;
  box-shadow: none;
  bottom: 0;
  left: 0;
  /* width: auto; */
  width: 45rem;
  padding: 0;
}
.content-window-card p {
  height: 2rem;
}

.custom-info {
  border: solid 1px silver;
}

.info-top {
  position: relative;
  //background: none repeat scroll 0 0 #f9f9f9;
  background: #0076d5;
  border-bottom: 1px solid #ccc;
  //border-radius: 5px 5px 0 0;
}

.info-top div {
  display: inline-block;
  color: #333333;
  font-size: 14px;
  font-weight: bold;
  line-height: 31px;
  padding: 0 10px;
}
.info-top img {
  position: absolute;
  top: 10px;
  right: 10px;
  transition-duration: 0.25s;
}

.info-top img:hover {
  box-shadow: 0px 0px 5px #000;
}

.info-middle {
  font-size: 14px;
  padding: 5px 15px;
  line-height: 25px;
  color: #999DB0;
}

.info-bottom {
  height: 0px;
  width: 100%;
  clear: both;
  text-align: center;
}
.info-bottom img {
  position: relative;
  z-index: 104;
}

/* span {
  margin-left: 5px;
  font-size: 11px;
} */

.info-middle img {
  float: left;
  margin-right: 6px;
}

.info-span {
  /* margin-left: 35px; */
  //font-size: 11px;
  color: #333333;
}

.info-div {
  width: 100%;
  display: inline-block;
  margin-left: 10px;
}

.info-img {
  width: 40px;
  height: 40px;
}

.info-a-title {
  color: #000000;
  font-size: 16px;
}

</style>