From d33eacc1f85ac3a736b33ba4713a19aae466d711 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 05 八月 2022 16:42:53 +0800
Subject: [PATCH] 1.做适应平板显示的内容大小

---
 src/views/jcsz/jsqd.vue |   95 +++++++++++++++++++++++++++++++----------------
 1 files changed, 62 insertions(+), 33 deletions(-)

diff --git a/src/views/jcsz/jsqd.vue b/src/views/jcsz/jsqd.vue
index ecc2490..206278f 100644
--- a/src/views/jcsz/jsqd.vue
+++ b/src/views/jcsz/jsqd.vue
@@ -47,7 +47,7 @@
       <div style="margin-left: 10px;display: flex">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
         <el-button type="primary" icon="el-icon-setting" @click="settingButton">璁剧疆</el-button>
-        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
+        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>
       </div>
       <el-divider />
       <div class="elTableDiv">
@@ -56,7 +56,7 @@
           border
           stripe
           :height="tableHeight+'px'"
-          :style="{width: 100+'%',height:tableHeight+'px'}"
+          :style="{width: 100+'%',height: tableHeight+'px'}"
           highlight-current-row
           :header-cell-style="this.$headerCellStyle"
           :cell-style="this.$cellStyle"
@@ -117,7 +117,7 @@
           >
             <template slot-scope="{row}">
               <i v-if="row.is_user==='Y'" class="el-icon-user-solid" @click="userClick(row)" />
-              <i v-if="row.is_user==='N'" class="el-icon-user-solid" style="color: #E4E7ED" @click="userClick(row)" />
+              <i v-if="row.is_user==='N'" class="el-icon-user-solid" style="color: rgb(180 ,181, 185)" @click="userClick(row)" />
             </template>
           </el-table-column>
           <el-table-column
@@ -128,12 +128,13 @@
           >
             <template slot-scope="{row}">
               <i v-if="row.is_right==='Y'" class="el-icon-share" @click="rightClick(row)" />
-              <i v-if="row.is_right==='N'" class="el-icon-share" style="color: #E4E7ED" @click="rightClick(row)" />
+              <i v-if="row.is_right==='N'" class="el-icon-share" style="color: rgb(180 ,181, 185)" @click="rightClick(row)" />
             </template>
           </el-table-column>
           <el-table-column
             label="鎿嶄綔"
             fixed="right"
+            width="120"
           >
             <template slot-scope="{row}">
               <div class="operationClass">
@@ -287,10 +288,10 @@
     <el-dialog
       title="瑙掕壊鍏宠仈鐢ㄦ埛"
       :visible.sync="userDialogVisible"
-      width="1500px"
+      width="900px"
       :close-on-click-modal="false"
       top="15vh"
-      :fullscreen="isFullscreen"
+      :fullscreen="isIpad"
       class="userDialogVisible"
       @closed="handleCloseUser"
       @close="handleCloseUser"
@@ -305,10 +306,16 @@
       <div style="display: flex;min-height: 50px">
         <el-form ref="dialogFormUser" inline :model="dialogFormUser" label-width="80px">
           <el-form-item label="鐢ㄦ埛缂栫爜">
-            <el-input v-model="dialogFormUser.usercode" style="width: 200px" />
+            <el-input
+              v-model="dialogFormUser.usercode"
+              :style="{width:isIpad? '180px':'200px'}"
+            />
           </el-form-item>
           <el-form-item label="鐢ㄦ埛鍚嶇О">
-            <el-input v-model="dialogFormUser.username" style="width: 200px" />
+            <el-input
+              v-model="dialogFormUser.username"
+              :style="{width:isIpad? '180px':'200px'}"
+            />
           </el-form-item>
           <el-form-item label="鎵�灞炵粍缁�">
             <el-cascader
@@ -319,7 +326,7 @@
               :append-to-body="false"
               :options="StuOrgArr"
               :props="defaultProps"
-              style="width: 200px;"
+              :style="{width:isIpad? '180px':'200px'}"
 
               @change="dialogCascaderChange"
             />
@@ -330,7 +337,7 @@
               v-model="dialogFormUser.isrole"
               filterable
               :popper-append-to-body="false"
-              style="width: 200px"
+              :style="{width:isIpad? '180px':'200px'}"
               placeholder="璇烽�夋嫨"
             >
               <el-option
