|
@@ -98,9 +98,9 @@
|
|
|
show-checkbox
|
|
|
node-key="id"
|
|
|
default-expand-all
|
|
|
- :default-checked-keys="selectList"
|
|
|
+ :default-checked-keys="defaultList"
|
|
|
:props="defaultProps"
|
|
|
- @check="selectTable"
|
|
|
+ @check-change="handleCheckChange"
|
|
|
ref="tree">
|
|
|
</el-tree>
|
|
|
</div>
|
|
@@ -168,6 +168,8 @@
|
|
|
children: 'children',
|
|
|
label: 'menuName'
|
|
|
},
|
|
|
+ // 默认选择的参数
|
|
|
+ defaultList: [],
|
|
|
// 选择得参数
|
|
|
selectList: [],
|
|
|
keyword: '',
|
|
@@ -178,7 +180,10 @@
|
|
|
// 用户列表
|
|
|
userList: [],
|
|
|
dialogUsers: false,
|
|
|
+ // 选择的列表
|
|
|
userSelect: [],
|
|
|
+ // 默认选择的列表
|
|
|
+ defaultUserList: [],
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -209,13 +214,13 @@
|
|
|
handleLimits(data) {
|
|
|
this.dialogLimits = true;
|
|
|
this.selectId = data.id;
|
|
|
- this.selectList = [];
|
|
|
+ this.defaultList = [];
|
|
|
this.$axios.post(`http://121.37.169.186:8081/auth/getMenuByGroup?groupId=${data.id}`)
|
|
|
.then(res => {
|
|
|
if(res.data.code === 10005) {
|
|
|
- this.selectList = [];
|
|
|
+ this.defaultList = [];
|
|
|
} else {
|
|
|
- this.selectList = res.data.data.split(',');
|
|
|
+ this.defaultList = res.data.data.split(',');
|
|
|
this.$forceUpdate();
|
|
|
}
|
|
|
})
|
|
@@ -224,16 +229,22 @@
|
|
|
handleUser(data) {
|
|
|
this.dialogUsers = true;
|
|
|
this.selectId = data.id;
|
|
|
+ this.defaultUserList = [];
|
|
|
this.$axios.post(`http://121.37.169.186:8081/auth/getAcountByGroup?groupId=${data.id}`)
|
|
|
.then(res => {
|
|
|
if(res.data.code === 10006) {
|
|
|
- this.userSelect = [];
|
|
|
+ this.defaultUserList = [];
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.multipleTable.clearSelection();
|
|
|
+ })
|
|
|
} else {
|
|
|
- let arr = res.data.data.split(',');
|
|
|
+ this.defaultUserList = res.data.data.split(',');
|
|
|
+ console.log(this.defaultUserList);
|
|
|
this.$nextTick(() => {
|
|
|
+ this.$refs.multipleTable.clearSelection();
|
|
|
for (let key in this.userList) {
|
|
|
- for(let i in arr) {
|
|
|
- if(this.userList[key]['id'] == arr[i]) {
|
|
|
+ for(let i in this.defaultUserList) {
|
|
|
+ if(this.userList[key]['id'] == this.defaultUserList[i]) {
|
|
|
this.$refs.multipleTable.toggleRowSelection(this.userList[key], true);
|
|
|
}
|
|
|
}
|
|
@@ -263,8 +274,9 @@
|
|
|
});
|
|
|
this.dialogUsers = false;
|
|
|
},
|
|
|
- selectTable(data, checked, ) {
|
|
|
- this.selectList = checked.checkedKeys.concat(checked.halfCheckedKeys);
|
|
|
+ handleCheckChange() {
|
|
|
+ this.selectList = [];
|
|
|
+ this.selectList = this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys());
|
|
|
},
|
|
|
// 新增角色
|
|
|
onSubmit() {
|
|
@@ -295,7 +307,13 @@
|
|
|
init() {
|
|
|
this.$axios.post(`http://121.37.169.186:8081/group/list?pageNum=${this.pageNum}&pageSize=${this.size}&searchStr=${this.keyword}`)
|
|
|
.then(res => {
|
|
|
- this.tableData = res.data.content;
|
|
|
+ let arr = [];
|
|
|
+ res.data.content.forEach(item => {
|
|
|
+ if(item.remark === this.typeCode) {
|
|
|
+ arr.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.tableData = arr;
|
|
|
this.total = res.data.totalElements;
|
|
|
})
|
|
|
},
|