aldehyde 0.2.97 → 0.2.99

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 (389) hide show
  1. package/LICENSE +1 -1
  2. package/lib/controls/action/index.d.ts +16 -7
  3. package/lib/controls/action/index.d.ts.map +1 -1
  4. package/lib/controls/action/index.js +64 -48
  5. package/lib/controls/action/index.js.map +1 -1
  6. package/lib/controls/action/utils.d.ts +1 -1
  7. package/lib/controls/action/utils.d.ts.map +1 -1
  8. package/lib/controls/action/utils.js +6 -4
  9. package/lib/controls/action/utils.js.map +1 -1
  10. package/lib/controls/auto-complete/index.d.ts +1 -1
  11. package/lib/controls/auto-complete/index.d.ts.map +1 -1
  12. package/lib/controls/auto-complete/index.js +12 -6
  13. package/lib/controls/auto-complete/index.js.map +1 -1
  14. package/lib/controls/chemstruc/graph.d.ts +13 -4
  15. package/lib/controls/chemstruc/graph.d.ts.map +1 -1
  16. package/lib/controls/chemstruc/graph.js +40 -27
  17. package/lib/controls/chemstruc/graph.js.map +1 -1
  18. package/lib/controls/color-picker/index.d.ts +11 -2
  19. package/lib/controls/color-picker/index.d.ts.map +1 -1
  20. package/lib/controls/color-picker/index.js +23 -19
  21. package/lib/controls/color-picker/index.js.map +1 -1
  22. package/lib/controls/cquery/cquick-button.d.ts +11 -2
  23. package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
  24. package/lib/controls/cquery/cquick-button.js +30 -28
  25. package/lib/controls/cquery/cquick-button.js.map +1 -1
  26. package/lib/controls/entity-select/entity-select.d.ts +12 -3
  27. package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
  28. package/lib/controls/entity-select/entity-select.js +66 -64
  29. package/lib/controls/entity-select/entity-select.js.map +1 -1
  30. package/lib/controls/entity-select/lab-tree-select.d.ts +11 -2
  31. package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -1
  32. package/lib/controls/entity-select/lab-tree-select.js +26 -21
  33. package/lib/controls/entity-select/lab-tree-select.js.map +1 -1
  34. package/lib/controls/entity-select/popover-entity-select.d.ts +11 -2
  35. package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
  36. package/lib/controls/entity-select/popover-entity-select.js +30 -26
  37. package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
  38. package/lib/controls/entry-control.d.ts +1 -1
  39. package/lib/controls/entry-control.d.ts.map +1 -1
  40. package/lib/controls/entry-control.js +152 -98
  41. package/lib/controls/entry-control.js.map +1 -1
  42. package/lib/controls/html-editor/tinymce.d.ts.map +1 -1
  43. package/lib/controls/input-number/index.d.ts +1 -1
  44. package/lib/controls/input-number/index.d.ts.map +1 -1
  45. package/lib/controls/input-number/index.js +31 -23
  46. package/lib/controls/input-number/index.js.map +1 -1
  47. package/lib/controls/input-range/index.d.ts +1 -1
  48. package/lib/controls/input-range/index.d.ts.map +1 -1
  49. package/lib/controls/input-range/index.js +9 -8
  50. package/lib/controls/input-range/index.js.map +1 -1
  51. package/lib/controls/password-setter/index.d.ts +9 -3
  52. package/lib/controls/password-setter/index.d.ts.map +1 -1
  53. package/lib/controls/password-setter/index.js +22 -14
  54. package/lib/controls/password-setter/index.js.map +1 -1
  55. package/lib/controls/progress/index.d.ts +1 -1
  56. package/lib/controls/progress/index.d.ts.map +1 -1
  57. package/lib/controls/progress/index.js +13 -6
  58. package/lib/controls/progress/index.js.map +1 -1
  59. package/lib/controls/relation-existion/index.d.ts +11 -2
  60. package/lib/controls/relation-existion/index.d.ts.map +1 -1
  61. package/lib/controls/relation-existion/index.js +30 -18
  62. package/lib/controls/relation-existion/index.js.map +1 -1
  63. package/lib/controls/rfield/index.d.ts +11 -2
  64. package/lib/controls/rfield/index.d.ts.map +1 -1
  65. package/lib/controls/rfield/index.js +33 -35
  66. package/lib/controls/rfield/index.js.map +1 -1
  67. package/lib/controls/signature/index.d.ts +10 -1
  68. package/lib/controls/signature/index.d.ts.map +1 -1
  69. package/lib/controls/signature/index.js +56 -31
  70. package/lib/controls/signature/index.js.map +1 -1
  71. package/lib/controls/steps/index.d.ts +1 -1
  72. package/lib/controls/steps/index.d.ts.map +1 -1
  73. package/lib/controls/steps/index.js +8 -6
  74. package/lib/controls/steps/index.js.map +1 -1
  75. package/lib/controls/text/ellipsis-text.d.ts +9 -0
  76. package/lib/controls/text/ellipsis-text.d.ts.map +1 -1
  77. package/lib/controls/text/ellipsis-text.js +13 -11
  78. package/lib/controls/text/ellipsis-text.js.map +1 -1
  79. package/lib/controls/upload/index.d.ts +10 -1
  80. package/lib/controls/upload/index.d.ts.map +1 -1
  81. package/lib/controls/upload/index.js +30 -21
  82. package/lib/controls/upload/index.js.map +1 -1
  83. package/lib/controls/view-control.d.ts +1 -1
  84. package/lib/controls/view-control.d.ts.map +1 -1
  85. package/lib/controls/view-control.js +118 -85
  86. package/lib/controls/view-control.js.map +1 -1
  87. package/lib/custom-page/def-custom-page.d.ts +5 -6
  88. package/lib/custom-page/def-custom-page.d.ts.map +1 -1
  89. package/lib/custom-page/def-custom-page.js +13 -12
  90. package/lib/custom-page/def-custom-page.js.map +1 -1
  91. package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts +10 -1
  92. package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts.map +1 -1
  93. package/lib/custom-page/dtmpl-custom-edit-modal-page.js +19 -7
  94. package/lib/custom-page/dtmpl-custom-edit-modal-page.js.map +1 -1
  95. package/lib/detail/button/bottom-submit-button-bar.d.ts +11 -2
  96. package/lib/detail/button/bottom-submit-button-bar.d.ts.map +1 -1
  97. package/lib/detail/button/bottom-submit-button-bar.js +20 -12
  98. package/lib/detail/button/bottom-submit-button-bar.js.map +1 -1
  99. package/lib/detail/button/cquery-button-bar.d.ts +12 -3
  100. package/lib/detail/button/cquery-button-bar.d.ts.map +1 -1
  101. package/lib/detail/button/cquery-button-bar.js +22 -18
  102. package/lib/detail/button/cquery-button-bar.js.map +1 -1
  103. package/lib/detail/button/fix-right-submit-button-bar.d.ts +11 -2
  104. package/lib/detail/button/fix-right-submit-button-bar.d.ts.map +1 -1
  105. package/lib/detail/button/fix-right-submit-button-bar.js +28 -23
  106. package/lib/detail/button/fix-right-submit-button-bar.js.map +1 -1
  107. package/lib/detail/edit/fields-edit-card.d.ts +11 -2
  108. package/lib/detail/edit/fields-edit-card.d.ts.map +1 -1
  109. package/lib/detail/edit/fields-edit-card.js +18 -19
  110. package/lib/detail/edit/fields-edit-card.js.map +1 -1
  111. package/lib/detail/edit/modal-row-edit.d.ts +11 -2
  112. package/lib/detail/edit/modal-row-edit.d.ts.map +1 -1
  113. package/lib/detail/edit/modal-row-edit.js +14 -11
  114. package/lib/detail/edit/modal-row-edit.js.map +1 -1
  115. package/lib/detail/edit/post-result/index.d.ts +1 -1
  116. package/lib/detail/edit/post-result/index.d.ts.map +1 -1
  117. package/lib/detail/edit/post-result/index.js +17 -12
  118. package/lib/detail/edit/post-result/index.js.map +1 -1
  119. package/lib/detail/edit/row-edit-card.d.ts +11 -2
  120. package/lib/detail/edit/row-edit-card.d.ts.map +1 -1
  121. package/lib/detail/edit/row-edit-card.js +23 -23
  122. package/lib/detail/edit/row-edit-card.js.map +1 -1
  123. package/lib/detail/rightbar/index.d.ts +12 -3
  124. package/lib/detail/rightbar/index.d.ts.map +1 -1
  125. package/lib/detail/rightbar/index.js +16 -9
  126. package/lib/detail/rightbar/index.js.map +1 -1
  127. package/lib/detail/view/act-dtmpl-view.d.ts +11 -2
  128. package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
  129. package/lib/detail/view/act-dtmpl-view.js +26 -25
  130. package/lib/detail/view/act-dtmpl-view.js.map +1 -1
  131. package/lib/detail/view/dtmpl-view.d.ts +2 -2
  132. package/lib/detail/view/dtmpl-view.d.ts.map +1 -1
  133. package/lib/detail/view/dtmpl-view.js +40 -40
  134. package/lib/detail/view/dtmpl-view.js.map +1 -1
  135. package/lib/detail/view/modal-dtmpl-view.d.ts +10 -1
  136. package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
  137. package/lib/detail/view/modal-dtmpl-view.js +11 -8
  138. package/lib/detail/view/modal-dtmpl-view.js.map +1 -1
  139. package/lib/detail/view/snapshot-timeline.d.ts +11 -2
  140. package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
  141. package/lib/detail/view/snapshot-timeline.js +18 -16
  142. package/lib/detail/view/snapshot-timeline.js.map +1 -1
  143. package/lib/exportor/export-frame.d.ts +11 -2
  144. package/lib/exportor/export-frame.d.ts.map +1 -1
  145. package/lib/exportor/export-frame.js +41 -42
  146. package/lib/exportor/export-frame.js.map +1 -1
  147. package/lib/form/criteria-form.d.ts +2 -2
  148. package/lib/form/criteria-form.d.ts.map +1 -1
  149. package/lib/form/criteria-form.js +58 -45
  150. package/lib/form/criteria-form.js.map +1 -1
  151. package/lib/form/dtmpl-form.d.ts +11 -2
  152. package/lib/form/dtmpl-form.d.ts.map +1 -1
  153. package/lib/form/dtmpl-form.js +76 -61
  154. package/lib/form/dtmpl-form.js.map +1 -1
  155. package/lib/form/field-group-form.d.ts +12 -3
  156. package/lib/form/field-group-form.d.ts.map +1 -1
  157. package/lib/form/field-group-form.js +26 -18
  158. package/lib/form/field-group-form.js.map +1 -1
  159. package/lib/form/form-Item-group.d.ts +10 -1
  160. package/lib/form/form-Item-group.d.ts.map +1 -1
  161. package/lib/form/form-Item-group.js +43 -26
  162. package/lib/form/form-Item-group.js.map +1 -1
  163. package/lib/import/excel-import.d.ts +12 -3
  164. package/lib/import/excel-import.d.ts.map +1 -1
  165. package/lib/import/excel-import.js +69 -55
  166. package/lib/import/excel-import.js.map +1 -1
  167. package/lib/index.d.ts +42 -39
  168. package/lib/index.d.ts.map +1 -1
  169. package/lib/index.js +43 -39
  170. package/lib/index.js.map +1 -1
  171. package/lib/layout/MainPage.d.ts +1 -1
  172. package/lib/layout/MainPage.d.ts.map +1 -1
  173. package/lib/layout/MainPage.js +46 -36
  174. package/lib/layout/MainPage.js.map +1 -1
  175. package/lib/layout/footer/index.d.ts.map +1 -1
  176. package/lib/layout/header/index.d.ts +1 -1
  177. package/lib/layout/header/index.d.ts.map +1 -1
  178. package/lib/layout/header/index.js +16 -14
  179. package/lib/layout/header/index.js.map +1 -1
  180. package/lib/layout/menu/l2menu-quick-bar.d.ts +11 -2
  181. package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
  182. package/lib/layout/menu/l2menu-quick-bar.js +24 -19
  183. package/lib/layout/menu/l2menu-quick-bar.js.map +1 -1
  184. package/lib/layout/menu/reset-password.d.ts +12 -3
  185. package/lib/layout/menu/reset-password.d.ts.map +1 -1
  186. package/lib/layout/menu/reset-password.js +52 -36
  187. package/lib/layout/menu/reset-password.js.map +1 -1
  188. package/lib/layout/menu/user-bar.d.ts +12 -3
  189. package/lib/layout/menu/user-bar.d.ts.map +1 -1
  190. package/lib/layout/menu/user-bar.js +72 -42
  191. package/lib/layout/menu/user-bar.js.map +1 -1
  192. package/lib/layout/menu/userinfo-bar.d.ts +10 -1
  193. package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
  194. package/lib/layout/menu/userinfo-bar.js +11 -10
  195. package/lib/layout/menu/userinfo-bar.js.map +1 -1
  196. package/lib/layout/sidebar/index.css +15 -4
  197. package/lib/layout/sidebar/index.d.ts +2 -2
  198. package/lib/layout/sidebar/index.d.ts.map +1 -1
  199. package/lib/layout/sidebar/index.js +19 -13
  200. package/lib/layout/sidebar/index.js.map +1 -1
  201. package/lib/locale/LocaleButton.d.ts +4 -0
  202. package/lib/locale/LocaleButton.d.ts.map +1 -0
  203. package/lib/locale/LocaleButton.js +24 -0
  204. package/lib/locale/LocaleButton.js.map +1 -0
  205. package/lib/locale/LocaleProvider.d.ts +13 -0
  206. package/lib/locale/LocaleProvider.d.ts.map +1 -0
  207. package/lib/locale/LocaleProvider.js +135 -0
  208. package/lib/locale/LocaleProvider.js.map +1 -0
  209. package/lib/locale/langMp.d.ts +16 -0
  210. package/lib/locale/langMp.d.ts.map +1 -0
  211. package/lib/locale/langMp.js +29 -0
  212. package/lib/locale/langMp.js.map +1 -0
  213. package/lib/locale/translate.d.ts +3 -0
  214. package/lib/locale/translate.d.ts.map +1 -0
  215. package/lib/locale/translate.js +74 -0
  216. package/lib/locale/translate.js.map +1 -0
  217. package/lib/locale/useLocale.d.ts +14 -0
  218. package/lib/locale/useLocale.d.ts.map +1 -0
  219. package/lib/locale/useLocale.js +34 -0
  220. package/lib/locale/useLocale.js.map +1 -0
  221. package/lib/login/login.d.ts +13 -3
  222. package/lib/login/login.d.ts.map +1 -1
  223. package/lib/login/login.js +38 -25
  224. package/lib/login/login.js.map +1 -1
  225. package/lib/login/router-login.d.ts +2 -2
  226. package/lib/login/router-login.d.ts.map +1 -1
  227. package/lib/login/router-login.js +33 -19
  228. package/lib/login/router-login.js.map +1 -1
  229. package/lib/module/dtmpl-edit-card.d.ts +11 -2
  230. package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
  231. package/lib/module/dtmpl-edit-card.js +21 -13
  232. package/lib/module/dtmpl-edit-card.js.map +1 -1
  233. package/lib/module/dtmpl-edit-page.d.ts +12 -3
  234. package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
  235. package/lib/module/dtmpl-edit-page.js +42 -31
  236. package/lib/module/dtmpl-edit-page.js.map +1 -1
  237. package/lib/module/ltmpl-modal.d.ts +10 -1
  238. package/lib/module/ltmpl-modal.d.ts.map +1 -1
  239. package/lib/module/ltmpl-modal.js +15 -8
  240. package/lib/module/ltmpl-modal.js.map +1 -1
  241. package/lib/module/ltmpl-table.d.ts +11 -2
  242. package/lib/module/ltmpl-table.d.ts.map +1 -1
  243. package/lib/module/ltmpl-table.js +39 -39
  244. package/lib/module/ltmpl-table.js.map +1 -1
  245. package/lib/table/act-table.d.ts +12 -3
  246. package/lib/table/act-table.d.ts.map +1 -1
  247. package/lib/table/act-table.js +256 -205
  248. package/lib/table/act-table.js.map +1 -1
  249. package/lib/table/control-table-x-axis-wrapper.d.ts +5 -0
  250. package/lib/table/control-table-x-axis-wrapper.d.ts.map +1 -0
  251. package/lib/table/control-table-x-axis-wrapper.js +60 -0
  252. package/lib/table/control-table-x-axis-wrapper.js.map +1 -0
  253. package/lib/table/l2-act-table.d.ts +1 -1
  254. package/lib/table/pagination.d.ts +11 -2
  255. package/lib/table/pagination.d.ts.map +1 -1
  256. package/lib/table/pagination.js +13 -12
  257. package/lib/table/pagination.js.map +1 -1
  258. package/lib/table/query-table.d.ts.map +1 -1
  259. package/lib/table/query-table.js +2 -1
  260. package/lib/table/query-table.js.map +1 -1
  261. package/lib/table/relation-table.d.ts +13 -4
  262. package/lib/table/relation-table.d.ts.map +1 -1
  263. package/lib/table/relation-table.js +117 -108
  264. package/lib/table/relation-table.js.map +1 -1
  265. package/lib/table/selected-rows-card.d.ts +10 -1
  266. package/lib/table/selected-rows-card.d.ts.map +1 -1
  267. package/lib/table/selected-rows-card.js +10 -9
  268. package/lib/table/selected-rows-card.js.map +1 -1
  269. package/lib/table/stat/restat.d.ts +10 -1
  270. package/lib/table/stat/restat.d.ts.map +1 -1
  271. package/lib/table/stat/restat.js +10 -9
  272. package/lib/table/stat/restat.js.map +1 -1
  273. package/lib/tmpl/hc-data-source.d.ts.map +1 -1
  274. package/lib/tmpl/hc-data-source.js +21 -14
  275. package/lib/tmpl/hc-data-source.js.map +1 -1
  276. package/lib/tmpl/hcservice-v3.d.ts +2 -0
  277. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  278. package/lib/tmpl/hcservice-v3.js +127 -100
  279. package/lib/tmpl/hcservice-v3.js.map +1 -1
  280. package/lib/tmpl/model-struc-v3.d.ts.map +1 -1
  281. package/lib/tmpl/model-struc-v3.js +19 -18
  282. package/lib/tmpl/model-struc-v3.js.map +1 -1
  283. package/lib/tmpl/superagent.d.ts +2 -2
  284. package/lib/tmpl/superagent.d.ts.map +1 -1
  285. package/lib/tmpl/superagent.js +28 -23
  286. package/lib/tmpl/superagent.js.map +1 -1
  287. package/lib/tree/act-tree.d.ts +10 -1
  288. package/lib/tree/act-tree.d.ts.map +1 -1
  289. package/lib/tree/act-tree.js +26 -20
  290. package/lib/tree/act-tree.js.map +1 -1
  291. package/lib/tree/tmpl-tree.d.ts +11 -2
  292. package/lib/tree/tmpl-tree.d.ts.map +1 -1
  293. package/lib/tree/tmpl-tree.js +76 -58
  294. package/lib/tree/tmpl-tree.js.map +1 -1
  295. package/lib/units/index.d.ts.map +1 -1
  296. package/lib/welcome/HCWelcome.js +7 -23
  297. package/lib/welcome/HCWelcome.js.map +1 -1
  298. package/lib/welcome/HCWelcome1.d.ts +4 -0
  299. package/lib/welcome/HCWelcome1.d.ts.map +1 -0
  300. package/lib/welcome/HCWelcome1.js +192 -0
  301. package/lib/welcome/HCWelcome1.js.map +1 -0
  302. package/lib/welcome/quick-entrance.d.ts +12 -3
  303. package/lib/welcome/quick-entrance.d.ts.map +1 -1
  304. package/lib/welcome/quick-entrance.js +21 -17
  305. package/lib/welcome/quick-entrance.js.map +1 -1
  306. package/lib/welcome/workbench.d.ts +12 -3
  307. package/lib/welcome/workbench.d.ts.map +1 -1
  308. package/lib/welcome/workbench.js +23 -19
  309. package/lib/welcome/workbench.js.map +1 -1
  310. package/package.json +1 -1
  311. package/src/aldehyde/controls/action/index.tsx +328 -221
  312. package/src/aldehyde/controls/action/utils.tsx +6 -4
  313. package/src/aldehyde/controls/auto-complete/index.tsx +64 -60
  314. package/src/aldehyde/controls/chemstruc/graph.tsx +175 -139
  315. package/src/aldehyde/controls/color-picker/index.tsx +107 -78
  316. package/src/aldehyde/controls/cquery/cquick-button.tsx +129 -89
  317. package/src/aldehyde/controls/entity-select/entity-select.tsx +643 -521
  318. package/src/aldehyde/controls/entity-select/lab-tree-select.tsx +140 -131
  319. package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +178 -133
  320. package/src/aldehyde/controls/entry-control.tsx +373 -248
  321. package/src/aldehyde/controls/input-number/index.tsx +131 -86
  322. package/src/aldehyde/controls/input-range/index.tsx +51 -40
  323. package/src/aldehyde/controls/password-setter/index.js +81 -63
  324. package/src/aldehyde/controls/progress/index.tsx +59 -46
  325. package/src/aldehyde/controls/relation-existion/index.tsx +125 -87
  326. package/src/aldehyde/controls/rfield/index.tsx +178 -151
  327. package/src/aldehyde/controls/signature/index.tsx +215 -151
  328. package/src/aldehyde/controls/steps/index.tsx +44 -42
  329. package/src/aldehyde/controls/text/ellipsis-text.tsx +79 -53
  330. package/src/aldehyde/controls/upload/index.tsx +125 -109
  331. package/src/aldehyde/controls/view-control.tsx +250 -188
  332. package/src/aldehyde/custom-page/def-custom-page.tsx +17 -0
  333. package/src/aldehyde/custom-page/dtmpl-custom-edit-modal-page.tsx +75 -66
  334. package/src/aldehyde/detail/button/bottom-submit-button-bar.tsx +79 -43
  335. package/src/aldehyde/detail/button/cquery-button-bar.tsx +129 -98
  336. package/src/aldehyde/detail/button/fix-right-submit-button-bar.tsx +161 -113
  337. package/src/aldehyde/detail/edit/fields-edit-card.tsx +124 -87
  338. package/src/aldehyde/detail/edit/modal-row-edit.tsx +81 -60
  339. package/src/aldehyde/detail/edit/post-result/index.tsx +80 -47
  340. package/src/aldehyde/detail/edit/row-edit-card.tsx +158 -107
  341. package/src/aldehyde/detail/rightbar/index.tsx +79 -63
  342. package/src/aldehyde/detail/view/act-dtmpl-view.tsx +177 -124
  343. package/src/aldehyde/detail/view/dtmpl-view.tsx +284 -178
  344. package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +67 -54
  345. package/src/aldehyde/detail/view/snapshot-timeline.tsx +143 -110
  346. package/src/aldehyde/exportor/export-frame.tsx +258 -200
  347. package/src/aldehyde/form/criteria-form.tsx +309 -201
  348. package/src/aldehyde/form/dtmpl-form.tsx +460 -305
  349. package/src/aldehyde/form/field-group-form.tsx +87 -66
  350. package/src/aldehyde/form/form-Item-group.tsx +190 -132
  351. package/src/aldehyde/import/excel-import.tsx +414 -331
  352. package/src/aldehyde/index.tsx +90 -45
  353. package/src/aldehyde/layout/MainPage.tsx +280 -245
  354. package/src/aldehyde/layout/header/index.tsx +59 -53
  355. package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +137 -118
  356. package/src/aldehyde/layout/menu/reset-password.tsx +213 -162
  357. package/src/aldehyde/layout/menu/user-bar.tsx +216 -147
  358. package/src/aldehyde/layout/menu/userinfo-bar.tsx +58 -41
  359. package/src/aldehyde/layout/sidebar/index.css +15 -4
  360. package/src/aldehyde/layout/sidebar/index.tsx +66 -38
  361. package/src/aldehyde/locale/LocaleButton.tsx +31 -0
  362. package/src/aldehyde/locale/LocaleProvider.tsx +165 -0
  363. package/src/aldehyde/locale/langMp.ts +33 -0
  364. package/src/aldehyde/locale/translate.ts +78 -0
  365. package/src/aldehyde/locale/useLocale.ts +50 -0
  366. package/src/aldehyde/login/login.tsx +192 -141
  367. package/src/aldehyde/login/router-login.tsx +54 -21
  368. package/src/aldehyde/module/dtmpl-edit-card.tsx +225 -160
  369. package/src/aldehyde/module/dtmpl-edit-page.tsx +334 -212
  370. package/src/aldehyde/module/ltmpl-modal.tsx +57 -53
  371. package/src/aldehyde/module/ltmpl-table.tsx +329 -240
  372. package/src/aldehyde/table/act-table.tsx +1226 -794
  373. package/src/aldehyde/table/control-table-x-axis-wrapper.tsx +52 -0
  374. package/src/aldehyde/table/pagination.tsx +66 -59
  375. package/src/aldehyde/table/query-table.tsx +2 -1
  376. package/src/aldehyde/table/relation-table.tsx +781 -571
  377. package/src/aldehyde/table/selected-rows-card.tsx +61 -48
  378. package/src/aldehyde/table/stat/restat.tsx +112 -69
  379. package/src/aldehyde/tmpl/hc-data-source.tsx +381 -296
  380. package/src/aldehyde/tmpl/hcservice-v3.tsx +991 -796
  381. package/src/aldehyde/tmpl/model-struc-v3.tsx +95 -91
  382. package/src/aldehyde/tmpl/superagent.js +148 -142
  383. package/src/aldehyde/tree/act-tree.tsx +206 -138
  384. package/src/aldehyde/tree/tmpl-tree.tsx +611 -353
  385. package/src/aldehyde/welcome/HCWelcome.js +78 -110
  386. package/src/aldehyde/welcome/HCWelcome1.js +260 -0
  387. package/src/aldehyde/welcome/quick-entrance.tsx +82 -71
  388. package/src/aldehyde/welcome/workbench.tsx +83 -68
  389. package/src/aldehyde/custom-page/def-custom-page.js +0 -18
