refactor:国际化锁屏

This commit is contained in:
PZ688 2025-02-28 22:25:53 +08:00
parent ac9f4cf930
commit 6dfec2b75e

View File

@ -21,7 +21,7 @@
</div> </div>
<div class="layout-lock-screen-date-top"> <div class="layout-lock-screen-date-top">
<SvgIcon name="ele-Top" /> <SvgIcon name="ele-Top" />
<div class="layout-lock-screen-date-top-text">上滑解锁</div> <div class="layout-lock-screen-date-top-text">{{ $t('message.layout.unlock') }}</div>
</div> </div>
</div> </div>
<transition name="el-zoom-in-center"> <transition name="el-zoom-in-center">
@ -33,11 +33,11 @@
<div class="layout-lock-screen-login-box-name">{{ userInfos.account }}</div> <div class="layout-lock-screen-login-box-name">{{ userInfos.account }}</div>
<div v-if="state.showMessage" class="layout-lock-screen-login-box-message"> <div v-if="state.showMessage" class="layout-lock-screen-login-box-message">
<span>{{ state.message }}</span> <span>{{ state.message }}</span>
<el-button style="max-width: 80px; margin-top: 20px" size="default" @click="hideMessage"> 确认 </el-button> <el-button style="max-width: 80px; margin-top: 20px" size="default" @click="hideMessage"> {{$t('message.layout.confirm')}} </el-button>
</div> </div>
<div v-else class="layout-lock-screen-login-box-value"> <div v-else class="layout-lock-screen-login-box-value">
<el-input <el-input
placeholder="请输入密码" :placeholder="needPassword"
:type="state.isShowPassword ? 'text' : 'password'" :type="state.isShowPassword ? 'text' : 'password'"
ref="layoutLockScreenInputRef" ref="layoutLockScreenInputRef"
size="default" size="default"
@ -85,6 +85,12 @@ import { feature, getAPI } from '/@/utils/axios-utils';
import { SysAuthApi } from '/@/api-services'; import { SysAuthApi } from '/@/api-services';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { loadSysInfo } from '/@/utils/sysInfo'; import { loadSysInfo } from '/@/utils/sysInfo';
import { useI18n } from 'vue-i18n';
const { t,locale } = useI18n();
const needPassword = ref('');
needPassword.value = t('message.layout.needPassword');
// //
const layoutLockScreenDateRef = ref<HtmlType>(); const layoutLockScreenDateRef = ref<HtmlType>();
const layoutLockScreenInputRef = ref(); const layoutLockScreenInputRef = ref();
@ -171,7 +177,7 @@ const initGetElement = () => {
const initTime = () => { const initTime = () => {
state.time.hm = formatDate(new Date(), 'HH:MM'); state.time.hm = formatDate(new Date(), 'HH:MM');
state.time.s = formatDate(new Date(), 'SS'); state.time.s = formatDate(new Date(), 'SS');
state.time.mdq = formatDate(new Date(), 'mm月dd日WWW'); state.time.mdq = formatDate(new Date(), 'mm-ddWWW');
}; };
// //
const initSetTime = () => { const initSetTime = () => {