From db345664a31b8bffd8df02382e800133c91ca5b8 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Thu, 16 Feb 2023 20:45:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=A1=A8=E5=8D=95=E6=8E=A7=E4=BB=B6=E5=B0=BA?= =?UTF-8?q?=E5=AF=B8=E5=A4=A7=E5=B0=8F=E7=9A=84=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/login/components/login-form.vue | 80 ++++++++++++------- .../src/views/monitor/log/operation/index.vue | 18 +++-- .../src/views/system/role/index.vue | 28 ++----- .../user/center/components/basic-info.vue | 33 +++++--- .../security-settings/update-email.vue | 6 +- .../security-settings/update-pwd.vue | 5 +- 6 files changed, 90 insertions(+), 80 deletions(-) diff --git a/continew-admin-ui/src/views/login/components/login-form.vue b/continew-admin-ui/src/views/login/components/login-form.vue index f009d18b..ddeaac50 100644 --- a/continew-admin-ui/src/views/login/components/login-form.vue +++ b/continew-admin-ui/src/views/login/components/login-form.vue @@ -7,6 +7,7 @@ :model="form" :rules="rules" layout="vertical" + size="large" class="login-form" @submit="handleLogin" > @@ -15,7 +16,6 @@ v-model="form.username" :placeholder="$t('login.form.placeholder.username')" max-length="50" - size="large" > @@ -26,7 +26,6 @@ :placeholder="$t('login.form.placeholder.password')" max-length="32" allow-clear - size="large" > @@ -36,12 +35,15 @@ v-model="form.captcha" :placeholder="$t('login.form.placeholder.captcha')" allow-clear - size="large" style="width: 63%" > - + - + {{ $t('login.form.login') }} @@ -98,9 +105,15 @@ // 表单验证规则 rules: computed((): Record => { return { - username: [{ required: true, message: t('login.form.error.required.username') }], - password: [{ required: true, message: t('login.form.error.required.password') }], - captcha: [{ required: true, message: t('login.form.error.required.captcha') }], + username: [ + { required: true, message: t('login.form.error.required.username') }, + ], + password: [ + { required: true, message: t('login.form.error.required.password') }, + ], + captcha: [ + { required: true, message: t('login.form.error.required.captcha') }, + ], }; }), }); @@ -123,35 +136,42 @@ * @param errors 表单验证错误 * @param values 表单数据 */ - const handleLogin = ({ errors, values, }: { + const handleLogin = ({ + errors, + values, + }: { errors: Record | undefined; values: Record; }) => { if (loading.value) return; if (!errors) { loading.value = true; - loginStore.login({ - username: values.username, - password: encryptByRsa(values.password) || '', - captcha: values.captcha, - uuid: values.uuid - }).then(() => { - const { redirect, ...othersQuery } = router.currentRoute.value.query; - router.push({ - name: (redirect as string) || 'Workplace', - query: { - ...othersQuery, - }, + loginStore + .login({ + username: values.username, + password: encryptByRsa(values.password) || '', + captcha: values.captcha, + uuid: values.uuid, + }) + .then(() => { + const { redirect, ...othersQuery } = router.currentRoute.value.query; + router.push({ + name: (redirect as string) || 'Workplace', + query: { + ...othersQuery, + }, + }); + const { rememberMe } = loginConfig.value; + const { username } = values; + loginConfig.value.username = rememberMe ? username : ''; + proxy.$message.success(t('login.form.login.success')); + }) + .catch(() => { + getCaptcha(); + }) + .finally(() => { + loading.value = false; }); - const { rememberMe } = loginConfig.value; - const { username } = values; - loginConfig.value.username = rememberMe ? username : ''; - proxy.$message.success(t('login.form.login.success')); - }).catch(() => { - getCaptcha(); - }).finally(() => { - loading.value = false; - }); } }; diff --git a/continew-admin-ui/src/views/monitor/log/operation/index.vue b/continew-admin-ui/src/views/monitor/log/operation/index.vue index d7e330c5..4ca2b409 100644 --- a/continew-admin-ui/src/views/monitor/log/operation/index.vue +++ b/continew-admin-ui/src/views/monitor/log/operation/index.vue @@ -12,7 +12,7 @@ v-model="queryParams.description" placeholder="输入操作内容搜索" allow-clear - style="width: 150px;" + style="width: 150px" @press-enter="handleQuery" /> @@ -22,7 +22,7 @@ :options="statusOptions" placeholder="操作状态搜索" allow-clear - style="width: 150px;" + style="width: 150px" /> @@ -128,12 +128,14 @@ */ const getList = (params: OperationLogParam = { ...queryParams.value }) => { loading.value = true; - listOperationLog(params).then((res) => { - operationLogList.value = res.data.list; - total.value = res.data.total; - }).finally(() => { - loading.value = false; - }); + listOperationLog(params) + .then((res) => { + operationLogList.value = res.data.list; + total.value = res.data.total; + }) + .finally(() => { + loading.value = false; + }); }; getList(); diff --git a/continew-admin-ui/src/views/system/role/index.vue b/continew-admin-ui/src/views/system/role/index.vue index 8d8d354f..6e29c44a 100644 --- a/continew-admin-ui/src/views/system/role/index.vue +++ b/continew-admin-ui/src/views/system/role/index.vue @@ -188,27 +188,18 @@ @ok="handleOk" @cancel="handleCancel" > - + - + - + @@ -235,7 +225,6 @@ placeholder="请输入角色排序" :min="1" mode="button" - size="large" /> @@ -247,7 +236,6 @@ minRows: 3, }" show-word-limit - size="large" /> @@ -281,12 +269,8 @@ - - 启用 - - - 禁用 - + 启用 + 禁用 @@ -580,7 +564,7 @@ }; /** - * 多选 + * 已选择的数据行发生改变时触发 * * @param rowKeys ID 列表 */ diff --git a/continew-admin-ui/src/views/system/user/center/components/basic-info.vue b/continew-admin-ui/src/views/system/user/center/components/basic-info.vue index c0460526..6c5a529f 100644 --- a/continew-admin-ui/src/views/system/user/center/components/basic-info.vue +++ b/continew-admin-ui/src/views/system/user/center/components/basic-info.vue @@ -5,6 +5,7 @@ :rules="rules" :label-col-props="{ span: 8 }" :wrapper-col-props="{ span: 16 }" + size="large" class="form" > @@ -12,14 +13,12 @@ v-model="form.username" :placeholder="$t('userCenter.basicInfo.form.placeholder.username')" max-length="50" - size="large" /> @@ -46,7 +45,7 @@