浏览代码

Merge branch 'master' of http://120.26.64.82:3000/BFFE/Foshan4A4.0

# Conflicts:
#	src/components/rolelist/index.vue
chenjun 3 年之前
父节点
当前提交
c49ec60d83
共有 1 个文件被更改,包括 13 次插入12 次删除
  1. 13 12
      src/components/rolelist/index.vue

+ 13 - 12
src/components/rolelist/index.vue

@@ -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');
       }
     },
   },