@byteluck-fe/model-driven-upgrade 2.9.0-alpha.0 → 2.9.0-alpha.11

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.
@@ -3,7 +3,7 @@
3
3
  * @Autor: SuperLucky-Q
4
4
  * @Date: 2023-02-16 14:45:22
5
5
  * @LastEditors: SuperLuckyqi
6
- * @LastEditTime: 2023-11-21 15:21:10
6
+ * @LastEditTime: 2023-12-22 09:29:55
7
7
  */ function _define_property(obj, key, value) {
8
8
  if (key in obj) {
9
9
  Object.defineProperty(obj, key, {
@@ -33,6 +33,7 @@ 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
38
  if (item.props.width_type === "px") {
38
39
  item.props.meta_auto_width.pc.width = item.props.width;
@@ -40,6 +41,15 @@ function conversion(schema, payload) {
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
@@ -99,6 +109,10 @@ function conversion(schema, payload) {
99
109
  {
100
110
  key: "total_count",
101
111
  value: 0
112
+ },
113
+ {
114
+ key: "is_show_selection",
115
+ value: false
102
116
  }
103
117
  ]), _define_property(_obj, CONTROL_TYPE.LIST_VIEW, [
104
118
  {
@@ -108,6 +122,10 @@ function conversion(schema, payload) {
108
122
  {
109
123
  key: "row_style_type",
110
124
  value: "none"
125
+ },
126
+ {
127
+ key: "is_show_selection",
128
+ value: false
111
129
  }
112
130
  ]), _define_property(_obj, CONTROL_TYPE.SIMPLE_SEARCH, [
113
131
  {
@@ -118,6 +136,11 @@ function conversion(schema, payload) {
118
136
  key: "child-min-width",
119
137
  value: 230
120
138
  }
139
+ ]), _define_property(_obj, CONTROL_TYPE.IMPORT_RECORD_LIST_BUTTON, [
140
+ {
141
+ key: "template-type",
142
+ value: "system"
143
+ }
121
144
  ]), _obj);
122
145
  if (schema.type in addKeysDefaultValueMapping) {
123
146
  addKeysDefaultValueMapping[schema.type].forEach(function(item) {
@@ -126,6 +149,25 @@ function conversion(schema, payload) {
126
149
  }
127
150
  });
128
151
  }
152
+ if (schema.type === CONTROL_TYPE.GRID_TABLE) {
153
+ var gridTableInstance = schema;
154
+ schema.props.headers.forEach(function(item) {
155
+ if (item.type === CONTROL_TYPE.OPERATION_COLUMN) {
156
+ if (item.props.limit === undefined) {
157
+ item.props.limit = 3;
158
+ }
159
+ if (item.props.show_type === undefined) {
160
+ item.props.show_type = "icon";
161
+ }
162
+ }
163
+ });
164
+ }
165
+ //2023-12-24 qiyu 保证低版本升级上来时,默认是开启的
166
+ if (schema.type === CONTROL_TYPE.CALC) {
167
+ if (schema.props.calc_on_mounted === undefined) {
168
+ schema.props.calc_on_mounted = true;
169
+ }
170
+ }
129
171
  //将操作项按钮的完成时事件转成点击时事件
130
172
  conversionListener(payload);
131
173
  return schema;
@@ -3,7 +3,7 @@
3
3
  * @Autor: SuperLucky-Q
4
4
  * @Date: 2023-02-16 14:45:22
5
5
  * @LastEditors: SuperLuckyqi
6
- * @LastEditTime: 2023-11-21 15:21:23
6
+ * @LastEditTime: 2023-12-21 11:12:25
7
7
  */ import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
8
8
  var dataCleaner = function(schemaItems, payload) {
9
9
  var isArray = Array.isArray(schemaItems);
@@ -34,6 +34,7 @@ function conversion(schema, payload) {
34
34
  });
35
35
  if (isOpenCheckbox === true) {
36
36
  schema.props.is_show_selection = true;
37
+ item.props.is_show_selection = true;
37
38
  }
38
39
  }
39
40
  });
@@ -47,6 +48,11 @@ function conversion(schema, payload) {
47
48
  schema.props.auto_size = false;
48
49
  }
49
50
  }
51
+ if (schema.type === CONTROL_TYPE.TREE) {
52
+ if (schema.props.default_display === undefined) {
53
+ schema.props.default_display = false;
54
+ }
55
+ }
50
56
  return schema;
51
57
  }
52
58
  export { dataCleaner };