@byteluck-fe/model-driven-upgrade 2.8.1-beta8 → 2.8.2-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.
Files changed (44) hide show
  1. package/README.md +10 -10
  2. package/dist/esm/VersionBuilder.js +12 -12
  3. package/dist/esm/index.js +2 -2
  4. package/dist/esm/upgrade/index.js +35 -31
  5. package/dist/esm/upgrade/v1_0.js +114 -114
  6. package/dist/esm/upgrade/v2_0.js +2 -2
  7. package/dist/esm/upgrade/v2_1.js +9 -9
  8. package/dist/esm/upgrade/v2_10.js +1 -1
  9. package/dist/esm/upgrade/v2_2.js +13 -13
  10. package/dist/esm/upgrade/v2_3.js +2 -2
  11. package/dist/esm/upgrade/v2_4.js +1 -1
  12. package/dist/esm/upgrade/v2_5.js +1 -1
  13. package/dist/esm/upgrade/v2_6.js +1 -1
  14. package/dist/esm/upgrade/v2_7.js +5 -5
  15. package/dist/esm/upgrade/v2_8.js +2 -2
  16. package/dist/esm/upgrade/v2_9.js +8 -8
  17. package/dist/esm/upgrade/v3_0.js +29 -29
  18. package/dist/esm/upgrade/v3_1.js +64 -42
  19. package/dist/esm/upgrade/v3_2.js +22 -8
  20. package/dist/esm/upgrade/v3_3.js +35 -0
  21. package/dist/esm/upgrade/v3_4.js +63 -0
  22. package/dist/index.umd.js +1 -1
  23. package/dist/types/VersionBuilder.d.ts +11 -11
  24. package/dist/types/index.d.ts +2 -2
  25. package/dist/types/types.d.ts +14 -13
  26. package/dist/types/upgrade/index.d.ts +21 -19
  27. package/dist/types/upgrade/v1_0.d.ts +3 -3
  28. package/dist/types/upgrade/v2_0.d.ts +3 -3
  29. package/dist/types/upgrade/v2_1.d.ts +3 -3
  30. package/dist/types/upgrade/v2_10.d.ts +3 -3
  31. package/dist/types/upgrade/v2_2.d.ts +3 -3
  32. package/dist/types/upgrade/v2_3.d.ts +3 -3
  33. package/dist/types/upgrade/v2_4.d.ts +3 -3
  34. package/dist/types/upgrade/v2_5.d.ts +3 -3
  35. package/dist/types/upgrade/v2_6.d.ts +3 -3
  36. package/dist/types/upgrade/v2_7.d.ts +3 -3
  37. package/dist/types/upgrade/v2_8.d.ts +3 -3
  38. package/dist/types/upgrade/v2_9.d.ts +3 -3
  39. package/dist/types/upgrade/v3_0.d.ts +3 -3
  40. package/dist/types/upgrade/v3_1.d.ts +3 -3
  41. package/dist/types/upgrade/v3_2.d.ts +3 -3
  42. package/dist/types/upgrade/v3_3.d.ts +3 -0
  43. package/dist/types/upgrade/v3_4.d.ts +3 -0
  44. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
