style: 系统设置多语言

This commit is contained in:
TsMask
2023-11-10 11:43:03 +08:00
parent 946db8848c
commit be4e1b1d09
7 changed files with 162 additions and 54 deletions

View File

@@ -51,7 +51,7 @@ function fnBeforeUpload(file: FileType) {
function fnUpload(up: UploadRequestOption) {
Modal.confirm({
title: t('common.tipTitle'),
content: `确认要上传LOGO文件吗?`,
content: t('views.system.setting.sysLogoTipContentUpload'),
onOk() {
// 发送请求
const hide = message.loading(t('common.loading'), 0);
@@ -63,7 +63,7 @@ function fnUpload(up: UploadRequestOption) {
state.loading = false;
hide();
if (res.code === RESULT_CODE_SUCCESS) {
message.success('文件上传成功,提交保存生效', 3);
message.success(t('views.system.setting.uploadSuccess'), 3);
state.filePath = res.data.fileName;
// 兼容旧前端可改配置文件
const baseUrl = import.meta.env.PROD
@@ -101,7 +101,7 @@ function fnEdit(v: boolean) {
function fnSave() {
Modal.confirm({
title: t('common.tipTitle'),
content: `确认要提交当前变更的LOGO文件吗?`,
content: t('views.system.setting.sysLogoTipContent'),
onOk() {
const reqArr = [];
// 改变LOGO地址
@@ -126,7 +126,7 @@ function fnSave() {
state.loading = false;
hide();
if (resArr[0].code === RESULT_CODE_SUCCESS) {
message.success('提交保存成功', 3);
message.success(t('views.system.setting.saveSuccess'), 3);
if (state.filePath) {
appStore.setLOGO(state.type, state.filePath);
}
@@ -175,15 +175,19 @@ onMounted(() => {
{{ appStore.appName }}
</h1>
</div>
<div class="header-menu">首页</div>
<div class="header-menu">Menu</div>
</div>
<a-form layout="vertical" v-if="state.edite">
<a-form-item>
<a-space direction="horizontal" :size="18">
<a-radio-group v-model:value="state.type" button-style="solid">
<a-radio value="brand">全图</a-radio>
<a-radio value="icon">小图</a-radio>
<a-radio value="brand">
{{ t('views.system.setting.sysLogoBrand') }}
</a-radio>
<a-radio value="icon">
{{ t('views.system.setting.sysLogoIcon') }}
</a-radio>
</a-radio-group>
<a-upload
name="file"
@@ -195,7 +199,7 @@ onMounted(() => {
:custom-request="fnUpload"
>
<a-button type="link" :loading="state.loading">
上传LOGO
{{ t('views.system.setting.sysLogoUpload') }}
</a-button>
</a-upload>
</a-space>
@@ -203,7 +207,7 @@ onMounted(() => {
<a-form-item>
<a-button type="primary" :disabled="changeStatus" @click="fnSave">
提交保存
{{ t('views.system.setting.saveSubmit') }}
</a-button>
<a-button style="margin-left: 10px" @click="fnEdit(false)">
{{ t('common.cancel') }}
@@ -211,24 +215,31 @@ onMounted(() => {
</a-form-item>
</a-form>
<a-button type="dashed" @click="fnEdit(true)" v-else> 编辑 </a-button>
<a-button type="dashed" @click="fnEdit(true)" v-else>
{{ t('common.editText') }}
</a-button>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-typography>
<a-typography-paragraph>
系统LOGO展示样式如预览区域所示<br />
如需变更请将图片进行对应处理调整后在进行上传
{{ t('views.system.setting.sysLogoInstruction') }}<br />
{{ t('views.system.setting.sysLogoInstruction1') }}
</a-typography-paragraph>
<a-typography-title :level="5">全图</a-typography-title>
<a-typography-title :level="5">{{
t('views.system.setting.sysLogoBrand')
}}</a-typography-title>
<a-typography-paragraph>
将整张图片展示到系统LOGO区域请使用透明背景尺寸比例大小
{{ t('views.system.setting.sysLogoInstruction2') }}
<a-typography-text mark>174x48</a-typography-text>
</a-typography-paragraph>
<a-typography-title :level="5">小图</a-typography-title>
<a-typography-title :level="5">
{{ t('views.system.setting.sysLogoIcon') }}
</a-typography-title>
<a-typography-paragraph>
以LOGO+系统名称的形式展示到系统LOGO区域<br />
LOGO尺寸比例大小<a-typography-text mark>1:1</a-typography-text>
列如<a-typography-text mark>132x132</a-typography-text>
{{ t('views.system.setting.sysLogoInstruction3') }}<br />
{{ t('views.system.setting.sysLogoInstruction4') }}
<a-typography-text mark>1:1</a-typography-text>
eg<a-typography-text mark>132x132</a-typography-text>
</a-typography-paragraph>
</a-typography>
</a-col>