cloud-web-corejs 1.0.54-dev.745 → 1.0.54-dev.747

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.
Files changed (52) hide show
  1. package/package.json +194 -192
  2. package/src/App.vue +73 -71
  3. package/src/components/baseArea/index.vue +1628 -1628
  4. package/src/components/fileLibrary/categoryMoveDialog.vue +109 -109
  5. package/src/components/fileLibrary/fileObjAuthDialog.vue +297 -297
  6. package/src/components/fileLibrary/index.vue +1109 -1109
  7. package/src/components/fileLibrary/propertiesDialog.vue +190 -190
  8. package/src/components/fileLibrary/recycleBinDialog.vue +237 -237
  9. package/src/components/wf/mixins/setCandidateDialog.js +217 -217
  10. package/src/components/wf/mixins/setCandidateDialog2.js +252 -252
  11. package/src/components/xform/docs//345/257/271/346/257/224/345/212/237/350/203/275/350/220/275/345/234/260/346/226/271/346/241/210.md +986 -986
  12. package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +272 -272
  13. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +216 -216
  14. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +928 -928
  15. package/src/components/xform/form-designer/index.vue +195 -195
  16. package/src/components/xform/form-designer/indexMixin.js +848 -848
  17. package/src/components/xform/form-designer/setting-panel/index.vue +313 -313
  18. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +124 -124
  19. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +369 -369
  20. package/src/components/xform/form-designer/widget-panel/index.vue +389 -389
  21. package/src/components/xform/form-designer/widget-panel/indexMixin.js +343 -343
  22. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +4531 -4531
  23. package/src/components/xform/form-render/container-item/data-table-mixin.js +4748 -4576
  24. package/src/components/xform/form-render/container-item/tab-item.vue +125 -125
  25. package/src/components/xform/form-render/indexMixin.js +5061 -5078
  26. package/src/components/xform/lang/en-US.js +457 -457
  27. package/src/components/xform/lang/zh-CN.js +628 -628
  28. package/src/components/xform/utils/util.js +1585 -1554
  29. package/src/index.js +347 -230
  30. package/src/layout/components/AppMain.vue +122 -125
  31. package/src/layout/components/extractedCode/viewDialog.vue +207 -207
  32. package/src/layout/components/langTool.vue +128 -123
  33. package/src/layout/defaultLayout.vue +164 -158
  34. package/src/microRouter/index.js +389 -0
  35. package/src/permission.js +185 -135
  36. package/src/public-path.js +8 -0
  37. package/src/store/config/index.js +667 -669
  38. package/src/store/modules/micro.js +46 -0
  39. package/src/store/modules/permission.js +468 -373
  40. package/src/store/modules/user.js +419 -415
  41. package/src/utils/auth.js +27 -1
  42. package/src/utils/index.js +579 -6
  43. package/src/utils/keepAlive.js +4 -0
  44. package/src/utils/menuAdapter.js +183 -0
  45. package/src/utils/request.js +417 -28
  46. package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +483 -483
  47. package/src/views/bd/setting/form_script/form_list.vue +174 -174
  48. package/src/views/bd/setting/form_script/mixins/form_list.js +330 -330
  49. package/src/views/bd/setting/form_template/formDesignerDialog.vue +171 -171
  50. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +253 -253
  51. package/src/views/user/menuFallback/index.vue +123 -0
  52. package/src/views/user/wf/wfReport/index.vue +625 -625
