fix(sj_1.0.1): 修复 cron 表达式组件问题
This commit is contained in:
parent
5bfb638cfc
commit
5f7b149519
@ -15,7 +15,7 @@ interface Props {
|
||||
min: number;
|
||||
max: number;
|
||||
};
|
||||
locale: I18n.LocaleType;
|
||||
locale?: I18n.LocaleType;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@ -106,7 +106,9 @@ const value = computed(() => {
|
||||
return props.field.value === DATE ? type.value : `${lastDayOfWeek.value}${type.value}`;
|
||||
case TYPE.SPECIFY: {
|
||||
const specifyValue = specify.value;
|
||||
return specifyValue.length ? specifyValue.sort((a, b) => a - b).join(type.value) : `${specifyValue[0] || 0}`;
|
||||
return specifyValue.length
|
||||
? specifyValue.sort((a, b) => a - b).join(type.value)
|
||||
: `${specifyValue[0] || specifies.value[0].value}`;
|
||||
}
|
||||
default:
|
||||
return '';
|
||||
@ -144,7 +146,8 @@ watch(
|
||||
specify.value =
|
||||
data !== 'undefined' && data !== 'NaN' ? data.split(TYPE.SPECIFY).map(i => Number.parseInt(i, 10)) : [];
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
|
@ -81,7 +81,7 @@ const previews = computed(() => {
|
||||
try {
|
||||
previewList = parserCron(expression.value);
|
||||
} catch (error) {
|
||||
previewList = ['此表达式暂时无法解析!'];
|
||||
previewList = [Locales[props.lang].previewError];
|
||||
}
|
||||
|
||||
return previewList;
|
||||
|
Loading…
Reference in New Issue
Block a user