Browse Source

中英文翻译+bug修复

master_hella_20240701
yufei0306 1 year ago
parent
commit
7e40e937bb
  1. 1
      README.md
  2. 2
      index.html
  3. 2
      src/components/TableForm/src/TableForm.vue
  4. 4
      src/components/UploadFile/src/UploadFile.vue
  5. 3
      src/hooks/web/useTitle.ts
  6. 3
      src/layout/components/Footer/src/Footer.vue
  7. 22
      src/locales/en-US.ts
  8. 22
      src/locales/zh-CN.ts
  9. 6
      src/main.ts
  10. 2
      src/views/login/components/LoginForm.vue
  11. 4
      src/views/login/login.vue
  12. 2
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/purchasereceiptJobMain.data.ts

1
README.md

@ -4,6 +4,7 @@
form: { form: {
labelMessage: '信息提示说明!!!', labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
enterSearch: true, //可输入回车 对应绑定事件:@onEnter="onEnter"
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本 searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段 searchField: 'itemCode', // 查询弹窗赋值字段

2
index.html

@ -138,7 +138,7 @@
<div class="app-loading-wrap"> <div class="app-loading-wrap">
<div class="app-loading-title"> <div class="app-loading-title">
<img src="/src/assets/imgs/logo_white.png" class="app-loading-logo" alt="Logo" /> <img src="/src/assets/imgs/logo_white.png" class="app-loading-logo" alt="Logo" />
<div class="app-loading-title">%VITE_APP_TITLE%</div> <div class="app-loading-title" id="app-loading-title">%VITE_APP_TITLE%</div>
</div> </div>
<div class="app-loading-item"> <div class="app-loading-item">
<div class="app-loading-outter"></div> <div class="app-loading-outter"></div>

2
src/components/TableForm/src/TableForm.vue

@ -64,7 +64,7 @@
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
clearable clearable
:type="headerItem?.tableForm?.inputType" :type="headerItem?.tableForm?.inputType"
:placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label" :placeholder="t(`ts.${headerItem?.tableForm?.placeholder || '请输入' + headerItem.label}`)"
:disabled="headerItem?.tableForm?.disabled ? true: headerItem?.tableForm?.isInpuFocusShow ? true : false" :disabled="headerItem?.tableForm?.disabled ? true: headerItem?.tableForm?.isInpuFocusShow ? true : false"
style="flex:1" style="flex:1"
@blur="inputStringBlur(headerItem.field, row[headerItem.field], row)" @blur="inputStringBlur(headerItem.field, row[headerItem.field], row)"

4
src/components/UploadFile/src/UploadFile.vue

@ -23,10 +23,10 @@
<el-button type="primary"><Icon icon="ep:upload-filled" />{{ title }}</el-button> <el-button type="primary"><Icon icon="ep:upload-filled" />{{ title }}</el-button>
<template v-if="isShowTip" #tip> <template v-if="isShowTip" #tip>
<div style="font-size: 8px;margin-top: 10px;line-height: initial;"> <div style="font-size: 8px;margin-top: 10px;line-height: initial;">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> {{t('ts.大小不超过')}} <b style="color: #f56c6c">{{ fileSize }}MB</b>
</div> </div>
<div style="font-size: 8px;line-height: initial;"> <div style="font-size: 8px;line-height: initial;">
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b> 的文件 {{ t('ts.格式为') }} <b style="color: #f56c6c">{{ fileType.join('/') }}</b> {{ t('ts.的文件') }}
</div> </div>
</template> </template>
<template v-if="!isShowFile" #file > <template v-if="!isShowFile" #file >

3
src/hooks/web/useTitle.ts

@ -1,6 +1,7 @@
import { watch, ref } from 'vue' import { watch, ref } from 'vue'
import { isString } from '@/utils/is' import { isString } from '@/utils/is'
import { useAppStoreWithOut } from '@/store/modules/app' import { useAppStoreWithOut } from '@/store/modules/app'
const { t } = useI18n() // 国际化
const appStore = useAppStoreWithOut() const appStore = useAppStoreWithOut()
@ -14,7 +15,7 @@ export const useTitle = (newTitle?: string) => {
title, title,
(n, o) => { (n, o) => {
if (isString(n) && n !== o && document) { if (isString(n) && n !== o && document) {
document.title = n document.title = n.replace(import.meta.env.VITE_APP_TITLE,t(`ts.${import.meta.env.VITE_APP_TITLE}`))
} }
}, },
{ immediate: true } { immediate: true }

3
src/layout/components/Footer/src/Footer.vue

@ -1,6 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useAppStore } from '@/store/modules/app' import { useAppStore } from '@/store/modules/app'
import { useDesign } from '@/hooks/web/useDesign' import { useDesign } from '@/hooks/web/useDesign'
const { t } = useI18n()
// eslint-disable-next-line vue/no-reserved-component-names // eslint-disable-next-line vue/no-reserved-component-names
defineOptions({ name: 'Footer' }) defineOptions({ name: 'Footer' })
@ -19,6 +20,6 @@ const title = computed(() => appStore.getTitle)
:class="prefixCls" :class="prefixCls"
class="h-[var(--app-footer-height)] bg-[var(--app-content-bg-color)] text-center leading-[var(--app-footer-height)] text-[var(--el-text-color-placeholder)] dark:bg-[var(--el-bg-color)]" class="h-[var(--app-footer-height)] bg-[var(--app-content-bg-color)] text-center leading-[var(--app-footer-height)] text-[var(--el-text-color-placeholder)] dark:bg-[var(--el-bg-color)]"
> >
<p style="font-size: 14px">Copyright ©2022-{{ title }}</p> <p style="font-size: 14px">Copyright ©2022-{{ t(`ts.${title}`) }}</p>
</div> </div>
</template> </template>

22
src/locales/en-US.ts

@ -1063,7 +1063,6 @@ export default {
:'Purchasing price approver', :'Purchasing price approver',
:'Supplier\'s invoice number', :'Supplier\'s invoice number',
:'loading', :'loading',
:'Please enter remarks',
'正在上传文件,请稍候':'Please wait while uploading files', '正在上传文件,请稍候':'Please wait while uploading files',
:'upload successful', :'upload successful',
:'The number of uploaded files cannot exceed', :'The number of uploaded files cannot exceed',
@ -1084,7 +1083,26 @@ export default {
:'Invoicing calendar management', :'Invoicing calendar management',
:'description', :'description',
:'Batch delete', :'Batch delete',
:'Check the quality inspection report' :'Check the quality inspection report',
:'ChangChun',
:'ChengDu',
:'HELLR Smart Factory Management Platform',
:'Purchase unreceived record',
:'Please select the desired shipment tracking number',
:'Not more in size',
:'File in',
:'format',
:'Receive',
:'Please input batch',
:'Please input the supplier batch',
:'Option Date',
:'Please input comment',
// 格式为…的文件:The format is... File of
1:'Please input package specification1',
1:'Please input package quantity1',
2:'Please input package specification2',
2:'Please input package quantity2',
:'submit for approval'

22
src/locales/zh-CN.ts

@ -1063,7 +1063,6 @@ export default {
:'采购价格审批人', :'采购价格审批人',
:'供应商发货单号', :'供应商发货单号',
:'加载中', :'加载中',
:'请输入备注',
'正在上传文件,请稍候':'正在上传文件,请稍候...', '正在上传文件,请稍候':'正在上传文件,请稍候...',
:'上传成功', :'上传成功',
:'上传文件数量不能超过', :'上传文件数量不能超过',
@ -1084,7 +1083,26 @@ export default {
:'开票日历管理', :'开票日历管理',
:'描述', :'描述',
:'批量删除', :'批量删除',
:'查看质检报告' :'查看质检报告',
:'长春',
:'成都',
:'富维海拉智慧工厂管理平台',
:'采购未收货记录',
:'请选择要货计划单号',
:'大小不超过',
:'格式为',
:'的文件',
:'接收',
:'请输入批次',
:'请输入供应商批次',
:'选择日期',
:'请输入备注',
// 格式为…的文件:The format is... File of
1:'请输入包装规格1',
1:'请输入包装数量1',
2:'请输入包装规格2',
2:'请输入包装数量2',
:'提交审批'

6
src/main.ts

@ -43,6 +43,7 @@ import Logger from '@/utils/Logger'
import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐患 import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐患
import DataVVue3 from '@kjgl77/datav-vue3' import DataVVue3 from '@kjgl77/datav-vue3'
import { useLocaleStore } from '@/store/modules/locale'
// 创建实例 // 创建实例
const setupAll = async () => { const setupAll = async () => {
@ -70,6 +71,11 @@ const setupAll = async () => {
app.mount('#app') app.mount('#app')
app.config.warnHandler = () => null; app.config.warnHandler = () => null;
} }
// 多语言相关
const localeStore = useLocaleStore()
if(localeStore&&localeStore.currentLocale&&localeStore.currentLocale.lang.indexOf('en')>-1&&document.querySelector('#app-loading-title')){
document.querySelector('#app-loading-title').innerHTML = 'HELLR Smart Factory Management Platform' // 富维海拉智慧工厂管理平台
}
setupAll() setupAll()

2
src/views/login/components/LoginForm.vue

@ -15,7 +15,7 @@
<el-option <el-option
v-for="item in tenantArray" v-for="item in tenantArray"
:key="item" :key="item"
:label="item" :label="t(`ts.${item}`)"
:value="item" :value="item"
/> />
</el-select> </el-select>

4
src/views/login/login.vue

@ -10,7 +10,7 @@
<!-- 左上角的 logo + 系统标题 --> <!-- 左上角的 logo + 系统标题 -->
<div class="relative flex items-center "> <div class="relative flex items-center ">
<img alt="" class="mr-10px w-144px h-36px" src="@/assets/imgs/logo_white.png" /> <img alt="" class="mr-10px w-144px h-36px" src="@/assets/imgs/logo_white.png" />
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span> <span class="text-20px font-bold">{{ t(`ts.${underlineToHump(appStore.getTitle)}`) }}</span>
</div> </div>
<!-- 左边的背景图 + 欢迎语 --> <!-- 左边的背景图 + 欢迎语 -->
<div class="h-[calc(100%-60px)] flex items-center justify-center"> <div class="h-[calc(100%-60px)] flex items-center justify-center">
@ -34,7 +34,7 @@
> >
<div class="flex items-center at-2xl:hidden at-xl:hidden"> <div class="flex items-center at-2xl:hidden at-xl:hidden">
<img alt="" class="mr-10px w-144px h-36px" src="@/assets/imgs/logo_white.png" /> <img alt="" class="mr-10px w-144px h-36px" src="@/assets/imgs/logo_white.png" />
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span> <span class="text-20px font-bold">{{ t(`ts.${underlineToHump(appStore.getTitle)}`) }}</span>
</div> </div>
<div class="flex items-center justify-end space-x-10px"> <div class="flex items-center justify-end space-x-10px">
<!-- <ThemeSwitch /> --> <!-- <ThemeSwitch /> -->

2
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/purchasereceiptJobMain.data.ts

@ -609,7 +609,7 @@ export const PurchasereceiptJobMain = useCrudSchemas(reactive<CrudSchema[]>([
isDetail: false, isDetail: false,
isForm: false, isForm: false,
table: { table: {
width: 120, width: 180,
fixed: 'right' fixed: 'right'
}, },
}, },

Loading…
Cancel
Save