@byteluck-fe/model-driven-upgrade 2.21.0-beta.7 → 2.21.0-beta.8

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.
@@ -9,6 +9,7 @@ var dataCleaner = function(schemaItems, payload) {
9
9
  });
10
10
  // 将footers的数据转入headers中
11
11
  conversionFootersToHeaders(new_schema);
12
+ conversionRowStyle(new_schema);
12
13
  return isArray ? new_schema : new_schema[0];
13
14
  };
14
15
  function conversion(schema, payload) {
@@ -24,6 +25,46 @@ function conversion(schema, payload) {
24
25
  }
25
26
  return schema;
26
27
  }
28
+ // 行背景色格式转换成单元格背景色格式
29
+ function conversionRowStyle(schema) {
30
+ // console.log('------')
31
+ // console.log('schema=',schema[0])
32
+ if (schema[0].type === CONTROL_TYPE.LIST_VIEW) {
33
+ var props = schema[0].props;
34
+ var _props_row_style_type, _props_row_style_bg_color;
35
+ var rowStyle = {
36
+ "type": (_props_row_style_type = props.row_style_type) !== null && _props_row_style_type !== void 0 ? _props_row_style_type : "none",
37
+ "interval": {
38
+ "color": (_props_row_style_bg_color = props.row_style_bg_color) !== null && _props_row_style_bg_color !== void 0 ? _props_row_style_bg_color : ''
39
+ },
40
+ "rules": [],
41
+ "rules_script": []
42
+ };
43
+ if (props.row_style_rules) {
44
+ props.row_style_rules.forEach(function(item) {
45
+ var setting = {
46
+ "color": item.color,
47
+ "type": "background",
48
+ "scope": "row",
49
+ "fieldCodes": []
50
+ };
51
+ item.settings = [
52
+ setting
53
+ ];
54
+ delete item.color;
55
+ });
56
+ rowStyle.rules = props.row_style_rules;
57
+ }
58
+ if (props.row_style_rules_script) {
59
+ rowStyle.rules_script = props.row_style_rules_script;
60
+ }
61
+ props.row_style = rowStyle;
62
+ delete props.row_style_type;
63
+ delete props.row_style_bg_color;
64
+ delete props.row_style_rules;
65
+ delete props.row_style_rules_script;
66
+ }
67
+ }
27
68
  function conversionFootersToHeaders(schema) {
28
69
  if (schema[0].type === CONTROL_TYPE.LIST_VIEW) {
29
70
  var tableSchema = schema[0].children.find(function(item) {