南昌市物联网技防平台-前端
liuyg
2021-04-20 c6796cb12ca7aa0717349ca185ece091acdd2bbc
src/views/security/security.vue
@@ -23,9 +23,20 @@
      </template>
    </avue-crud>
    <el-drawer title="电子地图" append-to-body="true" :visible.sync="showMap">
      <iframe id="mapDiv" ref="mapDiv" src="/map/index.html?openid=scurityMap&ISinit=1" frameborder="0" width="100%"
    <!-- <el-drawer title="电子地图" append-to-body="true" :visible.sync="showMap">
      <iframe id="mapDiv" ref="mapDiv" src="/map/index.html?ISinit=1&openid=SecurityMap" frameborder="0" width="100%"
              height="100%"></iframe>
    </el-drawer> -->
    <el-drawer title="电子地图" append-to-body="true" :visible.sync="showMap">
      <iframe
                id="securityMap"
                ref="securityMap"
                :src="baseUrl"
                frameborder="0"
                width="100%"
                height="100%"
                name="securityMap"
              ></iframe>
    </el-drawer>
  </basic-container>
</template>
@@ -45,10 +56,11 @@
  export default {
    data() {
      return {
        baseUrl:"/map/index.html?ISinit=1",
        form: {},
        query: {},
        loading: true,
        showMap: false,
        showMap: true,
        page: {
          pageSize: 10,
          currentPage: 1,
@@ -189,6 +201,9 @@
        return ids.join(",");
      }
    },
    mounted() {
      this.showMap = false;
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
@@ -233,17 +248,22 @@
            });
          });
      },
      //打开地图
      handleMap(row) {
        this.showMap = true;
        this.$nextTick(() => {
          this.$refs.mapDiv.onload = () => {
        var that =this;
        that.baseUrl = `/map/index.html?ISinit=1&openid=SecurityMap&jd=${row.jd}&wd=${row.wd}&code=${row.code}&name=${row.realName}`;
        this.showMap=true;
        this.$refs.securityMap.onload = () => {
          if (window.frames[0].init) {
            window.frames[0].init("SecurityMap", {
              x: row.jd,
              y: row.wd,
              code:row.code
                x: row.jd,
                y: row.wd,
                code:row.code
            });
          };
        })
          } else {
            console.log(`没有找到到window.frames[0].init`)
          }
        }
      },
      handleDelete() {
        if (this.selectionList.length === 0) {