|
@@ -98,9 +98,9 @@
|
|
show-checkbox
|
|
show-checkbox
|
|
node-key="id"
|
|
node-key="id"
|
|
default-expand-all
|
|
default-expand-all
|
|
- :default-checked-keys="selectList"
|
|
|
|
|
|
+ :default-checked-keys="defaultList"
|
|
:props="defaultProps"
|
|
:props="defaultProps"
|
|
- @check="selectTable"
|
|
|
|
|
|
+ @check-change="handleCheckChange"
|
|
ref="tree">
|
|
ref="tree">
|
|
</el-tree>
|
|
</el-tree>
|
|
</div>
|
|
</div>
|
|
@@ -168,8 +168,8 @@
|
|
children: 'children',
|
|
children: 'children',
|
|
label: 'menuName'
|
|
label: 'menuName'
|
|
},
|
|
},
|
|
- // 选择得参数
|
|
|
|
- selectList: [],
|
|
|
|
|
|
+ // 默认选择的参数
|
|
|
|
+ defaultList: [],
|
|
keyword: '',
|
|
keyword: '',
|
|
total: 0,
|
|
total: 0,
|
|
size: 20,
|
|
size: 20,
|
|
@@ -209,14 +209,13 @@
|
|
handleLimits(data) {
|
|
handleLimits(data) {
|
|
this.dialogLimits = true;
|
|
this.dialogLimits = true;
|
|
this.selectId = data.id;
|
|
this.selectId = data.id;
|
|
- this.selectList = [];
|
|
|
|
|
|
+ this.defaultList = [];
|
|
this.$axios.post(`http://121.37.169.186:8081/auth/getMenuByGroup?groupId=${data.id}`)
|
|
this.$axios.post(`http://121.37.169.186:8081/auth/getMenuByGroup?groupId=${data.id}`)
|
|
.then(res => {
|
|
.then(res => {
|
|
if(res.data.code === 10005) {
|
|
if(res.data.code === 10005) {
|
|
- this.selectList = [];
|
|
|
|
|
|
+ this.defaultList = [];
|
|
} else {
|
|
} else {
|
|
- this.selectList = res.data.data.split(',');
|
|
|
|
- this.$forceUpdate();
|
|
|
|
|
|
+ this.defaultList = res.data.data.split(',');
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -235,6 +234,7 @@
|
|
} else {
|
|
} else {
|
|
let arr = res.data.data.split(',');
|
|
let arr = res.data.data.split(',');
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
|
+ this.$refs.multipleTable.clearSelection();
|
|
for (let key in this.userList) {
|
|
for (let key in this.userList) {
|
|
for(let i in arr) {
|
|
for(let i in arr) {
|
|
if(this.userList[key]['id'] == arr[i]) {
|
|
if(this.userList[key]['id'] == arr[i]) {
|
|
@@ -267,9 +267,6 @@
|
|
});
|
|
});
|
|
this.dialogUsers = false;
|
|
this.dialogUsers = false;
|
|
},
|
|
},
|
|
- selectTable(data, checked, ) {
|
|
|
|
- this.selectList = checked.checkedKeys.concat(checked.halfCheckedKeys);
|
|
|
|
- },
|
|
|
|
// 新增角色
|
|
// 新增角色
|
|
onSubmit() {
|
|
onSubmit() {
|
|
this.$axios.post(`http://121.37.169.186:8081/group/add?groupName=${this.form.groupName}&remark=${this.form.remark}`)
|
|
this.$axios.post(`http://121.37.169.186:8081/group/add?groupName=${this.form.groupName}&remark=${this.form.remark}`)
|
|
@@ -282,8 +279,14 @@
|
|
this.reset();
|
|
this.reset();
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ handleCheckChange() {
|
|
|
|
+ this.selectList = [];
|
|
|
|
+ this.selectList = this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys());
|
|
|
|
+ },
|
|
// 权限分配
|
|
// 权限分配
|
|
limitSave() {
|
|
limitSave() {
|
|
|
|
+ // console.log(this.$refs.tree.getCheckedKeys());
|
|
|
|
+ // this.selectList = this.$refs.tree.getCheckedKeys();
|
|
let menuIds = this.selectList.join(',');
|
|
let menuIds = this.selectList.join(',');
|
|
menuIds += ',136';
|
|
menuIds += ',136';
|
|
this.$axios.post(`http://121.37.169.186:8081/auth/saveGroupMenu?groupId=${this.selectId}&menuIds=${menuIds}`)
|
|
this.$axios.post(`http://121.37.169.186:8081/auth/saveGroupMenu?groupId=${this.selectId}&menuIds=${menuIds}`)
|