@@ -1,565 +1,687 @@
1
- import * as React from 'react'
2
- import {Button, Col, Divider, message, Row, Select, Spin, Tag} from 'antd'
3
- import {EControlProps, LtmplConfig, PageInfo, QueryData, QueryKey,} from "../../tmpl/interface";
1
+ import * as React from "react";
2
+ import { Button, Col, Divider, message, Row, Select, Spin, Tag } from "antd";
4
3
  import {
5
- AlignLeftOutlined,
6
- EditOutlined,
7
- PlusOutlined,
8
- RedoOutlined,
9
- SearchOutlined,
10
- TableOutlined
11
- } from '@ant-design/icons';
12
- import debounce from 'lodash/debounce';
13
- import './index.css';
4
+ EControlProps,
5
+ LtmplConfig,
6
+ PageInfo,
7
+ QueryData,
8
+ QueryKey,
9
+ } from "../../tmpl/interface";
10
+ import {
11
+ AlignLeftOutlined,
12
+ EditOutlined,
13
+ PlusOutlined,
14
+ RedoOutlined,
15
+ SearchOutlined,
16
+ TableOutlined,
17
+ } from "@ant-design/icons";
18
+ import debounce from "lodash/debounce";
19
+ import "./index.css";
14
20
  import HcserviceV3 from "../../tmpl/hcservice-v3";
