diff --git a/src/packages/components/Informations/Inputs/InputsDate/index.vue b/src/packages/components/Informations/Inputs/InputsDate/index.vue index 506d03a8..2fa35a75 100644 --- a/src/packages/components/Informations/Inputs/InputsDate/index.vue +++ b/src/packages/components/Informations/Inputs/InputsDate/index.vue @@ -56,7 +56,6 @@ const onChange = (v: number | number[]) => { } } -// 手动更新 watch( () => props.chartConfig.option.dataset, (newData: number | number[]) => { @@ -68,6 +67,25 @@ watch( immediate: true } ) + +// 手动更新 +watch( + () => props.chartConfig.option.differValue, + (newData: number) => { + if (props.chartConfig.option.differValue === 0) return + if (typeof option.dataset === 'object') { + option.dataset[0] = dayjs().add(newData, 'day').valueOf() + option.dataset[1] = dayjs().add(newData, 'day').valueOf() + } else { + option.dataset = dayjs().add(newData, 'day').valueOf() + } + // 关联目标组件首次请求带上默认内容 + onChange(newData) + }, + { + immediate: true + } +)