@byteluck-fe/model-driven-upgrade 2.7.0-alpha.0 → 2.7.0-alpha.2

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.
@@ -56,9 +56,9 @@ function _unsupportedIterableToArray(o, minLen) {
56
56
  if (n === "Map" || n === "Set") return Array.from(n);
57
57
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
58
58
  }
59
- import { loop, toNumberOrEmpty, isLanguageObject, camelizeKeys, decamelizeKeys, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
60
- import { DataSourceBind } from '@byteluck-fe/model-driven-core';
61
- import { Col, SubTableColumn, ListView, DataView } from '@byteluck-fe/model-driven-controls';
59
+ import { loop, toNumberOrEmpty, isLanguageObject, camelizeKeys, decamelizeKeys, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
60
+ import { DataSourceBind } from "@byteluck-fe/model-driven-core";
61
+ import { Col, SubTableColumn, ListView, DataView } from "@byteluck-fe/model-driven-controls";
62
62
  var dataCleaner = function(schemaItems, payload) {
63
63
  var isArray = Array.isArray(schemaItems);
64
64
  var schemaArray = isArray ? schemaItems : [
@@ -80,122 +80,122 @@ var baseControlKeys = [
80
80
  CONTROL_TYPE.TITLE,
81
81
  CONTROL_TYPE.LINK,
82
82
  CONTROL_TYPE.BUTTON,
83
- 'list-btn-export-list',
84
- 'list-btn-export-record',
83
+ "list-btn-export-list",
84
+ "list-btn-export-record"
85
85
  ];
86
86
  var listControlKeys = [
87
- 'subtable',
88
- 'grid-table'
87
+ "subtable",
88
+ "grid-table"
89
89
  ];
90
90
  var searchViewControlKeys = [
91
- 'simple-search'
91
+ "simple-search"
92
92
  ];
93
- function conversion(item1, payload) {
94
- var ref, ref1, ref2;
95
- var new_item = item1;
93
+ function conversion(item, payload) {
94
+ var _item_props, _item_props1, _item_props2;
95
+ var new_item = item;
96
96
  if (!new_item.controlType) {
97
97
  if (new_item.is_layout_control === true) {
98
- new_item.controlType = 'layout';
98
+ new_item.controlType = "layout";
99
99
  } else if (baseControlKeys.includes(new_item.type)) {
100
- new_item.controlType = 'base';
100
+ new_item.controlType = "base";
101
101
  } else {
102
- new_item.controlType = 'form';
102
+ new_item.controlType = "form";
103
103
  }
104
104
  // 放在这个位置,而不是else if是因为原来的subtable是一个form控件
105
105
  if (listControlKeys.includes(new_item.type)) {
106
- new_item.controlType = 'list';
106
+ new_item.controlType = "list";
107
107
  }
108
108
  if (searchViewControlKeys.includes(new_item.type)) {
109
- new_item.controlType = 'search-view';
109
+ new_item.controlType = "search-view";
110
110
  }
111
111
  }
112
112
  delete new_item.is_layout_control;
113
- if (item1.props.lable_position) {
114
- item1.props.labelPosition = item1.props.lable_position;
113
+ if (item.props.lable_position) {
114
+ item.props.labelPosition = item.props.lable_position;
115
115
  }
116
116
  // 排列方式
117
- if (item1.props.select_mode) {
118
- item1.props.optionsFormat = item1.props.select_mode;
117
+ if (item.props.select_mode) {
118
+ item.props.optionsFormat = item.props.select_mode;
119
119
  }
120
120
  // 默认值
121
- if (item1.props.value) {
122
- item1.props.defaultValue = item1.props.value;
121
+ if (item.props.value) {
122
+ item.props.defaultValue = item.props.value;
123
123
  }
124
124
  //caption/placeholder/placeholder_end 的 zh 属性将被保留,国际化资源都丢弃,放到外部
125
- if (isLanguageObject(item1 === null || item1 === void 0 ? void 0 : (ref = item1.props) === null || ref === void 0 ? void 0 : ref.caption)) {
126
- new_item.props.caption = item1.props.caption.zh;
125
+ if (isLanguageObject(item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.caption)) {
126
+ new_item.props.caption = item.props.caption.zh;
127
127
  }
128
- if (isLanguageObject(item1 === null || item1 === void 0 ? void 0 : (ref1 = item1.props) === null || ref1 === void 0 ? void 0 : ref1.placeholder)) {
129
- new_item.props.placeholder = item1.props.placeholder.zh;
128
+ if (isLanguageObject(item === null || item === void 0 ? void 0 : (_item_props1 = item.props) === null || _item_props1 === void 0 ? void 0 : _item_props1.placeholder)) {
129
+ new_item.props.placeholder = item.props.placeholder.zh;
130
130
  }
131
- if (isLanguageObject(item1 === null || item1 === void 0 ? void 0 : (ref2 = item1.props) === null || ref2 === void 0 ? void 0 : ref2.placeholder_end)) {
132
- new_item.props.placeholder_end = item1.props.placeholder_end.zh;
131
+ if (isLanguageObject(item === null || item === void 0 ? void 0 : (_item_props2 = item.props) === null || _item_props2 === void 0 ? void 0 : _item_props2.placeholder_end)) {
132
+ new_item.props.placeholder_end = item.props.placeholder_end.zh;
133
133
  }
134
134
  // 部门组件
135
- if (item1.type === 'department-search') {
136
- new_item.type = 'department';
137
- if (item1.props.value.length) {
138
- new_item.props.default_value = item1.props.value;
135
+ if (item.type === "department-search") {
136
+ new_item.type = "department";
137
+ if (item.props.value.length) {
138
+ new_item.props.default_value = item.props.value;
139
139
  }
140
- new_item.props.showType = item1.props.show_tree ? 'tree' : 'default';
141
- new_item.props.rangeOptions = item1.props.department_list;
140
+ new_item.props.showType = item.props.show_tree ? "tree" : "default";
141
+ new_item.props.rangeOptions = item.props.department_list;
142
142
  }
143
- if (item1.type === 'automatic-number') {
144
- new_item.type = 'auto-number';
145
- new_item.props.defaultValue = item1.props.value;
143
+ if (item.type === "automatic-number") {
144
+ new_item.type = "auto-number";
145
+ new_item.props.defaultValue = item.props.value;
146
146
  }
147
147
  // 附件类型转换
148
- if (item1.type === 'file') {
149
- var ref3;
150
- new_item.type = 'attachment';
151
- new_item.props.attachmentAccept = (ref3 = item1.attachment_format) === null || ref3 === void 0 ? void 0 : ref3.split(',');
152
- new_item.props.showType = item1.props.show_type === 'title' ? 'default' : 'table';
148
+ if (item.type === "file") {
149
+ var _item_attachment_format;
150
+ new_item.type = "attachment";
151
+ new_item.props.attachmentAccept = (_item_attachment_format = item.attachment_format) === null || _item_attachment_format === void 0 ? void 0 : _item_attachment_format.split(",");
152
+ new_item.props.showType = item.props.show_type === "title" ? "default" : "table";
153
153
  }
154
- if (item1.type === 'image') {
155
- var ref4;
156
- new_item.props.attachmentAccept = (ref4 = item1.attachment_format) === null || ref4 === void 0 ? void 0 : ref4.split(',');
154
+ if (item.type === "image") {
155
+ var _item_attachment_format1;
156
+ new_item.props.attachmentAccept = (_item_attachment_format1 = item.attachment_format) === null || _item_attachment_format1 === void 0 ? void 0 : _item_attachment_format1.split(",");
157
157
  }
158
158
  // 日期选择转换
159
- if (item1.type === 'date-pick') {
160
- new_item.type = 'date-picker';
159
+ if (item.type === "date-pick") {
160
+ new_item.type = "date-picker";
161
161
  }
162
- if (item1.type === 'rich-text') {
163
- if (isLanguageObject(item1.props.value)) {
164
- new_item.props.defaultValue = item1.props.value.zh;
162
+ if (item.type === "rich-text") {
163
+ if (isLanguageObject(item.props.value)) {
164
+ new_item.props.defaultValue = item.props.value.zh;
165
165
  } else {
166
- new_item.props.defaultValue = item1.props.value;
166
+ new_item.props.defaultValue = item.props.value;
167
167
  }
168
168
  }
169
169
  if ([
170
- 'link',
171
- 'text',
172
- 'button'
173
- ].includes(item1.type)) {
174
- if (isLanguageObject(item1.props.value)) {
175
- new_item.props.content = item1.props.value.zh;
170
+ "link",
171
+ "text",
172
+ "button"
173
+ ].includes(item.type)) {
174
+ if (isLanguageObject(item.props.value)) {
175
+ new_item.props.content = item.props.value.zh;
176
176
  } else {
177
- new_item.props.content = item1.props.value;
177
+ new_item.props.content = item.props.value;
178
178
  }
179
179
  }
180
- if (item1.type === 'text') {
181
- if (item1.props.showState === 'iconText') {
182
- new_item.props.showState = 'image';
180
+ if (item.type === "text") {
181
+ if (item.props.showState === "iconText") {
182
+ new_item.props.showState = "image";
183
183
  }
184
184
  }
185
- if (item1.type === 'user-search') {
186
- new_item.type = 'employee';
187
- new_item.props.defaultValue = item1.props.value;
185
+ if (item.type === "user-search") {
186
+ new_item.type = "employee";
187
+ new_item.props.defaultValue = item.props.value;
188
188
  }
189
- if (item1.type === 'address') {
190
- new_item.props.addressType = item1.props.address_type_value;
189
+ if (item.type === "address") {
190
+ new_item.props.addressType = item.props.address_type_value;
191
191
  }
192
192
  //明细子表去掉 subtable-row,保留 subtable-column
193
- if (new_item.type === 'subtable') {
194
- var ref5;
193
+ if (new_item.type === "subtable") {
194
+ var _new_item_children_;
195
195
  // 转换打开方式
196
196
  var entryType = new_item.props.entry_type || new_item.props.entryType;
197
- new_item.props.openType = entryType === 'subpage' ? 'modal' : 'default';
198
- if (((ref5 = new_item.children[0]) === null || ref5 === void 0 ? void 0 : ref5.type) === 'subtable-row') {
197
+ new_item.props.openType = entryType === "subpage" ? "modal" : "default";
198
+ if (((_new_item_children_ = new_item.children[0]) === null || _new_item_children_ === void 0 ? void 0 : _new_item_children_.type) === "subtable-row") {
199
199
  if (new_item.props.headers) {
200
200
  new_item.props.headers = new_item.props.headers.map(function(item, index) {
201
201
  var subtableColumn = new SubTableColumn.Designer();
@@ -203,7 +203,7 @@ function conversion(item1, payload) {
203
203
  // item.header_width_config === '1' ? 'auto' : 'px'
204
204
  // subtableColumn.props.width =
205
205
  // item.header_width === '' ? 200 : Number(item.header_width)
206
- subtableColumn.props.caption = isLanguageObject(item.field_name) ? item.field_name['zh'] : item.field_name;
206
+ subtableColumn.props.caption = isLanguageObject(item.field_name) ? item.field_name["zh"] : item.field_name;
207
207
  var schema = subtableColumn.toSchema();
208
208
  schema.id = item.header_id;
209
209
  var child = new_item.children[0].children[index].children[0];
@@ -216,25 +216,25 @@ function conversion(item1, payload) {
216
216
  }
217
217
  }
218
218
  }
219
- if (new_item.type === 'subtable-cell') {
220
- new_item.type = 'subtable-column';
219
+ if (new_item.type === "subtable-cell") {
220
+ new_item.type = "subtable-column";
221
221
  }
222
222
  var optionsControl = [
223
- 'radio',
224
- 'checkbox',
225
- 'select',
226
- 'select-multiple'
223
+ "radio",
224
+ "checkbox",
225
+ "select",
226
+ "select-multiple"
227
227
  ];
228
228
  //radio / checkbox 中 options text 的 zh 属性保留 国际化资源丢弃
229
- if (optionsControl.includes(item1.type)) {
230
- item1.props.options.map(function(option) {
229
+ if (optionsControl.includes(item.type)) {
230
+ item.props.options.map(function(option) {
231
231
  option.label = isLanguageObject(option.text) ? option.text.zh : option.text;
232
232
  option.id = option.id || option.opt_id || option.optId || option.data_id;
233
233
  });
234
- new_item = item1;
234
+ new_item = item;
235
235
  }
236
236
  // grid-row 更改type,并且添加col控件
237
- if (item1.type === 'grid-row') {
237
+ if (item.type === "grid-row") {
238
238
  var span = 24 / new_item.children.length;
239
239
  new_item.children = new_item.children.map(function(child) {
240
240
  var newCol = new Col.Designer();
@@ -245,21 +245,21 @@ function conversion(item1, payload) {
245
245
  });
246
246
  }
247
247
  // grid-layout-row 更改type
248
- if (item1.type === 'grid-layout-row') {
249
- new_item.type = 'row';
248
+ if (item.type === "grid-layout-row") {
249
+ new_item.type = "row";
250
250
  }
251
- if (item1.type === 'grid-layout-col') {
252
- new_item.type = 'col';
251
+ if (item.type === "grid-layout-col") {
252
+ new_item.type = "col";
253
253
  }
254
- if (item1.type === 'group-panel') {
255
- new_item.type = 'card-group';
256
- new_item.props.collapse = new_item.props.flod === 'no' ? 'none' : new_item.props.flod;
254
+ if (item.type === "group-panel") {
255
+ new_item.type = "card-group";
256
+ new_item.props.collapse = new_item.props.flod === "no" ? "none" : new_item.props.flod;
257
257
  }
258
258
  // tabs-pane => tab-pane
259
- if (item1.type === 'tabs-pane') {
260
- new_item.type = 'tab-pane';
259
+ if (item.type === "tabs-pane") {
260
+ new_item.type = "tab-pane";
261
261
  }
262
- if (item1.type === 'calc') {
262
+ if (item.type === "calc") {
263
263
  var calcValue = new_item === null || new_item === void 0 ? void 0 : new_item.children[0];
264
264
  var calcUnit = new_item === null || new_item === void 0 ? void 0 : new_item.children[1];
265
265
  var newDataBind = {};
@@ -283,9 +283,9 @@ function conversion(item1, payload) {
283
283
  new_item.props.dataBind = newDataBind;
284
284
  delete new_item.children;
285
285
  }
286
- if (item1.type === 'amount-currency') {
287
- new_item.type = 'amount';
288
- new_item.controlType = 'form';
286
+ if (item.type === "amount-currency") {
287
+ new_item.type = "amount";
288
+ new_item.controlType = "form";
289
289
  var amount = new_item === null || new_item === void 0 ? void 0 : new_item.children[0];
290
290
  var currency = new_item === null || new_item === void 0 ? void 0 : new_item.children[1];
291
291
  var newDataBind1 = {};
@@ -320,12 +320,12 @@ function conversion(item1, payload) {
320
320
  new_item.props.defaultValue = defaultValue;
321
321
  delete new_item.children;
322
322
  }
323
- if (item1.type === 'date-range') {
324
- new_item.controlType = 'form';
323
+ if (item.type === "date-range") {
324
+ new_item.controlType = "form";
325
325
  var min = new_item === null || new_item === void 0 ? void 0 : new_item.children[0];
326
326
  var max = new_item === null || new_item === void 0 ? void 0 : new_item.children[1];
327
- new_item.props.placeholderStart = isLanguageObject(item1.props.placeholder) ? item1.props.placeholder.zh : item1.props.placeholder;
328
- new_item.props.caption = isLanguageObject(item1.props.caption) ? item1.props.caption.zh : item1.props.caption;
327
+ new_item.props.placeholderStart = isLanguageObject(item.props.placeholder) ? item.props.placeholder.zh : item.props.placeholder;
328
+ new_item.props.caption = isLanguageObject(item.props.caption) ? item.props.caption.zh : item.props.caption;
329
329
  var newDataBind2 = {};
330
330
  if (min) {
331
331
  newDataBind2.min = min.props.data_bind;
@@ -336,26 +336,26 @@ function conversion(item1, payload) {
336
336
  new_item.props.dataBind = newDataBind2;
337
337
  delete new_item.children;
338
338
  }
339
- if (item1.type === 'score') {
339
+ if (item.type === "score") {
340
340
  new_item.props.defaultValue = new_item.props.value * 1;
341
341
  }
342
342
  if ([
343
- 'input',
344
- 'textarea'
345
- ].includes(item1.type)) {
346
- new_item.props.defaultValue = isLanguageObject(item1.props.value) ? item1.props.value.zh : item1.props.value;
343
+ "input",
344
+ "textarea"
345
+ ].includes(item.type)) {
346
+ new_item.props.defaultValue = isLanguageObject(item.props.value) ? item.props.value.zh : item.props.value;
347
347
  }
348
- if (item1.type === 'number') {
349
- new_item.props.range_min = toNumberOrEmpty(item1.props.range_min);
350
- new_item.props.range_max = toNumberOrEmpty(item1.props.range_max);
351
- new_item.props.defaultValue = toNumberOrEmpty(item1.props.value);
348
+ if (item.type === "number") {
349
+ new_item.props.range_min = toNumberOrEmpty(item.props.range_min);
350
+ new_item.props.range_max = toNumberOrEmpty(item.props.range_max);
351
+ new_item.props.defaultValue = toNumberOrEmpty(item.props.value);
352
352
  }
353
- if (item1.type === 'list-page-btn-custom-button') {
354
- item1.type = 'button';
353
+ if (item.type === "list-page-btn-custom-button") {
354
+ item.type = "button";
355
355
  }
356
- if (item1.type === 'button') {
357
- if (item1.props.button_type === 'dashed') {
358
- new_item.props.buttonType = 'default';
356
+ if (item.type === "button") {
357
+ if (item.props.button_type === "dashed") {
358
+ new_item.props.buttonType = "default";
359
359
  }
360
360
  }
361
361
  conversionControlEvents(new_item, payload === null || payload === void 0 ? void 0 : payload.control_events);
@@ -363,7 +363,7 @@ function conversion(item1, payload) {
363
363
  }
364
364
  function conversionDisplayBoListAndBehaviors(control, payload) {
365
365
  if (!payload) return;
366
- var _displayBoList = payload.displayBoList, displayBoList = _displayBoList === void 0 ? [] : _displayBoList, _behaviors = payload.behaviors, behaviors = _behaviors === void 0 ? [] : _behaviors;
366
+ var _payload_displayBoList = payload.displayBoList, displayBoList = _payload_displayBoList === void 0 ? [] : _payload_displayBoList, _payload_behaviors = payload.behaviors, behaviors = _payload_behaviors === void 0 ? [] : _payload_behaviors;
367
367
  var controlId = control.id;
368
368
  var newId = control.children[0].id;
369
369
  displayBoList.forEach(function(item) {
@@ -394,7 +394,7 @@ function conversionDataViewPage(controlArray) {
394
394
  return controlArray;
395
395
  }
396
396
  var grid = controlArray.find(function(item) {
397
- return item.type === 'grid';
397
+ return item.type === "grid";
398
398
  });
399
399
  if (!grid) {
400
400
  return controlArray;
@@ -419,13 +419,13 @@ function conversionLayoutControl(schemArray) {
419
419
  if (!(item && item.children)) return;
420
420
  var controlArray = item.children;
421
421
  for(var i = 0; i < controlArray.length; i++){
422
- var ref, ref6;
422
+ var _controlArray_i, _controlArray_i_children;
423
423
  var control = controlArray[i];
424
- var child = (ref = controlArray[i]) === null || ref === void 0 ? void 0 : (ref6 = ref.children) === null || ref6 === void 0 ? void 0 : ref6[0];
425
- if (control.type === 'grid-row' && child && [
426
- 'group-panel',
427
- 'subtable',
428
- 'tab'
424
+ var child = (_controlArray_i = controlArray[i]) === null || _controlArray_i === void 0 ? void 0 : (_controlArray_i_children = _controlArray_i.children) === null || _controlArray_i_children === void 0 ? void 0 : _controlArray_i_children[0];
425
+ if (control.type === "grid-row" && child && [
426
+ "group-panel",
427
+ "subtable",
428
+ "tab"
429
429
  ].includes(child.type)) {
430
430
  controlArray.splice(i, 1, child);
431
431
  }
@@ -433,31 +433,31 @@ function conversionLayoutControl(schemArray) {
433
433
  });
434
434
  }
435
435
  function conversionListPage(controlArray, payload) {
436
- var ref, ref7, ref8, ref9, ref10;
436
+ var _listPageProps_source_config, _listPageProps_source_config1, _listPageProps_source_config2, _listPageProps_source_config3, _listPageProps_sublist_page;
437
437
  if (!(Array.isArray(controlArray) && controlArray.length === 1)) {
438
438
  return controlArray;
439
439
  }
440
440
  var listPage = controlArray[0];
441
- if (listPage.type !== 'list-page') {
441
+ if (listPage.type !== "list-page") {
442
442
  return controlArray;
443
443
  }
444
444
  // children = search + toolbox + table
445
445
  var listPageProps = listPage.props, children = listPage.children;
446
446
  var _children = _slicedToArray(children, 3), search = _children[0], toolbox = _children[1], table = _children[2];
447
447
  conversionSearch(search);
448
- table.props.is_fixed_header = listPageProps === null || listPageProps === void 0 ? void 0 : (ref = listPageProps.source_config) === null || ref === void 0 ? void 0 : ref.is_fixed_header;
448
+ table.props.is_fixed_header = listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_source_config = listPageProps.source_config) === null || _listPageProps_source_config === void 0 ? void 0 : _listPageProps_source_config.is_fixed_header;
449
449
  // table.props.datasource_bind = new DataSourceBind({
450
450
  // dataCode: listPageProps?.source_config?data_code,
451
451
  // svcCode: listPageProps?.source_config?svc_code,
452
452
  // orders: camelizeKeys(listPageProps?.source_config?orders) as any[],
453
453
  // })
454
454
  conversionGridTable(table, toolbox);
455
- var ref11;
456
- var dataCode = (ref11 = listPageProps === null || listPageProps === void 0 ? void 0 : (ref7 = listPageProps.source_config) === null || ref7 === void 0 ? void 0 : ref7.data_code) !== null && ref11 !== void 0 ? ref11 : payload === null || payload === void 0 ? void 0 : payload.dataCode;
457
- var ref12;
458
- var svcCode = ((ref12 = listPageProps === null || listPageProps === void 0 ? void 0 : (ref8 = listPageProps.source_config) === null || ref8 === void 0 ? void 0 : ref8.svc_code) !== null && ref12 !== void 0 ? ref12 : dataCode) ? "".concat(dataCode, "_selectMore") : undefined;
459
- var ref13;
460
- var orders = (ref13 = listPageProps === null || listPageProps === void 0 ? void 0 : (ref9 = listPageProps.source_config) === null || ref9 === void 0 ? void 0 : ref9.orders) !== null && ref13 !== void 0 ? ref13 : [];
455
+ var _listPageProps_source_config_data_code;
456
+ var dataCode = (_listPageProps_source_config_data_code = listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_source_config1 = listPageProps.source_config) === null || _listPageProps_source_config1 === void 0 ? void 0 : _listPageProps_source_config1.data_code) !== null && _listPageProps_source_config_data_code !== void 0 ? _listPageProps_source_config_data_code : payload === null || payload === void 0 ? void 0 : payload.dataCode;
457
+ var _listPageProps_source_config_svc_code;
458
+ var svcCode = ((_listPageProps_source_config_svc_code = listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_source_config2 = listPageProps.source_config) === null || _listPageProps_source_config2 === void 0 ? void 0 : _listPageProps_source_config2.svc_code) !== null && _listPageProps_source_config_svc_code !== void 0 ? _listPageProps_source_config_svc_code : dataCode) ? "".concat(dataCode, "_selectMore") : undefined;
459
+ var _listPageProps_source_config_orders;
460
+ var orders = (_listPageProps_source_config_orders = listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_source_config3 = listPageProps.source_config) === null || _listPageProps_source_config3 === void 0 ? void 0 : _listPageProps_source_config3.orders) !== null && _listPageProps_source_config_orders !== void 0 ? _listPageProps_source_config_orders : [];
461
461
  var listView = new ListView.Designer();
462
462
  listView.props.datasourceBind = new DataSourceBind({
463
463
  dataCode: dataCode,
@@ -467,7 +467,7 @@ function conversionListPage(controlArray, payload) {
467
467
  listView.props.isShowSubList = listPageProps.is_show_sublist;
468
468
  listView.props.triggerType = listPageProps.timing_type;
469
469
  listView.props.triggerFieldCode = listPageProps.ctrl_field_code;
470
- listPageProps === null || listPageProps === void 0 ? void 0 : (ref10 = listPageProps.sublist_page) === null || ref10 === void 0 ? void 0 : ref10.sublists.forEach(function(item) {
470
+ listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_sublist_page = listPageProps.sublist_page) === null || _listPageProps_sublist_page === void 0 ? void 0 : _listPageProps_sublist_page.sublists.forEach(function(item) {
471
471
  item.title = isLanguageObject(item.title) ? item.title.zh : item.title;
472
472
  });
473
473
  listView.props.sublistPage = listPageProps.sublist_page;
@@ -478,34 +478,34 @@ function conversionListPage(controlArray, payload) {
478
478
  ];
479
479
  }
480
480
  function conversionSearch(searchControl) {
481
- searchControl.type = 'simple-search';
482
- searchControl.control_type = 'search-view';
481
+ searchControl.type = "simple-search";
482
+ searchControl.control_type = "search-view";
483
483
  searchControl.children.forEach(function(item) {
484
- var placeholder = isLanguageObject(item.placeholder) ? item.placeholder['zh'] : item.placeholder;
485
- if (item.type === 'number-range') {
486
- item.type = 'search-number-range';
484
+ var placeholder = isLanguageObject(item.placeholder) ? item.placeholder["zh"] : item.placeholder;
485
+ if (item.type === "number-range") {
486
+ item.type = "search-number-range";
487
487
  item.placeholderStart = placeholder;
488
488
  item.placeholderEnd = placeholder;
489
489
  }
490
- if (item.type === 'date-pick') {
491
- var ref, ref14;
492
- item.type = 'search-date-range';
490
+ if (item.type === "date-pick") {
491
+ var _item_dateType, _item_dateType_replace;
492
+ item.type = "search-date-range";
493
493
  item.placeholderStart = placeholder;
494
494
  item.placeholderEnd = placeholder;
495
- item.dateType = (ref = item.dateType) === null || ref === void 0 ? void 0 : (ref14 = ref.replace) === null || ref14 === void 0 ? void 0 : ref14.call(ref, /range$/);
495
+ item.dateType = (_item_dateType = item.dateType) === null || _item_dateType === void 0 ? void 0 : (_item_dateType_replace = _item_dateType.replace) === null || _item_dateType_replace === void 0 ? void 0 : _item_dateType_replace.call(_item_dateType, /range$/);
496
496
  }
497
- if (item.type === 'automatic-number' || item.type === 'auto-number') {
498
- item.type = 'search-input';
499
- item.props.defaultValue = '';
497
+ if (item.type === "automatic-number" || item.type === "auto-number") {
498
+ item.type = "search-input";
499
+ item.props.defaultValue = "";
500
500
  }
501
501
  });
502
502
  }
503
503
  function conversionGridTable(tableControl, toolbox) {
504
504
  // 去掉了'list-page-btn-custom-head'按钮控件
505
505
  tableControl.children = toolbox.children.filter(function(item) {
506
- return item.type !== 'list-page-btn-custom-head';
506
+ return item.type !== "list-page-btn-custom-head";
507
507
  });
508
- tableControl.type = 'grid-table';
508
+ tableControl.type = "grid-table";
509
509
  if (tableControl.props.sublist_page) {
510
510
  tableControl.props.sublist_page.form_bind = {
511
511
  data_code: tableControl.props.sublist_page.data_code,
@@ -515,63 +515,63 @@ function conversionGridTable(tableControl, toolbox) {
515
515
  if (Array.isArray(tableControl.props.headers)) {
516
516
  tableControl.props.headers = tableControl.props.headers.map(function(item) {
517
517
  var obj = {
518
- type: '',
519
- control_type: 'column',
518
+ type: "",
519
+ control_type: "column",
520
520
  props: {
521
- widthType: 'px',
521
+ widthType: "px",
522
522
  width: 50,
523
- caption: '',
523
+ caption: "",
524
524
  field_code: item.field_code,
525
- field_name: isLanguageObject(item.field_name) ? item.field_name['zh'] : item.field_name
525
+ field_name: isLanguageObject(item.field_name) ? item.field_name["zh"] : item.field_name
526
526
  }
527
527
  };
528
- obj.props.caption = isLanguageObject(item.field_name) ? item.field_name['zh'] : item.field_name;
528
+ obj.props.caption = isLanguageObject(item.field_name) ? item.field_name["zh"] : item.field_name;
529
529
  obj.props.filter_tags = item.is_filter_tags;
530
530
  obj.props.fixed = item.fixed;
531
531
  obj.props.display_bo_list = item.display_bo_list;
532
532
  obj.props.date_type = item.date_type;
533
- obj.props.optionConfig = 'none';
533
+ obj.props.optionConfig = "none";
534
534
  if (item.header_width_config) {
535
- obj.props.widthType = item.header_width_config === '1' ? 'auto' : 'px';
535
+ obj.props.widthType = item.header_width_config === "1" ? "auto" : "px";
536
536
  }
537
- if (obj.props.widthType === 'px' && item.header_width) {
537
+ if (obj.props.widthType === "px" && item.header_width) {
538
538
  obj.props.width = Number(item.header_width);
539
539
  }
540
- if (item.table_header_type === 'order') {
541
- obj.type = 'order-column';
540
+ if (item.table_header_type === "order") {
541
+ obj.type = "order-column";
542
542
  obj.props.fixed = true;
543
- } else if (item.table_header_type === 'operation') {
544
- obj.type = 'operation-column';
545
- var _check;
546
- obj.props.check = (_check = item.check) !== null && _check !== void 0 ? _check : {};
547
- obj.props.check.openType = 'window';
548
- var _delete;
549
- obj.props.delete = (_delete = item.delete) !== null && _delete !== void 0 ? _delete : {};
550
- obj.props.delete.openType = 'window';
551
- var _edit;
552
- obj.props.edit = (_edit = item.edit) !== null && _edit !== void 0 ? _edit : {};
553
- obj.props.edit.openType = 'window';
543
+ } else if (item.table_header_type === "operation") {
544
+ obj.type = "operation-column";
545
+ var _item_check;
546
+ obj.props.check = (_item_check = item.check) !== null && _item_check !== void 0 ? _item_check : {};
547
+ obj.props.check.openType = "window";
548
+ var _item_delete;
549
+ obj.props.delete = (_item_delete = item.delete) !== null && _item_delete !== void 0 ? _item_delete : {};
550
+ obj.props.delete.openType = "window";
551
+ var _item_edit;
552
+ obj.props.edit = (_item_edit = item.edit) !== null && _item_edit !== void 0 ? _item_edit : {};
553
+ obj.props.edit.openType = "window";
554
554
  obj.props.fixed = true;
555
555
  } else {
556
- obj.type = item.field_type + '-column';
557
- if (item.field_type === 'auto_number') {
558
- obj.type = 'auto-number-column';
556
+ obj.type = item.field_type + "-column";
557
+ if (item.field_type === "auto_number") {
558
+ obj.type = "auto-number-column";
559
559
  }
560
- if (item.field_type === 'relation') {
561
- obj.type = 'varchar-column';
560
+ if (item.field_type === "relation") {
561
+ obj.type = "varchar-column";
562
562
  }
563
563
  }
564
564
  if (item.convert_switch) {
565
- obj.props.optionConfig = item.convert_type === 1 ? 'datasource' : 'custom';
565
+ obj.props.optionConfig = item.convert_type === 1 ? "datasource" : "custom";
566
566
  }
567
- if (obj.props.optionConfig === 'datasource') {
567
+ if (obj.props.optionConfig === "datasource") {
568
568
  obj.props.datasource_bind = new DataSourceBind({
569
569
  svcCode: item.svc_code,
570
570
  displayBoList: item.display_bo_list,
571
571
  valueFieldCode: item.field_match,
572
572
  dataCode: item.field_source
573
573
  });
574
- } else if (obj.props.optionConfig === 'custom') {
574
+ } else if (obj.props.optionConfig === "custom") {
575
575
  obj.props.options = item.custom_match_bo_list;
576
576
  }
577
577
  return obj;
@@ -581,12 +581,12 @@ function conversionGridTable(tableControl, toolbox) {
581
581
  function groupPanelHandler(controlArray) {
582
582
  var group = null;
583
583
  for(var i = 0; i < controlArray.length; i++){
584
- var ref;
584
+ var _item_children_;
585
585
  var item = controlArray[i];
586
586
  if (!item) {
587
587
  continue;
588
588
  }
589
- if (item.children && ((ref = item.children[0]) === null || ref === void 0 ? void 0 : ref.type) === 'group-panel') {
589
+ if (item.children && ((_item_children_ = item.children[0]) === null || _item_children_ === void 0 ? void 0 : _item_children_.type) === "group-panel") {
590
590
  group = item.children[0];
591
591
  continue;
592
592
  }
@@ -612,7 +612,7 @@ function conversionPageEvents(events) {
612
612
  });
613
613
  }
614
614
  function conversionControlEvents(control, controlEvents) {
615
- var ref;
615
+ var _controlEvents_control_id;
616
616
  if (!controlEvents || !control.props.events) {
617
617
  return;
618
618
  }
@@ -621,7 +621,7 @@ function conversionControlEvents(control, controlEvents) {
621
621
  return;
622
622
  }
623
623
  eventKeys.forEach(function(eventKey) {
624
- var _eventKey;
624
+ var _controlEvents_control_id_eventKey;
625
625
  if (!control.props.events[eventKey].length) {
626
626
  return;
627
627
  }
@@ -631,17 +631,17 @@ function conversionControlEvents(control, controlEvents) {
631
631
  if (!controlEvents[control.id][eventKey]) {
632
632
  controlEvents[control.id][eventKey] = [];
633
633
  }
634
- (_eventKey = controlEvents[control.id][eventKey]).push.apply(_eventKey, _toConsumableArray(control.props.events[eventKey].map(function(item) {
634
+ (_controlEvents_control_id_eventKey = controlEvents[control.id][eventKey]).push.apply(_controlEvents_control_id_eventKey, _toConsumableArray(control.props.events[eventKey].map(function(item) {
635
635
  return item.name;
636
636
  })));
637
637
  });
638
638
  // 将失焦事件转换为change事件
639
- if ((ref = controlEvents[control.id]) === null || ref === void 0 ? void 0 : ref.on_blur) {
640
- var _on_change;
639
+ if ((_controlEvents_control_id = controlEvents[control.id]) === null || _controlEvents_control_id === void 0 ? void 0 : _controlEvents_control_id.on_blur) {
640
+ var _controlEvents_control_id_on_change;
641
641
  if (!controlEvents[control.id].on_change) {
642
642
  controlEvents[control.id].on_change = [];
643
643
  }
644
- (_on_change = controlEvents[control.id].on_change).push.apply(_on_change, _toConsumableArray(controlEvents[control.id].on_blur));
644
+ (_controlEvents_control_id_on_change = controlEvents[control.id].on_change).push.apply(_controlEvents_control_id_on_change, _toConsumableArray(controlEvents[control.id].on_blur));
645
645
  }
646
646
  }
647
647
  export { dataCleaner };