15
21
  import HCDataSource from "../../tmpl/hc-data-source";
16
22
  import DtmplViewDrawer from "../../module/dtmpl-view-drawer";
17
23
  import DtmplEditPage from "../../module/dtmpl-edit-page";
18
- import {CustomTagProps} from 'rc-select/lib/BaseSelect';
24
+ import { CustomTagProps } from "rc-select/lib/BaseSelect";
19
25
  import DtmplCustomEditModalPage from "../../custom-page/dtmpl-custom-edit-modal-page";
20
- import {LtmplModal} from "../../index";
21
-
26
+ import { LtmplModal } from "../../index";
27
+ import { LocaleContext } from "../../locale/LocaleProvider";
22
28
 
23
29
  interface InnerEntitySelectProps extends EControlProps {
24
- maxSelected?: number,
25
- onEntityClick?: (code: string) => void,
26
- baseCriteria: object,
27
-
28
- };
30
+ maxSelected?: number;
31
+ onEntityClick?: (code: string) => void;
32
+ baseCriteria: object;
33
+ }
29
34
 
30
35
  interface InnerEntitySelectState {
31
- titleId?: string,
32
- optionCacheKey?: string,
33
- pageNo?: number,
34
- loading?: boolean,
35
- optionsCache?: object;
36
- codeLabel?: object;
37
- ltmplConfig?: LtmplConfig,
38
- showView?: boolean,
39
- drawCode?: string,
40
- showEdit?: boolean,
41
- showTable?: boolean,
42
- preMainCode?: string,
43
- };
36
+ titleId?: string;
37
+ optionCacheKey?: string;
38
+ pageNo?: number;
39
+ loading?: boolean;
40
+ optionsCache?: object;
41
+ codeLabel?: object;
42
+ ltmplConfig?: LtmplConfig;
43
+ showView?: boolean;
44
+ drawCode?: string;
45
+ showEdit?: boolean;
46
+ showTable?: boolean;
47
+ preMainCode?: string;
48
+ }
44
49
 
