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