From 48d7249fc672823beddb321a3ca7ea57cb3e4d21 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 22 Apr 2021 17:59:35 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jfpt-Vue

---
 src/views/security/security.vue |   66 ++++++++++++++++++++++++++-------
 1 files changed, 52 insertions(+), 14 deletions(-)

diff --git a/src/views/security/security.vue b/src/views/security/security.vue
index 17e28c7..62f4cdb 100644
--- a/src/views/security/security.vue
+++ b/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,15 +56,17 @@
   export default {
     data() {
       return {
+        baseUrl:"/map/index.html?ISinit=1",
         form: {},
         query: {},
         loading: true,
-        showMap: false,
+        showMap: true,
         page: {
           pageSize: 10,
           currentPage: 1,
           total: 0
         },
+        dialogVisible: false,
         selectionList: [],
         option: {
           height: 'auto',
@@ -61,7 +74,8 @@
           tip: false,
           searchShow: true,
           searchMenuSpan: 6,
-          border: true,
+          border: false,
+          stripe: true,
           index: true,
           viewBtn: true,
           selection: true,
@@ -94,6 +108,23 @@
                 message: "请输入名称",
                 trigger: "blur"
               }]
+            },
+            {
+              label: "所属部门",
+              prop: "deptName"
+            },
+            {
+              label: "在线状态",
+              prop: "online_status",
+              dicData: [{
+                label: "离线",
+                value: 0
+              },
+                {
+                  label: "在线",
+                  value: 1
+                },
+              ],
             },
             {
               label: "性别",
@@ -139,6 +170,7 @@
             {
               label: "创建时间",
               prop: "createTime",
+              width:160,
               display: false,
               rules: [{
                 required: true,
@@ -168,6 +200,9 @@
         });
         return ids.join(",");
       }
+    },
+    mounted() {
+      this.showMap = false;
     },
     methods: {
       rowSave(row, done, loading) {
@@ -213,19 +248,22 @@
             });
           });
       },
+      //打开地图
       handleMap(row) {
-        this.showMap = true;
-        console.log("row.id="+row.id);
-        console.log("row.wd="+row.wd);
-        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) {

--
Gitblit v1.9.3