فهرست منبع

数据权限架构

zhuliu 3 سال پیش
والد
کامیت
34e7b7718c
2فایلهای تغییر یافته به همراه47 افزوده شده و 22 حذف شده
  1. 12 1
      src/views/client/index.vue
  2. 35 21
      src/views/dataPermission/index.vue

+ 12 - 1
src/views/client/index.vue

@@ -31,8 +31,14 @@
       <el-table-column label="操作" align="center" width="150">
         <template slot-scope="scope">
           <el-dropdown split-button type="primary" size="small" >
-            <span v-if="$permission('/admin/client/modify')" @click="handleEdit(scope.row)">编辑</span>
+            <div v-if="$permission('/admin/client/modify')" @click="handleEdit(scope.row)">编辑</div>
             <span v-else :disabled="true">编辑</span>
+        <!-- <el-button type="primary" size="small"  @click="handleEdit(scope.row)" v-if="$permission('/admin/client/modify')">
+				<span>编辑</span>
+			</el-button>
+			<el-button type="primary" size="small" v-else :disabled="true">
+				 <span >编辑</span>
+			</el-button> -->
             <el-dropdown-menu slot="dropdown" class="text-align_center">
               <el-dropdown-item @click.native="handleDetails(scope.row)" v-if="$permission('/admin/client/detail')">详情</el-dropdown-item>
               <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided v-if="$permission('/admin/client/delete')">删除</el-dropdown-item>
@@ -309,6 +315,11 @@ export default {
     submit() {
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
+           this.ruleForm.functions=[]
+        for(var i =0;i<this.ruleForm.function.length;i++){
+          var a =this.ruleForm.function[i].join(',')
+          this.ruleForm.functions.push(a)
+        }
           this.btnLoading = true
           if (this.ruleForm.id) {
             this.$api.editTenant(this.ruleForm).then(response => {

+ 35 - 21
src/views/dataPermission/index.vue

@@ -60,15 +60,19 @@
         </el-form-item>
         <el-form-item label="数据权限">
              <template>
-                  <div style="border:1px solid #C0C0C0;border-radius:4px;overflow:auto;height:700px;padding:20px">
-                   <el-row :gutter="24" v-for="(item,i) in data" :key="i">
-                    <el-col :span="3"><span><el-input  v-model="item.logicOpr"></el-input></span></el-col>
-                    <el-col :span="6"><el-input v-model="item.field"></el-input></el-col>
+              <div> <el-button @click="addList()">+增加</el-button> </div>
+                  <div style="border:1px solid #C0C0C0;border-radius:4px;overflow:auto;min-height:200px;padding:20px">
+                   <el-row :gutter="24" v-for="(item,i) in list" :key="i">
+                    <el-col :span="3"><span><el-input  v-model="item.logicOpr" ></el-input></span></el-col>
+                    <el-col :span="7"><el-input v-model="item.field"></el-input></el-col>
                     <el-col :span="3"><el-input v-model="item.opr"></el-input></el-col>
-                    <el-col :span="6"><el-input v-model="item.value"></el-input></el-col>
-                    <el-col :span="6">
-                      <el-button circle icon="el-icon-plus" @click="addList()"></el-button>
-                      <el-button circle icon="el-icon-minus" @click="subList(i)" v-if="i>0"></el-button>
+                    <el-col :span="7"><el-input v-model="item.value"></el-input></el-col>
+                    <el-col :span="4">
+                    <el-button><i class="el-icon-delete"></i> </el-button>
+                      
+                      <!-- <el-button circle icon="el-icon-plus" @click="addList()" v-if="i==list.length-1"></el-button> -->
+                      <!-- <el-button circle icon="el-icon-minus" @click="subList(i)"></el-button> -->
+                      
                     </el-col>
                     <!-- <el-col :span="2"><div style="border-radius:50%"><i class="el-icon-delete"></i></div></el-col> -->
                   </el-row>
@@ -121,6 +125,7 @@ export default {
         name: [{ required: true, message: '请输入部门名称', trigger: 'blur' },],
         parentId: [{ required: true, message: '请选择所属部门', trigger: 'change' },],
       },
+      list:[],
       dataList:
         {
           "nodeType": "logic",
@@ -152,7 +157,27 @@ export default {
     }
   },
   created(){
-    var root = this.dataList
+   
+  },
+  mounted() {
+    this.getList()
+    this.getFunctionList()
+  },
+  computed: {
+   
+    userinfo() {
+      return this.$store.state.admin.userinfo
+    }
+  },
+  methods: {
+    addList(){
+      this.list.push({})
+    },
+    ListToTree(){
+
+    },
+    TreeToList(){
+       var root = this.dataList
     var a=[]
      const result = [];
     function l(root){
@@ -205,18 +230,7 @@ export default {
         
     console.log(a)
     this.data=a
-  },
-  mounted() {
-    this.getList()
-    this.getFunctionList()
-  },
-  computed: {
-    userinfo() {
-      return this.$store.state.admin.userinfo
-    }
-  },
-  methods: {
-   
+    },
     getNode(node){
       console.log(node)