Browse Source

2022-08-24 数据权限单选

zhuliu 3 years ago
parent
commit
d78963c41e
2 changed files with 24 additions and 5 deletions
  1. 14 3
      src/views/apply/index.vue
  2. 10 2
      src/views/dataPermission/index.vue

+ 14 - 3
src/views/apply/index.vue

@@ -85,7 +85,13 @@
             <el-table-column prop="name" label="租户名称" align="center" show-overflow-tooltip></el-table-column>
             <el-table-column prop="contacts" label="联系人" align="center" show-overflow-tooltip></el-table-column>
             <el-table-column prop="address" label="联系人地址" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="type" label="类型" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column label="类型" align="center" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <span v-if="dictionaries.TENANT_TYPE">
+                  {{(dictionaries.TENANT_TYPE.filter(item=>item.dictChildValue==scope.row.type))[0].dictChildLabel}}
+                </span>
+              </template>
+            </el-table-column>
             <el-table-column label="是否启用" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
               <span v-if="scope.row.state==0">否</span>
@@ -132,11 +138,16 @@ export default {
       },
     }
   },
-    computed: {
+  computed: {
     userinfo() {
       return this.$store.state.admin.userinfo
-    }
+    },
+    dictionaries() {
+      return this.$store.state.admin.dictionaries
+    },
+   
   },
+
   mounted() {
     this.getList()
 

+ 10 - 2
src/views/dataPermission/index.vue

@@ -11,12 +11,12 @@
     </el-form>
     <el-table
         row-key="id"
+        ref="dataTable"
         v-loading="loading"
         :data="tableData"
         border
-        @expand-change="getNode"
+       @select="changeData"
         header-row-class-name="custom-table-header"
-        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
       <el-table-column type="selection" width="60" align="center"></el-table-column>
       <el-table-column prop="name" label="数据权限名称" align="" show-overflow-tooltip></el-table-column>
@@ -226,6 +226,14 @@ export default {
     }
   },
   methods: {
+    changeData(selection,row){
+      if (selection.length > 1) {
+          const del_row = selection.shift()
+          this.$refs.dataTable.toggleRowSelection(del_row, false)
+        }
+        // this.checkList = selection[0]
+
+    },
     addList() {
       this.list.push({})
     },