mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
feat: 新增剪切
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
import { getUUID } from '@/utils'
|
||||
import { echartOptionProfixHandle } from '@/packages/utils/chart'
|
||||
import { echartOptionProfixHandle, publicConfig } from '@/packages/utils'
|
||||
import { BarCommonConfig } from './index'
|
||||
import { ConfigType, CreateComponentType } from '@/packages/index.d'
|
||||
import omit from 'lodash/omit'
|
||||
|
||||
export default class Config implements CreateComponentType {
|
||||
public id = getUUID()
|
||||
export default class Config extends publicConfig implements CreateComponentType {
|
||||
public key = BarCommonConfig.key
|
||||
public rename = undefined
|
||||
public chartData: Exclude<ConfigType, ['node']> = omit(BarCommonConfig, ['node'])
|
||||
|
||||
public attr = { x: 0, y: 0, w: 500, h: 300 }
|
||||
|
||||
// 图表配置项
|
||||
public option = echartOptionProfixHandle({
|
||||
tooltip: {
|
||||
@@ -34,10 +29,4 @@ export default class Config implements CreateComponentType {
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
// 设置坐标
|
||||
public setPosition(x: number, y: number): void {
|
||||
this.attr.x = x
|
||||
this.attr.y = y
|
||||
}
|
||||
}
|
||||
Vendored
+6
-4
@@ -13,14 +13,16 @@ export type ConfigType = {
|
||||
}
|
||||
|
||||
// 组件实例类
|
||||
export interface CreateComponentType {
|
||||
export interface PublicConfigType {
|
||||
id: string
|
||||
key: string
|
||||
rename?: string
|
||||
attr: { x: number; y: number; w: number; h: number }
|
||||
attr: { x: number; y: number; w: number; h: number; zIndex: number }
|
||||
setPosition: Function
|
||||
}
|
||||
export interface CreateComponentType extends PublicConfigType {
|
||||
key: string
|
||||
chartData: ConfigType
|
||||
option: object
|
||||
setPosition: Function
|
||||
}
|
||||
|
||||
// 包分类枚举
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export * from '@/packages/utils/chart'
|
||||
export * from '@/packages/utils/publicConfig'
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { getUUID } from '@/utils'
|
||||
import { PublicConfigType } from '@/packages/index.d'
|
||||
|
||||
export class publicConfig implements PublicConfigType{
|
||||
public id = getUUID()
|
||||
// 重命名
|
||||
public rename = undefined
|
||||
// 基本信息
|
||||
public attr = { x: 0, y: 0, w: 500, h: 300, zIndex: 0 }
|
||||
// 设置坐标
|
||||
public setPosition(x: number, y: number): void {
|
||||
this.attr.x = x
|
||||
this.attr.y = y
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user