Commit 31f6e0f62aa08bbbb312343d9bde5eed5ec609be
1 parent
4fab460c
集团管理员账号管理
Showing
1 changed file
with
29 additions
and
47 deletions
src/views/standard/setUp/account.vue
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | class="sel" | 52 | class="sel" |
| 53 | clearable | 53 | clearable |
| 54 | placeholder="选择学校" | 54 | placeholder="选择学校" |
| 55 | - v-model="query.schoolId" | 55 | + v-model="query.schoolIds" |
| 56 | :options="schoolList" | 56 | :options="schoolList" |
| 57 | :props="props" | 57 | :props="props" |
| 58 | :show-all-levels="false" | 58 | :show-all-levels="false" |
| @@ -82,9 +82,7 @@ | @@ -82,9 +82,7 @@ | ||
| 82 | <el-option label="禁用" :value="1"></el-option> | 82 | <el-option label="禁用" :value="1"></el-option> |
| 83 | </el-select> | 83 | </el-select> |
| 84 | <el-input | 84 | <el-input |
| 85 | - :placeholder=" | ||
| 86 | - role != 'ROLE_JITUAN' ? '请输入老师账号' : '请输入账号名称' | ||
| 87 | - " | 85 | + :placeholder="role != 'ROLE_JITUAN' ? '请输入老师账号' : '请输入账号'" |
| 88 | v-model="query.loginName" | 86 | v-model="query.loginName" |
| 89 | class="input-with-select sel" | 87 | class="input-with-select sel" |
| 90 | type="number" | 88 | type="number" |
| @@ -390,7 +388,7 @@ export default { | @@ -390,7 +388,7 @@ export default { | ||
| 390 | props: { multiple: true, checkStrictly: true }, | 388 | props: { multiple: true, checkStrictly: true }, |
| 391 | roleList: [], | 389 | roleList: [], |
| 392 | query: { | 390 | query: { |
| 393 | - schoolId: [], | 391 | + schoolIds: [], |
| 394 | roleId: "", | 392 | roleId: "", |
| 395 | available: "", | 393 | available: "", |
| 396 | loginName: "", | 394 | loginName: "", |
| @@ -681,10 +679,11 @@ export default { | @@ -681,10 +679,11 @@ export default { | ||
| 681 | } else if (type == 2) { | 679 | } else if (type == 2) { |
| 682 | this.query.roleId = ""; | 680 | this.query.roleId = ""; |
| 683 | this.query.available = ""; | 681 | this.query.available = ""; |
| 684 | - this.query.schoolId = []; | 682 | + this.query.schoolIds = []; |
| 685 | query.loginName = this.query.loginName; | 683 | query.loginName = this.query.loginName; |
| 686 | this.query.realName = ""; | 684 | this.query.realName = ""; |
| 687 | } else if (type == 3) { | 685 | } else if (type == 3) { |
| 686 | + this.query.schoolIds = []; | ||
| 688 | this.query.roleId = ""; | 687 | this.query.roleId = ""; |
| 689 | this.query.available = ""; | 688 | this.query.available = ""; |
| 690 | this.query.loginName = ""; | 689 | this.query.loginName = ""; |
| @@ -693,34 +692,20 @@ export default { | @@ -693,34 +692,20 @@ export default { | ||
| 693 | query = { ...this.query }; | 692 | query = { ...this.query }; |
| 694 | } | 693 | } |
| 695 | if (this.role == "ROLE_JITUAN") { | 694 | if (this.role == "ROLE_JITUAN") { |
| 696 | - query.regionIds = []; | ||
| 697 | - query.schoolIds = []; | ||
| 698 | - query.schoolId?.map((item) => { | 695 | + let isAll = false; |
| 696 | + query.schoolIds?.map((item) => { | ||
| 699 | if (item.length == 1) { | 697 | if (item.length == 1) { |
| 700 | - if (!query.regionIds.includes(item[0])) { | ||
| 701 | - query.regionIds.push(item[0]); | ||
| 702 | - } | ||
| 703 | - } else { | ||
| 704 | - if (!query.schoolIds.includes(item[1])) { | ||
| 705 | - query.schoolIds.push(item[1]); | ||
| 706 | - } | ||
| 707 | - if (query.regionIds.includes(item[0])) { | ||
| 708 | - query.regionIds.remove(item[0]); | ||
| 709 | - } | 698 | + isAll = true; |
| 710 | } | 699 | } |
| 711 | }); | 700 | }); |
| 712 | - if (type == 2) { | ||
| 713 | - this.query.realName = ""; | ||
| 714 | - query.loginName = this.query.loginName; | ||
| 715 | - } else if (type == 3) { | ||
| 716 | - this.query.loginName = ""; | ||
| 717 | - query.realName = this.query.realName; | ||
| 718 | - } else { | ||
| 719 | - query = { ...this.query }; | ||
| 720 | - } | 701 | + query.schoolIds = isAll |
| 702 | + ? null | ||
| 703 | + : query.schoolIds?.map((item) => { | ||
| 704 | + return item[1]; | ||
| 705 | + }); | ||
| 721 | delete query.roleId; | 706 | delete query.roleId; |
| 722 | - }else{ | ||
| 723 | - delete query.schoolId; | 707 | + } else { |
| 708 | + delete query.schoolIds; | ||
| 724 | } | 709 | } |
| 725 | return query; | 710 | return query; |
| 726 | }, | 711 | }, |
| @@ -728,18 +713,15 @@ export default { | @@ -728,18 +713,15 @@ export default { | ||
| 728 | let query = this.setQuery(type); | 713 | let query = this.setQuery(type); |
| 729 | this.loading = true; | 714 | this.loading = true; |
| 730 | this.tableData = []; | 715 | this.tableData = []; |
| 731 | - const { data, status, info } = | 716 | + let userPage = |
| 732 | this.role != "ROLE_JITUAN" | 717 | this.role != "ROLE_JITUAN" |
| 733 | - ? await this.$request.userPage({ | ||
| 734 | - ...query, | ||
| 735 | - page: this.page, | ||
| 736 | - size: this.size, | ||
| 737 | - }) | ||
| 738 | - : await this.$request.tenantUserPage({ | ||
| 739 | - ...query, | ||
| 740 | - page: this.page, | ||
| 741 | - size: this.size, | ||
| 742 | - }); | 718 | + ? this.$request.userPage |
| 719 | + : this.$request.tenantUserPage; | ||
| 720 | + const { data, status, info } = await userPage({ | ||
| 721 | + ...query, | ||
| 722 | + page: this.page, | ||
| 723 | + size: this.size, | ||
| 724 | + }); | ||
| 743 | 725 | ||
| 744 | this.loading = false; | 726 | this.loading = false; |
| 745 | if (status === 0) { | 727 | if (status === 0) { |
| @@ -769,14 +751,14 @@ export default { | @@ -769,14 +751,14 @@ export default { | ||
| 769 | .table-box { | 751 | .table-box { |
| 770 | padding: 0 20px; | 752 | padding: 0 20px; |
| 771 | } | 753 | } |
| 772 | -.answer-header{ | ||
| 773 | - .sel-box{ | ||
| 774 | - .sel{ | ||
| 775 | - margin-right:20px; | 754 | +.answer-header { |
| 755 | + .sel-box { | ||
| 756 | + .sel { | ||
| 757 | + margin-right: 20px; | ||
| 776 | } | 758 | } |
| 777 | } | 759 | } |
| 778 | - :deep(.el-input-group__append){ | ||
| 779 | - padding:0 20px 0 12px; | 760 | + :deep(.el-input-group__append) { |
| 761 | + padding: 0 20px 0 12px; | ||
| 780 | } | 762 | } |
| 781 | } | 763 | } |
| 782 | </style> | 764 | </style> |
| 783 | \ No newline at end of file | 765 | \ No newline at end of file |