Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: schemaDataAsync #885

Draft
wants to merge 13 commits into
base: refactor/develop
Choose a base branch
from
755 changes: 242 additions & 513 deletions designer-demo/public/mock/bundle.json

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions packages/canvas/DesignCanvas/src/DesignCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default {

const removeNode = (node) => {
const { pageState } = useCanvas()
footData.value = useCanvas().canvasApi.value.getNodePath(node?.id)
footData.value = useCanvas().getNodePath(node?.id)
pageState.currentSchema = {}
pageState.properties = null
}
Expand Down Expand Up @@ -131,19 +131,21 @@ export default {
}
)

const nodeSelected = (node, parent, type) => {
const nodeSelected = (node, parent, type, id) => {
const { toolbars } = useLayout().layoutState
if (type !== 'clickTree') {
useLayout().closePlugin()
}

const { getSchema, getNodePath } = useCanvas().canvasApi.value
const { getSchema, getNodePath } = useCanvas()
const schemaItem = useCanvas().getNodeById(id)

const schema = getSchema()
// 如果选中的节点是画布,就设置成默认选中最外层schema
useProperties().getProps(node || schema, parent)
useCanvas().setCurrentSchema(node || schema)
footData.value = getNodePath(node?.id)
// TODO: 将 canvas 的 schema 改成 pageState 的 schema
useProperties().getProps(schemaItem || schema, parent)
useCanvas().setCurrentSchema(schemaItem || schema)
footData.value = getNodePath(schemaItem?.id)
toolbars.visiblePopover = false
}

Expand Down
Loading