1
|
1
|
<script setup lang="ts">
|
2
|
2
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
3
|
3
|
import { BasicForm, useForm } from '/@/components/Form';
|
4
|
|
- import { EnableRuleFormType, getFormSchemas } from './config';
|
|
4
|
+ import { EnableRuleFormType, getFormSchemas, TimezoneEnum } from './config';
|
5
|
5
|
import { nextTick, ref, unref } from 'vue';
|
6
|
6
|
import CustomRule from './CustomRule.vue';
|
7
|
7
|
import { ScheduleTypeEnum } from '/@/enums/linkedgeEnum';
|
...
|
...
|
@@ -56,12 +56,17 @@ |
56
|
56
|
};
|
57
|
57
|
|
58
|
58
|
const handleSetFieldsValue = async (schedule: ScheduleType) => {
|
59
|
|
- const { type, startsOn, endsOn, timezone, daysOfWeek } = schedule;
|
|
59
|
+ const { type, startsOn, endsOn, timezone = TimezoneEnum.SHANG_HAI, daysOfWeek } = schedule;
|
60
|
60
|
|
61
|
61
|
if (type === ScheduleTypeEnum.ANY_TIME) return setFieldsValue({ type });
|
62
|
62
|
|
63
|
63
|
if (type === ScheduleTypeEnum.SPECIFIC_TIME)
|
64
|
|
- return setFieldsValue({ type, timezone, daysOfWeek, timeRange: { startsOn, endsOn } });
|
|
64
|
+ return setFieldsValue({
|
|
65
|
+ type,
|
|
66
|
+ timezone,
|
|
67
|
+ daysOfWeek,
|
|
68
|
+ timeRange: { startsOn, endsOn },
|
|
69
|
+ });
|
65
|
70
|
|
66
|
71
|
setFieldsValue(schedule);
|
67
|
72
|
await nextTick();
|
...
|
...
|
|