|
@@ -14,8 +14,10 @@
|
|
ref="dataTable"
|
|
ref="dataTable"
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
:data="tableData"
|
|
:data="tableData"
|
|
|
|
+ max-height="370"
|
|
border
|
|
border
|
|
- @select="changeData"
|
|
|
|
|
|
+ @expand-change="getNode"
|
|
|
|
+ @select="changeData"
|
|
header-row-class-name="custom-table-header"
|
|
header-row-class-name="custom-table-header"
|
|
>
|
|
>
|
|
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
|
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
|
@@ -33,8 +35,8 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
- <el-dialog :title="title" :visible.sync="visible" width="800px" :before-close="close" :append-to-body="true">
|
|
|
|
- <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" label-position="left">
|
|
|
|
|
|
+ <el-dialog :title="title" :visible.sync="visible" width="900px" :before-close="close" :append-to-body="true">
|
|
|
|
+ <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" label-position="left">
|
|
<el-form-item label="所属功能" prop="function">
|
|
<el-form-item label="所属功能" prop="function">
|
|
<el-input v-model="ruleForm.function" size="small" :readonly="true" placeholder="请输入所属功能"></el-input>
|
|
<el-input v-model="ruleForm.function" size="small" :readonly="true" placeholder="请输入所属功能"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -43,43 +45,45 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="数据权限">
|
|
<el-form-item label="数据权限">
|
|
<template>
|
|
<template>
|
|
- <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 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-option
|
|
|
|
- v-for="item in dictionaries.LOGIC_OPERATOR"
|
|
|
|
- :key="item.dictChildValue"
|
|
|
|
- :label="item.dictChildLabel"
|
|
|
|
- :value="item.dictChildValue">
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </span>
|
|
|
|
- </el-col>
|
|
|
|
-
|
|
|
|
- <el-col :span="7">
|
|
|
|
- <el-select v-model="item.field">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in dictionaries.dataDict"
|
|
|
|
- :key="item.dataSourceField"
|
|
|
|
- :label="item.dataSourceName"
|
|
|
|
- :value="item.dataSourceField">
|
|
|
|
- </el-option>
|
|
|
|
|
|
+ <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 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-option
|
|
|
|
+ v-for="item in dictionaries.LOGIC_OPERATOR"
|
|
|
|
+ :key="item.dictChildValue"
|
|
|
|
+ :label="item.dictChildLabel"
|
|
|
|
+ :value="item.dictChildValue">
|
|
|
|
+ </el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- </el-col>
|
|
|
|
- <el-col :span="3" style="padding:0">
|
|
|
|
- <el-select v-model="item.opr">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in dictionaries.OPERATOR"
|
|
|
|
- :key="item.dictChildValue"
|
|
|
|
- :label="item.dictChildLabel"
|
|
|
|
- :value="item.dictChildValue">
|
|
|
|
|
|
+ </span>
|
|
|
|
+ </el-col>
|
|
|
|
+
|
|
|
|
+ <el-col :span="7">
|
|
|
|
+ <el-select v-model="item.field">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in dictionaries.dataDict"
|
|
|
|
+ :key="item.dataSourceField"
|
|
|
|
+ :label="item.dataSourceName"
|
|
|
|
+ :value="item.dataSourceField">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="3" style="padding:0">
|
|
|
|
+ <el-select v-model="item.opr">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in dictionaries.OPERATOR"
|
|
|
|
+ :key="item.dictChildValue"
|
|
|
|
+ :label="item.dictChildLabel"
|
|
|
|
+ :value="item.dictChildValue">
|
|
</el-option>
|
|
</el-option>
|
|
- </el-select>
|
|
|
|
- </el-col>
|
|
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-col>
|
|
<el-col :span="7">
|
|
<el-col :span="7">
|
|
<el-select v-model="item.value"
|
|
<el-select v-model="item.value"
|
|
filterable
|
|
filterable
|
|
@@ -124,11 +128,13 @@ export default {
|
|
Treeselect,
|
|
Treeselect,
|
|
TreeItem
|
|
TreeItem
|
|
},
|
|
},
|
|
|
|
+ props: [
|
|
|
|
+ 'functionId',
|
|
|
|
+ 'functionName',
|
|
|
|
+ 'functionInfo'
|
|
|
|
+ ],
|
|
data() {
|
|
data() {
|
|
name: 'DataPermission'
|
|
name: 'DataPermission'
|
|
- props: {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
return {
|
|
return {
|
|
options:[{label:'你好',value:1},{label:'你好1',value:2},{label:'你好2',value:3}],
|
|
options:[{label:'你好',value:1},{label:'你好1',value:2},{label:'你好2',value:3}],
|
|
visible: false,
|
|
visible: false,
|
|
@@ -139,7 +145,10 @@ export default {
|
|
title: '',
|
|
title: '',
|
|
show:false,
|
|
show:false,
|
|
disabled:false,
|
|
disabled:false,
|
|
- lastName:'',
|
|
|
|
|
|
+ lastName: '',
|
|
|
|
+ funId: this.functionId,
|
|
|
|
+ funName: this.functionName,
|
|
|
|
+ funInfo: this.functionInfo,
|
|
functionLis: [],
|
|
functionLis: [],
|
|
multipleSelection: [],
|
|
multipleSelection: [],
|
|
queryParams: {
|
|
queryParams: {
|
|
@@ -155,45 +164,17 @@ export default {
|
|
parentId: [{ required: true, message: '请选择所属部门', trigger: 'change' },],
|
|
parentId: [{ required: true, message: '请选择所属部门', trigger: 'change' },],
|
|
},
|
|
},
|
|
list:[],
|
|
list:[],
|
|
-
|
|
|
|
- dataList:
|
|
|
|
- {
|
|
|
|
- "nodeType": "logic",
|
|
|
|
- "logicOpr": "or",
|
|
|
|
- "left":{
|
|
|
|
- "nodeType": "logic",
|
|
|
|
- "logicOpr": "and",
|
|
|
|
- "left": {
|
|
|
|
- "nodeType": "exp",
|
|
|
|
- "field": "POSITION_DESCRIPTION",
|
|
|
|
- "opr": "=",
|
|
|
|
- "value": "'总经理1'"
|
|
|
|
- },
|
|
|
|
- "right": {
|
|
|
|
- "nodeType": "exp",
|
|
|
|
- "field": "POSITION_DESCRIPTION",
|
|
|
|
- "opr": "=",
|
|
|
|
- "value": "'总经理2'"
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "right": {
|
|
|
|
- "nodeType": "exp",
|
|
|
|
- "field": "POSITION_DESCRIPTION",
|
|
|
|
- "opr": "=",
|
|
|
|
- "value": "'总经理3'"
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
this.getList()
|
|
this.getList()
|
|
this.getFunctionList()
|
|
this.getFunctionList()
|
|
- // this.ListToTree()
|
|
|
|
|
|
+ this.funId = 6
|
|
|
|
+ // this.$emit('getPremissData', this.funId)
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
dictionaries() {
|
|
dictionaries() {
|
|
@@ -205,7 +186,14 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- changeData(selection,row){
|
|
|
|
|
|
+ handleSelectionChange(val) {
|
|
|
|
+ this.multipleSelection = val;
|
|
|
|
+ if (val.length > 0) {
|
|
|
|
+ this.$emit('getPremissData', this.funId, this.funName, val[0])
|
|
|
|
+ }
|
|
|
|
+ // console.log(val[0])
|
|
|
|
+ },
|
|
|
|
+ changeData(selection,row){
|
|
if (selection.length > 1) {
|
|
if (selection.length > 1) {
|
|
const del_row = selection.shift()
|
|
const del_row = selection.shift()
|
|
this.$refs.dataTable.toggleRowSelection(del_row, false)
|
|
this.$refs.dataTable.toggleRowSelection(del_row, false)
|
|
@@ -220,7 +208,6 @@ export default {
|
|
this.list.splice(i, 1)
|
|
this.list.splice(i, 1)
|
|
},
|
|
},
|
|
ListToTree(){
|
|
ListToTree(){
|
|
- console.log(this.dataList)
|
|
|
|
var a =[]
|
|
var a =[]
|
|
if(this.list.length==1){
|
|
if(this.list.length==1){
|
|
a = this.list[0]
|
|
a = this.list[0]
|
|
@@ -235,14 +222,10 @@ export default {
|
|
a[i].nodeType='logic'
|
|
a[i].nodeType='logic'
|
|
a[i].right=this.list[i]
|
|
a[i].right=this.list[i]
|
|
a[i].logicOpr = this.list[i].logicOpr
|
|
a[i].logicOpr = this.list[i].logicOpr
|
|
- // delete a[i].right.logicOpr
|
|
|
|
- // delete a[i].left.logicOpr
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
console.log(a)
|
|
console.log(a)
|
|
this.ruleForm.rule = JSON.stringify(a[a.length-1])
|
|
this.ruleForm.rule = JSON.stringify(a[a.length-1])
|
|
- // this.TreeToList(a[a.length-1])
|
|
|
|
},
|
|
},
|
|
TreeToList(data){
|
|
TreeToList(data){
|
|
var root = data
|
|
var root = data
|
|
@@ -273,25 +256,23 @@ export default {
|
|
}
|
|
}
|
|
l(root)
|
|
l(root)
|
|
// console.log(result)
|
|
// 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)
|
|
|
|
|
|
+ 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)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
s(i)
|
|
s(i)
|
|
@@ -331,6 +312,7 @@ export default {
|
|
this.$api.getDataList(this.queryParams).then(response => {
|
|
this.$api.getDataList(this.queryParams).then(response => {
|
|
|
|
|
|
this.tableData = response.data
|
|
this.tableData = response.data
|
|
|
|
+ console.log(response.data)
|
|
this.total=response.pageColumn.total
|
|
this.total=response.pageColumn.total
|
|
this.loading = false
|
|
this.loading = false
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
@@ -341,6 +323,9 @@ export default {
|
|
this.$api.getFunctionList().then(response => {
|
|
this.$api.getFunctionList().then(response => {
|
|
this.functionList = response.data
|
|
this.functionList = response.data
|
|
})
|
|
})
|
|
|
|
+ console.log(this.funId)
|
|
|
|
+ console.log(this.functionName)
|
|
|
|
+ console.log(this.functionInfo)
|
|
},
|
|
},
|
|
submit() {
|
|
submit() {
|
|
this.$refs.ruleForm.validate((valid) => {
|
|
this.$refs.ruleForm.validate((valid) => {
|