45
50
  type OptionCache = {
46
- queryKey?: QueryKey,
47
- pageInfo?: PageInfo,
48
- touchEnd?: boolean,
49
- options?: any,
50
- searchValue?: string,
51
- optionCacheKey?: string,
52
- }
51
+ queryKey?: QueryKey;
52
+ pageInfo?: PageInfo;
53
+ touchEnd?: boolean;
54
+ options?: any;
55
+ searchValue?: string;
56
+ optionCacheKey?: string;
57
+ };
53
58
 
54
59
  type LoadDataSource = {
55
- options: any[],
56
- touchEnd: boolean,
57
-
58
- }
59
-
60
- export default class EntitySelect extends React.PureComponent<InnerEntitySelectProps, InnerEntitySelectState> {
60
+ options: any[];
61
+ touchEnd: boolean;
62
+ };
61
63
 
62
- static defaultProps = {
63
- maxSelected: 100,
64
+ export default class EntitySelect extends React.PureComponent<
65
+ InnerEntitySelectProps,
66
+ InnerEntitySelectState
67
+ > {
68
+ static defaultProps = {
69
+ maxSelected: 100,
70
+ };
71
+
72
+ state = {
73
+ titleId: undefined,
74
+ optionCacheKey: undefined,
75
+ pageNo: 1,
76
+ loading: false,
77
+ optionsCache: {},
78
+ codeLabel: {},
79
+ ltmplConfig: undefined,
80
+ showView: false,
81
+ showEdit: false,
82
+ showTable: false,
83
+ drawCode: undefined,
84
+ preMainCode: undefined,
85
+ };
86
+ static contextType = LocaleContext;
87
+ context: React.ContextType<typeof LocaleContext>;
88
+
89
+ dropdownRender = (menu) => {
90
+ const { fieldConfig } = this.props;
91
+ const { actions } = fieldConfig;
92
+ // console.log("menu",menu);
93
+ return (
94
+ <>
95
+ {menu}
96
+ {
97
+ <>
98
+ <Divider style={{ margin: "8px 0" }} />
99
+ <Row justify="end">
100
+ {actions && actions.indexOf("table") >= 0 ? (
101
+ <Col>
102
+ <Button
103
+ type="text"
104
+ icon={<TableOutlined style={{ color: "#0958d9" }} />}
105
+ onClick={() => this.showTable()}
106
+ ></Button>
107
+ </Col>
108
+ ) : null}
109
+ {actions && actions.indexOf("add") >= 0 ? (
110
+ <Col>
111
+ <Button
112
+ type="text"
113
+ icon={<PlusOutlined style={{ color: "#0958d9" }} />}
114
+ onClick={() => this.editItem()}
115
+ ></Button>
116
+ </Col>
117
+ ) : null}
118
+ <Col>
119
+ <Button
120
+ type="text"
121
+ icon={<RedoOutlined style={{ color: "#0958d9" }} />}
122
+ onClick={() => this.initCache()}
123
+ ></Button>
124
+ </Col>
125
+ </Row>
126
+ </>
127
+ }
128
+ </>
129
+ );
130
+ };
131
+
132
+ editItem = async (code?) => {
133
+ let ltmplConfig = await this.loadLtmplConfig();
134
+ this.setState({
135
+ showEdit: true,
136
+ showTable: false,
137
+ showView: false,
138
+ drawCode: code,
139
+ ltmplConfig,
140
+ });
141
+ };
142
+
143
+ showTable = async () => {
144
+ this.setState({
145
+ showEdit: false,
146
+ showTable: true,
147
+ showView: false,
148
+ drawCode: undefined,
149
+ });
150
+ };
151
+
152
+ loadLtmplConfig = async () => {
153
+ const { fieldConfig, serverKey } = this.props;
154
+ const { ltmplConfig } = this.state;
155
+ let ltmplConfig_ = ltmplConfig;
156
+ if (!ltmplConfig_) {
157
+ ltmplConfig_ = (
158
+ await HCDataSource.requestLtmplConfig(
159
+ fieldConfig.serverKey ? fieldConfig.serverKey : serverKey,
160
+ fieldConfig.sourceId ? fieldConfig.sourceId : fieldConfig.id
161
+ )
162
+ ).ltmplConfig;
64
163
  }
65
-
66
- state = {
67
- titleId: undefined,
68
- optionCacheKey: undefined,
69
- pageNo: 1,
70
- loading: false,
71
- optionsCache: {},
72
- codeLabel: {},
73
- ltmplConfig: undefined,
74
- showView: false,
75
- showEdit: false,
76
- showTable: false,
77
- drawCode: undefined,
78
- preMainCode: undefined,
164
+ this.setState({
165
+ ltmplConfig: ltmplConfig_,
166
+ });
167
+ return ltmplConfig_;
168
+ };
169
+
170
+ showItem = async (code) => {
171
+ let ltmplConfig = await this.loadLtmplConfig();
172
+
173
+ this.setState({
174
+ showEdit: false,
175
+ showTable: false,
176
+ showView: true,
177
+ drawCode: code,
178
+ ltmplConfig,
179
+ });
180
+ };
181
+
182
+ componentDidUpdate(prevProps) {
183
+ const { baseCriteria, mainCode, fieldConfig } = this.props;
184
+ let {
185
+ baseCriteria: preBaseCriteria,
186
+ mainCode: preMainCode,
187
+ fieldConfig: preFieldConfig,
188
+ } = prevProps;
189
+ if (
190
+ (baseCriteria &&
191
+ JSON.stringify(baseCriteria) != JSON.stringify(preBaseCriteria)) ||
192
+ (mainCode && mainCode != preMainCode) ||
193
+ (fieldConfig && preFieldConfig && fieldConfig.id != preFieldConfig.id)
194
+ ) {
195
+ this.initCache();
79
196
  }
80
- dropdownRender = (menu) => {
81
- const {fieldConfig} = this.props;
82
- const {actions} = fieldConfig;
83
- // console.log("menu",menu);
84
- return <>
85
- {menu}
86
- {
87
- <>
88
- <Divider style={{margin: '8px 0'}}/>
89
- <Row justify="end">
90
- {actions && actions.indexOf('table') >= 0 ?
91
- <Col>
92
- <Button type="text" icon={<TableOutlined style={{color: '#0958d9'}}/>}
93
- onClick={() => this.showTable()}>
94
- </Button>
95
- </Col> : null}
96
- {actions && actions.indexOf('add') >= 0 ?
97
- <Col>
98
- <Button type="text" icon={<PlusOutlined style={{color: '#0958d9'}}/>}
99
- onClick={() => this.editItem()}>
100
- </Button>
101
- </Col> : null}
102
- <Col>
103
- <Button type="text" icon={<RedoOutlined style={{color: '#0958d9'}}/>}
104
- onClick={() => this.initCache()}>
105
- </Button>
106
- </Col>
107
- </Row></>}
197
+ }
198
+
199
+ initCache = () => {
200
+ this.setState({
201
+ optionsCache: {},
202
+ codeLabel: {},
203
+ });
204
+ };
205
+
206
+ // componentWillUnmount(): void {
207
+ // this.setState=(state,callback)=>{
208
+ // return
209
+ // }
210
+ // }
211
+
212
+ toOption = (code: string, title: string, onEntityClick) => {
213
+ const { fieldConfig } = this.props;
214
+ const { actions } = fieldConfig;
215
+ const { codeLabel } = this.state;
216
+ codeLabel[code] = title;
217
+ let option = {
218
+ value: code,
219
+ label: (
220
+ <>
221
+ {title}
222
+ {actions && actions.indexOf("detail") >= 0 ? (
223
+ <Button
224
+ size={"small"}
225
+ type={"text"}
226
+ onClick={(event) => {
227
+ event.stopPropagation();
228
+ this.showItem(code);
229
+ }}
230
+ >
231
+ <AlignLeftOutlined style={{ color: "#0958d9" }} />
232
+ </Button>
233
+ ) : null}
234
+
235
+ {actions && actions.indexOf("edit") >= 0 ? (
236
+ <Button
237
+ size={"small"}
238
+ type={"text"}
239
+ onClick={(event) => {
240
+ event.stopPropagation();
241
+ this.editItem(code);
242
+ }}
243
+ >
244
+ <EditOutlined style={{ color: "#0958d9" }} />
245
+ </Button>
246
+ ) : null}
108
247
  </>
248
+ ),
109
249
  };
110
-
111
- editItem = async (code?) => {
112
- let ltmplConfig = await this.loadLtmplConfig();
113
- this.setState({
114
- showEdit: true,
115
- showTable: false,
116
- showView: false,
117
- drawCode: code,
118
- ltmplConfig,
119
- });
120
- }
121
-
122
- showTable = async () => {
123
- this.setState({
124
- showEdit: false,
125
- showTable: true,
126
- showView: false,
127
- drawCode: undefined,
128
- });
129
- }
130
-
131
- loadLtmplConfig = async () => {
132
- const {fieldConfig, serverKey} = this.props;
133
- const {ltmplConfig} = this.state;
134
- let ltmplConfig_ = ltmplConfig;
135
- if (!ltmplConfig_) {
136
- ltmplConfig_ = (await HCDataSource.requestLtmplConfig(fieldConfig.serverKey ? fieldConfig.serverKey : serverKey, fieldConfig.sourceId?fieldConfig.sourceId:fieldConfig.id)).ltmplConfig;
250
+ return option;
251
+ };
252
+
253
+ doClose = () => {
254
+ this.setState({
255
+ drawCode: undefined,
256
+ showEdit: false,
257
+ showView: false,
258
+ showTable: false,
259
+ });
260
+ };
261
+
262
+ drawSubmited = () => {
263
+ this.initCache();
264
+ this.doClose();
265
+ };
266
+
267
+ closeTable = () => {
268
+ this.drawSubmited();
269
+ };
270
+
271
+ toValueArray = (value) => {
272
+ let result = [];
273
+ let valueArray = this.toArray(value);
274
+ for (let v of valueArray) {
275
+ if (v) {
276
+ let vs = v.split("@R@");
277
+ if (vs[1] != "null") {
278
+ result.push(vs[0]);
137
279
  }
138
- this.setState({
139
- ltmplConfig: ltmplConfig_
140
- });
141
- return ltmplConfig_;
142
- }
143
-
144
- showItem = async (code) => {
145
-
146
- let ltmplConfig = await this.loadLtmplConfig();
147
-
148
- this.setState({
149
- showEdit: false,
150
- showTable: false,
151
- showView: true,
152
- drawCode: code,
153
- ltmplConfig,
154
- });
280
+ }
155
281
  }
156
-
157
-
158
- componentDidUpdate(prevProps) {
159
- const {baseCriteria, mainCode, fieldConfig} = this.props;
160
- let {baseCriteria: preBaseCriteria, mainCode: preMainCode, fieldConfig: preFieldConfig} = prevProps;
161
- if ((baseCriteria && JSON.stringify(baseCriteria) != JSON.stringify(preBaseCriteria)) || (mainCode && mainCode != preMainCode)
162
- || (fieldConfig && preFieldConfig && fieldConfig.id != preFieldConfig.id)) {
163
- this.initCache();
164
- }
282
+ return result;
283
+ };
284
+
285
+ toArray = (value) => {
286
+ let valueArray: string[] = [];
287
+ if (value instanceof Array) {
288
+ valueArray = value;
289
+ } else {
290
+ if (value) {
291
+ valueArray = value.split(",");
292
+ } else {
293
+ valueArray = [];
294
+ }
165
295
  }
166
296
 
167
- initCache = () => {
168
- this.setState({
169
- optionsCache: {},
170
- codeLabel: {}
171
- })
172
- }
297
+ return valueArray;
298
+ };
173
299
 
300
+ toOptions = (value, onEntityClick) => {
301
+ const { fieldConfig } = this.props;
302
+ let options: object[] = [];
303
+ //console.log('options value', value);
174
304
 
175
- // componentWillUnmount(): void {
176
- // this.setState=(state,callback)=>{
177
- // return
178
- // }
179
- // }
180
-
181
-
182
- toOption = (code: string, title: string, onEntityClick) => {
183
- const {fieldConfig} = this.props;
184
- const {actions} = fieldConfig;
185
- const {codeLabel} = this.state;
186
- codeLabel[code] = title;
187
- let option = {
188
- value: code,
189
- label: <>
190
- {title}
191
- {actions && actions.indexOf("detail") >= 0 ?
192
- <Button size={'small'} type={'text'} onClick={(event) => {
193
- event.stopPropagation();
194
- this.showItem(code);
195
- }}><AlignLeftOutlined style={{color: '#0958d9'}}/></Button> : null}
196
-
197
- {actions && actions.indexOf("edit") >= 0 ?
198
- <Button size={'small'} type={'text'} onClick={(event) => {
199
- event.stopPropagation();
200
- this.editItem(code);
201
- }}><EditOutlined style={{color: '#0958d9'}}/></Button>
202
- : null}
203
- </>,
204
- };
205
- return option;
206
- }
207
-
208
- doClose = () => {
209
- this.setState({
210
- drawCode: undefined,
211
- showEdit: false,
212
- showView: false,
213
- showTable: false,
214
- })
215
-
216
- }
217
-
218
- drawSubmited = () => {
219
- this.initCache();
220
- this.doClose();
221
- }
222
-
223
- closeTable = () => {
224
- this.drawSubmited();
225
- }
226
-
227
- toValueArray = (value) => {
228
- let result = [];
229
- let valueArray = this.toArray(value);
230
- for (let v of valueArray) {
231
- if (v) {
232
- let vs = v.split("@R@");
233
- if (vs[1] != 'null') {
234
- result.push(vs[0]);
235
- }
236
- }
305
+ let valueArray: string[] = this.toArray(value);
306
+ for (let v of valueArray) {
307
+ if (v) {
308
+ let vs = v.split("@R@");
309
+ if (vs[1] != "null") {
310
+ options.push(this.toOption(vs[0], vs[1], onEntityClick));
237
311
  }
238
- return result;
312
+ }
239
313
  }
240
314
 
241
- toArray = (value) => {
242
- let valueArray: string[] = [];
243
- if (value instanceof Array) {
244
- valueArray = value;
245
- } else {
246
- if (value) {
247
- valueArray = value.split(',');
248
- } else {
249
- valueArray = [];
250
- }
315
+ //添加补充项
316
+ if (fieldConfig.suppleOptions) {
317
+ fieldConfig.suppleOptions.forEach((o) => {
318
+ let had = false;
319
+ options.forEach((s) => {
320
+ if (s["value"] == o.code) {
321
+ had = true;
322
+ return;
323
+ }
324
+ });
325
+ if (!had) {
326
+ options.push(this.toOption(o.code, o.title, undefined));
251
327
  }
252
-
253
- return valueArray;
328
+ });
254
329
  }
255
-
256
- toOptions = (value, onEntityClick) => {
257
- const {fieldConfig} = this.props;
258
- let options: object[] = [];
259
- //console.log('options value', value);
260
-
261
- let valueArray: string[] = this.toArray(value);
262
- for (let v of valueArray) {
263
- if (v) {
264
- let vs = v.split("@R@");
265
- if (vs[1] != 'null') {
266
- options.push(this.toOption(vs[0], vs[1], onEntityClick));
267
- }
268
- }
269
- }
270
-
271
- //添加补充项
272
- if (fieldConfig.suppleOptions) {
273
- fieldConfig.suppleOptions.forEach((o) => {
274
- let had = false;
275
- options.forEach((s) => {
276
- if (s['value'] == o.code) {
277
- had = true;
278
- return;
279
- }
280
- })
281
- if (!had) {
282
- options.push(this.toOption(o.code, o.title, undefined));
283
- }
284
- })
285
- }
286
- //console.log('options', options);
287
- return options;
330
+ //console.log('options', options);
331
+ return options;
332
+ };
333
+
334
+ fetchNextPage = async () => {
335
+ const { optionCacheKey, titleId, optionsCache } = this.state;
336
+ let optionCache = optionsCache[optionCacheKey];
337
+ let pageInfo = optionCache.pageInfo;
338
+ if (!optionCache.touchEnd) {
339
+ pageInfo.pageNo = pageInfo.pageNo + 1;
340
+ let dataSource = await this.loadData(
341
+ optionCache.queryKey.key,
342
+ { ...pageInfo },
343
+ titleId
344
+ );
345
+ if (dataSource) {
346
+ optionCache.options = [...optionCache.options, ...dataSource.options];
347
+ optionCache.touchEnd = dataSource.touchEnd;
348
+ }
349
+ this.setState({
350
+ pageNo: pageInfo.pageNo,
351
+ });
288
352
  }
289
-
290
- fetchNextPage = async () => {
291
- const {optionCacheKey, titleId, optionsCache} = this.state;
292
- let optionCache = optionsCache[optionCacheKey];
293
- let pageInfo = optionCache.pageInfo;
294
- if (!optionCache.touchEnd) {
295
- pageInfo.pageNo = pageInfo.pageNo + 1;
296
- let dataSource = await this.loadData(optionCache.queryKey.key, {...pageInfo}, titleId);
297
- if (dataSource) {
298
- optionCache.options = [...optionCache.options, ...dataSource.options];
299
- optionCache.touchEnd = dataSource.touchEnd;
300
- }
301
- this.setState({
302
- pageNo: pageInfo.pageNo,
303
- })
304
- }
353
+ };
354
+
355
+ fetchOptions = async (searchText) => {
356
+ const { fieldConfig, mainCode, baseCriteria, serverKey } = this.props;
357
+ const { optionsCache, ltmplConfig, preMainCode } = this.state;
358
+ const currentMainCode = mainCode ? mainCode : fieldConfig.mainCode;
359
+ if (preMainCode != currentMainCode) {
360
+ this.setState({ preMainCode: currentMainCode.toString() });
361
+ //清空,
362
+ this.initCache();
305
363
  }
306
364
 
307
- fetchOptions = async (searchText) => {
308
- const {fieldConfig, mainCode, baseCriteria, serverKey} = this.props;
309
- const {optionsCache, ltmplConfig, preMainCode} = this.state;
310
- const currentMainCode = mainCode ? mainCode : fieldConfig.mainCode
311
- if (preMainCode != currentMainCode) {
312
- this.setState({preMainCode: currentMainCode.toString()})
313
- //清空,
314
- this.initCache();
315
- }
316
-
317
- let optionCacheKey = "withoutValue";
318
- //先从缓存里拿
319
- if (searchText) {
320
- optionCacheKey = searchText;
321
- }
322
- let titleId = this.state.titleId;
323
- let optionCache = optionsCache[optionCacheKey];
324
- if (!optionCache) {
325
- this.setState({
326
- loading: true,
327
- })
328
- let ltmplConfig_ = ltmplConfig;
329
- if (!ltmplConfig_) {
330
- ltmplConfig_ = await this.loadLtmplConfig();
331
- }
332
- if(!ltmplConfig_){
333
- message.error("请配置正确查询页面");
334
- return;
335
- }
336
- let pageInfo = {
337
- pageNo: 1,
338
- pageSize: 6,
339
- virtualEndPageNo: undefined,
340
- };
341
- titleId = ltmplConfig_.primaryColumn.id;
342
- //得到第一个过滤条件
343
- let firstCriteria = ltmplConfig_.primaryCriteria;
344
- let formItemName = 'undefinedCriteria';
345
- if (firstCriteria) {
346
- formItemName = 'c_' + firstCriteria.id;
347
- }
348
- const {defaultPageSize} = ltmplConfig_;
349
- if (defaultPageSize) {
350
- pageInfo.pageSize = defaultPageSize;
351
- }
352
-
353
- /** 构建 dataSource **/
354
- //构建过滤条件
355
- let criteriaData = {};
356
- if (baseCriteria) {
357
- criteriaData = {...baseCriteria}
358
- }
359
- // let mainCode_ = mainCode;
360
- // if (baseCriteria) {
361
- // criteriaData = {...baseCriteria}
362
- // if (!mainCode) {
363
- // mainCode_ = baseCriteria['mainCode']; //当只在条件中设置mainCode时,保证生效不被设置为null
364
- // }
365
- // }
366
- criteriaData[formItemName] = searchText;
367
- let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(fieldConfig.serverKey ? fieldConfig.serverKey : serverKey, fieldConfig.sourceId, {
368
- ...criteriaData, ...pageInfo,
369
- mainCode: currentMainCode
370
- });
371
- let sourceData = await this.loadData(queryKey.key, pageInfo, titleId);
372
-
373
- optionCache = {
374
- options: sourceData.options,
375
- pageInfo,
376
- queryKey,
377
- searchValue: searchText,
378
- touchEnd: sourceData.touchEnd
379
- };
380
- optionsCache[optionCacheKey] = optionCache;
381
- this.setState({
382
- optionCacheKey,
383
- titleId,
384
- optionsCache: {...optionsCache},
385
- loading: false,
386
- })
387
- } else {
388
- if (this.state.optionCacheKey == optionCacheKey && optionCacheKey == 'withoutValue') {
389
- this.setState({
390
- loading: false,
391
- optionCacheKey,
392
- })
393
- } else {
394
- debounce(() => {
395
- this.setState({
396
- loading: false,
397
- optionCacheKey,
398
- })
399
- }, 500)();
400
- }
401
- }
402
-
365
+ let optionCacheKey = "withoutValue";
366
+ //先从缓存里拿
367
+ if (searchText) {
368
+ optionCacheKey = searchText;
403
369
  }
404
-
405
- onChange = (values: any[]) => {
406
- const {codeLabel} = this.state;
407
- let newValues: Array<string> = [...values];
408
- if (values && values.length > this.props.maxSelected) {
409
- newValues.shift();
370
+ let titleId = this.state.titleId;
371
+ let optionCache = optionsCache[optionCacheKey];
372
+ if (!optionCache) {
373
+ this.setState({
374
+ loading: true,
375
+ });
376
+ let ltmplConfig_ = ltmplConfig;
377
+ if (!ltmplConfig_) {
378
+ ltmplConfig_ = await this.loadLtmplConfig();
379
+ }
380
+ if (!ltmplConfig_) {
381
+ message.error("请配置正确查询页面");
382
+ return;
383
+ }
384
+ let pageInfo = {
385
+ pageNo: 1,
386
+ pageSize: 6,
387
+ virtualEndPageNo: undefined,
388
+ };
389
+ titleId = ltmplConfig_.primaryColumn.id;
390
+ //得到第一个过滤条件
391
+ let firstCriteria = ltmplConfig_.primaryCriteria;
392
+ let formItemName = "undefinedCriteria";
393
+ if (firstCriteria) {
394
+ formItemName = "c_" + firstCriteria.id;
395
+ }
396
+ const { defaultPageSize } = ltmplConfig_;
397
+ if (defaultPageSize) {
398
+ pageInfo.pageSize = defaultPageSize;
399
+ }
400
+
401
+ /** 构建 dataSource **/
402
+ //构建过滤条件
403
+ let criteriaData = {};
404
+ if (baseCriteria) {
405
+ criteriaData = { ...baseCriteria };
406
+ }
407
+ // let mainCode_ = mainCode;
408
+ // if (baseCriteria) {
409
+ // criteriaData = {...baseCriteria}
410
+ // if (!mainCode) {
411
+ // mainCode_ = baseCriteria['mainCode']; //当只在条件中设置mainCode时,保证生效不被设置为null
412
+ // }
413
+ // }
414
+ criteriaData[formItemName] = searchText;
415
+ let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(
416
+ fieldConfig.serverKey ? fieldConfig.serverKey : serverKey,
417
+ fieldConfig.sourceId,
418
+ {
419
+ ...criteriaData,
420
+ ...pageInfo,
421
+ mainCode: currentMainCode,
410
422
  }
411
- let formValues: Array<string> = [];
412
- newValues.forEach((c) => {
413
- if (c.indexOf("@R@") > 0) {
414
- formValues.push(c);
415
- } else {
416
- formValues.push(c + "@R@" + codeLabel[c]);
417
- }
418
- })
419
- this.props.onChange(formValues);
423
+ );
424
+ let sourceData = await this.loadData(queryKey.key, pageInfo, titleId);
425
+
426
+ optionCache = {
427
+ options: sourceData.options,
428
+ pageInfo,
429
+ queryKey,
430
+ searchValue: searchText,
431
+ touchEnd: sourceData.touchEnd,
432
+ };
433
+ optionsCache[optionCacheKey] = optionCache;
434
+ this.setState({
435
+ optionCacheKey,
436
+ titleId,
437
+ optionsCache: { ...optionsCache },
438
+ loading: false,
439
+ });
440
+ } else {
441
+ if (
442
+ this.state.optionCacheKey == optionCacheKey &&
443
+ optionCacheKey == "withoutValue"
444
+ ) {
445
+ this.setState({
446
+ loading: false,
447
+ optionCacheKey,
448
+ });
449
+ } else {
450
+ debounce(() => {
451
+ this.setState({
452
+ loading: false,
453
+ optionCacheKey,
454
+ });
455
+ }, 500)();
456
+ }
420
457
  }
458
+ };
421
459
 
422
- tagRender = (props: CustomTagProps) => {
423
- const {label, closable, onClose} = props;
424
- const onPreventMouseDown = (event: React.MouseEvent<HTMLSpanElement>) => {
425
- event.preventDefault();
426
- event.stopPropagation();
427
- };
428
- return (
429
- <Tag
430
- onMouseDown={onPreventMouseDown}
431
- closable={closable}
432
- onClose={onClose}
433
- style={{marginRight: 3}}
434
- >
435
- {label}
436
- </Tag>
437
- );
438
- };
439
-
440
-
441
- loadData = async (queryKey: string, pageInfo: PageInfo, titleId: string): Promise<LoadDataSource> => {
442
- const {onEntityClick, baseCriteria, serverKey, fieldConfig} = this.props;
443
-
444
- let queryData: QueryData = await HcserviceV3.requestQueryData(fieldConfig.serverKey ? fieldConfig.serverKey : serverKey, queryKey, pageInfo);
445
- let options: object[] = [];
446
- pageInfo = queryData.pageInfo;
447
- queryData.entities.forEach((item, index) => {
448
- let title = item.fieldMap[titleId];
449
- //放入全局对象缓存
450
- //这个缓存后续还需要完善,因为太多了,容易爆掉
451
- HCDataSource.cache(item);
452
- if (title) {
453
- let ts = title.split('@R@');
454
- let t = ts && ts.length > 0 ? ts[ts.length - 1] : title;
455
- if (t != 'null') {
456
- let option = this.toOption(item.code, t, onEntityClick);
457
- options.push(option);
458
- }
459
- }
460
- })
461
- return {options, touchEnd: queryData.touchEnd};
460
+ onChange = (values: any[]) => {
461
+ const { codeLabel } = this.state;
462
+ let newValues: Array<string> = [...values];
463
+ if (values && values.length > this.props.maxSelected) {
464
+ newValues.shift();
462
465
  }
463
-
464
- debounceFetcher = () => {
465
- const loadOptions = (val) => {
466
- this.fetchOptions(val);
467
- };
468
- return debounce(loadOptions, 800);
466
+ let formValues: Array<string> = [];
467
+ newValues.forEach((c) => {
468
+ if (c.indexOf("@R@") > 0) {
469
+ formValues.push(c);
470
+ } else {
471
+ formValues.push(c + "@R@" + codeLabel[c]);
472
+ }
473
+ });
474
+ this.props.onChange(formValues);
475
+ };
476
+
477
+ tagRender = (props: CustomTagProps) => {
478
+ const { label, closable, onClose } = props;
479
+ const onPreventMouseDown = (event: React.MouseEvent<HTMLSpanElement>) => {
480
+ event.preventDefault();
481
+ event.stopPropagation();
469
482
  };
470
-
471
- debounceFetchNextPage = () => {
472
- // this.setState({
473
- // loading: true,
474
- // })
475
- debounce(this.fetchNextPage, 200)();
476
- // this.setState({
477
- // loading: false,
478
- // })
483
+ return (
484
+ <Tag
485
+ onMouseDown={onPreventMouseDown}
486
+ closable={closable}
487
+ onClose={onClose}
488
+ style={{ marginRight: 3 }}
489
+ >
490
+ {label}
491
+ </Tag>
492
+ );
493
+ };
494
+
495
+ loadData = async (
496
+ queryKey: string,
497
+ pageInfo: PageInfo,
498
+ titleId: string
499
+ ): Promise<LoadDataSource> => {
500
+ const { onEntityClick, baseCriteria, serverKey, fieldConfig } = this.props;
501
+
502
+ let queryData: QueryData = await HcserviceV3.requestQueryData(
503
+ fieldConfig.serverKey ? fieldConfig.serverKey : serverKey,
504
+ queryKey,
505
+ pageInfo
506
+ );
507
+ let options: object[] = [];
508
+ pageInfo = queryData.pageInfo;
509
+ queryData.entities.forEach((item, index) => {
510
+ let title = item.fieldMap[titleId];
511
+ //放入全局对象缓存
512
+ //这个缓存后续还需要完善,因为太多了,容易爆掉
513
+ HCDataSource.cache(item);
514
+ if (title) {
515
+ let ts = title.split("@R@");
516
+ let t = ts && ts.length > 0 ? ts[ts.length - 1] : title;
517
+ if (t != "null") {
518
+ let option = this.toOption(item.code, t, onEntityClick);
519
+ options.push(option);
520
+ }
521
+ }
522
+ });
523
+ return { options, touchEnd: queryData.touchEnd };
524
+ };
525
+
526
+ debounceFetcher = () => {
527
+ const loadOptions = (val) => {
528
+ this.fetchOptions(val);
529
+ };
530
+ return debounce(loadOptions, 800);
531
+ };
532
+
533
+ debounceFetchNextPage = () => {
534
+ // this.setState({
535
+ // loading: true,
536
+ // })
537
+ debounce(this.fetchNextPage, 200)();
538
+ // this.setState({
539
+ // loading: false,
540
+ // })
541
+ };
542
+
543
+ render() {
544
+ const {
545
+ id,
546
+ value,
547
+ fieldConfig,
548
+ onChange,
549
+ disabled,
550
+ style,
551
+ maxSelected,
552
+ onEntityClick,
553
+ mainCode,
554
+ serverKey: pServerKey,
555
+ } = this.props;
556
+ const { actions } = fieldConfig;
557
+ const {
558
+ optionCacheKey,
559
+ loading,
560
+ optionsCache,
561
+ drawCode,
562
+ showEdit,
563
+ showView,
564
+ showTable,
565
+ ltmplConfig,
566
+ } = this.state;
567
+ const { translate } = this.context;
568
+
569
+ let serverKey = fieldConfig.serverKey ? fieldConfig.serverKey : pServerKey;
570
+
571
+ let initOptions = this.toOptions(value, onEntityClick);
572
+ let exists;
573
+ let properOptions = [...initOptions];
574
+ let listHeight = 256;
575
+ if (optionCacheKey && optionsCache[optionCacheKey]) {
576
+ let optionCache = optionsCache[optionCacheKey];
577
+ if (optionCache["pageInfo"] && optionCache.pageInfo.pageSize < 8) {
578
+ listHeight = 32 * optionCache["pageInfo"].pageSize - 10;
579
+ }
580
+ for (let option of optionCache.options) {
581
+ exists = false;
582
+ for (let init of initOptions) {
583
+ if (init["value"] == option["value"]) {
584
+ exists = true;
585
+ //用查询的覆盖之前的
586
+ init["label"] = option["label"];
587
+ }
588
+ }
589
+ if (!exists) {
590
+ properOptions.push(option);
591
+ }
592
+ }
479
593
  }
480
594
 
481
- render() {
482
- const {id, value, fieldConfig, onChange, disabled, style, maxSelected, onEntityClick, mainCode, serverKey: pServerKey} = this.props;
483
- const {actions} = fieldConfig;
484
- const {optionCacheKey, loading, optionsCache, drawCode, showEdit, showView, showTable, ltmplConfig} = this.state;
485
-
486
- let serverKey = fieldConfig.serverKey ? fieldConfig.serverKey : pServerKey;
487
-
488
- let initOptions = this.toOptions(value, onEntityClick);
489
- let exists;
490
- let properOptions = [...initOptions];
491
- let listHeight = 256;
492
- if (optionCacheKey && optionsCache[optionCacheKey]) {
493
- let optionCache = optionsCache[optionCacheKey];
494
- if (optionCache['pageInfo'] && optionCache.pageInfo.pageSize < 8) {
495
- listHeight = 32 * (optionCache['pageInfo'].pageSize) - 10;
496
- }
497
- for (let option of optionCache.options) {
498
- exists = false;
499
- for (let init of initOptions) {
500
- if (init['value'] == option['value']) {
501
- exists = true;
502
- //用查询的覆盖之前的
503
- init['label'] = option['label'];
504
- }
505
- }
506
- if (!exists) {
507
- properOptions.push(option);
595
+ return (
596
+ <>
597
+ <Select
598
+ disabled={disabled}
599
+ id={id}
600
+ listHeight={listHeight}
601
+ style={{ ...style }}
602
+ onChange={this.onChange}
603
+ value={this.toValueArray(value)}
604
+ mode="multiple"
605
+ placeholder={translate("${请选择}${" + fieldConfig.title + "}")}
606
+ notFoundContent={
607
+ loading ? <Spin size={"small"}></Spin> : translate("${无数据}")
608
+ }
609
+ allowClear={true}
610
+ showArrow={true}
611
+ suffixIcon={<SearchOutlined />}
612
+ filterOption={false}
613
+ dropdownRender={this.dropdownRender}
614
+ tagRender={
615
+ actions &&
616
+ (actions.indexOf("detail") >= 0 || actions.indexOf("edit") >= 0)
617
+ ? this.tagRender
618
+ : undefined
619
+ }
620
+ onSearch={this.debounceFetcher()}
621
+ onClick={
622
+ disabled
623
+ ? null
624
+ : () => {
625
+ debounce(this.fetchOptions, 100)(undefined);
508
626
  }
627
+ }
628
+ options={loading ? [] : properOptions}
629
+ onPopupScroll={(e) => {
630
+ const { target } = e;
631
+ if (
632
+ target["scrollTop"] + target["offsetHeight"] + 1 >=
633
+ target["scrollHeight"]
634
+ ) {
635
+ this.debounceFetchNextPage();
509
636
  }
510
- }
511
-
512
- return <><Select
513
- disabled={disabled}
514
- id={id}
515
- listHeight={listHeight}
516
- style={{...style}}
517
- onChange={this.onChange}
518
- value={this.toValueArray(value)}
519
- mode="multiple"
520
- placeholder={`请选择${fieldConfig.title}`}
521
- notFoundContent={loading ? <Spin size={'small'}></Spin> : "无数据"}
522
- allowClear={true}
523
- showArrow={true}
524
- suffixIcon={<SearchOutlined/>}
525
- filterOption={false}
526
- dropdownRender={this.dropdownRender}
527
- tagRender={actions && (actions.indexOf("detail") >= 0 || actions.indexOf("edit") >= 0) ? this.tagRender : undefined}
528
- onSearch={this.debounceFetcher()}
529
- onClick={disabled ? null : () => {
530
- debounce(this.fetchOptions, 100)(undefined)
531
- }}
532
- options={loading ? [] : properOptions}
533
- onPopupScroll={(e) => {
534
- const {target} = e;
535
- if (target['scrollTop'] + target['offsetHeight'] + 1 >= target['scrollHeight']) {
536
- this.debounceFetchNextPage();
537
- }
538
- }}>
539
- </Select>
540
- {showView && drawCode ?
541
- <DtmplViewDrawer serverKey={serverKey} placement={'left'} onClose={this.doClose} open={showView}
542
- sourceId={fieldConfig.sourceId} code={drawCode}></DtmplViewDrawer> : null}
543
- {showEdit && ltmplConfig ? ltmplConfig.customEditPagePath ?
544
- <DtmplCustomEditModalPage open={showEdit} onOk={() => {
545
- this.drawSubmited();
546
- }} customPath={ltmplConfig.customEditPagePath} sourceId={fieldConfig.sourceId} mainCode={mainCode}
547
- code={drawCode}/>
548
- : <DtmplEditPage serverKey={serverKey} pageType={"modal"} open={showEdit}
549
- onCancel={this.doClose} mainCode={mainCode}
550
- sourceId={fieldConfig.sourceId}
551
- code={drawCode}
552
- onOk={this.drawSubmited}/> : null}
553
- {showTable ? <LtmplModal serverKey={serverKey} open={showTable} height={"76vh"}
554
- onCancel={this.closeTable}
555
- sourceId={fieldConfig.sourceId}
556
- mainCode={mainCode}
557
- /> : null}
558
-
559
- </>
560
- }
561
-
562
-
637
+ }}
638
+ ></Select>
639
+ {showView && drawCode ? (
640
+ <DtmplViewDrawer
641
+ serverKey={serverKey}
642
+ placement={"left"}
643
+ onClose={this.doClose}
644
+ open={showView}
645
+ sourceId={fieldConfig.sourceId}
646
+ code={drawCode}
647
+ ></DtmplViewDrawer>
648
+ ) : null}
649
+ {showEdit && ltmplConfig ? (
650
+ ltmplConfig.customEditPagePath ? (
651
+ <DtmplCustomEditModalPage
652
+ open={showEdit}
653
+ onOk={() => {
654
+ this.drawSubmited();
655
+ }}
656
+ customPath={ltmplConfig.customEditPagePath}
657
+ sourceId={fieldConfig.sourceId}
658
+ mainCode={mainCode}
659
+ code={drawCode}
660
+ />
661
+ ) : (
662
+ <DtmplEditPage
663
+ serverKey={serverKey}
664
+ pageType={"modal"}
665
+ open={showEdit}
666
+ onCancel={this.doClose}
667
+ mainCode={mainCode}
668
+ sourceId={fieldConfig.sourceId}
669
+ code={drawCode}
670
+ onOk={this.drawSubmited}
671
+ />
672
+ )
673
+ ) : null}
674
+ {showTable ? (
675
+ <LtmplModal
676
+ serverKey={serverKey}
677
+ open={showTable}
678
+ height={"76vh"}
679
+ onCancel={this.closeTable}
680
+ sourceId={fieldConfig.sourceId}
681
+ mainCode={mainCode}
682
+ />
683
+ ) : null}
684
+ </>
685
+ );
686
+ }
563
687
  }
564
-
565
-