From a2e5b78d3677cb0999c0b7faa6c93d97810370e2 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 14 十月 2024 17:04:53 +0800
Subject: [PATCH] ll

---
 admin/src/components/business/OperaMemberRoleWindow.vue |  119 +++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 67 insertions(+), 52 deletions(-)

diff --git a/admin/src/components/business/OperaMemberRoleWindow.vue b/admin/src/components/business/OperaMemberRoleWindow.vue
index 5ed9027..9c4b0eb 100644
--- a/admin/src/components/business/OperaMemberRoleWindow.vue
+++ b/admin/src/components/business/OperaMemberRoleWindow.vue
@@ -39,6 +39,7 @@
                     :filter-method="filterMethod"
                     filter-placeholder="璇疯緭鍏ラ棬绂佺偣鍒嗙粍鍚嶇О"
                     v-model="form.roleIds"
+                    class="transfer"
                     :data="roles">
                 </el-transfer>
             </el-form-item>
@@ -50,42 +51,42 @@
 <script>
 import BaseOpera from '@/components/base/BaseOpera'
 import GlobalWindow from '@/components/common/GlobalWindow'
-import {getDeviceRoleList} from '@/api/business/device'
+import { getDeviceRoleList } from '@/api/business/device'
 export default {
   name: 'OperaDeviceRoleWindow',
   extends: BaseOpera,
   components: { GlobalWindow },
   data () {
     var validateTime = (rule, value, callback) => {
-      if(this.form.timeType == null  ){
+      if (this.form.timeType == null) {
         callback(new Error('璇峰~鍐欐纭殑闂ㄧ鏈夋晥鏈熸椂闂�'))
         return
       }
-      if(this.form.timeType === 1 && (this.form.startTime ==null || this.form.endTime == null)){
-          callback(new Error('璇峰~鍐欐纭殑闂ㄧ鏈夋晥鏈熸椂闂�'))
-          return
+      if (this.form.timeType === 1 && (this.form.startTime == null || this.form.endTime == null)) {
+        callback(new Error('璇峰~鍐欐纭殑闂ㄧ鏈夋晥鏈熸椂闂�'))
+        return
       }
       callback()
-    };
+    }
     return {
       // 琛ㄥ崟鏁版嵁
-     time:null,
-      companyType:1,
+      time: null,
+      companyType: 1,
       form: {
         ids: [],
         names: [],
         timeType: 0,
         roleIds: [],
         status: 1,
-        startTime:null,
-        endTime:null,
+        startTime: null,
+        endTime: null,
         radio: 0
       },
-      roles:[],
+      roles: [],
       rules: {
       // 楠岃瘉瑙勫垯
         timeType: [
-          { required: true, validator: validateTime,message: '璇烽�変腑闂ㄧ鏈夋晥鏈�' }
+          { required: true, validator: validateTime, message: '璇烽�変腑闂ㄧ鏈夋晥鏈�' }
         ],
         startTime: [
           { validator: validateTime, trigger: 'blur' }
@@ -103,15 +104,15 @@
     })
   },
   methods: {
-    filterMethod(query, item) {
-      if (!query) return item;
-      return item.label.indexOf(query) > -1 ;
+    filterMethod (query, item) {
+      if (!query) return item
+      return item.label.indexOf(query) > -1
     },
     seleTime (e) {
-      if(e && e.length >= 2){
+      if (e && e.length >= 2) {
         this.form.startTime = e[0]
         this.form.endTime = e[1]
-      }else{
+      } else {
         this.form.startTime = null
         this.form.endTime = null
       }
@@ -123,41 +124,40 @@
         }
         if (this.form.roleIds == null || this.form.roleIds.length == 0) {
           this.$dialog.actionConfirm('鏉冮檺涓虹┖锛屾彁浜ゅ悗鍗虫竻闄ゆ墍閫変汉鍛樺凡鍒嗛厤鏉冮檺锛佽璋ㄦ厧鎿嶄綔', '鎮ㄧ‘璁よ繘琛岃鎿嶄綔鍚楋紵')
-              .then(() => {
-                this.confirmDo();
-              })
-              .catch(() => {})
-
+            .then(() => {
+              this.confirmDo()
+            })
+            .catch(() => {})
         } else {
-          this.confirmDo();
+          this.confirmDo()
         }
       })
     },
-    confirmDo(){
-        // 璋冪敤鏂板缓鎺ュ彛
-        this.isWorking = true
-        this.api.batchRoleAuth({
-          ids: this.form.ids,
-          timeType: this.form.timeType,
-          startTime: this.form.startTime,
-          endTime: this.form.endTime,
-          roleIds: this.form.roleIds
+    confirmDo () {
+      // 璋冪敤鏂板缓鎺ュ彛
+      this.isWorking = true
+      this.api.batchRoleAuth({
+        ids: this.form.ids,
+        timeType: this.form.timeType,
+        startTime: this.form.startTime,
+        endTime: this.form.endTime,
+        roleIds: this.form.roleIds
+      })
+        .then(() => {
+          this.visible = false
+          this.$tip.apiSuccess('鎺堟潈鎴愬姛锛屽彲鍓嶅線銆愪汉鍛樻巿鏉冭褰曘�戞煡鐪嬩笅鍙戣繘搴�')
+          this.$emit('success')
         })
-            .then(() => {
-              this.visible = false
-              this.$tip.apiSuccess('鎺堟潈鎴愬姛锛屽彲鍓嶅線銆愪汉鍛樻巿鏉冭褰曘�戞煡鐪嬩笅鍙戣繘搴�')
-              this.$emit('success')
-            })
-            .catch(e => {
-              this.$tip.apiFailed(e)
-            })
-            .finally(() => {
-              this.isWorking = false
-            })
-      },
+        .catch(e => {
+          //  this.$tip.apiFailed(e)
+        })
+        .finally(() => {
+          this.isWorking = false
+        })
+    },
     // 鑾峰彇璁惧
-    getLists (){
-      getDeviceRoleList({type:2})
+    getLists () {
+      getDeviceRoleList({ type: 2 })
         .then(res => {
           this.roles = res.map(item => {
             return {
@@ -168,7 +168,7 @@
           })
         })
     },
-    open (title, ids,names,companyType) {
+    open (title, ids, names, companyType) {
       this.roles = []
       this.getLists()
       this.title = title
@@ -178,8 +178,8 @@
       this.$nextTick(() => {
         this.$refs.form.resetFields()
         this.form[this.configData['field.id']] = null
-        this.form.ids = ids;
-        this.form.names =names;
+        this.form.ids = ids
+        this.form.names = names
 
         console.log(names)
       })
@@ -212,7 +212,22 @@
     }
   }
 }
-.el-transfer-panel {
-  width: 350px !important;
-}
+.transfer {
+    height: 600px;
+    width: 100%;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    ::v-deep .el-transfer-panel{
+      flex: 1;
+      height: 100%;
+    }
+    ::v-deep .el-transfer-panel__body {
+      height: 500px;
+    }
+
+    ::v-deep .el-transfer-panel__list.is-filterable {
+      height: 480px;
+    }
+  }
 </style>

--
Gitblit v1.9.3