@epxing/designer 5.3.0-beta.2 → 5.3.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API.md +1 -1
- package/README.md +46 -46
- package/dist/src/page-designer/PageDesigner.js +11 -0
- package/dist/src/page-designer/designer.js +21 -0
- package/dist/src/page-designer/previews/add-form/Preview.js +1 -1
- package/dist/src/page-designer/previews/add-form/Preview.vue.js +19 -8
- package/dist/src/page-designer/setting-panel/Setting.js +46 -10
- package/dist/src/visual/config-page/ComponentLibraryDialog.js +8 -2
- package/dist/src/visual/config-page/DashboardMobile.js +1 -1
- package/dist/style.css +116 -112
- package/package.json +8 -8
- package/src/index.js +27 -27
- package/src/page-designer/PageDesigner.vue +11 -0
- package/src/page-designer/designer.js +1322 -1299
- package/src/page-designer/previews/add-form/Preview.vue +43 -44
- package/src/page-designer/setting-panel/Setting.vue +24 -2
- package/src/page-designer/widget-preview/Mixin.js +285 -285
- package/src/page-designer/widget-preview/Preview.vue +322 -322
- package/src/page-designer/widget-preview/WidgetWrapper.vue +197 -197
- package/src/page-designer/widget-preview/directive.js +258 -258
- package/src/visual/CategoryList.vue +563 -563
- package/src/visual/ComponentList.vue +280 -280
- package/src/visual/CreatePage.vue +389 -389
- package/src/visual/EntityCardList.vue +449 -449
- package/src/visual/EntityList.vue +838 -838
- package/src/visual/config-page/ComponentLibraryDialog.vue +7 -1
- package/src/visual/config-page/DashboardMobile.vue +934 -934
- package/src/visual/widgets/ProcessFormItemVisual.vue +58 -58
- package/types/index.d.ts +22 -22
- package/types/page-designer.d.ts +3 -3
- package/types/visual-component.d.ts +1 -1
- package/types/visual-entity-list.d.ts +1 -1
- package/types/visual-entity-sub-list.d.ts +1 -1
|
@@ -164,9 +164,12 @@ export default {
|
|
|
164
164
|
)
|
|
165
165
|
},
|
|
166
166
|
renderForm () {
|
|
167
|
-
const {
|
|
167
|
+
const { operatePosition } = this.$configs
|
|
168
|
+
// 与运行时 AddForm 一致:按钮区放顶部仅 PC 端生效
|
|
169
|
+
const operateTop = operatePosition === 'top' && !this.$isMobile
|
|
168
170
|
return (
|
|
169
171
|
<div class="epx-add-form__content">
|
|
172
|
+
{ operateTop && this.renderOperateArea(true) }
|
|
170
173
|
<div
|
|
171
174
|
class="epx-add-form__field-group epx-page-designer-widget-preview__drop-zone"
|
|
172
175
|
ref="addForm"
|
|
@@ -192,55 +195,51 @@ export default {
|
|
|
192
195
|
}
|
|
193
196
|
</div>
|
|
194
197
|
</div>
|
|
198
|
+
{ !operateTop && this.renderOperateArea(false) }
|
|
199
|
+
</div>
|
|
200
|
+
)
|
|
201
|
+
},
|
|
202
|
+
// 表单区按钮区;PC 端开了目录时按钮在目录区渲染,此处不渲染
|
|
203
|
+
renderOperateArea (top) {
|
|
204
|
+
const { operateFlag, showCatalog } = this.$configs
|
|
205
|
+
if (this.readonly || !operateFlag || (showCatalog && !this.$isMobile)) return null
|
|
206
|
+
return (
|
|
207
|
+
<div>
|
|
195
208
|
{
|
|
196
|
-
|
|
197
|
-
<div>
|
|
198
|
-
{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
<div class=
|
|
202
|
-
|
|
203
|
-
this.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
// ⚠️ 必须显式传 null 作第二参:select 的 payload 是 (action, index)
|
|
211
|
-
// (Vant 4 与 MobileActionSheet 同形),而 $handler 的签名是
|
|
212
|
-
// (buttonConfigs, row, ...params) ⇒ index 会落进 row。
|
|
213
|
-
// row 不是惰性参数:global.js 里 `this.$operateItem = row`,且
|
|
214
|
-
// `if (row) selections = [{ ...row }]` —— index≥1 时把数字展开成 {},
|
|
215
|
-
// 操作就作用在一个空对象上而不是当前选中行/表单数据。
|
|
216
|
-
// (存量缺陷:Vant 也是这个 payload,换件前就坏,本次一并修。)
|
|
217
|
-
onSelect={action => this.$handler(action, null)}
|
|
218
|
-
/>
|
|
219
|
-
<el-button class="epx-add-form__m-button" size="default" onClick={() => (this.showMobileAction = true)}>{this.$t('operation')}</el-button>
|
|
220
|
-
</div>
|
|
221
|
-
) : this.operates.map(operate => (
|
|
222
|
-
<el-button loading={this.httpLoading[operate.handler + '-' + operate.text]} class="epx-add-form__m-button-one" key={operate.text} type={operate.ui}>{operate.text}</el-button>
|
|
223
|
-
))
|
|
224
|
-
}
|
|
209
|
+
this.$isMobile ? (
|
|
210
|
+
<div class={['epx-add-form__m-buttongroup', { 'epx-add-form__m-button-more': this.operates.length > 3 }]}>
|
|
211
|
+
<div class={['epx-add-form__m-button-inner', { 'epx-add-form__m-button-change': !this.screenHeightNoChange }]}>
|
|
212
|
+
{
|
|
213
|
+
this.operates.length > 3 ? (
|
|
214
|
+
<div class="epx-add-form__m-operate">
|
|
215
|
+
<MobileActionSheet
|
|
216
|
+
v-model={this.showMobileAction}
|
|
217
|
+
actions={this.operates.map(item => ({ ...item, name: item.text }))}
|
|
218
|
+
cancel-text={this.$t('cancel')}
|
|
219
|
+
close-on-click-action
|
|
220
|
+
onSelect={action => this.$handler(action, null)}
|
|
221
|
+
/>
|
|
222
|
+
<el-button class="epx-add-form__m-button" size="default" onClick={() => (this.showMobileAction = true)}>{this.$t('operation')}</el-button>
|
|
225
223
|
</div>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
224
|
+
) : this.operates.map(operate => (
|
|
225
|
+
<el-button loading={this.httpLoading[operate.handler + '-' + operate.text]} class="epx-add-form__m-button-one" key={operate.text} type={operate.ui}>{operate.text}</el-button>
|
|
226
|
+
))
|
|
227
|
+
}
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
) : (
|
|
231
|
+
<div class={['epx-add-form__button-group', { 'epx-add-form__button-group--top': top }]}>
|
|
232
|
+
{
|
|
233
|
+
this.operates.map(operate => (
|
|
234
|
+
<el-button loading={this.httpLoading[operate.handler + '-' + operate.text]} size="default" style={{ width: operate.width + 'px' }} key={operate.text} {...{ [operate.type]: true }} type={operate.type === 'text' ? 'text' : operate.ui}>
|
|
235
|
+
{ operate.icon && <i class={[operate.icon]}></i> }
|
|
236
|
+
{operate.text}
|
|
237
|
+
</el-button>
|
|
238
|
+
))
|
|
239
239
|
}
|
|
240
240
|
</div>
|
|
241
241
|
)
|
|
242
242
|
}
|
|
243
|
-
|
|
244
243
|
</div>
|
|
245
244
|
)
|
|
246
245
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
<i class="epx-icon-quxiaofenzu" title="拆分模板"></i>
|
|
15
15
|
<span>拆分</span>
|
|
16
16
|
</span>
|
|
17
|
+
<i v-else class="epx-page-designer-setting__widget-switch el-icon-sort" title="切换组件" @click="showSwitchDialog=true"></i>
|
|
17
18
|
<el-popover
|
|
18
19
|
ref="codeEditorPopover"
|
|
19
20
|
placement="bottom"
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
</el-popover>
|
|
30
31
|
</div>
|
|
31
32
|
</template>
|
|
32
|
-
<epx-page-designer-setting-property :key="
|
|
33
|
+
<epx-page-designer-setting-property :key="propertyKey" :designer="designer" :relationList="relationList">
|
|
33
34
|
</epx-page-designer-setting-property>
|
|
34
35
|
</el-tab-pane>
|
|
35
36
|
<el-tab-pane :label="$t('style')" name="style" lazy>
|
|
@@ -40,6 +41,10 @@
|
|
|
40
41
|
<epx-page-designer-setting-advance :key="widgetId" :designer="designer"></epx-page-designer-setting-advance>
|
|
41
42
|
</el-tab-pane>
|
|
42
43
|
</el-tabs>
|
|
44
|
+
<!-- 切换组件:复用新增组件的组件库弹窗 -->
|
|
45
|
+
<el-dialog title="切换组件" v-model="showSwitchDialog" width="960px" append-to-body>
|
|
46
|
+
<epx-visual-component-library-dialog hide-template @click="switchComponent"></epx-visual-component-library-dialog>
|
|
47
|
+
</el-dialog>
|
|
43
48
|
</el-container>
|
|
44
49
|
</template>
|
|
45
50
|
|
|
@@ -61,7 +66,9 @@ export default {
|
|
|
61
66
|
data () {
|
|
62
67
|
return {
|
|
63
68
|
activeTab: 'property',
|
|
64
|
-
showCodeEditor: false
|
|
69
|
+
showCodeEditor: false,
|
|
70
|
+
showPropertyPanel: true,
|
|
71
|
+
showSwitchDialog: false
|
|
65
72
|
}
|
|
66
73
|
},
|
|
67
74
|
computed: {
|
|
@@ -75,6 +82,10 @@ export default {
|
|
|
75
82
|
if (!this.designer.selectedWidget) return this.designer.page.pageId
|
|
76
83
|
return this.designer.selectedWidget.id
|
|
77
84
|
},
|
|
85
|
+
// 切换组件后 id 不变,属性面板需按组件类型重建,才能加载新组件的配置面板
|
|
86
|
+
propertyKey () {
|
|
87
|
+
return this.widgetId + '_' + (this.designer.selectedWidget?.contentType || '')
|
|
88
|
+
},
|
|
78
89
|
widgetConfig () {
|
|
79
90
|
const { configs = {}, id } = this.designer.selectedWidget
|
|
80
91
|
const widgetConfig = this.designer.widgetConfig[id] || {}
|
|
@@ -134,6 +145,13 @@ export default {
|
|
|
134
145
|
}
|
|
135
146
|
})
|
|
136
147
|
},
|
|
148
|
+
// 换成弹窗中选择的组件,组件 id 不变,原配置保留
|
|
149
|
+
switchComponent (widgetInfo) {
|
|
150
|
+
this.showSwitchDialog = false
|
|
151
|
+
const widget = this.designer.selectedWidget
|
|
152
|
+
if (!widget || widget.contentType === widgetInfo.CODE) return
|
|
153
|
+
this.designer.switchWidget(widget, widgetInfo)
|
|
154
|
+
},
|
|
137
155
|
updateWidgetConfig (v) {
|
|
138
156
|
this.designer.updateWidgetConfig(this.designer.selectedWidget.id, v)
|
|
139
157
|
},
|
|
@@ -243,6 +261,10 @@ export default {
|
|
|
243
261
|
cursor: pointer;
|
|
244
262
|
margin-top: -2px;
|
|
245
263
|
}
|
|
264
|
+
@include e(widget-switch) {
|
|
265
|
+
font-size: 16px;
|
|
266
|
+
margin-left: 4px;
|
|
267
|
+
}
|
|
246
268
|
@include e(widget-split) {
|
|
247
269
|
@include font_color_primary;
|
|
248
270
|
font-size: var(--epx-font-size-base);
|