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>
let labelName = item?.label || ''
if(item?.label){
labelName = t(`ts.${item?.label}`)
if(labelName === 'ts.' + item?.label){
labelName = item?.label
}
labelName = t(`ts.${item?.label}`).replace('ts.','')
}
return isDivider ? (
<Com {...{ contentPosition: 'left', ...item.componentProps }}>{labelName}</Com>
@ -227,18 +224,12 @@ export default defineComponent({
if (item?.labelMessage) {
let labelName = item.label || ''
if(item.label){
labelName = t(`ts.${item.label}`)
if(labelName === 'ts.' + item.label){
labelName = item.label
}
labelName = t(`ts.${item.label}`).replace('ts.','')
}
let labelMessage = item.labelMessage || ''
if(item.labelMessage){
labelMessage = t(`ts.${item.labelMessage}`)
if(labelMessage === 'ts.' + item.labelMessage){
labelMessage = item.labelMessage
}
labelMessage = t(`ts.${item.labelMessage}`).replace('ts.','')
}
formItemSlots.label = () => {
return (
@ -367,10 +358,7 @@ export default defineComponent({
}
let labelName = item.label || ''
if(item.label){
labelName = t(`ts.${item.label}`)
if(labelName === 'ts.' + item.label){
labelName = item.label
}
labelName = t(`ts.${item.label}`).replace('ts.','')
}
return (
<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 zhName = labelAlias ? option[labelAlias] : label;//中文名称
let labelName = t(`ts.${zhName}`)
if(labelName === 'ts.' + zhName){
labelName = zhName
}
let labelName = t(`ts.${zhName}`).replace('ts.','')
return (
<ElOption

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

@ -17,12 +17,7 @@ export const setTextPlaceholder = (schema: FormSchema): PlaceholderModel => {
let labelName = schema.label || ''
if(schema.label){
labelName = t(`ts.${schema.label}`)
if(labelName === 'ts.' + schema.label){
labelName = ' '+schema.label
}else{
labelName = ' ' + labelName
}
labelName = ' '+t(`ts.${schema.label}`).replace('ts.','')
}
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(
(columnsChildren || columns).map((v) => {
const zhName = v.label || '';//
let labelName = t(`ts.${v.label}`)
if(labelName === 'ts.' + zhName){
labelName = zhName
}
let labelName = t(`ts.${v.label}`).replace('ts.','')
//
if (v.type === 'index') {
return (

4
src/utils/disposition/defaultButtons.ts

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

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

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

Loading…
Cancel
Save