@luck-design-biz/luckda 0.0.25-6 → 0.0.25-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.
Files changed (255) hide show
  1. package/es/components/LDActions/index.js +8 -10
  2. package/es/components/LDActions/index.less +7 -4
  3. package/es/components/LdAutoForm/index.js +26 -8
  4. package/es/components/LdFormList/index.js +37 -22
  5. package/es/components/LdGrid/index.js +14 -7
  6. package/es/components/LdGridForm/index.js +18 -6
  7. package/es/components/LdTree/index.js +33 -15
  8. package/es/helper/form.js +15 -8
  9. package/es/locales/zh-CN.js +16 -10
  10. package/es/lowcode/constants/api-url.js +120 -32
  11. package/es/lowcode/constants/event-topics.js +2 -0
  12. package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -2
  13. package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +4 -2
  14. package/es/lowcode/engine/meta/box.props.json +3 -3
  15. package/es/lowcode/engine/meta/button.props.json +3 -3
  16. package/es/lowcode/engine/meta/components-list.json +6 -0
  17. package/es/lowcode/engine/meta/dialog.props.default.json +10 -5
  18. package/es/lowcode/engine/meta/dialog.props.json +72 -42
  19. package/es/lowcode/engine/meta/drawer.props.json +8 -20
  20. package/es/lowcode/engine/meta/form.props.json +16 -10
  21. package/es/lowcode/engine/meta/imex.props.default.json +8 -1
  22. package/es/lowcode/engine/meta/imex.props.json +54 -22
  23. package/es/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
  24. package/es/lowcode/engine/meta/layout.props.json +2 -2
  25. package/es/lowcode/engine/meta/page.props.json +2 -2
  26. package/es/lowcode/engine/meta/pagelayout.props.default.json +14 -0
  27. package/es/lowcode/engine/meta/pagelayout.props.json +47 -0
  28. package/es/lowcode/engine/meta/section.props.json +2 -2
  29. package/es/lowcode/engine/meta/split.props.default.json +1 -1
  30. package/es/lowcode/engine/meta/split.props.json +4 -4
  31. package/es/lowcode/engine/meta/table.props.json +17 -11
  32. package/es/lowcode/engine/meta/tabs.props.json +3 -3
  33. package/es/lowcode/engine/meta/tree.props.default.json +2 -0
  34. package/es/lowcode/engine/meta/tree.props.json +62 -6
  35. package/es/lowcode/engine/provider/ContextProvider/index.js +20 -43
  36. package/es/lowcode/engine/provider/RemoteSourceProvider.js +69 -24
  37. package/es/lowcode/engine/tools/dataProcess.js +4 -0
  38. package/es/lowcode/engine/tools/helper.js +2 -3
  39. package/es/lowcode/engine/tools/useCanvasRender.js +3 -2
  40. package/es/lowcode/engine/tools/usePageDataStore.js +176 -0
  41. package/es/lowcode/engine/tools/usePromiseState.js +12 -23
  42. package/es/lowcode/engine/tools/useTodo.js +20 -10
  43. package/es/lowcode/painter/DesignOperator.js +12 -23
  44. package/es/lowcode/painter/DesignToolbar.js +10 -45
  45. package/es/lowcode/painter/Outline.js +2 -4
  46. package/es/lowcode/painter/Panel.js +29 -28
  47. package/es/lowcode/painter/components/ActionBindModal.js +30 -24
  48. package/es/lowcode/painter/components/AdvancePanel.js +6 -1
  49. package/es/lowcode/painter/components/AttrsPanel.js +38 -29
  50. package/es/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
  51. package/es/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
  52. package/es/lowcode/painter/components/field-setting/CheckFrontRules.js +108 -0
  53. package/es/lowcode/painter/components/field-setting/CheckRules.js +1 -26
  54. package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +33 -13
  55. package/es/lowcode/painter/components/field-setting/SettingUI.js +162 -30
  56. package/es/lowcode/painter/components/field-setting/index.js +32 -63
  57. package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
  58. package/es/lowcode/painter/panel-section/BlocksEditor/index.js +14 -17
  59. package/es/lowcode/painter/panel-section/ButtonType.js +4 -2
  60. package/es/lowcode/painter/panel-section/DataSetSelector.js +4 -1
  61. package/es/lowcode/painter/panel-section/FieldsSetting.js +53 -8
  62. package/es/lowcode/painter/panel-section/ImpExp.js +93 -6
  63. package/es/lowcode/painter/panel-section/ImpExpAlone.js +109 -0
  64. package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +95 -0
  65. package/es/lowcode/painter/panel-section/SerialsSelector.js +4 -2
  66. package/es/lowcode/painter/panel-section/SplitDisplay.js +25 -110
  67. package/es/lowcode/painter/panel-section/StylePanel/index.js +10 -4
  68. package/es/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
  69. package/es/lowcode/painter/style/action-bind-modal.less +3 -3
  70. package/es/lowcode/painter/style/design.less +1 -1
  71. package/es/lowcode/painter/style/page-layout-display.less +28 -0
  72. package/es/lowcode/painter/style/panel-item.less +1 -1
  73. package/es/lowcode/painter/style/split-display.less +0 -9
  74. package/es/lowcode/preview/index.js +4 -2
  75. package/es/lowcode/view/Canvas.js +6 -7
  76. package/es/lowcode/view/Page.js +2 -3
  77. package/es/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
  78. package/es/lowcode/view/lc-components/Box/meta.json +3 -3
  79. package/es/lowcode/view/lc-components/Button/index.js +2 -6
  80. package/es/lowcode/view/lc-components/Button/meta.json +3 -3
  81. package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +3 -10
  82. package/es/lowcode/view/lc-components/Dialog/index.js +114 -19
  83. package/es/lowcode/view/lc-components/Dialog/meta.json +65 -42
  84. package/es/lowcode/view/lc-components/Drawer/meta.json +8 -20
  85. package/es/lowcode/view/lc-components/Form/FunctionDesign.js +23 -33
  86. package/es/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
  87. package/es/lowcode/view/lc-components/Form/index.js +113 -21
  88. package/es/lowcode/view/lc-components/Form/meta.json +16 -10
  89. package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
  90. package/es/lowcode/view/lc-components/ImEx/index.js +260 -10
  91. package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
  92. package/es/lowcode/view/lc-components/ImEx/meta.json +55 -23
  93. package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +12 -19
  94. package/es/lowcode/view/lc-components/Layout/meta.json +2 -2
  95. package/es/lowcode/view/lc-components/Page/meta.json +2 -2
  96. package/es/lowcode/view/lc-components/PageContent/index.js +8 -9
  97. package/es/lowcode/view/lc-components/PageFooter/index.js +2 -5
  98. package/es/lowcode/view/lc-components/PageHeader/index.js +5 -6
  99. package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +63 -0
  100. package/es/lowcode/view/lc-components/PageLayout/FunctionLive.js +10 -0
  101. package/es/lowcode/view/lc-components/PageLayout/FunctionPreview.js +10 -0
  102. package/es/lowcode/view/lc-components/PageLayout/index.js +32 -0
  103. package/es/lowcode/view/lc-components/PageLayout/meta.json +47 -0
  104. package/es/lowcode/view/lc-components/PageModal/index.js +12 -15
  105. package/es/lowcode/view/lc-components/Section/FunctionDesign.js +3 -9
  106. package/es/lowcode/view/lc-components/Section/meta.json +2 -2
  107. package/es/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
  108. package/es/lowcode/view/lc-components/Split/index.js +5 -9
  109. package/es/lowcode/view/lc-components/Split/meta.json +4 -4
  110. package/es/lowcode/view/lc-components/Table/components/TopImex.js +138 -0
  111. package/es/lowcode/view/lc-components/Table/index.js +124 -39
  112. package/es/lowcode/view/lc-components/Table/meta.json +17 -11
  113. package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +10 -17
  114. package/es/lowcode/view/lc-components/Tabs/index.js +3 -1
  115. package/es/lowcode/view/lc-components/Tabs/meta.json +3 -3
  116. package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
  117. package/es/lowcode/view/lc-components/Tree/index.js +67 -18
  118. package/es/lowcode/view/lc-components/Tree/meta.json +62 -7
  119. package/es/lowcode/view/lc-components/Wrapper.js +9 -11
  120. package/es/services.js +0 -24
  121. package/es/upload/FilesWall/file.png +0 -0
  122. package/es/upload/FilesWall/index.js +422 -0
  123. package/es/upload/FilesWall/index.less +74 -0
  124. package/es/upload/Form/index.js +2 -1
  125. package/es/upload/FormItem/index.js +3 -5
  126. package/es/upload/index.js +2 -1
  127. package/es/utils/action.js +2 -2
  128. package/lib/components/LDActions/index.js +7 -9
  129. package/lib/components/LDActions/index.less +7 -4
  130. package/lib/components/LdAutoForm/index.js +25 -7
  131. package/lib/components/LdFormList/index.js +36 -21
  132. package/lib/components/LdGrid/index.js +14 -7
  133. package/lib/components/LdGridForm/index.js +16 -4
  134. package/lib/components/LdTree/index.js +33 -15
  135. package/lib/helper/form.js +14 -7
  136. package/lib/locales/zh-CN.js +16 -10
  137. package/lib/lowcode/constants/api-url.js +123 -32
  138. package/lib/lowcode/constants/event-topics.js +3 -1
  139. package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -2
  140. package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +4 -2
  141. package/lib/lowcode/engine/meta/box.props.json +3 -3
  142. package/lib/lowcode/engine/meta/button.props.json +3 -3
  143. package/lib/lowcode/engine/meta/components-list.json +6 -0
  144. package/lib/lowcode/engine/meta/dialog.props.default.json +10 -5
  145. package/lib/lowcode/engine/meta/dialog.props.json +72 -42
  146. package/lib/lowcode/engine/meta/drawer.props.json +8 -20
  147. package/lib/lowcode/engine/meta/form.props.json +16 -10
  148. package/lib/lowcode/engine/meta/imex.props.default.json +8 -1
  149. package/lib/lowcode/engine/meta/imex.props.json +54 -22
  150. package/lib/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
  151. package/lib/lowcode/engine/meta/layout.props.json +2 -2
  152. package/lib/lowcode/engine/meta/page.props.json +2 -2
  153. package/lib/lowcode/engine/meta/pagelayout.props.default.json +14 -0
  154. package/lib/lowcode/engine/meta/pagelayout.props.json +47 -0
  155. package/lib/lowcode/engine/meta/section.props.json +2 -2
  156. package/lib/lowcode/engine/meta/split.props.default.json +1 -1
  157. package/lib/lowcode/engine/meta/split.props.json +4 -4
  158. package/lib/lowcode/engine/meta/table.props.json +17 -11
  159. package/lib/lowcode/engine/meta/tabs.props.json +3 -3
  160. package/lib/lowcode/engine/meta/tree.props.default.json +2 -0
  161. package/lib/lowcode/engine/meta/tree.props.json +62 -6
  162. package/lib/lowcode/engine/provider/ContextProvider/index.js +36 -43
  163. package/lib/lowcode/engine/provider/RemoteSourceProvider.js +68 -23
  164. package/lib/lowcode/engine/tools/dataProcess.js +4 -0
  165. package/lib/lowcode/engine/tools/helper.js +2 -3
  166. package/lib/lowcode/engine/tools/useCanvasRender.js +3 -2
  167. package/lib/lowcode/engine/tools/usePageDataStore.js +183 -0
  168. package/lib/lowcode/engine/tools/usePromiseState.js +11 -21
  169. package/lib/lowcode/engine/tools/useTodo.js +19 -9
  170. package/lib/lowcode/painter/DesignOperator.js +11 -22
  171. package/lib/lowcode/painter/DesignToolbar.js +9 -44
  172. package/lib/lowcode/painter/Outline.js +1 -3
  173. package/lib/lowcode/painter/Panel.js +28 -27
  174. package/lib/lowcode/painter/components/ActionBindModal.js +28 -22
  175. package/lib/lowcode/painter/components/AdvancePanel.js +6 -1
  176. package/lib/lowcode/painter/components/AttrsPanel.js +37 -28
  177. package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
  178. package/lib/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
  179. package/lib/lowcode/painter/components/field-setting/CheckFrontRules.js +116 -0
  180. package/lib/lowcode/painter/components/field-setting/CheckRules.js +1 -26
  181. package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +34 -13
  182. package/lib/lowcode/painter/components/field-setting/SettingUI.js +159 -27
  183. package/lib/lowcode/painter/components/field-setting/index.js +32 -63
  184. package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
  185. package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +13 -16
  186. package/lib/lowcode/painter/panel-section/ButtonType.js +4 -2
  187. package/lib/lowcode/painter/panel-section/DataSetSelector.js +4 -1
  188. package/lib/lowcode/painter/panel-section/FieldsSetting.js +53 -8
  189. package/lib/lowcode/painter/panel-section/ImpExp.js +92 -5
  190. package/lib/lowcode/painter/panel-section/ImpExpAlone.js +115 -0
  191. package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +103 -0
  192. package/lib/lowcode/painter/panel-section/SerialsSelector.js +4 -2
  193. package/lib/lowcode/painter/panel-section/SplitDisplay.js +24 -109
  194. package/lib/lowcode/painter/panel-section/StylePanel/index.js +10 -4
  195. package/lib/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
  196. package/lib/lowcode/painter/style/action-bind-modal.less +3 -3
  197. package/lib/lowcode/painter/style/design.less +1 -1
  198. package/lib/lowcode/painter/style/page-layout-display.less +28 -0
  199. package/lib/lowcode/painter/style/panel-item.less +1 -1
  200. package/lib/lowcode/painter/style/split-display.less +0 -9
  201. package/lib/lowcode/preview/index.js +4 -2
  202. package/lib/lowcode/view/Canvas.js +5 -6
  203. package/lib/lowcode/view/Page.js +2 -3
  204. package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
  205. package/lib/lowcode/view/lc-components/Box/meta.json +3 -3
  206. package/lib/lowcode/view/lc-components/Button/index.js +2 -6
  207. package/lib/lowcode/view/lc-components/Button/meta.json +3 -3
  208. package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -9
  209. package/lib/lowcode/view/lc-components/Dialog/index.js +114 -19
  210. package/lib/lowcode/view/lc-components/Dialog/meta.json +65 -42
  211. package/lib/lowcode/view/lc-components/Drawer/meta.json +8 -20
  212. package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +20 -31
  213. package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
  214. package/lib/lowcode/view/lc-components/Form/index.js +110 -18
  215. package/lib/lowcode/view/lc-components/Form/meta.json +16 -10
  216. package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
  217. package/lib/lowcode/view/lc-components/ImEx/index.js +257 -8
  218. package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
  219. package/lib/lowcode/view/lc-components/ImEx/meta.json +55 -23
  220. package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +11 -18
  221. package/lib/lowcode/view/lc-components/Layout/meta.json +2 -2
  222. package/lib/lowcode/view/lc-components/Page/meta.json +2 -2
  223. package/lib/lowcode/view/lc-components/PageContent/index.js +7 -8
  224. package/lib/lowcode/view/lc-components/PageFooter/index.js +2 -5
  225. package/lib/lowcode/view/lc-components/PageHeader/index.js +4 -5
  226. package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +71 -0
  227. package/lib/lowcode/view/lc-components/PageLayout/FunctionLive.js +17 -0
  228. package/lib/lowcode/view/lc-components/PageLayout/FunctionPreview.js +17 -0
  229. package/lib/lowcode/view/lc-components/PageLayout/index.js +40 -0
  230. package/lib/lowcode/view/lc-components/PageLayout/meta.json +47 -0
  231. package/lib/lowcode/view/lc-components/PageModal/index.js +11 -14
  232. package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +2 -8
  233. package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
  234. package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
  235. package/lib/lowcode/view/lc-components/Split/index.js +2 -6
  236. package/lib/lowcode/view/lc-components/Split/meta.json +4 -4
  237. package/lib/lowcode/view/lc-components/Table/components/TopImex.js +145 -0
  238. package/lib/lowcode/view/lc-components/Table/index.js +123 -38
  239. package/lib/lowcode/view/lc-components/Table/meta.json +17 -11
  240. package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +11 -18
  241. package/lib/lowcode/view/lc-components/Tabs/index.js +3 -1
  242. package/lib/lowcode/view/lc-components/Tabs/meta.json +3 -3
  243. package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
  244. package/lib/lowcode/view/lc-components/Tree/index.js +65 -16
  245. package/lib/lowcode/view/lc-components/Tree/meta.json +62 -7
  246. package/lib/lowcode/view/lc-components/Wrapper.js +8 -10
  247. package/lib/services.js +0 -25
  248. package/lib/upload/FilesWall/file.png +0 -0
  249. package/lib/upload/FilesWall/index.js +429 -0
  250. package/lib/upload/FilesWall/index.less +74 -0
  251. package/lib/upload/Form/index.js +2 -1
  252. package/lib/upload/FormItem/index.js +3 -5
  253. package/lib/upload/index.js +8 -1
  254. package/lib/utils/action.js +2 -2
  255. package/package.json +5 -4
