Commit 31f6e0f62aa08bbbb312343d9bde5eed5ec609be

Authored by 梁保满
1 parent 4fab460c

集团管理员账号管理

src/views/standard/setUp/account.vue
... ... @@ -52,7 +52,7 @@
52 52 class="sel"
53 53 clearable
54 54 placeholder="选择学校"
55   - v-model="query.schoolId"
  55 + v-model="query.schoolIds"
56 56 :options="schoolList"
57 57 :props="props"
58 58 :show-all-levels="false"
... ... @@ -82,9 +82,7 @@
82 82 <el-option label="禁用" :value="1"></el-option>
83 83 </el-select>
84 84 <el-input
85   - :placeholder="
86   - role != 'ROLE_JITUAN' ? '请输入老师账号' : '请输入账号名称'
87   - "
  85 + :placeholder="role != 'ROLE_JITUAN' ? '请输入老师账号' : '请输入账号'"
88 86 v-model="query.loginName"
89 87 class="input-with-select sel"
90 88 type="number"
... ... @@ -390,7 +388,7 @@ export default {
390 388 props: { multiple: true, checkStrictly: true },
391 389 roleList: [],
392 390 query: {
393   - schoolId: [],
  391 + schoolIds: [],
394 392 roleId: "",
395 393 available: "",
396 394 loginName: "",
... ... @@ -681,10 +679,11 @@ export default {
681 679 } else if (type == 2) {
682 680 this.query.roleId = "";
683 681 this.query.available = "";
684   - this.query.schoolId = [];
  682 + this.query.schoolIds = [];
685 683 query.loginName = this.query.loginName;
686 684 this.query.realName = "";
687 685 } else if (type == 3) {
  686 + this.query.schoolIds = [];
688 687 this.query.roleId = "";
689 688 this.query.available = "";
690 689 this.query.loginName = "";
... ... @@ -693,34 +692,20 @@ export default {
693 692 query = { ...this.query };
694 693 }
695 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 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 706 delete query.roleId;
722   - }else{
723   - delete query.schoolId;
  707 + } else {
  708 + delete query.schoolIds;
724 709 }
725 710 return query;
726 711 },
... ... @@ -728,18 +713,15 @@ export default {
728 713 let query = this.setQuery(type);
729 714 this.loading = true;
730 715 this.tableData = [];
731   - const { data, status, info } =
  716 + let userPage =
732 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 726 this.loading = false;
745 727 if (status === 0) {
... ... @@ -769,14 +751,14 @@ export default {
769 751 .table-box {
770 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 764 </style>
783 765 \ No newline at end of file
... ...