From 318dfd1b1ee33e824feed62c83a34fa2088198d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyiyousong=E2=80=9D?= <鈥測ousong_yi@foxmail.com鈥�> Date: Mon, 4 Dec 2023 09:37:17 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../permissionsModel/userManagement.vue | 56 ++++++++++++------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/userManagement.vue b/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/userManagement.vue index d6822006..b7816508 100644 --- a/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/userManagement.vue +++ b/portal-manager-ui/admin/src/views/thePlatformIsSet/components/permissionsModel/userManagement.vue @@ -8,10 +8,19 @@ </div> <div class="search_btn"> <a-space> + <a-select + v-model="userform.type" + placeholder="璇烽€夋嫨绫诲瀷" + style="width: 150px" + > + <a-select-option :value="1">鎸夌敤鎴峰悕</a-select-option> + <a-select-option :value="2">鎸夌敤鎴峰鍚�</a-select-option> + <a-select-option :value="3">鎸夌數璇�</a-select-option> + </a-select> <a-input v-model="userform.searchVal" style="width: 250px" - placeholder="璇疯緭鍏ョ敤鎴峰鍚�/鎵嬫満鍙锋悳绱�" + placeholder="璇疯緭鍏ュ叧閿瓧鎼滅储" > <a-icon slot="prefix" type="search" /> </a-input> @@ -172,6 +181,7 @@ export default { sourceInfoForm: {}, userDict: {}, // 瑙掕壊鏁版嵁 userform: { + type: 1, roleId: undefined, searchVal: undefined, }, @@ -197,11 +207,14 @@ export default { this.tableLoading = true; let realName = ""; let mobile = ""; + let loginName = ""; if (this.userform.searchVal) { - if (/^[\d]+$/.test(this.userform.searchVal)) { - mobile = "%" + this.userform.searchVal + "%"; - } else { + if (this.userform.type == 1) { + loginName = "%" + this.userform.searchVal + "%"; + } else if (this.userform.type == 2) { realName = "%" + this.userform.searchVal + "%"; + } else if (this.userform.type == 3) { + mobile = "%" + this.userform.searchVal + "%"; } } let res = await userList({ @@ -210,24 +223,27 @@ export default { roleId: this.userform.roleId, realName, mobile, + loginName, }); - let { dict, data, total } = res.data; - let { roleId } = dict; - if (!data.length && this.tablePagination.current > 1) { - this.tablePagination.current -= 1; - this.getUserList(); - } - this.userDict = roleId; - let { loginName } = this.userData; - if (this.loginNames.includes(loginName)) { - this.tableSourceData = data; - this.tablePagination.total = total; - } else { - this.tableSourceData = data.filter((v) => { - return !this.loginNames.includes(v.loginName); - }); + if (res.code == 1) { + let { dict, data, total } = res.data; + let { roleId } = dict; + if (!data.length && this.tablePagination.current > 1) { + this.tablePagination.current -= 1; + this.getUserList(); + } + this.userDict = roleId; + let { loginName } = this.userData; + if (this.loginNames.includes(loginName)) { + this.tableSourceData = data; + this.tablePagination.total = total; + } else { + this.tableSourceData = data.filter((v) => { + return !this.loginNames.includes(v.loginName); + }); - this.tablePagination.total = total - 3; + this.tablePagination.total = total - this.loginNames.length; + } } this.tableLoading = false; }, -- 2.24.3