@@ -9,7 +9,7 @@
9
9
  "props": [
10
10
  {
11
11
  "key": "id",
12
- "desc": "唯一标识",
12
+ "name": "唯一标识",
13
13
  "type": "string",
14
14
  "disabled": true
15
15
  },
@@ -22,65 +22,88 @@
22
22
  },
23
23
  {
24
24
  "key": "width",
25
- "name": "宽度",
26
- "desc": "对话框的宽度",
27
- "type": "string",
25
+ "name": "对话框宽度",
26
+ "type": "_WidthHeight",
27
+ "options": [
28
+ {
29
+ "label": "px",
30
+ "value": "px"
31
+ },
32
+ {
33
+ "label": "%",
34
+ "value": "%"
35
+ },
36
+ {
37
+ "label": "vw",
38
+ "value": "vw"
39
+ },
40
+ {
41
+ "label": "A",
42
+ "value": "auto"
43
+ }
44
+ ],
28
45
  "default": "700px"
29
46
  },
30
47
  {
31
48
  "key": "height",
32
- "name": "高度",
33
- "desc": "对话框的高度",
34
- "type": "string",
35
- "default": "60vh"
36
- },
37
- {
38
- "key": "fullScreen",
39
- "name": "默认全屏",
40
- "desc": "对话框打开默认全屏",
41
- "type": "boolean",
42
- "default": false
43
- },
44
- {
45
- "key": "fullable",
46
- "name": "支持全屏切换",
47
- "desc": "可以通过右上角按钮切换全屏状态",
48
- "type": "boolean",
49
- "default": true
49
+ "name": "内容区高度",
50
+ "type": "_WidthHeight",
51
+ "options": [
52
+ {
53
+ "label": "px",
54
+ "value": "px"
55
+ },
56
+ {
57
+ "label": "vh",
58
+ "value": "vh"
59
+ },
60
+ {
61
+ "label": "A",
62
+ "value": "auto"
63
+ }
64
+ ],
65
+ "default": "50vh"
50
66
  },
