aldehyde 0.2.98 → 0.2.100

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 (528) hide show
  1. package/LICENSE +1 -1
  2. package/dist/bundle.021f784b1c84781461d2.js +1 -0
  3. package/dist/bundle.03c542ca824e205fe307.js +2 -0
  4. package/dist/bundle.03c542ca824e205fe307.js.LICENSE.txt +27 -0
  5. package/dist/bundle.03c542ca824e205fe307.js.gz +0 -0
  6. package/dist/bundle.15cb660c34802f6cccf5.js +1 -0
  7. package/dist/bundle.15cb660c34802f6cccf5.js.gz +0 -0
  8. package/dist/bundle.2f9c2d692fe0277a37aa.js +2 -0
  9. package/dist/bundle.2f9c2d692fe0277a37aa.js.LICENSE.txt +1 -0
  10. package/dist/bundle.2f9c2d692fe0277a37aa.js.gz +0 -0
  11. package/dist/bundle.320c02187dd135005102.js +2 -0
  12. package/dist/bundle.320c02187dd135005102.js.LICENSE.txt +6 -0
  13. package/dist/bundle.320c02187dd135005102.js.gz +0 -0
  14. package/dist/bundle.35a4af7e2d0da1942d79.js +10 -0
  15. package/dist/bundle.35a4af7e2d0da1942d79.js.gz +0 -0
  16. package/dist/bundle.3f9072b1629cdb384b46.js +2 -0
  17. package/dist/bundle.3f9072b1629cdb384b46.js.LICENSE.txt +5 -0
  18. package/dist/bundle.3f9072b1629cdb384b46.js.gz +0 -0
  19. package/dist/bundle.46e2295b5360a725bcd5.js +1 -0
  20. package/dist/bundle.46e2295b5360a725bcd5.js.gz +0 -0
  21. package/dist/bundle.4c3c988531c3cf360b87.js +1 -0
  22. package/dist/bundle.4c3c988531c3cf360b87.js.gz +0 -0
  23. package/dist/bundle.4df89546fd2e9d665dfb.js +2 -0
  24. package/dist/bundle.4df89546fd2e9d665dfb.js.LICENSE.txt +5 -0
  25. package/dist/bundle.4df89546fd2e9d665dfb.js.gz +0 -0
  26. package/dist/bundle.5a9afb9ee6cceca506fa.js +5 -0
  27. package/dist/bundle.5a9afb9ee6cceca506fa.js.LICENSE.txt +10 -0
  28. package/dist/bundle.5a9afb9ee6cceca506fa.js.gz +0 -0
  29. package/dist/bundle.5e6cccd06b34a0e3a2ff.js +1 -0
  30. package/dist/bundle.5e6cccd06b34a0e3a2ff.js.gz +0 -0
  31. package/dist/bundle.62c62e6aaa7f3c20761e.js +2 -0
  32. package/dist/bundle.62c62e6aaa7f3c20761e.js.LICENSE.txt +17 -0
  33. package/dist/bundle.62c62e6aaa7f3c20761e.js.gz +0 -0
  34. package/dist/bundle.6fd2dadd29083268c5a6.js +2 -0
  35. package/dist/bundle.6fd2dadd29083268c5a6.js.LICENSE.txt +17 -0
  36. package/dist/bundle.6fd2dadd29083268c5a6.js.gz +0 -0
  37. package/dist/bundle.8241d8d05e35988dd480.js +1 -0
  38. package/dist/bundle.8241d8d05e35988dd480.js.gz +0 -0
  39. package/dist/bundle.829683dfa6a98c78c58e.js +2 -0
  40. package/dist/bundle.829683dfa6a98c78c58e.js.LICENSE.txt +14 -0
  41. package/dist/bundle.829683dfa6a98c78c58e.js.gz +0 -0
  42. package/dist/bundle.840e28984e710e12f467.js +75 -0
  43. package/dist/bundle.840e28984e710e12f467.js.LICENSE.txt +8 -0
  44. package/dist/bundle.840e28984e710e12f467.js.gz +0 -0
  45. package/dist/bundle.85ce5221fe6ab1d91f7d.js +2 -0
  46. package/dist/bundle.85ce5221fe6ab1d91f7d.js.LICENSE.txt +1 -0
  47. package/dist/bundle.85ce5221fe6ab1d91f7d.js.gz +0 -0
  48. package/dist/bundle.9cfd99a04bde7f781c30.js +1 -0
  49. package/dist/bundle.9cfd99a04bde7f781c30.js.gz +0 -0
  50. package/dist/bundle.a049dc8814bbbf59160f.js +1 -0
  51. package/dist/bundle.a049dc8814bbbf59160f.js.gz +0 -0
  52. package/dist/bundle.a94f7811fac19aa9d6a3.js +2 -0
  53. package/dist/bundle.a94f7811fac19aa9d6a3.js.LICENSE.txt +1 -0
  54. package/dist/bundle.a94f7811fac19aa9d6a3.js.gz +0 -0
  55. package/dist/bundle.abdde6e82ee9f60d1bf3.js +2 -0
  56. package/dist/bundle.abdde6e82ee9f60d1bf3.js.LICENSE.txt +30 -0
  57. package/dist/bundle.abdde6e82ee9f60d1bf3.js.gz +0 -0
  58. package/dist/bundle.b207a66d5902f39d0c5a.js +1 -0
  59. package/dist/bundle.b207a66d5902f39d0c5a.js.gz +0 -0
  60. package/dist/bundle.b7b86a025aa95dea0e19.js +2 -0
  61. package/dist/bundle.b7b86a025aa95dea0e19.js.LICENSE.txt +8 -0
  62. package/dist/bundle.b7b86a025aa95dea0e19.js.gz +0 -0
  63. package/dist/bundle.b7e3eb480b649b3de67b.js +2 -0
  64. package/dist/bundle.b7e3eb480b649b3de67b.js.LICENSE.txt +5 -0
  65. package/dist/bundle.b7e3eb480b649b3de67b.js.gz +0 -0
  66. package/dist/bundle.c1c6028fd703ebf78c2e.js +2 -0
  67. package/dist/bundle.c1c6028fd703ebf78c2e.js.LICENSE.txt +5 -0
  68. package/dist/bundle.c1c6028fd703ebf78c2e.js.gz +0 -0
  69. package/dist/bundle.cd10ae07e0e0c36d0dee.js +2 -0
  70. package/dist/bundle.cd10ae07e0e0c36d0dee.js.LICENSE.txt +22 -0
  71. package/dist/bundle.cd10ae07e0e0c36d0dee.js.gz +0 -0
  72. package/dist/bundle.cf6a1933769c2aee4e6e.js +1 -0
  73. package/dist/bundle.cf6a1933769c2aee4e6e.js.gz +0 -0
  74. package/dist/bundle.d158d417d1d7a8acb2a1.js +1 -0
  75. package/dist/bundle.d158d417d1d7a8acb2a1.js.gz +0 -0
  76. package/dist/bundle.db40aa107272f4303ece.js +1 -0
  77. package/dist/bundle.db40aa107272f4303ece.js.gz +0 -0
  78. package/dist/bundle.ddefe6d8f235ef95d470.js +1 -0
  79. package/dist/bundle.ddefe6d8f235ef95d470.js.gz +0 -0
  80. package/dist/bundle.e02a7a16b4a6b3bb412f.js +2 -0
  81. package/dist/bundle.e02a7a16b4a6b3bb412f.js.LICENSE.txt +16 -0
  82. package/dist/bundle.e02a7a16b4a6b3bb412f.js.gz +0 -0
  83. package/dist/bundle.e760a70171cf0ae4567b.js +1 -0
  84. package/dist/bundle.e760a70171cf0ae4567b.js.gz +0 -0
  85. package/dist/bundle.f3ce062a620fe456c152.js +1 -0
  86. package/dist/bundle.f6e1c4fda58154810fe2.js +2 -0
  87. package/dist/bundle.f6e1c4fda58154810fe2.js.LICENSE.txt +41 -0
  88. package/dist/bundle.f6e1c4fda58154810fe2.js.gz +0 -0
  89. package/dist/bundle.fe9c09b8ace9c3117b0a.js +1 -0
  90. package/dist/bundle.fe9c09b8ace9c3117b0a.js.gz +0 -0
  91. package/dist/bundle.feaa17bec2057a4ee54f.js +1 -0
  92. package/dist/bundle.feaa17bec2057a4ee54f.js.gz +0 -0
  93. package/dist/css/chemstruc-graph-6437e59640f8b99b774f.css +12 -0
  94. package/dist/css/chemstruc-graph-6437e59640f8b99b774f.css.gz +0 -0
  95. package/dist/css/common-901df6b21f13391f2a53.css +56 -0
  96. package/dist/css/html-editor-draft-5e8e152675ab7d201c00.css +886 -0
  97. package/dist/css/html-editor-draft-5e8e152675ab7d201c00.css.gz +0 -0
  98. package/dist/css/main-f3c8fdebab315e61e7be.css +865 -0
  99. package/dist/css/main-f3c8fdebab315e61e7be.css.gz +0 -0
  100. package/dist/images/development-30de07a0.png +0 -0
  101. package/dist/images/logo-54b328b7.png +0 -0
  102. package/dist/images/pain-point-8f02421e.png +0 -0
  103. package/dist/images/target-13a5b4b9.png +0 -0
  104. package/dist/images/time-cost-cb40d2c2.png +0 -0
  105. package/dist/images/time-prograss-44b86b36.png +0 -0
  106. package/dist/index.html +4 -0
  107. package/lib/controls/action/index.d.ts +16 -7
  108. package/lib/controls/action/index.d.ts.map +1 -1
  109. package/lib/controls/action/index.js +64 -48
  110. package/lib/controls/action/index.js.map +1 -1
  111. package/lib/controls/action/utils.d.ts +1 -1
  112. package/lib/controls/action/utils.d.ts.map +1 -1
  113. package/lib/controls/action/utils.js +6 -4
  114. package/lib/controls/action/utils.js.map +1 -1
  115. package/lib/controls/auto-complete/index.d.ts +1 -1
  116. package/lib/controls/auto-complete/index.d.ts.map +1 -1
  117. package/lib/controls/auto-complete/index.js +12 -6
  118. package/lib/controls/auto-complete/index.js.map +1 -1
  119. package/lib/controls/chemstruc/graph.d.ts +13 -4
  120. package/lib/controls/chemstruc/graph.d.ts.map +1 -1
  121. package/lib/controls/chemstruc/graph.js +40 -27
  122. package/lib/controls/chemstruc/graph.js.map +1 -1
  123. package/lib/controls/collapse-card/index.d.ts +11 -2
  124. package/lib/controls/collapse-card/index.d.ts.map +1 -1
  125. package/lib/controls/collapse-card/index.js +18 -16
  126. package/lib/controls/collapse-card/index.js.map +1 -1
  127. package/lib/controls/color-picker/index.d.ts +11 -2
  128. package/lib/controls/color-picker/index.d.ts.map +1 -1
  129. package/lib/controls/color-picker/index.js +23 -19
  130. package/lib/controls/color-picker/index.js.map +1 -1
  131. package/lib/controls/cquery/cquick-button.d.ts +11 -2
  132. package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
  133. package/lib/controls/cquery/cquick-button.js +30 -28
  134. package/lib/controls/cquery/cquick-button.js.map +1 -1
  135. package/lib/controls/entity-select/entity-select.d.ts +12 -3
  136. package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
  137. package/lib/controls/entity-select/entity-select.js +67 -66
  138. package/lib/controls/entity-select/entity-select.js.map +1 -1
  139. package/lib/controls/entity-select/lab-tree-select.d.ts +11 -2
  140. package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -1
  141. package/lib/controls/entity-select/lab-tree-select.js +26 -21
  142. package/lib/controls/entity-select/lab-tree-select.js.map +1 -1
  143. package/lib/controls/entity-select/popover-entity-select.d.ts +11 -2
  144. package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
  145. package/lib/controls/entity-select/popover-entity-select.js +30 -26
  146. package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
  147. package/lib/controls/entry-control.d.ts +1 -1
  148. package/lib/controls/entry-control.d.ts.map +1 -1
  149. package/lib/controls/entry-control.js +153 -98
  150. package/lib/controls/entry-control.js.map +1 -1
  151. package/lib/controls/html-editor/tinymce.d.ts.map +1 -1
  152. package/lib/controls/input-number/index.d.ts +1 -1
  153. package/lib/controls/input-number/index.d.ts.map +1 -1
  154. package/lib/controls/input-number/index.js +31 -23
  155. package/lib/controls/input-number/index.js.map +1 -1
  156. package/lib/controls/input-range/index.d.ts +1 -1
  157. package/lib/controls/input-range/index.d.ts.map +1 -1
  158. package/lib/controls/input-range/index.js +9 -8
  159. package/lib/controls/input-range/index.js.map +1 -1
  160. package/lib/controls/password-setter/index.d.ts +9 -3
  161. package/lib/controls/password-setter/index.d.ts.map +1 -1
  162. package/lib/controls/password-setter/index.js +22 -14
  163. package/lib/controls/password-setter/index.js.map +1 -1
  164. package/lib/controls/progress/index.d.ts +1 -1
  165. package/lib/controls/progress/index.d.ts.map +1 -1
  166. package/lib/controls/progress/index.js +13 -6
  167. package/lib/controls/progress/index.js.map +1 -1
  168. package/lib/controls/relation-existion/index.d.ts +11 -2
  169. package/lib/controls/relation-existion/index.d.ts.map +1 -1
  170. package/lib/controls/relation-existion/index.js +30 -18
  171. package/lib/controls/relation-existion/index.js.map +1 -1
  172. package/lib/controls/rfield/index.d.ts +11 -2
  173. package/lib/controls/rfield/index.d.ts.map +1 -1
  174. package/lib/controls/rfield/index.js +33 -35
  175. package/lib/controls/rfield/index.js.map +1 -1
  176. package/lib/controls/signature/index.d.ts +10 -1
  177. package/lib/controls/signature/index.d.ts.map +1 -1
  178. package/lib/controls/signature/index.js +56 -31
  179. package/lib/controls/signature/index.js.map +1 -1
  180. package/lib/controls/steps/index.d.ts +1 -1
  181. package/lib/controls/steps/index.d.ts.map +1 -1
  182. package/lib/controls/steps/index.js +8 -6
  183. package/lib/controls/steps/index.js.map +1 -1
  184. package/lib/controls/text/ellipsis-text.d.ts +9 -0
  185. package/lib/controls/text/ellipsis-text.d.ts.map +1 -1
  186. package/lib/controls/text/ellipsis-text.js +13 -11
  187. package/lib/controls/text/ellipsis-text.js.map +1 -1
  188. package/lib/controls/upload/index.d.ts +10 -1
  189. package/lib/controls/upload/index.d.ts.map +1 -1
  190. package/lib/controls/upload/index.js +30 -21
  191. package/lib/controls/upload/index.js.map +1 -1
  192. package/lib/controls/view-control.d.ts +1 -1
  193. package/lib/controls/view-control.d.ts.map +1 -1
  194. package/lib/controls/view-control.js +118 -85
  195. package/lib/controls/view-control.js.map +1 -1
  196. package/lib/custom-page/def-custom-page.d.ts +5 -6
  197. package/lib/custom-page/def-custom-page.d.ts.map +1 -1
  198. package/lib/custom-page/def-custom-page.js +13 -12
  199. package/lib/custom-page/def-custom-page.js.map +1 -1
  200. package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts +10 -1
  201. package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts.map +1 -1
  202. package/lib/custom-page/dtmpl-custom-edit-modal-page.js +19 -7
  203. package/lib/custom-page/dtmpl-custom-edit-modal-page.js.map +1 -1
  204. package/lib/detail/button/bottom-submit-button-bar.d.ts +11 -2
  205. package/lib/detail/button/bottom-submit-button-bar.d.ts.map +1 -1
  206. package/lib/detail/button/bottom-submit-button-bar.js +20 -12
  207. package/lib/detail/button/bottom-submit-button-bar.js.map +1 -1
  208. package/lib/detail/button/cquery-button-bar.d.ts +12 -3
  209. package/lib/detail/button/cquery-button-bar.d.ts.map +1 -1
  210. package/lib/detail/button/cquery-button-bar.js +22 -18
  211. package/lib/detail/button/cquery-button-bar.js.map +1 -1
  212. package/lib/detail/button/fix-right-submit-button-bar.d.ts +11 -2
  213. package/lib/detail/button/fix-right-submit-button-bar.d.ts.map +1 -1
  214. package/lib/detail/button/fix-right-submit-button-bar.js +28 -23
  215. package/lib/detail/button/fix-right-submit-button-bar.js.map +1 -1
  216. package/lib/detail/edit/fields-edit-card.d.ts +11 -2
  217. package/lib/detail/edit/fields-edit-card.d.ts.map +1 -1
  218. package/lib/detail/edit/fields-edit-card.js +18 -19
  219. package/lib/detail/edit/fields-edit-card.js.map +1 -1
  220. package/lib/detail/edit/modal-row-edit.d.ts +11 -2
  221. package/lib/detail/edit/modal-row-edit.d.ts.map +1 -1
  222. package/lib/detail/edit/modal-row-edit.js +14 -11
  223. package/lib/detail/edit/modal-row-edit.js.map +1 -1
  224. package/lib/detail/edit/post-result/index.d.ts +1 -1
  225. package/lib/detail/edit/post-result/index.d.ts.map +1 -1
  226. package/lib/detail/edit/post-result/index.js +17 -12
  227. package/lib/detail/edit/post-result/index.js.map +1 -1
  228. package/lib/detail/edit/row-edit-card.d.ts +11 -2
  229. package/lib/detail/edit/row-edit-card.d.ts.map +1 -1
  230. package/lib/detail/edit/row-edit-card.js +23 -23
  231. package/lib/detail/edit/row-edit-card.js.map +1 -1
  232. package/lib/detail/rightbar/index.d.ts +12 -3
  233. package/lib/detail/rightbar/index.d.ts.map +1 -1
  234. package/lib/detail/rightbar/index.js +16 -9
  235. package/lib/detail/rightbar/index.js.map +1 -1
  236. package/lib/detail/view/act-dtmpl-view.d.ts +11 -2
  237. package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
  238. package/lib/detail/view/act-dtmpl-view.js +26 -25
  239. package/lib/detail/view/act-dtmpl-view.js.map +1 -1
  240. package/lib/detail/view/dtmpl-view.d.ts +2 -2
  241. package/lib/detail/view/dtmpl-view.d.ts.map +1 -1
  242. package/lib/detail/view/dtmpl-view.js +40 -40
  243. package/lib/detail/view/dtmpl-view.js.map +1 -1
  244. package/lib/detail/view/field-view-group.d.ts +10 -1
  245. package/lib/detail/view/field-view-group.d.ts.map +1 -1
  246. package/lib/detail/view/field-view-group.js +17 -11
  247. package/lib/detail/view/field-view-group.js.map +1 -1
  248. package/lib/detail/view/modal-dtmpl-view.d.ts +10 -1
  249. package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
  250. package/lib/detail/view/modal-dtmpl-view.js +11 -8
  251. package/lib/detail/view/modal-dtmpl-view.js.map +1 -1
  252. package/lib/detail/view/snapshot-timeline.d.ts +11 -2
  253. package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
  254. package/lib/detail/view/snapshot-timeline.js +18 -16
  255. package/lib/detail/view/snapshot-timeline.js.map +1 -1
  256. package/lib/exportor/export-frame.d.ts +11 -2
  257. package/lib/exportor/export-frame.d.ts.map +1 -1
  258. package/lib/exportor/export-frame.js +41 -42
  259. package/lib/exportor/export-frame.js.map +1 -1
  260. package/lib/form/criteria-form.d.ts +2 -2
  261. package/lib/form/criteria-form.d.ts.map +1 -1
  262. package/lib/form/criteria-form.js +58 -45
  263. package/lib/form/criteria-form.js.map +1 -1
  264. package/lib/form/dtmpl-form.d.ts +11 -2
  265. package/lib/form/dtmpl-form.d.ts.map +1 -1
  266. package/lib/form/dtmpl-form.js +77 -65
  267. package/lib/form/dtmpl-form.js.map +1 -1
  268. package/lib/form/field-group-form.d.ts +12 -3
  269. package/lib/form/field-group-form.d.ts.map +1 -1
  270. package/lib/form/field-group-form.js +26 -18
  271. package/lib/form/field-group-form.js.map +1 -1
  272. package/lib/form/form-Item-group.d.ts +10 -1
  273. package/lib/form/form-Item-group.d.ts.map +1 -1
  274. package/lib/form/form-Item-group.js +43 -26
  275. package/lib/form/form-Item-group.js.map +1 -1
  276. package/lib/import/excel-import.d.ts +12 -3
  277. package/lib/import/excel-import.d.ts.map +1 -1
  278. package/lib/import/excel-import.js +69 -55
  279. package/lib/import/excel-import.js.map +1 -1
  280. package/lib/index.d.ts +42 -39
  281. package/lib/index.d.ts.map +1 -1
  282. package/lib/index.js +43 -39
  283. package/lib/index.js.map +1 -1
  284. package/lib/layout/MainPage.d.ts +1 -1
  285. package/lib/layout/MainPage.d.ts.map +1 -1
  286. package/lib/layout/MainPage.js +47 -37
  287. package/lib/layout/MainPage.js.map +1 -1
  288. package/lib/layout/footer/index.d.ts.map +1 -1
  289. package/lib/layout/header/index.d.ts +1 -1
  290. package/lib/layout/header/index.d.ts.map +1 -1
  291. package/lib/layout/header/index.js +15 -13
  292. package/lib/layout/header/index.js.map +1 -1
  293. package/lib/layout/menu/block.d.ts +13 -1
  294. package/lib/layout/menu/block.d.ts.map +1 -1
  295. package/lib/layout/menu/block.js +66 -8
  296. package/lib/layout/menu/block.js.map +1 -1
  297. package/lib/layout/menu/l2menu-quick-bar.d.ts +11 -2
  298. package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
  299. package/lib/layout/menu/l2menu-quick-bar.js +24 -19
  300. package/lib/layout/menu/l2menu-quick-bar.js.map +1 -1
  301. package/lib/layout/menu/menu-2layers.d.ts +10 -0
  302. package/lib/layout/menu/menu-2layers.d.ts.map +1 -1
  303. package/lib/layout/menu/menu-2layers.js +32 -9
  304. package/lib/layout/menu/menu-2layers.js.map +1 -1
  305. package/lib/layout/menu/reset-password.d.ts +12 -3
  306. package/lib/layout/menu/reset-password.d.ts.map +1 -1
  307. package/lib/layout/menu/reset-password.js +52 -36
  308. package/lib/layout/menu/reset-password.js.map +1 -1
  309. package/lib/layout/menu/user-bar.d.ts +12 -3
  310. package/lib/layout/menu/user-bar.d.ts.map +1 -1
  311. package/lib/layout/menu/user-bar.js +72 -42
  312. package/lib/layout/menu/user-bar.js.map +1 -1
  313. package/lib/layout/menu/userinfo-bar.d.ts +10 -1
  314. package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
  315. package/lib/layout/menu/userinfo-bar.js +11 -10
  316. package/lib/layout/menu/userinfo-bar.js.map +1 -1
  317. package/lib/layout/sidebar/index.css +15 -4
  318. package/lib/layout/sidebar/index.d.ts +2 -2
  319. package/lib/layout/sidebar/index.d.ts.map +1 -1
  320. package/lib/layout/sidebar/index.js +21 -13
  321. package/lib/layout/sidebar/index.js.map +1 -1
  322. package/lib/locale/LocaleButton.d.ts +4 -0
  323. package/lib/locale/LocaleButton.d.ts.map +1 -0
  324. package/lib/locale/LocaleButton.js +24 -0
  325. package/lib/locale/LocaleButton.js.map +1 -0
  326. package/lib/locale/LocaleProvider.d.ts +13 -0
  327. package/lib/locale/LocaleProvider.d.ts.map +1 -0
  328. package/lib/locale/LocaleProvider.js +137 -0
  329. package/lib/locale/LocaleProvider.js.map +1 -0
  330. package/lib/locale/langMp.d.ts +16 -0
  331. package/lib/locale/langMp.d.ts.map +1 -0
  332. package/lib/locale/langMp.js +29 -0
  333. package/lib/locale/langMp.js.map +1 -0
  334. package/lib/locale/translate.d.ts +3 -0
  335. package/lib/locale/translate.d.ts.map +1 -0
  336. package/lib/locale/translate.js +76 -0
  337. package/lib/locale/translate.js.map +1 -0
  338. package/lib/locale/useLocale.d.ts +14 -0
  339. package/lib/locale/useLocale.d.ts.map +1 -0
  340. package/lib/locale/useLocale.js +34 -0
  341. package/lib/locale/useLocale.js.map +1 -0
  342. package/lib/login/login.d.ts +13 -3
  343. package/lib/login/login.d.ts.map +1 -1
  344. package/lib/login/login.js +38 -25
  345. package/lib/login/login.js.map +1 -1
  346. package/lib/login/router-login.d.ts +2 -2
  347. package/lib/login/router-login.d.ts.map +1 -1
  348. package/lib/login/router-login.js +33 -19
  349. package/lib/login/router-login.js.map +1 -1
  350. package/lib/module/dtmpl-edit-card.d.ts +11 -2
  351. package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
  352. package/lib/module/dtmpl-edit-card.js +22 -14
  353. package/lib/module/dtmpl-edit-card.js.map +1 -1
  354. package/lib/module/dtmpl-edit-page.d.ts +12 -3
  355. package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
  356. package/lib/module/dtmpl-edit-page.js +42 -31
  357. package/lib/module/dtmpl-edit-page.js.map +1 -1
  358. package/lib/module/ltmpl-modal.d.ts +10 -1
  359. package/lib/module/ltmpl-modal.d.ts.map +1 -1
  360. package/lib/module/ltmpl-modal.js +15 -8
  361. package/lib/module/ltmpl-modal.js.map +1 -1
  362. package/lib/module/ltmpl-table.d.ts +11 -2
  363. package/lib/module/ltmpl-table.d.ts.map +1 -1
  364. package/lib/module/ltmpl-table.js +39 -39
  365. package/lib/module/ltmpl-table.js.map +1 -1
  366. package/lib/routable/ltmpl-route.d.ts +2 -2
  367. package/lib/routable/ltmpl-route.d.ts.map +1 -1
  368. package/lib/routable/ltmpl-route.js +22 -21
  369. package/lib/routable/ltmpl-route.js.map +1 -1
  370. package/lib/table/act-table.d.ts +12 -3
  371. package/lib/table/act-table.d.ts.map +1 -1
  372. package/lib/table/act-table.js +269 -208
  373. package/lib/table/act-table.js.map +1 -1
  374. package/lib/table/column/column-selector.d.ts.map +1 -1
  375. package/lib/table/column/column-selector.js +20 -18
  376. package/lib/table/column/column-selector.js.map +1 -1
  377. package/lib/table/control-table-x-axis-wrapper.d.ts +5 -0
  378. package/lib/table/control-table-x-axis-wrapper.d.ts.map +1 -0
  379. package/lib/table/control-table-x-axis-wrapper.js +60 -0
  380. package/lib/table/control-table-x-axis-wrapper.js.map +1 -0
  381. package/lib/table/l2-act-table.d.ts +1 -1
  382. package/lib/table/pagination.d.ts +11 -2
  383. package/lib/table/pagination.d.ts.map +1 -1
  384. package/lib/table/pagination.js +13 -12
  385. package/lib/table/pagination.js.map +1 -1
  386. package/lib/table/query-table.d.ts +10 -1
  387. package/lib/table/query-table.d.ts.map +1 -1
  388. package/lib/table/query-table.js +47 -40
  389. package/lib/table/query-table.js.map +1 -1
  390. package/lib/table/relation-table.d.ts +13 -4
  391. package/lib/table/relation-table.d.ts.map +1 -1
  392. package/lib/table/relation-table.js +118 -109
  393. package/lib/table/relation-table.js.map +1 -1
  394. package/lib/table/selected-rows-card.d.ts +10 -1
  395. package/lib/table/selected-rows-card.d.ts.map +1 -1
  396. package/lib/table/selected-rows-card.js +10 -9
  397. package/lib/table/selected-rows-card.js.map +1 -1
  398. package/lib/table/stat/restat.d.ts +10 -1
  399. package/lib/table/stat/restat.d.ts.map +1 -1
  400. package/lib/table/stat/restat.js +10 -9
  401. package/lib/table/stat/restat.js.map +1 -1
  402. package/lib/tmpl/hc-data-source.d.ts.map +1 -1
  403. package/lib/tmpl/hc-data-source.js +21 -14
  404. package/lib/tmpl/hc-data-source.js.map +1 -1
  405. package/lib/tmpl/hcservice-v3.d.ts +2 -0
  406. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  407. package/lib/tmpl/hcservice-v3.js +127 -100
  408. package/lib/tmpl/hcservice-v3.js.map +1 -1
  409. package/lib/tmpl/model-struc-v3.d.ts.map +1 -1
  410. package/lib/tmpl/model-struc-v3.js +19 -18
  411. package/lib/tmpl/model-struc-v3.js.map +1 -1
  412. package/lib/tmpl/superagent.d.ts +2 -2
  413. package/lib/tmpl/superagent.d.ts.map +1 -1
  414. package/lib/tmpl/superagent.js +28 -23
  415. package/lib/tmpl/superagent.js.map +1 -1
  416. package/lib/tree/act-tree.d.ts +10 -1
  417. package/lib/tree/act-tree.d.ts.map +1 -1
  418. package/lib/tree/act-tree.js +26 -20
  419. package/lib/tree/act-tree.js.map +1 -1
  420. package/lib/tree/tmpl-tree.d.ts +11 -2
  421. package/lib/tree/tmpl-tree.d.ts.map +1 -1
  422. package/lib/tree/tmpl-tree.js +85 -64
  423. package/lib/tree/tmpl-tree.js.map +1 -1
  424. package/lib/tree/tree-node.d.ts.map +1 -1
  425. package/lib/tree/tree-node.js.map +1 -1
  426. package/lib/units/index.d.ts.map +1 -1
  427. package/lib/welcome/HCWelcome.js +7 -23
  428. package/lib/welcome/HCWelcome.js.map +1 -1
  429. package/lib/welcome/HCWelcome1.d.ts +4 -0
  430. package/lib/welcome/HCWelcome1.d.ts.map +1 -0
  431. package/lib/welcome/HCWelcome1.js +192 -0
  432. package/lib/welcome/HCWelcome1.js.map +1 -0
  433. package/lib/welcome/quick-entrance.d.ts +12 -3
  434. package/lib/welcome/quick-entrance.d.ts.map +1 -1
  435. package/lib/welcome/quick-entrance.js +21 -17
  436. package/lib/welcome/quick-entrance.js.map +1 -1
  437. package/lib/welcome/workbench.d.ts +12 -3
  438. package/lib/welcome/workbench.d.ts.map +1 -1
  439. package/lib/welcome/workbench.js +23 -19
  440. package/lib/welcome/workbench.js.map +1 -1
  441. package/package.json +1 -1
  442. package/src/aldehyde/controls/action/index.tsx +329 -221
  443. package/src/aldehyde/controls/action/utils.tsx +6 -4
  444. package/src/aldehyde/controls/auto-complete/index.tsx +64 -60
  445. package/src/aldehyde/controls/chemstruc/graph.tsx +175 -139
  446. package/src/aldehyde/controls/collapse-card/index.tsx +96 -54
  447. package/src/aldehyde/controls/color-picker/index.tsx +107 -78
  448. package/src/aldehyde/controls/cquery/cquick-button.tsx +129 -89
  449. package/src/aldehyde/controls/entity-select/entity-select.tsx +643 -523
  450. package/src/aldehyde/controls/entity-select/lab-tree-select.tsx +140 -131
  451. package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +178 -133
  452. package/src/aldehyde/controls/entry-control.tsx +374 -248
  453. package/src/aldehyde/controls/input-number/index.tsx +131 -86
  454. package/src/aldehyde/controls/input-range/index.tsx +51 -40
  455. package/src/aldehyde/controls/password-setter/index.js +81 -63
  456. package/src/aldehyde/controls/progress/index.tsx +59 -46
  457. package/src/aldehyde/controls/relation-existion/index.tsx +125 -87
  458. package/src/aldehyde/controls/rfield/index.tsx +178 -151
  459. package/src/aldehyde/controls/signature/index.tsx +215 -151
  460. package/src/aldehyde/controls/steps/index.tsx +44 -42
  461. package/src/aldehyde/controls/text/ellipsis-text.tsx +79 -53
  462. package/src/aldehyde/controls/upload/index.tsx +125 -109
  463. package/src/aldehyde/controls/view-control.tsx +250 -188
  464. package/src/aldehyde/custom-page/def-custom-page.tsx +17 -0
  465. package/src/aldehyde/custom-page/dtmpl-custom-edit-modal-page.tsx +75 -66
  466. package/src/aldehyde/detail/button/bottom-submit-button-bar.tsx +79 -43
  467. package/src/aldehyde/detail/button/cquery-button-bar.tsx +129 -98
  468. package/src/aldehyde/detail/button/fix-right-submit-button-bar.tsx +161 -113
  469. package/src/aldehyde/detail/edit/fields-edit-card.tsx +124 -87
  470. package/src/aldehyde/detail/edit/modal-row-edit.tsx +81 -60
  471. package/src/aldehyde/detail/edit/post-result/index.tsx +80 -47
  472. package/src/aldehyde/detail/edit/row-edit-card.tsx +158 -107
  473. package/src/aldehyde/detail/rightbar/index.tsx +79 -63
  474. package/src/aldehyde/detail/view/act-dtmpl-view.tsx +177 -124
  475. package/src/aldehyde/detail/view/dtmpl-view.tsx +284 -178
  476. package/src/aldehyde/detail/view/field-view-group.tsx +62 -47
  477. package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +67 -54
  478. package/src/aldehyde/detail/view/snapshot-timeline.tsx +143 -110
  479. package/src/aldehyde/exportor/export-frame.tsx +258 -200
  480. package/src/aldehyde/form/criteria-form.tsx +309 -201
  481. package/src/aldehyde/form/dtmpl-form.tsx +460 -307
  482. package/src/aldehyde/form/field-group-form.tsx +87 -66
  483. package/src/aldehyde/form/form-Item-group.tsx +190 -132
  484. package/src/aldehyde/import/excel-import.tsx +414 -331
  485. package/src/aldehyde/index.tsx +90 -45
  486. package/src/aldehyde/layout/MainPage.tsx +280 -245
  487. package/src/aldehyde/layout/header/index.tsx +59 -53
  488. package/src/aldehyde/layout/menu/block.less +11 -0
  489. package/src/aldehyde/layout/menu/block.tsx +132 -72
  490. package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +137 -118
  491. package/src/aldehyde/layout/menu/menu-2layers.tsx +99 -64
  492. package/src/aldehyde/layout/menu/reset-password.tsx +213 -162
  493. package/src/aldehyde/layout/menu/user-bar.tsx +216 -147
  494. package/src/aldehyde/layout/menu/userinfo-bar.tsx +58 -41
  495. package/src/aldehyde/layout/sidebar/index.css +15 -4
  496. package/src/aldehyde/layout/sidebar/index.tsx +70 -38
  497. package/src/aldehyde/locale/LocaleButton.tsx +31 -0
  498. package/src/aldehyde/locale/LocaleProvider.tsx +166 -0
  499. package/src/aldehyde/locale/langMp.ts +33 -0
  500. package/src/aldehyde/locale/translate.ts +81 -0
  501. package/src/aldehyde/locale/useLocale.ts +50 -0
  502. package/src/aldehyde/login/login.tsx +192 -141
  503. package/src/aldehyde/login/router-login.tsx +54 -21
  504. package/src/aldehyde/module/dtmpl-edit-card.tsx +225 -160
  505. package/src/aldehyde/module/dtmpl-edit-page.tsx +334 -212
  506. package/src/aldehyde/module/ltmpl-modal.tsx +57 -53
  507. package/src/aldehyde/module/ltmpl-table.tsx +329 -240
  508. package/src/aldehyde/routable/ltmpl-route.tsx +220 -196
  509. package/src/aldehyde/table/act-table.tsx +1244 -795
  510. package/src/aldehyde/table/column/column-selector.tsx +111 -72
  511. package/src/aldehyde/table/control-table-x-axis-wrapper.tsx +52 -0
  512. package/src/aldehyde/table/pagination.tsx +66 -59
  513. package/src/aldehyde/table/query-table.tsx +354 -303
  514. package/src/aldehyde/table/relation-table.tsx +781 -571
  515. package/src/aldehyde/table/selected-rows-card.tsx +61 -48
  516. package/src/aldehyde/table/stat/restat.tsx +112 -69
  517. package/src/aldehyde/tmpl/hc-data-source.tsx +381 -296
  518. package/src/aldehyde/tmpl/hcservice-v3.tsx +991 -796
  519. package/src/aldehyde/tmpl/model-struc-v3.tsx +95 -91
  520. package/src/aldehyde/tmpl/superagent.js +148 -142
  521. package/src/aldehyde/tree/act-tree.tsx +206 -138
  522. package/src/aldehyde/tree/tmpl-tree.tsx +627 -353
  523. package/src/aldehyde/tree/tree-node.tsx +0 -3
  524. package/src/aldehyde/welcome/HCWelcome.js +78 -110
  525. package/src/aldehyde/welcome/HCWelcome1.js +260 -0
  526. package/src/aldehyde/welcome/quick-entrance.tsx +82 -71
  527. package/src/aldehyde/welcome/workbench.tsx +83 -68
  528. package/src/aldehyde/custom-page/def-custom-page.js +0 -18
