|
@@ -21,7 +21,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="功能权限" align="center" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-for="item in scope.row.functionList">{{item.name}}
|
|
|
+ <span v-for="item in scope.row.functionList" :key="item.id">{{item.name}}
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -78,7 +78,7 @@
|
|
|
<el-table-column label="功能名称" align="left" prop="name">
|
|
|
<template slot-scope="scope">
|
|
|
<el-checkbox-group v-model="checkList" style="display:inline-block" @change="handleCheckedCitiesChange">
|
|
|
- <el-checkbox :label="scope.row.id" @change="getFunInfo(scope.row)"
|
|
|
+ <el-checkbox :label="scope.row.id" :checked="checked" @change="getFunInfo(scope.row)"
|
|
|
>
|
|
|
{{scope.row.name}}
|
|
|
</el-checkbox>
|
|
@@ -87,8 +87,13 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="(permissionData.filter(item=>item.functionId == scope.row.id))[0]">{{(permissionData.filter(item=>item.functionId == scope.row.id))[0].permissionData.name}}</span>
|
|
|
- <i v-if="checkList.filter(item=>item==scope.row.id)[0]" class="el-icon-plus" @click="premissVisibale(scope.row)">添加</i>
|
|
|
+ <span v-if="checkList.filter(item=>item==scope.row.id)[0]">
|
|
|
+ <span v-if="(permissionData.filter(item=>item.functionId == scope.row.id))[0]">{{(permissionData.filter(item=>item.functionId == scope.row.id))[0].permissionData.name}}</span>
|
|
|
+ <el-link style="margin-left: 10px" :underline="false" v-if="(permissionData.filter(item=>item.functionId == scope.row.id))[0]" @click="premissVisibale(scope.row)">修改</el-link>
|
|
|
+ <el-link style="margin-left:10px" :underline="false" v-else-if="checkList.filter(item=>item==scope.row.id)[0]" @click="premissVisibale(scope.row)">添加</el-link>
|
|
|
+ </span>
|
|
|
+
|
|
|
+
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -117,7 +122,6 @@
|
|
|
<div style="height: 500px;">
|
|
|
<DataPermission
|
|
|
:fun="fun"
|
|
|
-
|
|
|
@getPremissData="getPremissData"
|
|
|
>
|
|
|
</DataPermission>
|
|
@@ -190,28 +194,20 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getPremissData(id, name, data) {
|
|
|
- console.log(id, name, data)
|
|
|
- // for(var i = 0; i<this.functionList.length;i++){
|
|
|
- // for(var j=0;j<this.functionList[i].children.length;j++){
|
|
|
- // if(this.functionList[i].children[j].id==id){
|
|
|
- // this.functionList[i].children[j].pdata = data.name
|
|
|
- // }else{
|
|
|
- // if(this.functionList[i].children[j].hasOwnProperty('children')){
|
|
|
-
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- this.pdata={
|
|
|
- functionId:id,
|
|
|
- permissionData:data
|
|
|
+ // console.log(id, name, data)
|
|
|
+ this.pdata={
|
|
|
+ functionId:id,
|
|
|
+ permissionData:data
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
- premissSubmit() {
|
|
|
- this.permissionData.push(this.pdata)
|
|
|
+ premissSubmit() {
|
|
|
+ if (this.pdata.permissionData) {
|
|
|
+ this.permissionData.push(this.pdata)
|
|
|
+ } else {
|
|
|
+ this.permissionData.shift()
|
|
|
+ }
|
|
|
+
|
|
|
this.permissVisible=false
|
|
|
- // console.log('')
|
|
|
},
|
|
|
getFunInfo(val) {
|
|
|
this.fun = val
|
|
@@ -244,9 +240,10 @@ export default {
|
|
|
this.visible = true
|
|
|
this.ruleForm = { ...row }
|
|
|
},
|
|
|
- premissVisibale() {
|
|
|
+ premissVisibale(val) {
|
|
|
this.permissTitle = '数据权限管理'
|
|
|
this.permissVisible = true
|
|
|
+ this.fun = val
|
|
|
},
|
|
|
close() {
|
|
|
this.visible = false
|
|
@@ -260,18 +257,7 @@ export default {
|
|
|
this.queryParams.current = val;
|
|
|
this.getList();
|
|
|
},
|
|
|
- getDataList(val){
|
|
|
- console.log(val,this.ruleForm.function )
|
|
|
- // var functionList = {
|
|
|
- // functions:this.ruleForm.function
|
|
|
- // }
|
|
|
- if(val==false){
|
|
|
- this.$api.getDataList({functionList:this.ruleForm.function}).then(response => {
|
|
|
- this.dataList = response.data
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
+
|
|
|
getFunctionList() {
|
|
|
this.$api.getFunctionList().then(response => {
|
|
|
this.functionList = response.data
|
|
@@ -351,4 +337,7 @@ export default {
|
|
|
.permiss {
|
|
|
height: 2000px;
|
|
|
}
|
|
|
+el-link {
|
|
|
+ margin: auto 10px;
|
|
|
+}
|
|
|
</style>
|