diff --git a/src/components/Pages/ChartItemSetting/StylesSetting.vue b/src/components/Pages/ChartItemSetting/StylesSetting.vue
index 27275449..efb1d653 100644
--- a/src/components/Pages/ChartItemSetting/StylesSetting.vue
+++ b/src/components/Pages/ChartItemSetting/StylesSetting.vue
@@ -69,6 +69,22 @@
+
+
+ (chartStyles.hueRotate = item.hueRotate)"
+ >
+
+
@@ -149,10 +165,12 @@
-
+
diff --git a/src/hooks/useChartInteract.hook.ts b/src/hooks/useChartInteract.hook.ts
index aa0b1ed6..dce0d25b 100644
--- a/src/hooks/useChartInteract.hook.ts
+++ b/src/hooks/useChartInteract.hook.ts
@@ -30,10 +30,10 @@ export const useChartInteract = (
const { Params, Header } = toRefs(chartEditStore.requestGlobalConfig.requestDataPond[globalConfigPindAprndex].dataPondRequestConfig.requestParams)
Object.keys(item.interactFn).forEach(key => {
- if (Params.value[key]) {
+ if (key in Params.value) {
Params.value[key] = param[item.interactFn[key]]
}
- if (Header.value[key]) {
+ if (key in Header.value) {
Header.value[key] = param[item.interactFn[key]]
}
})
@@ -43,10 +43,10 @@ export const useChartInteract = (
const { Params, Header } = toRefs(chartEditStore.componentList[index].request.requestParams)
Object.keys(item.interactFn).forEach(key => {
- if (Params.value[key]) {
+ if (key in Params.value) {
Params.value[key] = param[item.interactFn[key]]
}
- if (Header.value[key]) {
+ if (key in Header.value) {
Header.value[key] = param[item.interactFn[key]]
}
})
diff --git a/src/hooks/usePreviewScale.hook.ts b/src/hooks/usePreviewScale.hook.ts
index 066f6b66..9d8bcb78 100644
--- a/src/hooks/usePreviewScale.hook.ts
+++ b/src/hooks/usePreviewScale.hook.ts
@@ -1,218 +1,218 @@
-import throttle from 'lodash/throttle'
-
-// 拆出来是为了更好的分离单独复用
-
-// * 屏幕缩放适配(两边留白)
-export const usePreviewFitScale = (
- width: number,
- height: number,
- scaleDom: HTMLElement | null,
- callback?: (scale: {
- width: number;
- height: number;
- }) => void
-) => {
- // * 画布尺寸(px)
- const baseWidth = width
- const baseHeight = height
-
- // * 默认缩放值
- const scale = {
- width: 1,
- height: 1,
- }
-
- // * 需保持的比例
- const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
- const calcRate = () => {
- // 当前屏幕宽高比
- const currentRate = parseFloat(
- (window.innerWidth / window.innerHeight).toFixed(5)
- )
- if (scaleDom) {
- if (currentRate > baseProportion) {
- // 表示更宽
- scale.width = parseFloat(((window.innerHeight * baseProportion) / baseWidth).toFixed(5))
- scale.height = parseFloat((window.innerHeight / baseHeight).toFixed(5))
- scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
- } else {
- // 表示更高
- scale.height = parseFloat(((window.innerWidth / baseProportion) / baseHeight).toFixed(5))
- scale.width = parseFloat((window.innerWidth / baseWidth).toFixed(5))
- scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
- }
- if (callback) callback(scale)
- }
- }
-
- const resize = throttle(() => {
- calcRate()
- }, 200)
-
- // * 改变窗口大小重新绘制
- const windowResize = () => {
- window.addEventListener('resize', resize)
- }
-
- // * 改变窗口大小重新绘制
- const unWindowResize = () => {
- window.removeEventListener('resize', resize)
- }
-
- return {
- calcRate,
- windowResize,
- unWindowResize,
- }
-}
-
-// * X轴撑满,Y轴滚动条
-export const usePreviewScrollYScale = (
- width: number,
- height: number,
- scaleDom: HTMLElement | null,
- callback?: (scale: {
- width: number;
- height: number;
- }) => void
-) => {
- // * 画布尺寸(px)
- const baseWidth = width
- const baseHeight = height
-
- // * 默认缩放值
- const scale = {
- width: 1,
- height: 1,
- }
-
- // * 需保持的比例
- const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
- const calcRate = () => {
- if (scaleDom) {
- scale.height = parseFloat(((window.innerWidth / baseProportion) / baseHeight).toFixed(5))
- scale.width = parseFloat((window.innerWidth / baseWidth).toFixed(5))
- scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
- if (callback) callback(scale)
- }
- }
-
- const resize = throttle(() => {
- calcRate()
- }, 200)
-
- // * 改变窗口大小重新绘制
- const windowResize = () => {
- window.addEventListener('resize', resize)
- }
-
- // * 改变窗口大小重新绘制
- const unWindowResize = () => {
- window.removeEventListener('resize', resize)
- }
-
- return {
- calcRate,
- windowResize,
- unWindowResize,
- }
-}
-
-// * Y轴撑满,X轴滚动条
-export const usePreviewScrollXScale = (
- width: number,
- height: number,
- scaleDom: HTMLElement | null,
- callback?: (scale: {
- width: number;
- height: number;
- }) => void
-) => {
- // * 画布尺寸(px)
- const baseWidth = width
- const baseHeight = height
-
- // * 默认缩放值
- const scale = {
- height: 1,
- width: 1,
- }
-
- // * 需保持的比例
- const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
- const calcRate = () => {
- if (scaleDom) {
- scale.width = parseFloat(((window.innerHeight * baseProportion) / baseWidth).toFixed(5))
- scale.height = parseFloat((window.innerHeight / baseHeight).toFixed(5))
- scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
- if (callback) callback(scale)
- }
- }
-
- const resize = throttle(() => {
- calcRate()
- }, 200)
-
- // * 改变窗口大小重新绘制
- const windowResize = () => {
- window.addEventListener('resize', resize)
- }
-
- // * 改变窗口大小重新绘制
- const unWindowResize = () => {
- window.removeEventListener('resize', resize)
- }
-
- return {
- calcRate,
- windowResize,
- unWindowResize,
- }
-}
-
-// * 变形内容,宽高铺满
-export const usePreviewFullScale = (
- width: number,
- height: number,
- scaleDom: HTMLElement | null,
- callback?: (scale: {
- width: number;
- height: number;
- }) => void
-) => {
-
- // * 默认缩放值
- const scale = {
- width: 1,
- height: 1,
- }
-
- const calcRate = () => {
- if (scaleDom) {
- scale.width = parseFloat((window.innerWidth / width).toFixed(5))
- scale.height = parseFloat((window.innerHeight / height).toFixed(5))
- scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
- if (callback) callback(scale)
- }
- }
-
- const resize = throttle(() => {
- calcRate()
- }, 200)
-
- // * 改变窗口大小重新绘制
- const windowResize = () => {
- window.addEventListener('resize', resize)
- }
-
- // * 改变窗口大小重新绘制
- const unWindowResize = () => {
- window.removeEventListener('resize', resize)
- }
-
- return {
- calcRate,
- windowResize,
- unWindowResize,
- }
+import throttle from 'lodash/throttle'
+
+// 拆出来是为了更好的分离单独复用
+
+// * 屏幕缩放适配(两边留白)
+export const usePreviewFitScale = (
+ width: number,
+ height: number,
+ scaleDom: HTMLElement | null,
+ callback?: (scale: {
+ width: number;
+ height: number;
+ }) => void
+) => {
+ // * 画布尺寸(px)
+ const baseWidth = width
+ const baseHeight = height
+
+ // * 默认缩放值
+ const scale = {
+ width: 1,
+ height: 1,
+ }
+
+ // * 需保持的比例
+ const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
+ const calcRate = () => {
+ // 当前屏幕宽高比
+ const currentRate = parseFloat(
+ (window.innerWidth / window.innerHeight).toFixed(5)
+ )
+ if (scaleDom) {
+ if (currentRate > baseProportion) {
+ // 表示更宽
+ scale.width = parseFloat(((window.innerHeight * baseProportion) / baseWidth).toFixed(5))
+ scale.height = parseFloat((window.innerHeight / baseHeight).toFixed(5))
+ scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
+ } else {
+ // 表示更高
+ scale.height = parseFloat(((window.innerWidth / baseProportion) / baseHeight).toFixed(5))
+ scale.width = parseFloat((window.innerWidth / baseWidth).toFixed(5))
+ scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
+ }
+ if (callback) callback(scale)
+ }
+ }
+
+ const resize = throttle(() => {
+ calcRate()
+ }, 200)
+
+ // * 改变窗口大小重新绘制
+ const windowResize = () => {
+ window.addEventListener('resize', resize)
+ }
+
+ // * 卸载监听
+ const unWindowResize = () => {
+ window.removeEventListener('resize', resize)
+ }
+
+ return {
+ calcRate,
+ windowResize,
+ unWindowResize,
+ }
+}
+
+// * X轴撑满,Y轴滚动条
+export const usePreviewScrollYScale = (
+ width: number,
+ height: number,
+ scaleDom: HTMLElement | null,
+ callback?: (scale: {
+ width: number;
+ height: number;
+ }) => void
+) => {
+ // * 画布尺寸(px)
+ const baseWidth = width
+ const baseHeight = height
+
+ // * 默认缩放值
+ const scale = {
+ width: 1,
+ height: 1,
+ }
+
+ // * 需保持的比例
+ const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
+ const calcRate = () => {
+ if (scaleDom) {
+ scale.height = parseFloat(((window.innerWidth / baseProportion) / baseHeight).toFixed(5))
+ scale.width = parseFloat((window.innerWidth / baseWidth).toFixed(5))
+ scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
+ if (callback) callback(scale)
+ }
+ }
+
+ const resize = throttle(() => {
+ calcRate()
+ }, 200)
+
+ // * 改变窗口大小重新绘制
+ const windowResize = () => {
+ window.addEventListener('resize', resize)
+ }
+
+ // * 卸载监听
+ const unWindowResize = () => {
+ window.removeEventListener('resize', resize)
+ }
+
+ return {
+ calcRate,
+ windowResize,
+ unWindowResize,
+ }
+}
+
+// * Y轴撑满,X轴滚动条
+export const usePreviewScrollXScale = (
+ width: number,
+ height: number,
+ scaleDom: HTMLElement | null,
+ callback?: (scale: {
+ width: number;
+ height: number;
+ }) => void
+) => {
+ // * 画布尺寸(px)
+ const baseWidth = width
+ const baseHeight = height
+
+ // * 默认缩放值
+ const scale = {
+ height: 1,
+ width: 1,
+ }
+
+ // * 需保持的比例
+ const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
+ const calcRate = () => {
+ if (scaleDom) {
+ scale.width = parseFloat(((window.innerHeight * baseProportion) / baseWidth).toFixed(5))
+ scale.height = parseFloat((window.innerHeight / baseHeight).toFixed(5))
+ scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
+ if (callback) callback(scale)
+ }
+ }
+
+ const resize = throttle(() => {
+ calcRate()
+ }, 200)
+
+ // * 改变窗口大小重新绘制
+ const windowResize = () => {
+ window.addEventListener('resize', resize)
+ }
+
+ // * 卸载监听
+ const unWindowResize = () => {
+ window.removeEventListener('resize', resize)
+ }
+
+ return {
+ calcRate,
+ windowResize,
+ unWindowResize,
+ }
+}
+
+// * 变形内容,宽高铺满
+export const usePreviewFullScale = (
+ width: number,
+ height: number,
+ scaleDom: HTMLElement | null,
+ callback?: (scale: {
+ width: number;
+ height: number;
+ }) => void
+) => {
+
+ // * 默认缩放值
+ const scale = {
+ width: 1,
+ height: 1,
+ }
+
+ const calcRate = () => {
+ if (scaleDom) {
+ scale.width = parseFloat((window.innerWidth / width).toFixed(5))
+ scale.height = parseFloat((window.innerHeight / height).toFixed(5))
+ scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
+ if (callback) callback(scale)
+ }
+ }
+
+ const resize = throttle(() => {
+ calcRate()
+ }, 200)
+
+ // * 改变窗口大小重新绘制
+ const windowResize = () => {
+ window.addEventListener('resize', resize)
+ }
+
+ // * 卸载监听
+ const unWindowResize = () => {
+ window.removeEventListener('resize', resize)
+ }
+
+ return {
+ calcRate,
+ windowResize,
+ unWindowResize,
+ }
}
\ No newline at end of file
diff --git a/src/packages/components/Decorates/Mores/FlipperNumber/index.vue b/src/packages/components/Decorates/Mores/FlipperNumber/index.vue
index 9e5c0ca2..0c4ae010 100644
--- a/src/packages/components/Decorates/Mores/FlipperNumber/index.vue
+++ b/src/packages/components/Decorates/Mores/FlipperNumber/index.vue
@@ -63,7 +63,7 @@ watch(
() => props.chartConfig.option,
newVal => {
try {
- updateDatasetHandler((newVal as OptionType).dataset)
+ updateDatasetHandler((newVal as any as OptionType).dataset)
} catch (error) {
console.log(error)
}
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..228fa494
--- a/src/packages/components/Informations/Inputs/InputsDate/config.vue
+++ b/src/packages/components/Informations/Inputs/InputsDate/config.vue
@@ -8,39 +8,67 @@
-
+
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
- 动态
+
- 动态值不为0时,默认值:取当天时间相加当前值
+ 打开页面时浏览器操作系统的系统时间+偏移量(单位)
-
- 天
-
+
+
+
+ {{DifferUnitObject[optionData.differUnit[0]]}}
+
+
+
+
+
+
+
+
+
+ {{DifferUnitObject[optionData.differUnit[1]]}}
+
+
+
+
+
+
+
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 @@