Browse Source

中英文bug修复

master_hella_20240701
yufei0306 6 months ago
parent
commit
03d929b01f
  1. 20
      src/components/Form/src/Form.vue
  2. 5
      src/components/Form/src/components/useRenderSelect.tsx
  3. 7
      src/components/Form/src/helper.ts
  4. 5
      src/components/Table/src/Table.vue
  5. 4
      src/utils/disposition/defaultButtons.ts
  6. 2
      src/views/login/components/LoginForm.vue

20
src/components/Form/src/Form.vue

@ -175,10 +175,7 @@ export default defineComponent({
const Com = componentMap['Divider'] as ReturnType<typeof defineComponent> const Com = componentMap['Divider'] as ReturnType<typeof defineComponent>
let labelName = item?.label || '' let labelName = item?.label || ''
if(item?.label){ if(item?.label){
labelName = t(`ts.${item?.label}`) labelName = t(`ts.${item?.label}`).replace('ts.','')
if(labelName === 'ts.' + item?.label){
labelName = item?.label
}
} }
return isDivider ? ( return isDivider ? (
<Com {...{ contentPosition: 'left', ...item.componentProps }}>{labelName}</Com> <Com {...{ contentPosition: 'left', ...item.componentProps }}>{labelName}</Com>
@ -227,18 +224,12 @@ export default defineComponent({
if (item?.labelMessage) { if (item?.labelMessage) {
let labelName = item.label || '' let labelName = item.label || ''
if(item.label){ if(item.label){
labelName = t(`ts.${item.label}`) labelName = t(`ts.${item.label}`).replace('ts.','')
if(labelName === 'ts.' + item.label){
labelName = item.label
}
} }
let labelMessage = item.labelMessage || '' let labelMessage = item.labelMessage || ''
if(item.labelMessage){ if(item.labelMessage){
labelMessage = t(`ts.${item.labelMessage}`) labelMessage = t(`ts.${item.labelMessage}`).replace('ts.','')
if(labelMessage === 'ts.' + item.labelMessage){
labelMessage = item.labelMessage
}
} }
formItemSlots.label = () => { formItemSlots.label = () => {
return ( return (
@ -367,10 +358,7 @@ export default defineComponent({
} }
let labelName = item.label || '' let labelName = item.label || ''
if(item.label){ if(item.label){
labelName = t(`ts.${item.label}`) labelName = t(`ts.${item.label}`).replace('ts.','')
if(labelName === 'ts.' + item.label){
labelName = item.label
}
} }
return ( return (
<ElFormItem {...(item.formItemProps || {})} prop={item.field} label={labelName}> <ElFormItem {...(item.formItemProps || {})} prop={item.field} label={labelName}>

5
src/components/Form/src/components/useRenderSelect.tsx

@ -35,10 +35,7 @@ export const useRenderSelect = (slots: Slots) => {
const { label, value, ...other } = option const { label, value, ...other } = option
const zhName = labelAlias ? option[labelAlias] : label;//中文名称 const zhName = labelAlias ? option[labelAlias] : label;//中文名称
let labelName = t(`ts.${zhName}`) let labelName = t(`ts.${zhName}`).replace('ts.','')
if(labelName === 'ts.' + zhName){
labelName = zhName
}
return ( return (
<ElOption <ElOption

7
src/components/Form/src/helper.ts

@ -17,12 +17,7 @@ export const setTextPlaceholder = (schema: FormSchema): PlaceholderModel => {
let labelName = schema.label || '' let labelName = schema.label || ''
if(schema.label){ if(schema.label){
labelName = t(`ts.${schema.label}`) labelName = ' '+t(`ts.${schema.label}`).replace('ts.','')
if(labelName === 'ts.' + schema.label){
labelName = ' '+schema.label
}else{
labelName = ' ' + labelName
}
} }
if (textMap.includes(schema?.component as string)) { if (textMap.includes(schema?.component as string)) {

5
src/components/Table/src/Table.vue

@ -283,10 +283,7 @@ export default defineComponent({
return [...[renderTableExpand()], ...[renderTableSelection()]].concat( return [...[renderTableExpand()], ...[renderTableSelection()]].concat(
(columnsChildren || columns).map((v) => { (columnsChildren || columns).map((v) => {
const zhName = v.label || '';// const zhName = v.label || '';//
let labelName = t(`ts.${v.label}`) let labelName = t(`ts.${v.label}`).replace('ts.','')
if(labelName === 'ts.' + zhName){
labelName = zhName
}
// //
if (v.type === 'index') { if (v.type === 'index') {
return ( return (

4
src/utils/disposition/defaultButtons.ts

@ -289,7 +289,7 @@ export function mainListDisableBtn(option:any) {
// 主列表-中止按钮1 // 主列表-中止按钮1
export function mainListSuspend1Btn(option:any) { export function mainListSuspend1Btn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{
label: t(`ts.中止`), label: t(`ts.中止`).replace('ts.',''),
name: 'suspend', name: 'suspend',
hide: false, hide: false,
type: 'danger', type: 'danger',
@ -624,7 +624,7 @@ export function mainListPurchasePlanModBtn(option:any) {
// 主列表-要货计划流程-下架按钮 // 主列表-要货计划流程-下架按钮
export function mainListPurchasePlanWitBtn(option:any) { export function mainListPurchasePlanWitBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{
label: t(`ts.下架`), label: t(`ts.下架`).replace('ts.',''),
name: 'mainPurPlanWit', name: 'mainPurPlanWit',
hide: false, hide: false,
type: 'danger', type: 'danger',

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="t(`ts.${item}`)" :label="t(`ts.${item}`).replace('ts.','')"
:value="item" :value="item"
/> />
</el-select> </el-select>

Loading…
Cancel
Save