From e6acb39a2475e211f2c1decc45a95c868239c25f Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期五, 18 十月 2024 14:28:32 +0800
Subject: [PATCH] ll

---
 admin/src/components/system/role/OperaSystemRoleDataWindow.vue |   84 ++++++++++++++++++++++-------------------
 1 files changed, 45 insertions(+), 39 deletions(-)

diff --git a/admin/src/components/system/role/OperaSystemRoleDataWindow.vue b/admin/src/components/system/role/OperaSystemRoleDataWindow.vue
index 9528a0b..5727a97 100644
--- a/admin/src/components/system/role/OperaSystemRoleDataWindow.vue
+++ b/admin/src/components/system/role/OperaSystemRoleDataWindow.vue
@@ -1,32 +1,16 @@
 <template>
-  <GlobalWindow
-    :title="title"
-    width="60%"
-    :visible.sync="visible"
-    :confirm-working="isWorking"
-    @confirm="confirm"
-  >
-    <p class="tip">姝e湪涓鸿鑹层�� <em>{{role.name || '-'}}</em>銆� 閰嶇疆鏁版嵁鏉冮檺</p>
+  <GlobalWindow :title="title" width="80%" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm">
+    <p class="tip">姝e湪涓鸿鑹层�� <em>{{ role.name || '-' }}</em>銆� 閰嶇疆鏁版嵁鏉冮檺</p>
     <p class="tip-warn"><i class="el-icon-warning"></i>鎻愰啋锛氭潈闄愰厤缃悗闇�閲嶆柊鐧诲綍鍚庣敓鏁�</p>
     <el-form :model="form" ref="form" style="margin-top:15px">
       <el-form-item label="鏉冮檺绫诲瀷锛�" prop="type">
         <el-select v-model="form.type" clearable filterable placeholder="璇烽�夋嫨鏉冮檺绫诲瀷">
-          <el-option
-            v-for="(item, index) in options"
-            :key="index"
-            :label="item.name"
-            :value="item.id"
-          >
+          <el-option v-for="(item, index) in options" :key="index" :label="item.name" :value="item.id">
           </el-option>
         </el-select>
       </el-form-item>
       <el-form-item v-if="form.type == 4" label="鑷畾涔夐儴闂細" prop="customData">
-        <el-cascader
-          :options="departments"
-          v-model="form.customData"
-          :props=defaultProps
-          clearable
-        ></el-cascader>
+        <el-cascader :options="departments" v-model="form.customData" :props=defaultProps clearable></el-cascader>
       </el-form-item>
 
     </el-form>
@@ -38,13 +22,13 @@
 import GlobalWindow from '@/components/common/GlobalWindow'
 import { createRoleDataPermission } from '@/api/system/role'
 import { fetchList } from '@/api/business/company'
-  // import the styles
+// import the styles
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 export default {
   name: 'OperaSystemRoleWindow',
   extends: BaseOpera,
   components: { GlobalWindow },
-  data () {
+  data() {
     return {
       options: [
         { name: '鍏ㄩ儴', id: 0 },
@@ -71,11 +55,11 @@
         value: 'id',
         emitPath: false
       },
-      role:{},
+      role: {},
       departments: []
     }
   },
-  created () {
+  created() {
     this.config({
       api: '/system/role',
       'field.id': 'id'
@@ -84,18 +68,18 @@
   },
   methods: {
     // 閮ㄩ棬鏍戠姸缁撴瀯鏁版嵁
-    treeComList () {
+    treeComList() {
       fetchList()
         .then(res => {
           // this.departments = this.tree([res])
-          this.departments =this.newTree(res)
+          this.departments = this.newTree(res)
         })
     },
-    open (title, target,role) {
+    open(title, target, role) {
       // console.log(title, target)
       this.title = title
       this.visible = true
-      this.role=role
+      this.role = role
       // 鏂板缓
       if (target == null) {
         this.$nextTick(() => {
@@ -109,33 +93,33 @@
         for (const key in this.form) {
           this.form[key] = target[key]
         }
-        console.log(target);
-        if (target.customData === undefined ||target.customData === null || target.customData === '') {
+        console.log(target)
+        if (target.customData === undefined || target.customData === null || target.customData === '') {
           this.form.customData = []
         } else {
-          const customD  = this.form.customData.split(',')
+          const customD = this.form.customData.split(',')
           this.form.customData = customD.map((item) => { return parseInt(item) })
         }
       })
     },
     newTree(tree) {
-      if(tree ==null){
+      if (tree == null) {
         return []
       }
       return tree.map(item => {
-        let newItem = {...item}
-        if(newItem){
-          newItem.children=newItem.childList
+        let newItem = { ...item }
+        if (newItem) {
+          newItem.children = newItem.childList
         }
         if (item.children && item.children.length == 0) {
-          this.$delete( newItem, 'children' )
+          this.$delete(newItem, 'children')
         } else {
           newItem.children = this.newTree(newItem.children)
         }
         return newItem
-      });
+      })
     },
-    __confirmCreate () {
+    __confirmCreate() {
       // console.log(JSON.stringify(this.form.customData));
       // return
       this.$refs.form.validate((valid) => {
@@ -164,7 +148,7 @@
           })
       })
     },
-    __confirmEdit () {
+    __confirmEdit() {
       // console.log(JSON.stringify(this.form.customData));
       // return
       this.$refs.form.validate((valid) => {
@@ -196,3 +180,25 @@
   }
 }
 </script>
+<style scoped lang="scss">
+.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