From a38281e697cde9f45926a6af0c88bec14501fec0 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Tue, 15 Feb 2022 11:06:34 +0800
Subject: [PATCH] 68个表格在1366*768下的适配,保安单位情况智能分析中的图表的适配以及其按钮会被遮住不能点击

---
 src/views/securityEquipment/gun.vue |  174 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 89 insertions(+), 85 deletions(-)

diff --git a/src/views/securityEquipment/gun.vue b/src/views/securityEquipment/gun.vue
index 5f48086..c6a780f 100644
--- a/src/views/securityEquipment/gun.vue
+++ b/src/views/securityEquipment/gun.vue
@@ -1,64 +1,64 @@
 <template>
-  <basic-container>
-    <div
-      :class="[
-        'equipments',
-        $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
-      ]"
+  <basic-container
+    :class="[
+      'equipments',
+      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
+      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
+    ]"
+  >
+    <avue-crud
+      class="tablesss"
+      :option="option"
+      :data="data"
+      :page.sync="page"
+      ref="crudrec"
+      @on-load="onLoad"
+      :table-loading="loading"
+      @row-save="rowSave"
+      @search-change="searchChange"
+      @search-reset="searchReset"
+      @row-update="rowUpdate"
+      @row-del="rowDel"
+      @selection-change="selectionChange"
+      @refresh-change="refreshChange"
     >
-      <avue-crud
-        :option="option"
-        :data="data"
-        :page.sync="page"
-        ref="crudrec"
-        @on-load="onLoad"
-        :table-loading="loading"
-        @row-save="rowSave"
-        @search-change="searchChange"
-        @search-reset="searchReset"
-        @row-update="rowUpdate"
-        @row-del="rowDel"
-        @selection-change="selectionChange"
-        @refresh-change="refreshChange"
+      <template slot="menuLeft">
+        <el-button
+          type="danger"
+          size="small"
+          plain
+          icon="el-icon-delete"
+          @click="handleDelete"
+          >删 除
+        </el-button>
+        <el-button
+          type="success"
+          size="small"
+          plain
+          icon="el-icon-upload2"
+          @click="handleImport"
+          >批量导入
+        </el-button>
+      </template>
+    </avue-crud>
+    <el-dialog
+      title="枪支导入"
+      append-to-body
+      :visible.sync="excelBox"
+      width="555px"
+    >
+      <avue-form
+        :option="excelOption"
+        v-model="excelForm"
+        :upload-after="uploadAfter"
       >
-        <template slot="menuLeft">
-          <el-button
-            type="danger"
-            size="small"
-            plain
-            icon="el-icon-delete"
-            @click="handleDelete"
-            >删 除
-          </el-button>
-          <el-button
-            type="success"
-            size="small"
-            plain
-            icon="el-icon-upload2"
-            @click="handleImport"
-            >批量导入
+        <template slot="excelTemplate">
+          <el-button type="primary" @click="handleTemplate">
+            点击下载<i class="el-icon-download el-icon--right"></i>
           </el-button>
         </template>
-      </avue-crud>
-      <el-dialog
-        title="枪支导入"
-        append-to-body
-        :visible.sync="excelBox"
-        width="555px"
-      >
-        <avue-form
-          :option="excelOption"
-          v-model="excelForm"
-          :upload-after="uploadAfter"
-        >
-          <template slot="excelTemplate">
-            <el-button type="primary" @click="handleTemplate">
-              点击下载<i class="el-icon-download el-icon--right"></i>
-            </el-button>
-          </template>
-        </avue-form>
-      </el-dialog>
-    </div>
+      </avue-form>
+    </el-dialog>
   </basic-container>
 </template>
 
@@ -86,18 +86,18 @@
             loadText: "文件上传中,请稍等",
             span: 24,
             propsHttp: {
-              res: "data",
+              res: "data"
             },
             tip: "请上传 .xls,.xlsx 标准格式文件",
