diff --git a/src/components/Pages/ChartItemSetting/PositionSetting.vue b/src/components/Pages/ChartItemSetting/PositionSetting.vue index 8e28b70b..173910f5 100644 --- a/src/components/Pages/ChartItemSetting/PositionSetting.vue +++ b/src/components/Pages/ChartItemSetting/PositionSetting.vue @@ -20,7 +20,7 @@ placeholder="px" > - + @@ -68,6 +68,62 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -81,6 +137,10 @@ import { } from '@/components/Pages/ChartItemSetting' const props = defineProps({ + isCanvas: { + type: Boolean, + default: false + }, chartStyles: { type: Object as PropType, 'animations'>>, required: true, diff --git a/src/packages/index.d.ts b/src/packages/index.d.ts index a38bb3e1..1c5c2ef7 100644 --- a/src/packages/index.d.ts +++ b/src/packages/index.d.ts @@ -26,13 +26,27 @@ interface EchartsDataType { source: any[] } -// 滤镜枚举 +// 滤镜/变换枚举 export enum FilterEnum { - HUE_ROTATE = 'hueRotate', - SATURATE = 'saturate', - BRIGHTNESS = 'brightness', - CONTRAST = 'contrast', + // 透明度 OPACITY = 'opacity', + // 饱和度 + SATURATE = 'saturate', + // 对比度 + CONTRAST = 'contrast', + // 色相 + HUE_ROTATE = 'hueRotate', + // 亮度 + BRIGHTNESS = 'brightness', + + // 旋转 + ROTATE_Z = 'rotateZ', + ROTATE_X = 'rotateX', + ROTATE_Y = 'rotateY', + + // 倾斜 + SKEW_X = 'skewX', + SKEW_Y = 'skewY', } // 组件实例类 @@ -41,16 +55,18 @@ export interface PublicConfigType extends requestConfig { rename?: string attr: { x: number; y: number; w: number; h: number; zIndex: number } styles: { - // 透明度 [FilterEnum.OPACITY]: number; - // 饱和度 [FilterEnum.SATURATE]: number; - // 对比度 [FilterEnum.CONTRAST]: number; - // 色相 [FilterEnum.HUE_ROTATE]: number; - // 亮度 [FilterEnum.BRIGHTNESS]: number; + + [FilterEnum.ROTATE_Z]: number; + [FilterEnum.ROTATE_X]: number; + [FilterEnum.ROTATE_Y]: number; + + [FilterEnum.SKEW_X]: number; + [FilterEnum.SKEW_Y]: number; // 动画 animations: string[] } diff --git a/src/packages/public/publicConfig.ts b/src/packages/public/publicConfig.ts index 5b50f746..285f4560 100644 --- a/src/packages/public/publicConfig.ts +++ b/src/packages/public/publicConfig.ts @@ -27,6 +27,16 @@ export class publicConfig implements PublicConfigType { brightness: 1, // 透明 opacity: 1, + + // 旋转 + rotateZ: 0, + rotateX: 0, + rotateY: 0, + + // 倾斜 + skewX: 0, + skewY: 0, + // 动画 animations: [] } diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue b/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue index 3d67971b..a6d0f2d0 100644 --- a/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue +++ b/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue @@ -73,7 +73,7 @@ - + diff --git a/src/views/preview/components/PreviewRenderList/index.vue b/src/views/preview/components/PreviewRenderList/index.vue index 7a00e179..88714162 100644 --- a/src/views/preview/components/PreviewRenderList/index.vue +++ b/src/views/preview/components/PreviewRenderList/index.vue @@ -4,7 +4,11 @@ :class="animationsClass(item.styles.animations)" v-for="(item, index) in localStorageInfo.componentList" :key="item.id" - :style="{ ...getComponentAttrStyle(item.attr, index), ...getStyle(item.styles)}" + :style="{ + ...getComponentAttrStyle(item.attr, index), + ...getFilterStyle(item.styles), + ...getTranstormStyle(item.styles) + }" > { const chartThemeSetting = props.localStorageInfo.editCanvasConfig.chartThemeSetting diff --git a/src/views/preview/index.vue b/src/views/preview/index.vue index d50bc5b5..951bd415 100644 --- a/src/views/preview/index.vue +++ b/src/views/preview/index.vue @@ -16,7 +16,7 @@