Преглед изворни кода

修改编辑数据权限bug

zhuliu пре 3 година
родитељ
комит
d0a880088f
2 измењених фајлова са 8 додато и 7 уклоњено
  1. 1 1
      src/views/client/index.vue
  2. 7 6
      src/views/dataPermission/index.vue

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

@@ -128,7 +128,7 @@
           <el-col :span="24">
             <el-form-item label="功能权限" prop="function">
            <el-cascader
-           ref="FunctionCascader"
+              ref="FunctionCascader"
               v-model="ruleForm.function"
               :options="authority"
               :props="{multiple:true,value:'id',label:'name' }"

+ 7 - 6
src/views/dataPermission/index.vue

@@ -51,11 +51,11 @@
                 <el-button type="primary" @click="addList()">添加</el-button>
               </div>
                 <div style="border:1px solid #C0C0C0;border-radius:4px;overflow:auto;min-height:200px;padding: 10px 20px">
-                  <el-row :gutter="24" v-for="(item,i) in list" :key="i" class="listItem">
+                  <el-row :gutter="24" v-for="(items,i) in list" :key="i" class="listItem">
                     <el-col :span="4" style="padding:0">
                       <span>
                         <span v-if="i==0" style="opacity: 0;"> 内容 </span>
-                        <el-select v-else v-model="item.logicOpr">
+                        <el-select v-else v-model="list[i].logicOpr">
                           <el-option
                             v-for="item in dictionaries.LOGIC_OPERATOR"
                             :key="item.dictChildValue"
@@ -67,7 +67,7 @@
                     </el-col>
 
                     <el-col :span="7">
-                      <el-select v-model="item.field">
+                      <el-select v-model="list[i].field">
                         <el-option
                         v-for="item in dictList"
                         :key="item.dataSourceField"
@@ -77,7 +77,7 @@
                       </el-select>
                     </el-col>
                     <el-col :span="3" style="padding:0">
-                      <el-select v-model="item.opr">
+                      <el-select v-model="list[i].opr">
                         <el-option
                         v-for="item in dictionaries.OPERATOR"
                         :key="item.dictChildValue"
@@ -87,7 +87,7 @@
                       </el-select>
                     </el-col>
                       <el-col :span="7">
-                        <el-select v-model="item.value"
+                        <el-select v-model="list[i].value"
                           filterable
                           allow-create
                           default-first-option
@@ -383,7 +383,7 @@ if(row.rule){
   if(JSON.parse(row.rule).hasOwnProperty('left')){
         this.TreeToList(JSON.parse(row.rule))
       }else{
-        this.list[0]=JSON.parse(row.rule)
+        this.list.push(JSON.parse(row.rule))
       }
 }
       this.ruleForm = { ...row }
@@ -391,6 +391,7 @@ if(row.rule){
     },
     close() {
       this.visible = false
+      this.list = []
     },
      handleCurrentChange(val) {
       this.queryParams.current = val;