From a4e06ccd3cd976fbe4eef99e188d42ec9f3ad054 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 08 Apr 2021 09:32:05 +0800
Subject: [PATCH] 样式修改

---
 src/views/security/security.vue |  139 +++++++++++++++++++++++++++------------------
 1 files changed, 83 insertions(+), 56 deletions(-)

diff --git a/src/views/security/security.vue b/src/views/security/security.vue
index 735662e..65accab 100644
--- a/src/views/security/security.vue
+++ b/src/views/security/security.vue
@@ -1,39 +1,46 @@
 <template>
   <basic-container>
-    <avue-crud :option="option"
-               :table-loading="loading"
-               :data="data"
-               :page="page"
-               :permission="permissionList"
-               :before-open="beforeOpen"
-               v-model="form"
-               ref="crud"
-               @row-update="rowUpdate"
-               @row-save="rowSave"
-               @row-del="rowDel"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad">
+    <avue-crud :option="option" :table-loading="loading" :data="data" :page="page" :permission="permissionList"
+               :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
+               @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
+               @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
       <template slot="menuLeft">
-        <el-button type="danger"
-                   size="small"
-                   icon="el-icon-delete"
-                   plain
-                   v-if="permission.security_delete"
-                   @click="handleDelete">删 除
+        <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.security_delete" @click="handleDelete">删
+          除
+        </el-button>
+      </template>
+
+      <template slot-scope="{ row }" slot="jtype">
+        <el-tag>{{
+          row.jtype == "0" ? "否" : row.jtype == "1" ? "是" : "无"
+          }}
+        </el-tag>
+      </template>
+
+      <template slot-scope="{ type, size, row }" slot="menu">
+        <el-button icon="el-icon-location-outline" :size="size" :type="type" @click.stop="handleMap(row)">编辑电子围栏
         </el-button>
       </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%"
+              height="100%"></iframe>
+    </el-drawer>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/security/security";
-  import {mapGetters} from "vuex";
+  import {
+    getList,
+    getDetail,
+    add,
+    update,
+    remove
+  } from "@/api/security/security";
+  import {
+    mapGetters
+  } from "vuex";
 
   export default {
     data() {
@@ -41,14 +48,16 @@
         form: {},
         query: {},
         loading: true,
+        showMap: false,
         page: {
           pageSize: 10,
           currentPage: 1,
           total: 0
         },
+        dialogVisible: false,
         selectionList: [],
         option: {
-          height:'auto',
+          height: 'auto',
           calcHeight: 30,
           tip: false,
           searchShow: true,
@@ -58,10 +67,18 @@
           viewBtn: true,
           selection: true,
           dialogClickModal: false,
-          column: [
+          column: [{
+            label: "账号",
+            prop: "account",
+            rules: [{
+              required: true,
+              message: "请输入账号",
+              trigger: "blur"
+            }]
+          },
             {
               label: "人员编号",
-              prop: "snumber",
+              prop: "code",
               search: true,
               rules: [{
                 required: true,
@@ -70,8 +87,8 @@
               }]
             },
             {
-              label: "人员名称",
-              prop: "sname",
+              label: "人员姓名",
+              prop: "realName",
               search: true,
               rules: [{
                 required: true,
@@ -83,25 +100,15 @@
               label: "性别",
               prop: "sex",
               type: "select",
-              dicData: [
-                {
-                  label: "男",
-                  value: "0"
-                },
+              dicData: [{
+                label: "男",
+                value: 1
+              },
                 {
                   label: "女",
-                  value: "1"
+                  value: 2
                 },
               ],
-            },
-            {
-              label: "年龄",
-              prop: "age",
-              rules: [{
-                required: true,
-                message: "请输入年龄",
-                trigger: "blur"
-              }]
             },
             {
               label: "联系电话",
@@ -113,24 +120,33 @@
               }]
             },
             {
-              label: "家庭住址",
-              prop: "address",
+              label: "邮箱",
+              prop: "email",
               rules: [{
                 required: true,
-                message: "请输入家庭住址",
+                message: "请输入邮箱",
                 trigger: "blur"
               }]
             },
             {
-              label: "录用时间",
-              prop: "stime",
-              display: false,
+              label: "生日",
+              prop: "birthday",
               rules: [{
                 required: true,
-                message: "请输入录用时间",
+                message: "请选择",
                 trigger: "blur"
               }]
             },
+            {
+              label: "创建时间",
+              prop: "createTime",
+              display: false,
+              rules: [{
+                required: true,
+                message: "请选择创建时间",
+                trigger: "blur"
+              }]
+            }
           ]
         },
         data: []
@@ -198,6 +214,18 @@
             });
           });
       },
+      handleMap(row) {
+        this.showMap = true;
+        this.$nextTick(() => {
+          this.$refs.mapDiv.onload = () => {
+            window.frames[0].init("SecurityMap", {
+              x: row.jd,
+              y: row.wd,
+              code:row.code
+            });
+          };
+        })
+      },
       handleDelete() {
         if (this.selectionList.length === 0) {
           this.$message.warning("请选择至少一条数据");
@@ -245,10 +273,10 @@
         this.selectionList = [];
         this.$refs.crud.toggleSelection();
       },
-      currentChange(currentPage){
+      currentChange(currentPage) {
         this.page.currentPage = currentPage;
       },
-      sizeChange(pageSize){
+      sizeChange(pageSize) {
         this.page.pageSize = pageSize;
       },
       refreshChange() {
@@ -267,4 +295,3 @@
     }
   };
 </script>
-

--
Gitblit v1.9.3