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

View File

@ -232,7 +232,7 @@ const operation = (cmd: string, data: BusiTreeNode, nodeType: string) => {
}) })
} else if (cmd === 'edit') { } else if (cmd === 'edit') {
resourceEdit(data.id) resourceEdit(data.id)
} else { } else if (cmd === 'copy') {
const targetPid = findParentIdByChildIdRecursive(state.resourceTree, data.id) const targetPid = findParentIdByChildIdRecursive(state.resourceTree, data.id)
const params: ResourceOrFolder = { const params: ResourceOrFolder = {
nodeType: nodeType as 'folder' | 'leaf', 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}` : `#/dashboard?opt=copy&pid=${params.pid}&resourceId=${data.data}`
window.open(baseUrl, '_blank') 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.style.left = e.clientX - rectInfo.x
component.id = guid() component.id = guid()
changeComponentSizeWithScale(component) changeComponentSizeWithScale(component)
dvMainStore.addComponent({ component: component, index: 0 }) dvMainStore.addComponent({ component: component, index: undefined })
adaptCurThemeCommonStyle(component) adaptCurThemeCommonStyle(component)
snapshotStore.recordSnapshotCache('renderChart', component.id) snapshotStore.recordSnapshotCache('renderChart', component.id)
} }