修改国际化

master
夜笙歌 2 years ago
parent e9e72e7f75
commit 15a2f90a46

@ -3,12 +3,14 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="/favicon.ico">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta content="webkit" name="renderer">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link href="/favicon.ico" rel="icon">
<title>若依管理系统</title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<!--[if lt IE 11]>
<script>window.location.href = '/html/ie.html';</script>
<![endif]-->
<style>
html,
body,
@ -201,15 +203,15 @@
</head>
<body>
<div id="app">
<div id="app">
<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
<div class="load_title">正在加载系统资源,请耐心等待</div>
</div>
</div>
<script type="module" src="/src/main.js"></script>
</div>
<script src="/src/main.js" type="module"></script>
</body>
</html>

@ -1,6 +1,14 @@
import request from '@/utils/request'
import Cookies from "js-cookie";
// 切换语言
export function cutLang() {
return request({
url: '/system/language/change',
method: 'get',
})
}
// 登录方法
export function login(username, password, code, uuid) {
const data = {

@ -17,20 +17,22 @@
<script setup>
import useAppStore from "@/store/modules/app";
import {useI18n} from "vue-i18n";
const {t} = useI18n();
const appStore = useAppStore();
const size = computed(() => appStore.size);
const route = useRoute();
const router = useRouter();
const { proxy } = getCurrentInstance();
const sizeOptions = ref([
{ label: "较大", value: "large" },
{ label: "默认", value: "default" },
{ label: "稍小", value: "small" },
{ label: t('sizeSelect.large'), value: "large" },
{ label: t('sizeSelect.default'), value: "default" },
{ label: t('sizeSelect.small'), value: "small" },
]);
function handleSetSize(size) {
proxy.$modal.loading("正在设置布局大小,请稍候...");
proxy.$modal.loading(t('sizeSelect.wait'));
appStore.setSize(size);
setTimeout("window.location.reload()", 1000);
}

@ -38,16 +38,41 @@ export default {
saveConfiguration: 'Save Config',
resetConfiguration: 'Reset Config',
},
profile:{
personalInfo:'Personal Info',
userName:'User Name',
phone:'Phone',
email:'Email',
department:'Department',
role:'Role',
creationDate:'Creation Date',
basicInformation:'Basic Information',
changePassword:'Change Password'
profile: {
personalInfo: 'Personal Info',
userName: 'User Name',
phone: 'Phone',
email: 'Email',
department: 'Department',
role: 'Role',
creationDate: 'Creation Date',
basicInformation: 'Basic Information',
changePassword: 'Change Password'
},
userInfo: {
username: 'username',
phone: 'phone',
email: 'email',
sex: 'sex',
male: 'male',
female: 'female'
},
userAvatar: {
uploadAvatar: 'Click to upload avatar',
choose: 'Choose',
submit: 'Submit',
ModifyAvatar: 'Modify Avatar'
},
resetPwd: {
oldPassword: 'Old Password',
newPassword: 'New Password',
confirmPassword: 'Confirm Password',
},
sizeSelect:{
large:'Large',
default:'Default',
small:'Small',
wait:'Please wait, setting layout size...',
},
option: {
refresh: 'refresh',
@ -61,12 +86,15 @@ export default {
cancel: 'cancel',
ok: 'ok',
hint: 'hint',
save: 'save',
close: 'close',
confirmDeletion: 'Are you sure to delete the data item whose {key} is {value}?',
modificationSuccessful: 'Modification Successful',
addedSuccessfully: 'Added Successfully',
successfullyDeleted: 'Successfully Deleted'
},
common: {
loadTitle:'Loading system resources, please be patient',
success: 'success',
show: 'show',
hide: 'hide',

@ -49,6 +49,31 @@ export default {
basicInformation:'基本资料',
changePassword:'修改密码'
},
userInfo:{
username:'用户昵称',
phone:'手机号码',
email:'邮箱',
sex:'性别',
male:'男',
female:'女'
},
userAvatar:{
uploadAvatar:'点击上传头像',
choose:'选择',
submit:'提 交',
ModifyAvatar:'修改头像'
},
resetPwd:{
oldPassword:'旧密码',
newPassword:'新密码',
confirmPassword:'确认密码',
},
sizeSelect:{
large:'较大',
default:'默认',
small:'稍小',
wait:'正在设置布局大小,请稍候...',
},
option: {
refresh: '刷新',
option: '操作',
@ -61,12 +86,15 @@ export default {
cancel: '取 消',
ok: '确 定',
hint: '提示',
save:'保存',
close:'关闭',
confirmDeletion: '是否确认删除%{key}为%{value}的数据项?',
modificationSuccessful: '修改成功',
addedSuccessfully: '新增成功',
successfullyDeleted: '删除成功'
},
common: {
loadTitle:'正在加载系统资源,请耐心等待',
success: '成功',
show: '显示',
hide: '隐藏',

@ -72,6 +72,7 @@
<script setup>
import {ElMessageBox} from 'element-plus'
import {cutLang} from "@/api/login";
import Breadcrumb from '@/components/Breadcrumb'
import TopNav from '@/components/TopNav'
import Hamburger from '@/components/Hamburger'
@ -91,7 +92,9 @@ const userStore = useUserStore()
const settingsStore = useSettingsStore()
const lang = (e) => {
Cookies.set('language', e)
location.reload()
cutLang().finally(() => {
setTimeout( () => location.reload(),10)
})
}
function toggleSideBar() {

@ -43,6 +43,7 @@ import ImagePreview from "@/components/ImagePreview"
import TreeSelect from '@/components/TreeSelect'
// 字典标签组件
import DictTag from '@/components/DictTag'
import {useI18n} from "vue-i18n";
const app = createApp(App)

@ -98,7 +98,7 @@
</template>
<script setup>
import {getCodeImg} from "@/api/login";
import {getCodeImg,cutLang} from "@/api/login";
import Cookies from "js-cookie";
import {decrypt, encrypt} from "@/utils/jsencrypt";
import useUserStore from '@/store/modules/user'
@ -108,7 +108,11 @@ import {useI18n} from 'vue-i18n';
const {t} = useI18n();
const lang = (e) => {
Cookies.set('language',e)
location.reload()
cutLang().finally(() => {
setTimeout( () => location.reload(),10)
})
}
const userStore = useUserStore()
const router = useRouter();

@ -1,24 +1,28 @@
<template>
<el-form ref="pwdRef" :model="user" :rules="rules" label-width="80px">
<el-form-item label="旧密码" prop="oldPassword">
<el-input v-model="user.oldPassword" placeholder="请输入旧密码" type="password" show-password />
<el-form ref="pwdRef" :model="user" :rules="rules" :label-width="isEN ? '160px': '80px'">
<el-form-item :label="t('resetPwd.oldPassword')" prop="oldPassword">
<el-input v-model="user.oldPassword" :placeholder="t('common.pleaseEnter') + t('resetPwd.oldPassword')" type="password" show-password />
</el-form-item>
<el-form-item label="新密码" prop="newPassword">
<el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password />
<el-form-item :label="t('resetPwd.newPassword')" prop="newPassword">
<el-input v-model="user.newPassword" :placeholder="t('common.pleaseEnter') + t('resetPwd.newPassword')" type="password" show-password />
</el-form-item>
<el-form-item label="确认密码" prop="confirmPassword">
<el-input v-model="user.confirmPassword" placeholder="请确认新密码" type="password" show-password/>
<el-form-item :label="t('resetPwd.confirmPassword')" prop="confirmPassword">
<el-input v-model="user.confirmPassword" :placeholder="t('common.pleaseEnter') + t('resetPwd.confirmPassword')" type="password" show-password/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submit"></el-button>
<el-button type="danger" @click="close"></el-button>
<el-button type="primary" @click="submit">{{ t('option.save') }}</el-button>
<el-button type="danger" @click="close">{{ t('option.close') }}</el-button>
</el-form-item>
</el-form>
</template>
<script setup>
import { updateUserPwd } from "@/api/system/user";
import {useI18n} from "vue-i18n";
import Cookies from "js-cookie";
const {t} = useI18n();
const isEN = (Cookies.get('language') || 'zhCn') === 'en'
const { proxy } = getCurrentInstance();
const user = reactive({

@ -1,6 +1,6 @@
<template>
<div class="user-info-head" @click="editCropper()">
<img :src="options.img" title="点击上传头像" class="img-circle img-lg" />
<img :src="options.img" :title="t('userAvatar.uploadAvatar')" class="img-circle img-lg" />
<el-dialog :title="title" v-model="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog">
<el-row>
<el-col :xs="24" :md="12" :style="{ height: '350px' }">
@ -33,7 +33,7 @@
:before-upload="beforeUpload"
>
<el-button>
选择
{{ t('userAvatar.choose') }}
<el-icon class="el-icon--right"><Upload /></el-icon>
</el-button>
</el-upload>
@ -51,7 +51,7 @@
<el-button icon="RefreshRight" @click="rotateRight()"></el-button>
</el-col>
<el-col :lg="{ span: 2, offset: 6 }" :md="2">
<el-button type="primary" @click="uploadImg()"> </el-button>
<el-button type="primary" @click="uploadImg()">{{ t('userAvatar.submit') }}</el-button>
</el-col>
</el-row>
</el-dialog>
@ -63,13 +63,15 @@ import "vue-cropper/dist/index.css";
import { VueCropper } from "vue-cropper";
import { uploadAvatar } from "@/api/system/user";
import useUserStore from "@/store/modules/user";
import {useI18n} from "vue-i18n";
const {t} = useI18n();
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const open = ref(false);
const visible = ref(false);
const title = ref("修改头像");
const title = ref(t('userAvatar.ModifyAvatar'));
//
const options = reactive({

@ -1,30 +1,32 @@
<template>
<el-form ref="userRef" :model="user" :rules="rules" label-width="80px">
<el-form-item label="用户昵称" prop="nickName">
<el-form-item :label="t('userInfo.username')" prop="nickName">
<el-input v-model="user.nickName" maxlength="30" />
</el-form-item>
<el-form-item label="手机号码" prop="phonenumber">
<el-form-item :label="t('userInfo.phone')" prop="phonenumber">
<el-input v-model="user.phonenumber" maxlength="11" />
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-form-item :label="t('userInfo.email')" prop="email">
<el-input v-model="user.email" maxlength="50" />
</el-form-item>
<el-form-item label="性别">
<el-form-item :label="t('userInfo.sex')">
<el-radio-group v-model="user.sex">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
<el-radio label="0">{{ t('userInfo.male') }}</el-radio>
<el-radio label="1">{{ t('userInfo.female') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submit"></el-button>
<el-button type="danger" @click="close"></el-button>
<el-button type="primary" @click="submit">{{ t('option.save') }}</el-button>
<el-button type="danger" @click="close">{{ t('option.close') }}</el-button>
</el-form-item>
</el-form>
</template>
<script setup>
import { updateUserProfile } from "@/api/system/user";
import {useI18n} from "vue-i18n";
const {t} = useI18n();
const props = defineProps({
user: {
type: Object

Loading…
Cancel
Save