- import { decamelizeKeys, loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
2
- import { DataBind } from "@byteluck-fe/model-driven-core";
1
+ import { decamelizeKeys, loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
2
+ import { DataBind } from '@byteluck-fe/model-driven-core';
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 : [
@@ -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
  }
@@ -1,11 +1,11 @@
1
- /*
2
- * @Author: qiyu qiyu@byteluck.com
3
- * @Date: 2022-12-22 11:36:04
4
- * @LastEditors: qiyu qiyu@byteluck.com
5
- * @LastEditTime: 2023-03-03 13:42:29
6
- * @FilePath: /model-driven/packages/upgrade/src/upgrade/v2_9.ts
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";
1
+ /*
2
+ * @Author: qiyu qiyu@byteluck.com
3
+ * @Date: 2022-12-22 11:36:04
4
+ * @LastEditors: qiyu qiyu@byteluck.com
5
+ * @LastEditTime: 2023-03-03 13:42:29
6
+ * @FilePath: /model-driven/packages/upgrade/src/upgrade/v2_9.ts
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
9
  var dataCleaner = function(schemaItems, payload) {
10
10
  var isArray = Array.isArray(schemaItems);
11
11
  var schemaArray = isArray ? schemaItems : [
@@ -1,13 +1,13 @@
1
- /*
2
- * @Author: qiyu qiyu@byteluck.com
3
- * @Date: 2022-12-22 11:36:04
4
- * @LastEditors: qiyu qiyu@byteluck.com
5
- * @LastEditTime: 2023-03-03 13:42:45
6
- * @FilePath: /model-driven/packages/upgrade/src/upgrade/v2_10.ts
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";
1
+ /*
2
+ * @Author: qiyu qiyu@byteluck.com
3
+ * @Date: 2022-12-22 11:36:04
4
+ * @LastEditors: qiyu qiyu@byteluck.com
5
+ * @LastEditTime: 2023-03-03 13:42:45
6
+ * @FilePath: /model-driven/packages/upgrade/src/upgrade/v2_10.ts
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';
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
  }
@@ -1,9 +1,9 @@
1
- /*
2
- * @Description: subtable-column 数据转换
3
- * @Autor: SuperLucky-Q
4
- * @Date: 2023-02-16 14:45:22
5
- * @LastEditors: SuperLuckyqi
6
- * @LastEditTime: 2023-12-22 09:29:55
1
+ /*
2
+ * @Description: subtable-column 数据转换
3
+ * @Autor: SuperLucky-Q
4
+ * @Date: 2023-02-16 14:45:22
5
+ * @LastEditors: SuperLuckyqi
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 : [
@@ -33,13 +33,23 @@ function conversion(schema, payload) {
33
33
  //标题组件控件兼容老数据 config 默认展示标题
34
34
  if (schema.type === CONTROL_TYPE.SUBTABLE) {
35
35
  schema.props.headers.map(function(item) {
36
+ var _item_children;
36
37
  item.props.meta_auto_width = new MetaAutoWidth();
37
- if (item.props.width_type === "px") {
38
+ if (item.props.width_type === 'px') {
38
39
  item.props.meta_auto_width.pc.width = item.props.width;
39
- item.props.meta_auto_width.pc.width_type = "px";
40
+ item.props.meta_auto_width.pc.width_type = 'px';
40
41
  }
41
42
  delete item.props.width;
42
43
  delete item.props.width_type;
44
+ var childCtl = (_item_children = item.children) === null || _item_children === void 0 ? void 0 : _item_children[0];
45
+ if (childCtl) {
46
+ //2023-12-24 qiyu 保证低版本升级上来时,默认是开启的
47
+ if (childCtl.type === CONTROL_TYPE.CALC) {
48
+ if (childCtl.props.calc_on_mounted === undefined) {
49
+ childCtl.props.calc_on_mounted = true;
50
+ }
51
+ }
52
+ }
43
53
  });
44
54
  // if (schema.props.page_index === undefined) {
45
55
  // schema.props.page_index = 1
@@ -58,15 +68,15 @@ function conversion(schema, payload) {
58
68
  //默认值 赋值
59
69
  var addKeysDefaultValueMapping = (_obj = {}, _define_property(_obj, CONTROL_TYPE.SUBTABLE, [
60
70
  {
61
- key: "page_index",
71
+ key: 'page_index',
62
72
  value: 1
63
73
  },
64
74
  {
65
- key: "page_size",
75
+ key: 'page_size',
66
76
  value: 10
67
77
  },
68
78
  {
69
- key: "page_size_options",
79
+ key: 'page_size_options',
70
80
  value: [
71
81
  10,
72
82
  20,
@@ -75,20 +85,20 @@ function conversion(schema, payload) {
75
85
  ]
76
86
  },
77
87
  {
78
- key: "total_count",
88
+ key: 'total_count',
79
89
  value: 0
80
90
  }
81
91
  ]), _define_property(_obj, CONTROL_TYPE.GRID_TABLE, [
82
92
  {
83
- key: "page_index",
93
+ key: 'page_index',
84
94
  value: 1
85
95
  },
86
96
  {
87
- key: "page_size",
97
+ key: 'page_size',
88
98
  value: 20
89
99
  },
90
100
  {
91
- key: "page_size_options",
101
+ key: 'page_size_options',
92
102
  value: [
93
103
  10,
94
104
  20,
@@ -97,39 +107,39 @@ function conversion(schema, payload) {
97
107
  ]
98
108
  },
99
109
  {
100
- key: "total_count",
110
+ key: 'total_count',
101
111
  value: 0
102
112
  },
103
113
  {
104
- key: "is_show_selection",
114
+ key: 'is_show_selection',
105
115
  value: false
106
116
  }
107
117
  ]), _define_property(_obj, CONTROL_TYPE.LIST_VIEW, [
108
118
  {
109
- key: "selection_type",
110
- value: "multiple"
119
+ key: 'selection_type',
120
+ value: 'multiple'
111
121
  },
112
122
  {
113
- key: "row_style_type",
114
- value: "none"
123
+ key: 'row_style_type',
124
+ value: 'none'
115
125
  },
116
126
  {
117
- key: "is_show_selection",
127
+ key: 'is_show_selection',
118
128
  value: false
119
129
  }
120
130
  ]), _define_property(_obj, CONTROL_TYPE.SIMPLE_SEARCH, [
121
131
  {
122
- key: "col-gap",
132
+ key: 'col-gap',
123
133
  value: 24
124
134
  },
125
135
  {
126
- key: "child-min-width",
136
+ key: 'child-min-width',
127
137
  value: 230
128
138
  }
129
139
  ]), _define_property(_obj, CONTROL_TYPE.IMPORT_RECORD_LIST_BUTTON, [
130
140
  {
131
- key: "template-type",
132
- value: "system"
141
+ key: 'template-type',
142
+ value: 'system'
133
143
  }
134
144
  ]), _obj);
135
145
  if (schema.type in addKeysDefaultValueMapping) {
@@ -147,11 +157,23 @@ function conversion(schema, payload) {
147
157
  item.props.limit = 3;
148
158
  }
149
159
  if (item.props.show_type === undefined) {
150
- item.props.show_type = "icon";
160
+ item.props.show_type = 'icon';
151
161
  }
152
162
  }
163
+ if (item.props.flex === undefined) {
164
+ item.props.flex = 1;
165
+ }
166
+ if (item.props.auto_width === undefined) {
167
+ item.props.auto_width = new AutoWidth();
168
+ }
153
169
  });
154
170
  }
171
+ //2023-12-24 qiyu 保证低版本升级上来时,默认是开启的
172
+ if (schema.type === CONTROL_TYPE.CALC) {
173
+ if (schema.props.calc_on_mounted === undefined) {
174
+ schema.props.calc_on_mounted = true;
175
+ }
176
+ }
155
177
  //将操作项按钮的完成时事件转成点击时事件
156
178
  conversionListener(payload);
157
179
  return schema;
@@ -167,11 +189,11 @@ function conversionListener(payload) {
167
189
  payload.listeners[controlId].forEach(function(event, index) {
168
190
  var eventKey = event.event_key || event.eventKey;
169
191
  switch(eventKey){
170
- case "on_click_finish":
192
+ case 'on_click_finish':
171
193
  onClickFinish = event;
172
194
  onClickFinishIndex = index;
173
195
  break;
174
- case "on_click":
196
+ case 'on_click':
175
197
  onClick = event;
176
198
  break;
177
199
  }
@@ -185,14 +207,14 @@ function conversionListener(payload) {
185
207
  // @ts-ignore
186
208
  payload.listeners[controlId].splice(onClickFinishIndex, 1);
187
209
  } else {
188
- onClickFinish.event_key = "on_click";
210
+ onClickFinish.event_key = 'on_click';
189
211
  }
190
212
  }
191
213
  });
192
214
  if (!payload.listeners.form_submit) {
193
215
  payload.listeners.form_submit = [
194
216
  {
195
- event_key: "on_click",
217
+ event_key: 'on_click',
196
218
  event_param: [],
197
219
  cases: [
198
220
  getDefaultActionOperateCase()
@@ -203,7 +225,7 @@ function conversionListener(payload) {
203
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) {
204
226
  var hasActionOperateHandler = false;
205
227
  payload.listeners.form_submit[0].cases[0].handlers.forEach(function(handler) {
206
- if (handler.method === "actionOperate") {
228
+ if (handler.method === 'actionOperate') {
207
229
  hasActionOperateHandler = true;
208
230
  }
209
231
  });
@@ -215,9 +237,9 @@ function conversionListener(payload) {
215
237
  }
216
238
  function getDefaultActionOperateCase() {
217
239
  return {
218
- id: "case" + new Date().getTime(),
219
- name: "默认情形",
220
- match_type: "AND",
240
+ id: 'case' + new Date().getTime(),
241
+ name: '默认情形',
242
+ match_type: 'AND',
221
243
  match_rules: [],
222
244
  handlers: [
223
245
  getDefaultActionOperateHandler()
@@ -226,12 +248,12 @@ function getDefaultActionOperateCase() {
226
248
  }
227
249
  function getDefaultActionOperateHandler() {
228
250
  return {
229
- id: "handler" + new Date().getTime(),
230
- method: "actionOperate",
251
+ id: 'handler' + new Date().getTime(),
252
+ method: 'actionOperate',
231
253
  params: {
232
- control_id: "",
233
- opt_type: "",
234
- opt_code: "",
254
+ control_id: '',
255
+ opt_type: '',
256
+ opt_code: '',
235
257
  is_error_continue: false
236
258
  }
237
259
  };
@@ -1,10 +1,11 @@
1
- /*
2
- * @Description: subtable-column 数据转换
3
- * @Autor: SuperLucky-Q
4
- * @Date: 2023-02-16 14:45:22
5
- * @LastEditors: SuperLuckyqi
6
- * @LastEditTime: 2023-12-21 11:12:25
7
- */ import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
1
+ /*
2
+ * @Description: subtable-column 数据转换
3
+ * @Autor: SuperLucky-Q
4
+ * @Date: 2023-02-16 14:45:22
5
+ * @LastEditors: SuperLuckyqi
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,15 +40,23 @@ 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;
@@ -58,6 +67,11 @@ function conversion(schema, payload) {
58
67
  schema.props.is_show_toolbar = true;
59
68
  }
60
69
  }
70
+ if (schema.type === CONTROL_TYPE.NUMBER) {
71
+ if (schema.props.regular_rules === undefined) {
72
+ schema.props.regular_rules = new RegularRules();
73
+ }
74
+ }
61
75
  return schema;
62
76
  }
63
77
  export { dataCleaner };
@@ -0,0 +1,35 @@
1
+ import { loop, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
2
+ var dataCleaner = function(schemaItems, payload) {
3
+ var isArray = Array.isArray(schemaItems);
4
+ var schemaArray = isArray ? schemaItems : [
5
+ schemaItems
6
+ ];
7
+ var new_schema = loop(schemaArray, function(item) {
8
+ return conversion(item, payload);
9
+ });
10
+ return isArray ? new_schema : new_schema[0];
11
+ };
12
+ function conversion(schema, payload) {
13
+ var listBtnArrs = [
14
+ CONTROL_TYPE.LIST_PAGE_BTN_BATCH_PRINT_RECORD,
15
+ CONTROL_TYPE.EXPORT_LIST_BUTTON,
16
+ CONTROL_TYPE.EXPORT_RECORD_LIST_BUTTON,
17
+ CONTROL_TYPE.CREATE_FORM_LIST_BUTTON,
18
+ CONTROL_TYPE.IMPORT_RECORD_LIST_BUTTON,
19
+ CONTROL_TYPE.SUBMISSION_RECORD_LIST_BUTTON,
20
+ CONTROL_TYPE.BATCH_DELETE_LIST_BUTTON,
21
+ CONTROL_TYPE.BUTTON,
22
+ CONTROL_TYPE.SUBMISSION_RECORD_LIST_BUTTON,
23
+ CONTROL_TYPE.LIST_PAGE_BTN_BATCH_PRINT
24
+ ];
25
+ if (listBtnArrs.includes(schema.type)) {
26
+ schema.control_type = 'base';
27
+ }
28
+ if (schema.type === CONTROL_TYPE.SUBTABLE) {
29
+ if (schema.props.mobile_default_num === undefined) {
30
+ schema.props.mobile_default_num = schema.props.mobile_show_type === 'tile' ? 5 : 10;
31
+ }
32
+ }
33
+ return schema;
34
+ }
35
+ export { dataCleaner };