@@ -362,7 +369,7 @@
         :data="dialogFormUserTable"
         border
         highlight-current-row
-        height="300"
+        height="370"
         :header-cell-style="this.$headerCellStyle"
         :cell-style="this.$cellStyle"
         :row-key="getRowKey"
@@ -433,7 +440,7 @@
       :visible.sync="dialogVisibleRight"
       width="800px"
       top="15vh"
-      :fullscreen="isFullscreen"
+      :fullscreen="isIpad"
       :close-on-click-modal="false"
       class="dialogVisibleRight"
       @closed="handleCloseRight"
@@ -504,11 +511,16 @@
         </div>
       </span>
     </el-dialog>
+
+    <!--瀵煎叆缁勪欢-->
+    <import-picker ref="importPickerFunc" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
+
   </div>
 </template>
 
 <script>
 import Pagination from '@/components/Pagination'
+import ImportPicker from '@/components/ImportPicker'
 import {
   AddUpdateRole,
   DeleteRole, RoleAssociationRight,
@@ -524,7 +536,7 @@
 export default {
   name: 'JSQD',
   components: {
-    Pagination
+    Pagination, ImportPicker
   },
   data() {
     const validateName = (rule, value, callback) => {
@@ -538,15 +550,8 @@
         }
       }
     }
-    // const validateTypeCode = (rule, value, callback) => {
-    //   if (!value) {
-    //     return callback(new Error('璇烽�夋嫨涓婄骇'))
-    //   } else {
-    //     callback()
-    //   }
-    // }
     return {
-      isFullscreen: false,
+      isIpad: false,
       mainHeight: 0,
       tableHeight: 0,
       form: {
@@ -642,24 +647,42 @@
         value: 'code'
       },
       PCTrue: false, // 鏄惁灞曠ず
-      APPTrue: false// 鏄惁灞曠ず
+      APPTrue: false, // 鏄惁灞曠ず
+
+      title_value: '鏁版嵁瀵煎叆 / 瑙掕壊娓呭崟',
+      code: '1',
+      shows: false
+    }
+  },
+  watch: {
+    shows() {
+      if (!this.shows) {
+        this.getRoleSearch()
+      }
     }
   },
   created() {
-    this.getRoleSearch()
-    this.getRoleTypeSearch2()
-    this.getUserOrganization()
+    this.handleRequest()
   },
   mounted() {
     window.addEventListener('resize', this.getHeight)
     this.getHeight()
   },
   methods: {
+    handleRequest() {
+      this.getRoleSearch().then(res => {
+        if (res.code === '200') {
+          this.getRoleTypeSearch2()
+          this.getUserOrganization()
+        }
+      })
+    },
     // 鑾峰彇瑙掕壊娓呭崟
     async getRoleSearch() {
       const res = await RoleSearch(this.form)
       this.tableData = res.data
       this.total = res.count
+      return { code: res.code }
     },
     // 鑾峰彇鐢ㄦ埛绫诲瀷
     async getRoleTypeSearch() {
@@ -707,10 +730,6 @@
       this.formSetting.order = order
       this.formSetting.prop = prop
       this.getRoleTypeSearch()
-    },
-
-    upload() {
-
     },
     // 鏌ヨ
     search() {
@@ -801,11 +820,13 @@
     // 鑾峰彇椤甸潰楂樺害
     getHeight() {
       this.$nextTick(() => {
-        console.log(window.innerHeight)
-        console.log(window.innerHeight)
         this.mainHeight = window.innerHeight - 250
-        this.tableHeight = this.mainHeight - 100
-        // this.isFullscreen = window.innerHeight < 800
+        this.tableHeight = this.mainHeight - 50
+        if (window.innerHeight < 769) {
+          this.tableHeight = this.tableHeight - 50
+        }
+
+        this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
       })
     },
     /* 璁剧疆妯″潡*/
@@ -1430,6 +1451,14 @@
           this.dialogFormRight.rightAPPArrSelected = ['APP']
         }
       }
+    },
+    // 瀵煎叆鎸夐挳
+    upload() {
+      this.shows = true
+      this.$refs.importPickerFunc.newDataFunc()
+    },
+    colos() {
+      this.shows = false
     }
 
   }

--
Gitblit v1.9.3