From dfd9326efccded8dbcbab85e76bb0f0285e06445 Mon Sep 17 00:00:00 2001
From: wanggongfeng <1305282856@qq.com>
Date: Mon, 28 Mar 2022 15:07:18 +0800
Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=EF=BC=8C?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=80=E5=B1=9E=E9=83=A8=E9=97=A8=E6=9F=A5?=
=?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
(cherry picked from commit 86370d7cc1097218e426e0faa2ea0a54d753c924)
---
src/views/modules/sys/user.vue | 47 +++++++++++++++++++++++++++++-----
1 file changed, 41 insertions(+), 6 deletions(-)
diff --git a/src/views/modules/sys/user.vue b/src/views/modules/sys/user.vue
index 4f2d296f..450644ee 100644
--- a/src/views/modules/sys/user.vue
+++ b/src/views/modules/sys/user.vue
@@ -15,6 +15,15 @@
+
+
+
+
{{ $t('query') }}
@@ -89,28 +98,54 @@ export default {
username: '',
realname: '',
mobile: '',
- email: ''
- }
+ email: '',
+ deptId: ''
+ },
+ ids: [],
+ options: []
}
},
components: {
AddOrUpdate
},
+ created: function () {
+ this.getOptions()
+ },
+ watch: {
+ ids: function (val) {
+ if (val.length === 0) {
+ this.dataForm.deptId = ''
+ } else {
+ this.dataForm.deptId = this.ids[val.length - 1]
+ }
+ }
+ },
methods: {
+ getOptions () {
+ this.$http
+ .get(`/sys/user/deptOptions/getByLoginUser`)
+ .then(({ data: res }) => {
+ if (res.code !== 0) {
+ return this.$message.error(res.msg)
+ }
+ this.options = res.data.options
+ })
+ .catch(() => {})
+ },
btKeyUpUsername (e) {
- e.target.value = e.target.value.replace(/[`~!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】\\[\]、;‘’,。、\s+]/g, '')
+ e.target.value = e.target.value.replace(/[`~!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】\\[\]、;‘’,。、\s+]/g, '')
this.dataForm.username = e.target.value
},
btKeyUpRealname (e) {
- e.target.value = e.target.value.replace(/[`~!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】\\[\]、;‘’,。、\s+]/g, '')
+ e.target.value = e.target.value.replace(/[`~!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】\\[\]、;‘’,。、\s+]/g, '')
this.dataForm.realname = e.target.value
},
btKeyUpEmail (e) {
- e.target.value = e.target.value.replace(/[`~!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】\\[\]、;‘’,。、\s+]/g, '')
+ e.target.value = e.target.value.replace(/[`~!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】\\[\]、;‘’,。、\s+]/g, '')
this.dataForm.email = e.target.value
},
btKeyUpMobile (e) {
- e.target.value = e.target.value.replace(/[`~!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】\\[\]、;‘’,。、\s+]/g, '')
+ e.target.value = e.target.value.replace(/[`~!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】\\[\]、;‘’,。、\s+]/g, '')
this.dataForm.mobile = e.target.value
}
}