vue2-client 1.8.259 → 1.8.261
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/.env +19 -19
- package/.eslintrc.js +90 -90
- package/CHANGELOG.md +824 -824
- package/Components.md +60 -60
- package/babel.config.js +21 -21
- package/docs/index.md +30 -30
- package/docs/lowcode.md +188 -188
- package/docs/lowcodeForDeveloper.md +200 -192
- package/index.js +31 -31
- package/jest-transform-stub.js +8 -8
- package/jest.config.js +21 -21
- package/jest.setup.js +7 -7
- package/package.json +95 -95
- package/public/index.html +27 -27
- package/src/App.vue +188 -188
- package/src/ReportView.js +19 -19
- package/src/assets/img/querySlotDemo.svg +15 -15
- package/src/assets/svg/badtwo.svg +1 -1
- package/src/assets/svg/goodtwo.svg +1 -1
- package/src/base-client/components/common/AMisRender/index.js +3 -3
- package/src/base-client/components/common/AMisRender/index.vue +263 -263
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +413 -413
- package/src/base-client/components/common/AddressSearchCombobox/demo.vue +36 -36
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
- package/src/base-client/components/common/CitySelect/CitySelect.vue +348 -348
- package/src/base-client/components/common/CitySelect/index.js +3 -3
- package/src/base-client/components/common/CitySelect/index.md +109 -109
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1014 -1014
- package/src/base-client/components/common/CreateQuery/index.js +3 -3
- package/src/base-client/components/common/CreateQuery/index.md +42 -42
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +452 -452
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +511 -511
- package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
- package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
- package/src/base-client/components/common/FormGroupEdit/index.js +3 -3
- package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +166 -166
- package/src/base-client/components/common/FormGroupQuery/index.js +3 -3
- package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
- package/src/base-client/components/common/LowCodeComponent/LowCodePageOrganization.vue +394 -355
- package/src/base-client/components/common/LowCodePageRender/LowCodePageRender.vue +29 -29
- package/src/base-client/components/common/LowCodePageRender/editorPageRender.vue +533 -467
- package/src/base-client/components/common/LowCodePageRender/index.js +3 -3
- package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
- package/src/base-client/components/common/PersonSetting/index.js +3 -3
- package/src/base-client/components/common/Tree/Tree.vue +149 -149
- package/src/base-client/components/common/Tree/index.js +2 -2
- package/src/base-client/components/common/Upload/Upload.vue +197 -197
- package/src/base-client/components/common/Upload/index.js +3 -3
- package/src/base-client/components/common/XAddForm/XAddForm.vue +98 -98
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +732 -732
- package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
- package/src/base-client/components/common/XAddNativeForm/lowcodeEditorRegister.js +16 -12
- package/src/base-client/components/common/XAddNativeFormOA/XAddNativeFormOA.vue +303 -303
- package/src/base-client/components/common/XAddNativeFormOA/index.js +3 -3
- package/src/base-client/components/common/XAddNativeFormOA/index.md +146 -146
- package/src/base-client/components/common/XBadge/XBadge.vue +78 -78
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
- package/src/base-client/components/common/XDataDrawer/index.js +3 -3
- package/src/base-client/components/common/XDataDrawer/index.md +41 -41
- package/src/base-client/components/common/XDescriptions/XDescriptions.vue +167 -167
- package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +299 -299
- package/src/base-client/components/common/XDescriptions/demo.vue +50 -50
- package/src/base-client/components/common/XDescriptions/index.js +3 -3
- package/src/base-client/components/common/XDescriptions/index.md +83 -83
- package/src/base-client/components/common/XDescriptions/lowcodeEditorRegister.js +15 -5
- package/src/base-client/components/common/XDetailsView/XDetailsView.vue +214 -214
- package/src/base-client/components/common/XDetailsView/index.js +3 -3
- package/src/base-client/components/common/XForm/XForm.vue +281 -281
- package/src/base-client/components/common/XForm/XFormItem.vue +807 -807
- package/src/base-client/components/common/XForm/XTreeSelect.vue +206 -206
- package/src/base-client/components/common/XForm/index.md +178 -178
- package/src/base-client/components/common/XFormCol/XFormCol.vue +36 -36
- package/src/base-client/components/common/XFormGroup/XFormGroup.vue +241 -241
- package/src/base-client/components/common/XFormGroup/demo.vue +40 -40
- package/src/base-client/components/common/XFormGroup/index.js +3 -3
- package/src/base-client/components/common/XFormGroup/index.md +38 -38
- package/src/base-client/components/common/XFormGroupDetails/XFormGroupDetails.vue +72 -72
- package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
- package/src/base-client/components/common/XFormTable/XFormTable.vue +519 -519
- package/src/base-client/components/common/XFormTable/index.md +98 -98
- package/src/base-client/components/common/XFormTable/lowcodeEditorRegister.js +16 -12
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +147 -147
- package/src/base-client/components/common/XReport/XReport.vue +843 -843
- package/src/base-client/components/common/XReport/XReportDemo.vue +2233 -2233
- package/src/base-client/components/common/XReport/XReportDesign.vue +470 -470
- package/src/base-client/components/common/XReport/XReportJsonRender.vue +267 -267
- package/src/base-client/components/common/XReport/XReportTrGroup.vue +745 -742
- package/src/base-client/components/common/XReport/index.js +3 -3
- package/src/base-client/components/common/XReport/index.md +44 -44
- package/src/base-client/components/common/XReportSlot/XReportSlot.vue +110 -110
- package/src/base-client/components/common/XReportSlot/index.js +3 -3
- package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
- package/src/base-client/components/common/XStepView/index.js +3 -3
- package/src/base-client/components/common/XStepView/index.md +31 -31
- package/src/base-client/components/common/XTable/XTable.vue +636 -636
- package/src/base-client/components/common/XTable/index.md +255 -255
- package/src/base-client/components/common/XTree/XTree.vue +318 -318
- package/src/base-client/components/common/XTree/index.js +3 -3
- package/src/base-client/components/common/XTree/index.md +36 -36
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +114 -114
- package/src/base-client/components/common/XTreeOne/lowcodeEditorRegister.js +11 -9
- package/src/base-client/components/index.js +51 -51
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/plugins/AppData.js +115 -115
- package/src/base-client/plugins/Config.js +19 -19
- package/src/base-client/plugins/GetLoginInfoService.js +183 -183
- package/src/base-client/plugins/tabs-page-plugin.js +39 -39
- package/src/bootstrap.js +39 -39
- package/src/components/CodeMirror/inedx.vue +118 -118
- package/src/components/CodeMirror/setting.js +40 -40
- package/src/components/FilePreview/FilePreview.vue +166 -166
- package/src/components/NumberInfo/NumberInfo.vue +54 -54
- package/src/components/STable/index.js +323 -323
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/menu/SideMenu.vue +75 -75
- package/src/components/menu/menu.js +273 -273
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/config/CreateQueryConfig.js +322 -322
- package/src/config/default/antd.config.js +89 -89
- package/src/config/default/setting.config.js +55 -55
- package/src/font-style/font.css +4 -4
- package/src/layouts/CommonLayout.vue +56 -56
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +138 -138
- package/src/layouts/header/AdminHeader.vue +132 -132
- package/src/layouts/header/HeaderNotice.vue +177 -177
- package/src/layouts/tabs/TabsHead.vue +189 -189
- package/src/layouts/tabs/TabsView.vue +387 -387
- package/src/lib.js +1 -1
- package/src/main.js +26 -26
- package/src/mock/extend/index.js +84 -84
- package/src/mock/goods/index.js +108 -108
- package/src/pages/AMisDemo/AMisDemo.vue +325 -325
- package/src/pages/AMisDemo/AMisDemo2.vue +74 -74
- package/src/pages/DynamicStatistics/ChartSelector.vue +331 -331
- package/src/pages/DynamicStatistics/DataTabs.vue +83 -83
- package/src/pages/DynamicStatistics/DynamicTable.vue +128 -128
- package/src/pages/DynamicStatistics/EvaluationArea.vue +69 -69
- package/src/pages/DynamicStatistics/FavoriteList.vue +51 -51
- package/src/pages/DynamicStatistics/QuestionHistoryAndFavorites.vue +591 -591
- package/src/pages/DynamicStatistics/SearchBar.vue +192 -192
- package/src/pages/DynamicStatistics/index.vue +282 -282
- package/src/pages/Example/index.vue +32 -32
- package/src/pages/NewDynamicStatistics/ChartSelector.vue +331 -331
- package/src/pages/NewDynamicStatistics/DataTabs.vue +122 -122
- package/src/pages/NewDynamicStatistics/DynamicTable.vue +128 -128
- package/src/pages/NewDynamicStatistics/EvaluationArea.vue +69 -69
- package/src/pages/NewDynamicStatistics/FavoriteList.vue +51 -51
- package/src/pages/NewDynamicStatistics/QuestionHistoryAndFavorites.vue +289 -289
- package/src/pages/NewDynamicStatistics/SearchBar.vue +193 -193
- package/src/pages/NewDynamicStatistics/index.vue +258 -258
- package/src/pages/ServiceReview/index.vue +284 -284
- package/src/pages/XReportView/index.vue +62 -62
- package/src/pages/login/Login.vue +378 -378
- package/src/pages/login/LoginV3.vue +389 -389
- package/src/pages/lowCode/lowCodeEditor.vue +1501 -1285
- package/src/pages/lowCode/lowCodeRender.vue +39 -39
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/dictionary/index.vue +44 -44
- package/src/pages/system/monitor/loginInfor/index.vue +37 -37
- package/src/pages/system/monitor/operLog/index.vue +37 -37
- package/src/pages/system/settings/modifyPassword.vue +117 -117
- package/src/pages/system/ticket/index.vue +480 -480
- package/src/pages/system/ticket/submitTicketSuccess.vue +484 -484
- package/src/router/async/config.async.js +33 -33
- package/src/router/async/router.map.js +107 -107
- package/src/router/guards.js +220 -220
- package/src/router/index.js +27 -27
- package/src/router.js +19 -19
- package/src/services/api/TicketDetailsViewApi.js +46 -46
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +284 -284
- package/src/services/api/entity.js +18 -18
- package/src/services/api/index.js +17 -17
- package/src/services/api/restTools.js +46 -46
- package/src/services/apiService.js +14 -14
- package/src/services/user.js +71 -71
- package/src/store/modules/setting.js +119 -119
- package/src/theme/default/style.less +57 -57
- package/src/theme/global.less +130 -130
- package/src/utils/authority-utils.js +85 -85
- package/src/utils/errorCode.js +6 -6
- package/src/utils/htmlToPDF.js +108 -108
- package/src/utils/htmlToPDFApi.js +5 -5
- package/src/utils/indexedDB.js +201 -201
- package/src/utils/login.js +144 -144
- package/src/utils/lowcode/lowcodeComponentMixin.js +112 -78
- package/src/utils/lowcode/lowcodeLog.js +29 -29
- package/src/utils/lowcode/lowcodeUtils.js +276 -129
- package/src/utils/lowcode/registerComponentForEditor.js +11 -11
- package/src/utils/lowcode/registerComponentForRender.js +11 -11
- package/src/utils/map-utils.js +47 -47
- package/src/utils/reg.js +19 -19
- package/src/utils/request.js +343 -343
- package/src/utils/routerUtil.js +435 -435
- package/src/utils/runEvalFunction.js +6 -6
- package/src/utils/util.js +241 -241
- package/src/utils/waterMark.js +31 -31
- package/test/Amis.spec.js +163 -163
- package/test/Tree.spec.js +167 -167
- package/test/myDialog.spec.js +46 -46
- package/vue.config.js +177 -177
- package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
|
@@ -1,1285 +1,1501 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<!-- 标题 -->
|
|
4
|
-
<a-card>
|
|
5
|
-
<a-page-header
|
|
6
|
-
title="奥枫低代码前端编辑器"
|
|
7
|
-
sub-title="af-lowcode"
|
|
8
|
-
:backIcon="false"
|
|
9
|
-
@back="() => null"
|
|
10
|
-
>
|
|
11
|
-
<template slot="extra">
|
|
12
|
-
<a-button @click="test">测试</a-button>
|
|
13
|
-
<a-button @click="editModeActive">编辑</a-button>
|
|
14
|
-
<a-button @click="previewModeActive">预览</a-button>
|
|
15
|
-
<a-button type="primary" @click="exportConfig">导出</a-button>
|
|
16
|
-
</template>
|
|
17
|
-
</a-page-header>
|
|
18
|
-
</a-card>
|
|
19
|
-
<!-- 预览模式 -->
|
|
20
|
-
<a-card v-if="preview">
|
|
21
|
-
<editor-page-render :page-config="config" :edit-mode="false"/>
|
|
22
|
-
</a-card>
|
|
23
|
-
<!-- 编辑模式 -->
|
|
24
|
-
<div v-show="!preview">
|
|
25
|
-
<a-row :gutter="2">
|
|
26
|
-
<!-- 左侧 -->
|
|
27
|
-
<a-col :span="4">
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</a-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</
|
|
56
|
-
</a-
|
|
57
|
-
</
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
v-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
<a-select-option
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
</a-select-option>
|
|
240
|
-
</a-select>
|
|
241
|
-
</a-form-item>
|
|
242
|
-
<!--
|
|
243
|
-
<a-form-item label="
|
|
244
|
-
<a-select
|
|
245
|
-
<a-select-option
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
</a-select-option>
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
<a-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
<
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
<
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
//
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
},
|
|
705
|
-
//
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
//
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
this.refreshOrganization()
|
|
830
|
-
},
|
|
831
|
-
//
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
this.
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
} else {
|
|
932
|
-
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
this.
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
this.
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
this.
|
|
1068
|
-
//
|
|
1069
|
-
if (
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
this.
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
//
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
//
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
//
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
.
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
.
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
.
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<!-- 标题 -->
|
|
4
|
+
<a-card>
|
|
5
|
+
<a-page-header
|
|
6
|
+
title="奥枫低代码前端编辑器"
|
|
7
|
+
sub-title="af-lowcode"
|
|
8
|
+
:backIcon="false"
|
|
9
|
+
@back="() => null"
|
|
10
|
+
>
|
|
11
|
+
<template slot="extra">
|
|
12
|
+
<a-button @click="test">测试</a-button>
|
|
13
|
+
<a-button @click="editModeActive">编辑</a-button>
|
|
14
|
+
<a-button @click="previewModeActive">预览</a-button>
|
|
15
|
+
<a-button type="primary" @click="exportConfig">导出</a-button>
|
|
16
|
+
</template>
|
|
17
|
+
</a-page-header>
|
|
18
|
+
</a-card>
|
|
19
|
+
<!-- 预览模式 -->
|
|
20
|
+
<a-card v-if="preview">
|
|
21
|
+
<editor-page-render :page-config="config" :edit-mode="false"/>
|
|
22
|
+
</a-card>
|
|
23
|
+
<!-- 编辑模式 -->
|
|
24
|
+
<div v-show="!preview">
|
|
25
|
+
<a-row :gutter="2">
|
|
26
|
+
<!-- 左侧 -->
|
|
27
|
+
<a-col :span="4">
|
|
28
|
+
<a-card>
|
|
29
|
+
<a-tabs>
|
|
30
|
+
<!-- UI库 -->
|
|
31
|
+
<a-tab-pane key="1" tab="UI库">
|
|
32
|
+
<a-card style="margin-bottom: 5%">
|
|
33
|
+
<!-- 所有组件 -->
|
|
34
|
+
<a-card-grid class="ui-item" @click="addContainer">
|
|
35
|
+
组件容器
|
|
36
|
+
</a-card-grid>
|
|
37
|
+
<template v-for="(item, index) in getRegisteredComponents()">
|
|
38
|
+
<a-card-grid :key="index" class="ui-item" @click="addComponentToContainer(item)">
|
|
39
|
+
{{ item }}
|
|
40
|
+
</a-card-grid>
|
|
41
|
+
</template>
|
|
42
|
+
</a-card>
|
|
43
|
+
</a-tab-pane>
|
|
44
|
+
<!-- 页面架构 -->
|
|
45
|
+
<a-tab-pane key="2" tab="架构">
|
|
46
|
+
<div style="margin-bottom: 3%">
|
|
47
|
+
<LowCodePageOrganization
|
|
48
|
+
:config="config"
|
|
49
|
+
v-if="showPageOrganization"
|
|
50
|
+
@rename="rename"
|
|
51
|
+
@pasteItem="handlePasteItem"
|
|
52
|
+
@componentMove="handleTreeDrag"
|
|
53
|
+
@deleteComponent="deleteComponentInTree"
|
|
54
|
+
@treeOrganizationClick="treeOrganizationClick"/>
|
|
55
|
+
</div>
|
|
56
|
+
</a-tab-pane>
|
|
57
|
+
</a-tabs>
|
|
58
|
+
</a-card>
|
|
59
|
+
</a-col>
|
|
60
|
+
<!-- 中间主体编辑器 -->
|
|
61
|
+
<a-col :span="15">
|
|
62
|
+
<a-card>
|
|
63
|
+
<!-- 切换显示的组件 -->
|
|
64
|
+
<div style="margin-bottom: 3%">
|
|
65
|
+
<!-- 添加页面组件按钮 -->
|
|
66
|
+
<div style="float: right">
|
|
67
|
+
<a-popover>
|
|
68
|
+
<template slot="content">
|
|
69
|
+
<p>添加页面组件</p>
|
|
70
|
+
</template>
|
|
71
|
+
<a-button @click="addPageContainer" >
|
|
72
|
+
<a-icon type="plus"/>
|
|
73
|
+
</a-button>
|
|
74
|
+
</a-popover>
|
|
75
|
+
</div>
|
|
76
|
+
<!-- 每个页面按钮切换栏 -->
|
|
77
|
+
<a-menu v-model="mainPageMenu" mode="horizontal" @click="handleMainPageMenuChange">
|
|
78
|
+
<template v-for="(page) in config.page">
|
|
79
|
+
<a-menu-item :key="page.id">{{ page.title + '(' + determinePageType(page.type) + ')' }}</a-menu-item>
|
|
80
|
+
</template>
|
|
81
|
+
</a-menu>
|
|
82
|
+
</div>
|
|
83
|
+
<!-- 渲染器 -->
|
|
84
|
+
<div v-if="activeMainPageType === 'page'">
|
|
85
|
+
<editor-page-render
|
|
86
|
+
v-if="renderPreview"
|
|
87
|
+
@spanDrag="handleDrag"
|
|
88
|
+
@containerDelete="handleContainerDelete"
|
|
89
|
+
@clickComponentInEditor="clickComponentInEditor"
|
|
90
|
+
:page-config="{ data: config.data, page: config.page.filter(page => page.id === activeMainPage)}"/>
|
|
91
|
+
<a-skeleton v-else/>
|
|
92
|
+
</div>
|
|
93
|
+
<div v-if="activeMainPageType === 'modal'">
|
|
94
|
+
<editor-page-render
|
|
95
|
+
v-if="renderModalPreview"
|
|
96
|
+
@spanDrag="handleDrag"
|
|
97
|
+
@containerDelete="handleContainerDelete"
|
|
98
|
+
@clickComponentInEditor="clickComponentInEditor"
|
|
99
|
+
:page-config="{ data: config.data, page: config.page.filter(page => page.id === activeMainPage)}"/>
|
|
100
|
+
<a-skeleton v-else/>
|
|
101
|
+
</div>
|
|
102
|
+
<div v-if="activeMainPageType === 'draw'">
|
|
103
|
+
<editor-page-render
|
|
104
|
+
v-if="renderDrawPreview"
|
|
105
|
+
@spanDrag="handleDrag"
|
|
106
|
+
@containerDelete="handleContainerDelete"
|
|
107
|
+
@clickComponentInEditor="clickComponentInEditor"
|
|
108
|
+
:page-config="{ data: config.data, page: config.page.filter(page => page.id === activeMainPage)}"/>
|
|
109
|
+
<a-skeleton v-else/>
|
|
110
|
+
</div>
|
|
111
|
+
</a-card>
|
|
112
|
+
</a-col>
|
|
113
|
+
<!-- 右侧 -->
|
|
114
|
+
<a-col :span="5">
|
|
115
|
+
<!-- 属性编辑 -->
|
|
116
|
+
<a-card>
|
|
117
|
+
<template v-if="editorPropertiesConfig === 'unregistered'">
|
|
118
|
+
<p>所选组件并未注册</p>
|
|
119
|
+
</template>
|
|
120
|
+
<template v-else>
|
|
121
|
+
<!-- 组件名 -->
|
|
122
|
+
<template v-if="editorPropertiesConfig.name">
|
|
123
|
+
<h3>组件名</h3>
|
|
124
|
+
<h4>{{ editorPropertiesConfig.name }}</h4>
|
|
125
|
+
</template>
|
|
126
|
+
<template v-else-if="editorPropertiesConfig.id">
|
|
127
|
+
<h3>组件ID</h3>
|
|
128
|
+
<h4>{{ editorPropertiesConfig.id }}</h4>
|
|
129
|
+
</template>
|
|
130
|
+
<!-- 切换 -->
|
|
131
|
+
<a-menu v-model="editorPanelCurrent" mode="horizontal" @click="() => null">
|
|
132
|
+
<a-menu-item key="properties">属性</a-menu-item>
|
|
133
|
+
<a-menu-item key="events">事件</a-menu-item>
|
|
134
|
+
</a-menu>
|
|
135
|
+
<!-- 属性编辑 -->
|
|
136
|
+
<div v-if="editorPanelCurrent[0] === 'properties'">
|
|
137
|
+
<div v-if="editorPropertiesConfig.props !== undefined">
|
|
138
|
+
<div>
|
|
139
|
+
栅格数:<a-input :default-value="editorPropertiesConfig.span" @change="changeSpan"/>
|
|
140
|
+
</div>
|
|
141
|
+
<template v-for="(value,key) in editorPropertiesConfig.props">
|
|
142
|
+
<div :key="editorPropertiesConfig.id + '_' + key">
|
|
143
|
+
<a-tooltip>
|
|
144
|
+
<template slot="title" v-if="resolveEditorPropsLabel(editorPropertiesConfig.type, key).desc">
|
|
145
|
+
{{ resolveEditorPropsLabel(editorPropertiesConfig.type, key).desc }}
|
|
146
|
+
</template>
|
|
147
|
+
{{ resolveEditorPropsLabel(editorPropertiesConfig.type, key).label }}:
|
|
148
|
+
</a-tooltip>
|
|
149
|
+
<a-input :default-value="value" @change="editorPropertiesInputChange($event, key)"/>
|
|
150
|
+
</div>
|
|
151
|
+
</template>
|
|
152
|
+
</div>
|
|
153
|
+
<p v-else>您未选择任何组件</p>
|
|
154
|
+
</div>
|
|
155
|
+
<!-- 事件编辑 -->
|
|
156
|
+
<div v-else-if="editorPanelCurrent[0] === 'events'">
|
|
157
|
+
<template v-if="editorPropertiesConfig.onEvent !== undefined">
|
|
158
|
+
<a-collapse v-model="eventCollapseActive">
|
|
159
|
+
<a-collapse-panel
|
|
160
|
+
v-for="(eventConfig,eventType) in editorPropertiesConfig.onEvent"
|
|
161
|
+
:key="eventType"
|
|
162
|
+
:header="eventType">
|
|
163
|
+
<div v-for="(singleEvent,singleEventIndex) in eventConfig" :key="singleEventIndex" class="singleEvent">
|
|
164
|
+
<p>
|
|
165
|
+
<span style="color:rgb( 24,144,255)">{{ singleEvent.eventType }}</span>
|
|
166
|
+
事件
|
|
167
|
+
</p>
|
|
168
|
+
<!-- 事件 编辑/删除 按钮 -->
|
|
169
|
+
<div style="display: flex; justify-content: space-evenly">
|
|
170
|
+
<a-icon type="edit" theme="twoTone" class="edit_icon" @click="editEventIconClick(eventType,singleEventIndex)"/>
|
|
171
|
+
<a-popconfirm title="确认删除" ok-text="确认删除" cancel-text="取消" @confirm="removeEventClick(eventType,singleEventIndex)" @cancel="() => null">
|
|
172
|
+
<a-icon type="delete" theme="twoTone" class="edit_icon"/>
|
|
173
|
+
</a-popconfirm>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</a-collapse-panel>
|
|
177
|
+
</a-collapse>
|
|
178
|
+
</template>
|
|
179
|
+
<a-button v-if="editorPropertiesConfig.id !== undefined" @click="addEvent">添加事件</a-button>
|
|
180
|
+
<p v-else>您未选择任何组件</p>
|
|
181
|
+
</div>
|
|
182
|
+
</template>
|
|
183
|
+
</a-card>
|
|
184
|
+
</a-col>
|
|
185
|
+
</a-row>
|
|
186
|
+
</div>
|
|
187
|
+
<!-- 自定义事件弹框 -->
|
|
188
|
+
<a-modal
|
|
189
|
+
title="事件编辑器"
|
|
190
|
+
width="60%"
|
|
191
|
+
:z-index="1001"
|
|
192
|
+
:destroyOnClose="true"
|
|
193
|
+
@ok="handleEventEditorOk"
|
|
194
|
+
@cancel="handleEventEditorCancel"
|
|
195
|
+
v-if="showEventEditor"
|
|
196
|
+
:visible="showEventEditor">
|
|
197
|
+
<a-form :label-col="{ span: 6 }" :wrapper-col="{ span: 14 }">
|
|
198
|
+
<!-- 事件触发类型 -->
|
|
199
|
+
<a-form-item label="事件触发类型">
|
|
200
|
+
<a-select @change="handleEventEditorTypeChange" :default-value="eventEditorContent.emitType">
|
|
201
|
+
<a-select-option
|
|
202
|
+
v-for="(eventType, eventTypeIndex) in editorPropertiesConfig.selfEvent"
|
|
203
|
+
:key="eventTypeIndex"
|
|
204
|
+
:value="eventType">
|
|
205
|
+
{{ eventType }}
|
|
206
|
+
</a-select-option>
|
|
207
|
+
<a-select-option value="customEmitType">
|
|
208
|
+
自定义触发类型
|
|
209
|
+
</a-select-option>
|
|
210
|
+
<a-select-option value="lifeCycle">
|
|
211
|
+
生命周期函数
|
|
212
|
+
</a-select-option>
|
|
213
|
+
</a-select>
|
|
214
|
+
</a-form-item>
|
|
215
|
+
<!-- 自定义事件触发类型 -->
|
|
216
|
+
<a-form-item label="自定义事件触发名" v-if="eventEditorContent.emitType === 'customEmitType'">
|
|
217
|
+
<a-input v-model="eventEditorContent.customEmitType"/>
|
|
218
|
+
</a-form-item>
|
|
219
|
+
<!-- 事件类型 -->
|
|
220
|
+
<a-form-item label="事件类型" v-if="eventEditorContent.emitType !== 'lifeCycle'">
|
|
221
|
+
<a-select @change="handleEventEditorEventTypeChange" :default-value="eventEditorContent.eventType">
|
|
222
|
+
<a-select-option value="changeValue">
|
|
223
|
+
修改组件的值
|
|
224
|
+
</a-select-option>
|
|
225
|
+
<a-select-option value="changeProps">
|
|
226
|
+
修改组件的Props
|
|
227
|
+
</a-select-option>
|
|
228
|
+
<a-select-option value="runLogic">
|
|
229
|
+
执行Logic
|
|
230
|
+
</a-select-option>
|
|
231
|
+
<a-select-option value="log">
|
|
232
|
+
打印日志
|
|
233
|
+
</a-select-option>
|
|
234
|
+
<a-select-option value="showModal" v-if="this.config.page.filter(page => page.type === 'modal').length > 0">
|
|
235
|
+
修改弹框可见
|
|
236
|
+
</a-select-option>
|
|
237
|
+
<a-select-option value="showDraw" v-if="this.config.page.filter(page => page.type === 'draw').length > 0">
|
|
238
|
+
修改抽屉可见
|
|
239
|
+
</a-select-option>
|
|
240
|
+
</a-select>
|
|
241
|
+
</a-form-item>
|
|
242
|
+
<!-- 生命周期函数 -->
|
|
243
|
+
<a-form-item label="生命周期名" v-if="eventEditorContent.emitType === 'lifeCycle'">
|
|
244
|
+
<a-select @change="handleEventEditorLifeCycleChange" :default-value="eventEditorContent.lifeCycle">
|
|
245
|
+
<a-select-option value="created">
|
|
246
|
+
created
|
|
247
|
+
</a-select-option>
|
|
248
|
+
<a-select-option value="beforeMount">
|
|
249
|
+
beforeMount
|
|
250
|
+
</a-select-option>
|
|
251
|
+
<a-select-option value="mounted">
|
|
252
|
+
mounted
|
|
253
|
+
</a-select-option>
|
|
254
|
+
<a-select-option value="beforeUpdate">
|
|
255
|
+
beforeUpdate
|
|
256
|
+
</a-select-option>
|
|
257
|
+
<a-select-option value="updated">
|
|
258
|
+
updated
|
|
259
|
+
</a-select-option>
|
|
260
|
+
<a-select-option value="beforeDestroy">
|
|
261
|
+
beforeDestroy
|
|
262
|
+
</a-select-option>
|
|
263
|
+
<a-select-option value="destroyed">
|
|
264
|
+
destroyed
|
|
265
|
+
</a-select-option>
|
|
266
|
+
</a-select>
|
|
267
|
+
</a-form-item>
|
|
268
|
+
<!-- 修改弹框可见 or 修改抽屉可见 -->
|
|
269
|
+
<a-form-item label="修改可见" v-if="eventEditorContent.eventType === 'showModal' || eventEditorContent.eventType === 'showDraw'">
|
|
270
|
+
<a-radio-group v-model="eventEditorContent.visible" button-style="solid">
|
|
271
|
+
<a-radio-button value="open">
|
|
272
|
+
显示
|
|
273
|
+
</a-radio-button>
|
|
274
|
+
<a-radio-button value="close">
|
|
275
|
+
隐藏
|
|
276
|
+
</a-radio-button>
|
|
277
|
+
</a-radio-group>
|
|
278
|
+
</a-form-item>
|
|
279
|
+
<!-- 弹框容器ID -->
|
|
280
|
+
<a-form-item label="弹框容器ID" v-if="eventEditorContent.eventType === 'showModal'">
|
|
281
|
+
<a-select v-model="eventEditorContent.containerId">
|
|
282
|
+
<a-select-option
|
|
283
|
+
v-for="(modal) in config.page.filter(page => page.type === 'modal')"
|
|
284
|
+
:key="modal.id"
|
|
285
|
+
:value="modal.id">
|
|
286
|
+
弹框_{{ modal.id }}
|
|
287
|
+
</a-select-option>
|
|
288
|
+
</a-select>
|
|
289
|
+
</a-form-item>
|
|
290
|
+
<!-- 抽屉容器ID -->
|
|
291
|
+
<a-form-item label="抽屉容器ID" v-if="eventEditorContent.eventType === 'showDraw'">
|
|
292
|
+
<a-select v-model="eventEditorContent.containerId">
|
|
293
|
+
<a-select-option
|
|
294
|
+
v-for="(draw) in config.page.filter(page => page.type === 'draw')"
|
|
295
|
+
:key="draw.id"
|
|
296
|
+
:value="draw.id">
|
|
297
|
+
抽屉_{{ draw.id }}
|
|
298
|
+
</a-select-option>
|
|
299
|
+
</a-select>
|
|
300
|
+
</a-form-item>
|
|
301
|
+
<!-- Logic名 -->
|
|
302
|
+
<a-form-item label="Logic名" v-if="eventEditorContent.eventType === 'runLogic'">
|
|
303
|
+
<a-input v-model="eventEditorContent.logicName"/>
|
|
304
|
+
</a-form-item>
|
|
305
|
+
<!-- 服务名 -->
|
|
306
|
+
<a-form-item label="服务名" v-if="eventEditorContent.eventType === 'runLogic'">
|
|
307
|
+
<a-input v-model="eventEditorContent.serviceName"/>
|
|
308
|
+
</a-form-item>
|
|
309
|
+
<!-- 自定义Logic参数,由哪些组件传递 -->
|
|
310
|
+
<a-form-item label="Logic参数取值组件" v-if="eventEditorContent.eventType === 'runLogic'">
|
|
311
|
+
<a-transfer
|
|
312
|
+
:data-source="logicParamTransferDataSource"
|
|
313
|
+
:render="item => item.title"
|
|
314
|
+
:target-keys="eventEditorContent.logicParamTransfer"
|
|
315
|
+
@change="handleLogicParamTransferChange"/>
|
|
316
|
+
</a-form-item>
|
|
317
|
+
<!-- 自定义Logic参数 -->
|
|
318
|
+
<a-form-item label="自定义Logic参数" v-if="eventEditorContent.eventType === 'runLogic'">
|
|
319
|
+
<a-button type="primary" @click="openLogicParamJSEditor">
|
|
320
|
+
打开编辑器
|
|
321
|
+
</a-button>
|
|
322
|
+
</a-form-item>
|
|
323
|
+
<!-- 自定义Logic回调 -->
|
|
324
|
+
<a-form-item label="自定义Logic回调" v-if="eventEditorContent.eventType === 'runLogic'" >
|
|
325
|
+
<a-button type="primary" @click="openLogicCallbackEditor">
|
|
326
|
+
打开编辑器
|
|
327
|
+
</a-button>
|
|
328
|
+
</a-form-item>
|
|
329
|
+
<!-- 修改组件的值 才会显示的其余参数 -->
|
|
330
|
+
<template v-if="eventEditorContent.eventType === 'changeValue' || eventEditorContent.eventType === 'changeProps'">
|
|
331
|
+
<!-- 目标组件 -->
|
|
332
|
+
<a-form-item label="目标组件">
|
|
333
|
+
<a-select @change="handleEventEditorTargetChange" :default-value="eventEditorContent.target">
|
|
334
|
+
<a-select-option
|
|
335
|
+
v-for="(targetId, targetIndex) in getAllRenderedComponents()"
|
|
336
|
+
:key="targetIndex"
|
|
337
|
+
:value="targetId">
|
|
338
|
+
{{ targetId }}
|
|
339
|
+
</a-select-option>
|
|
340
|
+
</a-select>
|
|
341
|
+
</a-form-item>
|
|
342
|
+
<!-- 目标组件执行事件名 -->
|
|
343
|
+
<a-form-item label="目标组件执行事件名" v-if="eventEditorContent.eventName === 'changeValue'">
|
|
344
|
+
<a-select @change="handleEventEditorTargetEventTypeChange" :default-value="eventEditorContent.eventName">
|
|
345
|
+
<a-select-option :value="eventType" v-for="(eventType,eventTypeIndex) in supportedEventType" :key="'eventType_' + eventTypeIndex">
|
|
346
|
+
{{ eventType }}
|
|
347
|
+
</a-select-option>
|
|
348
|
+
</a-select>
|
|
349
|
+
</a-form-item>
|
|
350
|
+
<!-- 目标组件修改值对应的key -->
|
|
351
|
+
<a-form-item label="目标组件修改值对应的key" v-if="eventEditorContent.target !== undefined">
|
|
352
|
+
<a-input v-model="eventEditorContent.targetKey"/>
|
|
353
|
+
</a-form-item>
|
|
354
|
+
</template>
|
|
355
|
+
<!-- 自定义JS方法 -->
|
|
356
|
+
<a-form-item label="自定义JS方法" v-if="eventEditorContent.emitType !== 'lifeCycle'">
|
|
357
|
+
<a-button type="primary" @click="openEventJSEditor">打开编辑器</a-button>
|
|
358
|
+
</a-form-item>
|
|
359
|
+
<!-- 自定义钩子函数 -->
|
|
360
|
+
<a-form-item label="自定义生命周期函数" v-if="eventEditorContent.emitType === 'lifeCycle'">
|
|
361
|
+
<a-button type="primary" @click="openEventLifeCycleJSEditor">打开编辑器</a-button>
|
|
362
|
+
</a-form-item>
|
|
363
|
+
</a-form>
|
|
364
|
+
</a-modal>
|
|
365
|
+
<!-- 自定义JS事件弹框 -->
|
|
366
|
+
<a-modal
|
|
367
|
+
title="事件编辑器"
|
|
368
|
+
width="60%"
|
|
369
|
+
:destroyOnClose="true"
|
|
370
|
+
:z-index="1002"
|
|
371
|
+
@ok="handleJSEventEditorOk"
|
|
372
|
+
@cancel="handleJSEventEditorCancel"
|
|
373
|
+
:visible="showJSEventEditor">
|
|
374
|
+
<a-popover title="参数说明" style="margin-right: 5%">
|
|
375
|
+
<template slot="content">
|
|
376
|
+
<p>该方法有以下几个参数:</p>
|
|
377
|
+
<p>eventType:事件类型,比如:changeValue代表修改目标组件的值</p>
|
|
378
|
+
<p>data:由事件源发出的参数列表</p>
|
|
379
|
+
<p>targetKey:修改目标组件值所对应的key</p>
|
|
380
|
+
<p>sourceVM:事件源的vue对象</p>
|
|
381
|
+
<p>targetVM:目标的vue对象</p>
|
|
382
|
+
</template>
|
|
383
|
+
<a-button type="primary">
|
|
384
|
+
参数说明
|
|
385
|
+
</a-button>
|
|
386
|
+
</a-popover>
|
|
387
|
+
<a-popover title="返回值说明" style="margin-bottom: 5%">
|
|
388
|
+
<template slot="content">
|
|
389
|
+
<p>该方法需要的返回值:</p>
|
|
390
|
+
<p>eventType:事件类型</p>
|
|
391
|
+
<p>data:传递给目标组件的数据</p>
|
|
392
|
+
<p>targetKey:修改目标组件值所对应的key</p>
|
|
393
|
+
</template>
|
|
394
|
+
<a-button type="primary">
|
|
395
|
+
返回值说明
|
|
396
|
+
</a-button>
|
|
397
|
+
</a-popover>
|
|
398
|
+
<code-mirror
|
|
399
|
+
:style-obj="{height:'80%',fontSize:'18px',marginBottom:'15px'}"
|
|
400
|
+
:mode="'javascript'"
|
|
401
|
+
:theme="'monokai'"
|
|
402
|
+
v-model="eventEditorContent.JSFunction"
|
|
403
|
+
:value="eventEditorContent.JSFunction"/>
|
|
404
|
+
</a-modal>
|
|
405
|
+
<!-- 自定义Logic参数JS弹框 -->
|
|
406
|
+
<a-modal
|
|
407
|
+
title="自定义Logic参数JS编辑器"
|
|
408
|
+
width="60%"
|
|
409
|
+
:destroyOnClose="true"
|
|
410
|
+
:z-index="1002"
|
|
411
|
+
@ok="() => { showLogicParamJSEditor = false}"
|
|
412
|
+
@cancel="() => { showLogicParamJSEditor = false}"
|
|
413
|
+
:visible="showLogicParamJSEditor">
|
|
414
|
+
<a-popover title="参数说明" style="margin-right: 5%">
|
|
415
|
+
<template slot="content">
|
|
416
|
+
<p>该方法有以下几个参数:</p>
|
|
417
|
+
<p>componentData:Logic参数取值组件中选中的组件,将会把数据打包存在此对象中,key则为组件的id</p>
|
|
418
|
+
<p>data:由事件源emit发出的参数</p>
|
|
419
|
+
</template>
|
|
420
|
+
<a-button type="primary">
|
|
421
|
+
参数说明
|
|
422
|
+
</a-button>
|
|
423
|
+
</a-popover>
|
|
424
|
+
<a-popover title="返回值说明" style="margin-bottom: 5%">
|
|
425
|
+
<template slot="content">
|
|
426
|
+
<p>该方法需要一个JSON类型的返回值</p>
|
|
427
|
+
<p>该返回值就是传递给Logic执行的参数</p>
|
|
428
|
+
</template>
|
|
429
|
+
<a-button type="primary">
|
|
430
|
+
返回值说明
|
|
431
|
+
</a-button>
|
|
432
|
+
</a-popover>
|
|
433
|
+
<code-mirror
|
|
434
|
+
:style-obj="{height:'80%',fontSize:'18px',marginBottom:'15px'}"
|
|
435
|
+
:mode="'javascript'"
|
|
436
|
+
:theme="'monokai'"
|
|
437
|
+
v-model="eventEditorContent.logicParamJSFunction"
|
|
438
|
+
:value="eventEditorContent.logicParamJSFunction"/>
|
|
439
|
+
</a-modal>
|
|
440
|
+
<!-- 自定义Logic回调弹框 -->
|
|
441
|
+
<a-modal
|
|
442
|
+
title="事件编辑器"
|
|
443
|
+
width="60%"
|
|
444
|
+
:destroyOnClose="true"
|
|
445
|
+
:z-index="1002"
|
|
446
|
+
@ok="() => { showLogicCallBackEditor = false}"
|
|
447
|
+
@cancel="() => { showLogicCallBackEditor = false}"
|
|
448
|
+
:visible="showLogicCallBackEditor">
|
|
449
|
+
<a-popover title="参数说明" style="margin-bottom: 5%">
|
|
450
|
+
<template slot="content">
|
|
451
|
+
<p>该方法有以下几个参数:</p>
|
|
452
|
+
<p>componentsMap:所有组件注册的Map</p>
|
|
453
|
+
<p>responseData:后端的返回值</p>
|
|
454
|
+
</template>
|
|
455
|
+
<a-button type="primary">
|
|
456
|
+
参数说明
|
|
457
|
+
</a-button>
|
|
458
|
+
</a-popover>
|
|
459
|
+
<code-mirror
|
|
460
|
+
:style-obj="{height:'80%',fontSize:'18px',marginBottom:'15px'}"
|
|
461
|
+
:mode="'javascript'"
|
|
462
|
+
:theme="'monokai'"
|
|
463
|
+
v-model="eventEditorContent.logicCallBackFunction"
|
|
464
|
+
:value="eventEditorContent.logicCallBackFunction"/>
|
|
465
|
+
</a-modal>
|
|
466
|
+
<!-- 自定义生命周期函数弹框 -->
|
|
467
|
+
<a-modal
|
|
468
|
+
title="生命周期函数编辑器"
|
|
469
|
+
width="60%"
|
|
470
|
+
:destroyOnClose="true"
|
|
471
|
+
:z-index="1002"
|
|
472
|
+
@ok="() => { showLifeCycleFunctionEditor = false}"
|
|
473
|
+
@cancel="() => { showLifeCycleFunctionEditor = false}"
|
|
474
|
+
:visible="showLifeCycleFunctionEditor">
|
|
475
|
+
<a-popover title="参数说明" style="margin-bottom: 5%">
|
|
476
|
+
<template slot="content">
|
|
477
|
+
<p>该方法有以下几个参数:</p>
|
|
478
|
+
<p>vm:VUE组件对象(this)</p>
|
|
479
|
+
</template>
|
|
480
|
+
<a-button type="primary">
|
|
481
|
+
参数说明
|
|
482
|
+
</a-button>
|
|
483
|
+
</a-popover>
|
|
484
|
+
<code-mirror
|
|
485
|
+
:style-obj="{height:'80%',fontSize:'18px',marginBottom:'15px'}"
|
|
486
|
+
:mode="'javascript'"
|
|
487
|
+
:theme="'monokai'"
|
|
488
|
+
v-model="eventEditorContent.LifeCycleFunction"
|
|
489
|
+
:value="eventEditorContent.LifeCycleFunction"/>
|
|
490
|
+
</a-modal>
|
|
491
|
+
<!-- 新增页面容器弹框 -->
|
|
492
|
+
<a-modal
|
|
493
|
+
title="新增页面容器"
|
|
494
|
+
width="60%"
|
|
495
|
+
:z-index="1001"
|
|
496
|
+
:destroyOnClose="true"
|
|
497
|
+
@ok="handleAddPageContainerModalOk"
|
|
498
|
+
@cancel="() => { showPageContainerAddModal = false }"
|
|
499
|
+
:visible="showPageContainerAddModal">
|
|
500
|
+
<a-form :label-col="{ span: 7 }" :wrapper-col="{ span: 12 }">
|
|
501
|
+
<!-- 容器类型 -->
|
|
502
|
+
<a-form-item label="容器类型">
|
|
503
|
+
<a-select v-model="addComponentTemp.type" @change="pageContainerAddTypeChange">
|
|
504
|
+
<a-select-option value="page">
|
|
505
|
+
页面
|
|
506
|
+
</a-select-option>
|
|
507
|
+
<a-select-option value="modal">
|
|
508
|
+
弹框
|
|
509
|
+
</a-select-option>
|
|
510
|
+
<a-select-option value="draw">
|
|
511
|
+
抽屉
|
|
512
|
+
</a-select-option>
|
|
513
|
+
</a-select>
|
|
514
|
+
</a-form-item>
|
|
515
|
+
<!-- 标题 -->
|
|
516
|
+
<a-form-item label="标题">
|
|
517
|
+
<a-input v-model="addComponentTemp.title"/>
|
|
518
|
+
</a-form-item>
|
|
519
|
+
<template v-if="addComponentTemp.type !== 'page'">
|
|
520
|
+
<!-- 宽度 -->
|
|
521
|
+
<a-form-item label="宽度">
|
|
522
|
+
<a-input v-model="addComponentTemp.width"/>
|
|
523
|
+
</a-form-item>
|
|
524
|
+
</template>
|
|
525
|
+
</a-form>
|
|
526
|
+
</a-modal>
|
|
527
|
+
</div>
|
|
528
|
+
</template>
|
|
529
|
+
|
|
530
|
+
<script>
|
|
531
|
+
import editorPageRender from '@vue2-client/base-client/components/common/LowCodePageRender/editorPageRender.vue'
|
|
532
|
+
import * as registeredRender from '@vue2-client/utils/lowcode/registerComponentForRender'
|
|
533
|
+
import * as lowcodeUtils from '@vue2-client/utils/lowcode/lowcodeUtils'
|
|
534
|
+
import codeMirror from '@vue2-client/components/CodeMirror/inedx.vue'
|
|
535
|
+
import lowcodeComponentMixin from '@vue2-client/utils/lowcode/lowcodeComponentMixin'
|
|
536
|
+
// eslint-disable-next-line no-unused-vars
|
|
537
|
+
import lowcodeLog from '@vue2-client/utils/lowcode/lowcodeLog'
|
|
538
|
+
import LowCodePageOrganization from '@vue2-client/base-client/components/common/LowCodeComponent/LowCodePageOrganization.vue'
|
|
539
|
+
|
|
540
|
+
// 函数编辑器显示的模板
|
|
541
|
+
const JSEventFunctionTemplate = 'function(eventType, data, targetKey, sourceVM, targetVM) {\n \n return {\n "eventType": eventType,\n "data": data,\n "targetKey": targetKey\n }\n}'
|
|
542
|
+
const LogicParamFunctionTemplate = 'function(componentData, data) {\n \n return {\n \n }\n}'
|
|
543
|
+
const LogicCallBackFunctionTemplate = 'function(componentsMap, responseData) {\n \n}'
|
|
544
|
+
const LifeCycleFunctionTemplate = 'function(vm) {\n \n}'
|
|
545
|
+
|
|
546
|
+
export default {
|
|
547
|
+
components: {
|
|
548
|
+
LowCodePageOrganization,
|
|
549
|
+
editorPageRender,
|
|
550
|
+
codeMirror
|
|
551
|
+
},
|
|
552
|
+
props: {
|
|
553
|
+
// 页面原始的配置,用于从琉璃中读取
|
|
554
|
+
originalConfig: {
|
|
555
|
+
type: Object,
|
|
556
|
+
default: () => {
|
|
557
|
+
return {
|
|
558
|
+
page: []
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
data () {
|
|
564
|
+
return {
|
|
565
|
+
// 主体窗口选择的标签
|
|
566
|
+
mainPageMenu: ['none'],
|
|
567
|
+
// 默认的配置
|
|
568
|
+
config: { page: [] },
|
|
569
|
+
// 选中的容器
|
|
570
|
+
targetContainer: undefined,
|
|
571
|
+
// 控制是否渲染页面
|
|
572
|
+
preview: false,
|
|
573
|
+
// 控制架构树显隐,用于刷新组件
|
|
574
|
+
showPageOrganization: true,
|
|
575
|
+
// 用于保存右侧编辑组件的属性
|
|
576
|
+
editorPropertiesConfig: {},
|
|
577
|
+
// 编辑属性时用到的定时器
|
|
578
|
+
inputTimeout: undefined,
|
|
579
|
+
// 当前激活的是组件事件中哪一类触发属性,对应事件编辑中的手风琴面板
|
|
580
|
+
eventCollapseActive: undefined,
|
|
581
|
+
// 控制事件编辑器弹框显隐
|
|
582
|
+
showEventEditor: false,
|
|
583
|
+
// 控制自定义JS函数弹框显隐
|
|
584
|
+
showJSEventEditor: false,
|
|
585
|
+
// 控制页面显隐,用于属性面板编辑后,触发页面更新
|
|
586
|
+
renderPreview: true,
|
|
587
|
+
// 控制弹框显隐,用于属性面板编辑后,触发页面更新
|
|
588
|
+
renderModalPreview: true,
|
|
589
|
+
// 控制抽屉显隐,用于属性面板编辑后,触发页面更新
|
|
590
|
+
renderDrawPreview: true,
|
|
591
|
+
// 控制右侧编辑器切换标签页
|
|
592
|
+
editorPanelCurrent: ['properties'],
|
|
593
|
+
// 事件编辑内容的缓存
|
|
594
|
+
eventEditorContent: {},
|
|
595
|
+
// 用于事件编辑的回显,在点击事件编辑按钮后,会将此变量赋值
|
|
596
|
+
eventEditorCurrent: undefined,
|
|
597
|
+
// 保存目标组件可以触发哪些事件
|
|
598
|
+
supportedEventType: undefined,
|
|
599
|
+
// 控制自定义Logic参数自定义JS函数弹框显隐
|
|
600
|
+
showLogicParamJSEditor: false,
|
|
601
|
+
// 控制自定义Logic回调弹框显隐
|
|
602
|
+
showLogicCallBackEditor: false,
|
|
603
|
+
// 保存主体中,当前激活的标签栏ID
|
|
604
|
+
activeMainPage: undefined,
|
|
605
|
+
// 保存主体中,当前激活的标签栏类型
|
|
606
|
+
activeMainPageType: undefined,
|
|
607
|
+
// 定义Logic参数从哪些组件获取
|
|
608
|
+
logicParamTransferDataSource: [],
|
|
609
|
+
// 添加页面容器参数
|
|
610
|
+
addComponentTemp: { type: 'page' },
|
|
611
|
+
// 控制添加页面容器弹框显隐
|
|
612
|
+
showPageContainerAddModal: false,
|
|
613
|
+
showLifeCycleFunctionEditor: false
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
provide () {
|
|
617
|
+
return {
|
|
618
|
+
// 将注册的组件传递给子组件
|
|
619
|
+
componentsMap: {}
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
methods: {
|
|
623
|
+
refreshRender () {
|
|
624
|
+
this.renderPreview = false
|
|
625
|
+
this.renderModalPreview = false
|
|
626
|
+
this.renderDrawPreview = false
|
|
627
|
+
this.$nextTick(() => {
|
|
628
|
+
this.renderPreview = true
|
|
629
|
+
this.renderModalPreview = true
|
|
630
|
+
this.renderDrawPreview = true
|
|
631
|
+
})
|
|
632
|
+
},
|
|
633
|
+
// 添加页面容器弹框确认
|
|
634
|
+
handleAddPageContainerModalOk () {
|
|
635
|
+
const result = {
|
|
636
|
+
id: 'page_' + lowcodeUtils.nanoidWithoutSymbol(6),
|
|
637
|
+
type: this.addComponentTemp.type,
|
|
638
|
+
title: this.addComponentTemp.title,
|
|
639
|
+
width: this.addComponentTemp.width,
|
|
640
|
+
body: []
|
|
641
|
+
}
|
|
642
|
+
this.addComponentTemp = { type: 'page' }
|
|
643
|
+
this.config.page.push(result)
|
|
644
|
+
this.refreshOrganization()
|
|
645
|
+
this.showPageContainerAddModal = false
|
|
646
|
+
},
|
|
647
|
+
// 添加页面容器类型修改
|
|
648
|
+
pageContainerAddTypeChange (value) {
|
|
649
|
+
if (value !== 'page') {
|
|
650
|
+
this.addComponentTemp = { width: '70%', type: value }
|
|
651
|
+
} else {
|
|
652
|
+
this.addComponentTemp = { type: value }
|
|
653
|
+
}
|
|
654
|
+
},
|
|
655
|
+
// 添加页面容器
|
|
656
|
+
addPageContainer () {
|
|
657
|
+
this.addComponentTemp = { type: 'page' }
|
|
658
|
+
this.showPageContainerAddModal = true
|
|
659
|
+
},
|
|
660
|
+
// 通过组件类型和key解析出该key对应的中文定义
|
|
661
|
+
resolveEditorPropsLabel (type, key) {
|
|
662
|
+
const def = lowcodeUtils.getEditorConfigByType(type)
|
|
663
|
+
const propsDef = def.properties
|
|
664
|
+
const targetDef = propsDef[key]
|
|
665
|
+
if (!targetDef.label) {
|
|
666
|
+
targetDef.label = key
|
|
667
|
+
targetDef.desc = '未配置该参数的说明!'
|
|
668
|
+
} else if (!targetDef.desc) {
|
|
669
|
+
targetDef.desc = '未配置该参数的说明!'
|
|
670
|
+
}
|
|
671
|
+
return targetDef
|
|
672
|
+
},
|
|
673
|
+
// 架构重命名
|
|
674
|
+
rename (id, newName) {
|
|
675
|
+
const target = lowcodeUtils.getConfig(id, this.config)
|
|
676
|
+
if (id.length <= 2) {
|
|
677
|
+
target.title = newName
|
|
678
|
+
} else {
|
|
679
|
+
target.name = newName
|
|
680
|
+
}
|
|
681
|
+
this.refreshOrganization()
|
|
682
|
+
},
|
|
683
|
+
// 复制粘贴组件
|
|
684
|
+
handlePasteItem (id, copyCache, type) {
|
|
685
|
+
const target = lowcodeUtils.getConfig(id, this.config)
|
|
686
|
+
// 页面中插入行
|
|
687
|
+
if (type === 'page-row') {
|
|
688
|
+
const content = copyCache.content
|
|
689
|
+
const contentKeys = Object.keys(content)
|
|
690
|
+
const result = []
|
|
691
|
+
contentKeys.forEach(key => {
|
|
692
|
+
result.push(content[key])
|
|
693
|
+
})
|
|
694
|
+
target.body.push(result)
|
|
695
|
+
} else if (type === 'row-item') {
|
|
696
|
+
// 行中插入组件
|
|
697
|
+
target.push(copyCache.content)
|
|
698
|
+
} else if (type === 'page') {
|
|
699
|
+
// 复制页面
|
|
700
|
+
this.config.page.push(copyCache)
|
|
701
|
+
this.$message.success('复制成功!')
|
|
702
|
+
}
|
|
703
|
+
this.refreshOrganization()
|
|
704
|
+
},
|
|
705
|
+
// span属性通过input框修改
|
|
706
|
+
changeSpan (event) {
|
|
707
|
+
this.editorPropertiesConfig.span = event.target.value
|
|
708
|
+
},
|
|
709
|
+
// logic从组件中取值穿梭框改变事件
|
|
710
|
+
handleLogicParamTransferChange (targetKeys, direction, moveKeys) {
|
|
711
|
+
this.eventEditorContent.logicParamTransfer = targetKeys
|
|
712
|
+
this.$forceUpdate()
|
|
713
|
+
},
|
|
714
|
+
// 点击架构树
|
|
715
|
+
treeOrganizationClick (id) {
|
|
716
|
+
// 如果类型是page证明,选中的是最外层容器
|
|
717
|
+
// if (type === 'page') {
|
|
718
|
+
// this.mainPageMenu[0] = id
|
|
719
|
+
// this.activeMainPage = id
|
|
720
|
+
// for (let i = 0; i < this.config.page.length; i++) {
|
|
721
|
+
// if (this.config.page[i].id === this.activeMainPage) {
|
|
722
|
+
// this.activeMainPageType = this.config.page[i].type
|
|
723
|
+
// break
|
|
724
|
+
// }
|
|
725
|
+
// }
|
|
726
|
+
// this.$forceUpdate()
|
|
727
|
+
// } else if (type === 'component') {
|
|
728
|
+
// this.config.page.forEach(page => {
|
|
729
|
+
// page.body.forEach(row => {
|
|
730
|
+
// row.forEach(item => {
|
|
731
|
+
// if (item.id === id) {
|
|
732
|
+
// this.mainPageMenu[0] = page.id
|
|
733
|
+
// this.activeMainPage = page.id
|
|
734
|
+
// this.activeMainPageType = page.type
|
|
735
|
+
// this.$forceUpdate()
|
|
736
|
+
// }
|
|
737
|
+
// })
|
|
738
|
+
// })
|
|
739
|
+
// })
|
|
740
|
+
// 将组件选中
|
|
741
|
+
const target = lowcodeUtils.getComponentConfig(id, this.config)
|
|
742
|
+
this.clickComponentInEditor(target)
|
|
743
|
+
},
|
|
744
|
+
// 架构树拖拽事件
|
|
745
|
+
handleTreeDrag (dragKey, dropKey, dropLevel, dropPosition) {
|
|
746
|
+
let dragElement
|
|
747
|
+
// 如果被拖拽的id小于等于5位则为行
|
|
748
|
+
if (dragKey.length <= 5) {
|
|
749
|
+
const targetPageId = dragKey.split('_')[0]
|
|
750
|
+
const targetRowId = dragKey.split('_')[1] - 1
|
|
751
|
+
for (let i = 0; i < this.config.page.length; i++) {
|
|
752
|
+
const page = this.config.page[i]
|
|
753
|
+
if (page.id === targetPageId) {
|
|
754
|
+
dragElement = page.body[targetRowId]
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
this.deleteRow(dragKey)
|
|
758
|
+
} else {
|
|
759
|
+
// 组件的拖拽
|
|
760
|
+
dragElement = JSON.parse(JSON.stringify(lowcodeUtils.getComponentConfig(dragKey, this.config)))
|
|
761
|
+
this.deleteComponent(dragKey, false)
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// position有三种状态,-1表示在目标前,0表示插入,1表示在目标之后
|
|
765
|
+
if (dropPosition === 0) {
|
|
766
|
+
const target = lowcodeUtils.getComponentConfig(dropKey, this.config)
|
|
767
|
+
target.unshift(dragElement)
|
|
768
|
+
this.refreshOrganization()
|
|
769
|
+
this.$forceUpdate()
|
|
770
|
+
} else {
|
|
771
|
+
// 如果目标是一行
|
|
772
|
+
if (dropLevel === 'row') {
|
|
773
|
+
const targetPageId = dropKey.split('_')[0]
|
|
774
|
+
const targetRowId = dropKey.split('_')[1] - 1
|
|
775
|
+
for (let i = 0; i < this.config.page.length; i++) {
|
|
776
|
+
const page = this.config.page[i]
|
|
777
|
+
if (page.id === targetPageId) {
|
|
778
|
+
if (dropPosition > 0) {
|
|
779
|
+
page.body.splice(targetRowId + 1, 0, dragElement)
|
|
780
|
+
} else {
|
|
781
|
+
page.body.splice(targetRowId, 0, dragElement)
|
|
782
|
+
}
|
|
783
|
+
this.refreshOrganization()
|
|
784
|
+
this.$forceUpdate()
|
|
785
|
+
return
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
// 如果目标是组件
|
|
789
|
+
} else if (dropLevel === 'item') {
|
|
790
|
+
for (let i = 0; i < this.config.page.length; i++) {
|
|
791
|
+
const page = this.config.page[i]
|
|
792
|
+
for (let j = 0; j < page.body.length; j++) {
|
|
793
|
+
const row = page.body[j]
|
|
794
|
+
for (let k = 0; k < row.length; k++) {
|
|
795
|
+
const item = row[k]
|
|
796
|
+
if (item.id === dropKey) {
|
|
797
|
+
if (dropPosition > 0) {
|
|
798
|
+
row.splice(k + 1, 0, dragElement)
|
|
799
|
+
} else {
|
|
800
|
+
row.splice(k, 0, dragElement)
|
|
801
|
+
}
|
|
802
|
+
this.refreshOrganization()
|
|
803
|
+
this.$forceUpdate()
|
|
804
|
+
return
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
// 主页面标签切换
|
|
813
|
+
handleMainPageMenuChange (value) {
|
|
814
|
+
this.activeMainPage = value.key
|
|
815
|
+
for (let i = 0; i < this.config.page.length; i++) {
|
|
816
|
+
if (this.config.page[i].id === this.activeMainPage) {
|
|
817
|
+
this.activeMainPageType = this.config.page[i].type
|
|
818
|
+
return
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
// 将页面标签类型渲染为对应的文字
|
|
823
|
+
determinePageType (type) {
|
|
824
|
+
return lowcodeUtils.resolvePageType(type)
|
|
825
|
+
},
|
|
826
|
+
// 架构添加组件后,将配置添加到config中
|
|
827
|
+
handleAddComponent (config) {
|
|
828
|
+
this.config.page.push(config)
|
|
829
|
+
this.refreshOrganization()
|
|
830
|
+
},
|
|
831
|
+
// 打开logic回调编辑弹框
|
|
832
|
+
openLogicCallbackEditor () {
|
|
833
|
+
if (!this.eventEditorContent.logicCallBackFunction) {
|
|
834
|
+
this.eventEditorContent.logicCallBackFunction = LogicCallBackFunctionTemplate
|
|
835
|
+
}
|
|
836
|
+
this.showLogicCallBackEditor = true
|
|
837
|
+
},
|
|
838
|
+
// 打开logic参数JS编辑器弹框
|
|
839
|
+
openLogicParamJSEditor () {
|
|
840
|
+
if (!this.eventEditorContent.logicParamJSFunction) {
|
|
841
|
+
this.eventEditorContent.logicParamJSFunction = LogicParamFunctionTemplate
|
|
842
|
+
}
|
|
843
|
+
this.showLogicParamJSEditor = true
|
|
844
|
+
},
|
|
845
|
+
// 刷新架构
|
|
846
|
+
refreshOrganization () {
|
|
847
|
+
this.showPageOrganization = false
|
|
848
|
+
this.$nextTick(() => {
|
|
849
|
+
this.showPageOrganization = true
|
|
850
|
+
})
|
|
851
|
+
},
|
|
852
|
+
// 拖拽完成后,将新的span赋值
|
|
853
|
+
handleDrag (targetEle, nextEle) {
|
|
854
|
+
const target = lowcodeUtils.getComponentConfig(targetEle.id, this.config.page)
|
|
855
|
+
const targetNext = lowcodeUtils.getComponentConfig(nextEle.id, this.config.page)
|
|
856
|
+
target.span = targetEle.span
|
|
857
|
+
targetNext.span = nextEle.span
|
|
858
|
+
},
|
|
859
|
+
// 删除组件
|
|
860
|
+
deleteComponentInTree (id, type) {
|
|
861
|
+
if (type === 'page') {
|
|
862
|
+
const page = lowcodeUtils.getPageConfigById(id, this.config)
|
|
863
|
+
this.deletePage(page)
|
|
864
|
+
} else if (type === 'component') {
|
|
865
|
+
this.deleteComponent(id)
|
|
866
|
+
} else if (type === 'row') {
|
|
867
|
+
this.deleteRow(id)
|
|
868
|
+
} else if (type === 'container_page') {
|
|
869
|
+
this.deleteContainerPage(id)
|
|
870
|
+
}
|
|
871
|
+
},
|
|
872
|
+
deleteContainerPage (id) {
|
|
873
|
+
console.warn('id', id)
|
|
874
|
+
const target = lowcodeUtils.getContainerPageOuterByContainerPageId(id, this.config)
|
|
875
|
+
console.warn('target', target)
|
|
876
|
+
target.type = 'container'
|
|
877
|
+
delete target.page
|
|
878
|
+
this.targetContainer = undefined
|
|
879
|
+
this.editorPropertiesConfig = {}
|
|
880
|
+
this.refreshOrganization()
|
|
881
|
+
},
|
|
882
|
+
// 删除行
|
|
883
|
+
deleteRow (id) {
|
|
884
|
+
const pageId = id.substring(0, id.length - 2)
|
|
885
|
+
const rowId = id.substring(id.length - 1)
|
|
886
|
+
const page = lowcodeUtils.getPageConfigById(pageId, this.config)
|
|
887
|
+
page.body.splice(rowId - 1, 1)
|
|
888
|
+
this.targetContainer = undefined
|
|
889
|
+
this.editorPropertiesConfig = {}
|
|
890
|
+
this.refreshOrganization()
|
|
891
|
+
},
|
|
892
|
+
// 删除页面容器
|
|
893
|
+
deletePage (page) {
|
|
894
|
+
console.warn('123', page)
|
|
895
|
+
page.body.forEach(row => {
|
|
896
|
+
row.forEach(item => {
|
|
897
|
+
if (item.type === 'container_page') {
|
|
898
|
+
this.deletePage(item.page)
|
|
899
|
+
} else {
|
|
900
|
+
delete this.$children[0]._provided.componentsMap[item.id]
|
|
901
|
+
}
|
|
902
|
+
})
|
|
903
|
+
})
|
|
904
|
+
for (let i = 0; i < this.config.page.length; i++) {
|
|
905
|
+
if (this.config.page[i].id === page.id) {
|
|
906
|
+
this.config.page.splice(i, 1)
|
|
907
|
+
this.targetContainer = undefined
|
|
908
|
+
this.editorPropertiesConfig = {}
|
|
909
|
+
this.refreshOrganization()
|
|
910
|
+
return
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
// 删除组件
|
|
915
|
+
deleteComponent (id, addOnSpan = true) {
|
|
916
|
+
const row = lowcodeUtils.getRowConfigByComponentId(id, this.config)
|
|
917
|
+
const target = lowcodeUtils.getComponentConfig(id, this.config)
|
|
918
|
+
const deletedSpan = target.span
|
|
919
|
+
let index
|
|
920
|
+
for (let i = 0; i < row.length; i++) {
|
|
921
|
+
if (target.id === row[i].id) {
|
|
922
|
+
index = i
|
|
923
|
+
break
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
row.splice(index, 1)
|
|
927
|
+
if (addOnSpan) {
|
|
928
|
+
// 如果该组件之前还有组件,将该组件的span加给之前的组件
|
|
929
|
+
if (index !== 0) {
|
|
930
|
+
row[index - 1].span += deletedSpan
|
|
931
|
+
} else if (row.length > 0) {
|
|
932
|
+
row[0].span += deletedSpan
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
// 从注册的全局Map中删除
|
|
936
|
+
delete this.$children[0]._provided.componentsMap[id]
|
|
937
|
+
this.targetContainer = undefined
|
|
938
|
+
this.editorPropertiesConfig = {}
|
|
939
|
+
this.refreshOrganization()
|
|
940
|
+
},
|
|
941
|
+
// 打开JS函数编辑器
|
|
942
|
+
openEventJSEditor () {
|
|
943
|
+
if (!this.eventEditorContent.JSFunction) {
|
|
944
|
+
this.eventEditorContent.JSFunction = JSEventFunctionTemplate
|
|
945
|
+
}
|
|
946
|
+
this.showJSEventEditor = true
|
|
947
|
+
},
|
|
948
|
+
openEventLifeCycleJSEditor () {
|
|
949
|
+
if (!this.eventEditorContent.LifeCycleFunction) {
|
|
950
|
+
this.eventEditorContent.LifeCycleFunction = LifeCycleFunctionTemplate
|
|
951
|
+
}
|
|
952
|
+
this.showLifeCycleFunctionEditor = true
|
|
953
|
+
},
|
|
954
|
+
// 事件编辑器中,点击编辑按钮
|
|
955
|
+
editEventIconClick (eventType, eventIndex) {
|
|
956
|
+
// 找到目标配置
|
|
957
|
+
const targetConfig = lowcodeUtils.getComponentConfig(this.editorPropertiesConfig.id, this.config.page)
|
|
958
|
+
// 将目标对应的配置赋值到事件编辑器缓存
|
|
959
|
+
this.eventEditorContent = { ...targetConfig.onEvent[eventType][eventIndex] }
|
|
960
|
+
this.eventEditorContent.emitType = eventType
|
|
961
|
+
this.eventEditorCurrent = {
|
|
962
|
+
type: eventType,
|
|
963
|
+
index: eventIndex
|
|
964
|
+
}
|
|
965
|
+
this.showEventEditor = true
|
|
966
|
+
},
|
|
967
|
+
// 删除事件
|
|
968
|
+
removeEventClick (eventType, eventIndex) {
|
|
969
|
+
const targetConfig = lowcodeUtils.getComponentConfig(this.editorPropertiesConfig.id, this.config.page)
|
|
970
|
+
targetConfig.onEvent[eventType].splice(eventIndex, 1)
|
|
971
|
+
if (targetConfig.onEvent[eventType].length === 0) {
|
|
972
|
+
delete targetConfig.onEvent[eventType]
|
|
973
|
+
}
|
|
974
|
+
this.$forceUpdate()
|
|
975
|
+
},
|
|
976
|
+
// 添加事件
|
|
977
|
+
addEvent () {
|
|
978
|
+
this.showEventEditor = true
|
|
979
|
+
},
|
|
980
|
+
// 获取所有注册组件
|
|
981
|
+
getAllRenderedComponents () {
|
|
982
|
+
const IDs = Object.keys(this.$children[0]._provided.componentsMap)
|
|
983
|
+
const result = []
|
|
984
|
+
IDs.forEach(id => {
|
|
985
|
+
const config = lowcodeUtils.getConfig(id, this.config)
|
|
986
|
+
if (config.name) {
|
|
987
|
+
result.push(config.name)
|
|
988
|
+
} else {
|
|
989
|
+
result.push(config.id)
|
|
990
|
+
}
|
|
991
|
+
})
|
|
992
|
+
return result
|
|
993
|
+
},
|
|
994
|
+
// 容器删除
|
|
995
|
+
handleContainerDelete (id) {
|
|
996
|
+
let index
|
|
997
|
+
const row = lowcodeUtils.getRowConfigByComponentId(id, this.config)
|
|
998
|
+
for (let i = 0; i < row.length; i++) {
|
|
999
|
+
const item = row[i]
|
|
1000
|
+
if (item.id === id) {
|
|
1001
|
+
index = i
|
|
1002
|
+
break
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
row.splice(index, 1)
|
|
1006
|
+
this.targetContainer = undefined
|
|
1007
|
+
// 如果删除后只剩一个容器,将该容器span设置为24
|
|
1008
|
+
if (row.length === 1) {
|
|
1009
|
+
row[0].span = 24
|
|
1010
|
+
}
|
|
1011
|
+
this.refreshOrganization()
|
|
1012
|
+
},
|
|
1013
|
+
// 事件编辑器点击完成
|
|
1014
|
+
handleEventEditorOk () {
|
|
1015
|
+
let emitTypeKey = this.eventEditorContent.emitType
|
|
1016
|
+
// 是否是自定义事件触发
|
|
1017
|
+
if (this.eventEditorContent.customEmitType) {
|
|
1018
|
+
emitTypeKey = this.eventEditorContent.customEmitType
|
|
1019
|
+
}
|
|
1020
|
+
// 如果当前是回显事件
|
|
1021
|
+
if (this.eventEditorCurrent) {
|
|
1022
|
+
const targetConfig = lowcodeUtils.getComponentConfig(this.editorPropertiesConfig.id, this.config.page)
|
|
1023
|
+
targetConfig.onEvent[this.eventEditorCurrent.type][this.eventEditorCurrent.index] = { ...this.eventEditorContent }
|
|
1024
|
+
} else {
|
|
1025
|
+
// 当前是新增事件
|
|
1026
|
+
const target = lowcodeUtils.getComponentConfig(this.editorPropertiesConfig.id, this.config.page)
|
|
1027
|
+
// 如果没有onEvent属性则初始化
|
|
1028
|
+
if (!target.onEvent) {
|
|
1029
|
+
target.onEvent = {}
|
|
1030
|
+
}
|
|
1031
|
+
// 如果当前触发类型没有初始化,则初始化
|
|
1032
|
+
if (!target.onEvent[emitTypeKey]) {
|
|
1033
|
+
target.onEvent[emitTypeKey] = []
|
|
1034
|
+
}
|
|
1035
|
+
// 将缓存的事件属性赋值
|
|
1036
|
+
target.onEvent[emitTypeKey].push({
|
|
1037
|
+
...this.eventEditorContent
|
|
1038
|
+
})
|
|
1039
|
+
}
|
|
1040
|
+
this.showEventEditor = false
|
|
1041
|
+
this.eventEditorContent = {}
|
|
1042
|
+
this.eventEditorCurrent = undefined
|
|
1043
|
+
},
|
|
1044
|
+
// 关闭事件编辑器弹框
|
|
1045
|
+
handleEventEditorCancel () {
|
|
1046
|
+
this.showEventEditor = false
|
|
1047
|
+
this.eventEditorContent = {}
|
|
1048
|
+
this.eventEditorCurrent = undefined
|
|
1049
|
+
},
|
|
1050
|
+
// 事件编辑器中,触发类型改变
|
|
1051
|
+
handleEventEditorTypeChange (type) {
|
|
1052
|
+
this.eventEditorContent.emitType = type
|
|
1053
|
+
this.$forceUpdate()
|
|
1054
|
+
},
|
|
1055
|
+
// 事件编辑器中,目标组件改变
|
|
1056
|
+
handleEventEditorTargetChange (target) {
|
|
1057
|
+
this.eventEditorContent.target = target
|
|
1058
|
+
this.$forceUpdate()
|
|
1059
|
+
},
|
|
1060
|
+
handleEventEditorLifeCycleChange (lifeCycleName) {
|
|
1061
|
+
this.eventEditorContent.lifeCycle = lifeCycleName
|
|
1062
|
+
},
|
|
1063
|
+
// 事件编辑器中,事件类型改变
|
|
1064
|
+
handleEventEditorEventTypeChange (type) {
|
|
1065
|
+
const componentsMap = this.$children[0]._provided.componentsMap
|
|
1066
|
+
this.eventEditorContent.eventType = type
|
|
1067
|
+
this.logicParamTransferDataSource = []
|
|
1068
|
+
// 如果事件为运行Logic将组件加入穿梭框
|
|
1069
|
+
if (type === 'runLogic') {
|
|
1070
|
+
const keys = Object.keys(componentsMap)
|
|
1071
|
+
keys.forEach(key => {
|
|
1072
|
+
const name = lowcodeUtils.getComponentNameById(key, this.config)
|
|
1073
|
+
this.logicParamTransferDataSource.push({
|
|
1074
|
+
key: key,
|
|
1075
|
+
title: name,
|
|
1076
|
+
})
|
|
1077
|
+
})
|
|
1078
|
+
this.eventEditorContent.logicParamTransfer = []
|
|
1079
|
+
}
|
|
1080
|
+
this.$forceUpdate()
|
|
1081
|
+
},
|
|
1082
|
+
// 事件编辑器中,目标组件执行事件类型改变
|
|
1083
|
+
handleEventEditorTargetEventTypeChange (type) {
|
|
1084
|
+
this.eventEditorContent.eventName = type
|
|
1085
|
+
this.$forceUpdate()
|
|
1086
|
+
},
|
|
1087
|
+
// 自定义JS方法弹框确认
|
|
1088
|
+
handleJSEventEditorOk () {
|
|
1089
|
+
this.showJSEventEditor = false
|
|
1090
|
+
},
|
|
1091
|
+
// 自定义JS方法弹框关闭
|
|
1092
|
+
handleJSEventEditorCancel () {
|
|
1093
|
+
this.showJSEventEditor = false
|
|
1094
|
+
},
|
|
1095
|
+
// 添加组件到容器中
|
|
1096
|
+
addComponentToContainer (type) {
|
|
1097
|
+
// 如果没有选中容器
|
|
1098
|
+
if (!this.targetContainer) {
|
|
1099
|
+
this.$message.error('请先选择目标容器!')
|
|
1100
|
+
this.targetContainer = undefined
|
|
1101
|
+
return
|
|
1102
|
+
}
|
|
1103
|
+
// 获取选中的容器
|
|
1104
|
+
const target = lowcodeUtils.getComponentConfig(this.targetContainer.id, this.config.page)
|
|
1105
|
+
// 将容器的类型和id改变
|
|
1106
|
+
target.type = type
|
|
1107
|
+
target.id = target.type + '_' + lowcodeUtils.nanoidWithoutSymbol(6)
|
|
1108
|
+
this.targetContainer = undefined
|
|
1109
|
+
this.refreshOrganization()
|
|
1110
|
+
},
|
|
1111
|
+
// 添加容器
|
|
1112
|
+
addContainer () {
|
|
1113
|
+
// 如果目标不是一个容器
|
|
1114
|
+
if (!this.targetContainer) {
|
|
1115
|
+
// 如果没有指定页面容器,则直接报错
|
|
1116
|
+
if (this.activeMainPage === undefined) {
|
|
1117
|
+
this.$message.error('未选中任何工作空间!')
|
|
1118
|
+
return
|
|
1119
|
+
}
|
|
1120
|
+
// 获取当前选中的页面容器
|
|
1121
|
+
let targetIndex = this.activeMainPage
|
|
1122
|
+
for (let i = 0; i < this.config.page.length; i++) {
|
|
1123
|
+
if (this.config.page[i].id === this.activeMainPage) {
|
|
1124
|
+
targetIndex = i
|
|
1125
|
+
break
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
// 如果是page类型,添加两个容器。其他类型添加一个容器
|
|
1129
|
+
if (this.config.page[targetIndex].type === 'page') {
|
|
1130
|
+
this.config.page[targetIndex].body.push([
|
|
1131
|
+
{
|
|
1132
|
+
type: 'container_page',
|
|
1133
|
+
span: 24,
|
|
1134
|
+
id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6),
|
|
1135
|
+
page: [
|
|
1136
|
+
{
|
|
1137
|
+
id: 'container_page_' + lowcodeUtils.nanoidWithoutSymbol(6),
|
|
1138
|
+
type: 'page',
|
|
1139
|
+
body: [
|
|
1140
|
+
[
|
|
1141
|
+
{
|
|
1142
|
+
type: 'container',
|
|
1143
|
+
span: 12,
|
|
1144
|
+
id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
type: 'container',
|
|
1148
|
+
span: 12,
|
|
1149
|
+
id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
|
|
1150
|
+
},
|
|
1151
|
+
]
|
|
1152
|
+
]
|
|
1153
|
+
}
|
|
1154
|
+
]
|
|
1155
|
+
}
|
|
1156
|
+
])
|
|
1157
|
+
} else {
|
|
1158
|
+
this.config.page[targetIndex].body.push([{
|
|
1159
|
+
type: 'container',
|
|
1160
|
+
span: 24,
|
|
1161
|
+
id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
|
|
1162
|
+
}])
|
|
1163
|
+
}
|
|
1164
|
+
} else {
|
|
1165
|
+
// 如果目标是容器
|
|
1166
|
+
const row = lowcodeUtils.getRowConfigByComponentId(this.targetContainer.id, this.config)
|
|
1167
|
+
const targetInRowIndex = lowcodeUtils.getComponentInRowIndex(this.targetContainer.id, this.config)
|
|
1168
|
+
const targetItem = lowcodeUtils.getComponentConfig(this.targetContainer.id, this.config)
|
|
1169
|
+
const maxWidth = targetItem.span
|
|
1170
|
+
// 确认是水平拆分还是垂直拆分
|
|
1171
|
+
this.$confirm({
|
|
1172
|
+
content: '是否为水平拆分',
|
|
1173
|
+
onOk: () => {
|
|
1174
|
+
// 将目标容器一分为二
|
|
1175
|
+
row.splice(targetInRowIndex, 1, {
|
|
1176
|
+
type: 'container',
|
|
1177
|
+
span: Math.floor(maxWidth / 2),
|
|
1178
|
+
id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
|
|
1179
|
+
}, {
|
|
1180
|
+
type: 'container',
|
|
1181
|
+
span: Math.ceil(maxWidth / 2),
|
|
1182
|
+
id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
|
|
1183
|
+
})
|
|
1184
|
+
this.targetContainer = undefined
|
|
1185
|
+
this.refreshOrganization()
|
|
1186
|
+
},
|
|
1187
|
+
onCancel: () => {
|
|
1188
|
+
targetItem.type = 'container_page'
|
|
1189
|
+
targetItem.page = [{
|
|
1190
|
+
id: 'container_page_' + lowcodeUtils.nanoidWithoutSymbol(6),
|
|
1191
|
+
type: 'page',
|
|
1192
|
+
body: [
|
|
1193
|
+
[{
|
|
1194
|
+
type: 'container',
|
|
1195
|
+
span: 24,
|
|
1196
|
+
id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
|
|
1197
|
+
}],
|
|
1198
|
+
[{
|
|
1199
|
+
type: 'container',
|
|
1200
|
+
span: 24,
|
|
1201
|
+
id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
|
|
1202
|
+
}]
|
|
1203
|
+
]
|
|
1204
|
+
}]
|
|
1205
|
+
this.targetContainer = undefined
|
|
1206
|
+
this.refreshOrganization()
|
|
1207
|
+
}
|
|
1208
|
+
})
|
|
1209
|
+
}
|
|
1210
|
+
this.refreshOrganization()
|
|
1211
|
+
},
|
|
1212
|
+
// 获取所有已注册组件,用于添加至UI库
|
|
1213
|
+
getRegisteredComponents () {
|
|
1214
|
+
return Object.keys(registeredRender)
|
|
1215
|
+
},
|
|
1216
|
+
// 组件属性编辑
|
|
1217
|
+
editorPropertiesInputChange (event, key) {
|
|
1218
|
+
this.renderPreview = false
|
|
1219
|
+
this.renderModalPreview = false
|
|
1220
|
+
this.renderDrawPreview = false
|
|
1221
|
+
// 如果当前有定时器,清除该定时器,并设置新的定时器
|
|
1222
|
+
// 也就是说:每次操作间隔指定时间后才会触发更新
|
|
1223
|
+
// 如果在此期间又进行了操作,则重新开始计时
|
|
1224
|
+
if (this.inputTimeout) {
|
|
1225
|
+
clearTimeout(this.inputTimeout)
|
|
1226
|
+
}
|
|
1227
|
+
this.inputTimeout = setTimeout(() => {
|
|
1228
|
+
const target = lowcodeUtils.getComponentConfig(this.editorPropertiesConfig.id, this.config.page)
|
|
1229
|
+
lowcodeLog('组件属性修改', '触发更新', target.id, true, false)
|
|
1230
|
+
// 拿到组件注册的配置
|
|
1231
|
+
const editorConfig = lowcodeUtils.getEditorConfigById(this.editorPropertiesConfig.id, this.config.page)
|
|
1232
|
+
// 根据类型,将input框中的内容赋值
|
|
1233
|
+
if (editorConfig.properties[key].type === 'object') {
|
|
1234
|
+
target.props[key] = JSON.parse(event.target.value)
|
|
1235
|
+
} else if (editorConfig.properties[key].type === 'string') {
|
|
1236
|
+
target.props[key] = event.target.value
|
|
1237
|
+
} else if (editorConfig.properties[key].type === 'boolean') {
|
|
1238
|
+
const input = event.target.value.toLowerCase()
|
|
1239
|
+
target.props[key] = input === 'true' || input !== '0'
|
|
1240
|
+
}
|
|
1241
|
+
this.renderPreview = true
|
|
1242
|
+
this.renderModalPreview = true
|
|
1243
|
+
this.renderDrawPreview = true
|
|
1244
|
+
}, 1500)
|
|
1245
|
+
},
|
|
1246
|
+
// 切换预览模式
|
|
1247
|
+
previewModeActive () {
|
|
1248
|
+
// TODO 新标签页中预览
|
|
1249
|
+
// const params = {
|
|
1250
|
+
// config: this.config
|
|
1251
|
+
// }
|
|
1252
|
+
// const routeData = this.$router.resolve({
|
|
1253
|
+
// path: '/lowCodeReview',
|
|
1254
|
+
// query: params
|
|
1255
|
+
// })
|
|
1256
|
+
// window.open(routeData.location.path, '_blank')
|
|
1257
|
+
this.preview = true
|
|
1258
|
+
},
|
|
1259
|
+
// 切换编辑模式
|
|
1260
|
+
editModeActive () {
|
|
1261
|
+
this.preview = false
|
|
1262
|
+
},
|
|
1263
|
+
// 选中某个组件
|
|
1264
|
+
clickComponentInEditor (configItem) {
|
|
1265
|
+
this.editorPropertiesConfig = {}
|
|
1266
|
+
// 如果选中的是容器
|
|
1267
|
+
if (configItem.type === 'container') {
|
|
1268
|
+
// 如果已经选中,则反选,selected属性用于改变容器样式
|
|
1269
|
+
if (configItem.selected) {
|
|
1270
|
+
configItem.selected = false
|
|
1271
|
+
this.targetContainer = undefined
|
|
1272
|
+
} else {
|
|
1273
|
+
// 将所有已选中组件取消选择
|
|
1274
|
+
lowcodeUtils.unCheckAll(this.config)
|
|
1275
|
+
// 将目标设置为选定
|
|
1276
|
+
configItem.selected = true
|
|
1277
|
+
this.targetContainer = configItem
|
|
1278
|
+
}
|
|
1279
|
+
return
|
|
1280
|
+
}
|
|
1281
|
+
// 如果是组件对象
|
|
1282
|
+
// 拿注册的配置
|
|
1283
|
+
const configInJson = lowcodeUtils.getEditorConfigByType(configItem.type)
|
|
1284
|
+
if (configInJson) {
|
|
1285
|
+
this.editorPropertiesConfig = configItem
|
|
1286
|
+
// 为编辑器变量初始化
|
|
1287
|
+
if (configInJson.properties) {
|
|
1288
|
+
if (!this.editorPropertiesConfig.props) {
|
|
1289
|
+
this.editorPropertiesConfig.props = {}
|
|
1290
|
+
}
|
|
1291
|
+
const editableKeys = Object.keys(configInJson.properties)
|
|
1292
|
+
editableKeys.forEach(editableKey => {
|
|
1293
|
+
// 如果该值并不存在,则初始化
|
|
1294
|
+
if (!this.editorPropertiesConfig.props[editableKey]) {
|
|
1295
|
+
this.editorPropertiesConfig.props[editableKey] = ''
|
|
1296
|
+
} else {
|
|
1297
|
+
if (typeof this.editorPropertiesConfig.props[editableKey] === 'object') {
|
|
1298
|
+
this.editorPropertiesConfig.props[editableKey] = JSON.stringify(this.editorPropertiesConfig.props[editableKey])
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
})
|
|
1302
|
+
}
|
|
1303
|
+
// 为编辑器事件初始化
|
|
1304
|
+
if (configInJson.selfEvent) {
|
|
1305
|
+
if (!this.editorPropertiesConfig.selfEvent) {
|
|
1306
|
+
this.editorPropertiesConfig.selfEvent = []
|
|
1307
|
+
configInJson.selfEvent.forEach(everyEvent => {
|
|
1308
|
+
this.editorPropertiesConfig.selfEvent.push(everyEvent)
|
|
1309
|
+
})
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
} else {
|
|
1313
|
+
this.editorPropertiesConfig = 'unregistered'
|
|
1314
|
+
}
|
|
1315
|
+
},
|
|
1316
|
+
// 点击测试按钮
|
|
1317
|
+
test () {
|
|
1318
|
+
// 输出当前配置,和组件注册Map
|
|
1319
|
+
console.warn('config', this.config)
|
|
1320
|
+
console.warn('map', this.$children[0]._provided.componentsMap)
|
|
1321
|
+
},
|
|
1322
|
+
// 点击导出按钮
|
|
1323
|
+
exportConfig () {
|
|
1324
|
+
console.warn('导出', this.config)
|
|
1325
|
+
this.$emit('exportConfig', this.config)
|
|
1326
|
+
}
|
|
1327
|
+
},
|
|
1328
|
+
mounted () {
|
|
1329
|
+
// 将mixin中已经实现的通用响应方法添加
|
|
1330
|
+
this.supportedEventType = [...lowcodeComponentMixin.supportedEventType]
|
|
1331
|
+
// 深拷贝外侧传来的配置
|
|
1332
|
+
this.config = JSON.parse(JSON.stringify(this.originalConfig))
|
|
1333
|
+
// this.config = {
|
|
1334
|
+
// page: [
|
|
1335
|
+
// {
|
|
1336
|
+
// id: 'page_KBjw2i',
|
|
1337
|
+
// type: 'page',
|
|
1338
|
+
// title: '111',
|
|
1339
|
+
// body: [
|
|
1340
|
+
// [
|
|
1341
|
+
// {
|
|
1342
|
+
// type: 'XFormTable',
|
|
1343
|
+
// span: 12,
|
|
1344
|
+
// id: 'XFormTable_BV6Nwk',
|
|
1345
|
+
// selected: false,
|
|
1346
|
+
// props: {
|
|
1347
|
+
// queryParamsName: '',
|
|
1348
|
+
// serviceName: ''
|
|
1349
|
+
// },
|
|
1350
|
+
// selfEvent: [
|
|
1351
|
+
// 'action'
|
|
1352
|
+
// ]
|
|
1353
|
+
// },
|
|
1354
|
+
// {
|
|
1355
|
+
// type: 'XAddNativeForm',
|
|
1356
|
+
// span: 12,
|
|
1357
|
+
// id: 'XAddNativeForm_ekihTp',
|
|
1358
|
+
// selected: false,
|
|
1359
|
+
// props: {
|
|
1360
|
+
// configNameForLowCode: '',
|
|
1361
|
+
// systemNameForLowCode: ''
|
|
1362
|
+
// },
|
|
1363
|
+
// selfEvent: [
|
|
1364
|
+
// 'onSubmit'
|
|
1365
|
+
// ]
|
|
1366
|
+
// }
|
|
1367
|
+
// ],
|
|
1368
|
+
// [
|
|
1369
|
+
// {
|
|
1370
|
+
// type: 'XTreeOne',
|
|
1371
|
+
// span: 12,
|
|
1372
|
+
// id: 'XTreeOne_szu7Al',
|
|
1373
|
+
// selected: false
|
|
1374
|
+
// },
|
|
1375
|
+
// {
|
|
1376
|
+
// type: 'XDescriptions',
|
|
1377
|
+
// span: 12,
|
|
1378
|
+
// id: 'XDescriptions_DTkbEg',
|
|
1379
|
+
// selected: false,
|
|
1380
|
+
// props: {
|
|
1381
|
+
// title: '111',
|
|
1382
|
+
// content: {
|
|
1383
|
+
// c_f_user_phone: '2323',
|
|
1384
|
+
// c_f_total_fee: 33356,
|
|
1385
|
+
// c_f_address: '22',
|
|
1386
|
+
// c_f_meterlen: 2,
|
|
1387
|
+
// c_f_bank_card_number: '23',
|
|
1388
|
+
// c_f_create_user: '超级管理员',
|
|
1389
|
+
// c_f_customer: '23',
|
|
1390
|
+
// c_f_balance: 33356,
|
|
1391
|
+
// c_f_create_date: '2024-06-23 21:31:24',
|
|
1392
|
+
// c_f_operator_date: '2024-06-23 21:31:24',
|
|
1393
|
+
// c_f_total_times: 2,
|
|
1394
|
+
// c_f_user_name: '23',
|
|
1395
|
+
// c_f_comments: '323',
|
|
1396
|
+
// c_id: 39,
|
|
1397
|
+
// c_f_operatorid: '15',
|
|
1398
|
+
// c_f_operator: '超级管理员',
|
|
1399
|
+
// c_f_orgid: '9'
|
|
1400
|
+
// },
|
|
1401
|
+
// configName: 'Unit_Desc_Config',
|
|
1402
|
+
// serviceName: 'af-revenue',
|
|
1403
|
+
// getRealData: true
|
|
1404
|
+
// },
|
|
1405
|
+
// selfEvent: []
|
|
1406
|
+
// }
|
|
1407
|
+
// ]
|
|
1408
|
+
// ]
|
|
1409
|
+
// },
|
|
1410
|
+
// {
|
|
1411
|
+
// id: 'page_FgItf6',
|
|
1412
|
+
// type: 'page',
|
|
1413
|
+
// title: '22',
|
|
1414
|
+
// body: [
|
|
1415
|
+
// [
|
|
1416
|
+
// {
|
|
1417
|
+
// type: 'container',
|
|
1418
|
+
// span: 4,
|
|
1419
|
+
// id: 'container_ir2gR2',
|
|
1420
|
+
// selected: false
|
|
1421
|
+
// },
|
|
1422
|
+
// {
|
|
1423
|
+
// type: 'container_page',
|
|
1424
|
+
// span: 10,
|
|
1425
|
+
// id: 'container_xIRHGg',
|
|
1426
|
+
// selected: true,
|
|
1427
|
+
// page: [
|
|
1428
|
+
// {
|
|
1429
|
+
// id: 'container_page_IgYw9u',
|
|
1430
|
+
// type: 'page',
|
|
1431
|
+
// body: [
|
|
1432
|
+
// [
|
|
1433
|
+
// {
|
|
1434
|
+
// type: 'container',
|
|
1435
|
+
// span: 24,
|
|
1436
|
+
// id: 'container_tqVFCL'
|
|
1437
|
+
// }
|
|
1438
|
+
// ],
|
|
1439
|
+
// [
|
|
1440
|
+
// {
|
|
1441
|
+
// type: 'container',
|
|
1442
|
+
// span: 24,
|
|
1443
|
+
// id: 'container_i8VXCZ'
|
|
1444
|
+
// }
|
|
1445
|
+
// ]
|
|
1446
|
+
// ]
|
|
1447
|
+
// }
|
|
1448
|
+
// ]
|
|
1449
|
+
// },
|
|
1450
|
+
// {
|
|
1451
|
+
// type: 'container',
|
|
1452
|
+
// span: 10,
|
|
1453
|
+
// id: 'container_PT9n3Q',
|
|
1454
|
+
// selected: false
|
|
1455
|
+
// }
|
|
1456
|
+
// ],
|
|
1457
|
+
// [
|
|
1458
|
+
// {
|
|
1459
|
+
// type: 'container',
|
|
1460
|
+
// span: 18,
|
|
1461
|
+
// id: 'container_q04vQr',
|
|
1462
|
+
// selected: false
|
|
1463
|
+
// },
|
|
1464
|
+
// {
|
|
1465
|
+
// type: 'container',
|
|
1466
|
+
// span: 6,
|
|
1467
|
+
// id: 'container_MKwNvz',
|
|
1468
|
+
// selected: false
|
|
1469
|
+
// }
|
|
1470
|
+
// ]
|
|
1471
|
+
// ]
|
|
1472
|
+
// }
|
|
1473
|
+
// ]
|
|
1474
|
+
// }
|
|
1475
|
+
this.refreshOrganization()
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
</script>
|
|
1479
|
+
|
|
1480
|
+
<style scoped lang="less">
|
|
1481
|
+
.ui-item:hover {
|
|
1482
|
+
cursor: pointer;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
.ui-item{
|
|
1486
|
+
width: 100%;
|
|
1487
|
+
height:10%;
|
|
1488
|
+
text-align: center;
|
|
1489
|
+
overflow-wrap: break-word;
|
|
1490
|
+
padding: 7%
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
.singleEvent {
|
|
1494
|
+
border: black dashed 1px;
|
|
1495
|
+
padding: 10%;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
.edit_icon:hover {
|
|
1499
|
+
cursor: pointer;
|
|
1500
|
+
}
|
|
1501
|
+
</style>
|