Merge pull request #7344 from dataease/pr@dev-v2@refactor_layer

Pr@dev v2@refactor layer
This commit is contained in:
王嘉豪 2023-12-25 21:54:12 +08:00 committed by GitHub
commit e8a0ebd538
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -205,6 +205,10 @@ const curScale = computed(() => {
return canvasStyleData.value.scale / 100
})
const curBaseScale = computed(() => {
return dvMainStore.canvasStyleData.scale / 100
})
const pointShadowShow = computed(() => {
return (
canvasId.value === 'canvas-main' &&
@ -1314,7 +1318,7 @@ defineExpose({
:id="'component' + item.id"
:active="item.id === curComponentId"
:dv-type="dvInfo.type"
:scale="curScale"
:scale="curBaseScale"
:style="getComponentStyle(item.style)"
:prop-value="item.propValue"
:is-edit="true"

View File

@ -232,7 +232,7 @@ const operation = (cmd: string, data: BusiTreeNode, nodeType: string) => {
})
} else if (cmd === 'edit') {
resourceEdit(data.id)
} else {
} else if (cmd === 'copy') {
const targetPid = findParentIdByChildIdRecursive(state.resourceTree, data.id)
const params: ResourceOrFolder = {
nodeType: nodeType as 'folder' | 'leaf',
@ -248,6 +248,8 @@ const operation = (cmd: string, data: BusiTreeNode, nodeType: string) => {
: `#/dashboard?opt=copy&pid=${params.pid}&resourceId=${data.data}`
window.open(baseUrl, '_blank')
})
} else {
resourceGroupOpt.value.optInit(nodeType, data, cmd, ['copy'].includes(cmd))
}
}

View File

@ -109,7 +109,7 @@ const handleDrop = e => {
component.style.left = e.clientX - rectInfo.x
component.id = guid()
changeComponentSizeWithScale(component)
dvMainStore.addComponent({ component: component, index: 0 })
dvMainStore.addComponent({ component: component, index: undefined })
adaptCurThemeCommonStyle(component)
snapshotStore.recordSnapshotCache('renderChart', component.id)
}