51
67
  {
52
68
  "key": "defaultOpen",
53
69
  "name": "默认显示",
54
70
  "desc": "默认是否显示",
55
- "type": "boolean",
71
+ "type": "switch",
56
72
  "default": false
57
73
  },
58
74
  {
59
75
  "key": "mask",
60
76
  "name": "显示遮罩",
61
- "desc": "是否展示遮罩",
62
- "type": "boolean",
63
- "default": false
77
+ "type": "switch",
78
+ "default": true
64
79
  },
65
80
  {
66
- "key": "keyboard",
67
- "name": "ESC关闭",
68
- "desc": "是否支持键盘 esc 关闭",
69
- "type": "boolean",
70
- "default": true
81
+ "key": "okText",
82
+ "name": "确认文字",
83
+ "type": "_I18nInput",
84
+ "default": "确定"
85
+ },
86
+ {
87
+ "key": "cancelText",
88
+ "name": "取消文字",
89
+ "type": "_I18nInput",
90
+ "default": "取消"
71
91
  },
72
92
  {
73
93
  "key": "footer",
74
- "name": "底部按钮是否显示",
94
+ "name": "显示footer",
75
95
  "desc": "是否显示底部按钮区域",
76
- "type": "boolean",
96
+ "type": "switch",
77
97
  "default": true
78
98
  },
