@byteluck-fe/model-driven-upgrade 2.7.0-beta.2 → 2.8.0-alpha.1

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.
@@ -11,6 +11,7 @@ import { dataCleaner as dataCleanerV2_8toV2_9 } from "./v2_8";
11
11
  import { dataCleaner as dataCleanerV2_9toV2_10 } from "./v2_9";
12
12
  import { dataCleaner as dataCleanerV2_10toV3_0 } from "./v2_10";
13
13
  import { dataCleaner as dataCleanerV3_0toV3_1 } from "./v3_0";
14
+ import { dataCleaner as dataCleanerV3_1toV3_2 } from "./v3_1";
14
15
  // TODO 切记复制粘贴的时候改一下from后边的路径,不然会出事儿
15
16
  // TODO 注意从2.5版本开始,没有进行驼峰转下划线了,写的时候要注意
16
17
  export default {
@@ -27,6 +28,7 @@ export default {
27
28
  "v2.9": dataCleanerV2_9toV2_10,
28
29
  "v2.10": dataCleanerV2_10toV3_0,
29
30
  "v3.0": dataCleanerV3_0toV3_1,
31
+ "v3.1": dataCleanerV3_1toV3_2,
30
32
  // 每次都需要预留一个下一版本的转换函数,会使用到对应的key作为当前最新的schema version
31
- "v3.1": function() {}
33
+ "v3.2": function() {}
32
34
  };
@@ -28,7 +28,38 @@ function conversion(schema, payload) {
28
28
  delete item.props.width;
29
29
  delete item.props.width_type;
30
30
  });
31
+ if (schema.props.page_index === undefined) {
32
+ schema.props.page_index = 1;
33
+ }
34
+ if (schema.props.page_size === undefined) {
35
+ schema.props.page_size = 10;
36
+ }
37
+ if (schema.props.page_size_options === undefined) {
38
+ schema.props.page_size_options = [
39
+ 10,
40
+ 20,
41
+ 50,
42
+ 100
43
+ ];
44
+ }
31
45
  }
32
- return schema.props.headers;
46
+ if (schema.type === CONTROL_TYPE.GRID_TABLE) {
47
+ if (schema.props.page_index === undefined) {
48
+ schema.props.page_index = 1;
49
+ }
50
+ if (schema.props.page_size === undefined) {
51
+ schema.props.page_size = 20;
52
+ }
53
+ if (schema.props.page_size_options === undefined) {
54
+ schema.props.page_size_options = [
55
+ 10,
56
+ 20,
57
+ 50,
58
+ 100,
59
+ 500
60
+ ];
61
+ }
62
+ }
63
+ return schema;
33
64
  }
34
65
  export { dataCleaner };