|
|
@@ -980,8 +980,10 @@ export const drawerFormSchema: FormSchemaGetter = (props?: any) => [
|
|
980
|
980
|
Array.isArray(values.isCycleEnd) &&
|
|
981
|
981
|
values.isCycleEnd[0] === true),
|
|
982
|
982
|
componentProps(values: any) {
|
|
|
983
|
+ const startMonth = Number.parseInt(values.startTimeMonth) || 1;
|
|
983
|
984
|
const startDay = Number.parseInt(values.startTimeYearDay) || 1;
|
|
984
|
|
- const month = Number.parseInt(values.endTimeMonth) || 1;
|
|
|
985
|
+ const endMonth = Number.parseInt(values.endTimeMonth) || 1;
|
|
|
986
|
+ const month = endMonth;
|
|
985
|
987
|
|
|
986
|
988
|
// 计算每个月的天数
|
|
987
|
989
|
let daysInMonth = 31;
|
|
|
@@ -991,19 +993,23 @@ export const drawerFormSchema: FormSchemaGetter = (props?: any) => [
|
|
991
|
993
|
daysInMonth = 28; // 简化处理,不考虑闰年
|
|
992
|
994
|
}
|
|
993
|
995
|
|
|
994
|
|
- const count = daysInMonth - startDay + 1;
|
|
|
996
|
+ // 如果是同月,结束天数必须大于等于开始天数
|
|
|
997
|
+ // 如果是跨月,结束天数可以从1号开始
|
|
|
998
|
+ const start = startMonth === endMonth ? startDay : 1;
|
|
|
999
|
+ const count = daysInMonth - start + 1;
|
|
995
|
1000
|
return {
|
|
996
|
1001
|
options: Array.from({ length: count }, (_, i) => ({
|
|
997
|
|
- label: (startDay + i).toString(),
|
|
998
|
|
- value: startDay + i,
|
|
|
1002
|
+ label: (start + i).toString(),
|
|
|
1003
|
+ value: start + i,
|
|
999
|
1004
|
})),
|
|
1000
|
|
- defaultValue: startDay.toString(),
|
|
|
1005
|
+ defaultValue: start.toString(),
|
|
1001
|
1006
|
};
|
|
1002
|
1007
|
},
|
|
1003
|
1008
|
triggerFields: [
|
|
1004
|
1009
|
'endoftheperiod',
|
|
1005
|
1010
|
'isCycleEnd',
|
|
1006
|
1011
|
'taskFrequency',
|
|
|
1012
|
+ 'startTimeMonth',
|
|
1007
|
1013
|
'startTimeYearDay',
|
|
1008
|
1014
|
'endTimeMonth',
|
|
1009
|
1015
|
],
|