79
99
  {
80
100
  "key": "btnGroup",
81
101
  "name": "按钮组",
82
102
  "desc": "底部按钮区域的按钮组(参考按钮配置)",
83
- "type": "_ActionSelector"
103
+ "type": "_ActionsEditor",
104
+ "default": { "display": "button", "max": 2, "moreText": "操作", "todoList": [] },
105
+ "wrapper": "collapse",
106
+ "wrapperProps": { "suppressIcon": true }
84
107
  }
85
108
  ],
86
109
  "advance": {
@@ -89,31 +112,31 @@
89
112
  "key": "onMount",
90
113
  "name": "组件首次渲染时",
91
114
  "desc": "在组件首次渲染时,执行方法",
92
- "func": "(params)=>{\n\t\n}"
115
+ "func": "function onMount() {\n\t\n}"
93
116
  },
94
117
  {
95
118
  "key": "onUnmount",
96
119
  "name": "组件卸载时",
97
120
  "desc": "在组件卸载时,执行方法。",
98
- "func": "(params)=>{\n\t\n}"
121
+ "func": "function onUnmount() {\n\t\n}"
99
122
  },
100
123
  {
101
124
  "key": "onOpen",
102
125
  "name": "对话框打开时",
103
126
  "desc": "在对话框打开时,执行方法",
104
- "func": "(params)=>{\n\t\n}"
127
+ "func": "function onOpen() {\n\t\n}"
105
128
  },
106
129
  {
107
130
  "key": "onClose",
108
131
  "name": "对话框关闭时",
109
132
  "desc": "在对话框打开时,执行方法,promise反馈false无法截断关闭",
110
- "func": "(params)=>{\n\t\n}"
133
+ "func": "function onClose() {\n\t\n}"
111
134
  },
112
135
  {
113
- "key": "onButtonClick",
114
- "name": "按钮组点击",
115
- "desc": "点击按钮组某个按钮时,执行方法",
116
- "func": "(buttonKey,params)=>{\n\t\n}"
136
+ "key": "onOk",
137
+ "name": "确定按钮点击",
138
+ "desc": "点击确定按钮时,执行方法",
139
+ "func": "function onOk() {\n\t\n}"
117
140
  }
118
141
  ]
119
142
  }
@@ -100,43 +100,31 @@
100
100
  "key": "onMount",
101
101
  "name": "组件首次渲染时",
102
102
  "desc": "在组件首次渲染时,执行方法",
103
- "func": "(params)=>{\n\t\n}"
103
+ "func": "function onMount() {\n\t\n}"
104
104
  },
105
105
  {
106
106
  "key": "onUnmount",
107
107
  "name": "组件卸载时",
108
108
  "desc": "在组件卸载时,执行方法。",
109
- "func": "(params)=>{\n\t\n}"
110
- },
111
- {
112
- "key": "onMount",
113
- "name": "组件首次渲染时",
114
- "desc": "在组件首次渲染时,执行方法",
115
- "func": "(params)=>{\n\t\n}"
116
- },
117
- {
118
- "key": "onUnmount",
119
- "name": "组件卸载时",
120
- "desc": "在组件卸载时,执行方法。",
121
- "func": "(params)=>{\n\t\n}"
109
+ "func": "function onUnmount() {\n\t\n}"
122
110
  },
123
111
  {
124
112
  "key": "onOpen",
125
113
  "name": "抽屉打开时",
126
114
  "desc": "在抽屉打开时,执行方法",
127
- "func": "(params)=>{\n\t\n}"
115
+ "func": "function onOpen() {\n\t\n}"
128
116
  },