@@ -1,343 +1,343 @@
1
- import i18n from "../../../../components/xform/utils/i18n"
2
- import axios from "axios"
3
- import {
4
- containers,
5
- basicFields,
6
- advancedFields,
7
- customFields,
8
- businessFields,
9
- widgetPanelOrder
10
- } from "./widgetsConfig"
11
- import {
12
- formTemplates
13
- } from './templatesConfig'
14
- import {
15
- addWindowResizeHandler
16
- } from "../../../../components/xform/utils/util"
17
-
18
- let modules = {};
19
- const baseRefUtil = {
20
- i18n,
21
- axios,
22
- containers,
23
- basicFields,
24
- advancedFields,
25
- customFields,
26
- formTemplates,
27
- addWindowResizeHandler
28
- };
29
-
30
- modules = {
31
- mixins: [baseRefUtil.i18n],
32
- props: {
33
- designer: Object,
34
- },
35
- inject: ['getBannedWidgets', 'getDesignerConfig'],
36
- data() {
37
- return {
38
- designerConfig: this.getDesignerConfig(),
39
- firstTab: 'componentLib',
40
- scrollerHeight: 0,
41
- activeNames: ['1', '2', '3', '4'],
42
- metadataActiveNames: ["0", "1", "2", "3", "4"],
43
-
44
- businessActiveNames:["0"],
45
-
46
- containers: baseRefUtil.containers,
47
- commonContainers: [],
48
- basicFields: baseRefUtil.basicFields,
49
- advancedFields: baseRefUtil.advancedFields,
50
- customFields: baseRefUtil.customFields,
51
- businessFields:businessFields,
52
- commonAdvancedFields: [],
53
- chartContainers: [],
54
- chartWidgets: [],
55
- metaFields: {
56
- main: {
57
- entityName: "",
58
- entityLabel: "",
59
- fieldList: [
60
- {
61
- type: "",
62
- icon: "",
63
- displayName: "",
64
- options: {},
65
- },
66
- ],
67
- },
68
- detail: [
69
- {
70
- entityName: "",
71
- entityLabel: "",
72
- fieldList: [
73
- {
74
- type: "",
75
- icon: "",
76
- displayName: "",
77
- options: {},
78
- },
79
- ],
80
- },
81
- ],
82
- },
83
- formTemplates: baseRefUtil.formTemplates,
84
- // ftImages: [
85
- // {imgUrl: ftImg1},
86
- // {imgUrl: ftImg2},
87
- // {imgUrl: ftImg3},
88
- // {imgUrl: ftImg4},
89
- // {imgUrl: ftImg5},
90
- // {imgUrl: ftImg6},
91
- // {imgUrl: ftImg7},
92
- // {imgUrl: ftImg8},
93
- // ]
94
- }
95
- },
96
- computed: {
97
- //
98
- showComponentLib() {
99
- return this.designerConfig.componentLib === void 0
100
- ? !0
101
- : !!this.designerConfig.componentLib;
102
- },
103
- showFormTemplates() {
104
- return this.designerConfig.formTemplates === void 0
105
- ? !0
106
- : !!this.designerConfig.formTemplates;
107
- },
108
- showChartLib() {
109
- return this.designerConfig.chartLib === void 0
110
- ? !1
111
- : !!this.designerConfig.chartLib;
112
- },
113
- showMetadataLib() {
114
- return this.designerConfig.metadataLib === void 0
115
- ? !1
116
- : !!this.designerConfig.metadataLib;
117
- },
118
- },
119
- mounted() {
120
- this.designerConfig.chartLib && (this.firstTab = "chartLib"),
121
- this.designerConfig.metadataLib && (this.firstTab = "metadataLib");
122
- this.loadWidgets();
123
-
124
- this.scrollerHeight = window.innerHeight - 85 + 'px';
125
- baseRefUtil.addWindowResizeHandler(() => {
126
- this.$nextTick(() => {
127
- this.scrollerHeight = window.innerHeight - 85 + 'px';
128
- //console.log(this.scrollerHeight)
129
- });
130
- });
131
- },
132
- methods: {
133
- getMetaFieldLabel(o) {
134
- const e = o.displayName;
135
- return e.substring(e.indexOf(".") + 1, e.length);
136
- },
137
- getWidgetLabel(o) {
138
- return o.alias
139
- ? this.i18n2t(
140
- `designer.widgetLabel.${o.alias}`,
141
- `extension.widgetLabel.${o.alias}`
142
- )
143
- : this.i18n2t(
144
- `designer.widgetLabel.${o.type}`,
145
- `extension.widgetLabel.${o.type}`
146
- );
147
- },
148
- isBanned(wName) {
149
- return this.getBannedWidgets().indexOf(wName) > -1;
150
- },
151
-
152
- /*showFormTemplates() {
153
- if (this.designerConfig['formTemplates'] === undefined) {
154
- return true;
155
- }
156
-
157
- return !!this.designerConfig['formTemplates'];
158
- },*/
159
- checkColumnFlag(widget){
160
- if(this.designer.vueInstance.columnFlag){
161
- return widget.columnFlag;
162
- }
163
- return true
164
- },
165
- loadWidgets() {
166
- this.containers = this.sortByPanelOrder(containers.map(con => {
167
- return {
168
- ...con,
169
- displayName: this.i18n2t(`designer.widgetLabel.${con.type}`, `extension.widgetLabel.${con.type}`)
170
- };
171
- }).filter(con => {
172
- return !con.internal && !this.isBanned(con.type) && this.getIsShow(con);
173
- }), widgetPanelOrder.containers);
174
-
175
- this.commonContainers = this.containers.filter(con => !!con.commonFlag && this.getIsShow(con));
176
-
177
- this.basicFields = this.basicFields.map(fld => {
178
- return {
179
- ...fld,
180
- displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
181
- };
182
- }).filter(fld => {
183
- return !this.isBanned(fld.type) && this.getIsShow(fld);
184
- });
185
-
186
- this.advancedFields = this.advancedFields.map(fld => {
187
- return {
188
- ...fld,
189
- displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
190
- };
191
- }).filter(fld => {
192
- return !this.isBanned(fld.type) && this.getIsShow(fld);
193
- });
194
-
195
- /* 面板分组归一:表单数据字段(搜索框/自动完成/级联/凭证/状态等)展示在基础字段分组 */
196
- const moveTypes = widgetPanelOrder.basicFromAdvanced || [];
197
- const movedFields = this.advancedFields.filter(fld => moveTypes.indexOf(fld.type) > -1);
198
- this.advancedFields = this.advancedFields.filter(fld => moveTypes.indexOf(fld.type) === -1);
199
- this.basicFields = this.sortByPanelOrder(
200
- this.basicFields.concat(movedFields),
201
- widgetPanelOrder.basicFields
202
- );
203
- this.advancedFields = this.sortByPanelOrder(this.advancedFields, widgetPanelOrder.advancedFields);
204
-
205
- this.businessFields = this.businessFields.map(fld => {
206
- return {
207
- ...fld,
208
- displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
209
- };
210
- }).filter(fld => {
211
- return !this.isBanned(fld.type) && this.getIsShow(fld);
212
- });
213
-
214
- this.commonAdvancedFields = this.sortByPanelOrder(advancedFields.map(fld => {
215
- return {
216
- ...fld,
217
- displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
218
- };
219
- }).filter(fld => {
220
- return !this.isBanned(fld.type) && !!fld.commonFlag && this.getIsShow(fld)
221
- && moveTypes.indexOf(fld.type) === -1;
222
- }), widgetPanelOrder.advancedFields);
223
-
224
- this.customFields = this.customFields.map(fld => {
225
- return {
226
- ...fld,
227
- displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
228
- };
229
- }).filter(fld => {
230
- return !this.isBanned(fld.type) && this.getIsShow(fld);
231
- });
232
-
233
-
234
- this.chartContainers = this.chartContainers.map(con => {
235
- return {
236
- ...con,
237
- displayName: this.i18n2t(`designer.widgetLabel.${con.type}`, `extension.widgetLabel.${con.type}`)
238
- };
239
- }).filter(con => {
240
- return !con.internal && !this.isBanned(con.type) && this.getIsShow(con);
241
- });
242
-
243
- this.chartWidgets = this.chartWidgets.map(fld => {
244
- return {
245
- ...fld,
246
- displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
247
- };
248
- }).filter(fld => {
249
- return !this.isBanned(fld.type) && this.getIsShow(fld);
250
- });
251
-
252
- },
253
-
254
- /* 按 widgetPanelOrder 排序面板展示列表;未列出的类型(含扩展组件)排在末尾,保持原有相对顺序 */
255
- sortByPanelOrder(list, orderList) {
256
- if (!orderList || !orderList.length) {
257
- return list;
258
- }
259
- const orderMap = {};
260
- orderList.forEach((type, index) => {
261
- orderMap[type] = index;
262
- });
263
- return list
264
- .map((widget, index) => ({ widget, index }))
265
- .sort((a, b) => {
266
- const oa = orderMap[a.widget.type] !== undefined
267
- ? orderMap[a.widget.type]
268
- : orderList.length + a.index;
269
- const ob = orderMap[b.widget.type] !== undefined
270
- ? orderMap[b.widget.type]
271
- : orderList.length + b.index;
272
- return oa - ob;
273
- })
274
- .map(item => item.widget);
275
- },
276
-
277
- handleContainerWidgetClone(origin) {
278
- return this.designer.copyNewContainerWidget(origin);
279
- },
280
-
281
- handleFieldWidgetClone(origin) {
282
- return this.designer.copyNewFieldWidget(origin);
283
- },
284
-
285
- checkContainerMove(evt) {
286
- return this.designer.checkWidgetMove(evt);
287
- },
288
-
289
- checkFieldMove(evt) {
290
- return this.designer.checkFieldMove(evt);
291
- },
292
-
293
- onContainerDragEnd(evt) {
294
- //console.log('Drag end of container: ')
295
- //console.log(evt)
296
- },
297
-
298
- addContainerByDbClick(container) {
299
- this.designer.addContainerByDbClick(container);
300
- },
301
-
302
- addFieldByDbClick(widget) {
303
- this.designer.addFieldByDbClick(widget);
304
- },
305
-
306
- loadFormTemplate(jsonUrl) {
307
- this.$confirm(this.i18nt('designer.hint.loadFormTemplateHint'), this.i18nt('render.hint.prompt'), {
308
- confirmButtonText: this.i18nt('render.hint.confirm'),
309
- cancelButtonText: this.i18nt('render.hint.cancel')
310
- }).then(() => {
311
- baseRefUtil.axios.get(jsonUrl).then(res => {
312
- let modifiedFlag = false;
313
- if (typeof res.data === 'string') {
314
- modifiedFlag = this.designer.loadFormJson(JSON.parse(res.data));
315
- } else if (res.data.constructor === Object) {
316
- modifiedFlag = this.designer.loadFormJson(res.data);
317
- }
318
- if (modifiedFlag) {
319
- this.designer.emitHistoryChange();
320
- }
321
-
322
- this.$message.success(this.i18nt('designer.hint.loadFormTemplateSuccess'));
323
- }).catch(error => {
324
- this.$message.error(this.i18nt('designer.hint.loadFormTemplateFailed') + ':' + error);
325
- })
326
- }).catch(error => {
327
- console.error(error);
328
- });
329
- },
330
- setMetaFields(o) {
331
- this.metaFields = o;
332
- },
333
- getIsShow(ftd) {
334
- let layoutType = this.designer.getLayoutType()
335
- let flag = !ftd.layoutType || ftd.layoutType === layoutType;
336
- let flag2 = this.checkColumnFlag(ftd)
337
- let flag3 = !!ftd.commonFlag
338
- return flag && flag2 && flag3;
339
- }
340
- }
341
- };
342
-
343
- export default modules;
1
+ import i18n from "../../../../components/xform/utils/i18n"
2
+ import axios from "axios"
3
+ import {
4
+ containers,
5
+ basicFields,
6
+ advancedFields,
7
+ customFields,
8
+ businessFields,
9
+ widgetPanelOrder
10
+ } from "./widgetsConfig"
11
+ import {
12
+ formTemplates
13
+ } from './templatesConfig'
14
+ import {
15
+ addWindowResizeHandler
16
+ } from "../../../../components/xform/utils/util"
17
+
18
+ let modules = {};
19
+ const baseRefUtil = {
20
+ i18n,
21
+ axios,
22
+ containers,
23
+ basicFields,
24
+ advancedFields,
25
+ customFields,
26
+ formTemplates,
27
+ addWindowResizeHandler
28
+ };
29
+
30
+ modules = {
31
+ mixins: [baseRefUtil.i18n],
32
+ props: {
33
+ designer: Object,
34
+ },
35
+ inject: ['getBannedWidgets', 'getDesignerConfig'],
36
+ data() {
37
+ return {
38
+ designerConfig: this.getDesignerConfig(),
39
+ firstTab: 'componentLib',
40
+ scrollerHeight: 0,
41
+ activeNames: ['1', '2', '3', '4'],
42
+ metadataActiveNames: ["0", "1", "2", "3", "4"],
43
+
44
+ businessActiveNames:["0"],
45
+
46
+ containers: baseRefUtil.containers,
47
+ commonContainers: [],
48
+ basicFields: baseRefUtil.basicFields,
49
+ advancedFields: baseRefUtil.advancedFields,
50
+ customFields: baseRefUtil.customFields,
51
+ businessFields:businessFields,
52
+ commonAdvancedFields: [],
53
+ chartContainers: [],
54
+ chartWidgets: [],
55
+ metaFields: {
56
+ main: {
57
+ entityName: "",
58
+ entityLabel: "",
59
+ fieldList: [
60
+ {
61
+ type: "",
62
+ icon: "",
63
+ displayName: "",
64
+ options: {},
65
+ },
66
+ ],
67
+ },
68
+ detail: [
69
+ {
70
+ entityName: "",
71
+ entityLabel: "",
72
+ fieldList: [
73
+ {
74
+ type: "",
75
+ icon: "",
76
+ displayName: "",
77
+ options: {},
78
+ },
79
+ ],
80
+ },
81
+ ],
82
+ },
83
+ formTemplates: baseRefUtil.formTemplates,
84
+ // ftImages: [
85
+ // {imgUrl: ftImg1},
86
+ // {imgUrl: ftImg2},
87
+ // {imgUrl: ftImg3},
88
+ // {imgUrl: ftImg4},
89
+ // {imgUrl: ftImg5},
90
+ // {imgUrl: ftImg6},
91
+ // {imgUrl: ftImg7},
92
+ // {imgUrl: ftImg8},
93
+ // ]
94
+ }
95
+ },
96
+ computed: {
97
+ //
98
+ showComponentLib() {
99
+ return this.designerConfig.componentLib === void 0
100
+ ? !0
101
+ : !!this.designerConfig.componentLib;
102
+ },
103
+ showFormTemplates() {
104
+ return this.designerConfig.formTemplates === void 0
105
+ ? !0
106
+ : !!this.designerConfig.formTemplates;
107
+ },
108
+ showChartLib() {
109
+ return this.designerConfig.chartLib === void 0
110
+ ? !1
111
+ : !!this.designerConfig.chartLib;
112
+ },
113
+ showMetadataLib() {
114
+ return this.designerConfig.metadataLib === void 0
115
+ ? !1
116
+ : !!this.designerConfig.metadataLib;
117
+ },
118
+ },
119
+ mounted() {
120
+ this.designerConfig.chartLib && (this.firstTab = "chartLib"),
121
+ this.designerConfig.metadataLib && (this.firstTab = "metadataLib");
122
+ this.loadWidgets();
123
+
124
+ this.scrollerHeight = window.innerHeight - 85 + 'px';
125
+ baseRefUtil.addWindowResizeHandler(() => {
126
+ this.$nextTick(() => {
127
+ this.scrollerHeight = window.innerHeight - 85 + 'px';
128
+ //console.log(this.scrollerHeight)
129
+ });
130
+ });
131
+ },
132
+ methods: {
133
+ getMetaFieldLabel(o) {
134
+ const e = o.displayName;
135
+ return e.substring(e.indexOf(".") + 1, e.length);
136
+ },
137
+ getWidgetLabel(o) {
138
+ return o.alias
139
+ ? this.i18n2t(
140
+ `designer.widgetLabel.${o.alias}`,
141
+ `extension.widgetLabel.${o.alias}`
142
+ )
143
+ : this.i18n2t(
144
+ `designer.widgetLabel.${o.type}`,
145
+ `extension.widgetLabel.${o.type}`
146
+ );
147
+ },
148
+ isBanned(wName) {
149
+ return this.getBannedWidgets().indexOf(wName) > -1;
150
+ },
151
+
152
+ /*showFormTemplates() {
153
+ if (this.designerConfig['formTemplates'] === undefined) {
154
+ return true;
155
+ }
156
+
157
+ return !!this.designerConfig['formTemplates'];
158
+ },*/
159
+ checkColumnFlag(widget){
160
+ if(this.designer.vueInstance.columnFlag){
161
+ return widget.columnFlag;
162
+ }
163
+ return true
164
+ },
165
+ loadWidgets() {
166
+ this.containers = this.sortByPanelOrder(containers.map(con => {
167
+ return {
168
+ ...con,
169
+ displayName: this.i18n2t(`designer.widgetLabel.${con.type}`, `extension.widgetLabel.${con.type}`)
170
+ };
171
+ }).filter(con => {
172
+ return !con.internal && !this.isBanned(con.type) && this.getIsShow(con);
173
+ }), widgetPanelOrder.containers);
174
+
175
+ this.commonContainers = this.containers.filter(con => !!con.commonFlag && this.getIsShow(con));
176
+
177
+ this.basicFields = this.basicFields.map(fld => {
178
+ return {
179
+ ...fld,
180
+ displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
181
+ };
182
+ }).filter(fld => {
183
+ return !this.isBanned(fld.type) && this.getIsShow(fld);
184
+ });
185
+
186
+ this.advancedFields = this.advancedFields.map(fld => {
187
+ return {
188
+ ...fld,
189
+ displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
190
+ };
191
+ }).filter(fld => {
192
+ return !this.isBanned(fld.type) && this.getIsShow(fld);
193
+ });
194
+
195
+ /* 面板分组归一:表单数据字段(搜索框/自动完成/级联/凭证/状态等)展示在基础字段分组 */
196
+ const moveTypes = widgetPanelOrder.basicFromAdvanced || [];
197
+ const movedFields = this.advancedFields.filter(fld => moveTypes.indexOf(fld.type) > -1);
198
+ this.advancedFields = this.advancedFields.filter(fld => moveTypes.indexOf(fld.type) === -1);
199
+ this.basicFields = this.sortByPanelOrder(
200
+ this.basicFields.concat(movedFields),
201
+ widgetPanelOrder.basicFields
202
+ );
203
+ this.advancedFields = this.sortByPanelOrder(this.advancedFields, widgetPanelOrder.advancedFields);
204
+
205
+ this.businessFields = this.businessFields.map(fld => {
206
+ return {
207
+ ...fld,
208
+ displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
209
+ };
210
+ }).filter(fld => {
211
+ return !this.isBanned(fld.type) && this.getIsShow(fld);
212
+ });
213
+
214
+ this.commonAdvancedFields = this.sortByPanelOrder(advancedFields.map(fld => {
215
+ return {
216
+ ...fld,
217
+ displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
218
+ };
219
+ }).filter(fld => {
220
+ return !this.isBanned(fld.type) && !!fld.commonFlag && this.getIsShow(fld)
221
+ && moveTypes.indexOf(fld.type) === -1;
222
+ }), widgetPanelOrder.advancedFields);
223
+
224
+ this.customFields = this.customFields.map(fld => {
225
+ return {
226
+ ...fld,
227
+ displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
228
+ };
229
+ }).filter(fld => {
230
+ return !this.isBanned(fld.type) && this.getIsShow(fld);
231
+ });
232
+
233
+
234
+ this.chartContainers = this.chartContainers.map(con => {
235
+ return {
236
+ ...con,
237
+ displayName: this.i18n2t(`designer.widgetLabel.${con.type}`, `extension.widgetLabel.${con.type}`)
238
+ };
239
+ }).filter(con => {
240
+ return !con.internal && !this.isBanned(con.type) && this.getIsShow(con);
241
+ });
242
+
243
+ this.chartWidgets = this.chartWidgets.map(fld => {
244
+ return {
245
+ ...fld,
246
+ displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
247
+ };
248
+ }).filter(fld => {
249
+ return !this.isBanned(fld.type) && this.getIsShow(fld);
250
+ });
251
+
252
+ },
253
+
254
+ /* 按 widgetPanelOrder 排序面板展示列表;未列出的类型(含扩展组件)排在末尾,保持原有相对顺序 */
255
+ sortByPanelOrder(list, orderList) {
256
+ if (!orderList || !orderList.length) {
257
+ return list;
258
+ }
259
+ const orderMap = {};
260
+ orderList.forEach((type, index) => {
261
+ orderMap[type] = index;
262
+ });
263
+ return list
264
+ .map((widget, index) => ({ widget, index }))
265
+ .sort((a, b) => {
266
+ const oa = orderMap[a.widget.type] !== undefined
267
+ ? orderMap[a.widget.type]
268
+ : orderList.length + a.index;
269
+ const ob = orderMap[b.widget.type] !== undefined
270
+ ? orderMap[b.widget.type]
271
+ : orderList.length + b.index;
272
+ return oa - ob;
273
+ })
274
+ .map(item => item.widget);
275
+ },
276
+
277
+ handleContainerWidgetClone(origin) {
278
+ return this.designer.copyNewContainerWidget(origin);
279
+ },
280
+
281
+ handleFieldWidgetClone(origin) {
282
+ return this.designer.copyNewFieldWidget(origin);
283
+ },
284
+
285
+ checkContainerMove(evt) {
286
+ return this.designer.checkWidgetMove(evt);
287
+ },
288
+
289
+ checkFieldMove(evt) {
290
+ return this.designer.checkFieldMove(evt);
291
+ },
292
+
293
+ onContainerDragEnd(evt) {
294
+ //console.log('Drag end of container: ')
295
+ //console.log(evt)
296
+ },
297
+
298
+ addContainerByDbClick(container) {
299
+ this.designer.addContainerByDbClick(container);
300
+ },
301
+
302
+ addFieldByDbClick(widget) {
303
+ this.designer.addFieldByDbClick(widget);
304
+ },
305
+
306
+ loadFormTemplate(jsonUrl) {
307
+ this.$confirm(this.i18nt('designer.hint.loadFormTemplateHint'), this.i18nt('render.hint.prompt'), {
308
+ confirmButtonText: this.i18nt('render.hint.confirm'),
309
+ cancelButtonText: this.i18nt('render.hint.cancel')
310
+ }).then(() => {
311
+ baseRefUtil.axios.get(jsonUrl).then(res => {
312
+ let modifiedFlag = false;
313
+ if (typeof res.data === 'string') {
314
+ modifiedFlag = this.designer.loadFormJson(JSON.parse(res.data));
315
+ } else if (res.data.constructor === Object) {
316
+ modifiedFlag = this.designer.loadFormJson(res.data);
317
+ }
318
+ if (modifiedFlag) {
319
+ this.designer.emitHistoryChange();
320
+ }
321
+
322
+ this.$message.success(this.i18nt('designer.hint.loadFormTemplateSuccess'));
323
+ }).catch(error => {
324
+ this.$message.error(this.i18nt('designer.hint.loadFormTemplateFailed') + ':' + error);
325
+ })
326
+ }).catch(error => {
327
+ console.error(error);
328
+ });
329
+ },
330
+ setMetaFields(o) {
331
+ this.metaFields = o;
332
+ },
333
+ getIsShow(ftd) {
334
+ let layoutType = this.designer.getLayoutType()
335
+ let flag = !ftd.layoutType || ftd.layoutType === layoutType;
336
+ let flag2 = this.checkColumnFlag(ftd)
337
+ let flag3 = !!ftd.commonFlag
338
+ return flag && flag2 && flag3;
339
+ }
340
+ }
341
+ };
342
+
343
+ export default modules;