forked from github/dataease
Merge pull request #10983 from dataease/pr@dev-v2@fix_scrren_chart_plugin
fix(图表): 修复图表插件在大屏无法显示
This commit is contained in:
commit
1db213aae9
@ -46,7 +46,7 @@ export function findDragComponent(componentInfo) {
|
|||||||
return findNewComponent(componentName, innerType)
|
return findNewComponent(componentName, innerType)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function findNewComponent(componentName, innerType, isPlugin?: boolean) {
|
export function findNewComponent(componentName, innerType, staticMap?) {
|
||||||
let newComponent
|
let newComponent
|
||||||
componentList.forEach(comp => {
|
componentList.forEach(comp => {
|
||||||
if (comp.component === componentName || comp.component === innerType) {
|
if (comp.component === componentName || comp.component === innerType) {
|
||||||
@ -69,7 +69,10 @@ export function findNewComponent(componentName, innerType, isPlugin?: boolean) {
|
|||||||
newComponent.name = viewConfig?.title
|
newComponent.name = viewConfig?.title
|
||||||
newComponent.label = viewConfig?.title
|
newComponent.label = viewConfig?.title
|
||||||
newComponent.render = viewConfig?.render
|
newComponent.render = viewConfig?.render
|
||||||
newComponent.isPlugin = !!isPlugin
|
newComponent.isPlugin = !!staticMap
|
||||||
|
if (newComponent.isPlugin) {
|
||||||
|
newComponent.staticMap = staticMap
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return newComponent
|
return newComponent
|
||||||
}
|
}
|
||||||
|
@ -116,10 +116,10 @@ const contentStyle = computed(() => {
|
|||||||
|
|
||||||
// 通过实时监听的方式直接添加组件
|
// 通过实时监听的方式直接添加组件
|
||||||
const handleNew = newComponentInfo => {
|
const handleNew = newComponentInfo => {
|
||||||
const { componentName, innerType, isPlugin } = newComponentInfo
|
const { componentName, innerType, staticMap } = newComponentInfo
|
||||||
if (componentName) {
|
if (componentName) {
|
||||||
const { width, height, scale } = canvasStyleData.value
|
const { width, height, scale } = canvasStyleData.value
|
||||||
const component = findNewComponent(componentName, innerType, isPlugin)
|
const component = findNewComponent(componentName, innerType, staticMap)
|
||||||
component.style.top = ((height - component.style.height) * scale) / 200
|
component.style.top = ((height - component.style.height) * scale) / 200
|
||||||
component.style.left = ((width - component.style.width) * scale) / 200
|
component.style.left = ((width - component.style.width) * scale) / 200
|
||||||
component.id = guid()
|
component.id = guid()
|
||||||
|
Loading…
Reference in New Issue
Block a user