mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 修改引入方式,去除config文件上的node指向
This commit is contained in:
@@ -25,6 +25,7 @@ import { MacOsControlBtn } from '@/components/MacOsControlBtn/index'
|
||||
import { componentInstall } from '@/utils'
|
||||
import { DragKeyEnum } from '@/enums/editPageEnum'
|
||||
import { ConfigType } from '@/packages/index.d'
|
||||
import { fetchConfigComponent, fetchChartComponent } from '@/packages/index'
|
||||
import omit from 'lodash/omit'
|
||||
|
||||
defineProps({
|
||||
@@ -37,10 +38,10 @@ defineProps({
|
||||
// 拖拽处理
|
||||
const handleDragStart = (e: DragEvent, item: ConfigType) => {
|
||||
// 动态注册图表组件
|
||||
componentInstall(item.key, item.node())
|
||||
componentInstall(item.conKey, item.conNode())
|
||||
componentInstall(item.chartKey, fetchChartComponent(item))
|
||||
componentInstall(item.conKey, fetchConfigComponent(item))
|
||||
// 将配置项绑定到拖拽属性上
|
||||
e!.dataTransfer!.setData(DragKeyEnum.DROG_KEY, JSON.stringify(omit(item, ['node', 'conNode', 'image'])))
|
||||
e!.dataTransfer!.setData(DragKeyEnum.DROG_KEY, JSON.stringify(omit(item, ['image'])))
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -30,9 +30,10 @@ export const handleDrag = async (e: DragEvent) => {
|
||||
// 设置拖拽状态
|
||||
chartEditStore.setEditCanvas(EditCanvasTypeEnum.IS_CREATE, false)
|
||||
|
||||
const dropData: Exclude<ConfigType, ['node', 'image']> = JSON.parse(
|
||||
const dropData: Exclude<ConfigType, ['image']> = JSON.parse(
|
||||
drayDataString
|
||||
)
|
||||
|
||||
// 创建新图表组件
|
||||
let newComponent: CreateComponentType = await createComponent(dropData)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
>
|
||||
<component
|
||||
class="edit-content-chart"
|
||||
:is="item.key"
|
||||
:is="item.chartConfig.chartKey"
|
||||
:chartConfig="item"
|
||||
:themeSetting="themeSetting"
|
||||
:themeColor="themeColor"
|
||||
|
||||
Reference in New Issue
Block a user