|
@@ -145,9 +145,9 @@ export default {
|
|
|
deep: true,
|
|
|
},
|
|
|
roleType: {
|
|
|
- handler(msg) {
|
|
|
- if (msg == "account") {
|
|
|
- this.getRoleData("UserId");
|
|
|
+ handler (msg) {
|
|
|
+ if (msg == 'account') {
|
|
|
+ this.getRoleData('UserId', 'UserName');
|
|
|
}
|
|
|
if (msg == "roleByUpId") {
|
|
|
this.getRoleDataByUpId("roleId");
|
|
@@ -236,7 +236,7 @@ export default {
|
|
|
this.checkList = datas;
|
|
|
},
|
|
|
//获取列表
|
|
|
- async getRoleData(ids) {
|
|
|
+ async getRoleData (ids, names) {
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
const obj = {
|
|
@@ -254,8 +254,8 @@ export default {
|
|
|
this.arrsList.push(datas);
|
|
|
const arrs = this.arrsList.flat();
|
|
|
const msgs = _.unionBy(arrs, ids);
|
|
|
- msgs.forEach((item) => {
|
|
|
- item.name = item.UserName;
|
|
|
+ msgs.forEach(item => {
|
|
|
+ item.name = item[names]
|
|
|
});
|
|
|
this.dataList = msgs;
|
|
|
this.total = num;
|
|
@@ -275,17 +275,18 @@ export default {
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
const obj = {
|
|
|
- GroupIds: this.GroupIds,
|
|
|
+
|
|
|
+ GroupIds: this.GroupIds
|
|
|
};
|
|
|
let result = null;
|
|
|
- if (this.roleType == "roleByUpId") {
|
|
|
+ if (this.roleType == 'roleByUpId') {
|
|
|
result = await GetRoleByGroup(obj);
|
|
|
}
|
|
|
if (result.code === 0) {
|
|
|
const datas = result.returnData;
|
|
|
this.dataList = datas;
|
|
|
- this.dataList.forEach((item) => {
|
|
|
- item.name = item.RoleName;
|
|
|
+ this.dataList.forEach(item => {
|
|
|
+ item.name = item.RoleName
|
|
|
});
|
|
|
this.checkBoxs(this.dataList, "RoleId");
|
|
|
this.loading = false;
|
|
@@ -302,8 +303,8 @@ export default {
|
|
|
//滚动加载数据
|
|
|
load() {
|
|
|
this.pageNum += 1;
|
|
|
- if (this.roleType == "account") {
|
|
|
- this.getRoleData("UserId");
|
|
|
+ if (this.roleType == 'account') {
|
|
|
+ this.getRoleData('UserId', 'UserName');
|
|
|
}
|
|
|
},
|
|
|
},
|