129
117
  {
130
118
  "key": "onClose",
131
119
  "name": "抽屉关闭时",
132
120
  "desc": "在抽屉打开时,执行方法,promise反馈false无法截断关闭",
133
- "func": "(params)=>{\n\t\n}"
121
+ "func": "function onClose() {\n\t\n}"
134
122
  },
135
123
  {
136
- "key": "onButtonClick",
137
- "name": "按钮组点击",
138
- "desc": "点击按钮组某个按钮时,执行方法",
139
- "func": "(buttonKey,params)=>{\n\t\n}"
124
+ "key": "onOk",
125
+ "name": "确定按钮点击",
126
+ "desc": "点击确定按钮时,执行方法",
127
+ "func": "function onOk() {\n\t\n}"
140
128
  }
141
129
  ]
142
130
  }
@@ -6,12 +6,12 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
6
6
  var _excluded = ["children", "blocks", "id"];
7
7
  import React, { useRef, useEffect } from 'react';
8
8
  import { usePrevious, useUpdateLayoutEffect } from 'ahooks';
9
- import { isEqual, differenceWith, cloneDeep, differenceBy } from 'lodash';
9
+ import { isEqual, cloneDeep, differenceBy } from 'lodash';
10
10
  import { suid } from '@luck-design-biz/base/utils';
11
- import { useContext, usePageData } from "../../../engine/provider/ContextProvider";
12
- import { add, findNodeAndParent } from "../../../engine/tools/dataProcess";
11
+ import { useContext, useGet, addNode } from "../../../engine/provider/ContextProvider";
13
12
  import boxDefaultMeta from "../../../engine/meta/box.props.default.json";
14
13
  import Index from "./index";
