From b7fd270eb9be371d2c57dc67b0cc1ee77680098e Mon Sep 17 00:00:00 2001 From: Ming <739803697@qq.com> Date: Mon, 22 May 2023 11:38:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E5=8A=A8=E6=80=81=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=EF=BC=8C=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Informations/Inputs/InputsDate/index.vue | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 + } +)