@byteluck-fe/model-driven-upgrade 2.21.0-beta.0 → 2.21.0-beta.10

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.
@@ -1,4 +1,4 @@
1
- import { decamelizeKeys, loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
1
+ import { decamelizeKeys, loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
2
2
  var dataCleaner = function(schemaItems, payload) {
3
3
  var isArray = Array.isArray(schemaItems);
4
4
  var schemaArray = isArray ? schemaItems : [
@@ -22,23 +22,23 @@ function conversion(schema, payload) {
22
22
  CONTROL_TYPE.FORM_SELECT_BUTTON,
23
23
  CONTROL_TYPE.LIST_SELECT_BUTTON
24
24
  ].includes(schema.type)) {
25
- if (schema.props.button_type === "default") {
26
- schema.props.button_type = "secondary";
25
+ if (schema.props.button_type === 'default') {
26
+ schema.props.button_type = 'secondary';
27
27
  }
28
- if (schema.props.button_type === "danger") {
29
- schema.props.button_type = "secondary";
30
- schema.props.color = "danger";
28
+ if (schema.props.button_type === 'danger') {
29
+ schema.props.button_type = 'secondary';
30
+ schema.props.color = 'danger';
31
31
  }
32
32
  // 没有icon的按钮,给添加一个默认icon @余石伟
33
33
  if (!schema.props.icon) {
34
- schema.props.icon = "iconfenlei2";
34
+ schema.props.icon = 'iconfenlei2';
35
35
  }
36
36
  }
37
37
  if (schema.type === CONTROL_TYPE.IMPORT_RECORD_LIST_BUTTON) {
38
- schema.props.icon = "iconshangchuan3";
38
+ schema.props.icon = 'iconshangchuan3';
39
39
  }
40
40
  if (schema.type === CONTROL_TYPE.EXPORT_LIST_BUTTON) {
41
- schema.props.icon = "iconxiazai1";
41
+ schema.props.icon = 'iconxiazai1';
42
42
  }
43
43
  return schema;
44
44
  }
@@ -1,4 +1,4 @@
1
- import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
1
+ import { loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
2
2
  var dataCleaner = function(schemaItems, payload) {
3
3
  var isArray = Array.isArray(schemaItems);
4
4
  var schemaArray = isArray ? schemaItems : [
@@ -1,4 +1,4 @@
1
- import { decamelizeKeys, loop } from "@byteluck-fe/model-driven-shared";
1
+ import { decamelizeKeys, loop } from '@byteluck-fe/model-driven-shared';
2
2
  var dataCleaner = function(schemaItems, payload) {
3
3
  var isArray = Array.isArray(schemaItems);
4
4
  var schemaArray = isArray ? schemaItems : [
@@ -14,23 +14,23 @@ function conversion(schema, payload) {
14
14
  if (schema.props.icon) {
15
15
  var icon = schema.props.icon;
16
16
  switch(icon){
17
- case "icongeren":
18
- icon = "iconyyzy-renyuan";
17
+ case 'icongeren':
18
+ icon = 'iconyyzy-renyuan';
19
19
  break;
20
- case "iconjine1":
21
- icon = "iconcaiwu";
20
+ case 'iconjine1':
21
+ icon = 'iconcaiwu';
22
22
  break;
23
- case "iconhuibao":
24
- icon = "iconyyzy-tianxie";
23
+ case 'iconhuibao':
24
+ icon = 'iconyyzy-tianxie';
25
25
  break;
26
- case "iconwenjian":
27
- icon = "iconyyzy-wenjianjia1";
26
+ case 'iconwenjian':
27
+ icon = 'iconyyzy-wenjianjia1';
28
28
  break;
29
- case "iconyingpin":
30
- icon = "iconyyzy-gongzuo";
29
+ case 'iconyingpin':
30
+ icon = 'iconyyzy-gongzuo';
31
31
  break;
32
- case "iconpiliangtijiaojilu":
33
- icon = "iconyyzy-renwu";
32
+ case 'iconpiliangtijiaojilu':
33
+ icon = 'iconyyzy-renwu';
34
34
  break;
35
35
  }
36
36
  schema.props.icon = icon;
@@ -1,5 +1,5 @@
1
- import { decamelizeKeys, loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
2
- import { GridRow, Col } from "@byteluck-fe/model-driven-controls";
1
+ import { decamelizeKeys, loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
2
+ import { GridRow, Col } from '@byteluck-fe/model-driven-controls';
3
3
  var dataCleaner = function(schemaItems, payload) {
4
4
  var isArray = Array.isArray(schemaItems);
5
5
  var schemaArray = isArray ? schemaItems : [
@@ -1,4 +1,4 @@
1
- import { decamelizeKeys, loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
1
+ import { decamelizeKeys, loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
2
2
  var dataCleaner = function(schemaItems, payload) {
3
3
  var isArray = Array.isArray(schemaItems);
4
4
  var schemaArray = isArray ? schemaItems : [
@@ -1,4 +1,4 @@
1
- import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
1
+ import { loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
2
2
  var dataCleaner = function(schemaItems, payload) {
3
3
  var isArray = Array.isArray(schemaItems);
4
4
  var schemaArray = isArray ? schemaItems : [
@@ -11,7 +11,7 @@ function _define_property(obj, key, value) {
11
11
  }
12
12
  return obj;
13
13
  }
14
- import { loop, CONTROL_TYPE, FieldTypes } from "@byteluck-fe/model-driven-shared";
14
+ import { loop, CONTROL_TYPE, FieldTypes } from '@byteluck-fe/model-driven-shared';
15
15
  var dataCleaner = function(schemaItems, payload) {
16
16
  var isArray = Array.isArray(schemaItems);
17
17
  var schemaArray = isArray ? schemaItems : [
@@ -1,4 +1,4 @@
1
- import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
1
+ import { loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
2
2
  var dataCleaner = function(schemaItems, payload) {
3
3
  var isArray = Array.isArray(schemaItems);
4
4
  var schemaArray = isArray ? schemaItems : [
@@ -12,14 +12,14 @@ var dataCleaner = function(schemaItems, payload) {
12
12
  function conversion(schema, payload) {
13
13
  if (schema.type === CONTROL_TYPE.GRID_TABLE) {
14
14
  schema.props.headers.forEach(function(column) {
15
- if (column.type.endsWith("-column")) {
15
+ if (column.type.endsWith('-column')) {
16
16
  if (column.props.fixed) {
17
- column.props.fixed = "left";
17
+ column.props.fixed = 'left';
18
18
  if (column.type === CONTROL_TYPE.OPERATION_COLUMN) {
19
- column.props.fixed = "right";
19
+ column.props.fixed = 'right';
20
20
  }
21
21
  } else {
22
- column.props.fixed = "none";
22
+ column.props.fixed = 'none';
23
23
  }
24
24
  }
25
25
  });
@@ -1,4 +1,4 @@
1
- import { loop, CONTROL_TYPE, FieldTypes } from "@byteluck-fe/model-driven-shared";
1
+ import { loop, CONTROL_TYPE, FieldTypes } from '@byteluck-fe/model-driven-shared';
2
2
  var dataCleaner = function(schemaItems, payload) {
3
3
  var isArray = Array.isArray(schemaItems);
4
4
  var schemaArray = isArray ? schemaItems : [
@@ -21,7 +21,7 @@ function conversion(schema, payload) {
21
21
  FieldTypes.AUTO_NUMBER
22
22
  ].includes((_item_props = item.props) === null || _item_props === void 0 ? void 0 : (_item_props_data_bind = _item_props.data_bind) === null || _item_props_data_bind === void 0 ? void 0 : _item_props_data_bind.field_type)) {
23
23
  schema.props.query_type_map.push({
24
- query_type: "LIKE",
24
+ query_type: 'LIKE',
25
25
  field_code: item.props.data_bind.field_code
26
26
  });
27
27
  }
@@ -5,7 +5,7 @@
5
5
  * @LastEditTime: 2023-03-03 13:42:29
6
6
  * @FilePath: /model-driven/packages/upgrade/src/upgrade/v2_9.ts
7
7
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
- */ import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
8
+ */ import { loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
9
9
  var dataCleaner = function(schemaItems, payload) {
10
10
  var isArray = Array.isArray(schemaItems);
11
11
  var schemaArray = isArray ? schemaItems : [
@@ -5,9 +5,9 @@
5
5
  * @LastEditTime: 2023-03-03 13:42:45
6
6
  * @FilePath: /model-driven/packages/upgrade/src/upgrade/v2_10.ts
7
7
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
- */ import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
9
- import { OperationButton } from "@byteluck-fe/model-driven-controls";
10
- import { TitleConfigEnum } from "@byteluck-fe/model-driven-controls";
8
+ */ import { loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
9
+ import { OperationButton } from '@byteluck-fe/model-driven-controls';
10
+ import { TitleConfigEnum } from '@byteluck-fe/model-driven-controls';
11
11
  var dataCleaner = function(schemaItems, payload) {
12
12
  var isArray = Array.isArray(schemaItems);
13
13
  var schemaArray = isArray ? schemaItems : [
@@ -27,32 +27,32 @@ function conversion(schema, payload) {
27
27
  schema.props.headers.map(function(item) {
28
28
  if (item.type === CONTROL_TYPE.OPERATION_COLUMN) {
29
29
  var _item_props, _item_props1, _item_props2;
30
- if (item.props.width_type === "auto") {
30
+ if (item.props.width_type === 'auto') {
31
31
  item.props.auto_width = {
32
32
  min_width: 120,
33
33
  max_width: 120,
34
34
  flex: 1
35
35
  };
36
- } else if (item.props.width_type === "px") {
36
+ } else if (item.props.width_type === 'px') {
37
37
  item.props.auto_width = {
38
38
  min_width: item.props.width,
39
39
  max_width: item.props.width,
40
40
  flex: 1
41
41
  };
42
42
  }
43
- item.props.width_type = "auto";
43
+ item.props.width_type = 'auto';
44
44
  var _item_children;
45
45
  item.children = (_item_children = item === null || item === void 0 ? void 0 : item.children) !== null && _item_children !== void 0 ? _item_children : [];
46
46
  delete item.props.custom;
47
47
  if (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.check) !== undefined) {
48
48
  var _item_props3, _item_props4, _item_props5, _item_props6, _item_props7, _item_props8;
49
49
  var optbtn = new OperationButton.Designer();
50
- Object.defineProperty(optbtn, "id", {
51
- value: "listPageCheckBtnId"
50
+ Object.defineProperty(optbtn, 'id', {
51
+ value: 'listPageCheckBtnId'
52
52
  });
53
- optbtn.props.code = "view";
54
- optbtn.props.icon = "iconliulan1";
55
- optbtn.props.command = "view";
53
+ optbtn.props.code = 'view';
54
+ optbtn.props.icon = 'iconliulan1';
55
+ optbtn.props.command = 'view';
56
56
  optbtn.props.content = (_item_props3 = item.props) === null || _item_props3 === void 0 ? void 0 : _item_props3.check.content;
57
57
  optbtn.props.priorityProcess = (_item_props4 = item.props) === null || _item_props4 === void 0 ? void 0 : _item_props4.check.priority_process;
58
58
  optbtn.props.openType = (_item_props5 = item.props) === null || _item_props5 === void 0 ? void 0 : _item_props5.check.open_type;
@@ -65,12 +65,12 @@ function conversion(schema, payload) {
65
65
  if (((_item_props1 = item.props) === null || _item_props1 === void 0 ? void 0 : _item_props1.edit) !== undefined) {
66
66
  var _item_props9, _item_props10, _item_props11, _item_props12, _item_props13, _item_props14;
67
67
  var optbtn1 = new OperationButton.Designer();
68
- Object.defineProperty(optbtn1, "id", {
69
- value: "listPageEditBtnId"
68
+ Object.defineProperty(optbtn1, 'id', {
69
+ value: 'listPageEditBtnId'
70
70
  });
71
- optbtn1.props.code = "edit";
72
- optbtn1.props.icon = "iconbianji1";
73
- optbtn1.props.command = "edit";
71
+ optbtn1.props.code = 'edit';
72
+ optbtn1.props.icon = 'iconbianji1';
73
+ optbtn1.props.command = 'edit';
74
74
  optbtn1.props.content = (_item_props9 = item.props) === null || _item_props9 === void 0 ? void 0 : _item_props9.edit.content;
75
75
  optbtn1.props.priorityProcess = (_item_props10 = item.props) === null || _item_props10 === void 0 ? void 0 : _item_props10.edit.priority_process;
76
76
  optbtn1.props.openType = (_item_props11 = item.props) === null || _item_props11 === void 0 ? void 0 : _item_props11.edit.open_type;
@@ -83,18 +83,18 @@ function conversion(schema, payload) {
83
83
  if (((_item_props2 = item.props) === null || _item_props2 === void 0 ? void 0 : _item_props2.delete) !== undefined) {
84
84
  var _item_props15, _item_props16, _item_props17, _item_props18, _item_props19, _item_props20;
85
85
  var optbtn2 = new OperationButton.Designer();
86
- Object.defineProperty(optbtn2, "id", {
87
- value: "listPageDeleteBtnId"
86
+ Object.defineProperty(optbtn2, 'id', {
87
+ value: 'listPageDeleteBtnId'
88
88
  });
89
- optbtn2.props.code = "delete";
90
- optbtn2.props.icon = "iconlajitong";
91
- optbtn2.props.command = "delete";
89
+ optbtn2.props.code = 'delete';
90
+ optbtn2.props.icon = 'iconlajitong';
91
+ optbtn2.props.command = 'delete';
92
92
  optbtn2.props.content = (_item_props15 = item.props) === null || _item_props15 === void 0 ? void 0 : _item_props15.delete.content;
93
93
  optbtn2.props.priorityProcess = (_item_props16 = item.props) === null || _item_props16 === void 0 ? void 0 : _item_props16.delete.priority_process;
94
94
  optbtn2.props.openType = (_item_props17 = item.props) === null || _item_props17 === void 0 ? void 0 : _item_props17.delete.open_type;
95
95
  optbtn2.props.formKey = (_item_props18 = item.props) === null || _item_props18 === void 0 ? void 0 : _item_props18.delete.form_key;
96
96
  optbtn2.props.needConfirm = true;
97
- optbtn2.props.confirmMessage = "确定要删除此条数据吗?";
97
+ optbtn2.props.confirmMessage = '确定要删除此条数据吗?';
98
98
  if ((_item_props19 = item.props) === null || _item_props19 === void 0 ? void 0 : _item_props19.delete.is_show) {
99
99
  item.children.push(optbtn2.toSchema());
100
100
  }
@@ -3,7 +3,7 @@
3
3
  * @Autor: SuperLucky-Q
4
4
  * @Date: 2023-02-16 14:45:22
5
5
  * @LastEditors: SuperLuckyqi
6
- * @LastEditTime: 2024-01-05 15:23:17
6
+ * @LastEditTime: 2024-01-11 08:12:17
7
7
  */ function _define_property(obj, key, value) {
8
8
  if (key in obj) {
9
9
  Object.defineProperty(obj, key, {
@@ -17,8 +17,8 @@
17
17
  }
18
18
  return obj;
19
19
  }
20
- import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
21
- import { MetaAutoWidth } from "@byteluck-fe/model-driven-core";
20
+ import { loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
21
+ import { MetaAutoWidth, AutoWidth } from '@byteluck-fe/model-driven-core';
22
22
  var dataCleaner = function(schemaItems, payload) {
23
23
  var isArray = Array.isArray(schemaItems);
24
24
  var schemaArray = isArray ? schemaItems : [
@@ -35,9 +35,9 @@ function conversion(schema, payload) {
35
35
  schema.props.headers.map(function(item) {
36
36
  var _item_children;
37
37
  item.props.meta_auto_width = new MetaAutoWidth();
38
- if (item.props.width_type === "px") {
38
+ if (item.props.width_type === 'px') {
39
39
  item.props.meta_auto_width.pc.width = item.props.width;
40
- item.props.meta_auto_width.pc.width_type = "px";
40
+ item.props.meta_auto_width.pc.width_type = 'px';
41
41
  }
42
42
  delete item.props.width;
43
43
  delete item.props.width_type;
@@ -68,15 +68,15 @@ function conversion(schema, payload) {
68
68
  //默认值 赋值
69
69
  var addKeysDefaultValueMapping = (_obj = {}, _define_property(_obj, CONTROL_TYPE.SUBTABLE, [
70
70
  {
71
- key: "page_index",
71
+ key: 'page_index',
72
72
  value: 1
73
73
  },
74
74
  {
75
- key: "page_size",
75
+ key: 'page_size',
76
76
  value: 10
77
77
  },
78
78
  {
79
- key: "page_size_options",
79
+ key: 'page_size_options',
80
80
  value: [
81
81
  10,
82
82
  20,
@@ -85,20 +85,20 @@ function conversion(schema, payload) {
85
85
  ]
86
86
  },
87
87
  {
88
- key: "total_count",
88
+ key: 'total_count',
89
89
  value: 0
90
90
  }
91
91
  ]), _define_property(_obj, CONTROL_TYPE.GRID_TABLE, [
92
92
  {
93
- key: "page_index",
93
+ key: 'page_index',
94
94
  value: 1
95
95
  },
96
96
  {
97
- key: "page_size",
97
+ key: 'page_size',
98
98
  value: 20
99
99
  },
100
100
  {
101
- key: "page_size_options",
101
+ key: 'page_size_options',
102
102
  value: [
103
103
  10,
104
104
  20,
@@ -107,39 +107,39 @@ function conversion(schema, payload) {
107
107
  ]
108
108
  },
109
109
  {
110
- key: "total_count",
110
+ key: 'total_count',
111
111
  value: 0
112
112
  },
113
113
  {
114
- key: "is_show_selection",
114
+ key: 'is_show_selection',
115
115
  value: false
116
116
  }
117
117
  ]), _define_property(_obj, CONTROL_TYPE.LIST_VIEW, [
118
118
  {
119
- key: "selection_type",
120
- value: "multiple"
119
+ key: 'selection_type',
120
+ value: 'multiple'
121
121
  },
122
122
  {
123
- key: "row_style_type",
124
- value: "none"
123
+ key: 'row_style_type',
124
+ value: 'none'
125
125
  },
126
126
  {
127
- key: "is_show_selection",
127
+ key: 'is_show_selection',
128
128
  value: false
129
129
  }
130
130
  ]), _define_property(_obj, CONTROL_TYPE.SIMPLE_SEARCH, [
131
131
  {
132
- key: "col-gap",
132
+ key: 'col-gap',
133
133
  value: 24
134
134
  },
135
135
  {
136
- key: "child-min-width",
136
+ key: 'child-min-width',
137
137
  value: 230
138
138
  }
139
139
  ]), _define_property(_obj, CONTROL_TYPE.IMPORT_RECORD_LIST_BUTTON, [
140
140
  {
141
- key: "template-type",
142
- value: "system"
141
+ key: 'template-type',
142
+ value: 'system'
143
143
  }
144
144
  ]), _obj);
145
145
  if (schema.type in addKeysDefaultValueMapping) {
@@ -157,12 +157,15 @@ function conversion(schema, payload) {
157
157
  item.props.limit = 3;
158
158
  }
159
159
  if (item.props.show_type === undefined) {
160
- item.props.show_type = "icon";
160
+ item.props.show_type = 'icon';
161
161
  }
162
162
  }
163
163
  if (item.props.flex === undefined) {
164
164
  item.props.flex = 1;
165
165
  }
166
+ if (item.props.auto_width === undefined) {
167
+ item.props.auto_width = new AutoWidth();
168
+ }
166
169
  });
167
170
  }
168
171
  //2023-12-24 qiyu 保证低版本升级上来时,默认是开启的
@@ -186,11 +189,11 @@ function conversionListener(payload) {
186
189
  payload.listeners[controlId].forEach(function(event, index) {
187
190
  var eventKey = event.event_key || event.eventKey;
188
191
  switch(eventKey){
189
- case "on_click_finish":
192
+ case 'on_click_finish':
190
193
  onClickFinish = event;
191
194
  onClickFinishIndex = index;
192
195
  break;
193
- case "on_click":
196
+ case 'on_click':
194
197
  onClick = event;
195
198
  break;
196
199
  }
@@ -204,14 +207,14 @@ function conversionListener(payload) {
204
207
  // @ts-ignore
205
208
  payload.listeners[controlId].splice(onClickFinishIndex, 1);
206
209
  } else {
207
- onClickFinish.event_key = "on_click";
210
+ onClickFinish.event_key = 'on_click';
208
211
  }
209
212
  }
210
213
  });
211
214
  if (!payload.listeners.form_submit) {
212
215
  payload.listeners.form_submit = [
213
216
  {
214
- event_key: "on_click",
217
+ event_key: 'on_click',
215
218
  event_param: [],
216
219
  cases: [
217
220
  getDefaultActionOperateCase()
@@ -222,7 +225,7 @@ function conversionListener(payload) {
222
225
  if (payload.listeners.form_submit && payload.listeners.form_submit[0] && payload.listeners.form_submit[0].cases && payload.listeners.form_submit[0].cases[0] && payload.listeners.form_submit[0].cases[0].handlers) {
223
226
  var hasActionOperateHandler = false;
224
227
  payload.listeners.form_submit[0].cases[0].handlers.forEach(function(handler) {
225
- if (handler.method === "actionOperate") {
228
+ if (handler.method === 'actionOperate') {
226
229
  hasActionOperateHandler = true;
227
230
  }
228
231
  });
@@ -234,9 +237,9 @@ function conversionListener(payload) {
234
237
  }
235
238
  function getDefaultActionOperateCase() {
236
239
  return {
237
- id: "case" + new Date().getTime(),
238
- name: "默认情形",
239
- match_type: "AND",
240
+ id: 'case' + new Date().getTime(),
241
+ name: '默认情形',
242
+ match_type: 'AND',
240
243
  match_rules: [],
241
244
  handlers: [
242
245
  getDefaultActionOperateHandler()
@@ -245,12 +248,12 @@ function getDefaultActionOperateCase() {
245
248
  }
246
249
  function getDefaultActionOperateHandler() {
247
250
  return {
248
- id: "handler" + new Date().getTime(),
249
- method: "actionOperate",
251
+ id: 'handler' + new Date().getTime(),
252
+ method: 'actionOperate',
250
253
  params: {
251
- control_id: "",
252
- opt_type: "",
253
- opt_code: "",
254
+ control_id: '',
255
+ opt_type: '',
256
+ opt_code: '',
254
257
  is_error_continue: false
255
258
  }
256
259
  };
@@ -3,8 +3,9 @@
3
3
  * @Autor: SuperLucky-Q
4
4
  * @Date: 2023-02-16 14:45:22
5
5
  * @LastEditors: SuperLuckyqi
6
- * @LastEditTime: 2023-12-21 11:12:25
7
- */ import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
6
+ * @LastEditTime: 2024-04-01 11:23:43
7
+ */ import { loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
8
+ import { RegularRules } from '@byteluck-fe/model-driven-core';
8
9
  var dataCleaner = function(schemaItems, payload) {
9
10
  var isArray = Array.isArray(schemaItems);
10
11
  var schemaArray = isArray ? schemaItems : [
@@ -39,20 +40,38 @@ function conversion(schema, payload) {
39
40
  }
40
41
  });
41
42
  }
42
- if (schema.props.caption === "") {
43
+ if (schema.props.caption === '') {
43
44
  schema.props.caption = payload === null || payload === void 0 ? void 0 : payload.formName;
44
45
  }
46
+ if (schema.props.is_all_loaded === undefined) {
47
+ schema.props.is_all_loaded = true;
48
+ }
45
49
  }
46
50
  if (schema.type === CONTROL_TYPE.TEXTAREA) {
47
51
  if (schema.props.auto_size === undefined) {
48
52
  schema.props.auto_size = false;
49
53
  }
50
54
  }
55
+ if (schema.type === CONTROL_TYPE.SUBTABLE) {
56
+ if (schema.props.mobile_default_num === undefined) {
57
+ schema.props.mobile_default_num = schema.props.mobile_show_type === 'tile' ? 5 : 10;
58
+ }
59
+ }
51
60
  if (schema.type === CONTROL_TYPE.TREE) {
52
61
  if (schema.props.default_display === undefined) {
53
62
  schema.props.default_display = false;
54
63
  }
55
64
  }
65
+ if (schema.type === CONTROL_TYPE.GRID_TABLE) {
66
+ if (schema.props.is_show_toolbar === undefined) {
67
+ schema.props.is_show_toolbar = true;
68
+ }
69
+ }
70
+ if (schema.type === CONTROL_TYPE.NUMBER) {
71
+ if (schema.props.regular_rules === undefined) {
72
+ schema.props.regular_rules = new RegularRules();
73
+ }
74
+ }
56
75
  return schema;
57
76
  }
58
77
  export { dataCleaner };
@@ -3,7 +3,7 @@
3
3
  * @Autor: SuperLucky-Q
4
4
  * @Date: 2023-02-16 14:45:22
5
5
  * @LastEditors: SuperLuckyqi
6
- * @LastEditTime: 2024-01-09 18:06:49
6
+ * @LastEditTime: 2024-05-11 14:40:51
7
7
  */ function _define_property(obj, key, value) {
8
8
  if (key in obj) {
9
9
  Object.defineProperty(obj, key, {
@@ -17,7 +17,7 @@
17
17
  }
18
18
  return obj;
19
19
  }
20
- import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
20
+ import { loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
21
21
  var dataCleaner = function(schemaItems, payload) {
22
22
  var isArray = Array.isArray(schemaItems);
23
23
  var schemaArray = isArray ? schemaItems : [
@@ -32,16 +32,16 @@ function conversion(schema, payload) {
32
32
  //默认值 赋值
33
33
  var addKeysDefaultValueMapping = _define_property({}, CONTROL_TYPE.SUBTABLE, [
34
34
  {
35
- key: "import_config",
35
+ key: 'import_config',
36
36
  value: {
37
- template_type: "system",
37
+ template_type: 'system',
38
38
  template_list: []
39
39
  }
40
40
  },
41
41
  {
42
- key: "export_config",
42
+ key: 'export_config',
43
43
  value: {
44
- template_type: "system",
44
+ template_type: 'system',
45
45
  template_list: []
46
46
  }
47
47
  }
@@ -53,11 +53,31 @@ function conversion(schema, payload) {
53
53
  }
54
54
  });
55
55
  }
56
- if (schema.type === "card-group") {
56
+ if (schema.type === 'card-group') {
57
57
  if (schema.props.isHideCaption === undefined) {
58
58
  schema.props.isHideCaption = false;
59
59
  }
60
60
  }
61
+ var listBtnArrs = [
62
+ CONTROL_TYPE.LIST_PAGE_BTN_BATCH_PRINT_RECORD,
63
+ CONTROL_TYPE.EXPORT_LIST_BUTTON,
64
+ CONTROL_TYPE.EXPORT_RECORD_LIST_BUTTON,
65
+ CONTROL_TYPE.CREATE_FORM_LIST_BUTTON,
66
+ CONTROL_TYPE.IMPORT_RECORD_LIST_BUTTON,
67
+ CONTROL_TYPE.SUBMISSION_RECORD_LIST_BUTTON,
68
+ CONTROL_TYPE.BATCH_DELETE_LIST_BUTTON,
69
+ CONTROL_TYPE.BUTTON,
70
+ CONTROL_TYPE.SUBMISSION_RECORD_LIST_BUTTON,
71
+ CONTROL_TYPE.LIST_PAGE_BTN_BATCH_PRINT
72
+ ];
73
+ if (listBtnArrs.includes(schema.type)) {
74
+ schema.control_type = 'base';
75
+ }
76
+ if (schema.type === CONTROL_TYPE.SUBTABLE) {
77
+ if (schema.props.mobile_default_num === undefined) {
78
+ schema.props.mobile_default_num = schema.props.mobile_show_type === 'tile' ? 5 : 10;
79
+ }
80
+ }
61
81
  return schema;
62
82
  }
63
83
  export { dataCleaner };