14
+ import { keyBy, forEach } from 'lodash';
15
15
  var FunctionDesign = function FunctionDesign(_ref) {
16
16
  var children = _ref.children,
17
17
  blocks = _ref.blocks,
@@ -19,38 +19,32 @@ var FunctionDesign = function FunctionDesign(_ref) {
19
19
  props = _objectWithoutProperties(_ref, _excluded);
20
20
  var ref = useRef(null);
21
21
  var ctx = useContext();
22
- var _usePageData = usePageData(),
23
- _usePageData2 = _slicedToArray(_usePageData, 2),
24
- setPageData = _usePageData2[1].setPageData;
22
+ var current = useGet({
23
+ id: id
24
+ });
25
25
  var previousBlocks = usePrevious(cloneDeep(blocks), function (prev, next) {
26
26
  return !isEqual(prev, next);
27
27
  });
28
28
  useUpdateLayoutEffect(function () {
29
- var diffDataset = differenceWith(blocks, previousBlocks, function (arrVal, othVal) {
30
- var _arrVal$dataset, _othVal$dataset;
31
- return arrVal.id === othVal.id && ((_arrVal$dataset = arrVal.dataset) === null || _arrVal$dataset === void 0 ? void 0 : _arrVal$dataset.code) === ((_othVal$dataset = othVal.dataset) === null || _othVal$dataset === void 0 ? void 0 : _othVal$dataset.code);
32
- });
33
- diffDataset.forEach(function (df) {
34
- var _df$dataset;
35
- ((_df$dataset = df.dataset) === null || _df$dataset === void 0 ? void 0 : _df$dataset.code) && ref.current.doQueryOne(df.id);
36
- });
37
- var diffColReset = differenceWith(blocks, previousBlocks, function (arrVal, othVal) {
38
- return arrVal.id === othVal.id && arrVal.actionsColumnReset === othVal.actionsColumnReset;
39
- });
40
- diffColReset.forEach(function (df) {
41
- var _ctx$componentMap$get2;
42
- var _ctx$componentMap$get = (_ctx$componentMap$get2 = ctx.componentMap.get(id)) === null || _ctx$componentMap$get2 === void 0 ? void 0 : _ctx$componentMap$get2.api.getForm().getFormRef(df.id).formRef.current,
43
- gridApi = _ctx$componentMap$get.gridApi;
44
- gridApi.api.refreshCells({
45
- columns: ['luck-actions'],
46
- force: true
47
- });
29
+ var blocksObj = keyBy(blocks, 'id');
30
+ var previousBlocksObj = keyBy(previousBlocks, 'id');
31
+ forEach(blocksObj, function (value, key) {
32
+ var _value$dataset, _previousBlocksObj$ke, _value$dataset2, _previousBlocksObj$ke2;
33
+ if (((_value$dataset = value.dataset) === null || _value$dataset === void 0 ? void 0 : _value$dataset.code) !== ((_previousBlocksObj$ke = previousBlocksObj[key]) === null || _previousBlocksObj$ke === void 0 || (_previousBlocksObj$ke = _previousBlocksObj$ke.dataset) === null || _previousBlocksObj$ke === void 0 ? void 0 : _previousBlocksObj$ke.code)) ((_value$dataset2 = value.dataset) === null || _value$dataset2 === void 0 ? void 0 : _value$dataset2.code) && ref.current.doQueryOne(key);
34
+ if (value.actionsColumnReset !== ((_previousBlocksObj$ke2 = previousBlocksObj[key]) === null || _previousBlocksObj$ke2 === void 0 ? void 0 : _previousBlocksObj$ke2.actionsColumnReset)) {
35
+ var _ctx$componentMap$get2;
36
+ var _ctx$componentMap$get = (_ctx$componentMap$get2 = ctx.componentMap.get(id)) === null || _ctx$componentMap$get2 === void 0 ? void 0 : _ctx$componentMap$get2.api.getForm().getFormRef(key).formRef.current,
37
+ gridApi = _ctx$componentMap$get.gridApi;
38
+ gridApi.api.refreshCells({
39
+ columns: ['luck-actions'],
40
+ force: true
41
+ });
42
+ }
48
43
  });
49
44
  }, [JSON.stringify(blocks)]);
50
45
  useEffect(function () {
51
46
  var cmid = ctx.$subscriber(ctx.topics.COMPONENT_MODIFY).on(function (_ref2) {
52
47
  var compId = _ref2.id,
53
- pageData = _ref2.pageData,
54
48
  newValue = _ref2.newValue,
55
49
  oldValue = _ref2.oldValue;
56
50
  if (compId !== id || !newValue.hasOwnProperty('blocks')) return;
@@ -60,25 +54,21 @@ var FunctionDesign = function FunctionDesign(_ref) {
60
54
  newItem = _differenceBy2[0];
61
55
  if (newItem.type === 'blank') {
62
56
  var boxId = "box_".concat(suid());
63
- add(pageData, id, boxId, _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
57
+ addNode(id, boxId, _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
64
58
  buildIn: true,
65
59
  formBoxId: newItem.id
66
60
  }));
67
- setPageData(pageData);
68
61
  }
69
62
  } else if (newValue.blocks.length < oldValue.blocks.length) {
70
63
  var _differenceBy3 = differenceBy(oldValue.blocks, newValue.blocks, 'id'),
71
64
  _differenceBy4 = _slicedToArray(_differenceBy3, 1),
72
65
  removeItem = _differenceBy4[0];
73
66
  if (removeItem.type === 'blank') {
74
- var _findNodeAndParent = findNodeAndParent(id, pageData),
75
- current = _findNodeAndParent.node;
76
67
  var _boxId = current.children.find(function (childId) {
77
- return current[childId].props.tabId === removeItem.id;
68
+ return current[childId].props.formBoxId === removeItem.id;
78
69
  });
79
70
  ctx.$publisher(ctx.topics.COMPONENT_DELETE, {
80
- id: _boxId,
81
- pageData: pageData
71
+ id: _boxId
82
72
  });
83
73
  }
84
74
  }
@@ -1,3 +1,5 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
4
  var _excluded = ["children"];
3
5
  import React from 'react';
@@ -5,6 +7,11 @@ import Index from "./index";
5
7
  var FunctionPreview = function FunctionPreview(_ref) {
6
8
  var children = _ref.children,
7
9
  props = _objectWithoutProperties(_ref, _excluded);
8
- return /*#__PURE__*/React.createElement(Index, props, children);
10
+ return /*#__PURE__*/React.createElement(Index, _extends({}, props, {
11
+ initData: {
12
+ formMode: 'update',
13
+ ticketData: _defineProperty({}, window.appConfig.constraintKeys.PRIMARY, 'test')
14
+ }
15
+ }), children);
9
16
  };
10
17
  export default FunctionPreview;
@@ -1,11 +1,12 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import React, { useRef, forwardRef, Fragment, useImperativeHandle } from 'react';
4
- import { useMemoizedFn, useCreation, useMount, useUnmount } from 'ahooks';
2
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+ import React, { useRef, forwardRef, Fragment, useImperativeHandle, useEffect } from 'react';
4
+ import { useMemoizedFn, useCreation, useMount } from 'ahooks';
5
5
  import classNames from 'classnames';
6
- import { reduce, includes, isNil } from 'lodash';
6
+ import { reduce, includes, isNil, cloneDeep } from 'lodash';
7
7
  import { BasicDivider } from 'luck-design';
8
8
  import { Collapse } from '@luck-design-biz/base';
9
+ import { formatMessage, getPageQuery } from '@luck-design-biz/base/utils';
9
10
  import Wrapper from "../Wrapper";
10
11
  import { LdFormList } from "../../../../index";
11
12
  import { omitBadProps, executeCode } from "../../../engine/tools/helper";
@@ -14,6 +15,7 @@ import buildUploadForm from "../../../../upload/Form";
14
15
  import LdRuntimeCom from "../../../../components/LdRuntimeCom";
15
16
  import defaultMeta from "../../../engine/meta/form.props.default.json";
16
17
  import styles from "./index.less";
18
+ var _I18N_PREFIX_ = 'lc.form.validator';
17
19
  var Header = function Header(_ref) {
18
20
  var _ref$header = _ref.header,
19
21
  header = _ref$header === void 0 ? 'collapse' : _ref$header,
@@ -34,6 +36,7 @@ var Header = function Header(_ref) {
34
36
  }), children);
35
37
  };
36
38
  var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
39
+ var _ctx$pagePublicResour2;
37
40
  var id = _ref2.id,
38
41
  parentId = _ref2.parentId,
39
42
  width = _ref2.width,
@@ -54,6 +57,10 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
54
57
  var formRef = useRef();
55
58
  var ctx = useContext();
56
59
  var remoteSource = useRemoteSource();
60
+ var _initData = useCreation(function () {
61
+ return getPageQuery();
62
+ }, []); // 获取主界面传递过来的详情页参数
63
+
57
64
  var serials = useCreation(function () {
58
65
  var _remoteSource$serials;
59
66
  return ((_remoteSource$serials = remoteSource.serials) === null || _remoteSource$serials === void 0 ? void 0 : _remoteSource$serials.map(function (i) {
@@ -65,15 +72,46 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
65
72
  instance: (ref || formRef).current
66
73
  });
67
74
  });
68
- useUnmount(function () {
69
- ctx.doAction(advance.events.onUnmount, {
70
- instance: (ref || formRef).current
71
- });
72
- });
75
+ useEffect(function () {
76
+ var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref3) {
77
+ var resource = _ref3.resource,
78
+ prevResource = _ref3.prevResource;
79
+ ctx.doAction(advance.events.onPagePublicResourceChanged, {
80
+ resource: resource,
81
+ prevResource: prevResource,
82
+ instance: (ref || formRef).current
83
+ });
84
+ }).watch();
85
+ return function () {
86
+ ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
87
+ ctx.doAction(advance.events.onUnmount, {
88
+ instance: (ref || formRef).current
89
+ });
90
+ };
91
+ }, []);
73
92
  useImperativeHandle(apiRef, function () {
74
93
  return {
75
- getForm: function getForm() {
94
+ /**
95
+ * 获取表格实例
96
+ * @method
97
+ */
98
+ getInstance: function getInstance() {
76
99
  return (ref || formRef).current;
100
+ },
101
+ /**
102
+ * 提交表格数据
103
+ * @method
104
+ */
105
+ submit: function submit() {
106
+ var _ctx$pagePublicResour;
107
+ var instance = (ref || formRef).current;
108
+ var _ref4 = ((_ctx$pagePublicResour = ctx.pagePublicResource) === null || _ctx$pagePublicResour === void 0 ? void 0 : _ctx$pagePublicResour[id]) || initData || _initData || {},
109
+ formMode = _ref4.formMode;
110
+ if (formMode === 'add') {
111
+ instance.onAdd();
112
+ } else if (formMode === 'update') {
113
+ instance.onBatchUpdate();
114
+ }
77
115
  }
78
116
  };
79
117
  });
@@ -86,11 +124,11 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
86
124
  };
87
125
  return executeCode(ctx, defaultDataSourceFormat, ['defaultValues'], defaultValues);
88
126
  });
89
- var handleDataSourceFormat = useMemoizedFn(function (dataSourceFormat, _ref3) {
90
- var values = _ref3.values,
91
- submitData = _ref3.submitData;
92
- if (isNil(dataSourceFormat)) return submitData;
93
- return executeCode(ctx, dataSourceFormat, ['values', 'submitData'], values, submitData);
127
+ var handleDataSourceFormat = useMemoizedFn(function (dataSourceFormat, dataSetKey, _ref5) {
128
+ var values = _ref5.values,
129
+ submitData = _ref5.submitData;
130
+ if (isNil(dataSourceFormat)) return _defineProperty({}, dataSetKey, submitData);
131
+ return executeCode(ctx, dataSourceFormat, ['dataSetKey', 'values', 'submitData'], dataSetKey, values, submitData);
94
132
  });
95
133
  var handleResetActionsColumn = useMemoizedFn(function (actionsColumnReset, data, index, actions, params) {
96
134
  return executeCode(ctx, actionsColumnReset, ['data', 'index', 'actions', 'params'], data, index, actions, params);
@@ -120,9 +158,61 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
120
158
  var renderAffix = useMemoizedFn(function (_render) {
121
159
  return _render ? /*#__PURE__*/React.createElement(LdRuntimeCom, null, _render) : null;
122
160
  });
161
+ var setVerifyRules = function setVerifyRules(_props, verifyListObj) {
162
+ var _verifyListObj$length, _verifyListObj$min, _verifyListObj$max, _verifyListObj$rules;
163
+ var props = cloneDeep(_props);
164
+ props.config.rules = props.config.rules || [];
165
+ if ((_verifyListObj$length = verifyListObj.length) !== null && _verifyListObj$length !== void 0 && _verifyListObj$length.expression) props.config.rules.push({
166
+ validator: function validator(rule, value, callback) {
167
+ var _current;
168
+ var length = executeCode(ctx, verifyListObj.length.expression, ['cValue'], (_current = (ref || formRef).current) === null || _current === void 0 ? void 0 : _current.getCValue());
169
+ if (value.length > length) callback("".concat(formatMessage({
170
+ id: "".concat(_I18N_PREFIX_, ".maxLength"),
171
+ label: '字数不得超过'
172
+ })).concat(length).concat(formatMessage({
173
+ id: "".concat(_I18N_PREFIX_, ".textNum"),
174
+ label: '个字符'
175
+ })));
176
+ callback();
177
+ }
178
+ });
179
+ if ((_verifyListObj$min = verifyListObj.min) !== null && _verifyListObj$min !== void 0 && _verifyListObj$min.expression) props.config.rules.push({
180
+ validator: function validator(rule, value, callback) {
181
+ var _current2;
182
+ var min = executeCode(ctx, verifyListObj.min.expression, ['cValue'], (_current2 = (ref || formRef).current) === null || _current2 === void 0 ? void 0 : _current2.getCValue());
183
+ if (value < min) callback(formatMessage({
184
+ id: "".concat(_I18N_PREFIX_, ".numberBelowMin"),
185
+ label: '低于最小值'
186
+ }));
187
+ callback();
188
+ }
189
+ });
190
+ if ((_verifyListObj$max = verifyListObj.max) !== null && _verifyListObj$max !== void 0 && _verifyListObj$max.expression) props.config.rules.push({
191
+ validator: function validator(rule, value, callback) {
192
+ var _current3;
193
+ var max = executeCode(ctx, verifyListObj.max.expression, ['cValue'], (_current3 = (ref || formRef).current) === null || _current3 === void 0 ? void 0 : _current3.getCValue());
194
+ if (value > max) callback(formatMessage({
195
+ id: "".concat(_I18N_PREFIX_, ".numberExceedMax"),
196
+ label: '超过最大值'
197
+ }));
198
+ callback();
199
+ }
200
+ });
201
+ if (verifyListObj.email) props.config.type = 'email';
202
+ if (verifyListObj.idcard) props.config.type = 'idcard';
203
+ if (verifyListObj.mobile) props.config.type = 'mobile';
204
+ if ((_verifyListObj$rules = verifyListObj.rules) !== null && _verifyListObj$rules !== void 0 && _verifyListObj$rules.expression) props.config.rules.push({
205
+ validator: function validator(rule, value, callback) {
206
+ var _current4;
207
+ executeCode(ctx, verifyListObj.rules.expression, ['cValue', 'rule', 'value', 'callback'], (_current4 = (ref || formRef).current) === null || _current4 === void 0 ? void 0 : _current4.getCValue(), rule, value, callback);
208
+ }
209
+ });
210
+ return props;
211
+ };
123
212
  var renderFormList = useMemoizedFn(function (formConfig) {
124
213
  return reduce(blocks, function (result, item) {
125
- if (includes(['auto', 'grid', 'writer'], item.type) && item.dataset && includes(item.mode, formConfig.formMode)) {
214
+ if (includes(['auto', 'grid', 'writer'], item.type) && includes(item.mode, formConfig.formMode)) {
215
+ var _item$dataset;
126
216
  var data = {
127
217
  id: item.id,
128
218
  order: item.order,
@@ -130,15 +220,17 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
130
220
  readOnly: item.readOnly,
131
221
  title: item.name,
132
222
  header: item.header,
133
- dataSetKey: item.dataset.code,
223
+ dataSetKey: (_item$dataset = item.dataset) === null || _item$dataset === void 0 ? void 0 : _item$dataset.code,
134
224
  serial: item.serial,
135
225
  serialEffect: item.serialEffect,
226
+ fields: item.fields,
136
227
  defaultDataSourceFormat: function defaultDataSourceFormat(defaultValues) {
137
228
  return handleDefaultDataSourceFormat(item.defaultDataSourceFormat, defaultValues);
138
229
  },
139
230
  onUpdate: {
140
231
  post: function post(data) {
141
- return handleDataSourceFormat(item.dataSourceFormat, data);
232
+ var _item$dataset2;
233
+ return handleDataSourceFormat(item.dataSourceFormat, (_item$dataset2 = item.dataset) === null || _item$dataset2 === void 0 ? void 0 : _item$dataset2.code, data);
142
234
  }
143
235
  }
144
236
  };
@@ -236,7 +328,6 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
236
328
  });
237
329
  resolve(_data);
238
330
  }
239
- ;
240
331
  });
241
332
  });
242
333
  var afterSubmit = useMemoizedFn(function (success, mainKey, res) {
@@ -275,7 +366,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
275
366
  renderFormList: renderFormList,
276
367
  renderFormExtra: renderFormExtra,
277
368
  mainFormLdId: "block_main",
278
- initData: initData,
369
+ initData: ((_ctx$pagePublicResour2 = ctx.pagePublicResource) === null || _ctx$pagePublicResour2 === void 0 ? void 0 : _ctx$pagePublicResour2[id]) || initData || _initData,
279
370
  ref: ref || formRef,
280
371
  readOnly: readOnly,
281
372
  showSaveBtn: showSave,
@@ -290,7 +381,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
290
381
  beforeSubmit: beforeSubmit,
291
382
  afterSubmit: advance.events.onSaveCallback ? afterSubmit : null,
292
383
  onValueChange: onValueChange,
293
- onChildChange: onChildChange
384
+ onChildChange: onChildChange,
385
+ setVerifyRules: setVerifyRules
294
386
  })));
295
387
  });
296
388
  LCForm.defaultProps = omitBadProps(defaultMeta);
@@ -38,7 +38,7 @@
38
38
  {
39
39
  "key": "saveTitle",
40
40
  "name": "保存按钮标题",
41
- "type": "string",
41
+ "type": "_I18nInput",
42
42
  "default": "保存"
43
43
  },
44
44
  {
@@ -120,7 +120,7 @@
120
120
  {
121
121
  "key": "name",
122
122
  "name": "区块名称",
123
- "type": "string"
123
+ "type": "_I18nInput"
124
124
  },
125
125
  {
126
126
  "key": "serial",
@@ -244,7 +244,7 @@
244
244
  "name": "格式化数据",
245
245
  "desc": "格式化单表提交数据",
246
246
  "type": "_JSEditor",
247
- "defaultCode": "function dataSourceFormat(values, submitData) { \n return submitData; \n}",
247
+ "defaultCode": "function dataSourceFormat(dataSetKey, values, submitData) { \n return { [dataSetKey]: submitData }; \n}",
248
248
  "mustConfirm": true,
249
249
  "wrapper": "collapse",
250
250
  "wrapperProps": { "suppressIcon": true }
@@ -501,7 +501,7 @@
501
501
  {
502
502
  "key": "zipName",
503
503
  "name": "压缩包命名",
504
- "type": "string"
504
+ "type": "_I18nInput"
505
505
  },
506
506
  {
507
507
  "key": "uploadUrl",
@@ -562,37 +562,43 @@
562
562
  "key": "onMount",
563
563
  "name": "组件首次渲染时",
564
564
  "desc": "在组件首次渲染时,执行方法",
565
- "func": "(instance)=>{\n\t\n}"
565
+ "func": "function onMount(instance) {\n\t\n}"
566
566
  },
567
567
  {
568
568
  "key": "beforeSave",
569
569
  "name": "保存前置事件",
570
570
  "desc": "保存前置事件,promise,返回false取消执行",
571
- "func": "(values, data) => {\n return values; \n}"
571
+ "func": "function beforeSave(values, data) {\n return values; \n}"
572
572
  },
573
573
  {
574
574
  "key": "onSaveCallback",
575
575
  "name": "保存后回调",
576
576
  "desc": "保存后回调事件",
577
- "func": "(success, mainKey, res)=>{\n\t\n}"
577
+ "func": "function onSaveCallback(success, mainKey, res) {\n\t\n}"
578
578
  },
579
579
  {
580
580
  "key": "onUnmount",
581
581
  "name": "组件卸载时",
582
582
  "desc": "在组件卸载时,执行方法",
583
- "func": "(instance)=>{\n\t\n}"
583
+ "func": "function onUnmount(instance) {\n\t\n}"
584
584
  },
585
585
  {
586
586
  "key": "onValueChange",
587
587
  "name": "参数变化的事件",
588
588
  "desc": "参数变化时,执行方法",
589
- "func": "(change, data)=>{\n\t\n}"
589
+ "func": "function onValueChange(change, data) {\n\t\n}"
590
590
  },
591
591
  {
592
592
  "key": "onChildChange",
593
593
  "name": "表单内容发生改变时的回调",
594
594
  "desc": "表单内容发生改变时的回调",
595
- "func": "(instance)=>{\n\t\n}"
595
+ "func": "function onChildChange(instance) {\n\t\n}"
596
+ },
597
+ {
598
+ "key": "onPagePublicResourceChanged",
599
+ "name": "页面共享资源变化后",
600
+ "desc": "当页面共享资源发生变化后(pagePublicResourceChanged),执行方法",
601
+ "func": "function onPagePublicResourceChanged(resource, instance) {\n\t\n}"
596
602
  }
597
603
  ]
598
604
  }