@@ -9,6 +9,7 @@ import { unref, UnwrapRef } from "vue"
99
1010import { ElDivider , ElInputNumber , ElOption , ElSelect , ElSwitch } from "element-plus"
1111import { t } from "@app/locale"
12+ import { I18nKey , t as t_ } from "@i18n"
1213import { defineComponent , h , reactive } from "vue"
1314import optionService from "@service/option-service"
1415import { renderOptionItem , tagText } from "../common"
@@ -18,6 +19,36 @@ import { ALL_DIMENSIONS } from "@util/stat"
1819import { locale } from "@i18n"
1920import { rotate } from "@util/array"
2021
22+ type LocaleStyle = {
23+ durationSelectWidth : number
24+ typeSelectWidth : number
25+ }
26+
27+ const STYLES : Messages < LocaleStyle > = {
28+ zh_CN : {
29+ typeSelectWidth : 85 ,
30+ durationSelectWidth : 80 ,
31+ } ,
32+ en : {
33+ typeSelectWidth : 115 ,
34+ durationSelectWidth : 110
35+ } ,
36+ ja : {
37+ typeSelectWidth : 85 ,
38+ durationSelectWidth : 105 ,
39+ } ,
40+ pt_PT : {
41+ typeSelectWidth : 155 ,
42+ durationSelectWidth : 120 ,
43+ } ,
44+ zh_TW : {
45+ typeSelectWidth : 85 ,
46+ durationSelectWidth : 80 ,
47+ } ,
48+ }
49+
50+ const tStyle = ( key : I18nKey < LocaleStyle > ) => t_ ( STYLES , { key } )
51+
2152const mergeDomain = ( option : UnwrapRef < timer . option . PopupOption > ) => h ( ElSwitch , {
2253 modelValue : option . defaultMergeDomain ,
2354 onChange : ( newVal : boolean ) => {
@@ -41,7 +72,7 @@ const typeOptions = () => ALL_DIMENSIONS.map(item => h(ElOption, { value: item,
4172const typeSelect = ( option : UnwrapRef < timer . option . PopupOption > ) => h ( ElSelect , {
4273 modelValue : option . defaultType ,
4374 size : 'small' ,
44- style : { width : '120px' } ,
75+ style : { width : ` ${ tStyle ( m => m . typeSelectWidth ) } px` } ,
4576 onChange : ( val : timer . stat . Dimension ) => {
4677 option . defaultType = val
4778 optionService . setPopupOption ( unref ( option ) )
@@ -52,7 +83,7 @@ const durationOptions = () => ALL_POPUP_DURATION.map(item => h(ElOption, { value
5283const durationSelect = ( option : UnwrapRef < timer . option . PopupOption > ) => h ( ElSelect , {
5384 modelValue : option . defaultDuration ,
5485 size : 'small' ,
55- style : { width : t ( msg => msg . option . popup . durationWidth ) } ,
86+ style : { width : ` ${ tStyle ( m => m . durationSelectWidth ) } px` } ,
5687 onChange : ( val : PopupDuration ) => {
5788 option . defaultDuration = val
5889 optionService . setPopupOption ( unref ( option ) )
0 commit comments