From 9e70e9ca093d751cb494a14440084df6523fe709 Mon Sep 17 00:00:00 2001 From: dingxs Date: Mon, 19 Jun 2023 14:35:17 +0800 Subject: [PATCH 01/13] =?UTF-8?q?feat:=E6=97=B6=E9=97=B4=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=99=A8=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=80=BC=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Informations/Inputs/InputsDate/config.ts | 13 +- .../Informations/Inputs/InputsDate/config.vue | 135 ++++++++++++++++-- .../Informations/Inputs/InputsDate/index.vue | 135 ++++++++++++------ .../Inputs/InputsDate/interact.ts | 31 ++++ 4 files changed, 255 insertions(+), 59 deletions(-) mode change 100644 => 100755 src/packages/components/Informations/Inputs/InputsDate/config.ts mode change 100644 => 100755 src/packages/components/Informations/Inputs/InputsDate/config.vue mode change 100644 => 100755 src/packages/components/Informations/Inputs/InputsDate/index.vue mode change 100644 => 100755 src/packages/components/Informations/Inputs/InputsDate/interact.ts diff --git a/src/packages/components/Informations/Inputs/InputsDate/config.ts b/src/packages/components/Informations/Inputs/InputsDate/config.ts old mode 100644 new mode 100755 index e8f1d233..02b639c6 --- a/src/packages/components/Informations/Inputs/InputsDate/config.ts +++ b/src/packages/components/Informations/Inputs/InputsDate/config.ts @@ -4,7 +4,7 @@ import { PublicConfigClass } from '@/packages/public' import { CreateComponentType } from '@/packages/index.d' import { chartInitConfig } from '@/settings/designSetting' import { COMPONENT_INTERACT_EVENT_KET } from '@/enums/eventEnum' -import { interactActions, ComponentInteractEventEnum } from './interact' +import { interactActions, ComponentInteractEventEnum, DefaultTypeEnum, DifferUnitEnum } from './interact' import { InputsDateConfig } from './index' export const option = { @@ -12,9 +12,14 @@ export const option = { [COMPONENT_INTERACT_EVENT_KET]: ComponentInteractEventEnum.DATE, // 下拉展示 isPanel: 0, - dataset: dayjs().valueOf(), - differValue: 0 - + // 默认值 + dataset: dayjs().valueOf() as number | number[] | null, + // 默认值类型 + defaultType: DefaultTypeEnum.STATIC, + // 动态默认值偏移单位 + differUnit: [DifferUnitEnum.DAY, DifferUnitEnum.DAY], + // 动态默认值偏移值 + differValue: [0, 0] } export default class Config extends PublicConfigClass implements CreateComponentType { diff --git a/src/packages/components/Informations/Inputs/InputsDate/config.vue b/src/packages/components/Informations/Inputs/InputsDate/config.vue old mode 100644 new mode 100755 index 0d806518..8fa9adaf --- a/src/packages/components/Informations/Inputs/InputsDate/config.vue +++ b/src/packages/components/Informations/Inputs/InputsDate/config.vue @@ -8,39 +8,67 @@ - + - - - + + + + - + + + + + + + - - - + + + + + + + + + + + + + + + + + diff --git a/src/packages/components/Informations/Inputs/InputsDate/index.vue b/src/packages/components/Informations/Inputs/InputsDate/index.vue old mode 100644 new mode 100755 index 3800590f..a8e16bc1 --- a/src/packages/components/Informations/Inputs/InputsDate/index.vue +++ b/src/packages/components/Informations/Inputs/InputsDate/index.vue @@ -1,6 +1,7 @@ diff --git a/src/views/preview/hooks/useScale.hook.ts b/src/views/preview/hooks/useScale.hook.ts index b0185383..e4c57f97 100644 --- a/src/views/preview/hooks/useScale.hook.ts +++ b/src/views/preview/hooks/useScale.hook.ts @@ -23,6 +23,8 @@ export const useScale = (localStorageInfo: ChartEditStorageType) => { e.preventDefault() e.stopPropagation() removeEvent() + const fitDom = document.querySelector(".go-preview.fit") as HTMLElement + if (fitDom) fitDom.style.overflow = 'auto' const transform = previewRef.value.style.transform // 使用正则解析 scale(1, 1) 中的两个数值 const regRes = transform.match(/scale\((\d+\.?\d*)*/) as RegExpMatchArray From 37b84fcf123eb7c43aff6fcd752330c125d483e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Sat, 8 Jul 2023 21:59:41 +0800 Subject: [PATCH 13/13] =?UTF-8?q?feat:=20=E4=B8=8D=E7=AC=A6=E5=90=88?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A0=BC=E5=BC=8F=E6=97=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ChartData/components/ChartDataAjax/index.vue | 6 +++++- .../components/ChartData/components/ChartDataPond/index.vue | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataAjax/index.vue b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataAjax/index.vue index 203bb0e6..376a84b7 100644 --- a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataAjax/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataAjax/index.vue @@ -131,7 +131,11 @@ const sendHandle = async () => { loading.value = false if (res) { const { data } = res - if (!data && !targetData.value.filter) window['$message'].warning('您的数据不符合默认格式,请配置过滤器!') + if (!data && !targetData.value.filter) { + window['$message'].warning('您的数据不符合默认格式,请配置过滤器!') + showMatching.value = true + return + } targetData.value.option.dataset = newFunctionHandle(data, res, targetData.value.filter) showMatching.value = true return diff --git a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataPond/index.vue b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataPond/index.vue index b51938dd..a7a849fa 100644 --- a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataPond/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataPond/index.vue @@ -117,7 +117,11 @@ const sendHandle = async () => { const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.getRequestGlobalConfig)) loading.value = false if (res) { - if (!res?.data && !targetData.value.filter) window['$message'].warning('您的数据不符合默认格式,请配置过滤器!') + if (!res?.data && !targetData.value.filter) { + window['$message'].warning('您的数据不符合默认格式,请配置过滤器!') + showMatching.value = true + return + } targetData.value.option.dataset = newFunctionHandle(res?.data, res, targetData.value.filter) showMatching.value = true return