南昌市物联网技防平台-前端
zengh
2021-04-27 d74734fd32b892c4e71dccc0f85db7f3e9d36f18
src/views/security/security.vue
@@ -70,7 +70,7 @@
        selectionList: [],
        option: {
          height: 'auto',
          calcHeight: 30,
          calcHeight: 54,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
@@ -118,11 +118,11 @@
              prop: "online_status",
              dicData: [{
                label: "离线",
                value: 0
                value: "0"
              },
                {
                  label: "在线",
                  value: 1
                  value: "1"
                },
              ],
            },
@@ -248,20 +248,28 @@
            });
          });
      },
      //打开地图
      handleMap(row) {
        var that =this;
        that.baseUrl = `/map/index.html?ISinit=1&openid=SecurityMap&jd=${row.jd}&wd=${row.wd}`;
        that.baseUrl = `/map/index.html?ISinit=1&openid=SecurityMap&jd=${row.jd}&wd=${row.wd}&code=${row.code}&name=${row.realName}`;
        this.showMap=true;
        console.log(this.$refs,111);
        console.log(this.$refs.securityMap,222);
        this.$refs.securityMap.onload = () => {
          if (window.frames[0].init) {
            window.frames[0].init("SecurityMap", {
                x: row.jd,
                y: row.wd,
                code:row.code
            });
            if(row.jd==""){
              //如果处警员无位置信息,则赋值一个默认数据,否则地图无法加载
              window.frames[0].init("SecurityMap", {
                              x: "115.862321",
                              y: "28.591108",
                              code:row.code
                          });
            }else{
              window.frames[0].init("SecurityMap", {
                              x: row.jd,
                              y: row.wd,
                              code:row.code
                          });
            }
          } else {
            console.log(`没有找到到window.frames[0].init`)
          }