@@ -1,567 +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
- });
155
- }
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
- }
165
- }
166
-
167
- initCache = () => {
168
- this.setState({
169
- optionsCache: {},
170
- codeLabel: {}
171
- })
172
- }
173
-
174
-
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;
280
+ }
206
281
  }
207
-
208
- doClose = () => {
209
- this.setState({
210
- drawCode: undefined,
211
- showEdit: false,
212
- showView: false,
213
- showTable: false,
214
- })
215
-
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
+ }
216
295
  }
217
296
 
218
- drawSubmited = () => {
219
- this.initCache();
220
- this.doClose();
221
- }
297
+ return valueArray;
298
+ };
222
299
 
223
- closeTable = () => {
224
- this.drawSubmited();
225
- }
300
+ toOptions = (value, onEntityClick) => {
301
+ const { fieldConfig } = this.props;
302
+ let options: object[] = [];
303
+ //console.log('options value', value);
226
304
 
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?fieldConfig.sourceId:fieldConfig.id, {
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 sourceId=fieldConfig.sourceId?fieldConfig.sourceId:fieldConfig.id;
489
-
490
- let initOptions = this.toOptions(value, onEntityClick);
491
- let exists;
492
- let properOptions = [...initOptions];
493
- let listHeight = 256;
494
- if (optionCacheKey && optionsCache[optionCacheKey]) {
495
- let optionCache = optionsCache[optionCacheKey];
496
- if (optionCache['pageInfo'] && optionCache.pageInfo.pageSize < 8) {
497
- listHeight = 32 * (optionCache['pageInfo'].pageSize) - 10;
498
- }
499
- for (let option of optionCache.options) {
500
- exists = false;
501
- for (let init of initOptions) {
502
- if (init['value'] == option['value']) {
503
- exists = true;
504
- //用查询的覆盖之前的
505
- init['label'] = option['label'];
506
- }
507
- }
508
- if (!exists) {
509
- 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);
510
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();
511
636
  }
512
- }
513
-
514
- return <><Select
515
- disabled={disabled}
516
- id={id}
517
- listHeight={listHeight}
518
- style={{...style}}
519
- onChange={this.onChange}
520
- value={this.toValueArray(value)}
521
- mode="multiple"
522
- placeholder={`请选择${fieldConfig.title}`}
523
- notFoundContent={loading ? <Spin size={'small'}></Spin> : "无数据"}
524
- allowClear={true}
525
- showArrow={true}
526
- suffixIcon={<SearchOutlined/>}
527
- filterOption={false}
528
- dropdownRender={this.dropdownRender}
529
- tagRender={actions && (actions.indexOf("detail") >= 0 || actions.indexOf("edit") >= 0) ? this.tagRender : undefined}
530
- onSearch={this.debounceFetcher()}
531
- onClick={disabled ? null : () => {
532
- debounce(this.fetchOptions, 100)(undefined)
533
- }}
534
- options={loading ? [] : properOptions}
535
- onPopupScroll={(e) => {
536
- const {target} = e;
537
- if (target['scrollTop'] + target['offsetHeight'] + 1 >= target['scrollHeight']) {
538
- this.debounceFetchNextPage();
539
- }
540
- }}>
541
- </Select>
542
- {showView && drawCode ?
543
- <DtmplViewDrawer serverKey={serverKey} placement={'left'} onClose={this.doClose} open={showView}
544
- sourceId={sourceId} code={drawCode}></DtmplViewDrawer> : null}
545
- {showEdit && ltmplConfig ? ltmplConfig.customEditPagePath ?
546
- <DtmplCustomEditModalPage open={showEdit} onOk={() => {
547
- this.drawSubmited();
548
- }} customPath={ltmplConfig.customEditPagePath} sourceId={sourceId} mainCode={mainCode}
549
- code={drawCode}/>
550
- : <DtmplEditPage serverKey={serverKey} pageType={"modal"} open={showEdit}
551
- onCancel={this.doClose} mainCode={mainCode}
552
- sourceId={sourceId}
553
- code={drawCode}
554
- onOk={this.drawSubmited}/> : null}
555
- {showTable ? <LtmplModal serverKey={serverKey} open={showTable} height={"76vh"}
556
- onCancel={this.closeTable}
557
- sourceId={sourceId}
558
- mainCode={mainCode}
559
- /> : null}
560
-
561
- </>
562
- }
563
-
564
-
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
+ }
565
687
  }
566
-
567
-