From 740061502e04db1e64dd97c2a393ab8123885fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Thu, 7 Sep 2023 18:42:24 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=E6=96=B0=E5=A2=9E=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=E7=99=BB=E5=BD=95ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/login.scss | 12 ++- src/assets/styles/variables.module.scss | 2 +- src/components/SvgIcon/index.vue | 19 ++-- src/i18n/lang/zh-cn.json | 2 +- src/i18n/pages/login/en.json | 9 +- src/i18n/pages/login/zh-cn.json | 9 +- src/i18n/pages/login/zh-tw.json | 9 +- src/settings.js | 12 +-- src/views/components/Login/oauthLogin.vue | 43 +++++++++ src/views/components/Login/phoneLogin.vue | 106 ++++++++++++++++++++++ src/views/index_v1.vue | 9 +- src/views/login.vue | 87 ++++++++---------- src/views/register.vue | 33 +++---- 13 files changed, 254 insertions(+), 98 deletions(-) create mode 100644 src/views/components/Login/oauthLogin.vue create mode 100644 src/views/components/Login/phoneLogin.vue diff --git a/src/assets/styles/login.scss b/src/assets/styles/login.scss index 0976eda..4b31438 100644 --- a/src/assets/styles/login.scss +++ b/src/assets/styles/login.scss @@ -15,22 +15,23 @@ background: #ffffff; border-radius: 6px; width: var(--base-login-width); + position: relative; } } .title { - margin: 0px auto 30px auto; + margin: 10px auto 30px auto; text-align: center; // color: #fff; } .login-form { - padding: 35px 15px 5px 15px; + padding: 15px 25px 5px 25px; position: relative; - height: 300px; + height: 210px; .input-icon { - height: 39px; + height: 30px; width: 14px; margin-left: 0px; } @@ -115,3 +116,6 @@ align-items: center; justify-content: space-around; } + +@media screen and (max-width: 500px) { +} diff --git a/src/assets/styles/variables.module.scss b/src/assets/styles/variables.module.scss index 5645675..8751989 100644 --- a/src/assets/styles/variables.module.scss +++ b/src/assets/styles/variables.module.scss @@ -20,7 +20,7 @@ $panGreen: #30b08f; --base-tags-height: 34px; --base-header-height: 50px; //登录框宽度 - --base-login-width: 320px; + --base-login-width: 360px; } /***侧边栏深色配置***/ diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue index 44580f8..63e2860 100644 --- a/src/components/SvgIcon/index.vue +++ b/src/components/SvgIcon/index.vue @@ -7,17 +7,17 @@ export default defineComponent({ name: { type: String, required: true, - default: '', + default: '' }, className: { type: String, - default: '', + default: '' }, // svg 颜色 color: { type: String, - default: '', - }, + default: '' + } }, setup(props) { if (props.name?.startsWith('ele')) { @@ -25,9 +25,9 @@ export default defineComponent({ h( 'i', { - class: 'el-icon', + class: 'el-icon' }, - [h(resolveComponent(props.name.replace('ele-', '')))], + [h(resolveComponent(props.name.replace('ele-', '')))] ) } else if (props.name != undefined && props.name != '') { return () => @@ -38,16 +38,17 @@ export default defineComponent({ 'aria-hidden': true, style: `color: ${props.color}`, class: `svg-icon ${props.className}`, + 'shape-rendering': 'geometricPrecision' }, h('use', { 'xlink:href': `#icon-${props.name}`, - fill: `${props.color}`, - }), + fill: `${props.color}` + }) ) } else { return () => h('i') } - }, + } }) diff --git a/src/i18n/lang/zh-cn.json b/src/i18n/lang/zh-cn.json index 7d93791..219db2d 100644 --- a/src/i18n/lang/zh-cn.json +++ b/src/i18n/lang/zh-cn.json @@ -90,7 +90,7 @@ "topNav": "顶部导航", "commonFuncs": "常用功能", "openWatermark": "开启水印", - "workTime": "今日工作时长(分)", + "workTime": "今日工作时长", "onlineClientNum": "在线设备数" }, "common": { diff --git a/src/i18n/pages/login/en.json b/src/i18n/pages/login/en.json index b543a26..d4fa6c9 100644 --- a/src/i18n/pages/login/en.json +++ b/src/i18n/pages/login/en.json @@ -11,6 +11,13 @@ "invalidSession": "Invalid session, or session has expired, please log in again.", "otherLoginWay": "Other", "register": "Sign up now", - "forgotPwd": "forget" + "forgotPwd": "forget", + "loginway1": "account", + "loginway2": "Phone", + "loginway3": "Scan code", + "phoneCode": "Please enter SMS verification code", + "sendPhoneCode": "Send", + "input_phoneNum": "Please enter phone number", + "tip_scan_code": "Please use the mobile app to scan the code to log in" } } diff --git a/src/i18n/pages/login/zh-cn.json b/src/i18n/pages/login/zh-cn.json index 7680439..1942b43 100644 --- a/src/i18n/pages/login/zh-cn.json +++ b/src/i18n/pages/login/zh-cn.json @@ -11,6 +11,13 @@ "invalidSession": "无效的会话,或者会话已过期,请重新登录。", "otherLoginWay": "其他登录方式", "register": "立即注册", - "forgotPwd": "忘记密码" + "forgotPwd": "忘记密码", + "phoneCode": "请输入短信验证码", + "sendPhoneCode": "发送验证码", + "loginway1": "账号密码", + "loginway2": "手机号", + "loginway3": "扫码登录", + "input_phoneNum": "请输入手机号", + "tip_scan_code": "请使用移动端app扫码登录" } } diff --git a/src/i18n/pages/login/zh-tw.json b/src/i18n/pages/login/zh-tw.json index 662a95a..1beb434 100644 --- a/src/i18n/pages/login/zh-tw.json +++ b/src/i18n/pages/login/zh-tw.json @@ -11,6 +11,13 @@ "invalidSession": "無效的會話,或者會話已過期,請重新登錄。", "otherLoginWay": "其他登錄方式", "register": "註冊", - "forgotPwd": "忘記密碼" + "forgotPwd": "忘記密碼", + "loginway1": "賬號密碼", + "loginway2": "手機號", + "loginway3": "掃碼登錄", + "phoneCode": "請輸入短信驗證碼", + "sendPhoneCode": "發送驗證碼", + "input_phoneNum": "請輸入手機號", + "tip_scan_code": "請使用移動端app掃碼登錄" } } diff --git a/src/settings.js b/src/settings.js index c7c67ac..77533c5 100644 --- a/src/settings.js +++ b/src/settings.js @@ -71,13 +71,13 @@ export default { /** * 是否显示其他登录 */ - showOtherLogin: false, + showOtherLogin: true, /** * 默认大小 */ - defaultSize: 'default', - /** - * 默认语言 - */ - defaultLang: 'zh-cn' + defaultSize: 'default', + /** + * 默认语言 + */ + defaultLang: 'zh-cn' } diff --git a/src/views/components/Login/oauthLogin.vue b/src/views/components/Login/oauthLogin.vue new file mode 100644 index 0000000..5076cca --- /dev/null +++ b/src/views/components/Login/oauthLogin.vue @@ -0,0 +1,43 @@ + + + {{ $t('login.otherLoginWay') }} + + + + + + + diff --git a/src/views/components/Login/phoneLogin.vue b/src/views/components/Login/phoneLogin.vue new file mode 100644 index 0000000..310339a --- /dev/null +++ b/src/views/components/Login/phoneLogin.vue @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + {{ $t('login.sendPhoneCode') }} + + + + + + + + + + + + + + + + + + {{ $t('login.btnLogin') }} + 登 录 中... + + + + + + + + diff --git a/src/views/index_v1.vue b/src/views/index_v1.vue index bea6d31..e1c2bd6 100644 --- a/src/views/index_v1.vue +++ b/src/views/index_v1.vue @@ -31,7 +31,7 @@ {{ currentTime }} {{ weekName }} - + @@ -98,6 +98,10 @@ import PieChart from './dashboard/PieChart' import BarChart from './dashboard/BarChart' // import WordCloudChat from './dashboard/WordCloud.vue' import CommonMenu from './components/CommonMenu' +import dayjs from 'dayjs' +// 时间插件 +import duration from 'dayjs/plugin/duration' +dayjs.extend(duration) import useUserStore from '@/store/modules/user' import useSocketStore from '@/store/modules/socket' @@ -144,6 +148,9 @@ handleSetLineChartData('newVisitis') function handleAdd() { proxy.$modal.msg('请通过搜索添加') } +function workTimeFormatter(val) { + return dayjs.duration(val * 60, 'second').format('HH时mm分') +}