-            action: "/api/gun/import-gun?deptId=" + this.deptIds,
+            action: "/api/gun/import-gun?deptId=" + this.deptIds
           },
           {
             label: "模板下载",
             prop: "excelTemplate",
             formslot: true,
-            span: 24,
-          },
-        ],
+            span: 24
+          }
+        ]
       },
       deptIds: "",
       selectionList: [],
@@ -105,7 +105,7 @@
         pageSize: 10,
         currentPage: 1,
         total: 0,
-        ...this.$store.state.control.changePageSize,
+        ...this.$store.state.control.changePageSize
       },
       query: {},
       data: [],
@@ -122,20 +122,20 @@
         selection: true,
         labelWidth: 110,
         column: column,
-        ...this.$store.state.control.clearOtherBut,
+        ...this.$store.state.control.clearOtherBut
       },
-      useifid: 266,
+      useifid: 266
     };
   },
   computed: {
     ...mapGetters(["userInfo"]),
     ids() {
       let ids = [];
-      this.selectionList.forEach((ele) => {
+      this.selectionList.forEach(ele => {
         ids.push(ele.id);
       });
       return ids.join(",");
-    },
+    }
   },
   created() {
     var that = this;
@@ -157,7 +157,8 @@
         "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
     }
   },
-  mounted(){
+  mounted() {
+    this.$store.commit("setWindowSizeHeightAdd");
     this.deptIds = this.userInfo.dept_id;
   },
   methods: {
@@ -171,10 +172,9 @@
       done();
     },
     handleTemplate() {
-      window.open(`/api/gun/export-template-gun?${
-            this.website.tokenHeader
-          }=${getToken()}`
-        );
+      window.open(
+        `/api/gun/export-template-gun?${this.website.tokenHeader}=${getToken()}`
+      );
     },
     sizeChange(val) {
       this.page1.currentPage = 1;
@@ -194,15 +194,15 @@
         form["deptId"] = this.useifid;
       }
       adddata(form).then(
-        (res) => {
+        res => {
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "操作成功!",
+            message: "操作成功!"
           });
           done();
         },
-        (error) => {
+        error => {
           window.console.log(error);
           loading();
         }
@@ -231,11 +231,11 @@
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "操作成功!",
+            message: "操作成功!"
           });
           done();
         },
-        (error) => {
+        error => {
           window.console.log(error);
           loading();
         }
@@ -245,7 +245,7 @@
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           return remove(row.id);
@@ -254,7 +254,7 @@
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "操作成功!",
+            message: "操作成功!"
           });
         });
     },
@@ -269,7 +269,7 @@
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           return remove(this.ids);
@@ -278,7 +278,7 @@
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "操作成功!",
+            message: "操作成功!"
           });
           this.$refs.crudrec.toggleSelection();
         });
@@ -325,7 +325,10 @@
         params["jurisdiction"] = that.userInfo.jurisdiction;
       }
       //保安公司进入
-      if (this.userInfo.role_name == "保安公司管理员" || this.userInfo.role_name == "分公司管理员") {
+      if (
+        this.userInfo.role_name == "保安公司管理员" ||
+        this.userInfo.role_name == "分公司管理员"
+      ) {
         params["deptId"] = that.userInfo.dept_id;
         //导入action 修改
         const importColumn = that.findObject(
@@ -339,14 +342,15 @@
         page.currentPage,
         page.pageSize,
         Object.assign(params, this.query)
-      ).then((res) => {
+      ).then(res => {
         const data = res.data.data;
         this.page.total = data.total;
         this.data = data.records;
+        this.$store.commit("setWindowSizeHeightAdd");
         // console.log(this.data);
         this.loading = false;
       });
-    },
+    }
   },
   mounted() {
     // this.Ourdata = data;
@@ -355,7 +359,7 @@
     // var dept_id = JSON.parse(
     //   window.localStorage.getItem("saber-userInfo")
     // ).content.dept_id;
-  },
+  }
 };
 </script>
 
@@ -374,4 +378,4 @@
 // .el-tag--light {
 //   padding: 0 !important;
 // }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3