|
@@ -18,8 +18,9 @@
|
|
|
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>
|
|
|
- <el-table-column prop="tenant" label="所属功能" align="center" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="tenant" label="条件" align="center" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column prop="remark" label="备注" align="center" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column label="操作" align="center" width="150">
|
|
|
<template slot-scope="scope">
|
|
@@ -49,33 +50,59 @@
|
|
|
</el-tooltip>
|
|
|
</el-form-item> -->
|
|
|
<el-form-item label="所属功能" prop="function">
|
|
|
- <el-cascader
|
|
|
+ <el-input v-model="ruleForm.function" size="small" placeholder="请输入所属功能"></el-input>
|
|
|
+ <!-- <el-cascader
|
|
|
v-model="ruleForm.function"
|
|
|
:options="functionList"
|
|
|
:props="{multiple:true, checkStrictly: false,value:'id',label:'name' }"
|
|
|
collapse-tags
|
|
|
placeholder="请选择所属功能"
|
|
|
clearable
|
|
|
- style="width:100%"></el-cascader>
|
|
|
+ style="width:100%"></el-cascader> -->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="数据权限">
|
|
|
<template>
|
|
|
- <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="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>
|
|
|
+ <div class="add"><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 dataList" :key="i" class="listItem">
|
|
|
+ <el-col :span="3" :class="item.logicOpr ? 'normal' : 'hidden'" style="background: rgba(0,0,0,0)"><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="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-col>
|
|
|
+ </el-row> -->
|
|
|
+
|
|
|
+ <el-row :gutter="24" v-for="(item,i) in list" :key="i" class="listItem">
|
|
|
+ <el-col :span="3">
|
|
|
+ <span>
|
|
|
+ <span v-if="i==0" style="opacity: 0;"> 内容 </span>
|
|
|
+ <el-select v-else v-model="item.logicOpr">
|
|
|
+ <option value="a">a</option>
|
|
|
+ </el-select>
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-select>
|
|
|
+ <option value="s">s</option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="3">
|
|
|
+ <el-select>
|
|
|
+ <option value="d">d</option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-select>
|
|
|
+ <option value="z">z</option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button @click="deleteList(i)"><i class="el-icon-delete"></i> </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
@@ -102,7 +129,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ showSelect: false,
|
|
|
visible: false,
|
|
|
loading: false,
|
|
|
btnLoading: false,
|
|
@@ -112,7 +139,8 @@ export default {
|
|
|
show:false,
|
|
|
disabled:false,
|
|
|
lastName:'',
|
|
|
- functionLis:[],
|
|
|
+ functionLis: [],
|
|
|
+ multipleSelection: [],
|
|
|
queryParams: {
|
|
|
size: 10,
|
|
|
current: 1,
|
|
@@ -125,7 +153,7 @@ export default {
|
|
|
name: [{ required: true, message: '请输入部门名称', trigger: 'blur' },],
|
|
|
parentId: [{ required: true, message: '请选择所属部门', trigger: 'change' },],
|
|
|
},
|
|
|
- list:[],
|
|
|
+ list:[{}],
|
|
|
dataList:
|
|
|
{
|
|
|
"nodeType": "logic",
|
|
@@ -170,70 +198,69 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- addList(){
|
|
|
+ addList() {
|
|
|
+ this.showSelect = true
|
|
|
this.list.push({})
|
|
|
},
|
|
|
+ deleteList(i) {
|
|
|
+ this.list.splice(i, 1)
|
|
|
+ },
|
|
|
ListToTree(){
|
|
|
|
|
|
},
|
|
|
TreeToList(){
|
|
|
- var root = this.dataList
|
|
|
- var a=[]
|
|
|
- const result = [];
|
|
|
- function l(root){
|
|
|
- const stack = [];
|
|
|
- let last = null; // 标记上一个访问的节点
|
|
|
- let current = root;
|
|
|
- while (current || stack.length > 0) {
|
|
|
- while (current) {
|
|
|
- stack.push(current);
|
|
|
- current = current.left;
|
|
|
- }
|
|
|
- current = stack[stack.length - 1];
|
|
|
- if (!current.right || current.right == last) {
|
|
|
- current = stack.pop();
|
|
|
- result.push(current);
|
|
|
- last = current;
|
|
|
- current = null; // 继续弹栈
|
|
|
- } else {
|
|
|
- current = current.right;
|
|
|
+ var root = this.dataList
|
|
|
+ var a=[]
|
|
|
+ const result = [];
|
|
|
+ function l(root){
|
|
|
+ const stack = [];
|
|
|
+ let last = null; // 标记上一个访问的节点
|
|
|
+ let current = root;
|
|
|
+ while (current || stack.length > 0) {
|
|
|
+ while (current) {
|
|
|
+ stack.push(current);
|
|
|
+ current = current.left;
|
|
|
+ }
|
|
|
+ current = stack[stack.length - 1];
|
|
|
+ if (!current.right || current.right == last) {
|
|
|
+ current = stack.pop();
|
|
|
+ result.push(current);
|
|
|
+ last = current;
|
|
|
+ current = null; // 继续弹栈
|
|
|
+ } else {
|
|
|
+ current = current.right;
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log(result)
|
|
|
+ return result;
|
|
|
}
|
|
|
- console.log(result)
|
|
|
- return result;
|
|
|
-
|
|
|
- }
|
|
|
- l(root)
|
|
|
- console.log(result)
|
|
|
- var i=0
|
|
|
- var c=0
|
|
|
- function s(i){
|
|
|
- if(i<result.length){
|
|
|
-
|
|
|
- if(i==0){
|
|
|
- a.push(result[i])
|
|
|
- i+=1
|
|
|
- c+=1
|
|
|
- }
|
|
|
- if(i%2==1){
|
|
|
- a.push(result[i])
|
|
|
- console.log(a[c])
|
|
|
- a[c]['logicOpr'] = result[i+1].logicOpr
|
|
|
- i+=2
|
|
|
- c+=1
|
|
|
- }
|
|
|
-
|
|
|
- s(i)
|
|
|
+ l(root)
|
|
|
+ // console.log(result)
|
|
|
+ var i=0
|
|
|
+ var c=0
|
|
|
+ function s(i){
|
|
|
+ if(i<result.length){
|
|
|
+ if(i==0){
|
|
|
+ a.push(result[i])
|
|
|
+ i+=1
|
|
|
+ c+=1
|
|
|
}
|
|
|
+ if(i%2==1){
|
|
|
+ a.push(result[i])
|
|
|
+ console.log(a[c])
|
|
|
+ a[c]['logicOpr'] = result[i+1].logicOpr
|
|
|
+ i+=2
|
|
|
+ c+=1
|
|
|
}
|
|
|
s(i)
|
|
|
-
|
|
|
- console.log(a)
|
|
|
- this.data=a
|
|
|
+ }
|
|
|
+ }
|
|
|
+ s(i)
|
|
|
+ console.log(a)
|
|
|
+ this.dataList = a
|
|
|
},
|
|
|
getNode(node){
|
|
|
console.log(node)
|
|
|
-
|
|
|
},
|
|
|
normalizer(node) {
|
|
|
return {
|
|
@@ -329,5 +356,18 @@ export default {
|
|
|
.admin-department {
|
|
|
|
|
|
}
|
|
|
+.add {
|
|
|
+ display: flex;
|
|
|
+ justify-content: right;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+.listItem {
|
|
|
+ margin: 10px 0;
|
|
|
+}
|
|
|
+.normal {
|
|
|
|
|
|
+}
|
|
|
+.hidden {
|
|
|
+ opacity: 0;
|
|
|
+}
|
|
|
</style>
|