Skip to content

Commit

Permalink
feat: dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
wjywy committed Oct 31, 2024
1 parent fc6edc6 commit c705c6f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 32 deletions.
6 changes: 2 additions & 4 deletions mockServer/src/services/schema2code.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ export default class Schema2CodeServcice {

getComponentSchema(components) {
return components.map((component) => {
const {
component: componentName,
npm: { package: packageName, exportName, version, destructuring } = {}
} = component
const { component: componentName, npm: { package: packageName, exportName, version, destructuring } = {} } =
component
return {
componentName,
package: packageName,
Expand Down
28 changes: 18 additions & 10 deletions packages/canvas/src/components/container/CanvasContainer.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
<template>
<canvas-action :hoverState="hoverState" :selectState="selectState" :lineState="lineState"
:windowGetClickEventTarget="target" :resize="canvasState.type === 'absolute'" @select-slot="selectSlot"
@setting="settingModel"></canvas-action>
<canvas-action
:hoverState="hoverState"
:selectState="selectState"
:lineState="lineState"
:windowGetClickEventTarget="target"
:resize="canvasState.type === 'absolute'"
@select-slot="selectSlot"
@setting="settingModel"
></canvas-action>
<canvas-divider :selectState="selectState"></canvas-divider>
<canvas-resize-border :iframe="iframe"></canvas-resize-border>
<canvas-resize>
<iframe v-if="!loading" id="canvas" ref="iframe" :src="canvasSrc"
style="border: none; width: 100%; height: 100%"></iframe>
<iframe
v-if="!loading"
id="canvas"
ref="iframe"
:src="canvasSrc"
style="border: none; width: 100%; height: 100%"
></iframe>
<div v-else class="datainit-tip">应用数据初始化中...</div>
</canvas-resize>
<canvas-menu @insert="insertComponent"></canvas-menu>
Expand Down Expand Up @@ -127,7 +138,7 @@ export default {
insertPosition.value = false
setCurrentNode(event)
target.value = event.target
}, true)
})
win.addEventListener('scroll', () => {
isScrolling = true
Expand Down Expand Up @@ -243,18 +254,15 @@ export default {
top: 200px;
left: 400px;
width: 480px;
:deep(.components-wrap) {
&>.tiny-collapse {
& > .tiny-collapse {
max-height: 300px;
}
}
:deep(#pane-blocks) {
max-height: 400px;
}
}
.datainit-tip {
display: flex;
height: 100%;
Expand Down
26 changes: 8 additions & 18 deletions packages/plugins/block/src/BlockSetting.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
<template>
<plugin-setting
v-if="isOpen"
class="plugin-block-setting"
title="设置"
@mouseleave="onMouseLeave"
@click="handleClick"
>
<plugin-setting v-if="isOpen" class="plugin-block-setting" title="设置" @mouseleave="onMouseLeave" @click="handleClick">
<template #header>
<tiny-button @click="updateBlock">保存 </tiny-button>
<tiny-button
type="primary"
:disabled="globalConfig.dslMode === 'Angular'"
class="publish-btn"
@click="showDeployBlockDialog"
>发布
<tiny-button type="primary" :disabled="globalConfig.dslMode === 'Angular'" class="publish-btn"
@click="showDeployBlockDialog">发布
</tiny-button>
<svg-button name="delete" tips="删除" placement="top" @click="deleteBlock"></svg-button>
<close-icon @click="closePanel"></close-icon>
Expand Down Expand Up @@ -63,11 +53,8 @@
</div>
</tiny-collapse-item>
<tiny-collapse-item title="版本列表" name="history">
<block-history-list
:is-block-manage="true"
:history="state.backupList"
@preview="previewHistory"
></block-history-list>
<block-history-list :is-block-manage="true" :history="state.backupList"
@preview="previewHistory"></block-history-list>
</tiny-collapse-item>
</tiny-collapse>
</template>
Expand Down Expand Up @@ -294,12 +281,14 @@ export default {
.video-close {
font-size: 16px;
cursor: pointer;
.close-text {
display: inline-block;
vertical-align: top;
font-size: 14px;
}
}
:deep(.plugin-setting-content) {
padding: 16px 0;
}
Expand Down Expand Up @@ -331,6 +320,7 @@ export default {
.block-event {
position: relative;
padding: 16px;
:deep(.tiny-col) {
position: inherit;
}
Expand Down

0 comments on commit c705c6f

Please sign in to comment.