mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 调整预览状态下控制状态样式
This commit is contained in:
@@ -2,7 +2,7 @@ import { PickCreateComponentType } from '@/packages/index.d'
|
||||
import { EditCanvasConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||
|
||||
type AttrType = PickCreateComponentType<'attr'>
|
||||
type StylesType = PickCreateComponentType<'styles'>
|
||||
type StatusType = PickCreateComponentType<'status'>
|
||||
|
||||
// 设置位置
|
||||
export const getComponentAttrStyle = (attr: AttrType, index: number) => {
|
||||
@@ -16,10 +16,17 @@ export const getComponentAttrStyle = (attr: AttrType, index: number) => {
|
||||
|
||||
// 设置大小
|
||||
export const getSizeStyle = (attr: AttrType, scale?: number) => {
|
||||
return ({
|
||||
return {
|
||||
width: `${scale ? scale * attr.w : attr.w}px`,
|
||||
height: `${scale ? scale * attr.h : attr.h}px`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 设置状态样式
|
||||
export const getStatusStyle = (attr: StatusType) => {
|
||||
return {
|
||||
display: attr.hide ? 'none' : 'block'
|
||||
}
|
||||
}
|
||||
|
||||
// 全局样式
|
||||
|
||||
Reference in New Issue
Block a user