表格通用规则

多表头的配置:

  1. // 1、生成的模板中有多表头规则(暂不支持),不需要配置,直接在initTemPlate中调用 multipleMeta 方法即可
  2. meta = props.meta.multipleMeta(meta)
  3. // 2、生成的模板中无多表头规则(目前执行此规则),需要自己写配置规则,在initTemPlate中调用 handleMultiple 方法
  4. let gridMultiple = { // gridMultiple 是个对象 {}
  5. "revecont_b": [ // 区域Id为键,值为数组[] ,代表此区域Id有多组多表头关系
  6. { // 每组多表头关系细则
  7. "name": "合并列1", // name 为多表头的显示名称
  8. "code": "jianzhi1", // code 为多表头的键名字(唯一标识,自己取,不和任何键重复即可)
  9. "children": ["nallotmny", "nfinishnum"], // childen 为数组,值为 visible为true的item的键,最好键与键是按顺序连续排列的
  10. },
  11. {
  12. "name": "合并列2",
  13. "code": "jianzhi2",
  14. "children": ["nfinishmny", "ts"],
  15. },
  16. ],
  17. "revecont_b_child1": [
  18. {
  19. "name": "合并列3",
  20. "code": "jianzhi3",
  21. "children": ["cpobid", "cpobid.vname"],
  22. }
  23. ]
  24. }
  25. meta = props.meta.handleMultiple(meta, gridMultiple)
  26. // 下面为例子示范,拿revecont_b区域为例:
  27. "revecont_b": {
  28. "items": [
  29. {
  30. "itemtype": "input",
  31. "scale": "8",
  32. "maxlength": "28",
  33. "width": "200px",
  34. "visible": true,
  35. "required": true,
  36. "label": "数量",
  37. "attrcode": "npobnum"
  38. },
  39. {
  40. "itemtype": "switch_browse",
  41. "maxlength": "20",
  42. "width": "200px",
  43. "visible": true,
  44. "label": "是否启用",
  45. "disabled": true,
  46. "attrcode": "cunitid"
  47. },
  48. ......
  49. ],
  50. "moduletype": "table",
  51. "pagination": false,
  52. "code": "revecont_b",
  53. "name": "收入合同子实体"
  54. },
  55. // 经过方法处理变成了:
  56. "revecont_b": {
  57. "items": [
  58. {
  59. "label": "和并列1",
  60. "attrcode": "jianzhi1",
  61. "visible": true,
  62. "children": [
  63. {
  64. "itemtype": "input",
  65. "scale": "8",
  66. "maxlength": "28",
  67. "width": "200px",
  68. "visible": true,
  69. "label": "分配金额1",
  70. "attrcode": "nallotmny"
  71. },
  72. {
  73. "itemtype": "label",
  74. "scale": "8",
  75. "maxlength": "28",
  76. "width": "200px",
  77. "visible": true,
  78. "label": "已履约数量1",
  79. "disabled": true,
  80. "attrcode": "nfinishnum"
  81. },
  82. ]
  83. },
  84. ......
  85. ],
  86. "moduletype": "table",
  87. "pagination": false,
  88. "code": "revecont_b",
  89. "name": "收入合同子实体"
  90. },