aldehyde 0.2.19 → 0.2.21

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 (416) hide show
  1. package/lib/controls/action/index.d.ts +50 -50
  2. package/lib/controls/action/index.d.ts.map +1 -1
  3. package/lib/controls/action/index.js +187 -187
  4. package/lib/controls/action/index.js.map +1 -1
  5. package/lib/controls/action/utils.d.ts +8 -8
  6. package/lib/controls/action/utils.js +109 -109
  7. package/lib/controls/auto-complete/index.d.ts +6 -6
  8. package/lib/controls/auto-complete/index.js +51 -51
  9. package/lib/controls/cascader/index.d.ts +22 -22
  10. package/lib/controls/cascader/index.d.ts.map +1 -1
  11. package/lib/controls/cascader/index.js +107 -106
  12. package/lib/controls/cascader/index.js.map +1 -1
  13. package/lib/controls/chemstruc/graph.d.ts +28 -28
  14. package/lib/controls/chemstruc/graph.d.ts.map +1 -1
  15. package/lib/controls/chemstruc/graph.js +120 -119
  16. package/lib/controls/chemstruc/graph.js.map +1 -1
  17. package/lib/controls/code-editor/sql-code-editor.d.ts +14 -14
  18. package/lib/controls/code-editor/sql-code-editor.js +52 -51
  19. package/lib/controls/code-editor/sql-code-editor.js.map +1 -1
  20. package/lib/controls/collapse-card/index.d.ts +19 -19
  21. package/lib/controls/collapse-card/index.d.ts.map +1 -1
  22. package/lib/controls/collapse-card/index.js +62 -62
  23. package/lib/controls/color-picker/index.d.ts +18 -18
  24. package/lib/controls/color-picker/index.d.ts.map +1 -1
  25. package/lib/controls/color-picker/index.js +59 -59
  26. package/lib/controls/counting-tag/index.d.ts +17 -17
  27. package/lib/controls/counting-tag/index.js +31 -30
  28. package/lib/controls/counting-tag/index.js.map +1 -1
  29. package/lib/controls/cquery/cquick-button.d.ts +23 -23
  30. package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
  31. package/lib/controls/cquery/cquick-button.js +72 -72
  32. package/lib/controls/cquery/cquick-button.js.map +1 -1
  33. package/lib/controls/date-picker/index.d.ts +6 -6
  34. package/lib/controls/date-picker/index.js +83 -83
  35. package/lib/controls/entity-select/entity-select.d.ts +73 -73
  36. package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
  37. package/lib/controls/entity-select/entity-select.js +427 -423
  38. package/lib/controls/entity-select/entity-select.js.map +1 -1
  39. package/lib/controls/entity-select/lab-tree-select.d.ts +24 -24
  40. package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -1
  41. package/lib/controls/entity-select/lab-tree-select.js +121 -120
  42. package/lib/controls/entity-select/lab-tree-select.js.map +1 -1
  43. package/lib/controls/entity-select/popover-entity-select.d.ts +19 -19
  44. package/lib/controls/entity-select/popover-entity-select.js +92 -91
  45. package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
  46. package/lib/controls/entry-control.d.ts +12 -12
  47. package/lib/controls/entry-control.js +202 -202
  48. package/lib/controls/enum-badge/index.d.ts +6 -6
  49. package/lib/controls/enum-badge/index.js +13 -13
  50. package/lib/controls/enum-tag/index.d.ts +6 -6
  51. package/lib/controls/enum-tag/index.js +23 -23
  52. package/lib/controls/file-view/drawer-file-view.d.ts +21 -21
  53. package/lib/controls/file-view/drawer-file-view.d.ts.map +1 -1
  54. package/lib/controls/file-view/drawer-file-view.js +56 -55
  55. package/lib/controls/file-view/drawer-file-view.js.map +1 -1
  56. package/lib/controls/file-view/index.d.ts +27 -27
  57. package/lib/controls/file-view/index.d.ts.map +1 -1
  58. package/lib/controls/file-view/index.js +135 -134
  59. package/lib/controls/file-view/index.js.map +1 -1
  60. package/lib/controls/html-editor/draft.d.ts +21 -21
  61. package/lib/controls/html-editor/draft.d.ts.map +1 -1
  62. package/lib/controls/html-editor/draft.js +121 -121
  63. package/lib/controls/html-editor/draft.js.map +1 -1
  64. package/lib/controls/html-editor/tinymce.d.ts +12 -7
  65. package/lib/controls/html-editor/tinymce.d.ts.map +1 -1
  66. package/lib/controls/html-editor/tinymce.js +44 -43
  67. package/lib/controls/html-editor/tinymce.js.map +1 -1
  68. package/lib/controls/input-number/index.d.ts +6 -6
  69. package/lib/controls/input-number/index.js +68 -68
  70. package/lib/controls/input-range/index.d.ts +6 -6
  71. package/lib/controls/input-range/index.js +27 -27
  72. package/lib/controls/password-setter/index.d.ts +8 -7
  73. package/lib/controls/password-setter/index.d.ts.map +1 -1
  74. package/lib/controls/password-setter/index.js +50 -50
  75. package/lib/controls/progress/index.d.ts +6 -6
  76. package/lib/controls/progress/index.js +44 -44
  77. package/lib/controls/relation-existion/index.d.ts +19 -19
  78. package/lib/controls/relation-existion/index.d.ts.map +1 -1
  79. package/lib/controls/relation-existion/index.js +74 -74
  80. package/lib/controls/rfield/index.d.ts +28 -28
  81. package/lib/controls/rfield/index.d.ts.map +1 -1
  82. package/lib/controls/rfield/index.js +130 -130
  83. package/lib/controls/signature/index.d.ts +30 -30
  84. package/lib/controls/signature/index.d.ts.map +1 -1
  85. package/lib/controls/signature/index.js +129 -128
  86. package/lib/controls/signature/index.js.map +1 -1
  87. package/lib/controls/steps/index.d.ts +6 -6
  88. package/lib/controls/steps/index.js +41 -41
  89. package/lib/controls/text/ellipsis-text.d.ts +21 -21
  90. package/lib/controls/text/ellipsis-text.js +46 -45
  91. package/lib/controls/text/ellipsis-text.js.map +1 -1
  92. package/lib/controls/upload/index.d.ts +14 -14
  93. package/lib/controls/upload/index.js +99 -99
  94. package/lib/controls/view-control.d.ts +9 -9
  95. package/lib/controls/view-control.js +174 -174
  96. package/lib/custom-page/custom-page-router.d.ts +7 -22
  97. package/lib/custom-page/custom-page-router.d.ts.map +1 -1
  98. package/lib/custom-page/custom-page-router.js +66 -64
  99. package/lib/custom-page/custom-page-router.js.map +1 -1
  100. package/lib/custom-page/def-custom-page.d.ts +6 -5
  101. package/lib/custom-page/def-custom-page.d.ts.map +1 -1
  102. package/lib/custom-page/def-custom-page.js +13 -13
  103. package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts +42 -42
  104. package/lib/custom-page/dtmpl-custom-edit-modal-page.js +35 -34
  105. package/lib/custom-page/dtmpl-custom-edit-modal-page.js.map +1 -1
  106. package/lib/detail/button/cquery-button-bar.d.ts +15 -15
  107. package/lib/detail/button/cquery-button-bar.js +74 -74
  108. package/lib/detail/button/submit-button-bar.d.ts +18 -18
  109. package/lib/detail/button/submit-button-bar.d.ts.map +1 -1
  110. package/lib/detail/button/submit-button-bar.js +103 -104
  111. package/lib/detail/button/submit-button-bar.js.map +1 -1
  112. package/lib/detail/edit/dtmpl-edit.d.ts +47 -47
  113. package/lib/detail/edit/dtmpl-edit.d.ts.map +1 -1
  114. package/lib/detail/edit/dtmpl-edit.js +197 -196
  115. package/lib/detail/edit/dtmpl-edit.js.map +1 -1
  116. package/lib/detail/edit/fields-edit-card.d.ts +38 -38
  117. package/lib/detail/edit/fields-edit-card.js +64 -63
  118. package/lib/detail/edit/fields-edit-card.js.map +1 -1
  119. package/lib/detail/edit/modal-row-edit.d.ts +30 -30
  120. package/lib/detail/edit/modal-row-edit.js +56 -55
  121. package/lib/detail/edit/modal-row-edit.js.map +1 -1
  122. package/lib/detail/edit/post-result/index.d.ts +16 -16
  123. package/lib/detail/edit/post-result/index.js +27 -27
  124. package/lib/detail/edit/row-edit-card.d.ts +41 -41
  125. package/lib/detail/edit/row-edit-card.d.ts.map +1 -1
  126. package/lib/detail/edit/row-edit-card.js +84 -83
  127. package/lib/detail/edit/row-edit-card.js.map +1 -1
  128. package/lib/detail/edit/row-editor.d.ts +32 -32
  129. package/lib/detail/edit/row-editor.d.ts.map +1 -1
  130. package/lib/detail/edit/row-editor.js +56 -55
  131. package/lib/detail/edit/row-editor.js.map +1 -1
  132. package/lib/detail/rightbar/index.d.ts +19 -19
  133. package/lib/detail/rightbar/index.js +51 -50
  134. package/lib/detail/rightbar/index.js.map +1 -1
  135. package/lib/detail/view/act-dtmpl-view.d.ts +43 -43
  136. package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
  137. package/lib/detail/view/act-dtmpl-view.js +96 -96
  138. package/lib/detail/view/act-dtmpl-view.js.map +1 -1
  139. package/lib/detail/view/dtmpl-view.d.ts +41 -41
  140. package/lib/detail/view/dtmpl-view.d.ts.map +1 -1
  141. package/lib/detail/view/dtmpl-view.js +115 -115
  142. package/lib/detail/view/dtmpl-view.js.map +1 -1
  143. package/lib/detail/view/field-view-group.d.ts +16 -16
  144. package/lib/detail/view/field-view-group.js +50 -50
  145. package/lib/detail/view/modal-dtmpl-view.d.ts +27 -27
  146. package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
  147. package/lib/detail/view/modal-dtmpl-view.js +32 -31
  148. package/lib/detail/view/modal-dtmpl-view.js.map +1 -1
  149. package/lib/detail/view/snapshot-timeline.d.ts +31 -31
  150. package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
  151. package/lib/detail/view/snapshot-timeline.js +89 -89
  152. package/lib/detail/view/snapshot-timeline.js.map +1 -1
  153. package/lib/exportor/export-frame.d.ts +49 -49
  154. package/lib/exportor/export-frame.d.ts.map +1 -1
  155. package/lib/exportor/export-frame.js +142 -141
  156. package/lib/exportor/export-frame.js.map +1 -1
  157. package/lib/exportor/index.d.ts +15 -15
  158. package/lib/exportor/index.js +43 -43
  159. package/lib/form/criteria-form.d.ts +19 -19
  160. package/lib/form/criteria-form.js +147 -147
  161. package/lib/form/dtmpl-form.d.ts +44 -44
  162. package/lib/form/dtmpl-form.d.ts.map +1 -1
  163. package/lib/form/dtmpl-form.js +204 -203
  164. package/lib/form/dtmpl-form.js.map +1 -1
  165. package/lib/form/field-group-form.d.ts +20 -20
  166. package/lib/form/field-group-form.js +57 -57
  167. package/lib/form/fields-form.d.ts +19 -19
  168. package/lib/form/fields-form.js +31 -31
  169. package/lib/form/form-Item-group.d.ts +29 -29
  170. package/lib/form/form-Item-group.d.ts.map +1 -1
  171. package/lib/form/form-Item-group.js +108 -107
  172. package/lib/form/form-Item-group.js.map +1 -1
  173. package/lib/icon/index.d.ts +10 -10
  174. package/lib/icon/index.js +21 -21
  175. package/lib/import/excel-import.d.ts +47 -47
  176. package/lib/import/excel-import.d.ts.map +1 -1
  177. package/lib/import/excel-import.js +234 -234
  178. package/lib/import/template-builder.d.ts +28 -20
  179. package/lib/import/template-builder.d.ts.map +1 -1
  180. package/lib/import/template-builder.js +425 -425
  181. package/lib/index.d.ts +41 -40
  182. package/lib/index.d.ts.map +1 -1
  183. package/lib/index.js +79 -78
  184. package/lib/index.js.map +1 -1
  185. package/lib/layout/MainPage.d.ts +4 -33
  186. package/lib/layout/MainPage.d.ts.map +1 -1
  187. package/lib/layout/MainPage.js +204 -204
  188. package/lib/layout/MainPage.js.map +1 -1
  189. package/lib/layout/footer/index.d.ts +6 -5
  190. package/lib/layout/footer/index.d.ts.map +1 -1
  191. package/lib/layout/footer/index.js +10 -10
  192. package/lib/layout/header/index.d.ts +14 -14
  193. package/lib/layout/header/index.js +35 -35
  194. package/lib/layout/menu/block.d.ts +16 -8
  195. package/lib/layout/menu/block.d.ts.map +1 -1
  196. package/lib/layout/menu/block.js +46 -47
  197. package/lib/layout/menu/block.js.map +1 -1
  198. package/lib/layout/menu/l2menu-message-bar.d.ts +23 -23
  199. package/lib/layout/menu/l2menu-message-bar.d.ts.map +1 -1
  200. package/lib/layout/menu/l2menu-message-bar.js +96 -96
  201. package/lib/layout/menu/l2menu-quick-bar.d.ts +29 -29
  202. package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
  203. package/lib/layout/menu/l2menu-quick-bar.js +93 -93
  204. package/lib/layout/menu/menu-2layers.d.ts +13 -2
  205. package/lib/layout/menu/menu-2layers.d.ts.map +1 -1
  206. package/lib/layout/menu/menu-2layers.js +69 -70
  207. package/lib/layout/menu/menu-2layers.js.map +1 -1
  208. package/lib/layout/menu/menu-render.d.ts +8 -8
  209. package/lib/layout/menu/menu-render.js +74 -74
  210. package/lib/layout/menu/reset-password.d.ts +24 -24
  211. package/lib/layout/menu/reset-password.d.ts.map +1 -1
  212. package/lib/layout/menu/reset-password.js +113 -113
  213. package/lib/layout/menu/user-bar.d.ts +22 -22
  214. package/lib/layout/menu/user-bar.js +99 -99
  215. package/lib/layout/menu/userinfo-bar.d.ts +16 -16
  216. package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
  217. package/lib/layout/menu/userinfo-bar.js +43 -43
  218. package/lib/layout/sidebar/index.d.ts +11 -11
  219. package/lib/layout/sidebar/index.js +17 -17
  220. package/lib/login/context-setter.d.ts +23 -23
  221. package/lib/login/context-setter.d.ts.map +1 -1
  222. package/lib/login/context-setter.js +97 -97
  223. package/lib/login/context-setter.js.map +1 -1
  224. package/lib/login/login-context.d.ts +21 -10
  225. package/lib/login/login-context.d.ts.map +1 -1
  226. package/lib/login/login-context.js +126 -126
  227. package/lib/login/login.d.ts +2 -10
  228. package/lib/login/login.d.ts.map +1 -1
  229. package/lib/login/login.js +105 -101
  230. package/lib/login/login.js.map +1 -1
  231. package/lib/module/dtmpl-edit-card.d.ts +42 -42
  232. package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
  233. package/lib/module/dtmpl-edit-card.js +162 -162
  234. package/lib/module/dtmpl-edit-card.js.map +1 -1
  235. package/lib/module/dtmpl-edit-drawer.d.ts +16 -16
  236. package/lib/module/dtmpl-edit-drawer.js +7 -7
  237. package/lib/module/dtmpl-edit-modal.d.ts +17 -17
  238. package/lib/module/dtmpl-edit-modal.js +7 -7
  239. package/lib/module/dtmpl-edit-page.d.ts +59 -59
  240. package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
  241. package/lib/module/dtmpl-edit-page.js +191 -191
  242. package/lib/module/dtmpl-edit-page.js.map +1 -1
  243. package/lib/module/dtmpl-editor.d.ts +38 -38
  244. package/lib/module/dtmpl-editor.d.ts.map +1 -1
  245. package/lib/module/dtmpl-editor.js +146 -145
  246. package/lib/module/dtmpl-editor.js.map +1 -1
  247. package/lib/module/dtmpl-view-card.d.ts +18 -18
  248. package/lib/module/dtmpl-view-card.d.ts.map +1 -1
  249. package/lib/module/dtmpl-view-card.js +45 -45
  250. package/lib/module/dtmpl-view-drawer.d.ts +26 -26
  251. package/lib/module/dtmpl-view-drawer.js +39 -39
  252. package/lib/module/dtmpl-view-drawer.js.map +1 -1
  253. package/lib/module/dtmpl-view-modal.d.ts +27 -27
  254. package/lib/module/dtmpl-view-modal.js +35 -35
  255. package/lib/module/dtmpl-view-modal.js.map +1 -1
  256. package/lib/module/ltmpl-drawer.d.ts +28 -28
  257. package/lib/module/ltmpl-drawer.js +37 -36
  258. package/lib/module/ltmpl-drawer.js.map +1 -1
  259. package/lib/module/ltmpl-modal.d.ts +28 -28
  260. package/lib/module/ltmpl-modal.js +36 -35
  261. package/lib/module/ltmpl-modal.js.map +1 -1
  262. package/lib/module/ltmpl-table.d.ts +61 -56
  263. package/lib/module/ltmpl-table.d.ts.map +1 -1
  264. package/lib/module/ltmpl-table.js +217 -210
  265. package/lib/module/ltmpl-table.js.map +1 -1
  266. package/lib/routable/dtmpl-route.d.ts +9 -30
  267. package/lib/routable/dtmpl-route.d.ts.map +1 -1
  268. package/lib/routable/dtmpl-route.js +151 -154
  269. package/lib/routable/dtmpl-route.js.map +1 -1
  270. package/lib/routable/import-route.d.ts +5 -12
  271. package/lib/routable/import-route.d.ts.map +1 -1
  272. package/lib/routable/import-route.js +29 -28
  273. package/lib/routable/import-route.js.map +1 -1
  274. package/lib/routable/ltmpl-route.d.ts +10 -28
  275. package/lib/routable/ltmpl-route.d.ts.map +1 -1
  276. package/lib/routable/ltmpl-route.js +188 -169
  277. package/lib/routable/ltmpl-route.js.map +1 -1
  278. package/lib/routable/withroute.d.ts +3 -0
  279. package/lib/routable/withroute.d.ts.map +1 -0
  280. package/lib/routable/withroute.js +11 -0
  281. package/lib/routable/withroute.js.map +1 -0
  282. package/lib/table/act-table.d.ts +90 -89
  283. package/lib/table/act-table.d.ts.map +1 -1
  284. package/lib/table/act-table.js +529 -532
  285. package/lib/table/act-table.js.map +1 -1
  286. package/lib/table/column/column-selector.d.ts +24 -24
  287. package/lib/table/column/column-selector.js +59 -59
  288. package/lib/table/column/column-selector.js.map +1 -1
  289. package/lib/table/l2-act-table.d.ts +27 -22
  290. package/lib/table/l2-act-table.d.ts.map +1 -1
  291. package/lib/table/l2-act-table.js +86 -79
  292. package/lib/table/l2-act-table.js.map +1 -1
  293. package/lib/table/modal-select-table.d.ts +46 -41
  294. package/lib/table/modal-select-table.d.ts.map +1 -1
  295. package/lib/table/modal-select-table.js +215 -207
  296. package/lib/table/modal-select-table.js.map +1 -1
  297. package/lib/table/pagination.d.ts +16 -16
  298. package/lib/table/pagination.d.ts.map +1 -1
  299. package/lib/table/pagination.js +39 -39
  300. package/lib/table/pagination.js.map +1 -1
  301. package/lib/table/query-table.d.ts +73 -64
  302. package/lib/table/query-table.d.ts.map +1 -1
  303. package/lib/table/query-table.js +264 -256
  304. package/lib/table/query-table.js.map +1 -1
  305. package/lib/table/relation-table.d.ts +64 -64
  306. package/lib/table/relation-table.d.ts.map +1 -1
  307. package/lib/table/relation-table.js +425 -425
  308. package/lib/table/relation-table.js.map +1 -1
  309. package/lib/table/select-table.d.ts +45 -40
  310. package/lib/table/select-table.d.ts.map +1 -1
  311. package/lib/table/select-table.js +226 -220
  312. package/lib/table/select-table.js.map +1 -1
  313. package/lib/table/selected-rows-card.d.ts +15 -15
  314. package/lib/table/selected-rows-card.js +46 -46
  315. package/lib/table/stat/restat.d.ts +25 -25
  316. package/lib/table/stat/restat.d.ts.map +1 -1
  317. package/lib/table/stat/restat.js +60 -60
  318. package/lib/table/stat/restat.js.map +1 -1
  319. package/lib/table/table-util.d.ts +4 -4
  320. package/lib/table/table-util.js +25 -25
  321. package/lib/tmpl/control-type-supportor.d.ts +8 -8
  322. package/lib/tmpl/control-type-supportor.js +98 -98
  323. package/lib/tmpl/hc-data-source.d.ts +25 -25
  324. package/lib/tmpl/hc-data-source.js +331 -331
  325. package/lib/tmpl/hcservice-v3.d.ts +77 -76
  326. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  327. package/lib/tmpl/hcservice-v3.js +803 -787
  328. package/lib/tmpl/hcservice-v3.js.map +1 -1
  329. package/lib/tmpl/interface.d.ts +272 -269
  330. package/lib/tmpl/interface.d.ts.map +1 -1
  331. package/lib/tmpl/interface.js +3 -3
  332. package/lib/tmpl/interface.js.map +1 -1
  333. package/lib/tmpl/superagent.d.ts +9 -9
  334. package/lib/tmpl/superagent.js +142 -142
  335. package/lib/tmpl/tmpl-config-analysis.d.ts +6 -6
  336. package/lib/tmpl/tmpl-config-analysis.js +106 -106
  337. package/lib/units/EncryptUtils.d.ts +6 -6
  338. package/lib/units/EncryptUtils.js +30 -29
  339. package/lib/units/EncryptUtils.js.map +1 -1
  340. package/lib/units/index.d.ts +80 -81
  341. package/lib/units/index.d.ts.map +1 -1
  342. package/lib/units/index.js +747 -742
  343. package/lib/units/index.js.map +1 -1
  344. package/lib/units/storage.d.ts +2 -2
  345. package/lib/units/storage.js +1 -1
  346. package/lib/welcome/HCWelcome.d.ts +17 -13
  347. package/lib/welcome/HCWelcome.d.ts.map +1 -1
  348. package/lib/welcome/HCWelcome.js +199 -198
  349. package/lib/welcome/HCWelcome.js.map +1 -1
  350. package/lib/welcome/quick-entrance.d.ts +19 -19
  351. package/lib/welcome/quick-entrance.d.ts.map +1 -1
  352. package/lib/welcome/quick-entrance.js +78 -78
  353. package/lib/welcome/workbench.d.ts +19 -19
  354. package/lib/welcome/workbench.d.ts.map +1 -1
  355. package/lib/welcome/workbench.js +77 -77
  356. package/package.json +10 -10
  357. package/src/aldehyde/controls/action/index.tsx +2 -3
  358. package/src/aldehyde/controls/cascader/index.tsx +1 -1
  359. package/src/aldehyde/controls/chemstruc/graph.tsx +2 -2
  360. package/src/aldehyde/controls/collapse-card/index.tsx +1 -1
  361. package/src/aldehyde/controls/color-picker/index.tsx +1 -1
  362. package/src/aldehyde/controls/cquery/cquick-button.tsx +1 -1
  363. package/src/aldehyde/controls/entity-select/entity-select.tsx +17 -20
  364. package/src/aldehyde/controls/entity-select/lab-tree-select.tsx +1 -1
  365. package/src/aldehyde/controls/file-view/drawer-file-view.tsx +1 -1
  366. package/src/aldehyde/controls/file-view/index.tsx +1 -1
  367. package/src/aldehyde/controls/html-editor/draft.tsx +2 -2
  368. package/src/aldehyde/controls/relation-existion/index.tsx +1 -1
  369. package/src/aldehyde/controls/rfield/index.tsx +4 -4
  370. package/src/aldehyde/controls/signature/index.tsx +3 -3
  371. package/src/aldehyde/custom-page/custom-page-router.tsx +18 -15
  372. package/src/aldehyde/detail/button/submit-button-bar.tsx +1 -2
  373. package/src/aldehyde/detail/edit/dtmpl-edit.tsx +11 -11
  374. package/src/aldehyde/detail/edit/row-edit-card.tsx +1 -1
  375. package/src/aldehyde/detail/edit/row-editor.tsx +1 -1
  376. package/src/aldehyde/detail/view/act-dtmpl-view.tsx +6 -6
  377. package/src/aldehyde/detail/view/dtmpl-view.tsx +4 -4
  378. package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +0 -2
  379. package/src/aldehyde/detail/view/snapshot-timeline.tsx +2 -2
  380. package/src/aldehyde/exportor/export-frame.tsx +11 -11
  381. package/src/aldehyde/form/dtmpl-form.tsx +3 -3
  382. package/src/aldehyde/form/form-Item-group.tsx +1 -1
  383. package/src/aldehyde/import/excel-import.tsx +11 -11
  384. package/src/aldehyde/index.tsx +4 -2
  385. package/src/aldehyde/layout/MainPage.tsx +17 -19
  386. package/src/aldehyde/layout/menu/block.tsx +3 -3
  387. package/src/aldehyde/layout/menu/l2menu-message-bar.tsx +3 -3
  388. package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +4 -4
  389. package/src/aldehyde/layout/menu/menu-2layers.tsx +3 -4
  390. package/src/aldehyde/layout/menu/menu-render.tsx +1 -1
  391. package/src/aldehyde/layout/menu/reset-password.tsx +3 -3
  392. package/src/aldehyde/layout/menu/userinfo-bar.tsx +1 -1
  393. package/src/aldehyde/login/context-setter.tsx +3 -3
  394. package/src/aldehyde/login/login.js +9 -2
  395. package/src/aldehyde/module/dtmpl-edit-card.tsx +8 -8
  396. package/src/aldehyde/module/dtmpl-edit-page.tsx +8 -8
  397. package/src/aldehyde/module/dtmpl-editor.tsx +5 -5
  398. package/src/aldehyde/module/dtmpl-view-card.tsx +1 -1
  399. package/src/aldehyde/module/ltmpl-table.tsx +22 -11
  400. package/src/aldehyde/routable/dtmpl-route.tsx +32 -34
  401. package/src/aldehyde/routable/import-route.tsx +4 -3
  402. package/src/aldehyde/routable/ltmpl-route.tsx +100 -75
  403. package/src/aldehyde/routable/withroute.tsx +22 -0
  404. package/src/aldehyde/table/act-table.tsx +31 -32
  405. package/src/aldehyde/table/l2-act-table.tsx +15 -8
  406. package/src/aldehyde/table/modal-select-table.tsx +22 -12
  407. package/src/aldehyde/table/pagination.tsx +3 -4
  408. package/src/aldehyde/table/query-table.tsx +63 -51
  409. package/src/aldehyde/table/relation-table.tsx +9 -9
  410. package/src/aldehyde/table/select-table.tsx +22 -10
  411. package/src/aldehyde/table/stat/restat.tsx +2 -2
  412. package/src/aldehyde/tmpl/hcservice-v3.tsx +15 -0
  413. package/src/aldehyde/tmpl/interface.tsx +5 -1
  414. package/src/aldehyde/units/index.tsx +18 -13
  415. package/src/aldehyde/welcome/quick-entrance.tsx +1 -1
  416. package/src/aldehyde/welcome/workbench.tsx +1 -1
@@ -1,788 +1,804 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import Units from '../units';
11
- import Super from "./superagent";
12
- import { message } from 'antd';
13
- import EncryptUtils from '../units/EncryptUtils';
14
- // import moment from 'moment';
15
- import format from 'dayjs';
16
- import HCDataSource from "./hc-data-source";
17
- import { ProgramConfig } from "../index";
18
- export default class HcserviceV3 {
19
- static requestEnum(mstrucIds, path) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- if (!path) {
22
- return yield this.requestEnumWithPath(mstrucIds, "/enum");
23
- }
24
- else {
25
- return yield this.requestEnumWithPath(mstrucIds, path);
26
- }
27
- });
28
- }
29
- static requestEnumWithPath(mstrucIds, path) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- if (mstrucIds.length > 0) {
32
- let res = yield Super.super({
33
- url: `/v3${path}`,
34
- query: {
35
- mstrucIds
36
- },
37
- });
38
- return res.enumMap;
39
- }
40
- else {
41
- return {};
42
- }
43
- });
44
- }
45
- static requestOptions(mstrucId) {
46
- return __awaiter(this, void 0, void 0, function* () {
47
- return yield this.requestEnum([mstrucId]);
48
- });
49
- }
50
- // static async requestSelect(requestedMap, selectMSFieldIdArray) {
51
- // //先从当前状态从中找,没有的才去查
52
- // //后续可以放在缓存里,但需要一些策略和技巧
53
- // if (!requestedMap) {
54
- // requestedMap = await this.requestSelectS(selectMSFieldIdArray);
55
- // } else {
56
- // let needRequest = []
57
- // selectMSFieldIdArray.forEach(function (item, index, arr) {
58
- // if (!requestedMap[item]) {
59
- // needRequest.push(item);
60
- // }
61
- // });
62
- // let subOptionsMap = await HcserviceV3.requestSelectS(needRequest);
63
- // for (let key in subOptionsMap) {
64
- // requestedMap[key] = subOptionsMap[key];
65
- // }
66
- // }
67
- // return requestedMap;
68
- // }
69
- static requestDtmplConfig(sourceId) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- let url = `/v3/dtmpl/config`;
72
- let res = yield Super.super({
73
- url,
74
- method: "GET",
75
- query: { sourceId }
76
- });
77
- return res.dtmplConfig;
78
- });
79
- }
80
- static requestViewDtmplConfig(sourceId) {
81
- return __awaiter(this, void 0, void 0, function* () {
82
- let url = `/v3/view-dtmpl/config`;
83
- let res = yield Super.super({
84
- url,
85
- method: "GET",
86
- query: { sourceId }
87
- });
88
- return res.dtmplConfig;
89
- });
90
- }
91
- static requestAddDtmplConfig(sourceId) {
92
- return __awaiter(this, void 0, void 0, function* () {
93
- let url = `/v3/add-dtmpl/config`;
94
- let res = yield Super.super({
95
- url,
96
- method: "GET",
97
- query: { sourceId }
98
- });
99
- return res.dtmplConfig;
100
- });
101
- }
102
- // static async requestUserDtmplConfig() {
103
- // let url = `/v3/user/dtmpl/config`
104
- // let res = await Super.super({
105
- // url,
106
- // method: "GET",
107
- // });
108
- // return res.dtmplConfig;
109
- // }
110
- static requestSelectConfig(sourceId) {
111
- return __awaiter(this, void 0, void 0, function* () {
112
- let url = `/v3/select/config`;
113
- let res = yield Super.super({
114
- url,
115
- method: "GET",
116
- query: { sourceId }
117
- });
118
- return res.selectConfig;
119
- });
120
- }
121
- static requestLtmplConfig(sourceId) {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- let url = `/v3/ltmpl/config`;
124
- let res = yield Super.super({
125
- url,
126
- method: "GET",
127
- query: { sourceId }
128
- });
129
- return res;
130
- });
131
- }
132
- static requestL2LtmplConfig(sourceId) {
133
- return __awaiter(this, void 0, void 0, function* () {
134
- let url = `/v3/l2/ltmpl/config`;
135
- let res = yield Super.super({
136
- url,
137
- method: "GET",
138
- query: { sourceId }
139
- });
140
- return res;
141
- });
142
- }
143
- static requestLtmplQueryKey(sourceId, condition) {
144
- return __awaiter(this, void 0, void 0, function* () {
145
- //console.log('condition:',condition);
146
- let url = `/v3/ltmpl/query/key`;
147
- let res = yield Super.super({
148
- url: url,
149
- method: 'GET',
150
- query: Object.assign(Object.assign({}, condition), { sourceId })
151
- });
152
- return res;
153
- });
154
- }
155
- static requestLtmplQueryTop(sourceId, condition) {
156
- return __awaiter(this, void 0, void 0, function* () {
157
- // console.log('condition:',condition);
158
- let url = `/v3/ltmpl/top-data`;
159
- return yield this.requestCommonLtmplQueryTop(sourceId, condition, url);
160
- });
161
- }
162
- static requestMstrucLtmplQueryTop(sourceId, condition) {
163
- return __awaiter(this, void 0, void 0, function* () {
164
- //console.log('condition:',condition);
165
- let url = `/v3/mstruc/ltmpl/top-data`;
166
- return yield this.requestCommonLtmplQueryTop(sourceId, condition, url);
167
- });
168
- }
169
- static requestCommonLtmplQueryTop(sourceId, condition, url) {
170
- return __awaiter(this, void 0, void 0, function* () {
171
- let res = yield Super.super({
172
- url: url,
173
- method: 'GET',
174
- query: Object.assign(Object.assign({}, condition), { sourceId })
175
- });
176
- return res;
177
- });
178
- }
179
- static requestSelectedData(sourceId, codes) {
180
- return __awaiter(this, void 0, void 0, function* () {
181
- if (!codes) {
182
- message.warning("没有选择实体");
183
- return null;
184
- }
185
- let url = `/v3/field-group/data/selected`;
186
- let res = yield Super.super({
187
- url: url,
188
- query: { codes, sourceId },
189
- method: 'GET'
190
- });
191
- if (res.status === "success") {
192
- return res.entities;
193
- }
194
- else {
195
- message.error("没有找到实体!");
196
- return null;
197
- }
198
- });
199
- }
200
- static requestVersionList(sourceId, code) {
201
- return __awaiter(this, void 0, void 0, function* () {
202
- let res = yield Super.super({
203
- url: `/v3/dtmpl/data/versions`,
204
- query: {
205
- pageNo: 1,
206
- sourceId,
207
- code
208
- },
209
- method: 'GET'
210
- });
211
- return res.versions;
212
- });
213
- }
214
- static requestCommonDtmplData(sourceId, code, versionId, url) {
215
- return __awaiter(this, void 0, void 0, function* () {
216
- // if(sourceId=="user"){
217
- // return this.requestUserDtmplData();
218
- // }
219
- let res = yield Super.super({
220
- url: url,
221
- query: {
222
- code, versionId, sourceId
223
- },
224
- method: 'GET'
225
- });
226
- if (res.status === "success") {
227
- return res.entity;
228
- }
229
- else {
230
- message.error("实体不存在!");
231
- return null;
232
- }
233
- });
234
- }
235
- static requestDtmplData(sourceId, code, versionId) {
236
- return __awaiter(this, void 0, void 0, function* () {
237
- let url = `/v3/dtmpl/data`;
238
- return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
239
- });
240
- }
241
- static requestMstrucDtmplData(sourceId, code, versionId) {
242
- return __awaiter(this, void 0, void 0, function* () {
243
- let url = `/v3/mstruc/dtmpl/data`;
244
- return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
245
- });
246
- }
247
- static requestViewDtmplData(sourceId, code, versionId) {
248
- return __awaiter(this, void 0, void 0, function* () {
249
- let url = `/v3/view-dtmpl/data`;
250
- return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
251
- });
252
- }
253
- static requestMstrucViewDtmplData(sourceId, code, versionId) {
254
- return __awaiter(this, void 0, void 0, function* () {
255
- let url = `/v3/mstruc/view-dtmpl/data`;
256
- return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
257
- });
258
- }
259
- static postCommonDtmplData(sourceId, formDataObj, message, url) {
260
- return __awaiter(this, void 0, void 0, function* () {
261
- const formData = new FormData();
262
- for (let k in formDataObj) {
263
- if (!k.startsWith("$virtual")) {
264
- formData.append(k, formDataObj[k] || formDataObj[k] == 0 ? formDataObj[k] : "");
265
- }
266
- }
267
- formData.append('sourceId', sourceId.toString());
268
- let res = yield Super.super({
269
- url: url,
270
- data: formData,
271
- method: 'POST'
272
- }, 'formdata');
273
- let code = null;
274
- if (res) {
275
- if (res.status === "success") {
276
- let msg = "";
277
- if (res.message) {
278
- msg = res.message;
279
- }
280
- if (message) {
281
- message.success("保存成功! " + msg);
282
- }
283
- code = res.entityCode ? res.entityCode : res.code;
284
- }
285
- else {
286
- if (message) {
287
- message.error("保存失败");
288
- }
289
- }
290
- }
291
- else {
292
- if (message) {
293
- message.error("保存成功");
294
- }
295
- }
296
- return { code, status: res.status };
297
- });
298
- }
299
- static postDtmplData(sourceId, formDataObj, message) {
300
- return __awaiter(this, void 0, void 0, function* () {
301
- let url = `/v3/dtmpl/data`;
302
- return yield this.postCommonDtmplData(sourceId, formDataObj, message, url);
303
- });
304
- }
305
- static postMstrucDtmplData(sourceId, formDataObj, message) {
306
- return __awaiter(this, void 0, void 0, function* () {
307
- let url = `/v3/mstruc/dtmpl/data`;
308
- return yield this.postCommonDtmplData(sourceId, formDataObj, message, url);
309
- });
310
- }
311
- static postFileAction(file) {
312
- return Units.api() + `/v3/upload`;
313
- }
314
- static postFile(formData, message) {
315
- return __awaiter(this, void 0, void 0, function* () {
316
- let res = yield Super.super({
317
- url: `/v3/upload`,
318
- data: formData,
319
- method: 'POST'
320
- }, 'formdata');
321
- let fileKey = null;
322
- if (res) {
323
- if (res.status === "success") {
324
- if (message) {
325
- message.success("上传成功! ");
326
- }
327
- fileKey = res.fileKey;
328
- }
329
- }
330
- else {
331
- if (message) {
332
- message.error("上传失败!");
333
- }
334
- }
335
- return fileKey;
336
- });
337
- }
338
- static requestL2LtmplQueryKey(sourceId, condition) {
339
- return __awaiter(this, void 0, void 0, function* () {
340
- let url = `v3/l2/ltmpl/query/key`;
341
- let res = yield Super.super({
342
- url: url,
343
- method: 'GET',
344
- query: Object.assign(Object.assign({}, condition), { sourceId })
345
- });
346
- return res;
347
- });
348
- }
349
- static requestLtmplCount(sourceId) {
350
- return __awaiter(this, void 0, void 0, function* () {
351
- let url = `/v3/ltmpl/data/count`;
352
- let res = yield Super.super({
353
- url: url,
354
- query: { sourceId },
355
- method: 'GET',
356
- });
357
- return res.count;
358
- });
359
- }
360
- // static setCriteriasValue(criterias, criteriaValueMap) {
361
- // criterias.forEach((item) => {
362
- // for (let k in criteriaValueMap) {
363
- // if (k === item.id) {
364
- // item.value = criteriaValueMap[k]
365
- // }
366
- // }
367
- // });
368
- // return criterias;
369
- // }
370
- //
371
- // static setCriteriasValueCondition(criterias, condition) {
372
- // criterias.forEach((item) => {
373
- // for (let k of Object.keys(condition)) {
374
- // if (k == "c_" + item.id) {
375
- // item.value = condition[k]
376
- // }
377
- // }
378
- // });
379
- // return criterias;
380
- // }
381
- static requestQueryData(queryKey, pageInfo) {
382
- return __awaiter(this, void 0, void 0, function* () {
383
- let res = yield Super.super({
384
- url: `/v3/ltmpl/query/data`,
385
- method: 'GET',
386
- query: Object.assign({ queryKey }, pageInfo)
387
- });
388
- return res;
389
- });
390
- }
391
- static getCodesOfSelectedRows(selectedRows) {
392
- let codes = [];
393
- if (!selectedRows || selectedRows.length < 1) {
394
- return;
395
- }
396
- for (let item of selectedRows) {
397
- if (item.code) {
398
- codes.push(item.code);
399
- }
400
- else {
401
- message.error("没找到所选数据的Code!!");
402
- }
403
- }
404
- if (codes.length < 1) {
405
- message.error("没找到所选数据的Code!!");
406
- }
407
- return codes;
408
- }
409
- static deleteData(sourceId, selectedRows) {
410
- return __awaiter(this, void 0, void 0, function* () {
411
- const codes = this.getCodesOfSelectedRows(selectedRows);
412
- return yield this.deleteByCode(sourceId, codes);
413
- });
414
- }
415
- static deleteByCode(sourceId, codes) {
416
- return __awaiter(this, void 0, void 0, function* () {
417
- let res = yield Super.super({
418
- url: `/v3/ltmpl/data`,
419
- data: {
420
- codes, sourceId
421
- },
422
- method: 'DELETE',
423
- });
424
- if (res.status == 'success') {
425
- message.success("删除成功");
426
- return true;
427
- }
428
- else {
429
- message.error("删除失败");
430
- //console.log("删除失败消息",res.message);
431
- return false;
432
- }
433
- });
434
- }
435
- static requestQueryCount(queryKey) {
436
- return __awaiter(this, void 0, void 0, function* () {
437
- let res = yield Super.super({
438
- url: `/v3/ltmpl/query/count`,
439
- method: "GET",
440
- query: { queryKey }
441
- });
442
- return res.count;
443
- });
444
- }
445
- static requestFile(path) {
446
- return __awaiter(this, void 0, void 0, function* () {
447
- let res = yield Super.super({
448
- url: "/v3/files/" + path,
449
- method: "GET"
450
- });
451
- return res;
452
- });
453
- }
454
- static postActions(actionId, selectedRows, actionDataObj) {
455
- return __awaiter(this, void 0, void 0, function* () {
456
- const codes = this.getCodesOfSelectedRows(selectedRows);
457
- const formData = new FormData();
458
- for (let k in actionDataObj) {
459
- formData.append(k, actionDataObj[k] ? actionDataObj[k] : "");
460
- }
461
- formData.append('sourceId', actionId.toString());
462
- formData.append('codes', codes.join(","));
463
- let res = yield Super.super({
464
- url: `/v3/action`,
465
- data: formData,
466
- method: 'POST'
467
- }, 'formdata');
468
- return res;
469
- });
470
- }
471
- static postJumps(jumpId, code) {
472
- return __awaiter(this, void 0, void 0, function* () {
473
- let res = yield Super.super({
474
- url: `/v3/jump`,
475
- query: {
476
- code,
477
- sourceId: jumpId,
478
- },
479
- method: "GET",
480
- });
481
- return res;
482
- });
483
- }
484
- static increCalc(sourceId, params = {}) {
485
- return __awaiter(this, void 0, void 0, function* () {
486
- let res = yield Super.super({
487
- url: `/v3/stat/increcalc`,
488
- method: "POST",
489
- data: Object.assign(Object.assign({}, params), { sourceId })
490
- });
491
- if (res.status === 'success') {
492
- message.success("统计成功");
493
- }
494
- else {
495
- message.error("统计失败");
496
- }
497
- return res;
498
- });
499
- }
500
- static downloadDetailExcel(sourceId, entityCode) {
501
- const hydrocarbonToken = Units.hydrocarbonToken();
502
- let url = Units.api() + `/v3/dtmpl/excel?sourceId=${sourceId}&code=${entityCode}&@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
503
- Units.downloadFile(url, "详情");
504
- }
505
- static download(path) {
506
- let vars = path.split("/");
507
- let fileName = vars[vars.length - 1];
508
- Units.downloadFile(this.getFileUrl(path) + `&disposition=attachment`, fileName);
509
- }
510
- static openfile(path, toolbar) {
511
- let vars = path.split("/");
512
- let fileName = vars[vars.length - 1];
513
- Units.openFile(this.getFileUrl(path), fileName, toolbar);
514
- }
515
- static getFileUrl(path) {
516
- const hydrocarbonToken = Units.hydrocarbonToken();
517
- let url = Units.api() + Units.joinPath("/v3/files", path) + `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
518
- return url;
519
- }
520
- static getFileTxtUrl(path) {
521
- const hydrocarbonToken = Units.hydrocarbonToken();
522
- let url = Units.api() + "/v3/files/text" + path + `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
523
- return url;
524
- }
525
- static loadFileTxt(path) {
526
- return __awaiter(this, void 0, void 0, function* () {
527
- let res = yield Super.super({
528
- url: "/v3/files/text" + path,
529
- method: "GET",
530
- });
531
- return res.text;
532
- });
533
- }
534
- static requestFaceplate_menu() {
535
- return __awaiter(this, void 0, void 0, function* () {
536
- let url = `/v3/menu/faceplate`;
537
- let res = yield Super.super({
538
- url: url,
539
- method: "GET",
540
- });
541
- return res.l2Menus;
542
- });
543
- }
544
- static requestFaceplateStatistic_menu() {
545
- return __awaiter(this, void 0, void 0, function* () {
546
- let url = `/v3/menu/faceplate-statistic`;
547
- let res = yield Super.super({
548
- url: url,
549
- method: "GET",
550
- });
551
- return res.l2Menus;
552
- });
553
- }
554
- static requestBlocks(l2MenuId, blockId) {
555
- return __awaiter(this, void 0, void 0, function* () {
556
- let url = `/v3/menu/blocks`;
557
- let res = yield Super.super({
558
- url: url,
559
- method: "GET",
560
- query: {
561
- l2MenuId, blockId
562
- }
563
- });
564
- return res;
565
- });
566
- }
567
- static logout() {
568
- return __awaiter(this, void 0, void 0, function* () {
569
- Super.super({
570
- url: '/v3/auth/token',
571
- method: 'DELETE'
572
- }).then((res) => {
573
- Units.toLogin();
574
- });
575
- });
576
- }
577
- static resetPassword(oPassword, nPassword, pubkey) {
578
- return __awaiter(this, void 0, void 0, function* () {
579
- let oldPassword = EncryptUtils.rsaEncrypt(oPassword, pubkey);
580
- let newPassword = EncryptUtils.rsaEncrypt(nPassword, pubkey);
581
- let res = yield Super.super({
582
- url: '/v3/auth/password',
583
- query: {
584
- oldPassword, newPassword
585
- },
586
- method: "POST"
587
- });
588
- return res;
589
- });
590
- }
591
- static getContextSourceConfig() {
592
- return __awaiter(this, void 0, void 0, function* () {
593
- let res = yield Super.super({
594
- url: '/v3/context-source-config',
595
- method: "GET"
596
- });
597
- if (res) {
598
- return res.config;
599
- }
600
- else {
601
- return null;
602
- }
603
- });
604
- }
605
- static getContextSourceValue() {
606
- return __awaiter(this, void 0, void 0, function* () {
607
- let res = yield Super.super({
608
- url: '/v3/auth/context-source-value',
609
- method: "GET"
610
- });
611
- return res.value;
612
- });
613
- }
614
- static login(json, kaptchaToken, kaptchaText, pubkey) {
615
- return __awaiter(this, void 0, void 0, function* () {
616
- let datetime = format(new Date()).format("YYYY-MM-DD HH:mm:ss");
617
- let programCode;
618
- json['datetime'] = datetime;
619
- let userInfo = EncryptUtils.rsaEncrypt(JSON.stringify(json), pubkey);
620
- let res = yield Super.super({
621
- url: '/v3/auth/hctoken',
622
- query: {
623
- userInfo, kaptchaToken, kaptchaText
624
- },
625
- method: "GET"
626
- });
627
- if (res.status === 'success') {
628
- //window.location.hash = "#/home";
629
- HCDataSource.clear();
630
- window.location.hash = "#/context-setter";
631
- Units.setHydrocarbonToken(res.token);
632
- }
633
- return res;
634
- });
635
- }
636
- static setContext(json) {
637
- return __awaiter(this, void 0, void 0, function* () {
638
- const formData = new FormData();
639
- formData.append("context", JSON.stringify(json));
640
- let res = yield Super.super({
641
- url: '/v3/auth/context',
642
- data: formData,
643
- method: 'POST'
644
- }, 'formdata');
645
- if (res.status === 'success') {
646
- window.location.hash = "#/home";
647
- }
648
- return res;
649
- });
650
- }
651
- static getKaptchaToken() {
652
- return __awaiter(this, void 0, void 0, function* () {
653
- let res = yield Super.super({
654
- url: '/v3/auth/kaptcha',
655
- method: "POST"
656
- });
657
- if (res.status === 'success') {
658
- return res;
659
- }
660
- else {
661
- return null;
662
- }
663
- });
664
- }
665
- static getRasPubkey() {
666
- return __awaiter(this, void 0, void 0, function* () {
667
- let res = yield Super.super({
668
- url: '/v3/auth/ras-pubkey',
669
- method: "GET"
670
- });
671
- if (res.status === 'success') {
672
- return res.rasPubkey;
673
- }
674
- else {
675
- return null;
676
- }
677
- });
678
- }
679
- static getUser() {
680
- return __awaiter(this, void 0, void 0, function* () {
681
- let res = yield Super.super({
682
- url: '/v3/current-user',
683
- });
684
- return res.user;
685
- });
686
- }
687
- static requestMessagebar() {
688
- return __awaiter(this, void 0, void 0, function* () {
689
- let url = `/v3/menu/messagebar`;
690
- let res = yield Super.super({
691
- url: url,
692
- method: "GET",
693
- });
694
- return res.l2Menus;
695
- });
696
- }
697
- static requestSimpleCharts() {
698
- return __awaiter(this, void 0, void 0, function* () {
699
- let url = `/v3/menu/simple-charts`;
700
- let res = yield Super.super({
701
- url: url,
702
- method: "GET",
703
- });
704
- return res.l2Menus;
705
- });
706
- }
707
- static requestKsList(path, params, depth = 1, pageinfo = { pageNo: 1, pageSize: 100 }) {
708
- return __awaiter(this, void 0, void 0, function* () {
709
- let url = Units.joinPath("/v3/ks/list", path);
710
- let res = yield Super.super({
711
- url: url,
712
- method: "GET",
713
- query: Object.assign(Object.assign({ depth }, params), { pageNo: pageinfo.pageNo, pageSize: pageinfo.pageSize })
714
- });
715
- //console.log("ks list:", res);
716
- if (res.status == 'error') {
717
- return null;
718
- }
719
- else {
720
- return res.result;
721
- }
722
- });
723
- }
724
- static requestKsListTopPage(queryKey, pageNo, pageSize) {
725
- return __awaiter(this, void 0, void 0, function* () {
726
- let url = `/v3/ks/query/data`;
727
- let res = yield Super.super({
728
- url: url,
729
- method: "GET",
730
- query: {
731
- pageNo,
732
- pageSize, queryKey
733
- }
734
- });
735
- //console.log("requestKsListToPage:", res);
736
- return res.result;
737
- });
738
- }
739
- static requestKsUnique(path, depth = 1) {
740
- return __awaiter(this, void 0, void 0, function* () {
741
- let url = Units.joinPath("/v3/ks/unique", path);
742
- let res = yield Super.super({
743
- url: url,
744
- depth,
745
- method: "GET",
746
- });
747
- //console.log("ks unique:", res);
748
- return res.result;
749
- });
750
- }
751
- static reload() {
752
- return __awaiter(this, void 0, void 0, function* () {
753
- let url = `/v3/tmpl/reload`;
754
- let res = yield Super.super({
755
- url: url,
756
- method: "GET",
757
- });
758
- return res;
759
- });
760
- }
761
- static initProgramConfig(ProgramConfigJson) {
762
- return __awaiter(this, void 0, void 0, function* () {
763
- //设置项目配置信息
764
- if (ProgramConfigJson['programCode']) {
765
- ProgramConfig.setProgramCode(ProgramConfigJson['programCode']);
766
- }
767
- if (ProgramConfigJson['hydrocarbonServer']) {
768
- ProgramConfig.setHydrocarbonServer(ProgramConfigJson['hydrocarbonServer']);
769
- }
770
- ProgramConfig.setProgramName(ProgramConfigJson['programName']);
771
- ProgramConfig.setProgramName_sub(ProgramConfigJson['programName_sub']);
772
- ProgramConfig.setProgramName_NavLeft(ProgramConfigJson['programName_NavLeft']);
773
- ProgramConfig.setProgramName_Logo(ProgramConfigJson['programName_Logo']);
774
- let result = yield Super.getProramConfig();
775
- if (result) {
776
- console.log('result', result);
777
- //先放入programCode
778
- ProgramConfig.setProgramCode(result.programCode);
779
- ProgramConfig.setHydrocarbonServer(result.hydrocarbonServer);
780
- ProgramConfig.setProgramName(result.programName);
781
- ProgramConfig.setProgramName_sub(result.programName_NavLeft);
782
- ProgramConfig.setProgramName_NavLeft(result.programName_NavLeft);
783
- ProgramConfig.setProgramName_Logo(result.programName_Logo);
784
- }
785
- });
786
- }
787
- }
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import Units from '../units';
11
+ import Super from "./superagent";
12
+ import { message } from 'antd';
13
+ import EncryptUtils from '../units/EncryptUtils';
14
+ // import moment from 'moment';
15
+ import format from 'dayjs';
16
+ import HCDataSource from "./hc-data-source";
17
+ import { ProgramConfig } from "../index";
18
+ export default class HcserviceV3 {
19
+ static requestEnum(mstrucIds, path) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ if (!path) {
22
+ return yield this.requestEnumWithPath(mstrucIds, "/enum");
23
+ }
24
+ else {
25
+ return yield this.requestEnumWithPath(mstrucIds, path);
26
+ }
27
+ });
28
+ }
29
+ static requestEnumWithPath(mstrucIds, path) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ if (mstrucIds.length > 0) {
32
+ let res = yield Super.super({
33
+ url: `/v3${path}`,
34
+ query: {
35
+ mstrucIds
36
+ },
37
+ });
38
+ return res.enumMap;
39
+ }
40
+ else {
41
+ return {};
42
+ }
43
+ });
44
+ }
45
+ static requestOptions(mstrucId) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ return yield this.requestEnum([mstrucId]);
48
+ });
49
+ }
50
+ // static async requestSelect(requestedMap, selectMSFieldIdArray) {
51
+ // //先从当前状态从中找,没有的才去查
52
+ // //后续可以放在缓存里,但需要一些策略和技巧
53
+ // if (!requestedMap) {
54
+ // requestedMap = await this.requestSelectS(selectMSFieldIdArray);
55
+ // } else {
56
+ // let needRequest = []
57
+ // selectMSFieldIdArray.forEach(function (item, index, arr) {
58
+ // if (!requestedMap[item]) {
59
+ // needRequest.push(item);
60
+ // }
61
+ // });
62
+ // let subOptionsMap = await HcserviceV3.requestSelectS(needRequest);
63
+ // for (let key in subOptionsMap) {
64
+ // requestedMap[key] = subOptionsMap[key];
65
+ // }
66
+ // }
67
+ // return requestedMap;
68
+ // }
69
+ static requestDtmplConfig(sourceId) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ let url = `/v3/dtmpl/config`;
72
+ let res = yield Super.super({
73
+ url,
74
+ method: "GET",
75
+ query: { sourceId }
76
+ });
77
+ return res.dtmplConfig;
78
+ });
79
+ }
80
+ static requestViewDtmplConfig(sourceId) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ let url = `/v3/view-dtmpl/config`;
83
+ let res = yield Super.super({
84
+ url,
85
+ method: "GET",
86
+ query: { sourceId }
87
+ });
88
+ return res.dtmplConfig;
89
+ });
90
+ }
91
+ static requestAddDtmplConfig(sourceId) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ let url = `/v3/add-dtmpl/config`;
94
+ let res = yield Super.super({
95
+ url,
96
+ method: "GET",
97
+ query: { sourceId }
98
+ });
99
+ return res.dtmplConfig;
100
+ });
101
+ }
102
+ // static async requestUserDtmplConfig() {
103
+ // let url = `/v3/user/dtmpl/config`
104
+ // let res = await Super.super({
105
+ // url,
106
+ // method: "GET",
107
+ // });
108
+ // return res.dtmplConfig;
109
+ // }
110
+ static requestSelectConfig(sourceId) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ let url = `/v3/select/config`;
113
+ let res = yield Super.super({
114
+ url,
115
+ method: "GET",
116
+ query: { sourceId }
117
+ });
118
+ return res.selectConfig;
119
+ });
120
+ }
121
+ static requestLtmplConfig(sourceId) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ let url = `/v3/ltmpl/config`;
124
+ let res = yield Super.super({
125
+ url,
126
+ method: "GET",
127
+ query: { sourceId }
128
+ });
129
+ return res;
130
+ });
131
+ }
132
+ static requestL2LtmplConfig(sourceId) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ let url = `/v3/l2/ltmpl/config`;
135
+ let res = yield Super.super({
136
+ url,
137
+ method: "GET",
138
+ query: { sourceId }
139
+ });
140
+ return res;
141
+ });
142
+ }
143
+ static requestLtmplQueryKey(sourceId, condition) {
144
+ return __awaiter(this, void 0, void 0, function* () {
145
+ //console.log('condition:',condition);
146
+ let url = `/v3/ltmpl/query/key`;
147
+ let res = yield Super.super({
148
+ url: url,
149
+ method: 'GET',
150
+ query: Object.assign(Object.assign({}, condition), { sourceId })
151
+ });
152
+ return res;
153
+ });
154
+ }
155
+ static requestLtmplQueryTop(sourceId, condition) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ // console.log('condition:',condition);
158
+ let url = `/v3/ltmpl/top-data`;
159
+ return yield this.requestCommonLtmplQueryTop(sourceId, condition, url);
160
+ });
161
+ }
162
+ static requestMstrucLtmplQueryTop(sourceId, condition) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ //console.log('condition:',condition);
165
+ let url = `/v3/mstruc/ltmpl/top-data`;
166
+ return yield this.requestCommonLtmplQueryTop(sourceId, condition, url);
167
+ });
168
+ }
169
+ static requestCommonLtmplQueryTop(sourceId, condition, url) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ let res = yield Super.super({
172
+ url: url,
173
+ method: 'GET',
174
+ query: Object.assign(Object.assign({}, condition), { sourceId })
175
+ });
176
+ return res;
177
+ });
178
+ }
179
+ static requestSelectedData(sourceId, codes) {
180
+ return __awaiter(this, void 0, void 0, function* () {
181
+ if (!codes) {
182
+ message.warning("没有选择实体");
183
+ return null;
184
+ }
185
+ let url = `/v3/field-group/data/selected`;
186
+ let res = yield Super.super({
187
+ url: url,
188
+ query: { codes, sourceId },
189
+ method: 'GET'
190
+ });
191
+ if (res.status === "success") {
192
+ return res.entities;
193
+ }
194
+ else {
195
+ message.error("没有找到实体!");
196
+ return null;
197
+ }
198
+ });
199
+ }
200
+ static requestVersionList(sourceId, code) {
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ let res = yield Super.super({
203
+ url: `/v3/dtmpl/data/versions`,
204
+ query: {
205
+ pageNo: 1,
206
+ sourceId,
207
+ code
208
+ },
209
+ method: 'GET'
210
+ });
211
+ return res.versions;
212
+ });
213
+ }
214
+ static requestCommonDtmplData(sourceId, code, versionId, url) {
215
+ return __awaiter(this, void 0, void 0, function* () {
216
+ // if(sourceId=="user"){
217
+ // return this.requestUserDtmplData();
218
+ // }
219
+ let res = yield Super.super({
220
+ url: url,
221
+ query: {
222
+ code, versionId, sourceId
223
+ },
224
+ method: 'GET'
225
+ });
226
+ if (res.status === "success") {
227
+ return res.entity;
228
+ }
229
+ else {
230
+ message.error("实体不存在!");
231
+ return null;
232
+ }
233
+ });
234
+ }
235
+ static requestDtmplData(sourceId, code, versionId) {
236
+ return __awaiter(this, void 0, void 0, function* () {
237
+ let url = `/v3/dtmpl/data`;
238
+ return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
239
+ });
240
+ }
241
+ static requestMstrucDtmplData(sourceId, code, versionId) {
242
+ return __awaiter(this, void 0, void 0, function* () {
243
+ let url = `/v3/mstruc/dtmpl/data`;
244
+ return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
245
+ });
246
+ }
247
+ static requestViewDtmplData(sourceId, code, versionId) {
248
+ return __awaiter(this, void 0, void 0, function* () {
249
+ let url = `/v3/view-dtmpl/data`;
250
+ return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
251
+ });
252
+ }
253
+ static requestMstrucViewDtmplData(sourceId, code, versionId) {
254
+ return __awaiter(this, void 0, void 0, function* () {
255
+ let url = `/v3/mstruc/view-dtmpl/data`;
256
+ return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
257
+ });
258
+ }
259
+ static postCommonDtmplData(sourceId, formDataObj, message, url) {
260
+ return __awaiter(this, void 0, void 0, function* () {
261
+ const formData = new FormData();
262
+ for (let k in formDataObj) {
263
+ if (!k.startsWith("$virtual")) {
264
+ formData.append(k, formDataObj[k] || formDataObj[k] == 0 ? formDataObj[k] : "");
265
+ }
266
+ }
267
+ formData.append('sourceId', sourceId.toString());
268
+ let res = yield Super.super({
269
+ url: url,
270
+ data: formData,
271
+ method: 'POST'
272
+ }, 'formdata');
273
+ let code = null;
274
+ if (res) {
275
+ if (res.status === "success") {
276
+ let msg = "";
277
+ if (res.message) {
278
+ msg = res.message;
279
+ }
280
+ if (message) {
281
+ message.success("保存成功! " + msg);
282
+ }
283
+ code = res.entityCode ? res.entityCode : res.code;
284
+ }
285
+ else {
286
+ if (message) {
287
+ message.error("保存失败");
288
+ }
289
+ }
290
+ }
291
+ else {
292
+ if (message) {
293
+ message.error("保存成功");
294
+ }
295
+ }
296
+ return { code, status: res.status };
297
+ });
298
+ }
299
+ static postDtmplData(sourceId, formDataObj, message) {
300
+ return __awaiter(this, void 0, void 0, function* () {
301
+ let url = `/v3/dtmpl/data`;
302
+ return yield this.postCommonDtmplData(sourceId, formDataObj, message, url);
303
+ });
304
+ }
305
+ static postMstrucDtmplData(sourceId, formDataObj, message) {
306
+ return __awaiter(this, void 0, void 0, function* () {
307
+ let url = `/v3/mstruc/dtmpl/data`;
308
+ return yield this.postCommonDtmplData(sourceId, formDataObj, message, url);
309
+ });
310
+ }
311
+ static postFileAction(file) {
312
+ return Units.api() + `/v3/upload`;
313
+ }
314
+ static postFile(formData, message) {
315
+ return __awaiter(this, void 0, void 0, function* () {
316
+ let res = yield Super.super({
317
+ url: `/v3/upload`,
318
+ data: formData,
319
+ method: 'POST'
320
+ }, 'formdata');
321
+ let fileKey = null;
322
+ if (res) {
323
+ if (res.status === "success") {
324
+ if (message) {
325
+ message.success("上传成功! ");
326
+ }
327
+ fileKey = res.fileKey;
328
+ }
329
+ }
330
+ else {
331
+ if (message) {
332
+ message.error("上传失败!");
333
+ }
334
+ }
335
+ return fileKey;
336
+ });
337
+ }
338
+ static requestL2LtmplQueryKey(sourceId, condition) {
339
+ return __awaiter(this, void 0, void 0, function* () {
340
+ let url = `v3/l2/ltmpl/query/key`;
341
+ let res = yield Super.super({
342
+ url: url,
343
+ method: 'GET',
344
+ query: Object.assign(Object.assign({}, condition), { sourceId })
345
+ });
346
+ return res;
347
+ });
348
+ }
349
+ static requestLtmplCount(sourceId) {
350
+ return __awaiter(this, void 0, void 0, function* () {
351
+ let url = `/v3/ltmpl/data/count`;
352
+ let res = yield Super.super({
353
+ url: url,
354
+ query: { sourceId },
355
+ method: 'GET',
356
+ });
357
+ return res.count;
358
+ });
359
+ }
360
+ // static setCriteriasValue(criterias, criteriaValueMap) {
361
+ // criterias.forEach((item) => {
362
+ // for (let k in criteriaValueMap) {
363
+ // if (k === item.id) {
364
+ // item.value = criteriaValueMap[k]
365
+ // }
366
+ // }
367
+ // });
368
+ // return criterias;
369
+ // }
370
+ //
371
+ // static setCriteriasValueCondition(criterias, condition) {
372
+ // criterias.forEach((item) => {
373
+ // for (let k of Object.keys(condition)) {
374
+ // if (k == "c_" + item.id) {
375
+ // item.value = condition[k]
376
+ // }
377
+ // }
378
+ // });
379
+ // return criterias;
380
+ // }
381
+ static requestQueryData(queryKey, pageInfo) {
382
+ return __awaiter(this, void 0, void 0, function* () {
383
+ let res = yield Super.super({
384
+ url: `/v3/ltmpl/query/data`,
385
+ method: 'GET',
386
+ query: Object.assign({ queryKey }, pageInfo)
387
+ });
388
+ return res;
389
+ });
390
+ }
391
+ static getCodesOfSelectedRows(selectedRows) {
392
+ let codes = [];
393
+ if (!selectedRows || selectedRows.length < 1) {
394
+ return;
395
+ }
396
+ for (let item of selectedRows) {
397
+ if (item.code) {
398
+ codes.push(item.code);
399
+ }
400
+ else {
401
+ message.error("没找到所选数据的Code!!");
402
+ }
403
+ }
404
+ if (codes.length < 1) {
405
+ message.error("没找到所选数据的Code!!");
406
+ }
407
+ return codes;
408
+ }
409
+ static deleteData(sourceId, selectedRows) {
410
+ return __awaiter(this, void 0, void 0, function* () {
411
+ const codes = this.getCodesOfSelectedRows(selectedRows);
412
+ return yield this.deleteByCode(sourceId, codes);
413
+ });
414
+ }
415
+ static deleteByCode(sourceId, codes) {
416
+ return __awaiter(this, void 0, void 0, function* () {
417
+ let res = yield Super.super({
418
+ url: `/v3/ltmpl/data`,
419
+ data: {
420
+ codes, sourceId
421
+ },
422
+ method: 'DELETE',
423
+ });
424
+ if (res.status == 'success') {
425
+ message.success("删除成功");
426
+ return true;
427
+ }
428
+ else {
429
+ message.error("删除失败");
430
+ //console.log("删除失败消息",res.message);
431
+ return false;
432
+ }
433
+ });
434
+ }
435
+ static requestQueryCount(queryKey) {
436
+ return __awaiter(this, void 0, void 0, function* () {
437
+ let res = yield Super.super({
438
+ url: `/v3/ltmpl/query/count`,
439
+ method: "GET",
440
+ query: { queryKey }
441
+ });
442
+ return res.count;
443
+ });
444
+ }
445
+ static requestFile(path) {
446
+ return __awaiter(this, void 0, void 0, function* () {
447
+ let res = yield Super.super({
448
+ url: "/v3/files/" + path,
449
+ method: "GET"
450
+ });
451
+ return res;
452
+ });
453
+ }
454
+ static postActions(actionId, selectedRows, actionDataObj) {
455
+ return __awaiter(this, void 0, void 0, function* () {
456
+ const codes = this.getCodesOfSelectedRows(selectedRows);
457
+ const formData = new FormData();
458
+ for (let k in actionDataObj) {
459
+ formData.append(k, actionDataObj[k] ? actionDataObj[k] : "");
460
+ }
461
+ formData.append('sourceId', actionId.toString());
462
+ formData.append('codes', codes.join(","));
463
+ let res = yield Super.super({
464
+ url: `/v3/action`,
465
+ data: formData,
466
+ method: 'POST'
467
+ }, 'formdata');
468
+ return res;
469
+ });
470
+ }
471
+ static postJumps(jumpId, code) {
472
+ return __awaiter(this, void 0, void 0, function* () {
473
+ let res = yield Super.super({
474
+ url: `/v3/jump`,
475
+ query: {
476
+ code,
477
+ sourceId: jumpId,
478
+ },
479
+ method: "GET",
480
+ });
481
+ return res;
482
+ });
483
+ }
484
+ static increCalc(sourceId, params = {}) {
485
+ return __awaiter(this, void 0, void 0, function* () {
486
+ let res = yield Super.super({
487
+ url: `/v3/stat/increcalc`,
488
+ method: "POST",
489
+ data: Object.assign(Object.assign({}, params), { sourceId })
490
+ });
491
+ if (res.status === 'success') {
492
+ message.success("统计成功");
493
+ }
494
+ else {
495
+ message.error("统计失败");
496
+ }
497
+ return res;
498
+ });
499
+ }
500
+ static downloadDetailExcel(sourceId, entityCode) {
501
+ const hydrocarbonToken = Units.hydrocarbonToken();
502
+ let url = Units.api() + `/v3/dtmpl/excel?sourceId=${sourceId}&code=${entityCode}&@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
503
+ Units.downloadFile(url, "详情");
504
+ }
505
+ static download(path) {
506
+ let vars = path.split("/");
507
+ let fileName = vars[vars.length - 1];
508
+ Units.downloadFile(this.getFileUrl(path) + `&disposition=attachment`, fileName);
509
+ }
510
+ static openfile(path, toolbar) {
511
+ let vars = path.split("/");
512
+ let fileName = vars[vars.length - 1];
513
+ Units.openFile(this.getFileUrl(path), fileName, toolbar);
514
+ }
515
+ static getFileUrl(path) {
516
+ const hydrocarbonToken = Units.hydrocarbonToken();
517
+ let url = Units.api() + Units.joinPath("/v3/files", path) + `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
518
+ return url;
519
+ }
520
+ static getFileTxtUrl(path) {
521
+ const hydrocarbonToken = Units.hydrocarbonToken();
522
+ let url = Units.api() + "/v3/files/text" + path + `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
523
+ return url;
524
+ }
525
+ static loadFileTxt(path) {
526
+ return __awaiter(this, void 0, void 0, function* () {
527
+ let res = yield Super.super({
528
+ url: "/v3/files/text" + path,
529
+ method: "GET",
530
+ });
531
+ return res.text;
532
+ });
533
+ }
534
+ static requestFaceplate_menu() {
535
+ return __awaiter(this, void 0, void 0, function* () {
536
+ let url = `/v3/menu/faceplate`;
537
+ let res = yield Super.super({
538
+ url: url,
539
+ method: "GET",
540
+ });
541
+ return res.l2Menus;
542
+ });
543
+ }
544
+ static requestFaceplateStatistic_menu() {
545
+ return __awaiter(this, void 0, void 0, function* () {
546
+ let url = `/v3/menu/faceplate-statistic`;
547
+ let res = yield Super.super({
548
+ url: url,
549
+ method: "GET",
550
+ });
551
+ return res.l2Menus;
552
+ });
553
+ }
554
+ static requestBlocks(l2MenuId, blockId) {
555
+ return __awaiter(this, void 0, void 0, function* () {
556
+ let url = `/v3/menu/blocks`;
557
+ let res = yield Super.super({
558
+ url: url,
559
+ method: "GET",
560
+ query: {
561
+ l2MenuId, blockId
562
+ }
563
+ });
564
+ return res;
565
+ });
566
+ }
567
+ static logout() {
568
+ return __awaiter(this, void 0, void 0, function* () {
569
+ Super.super({
570
+ url: '/v3/auth/token',
571
+ method: 'DELETE'
572
+ }).then((res) => {
573
+ Units.toLogin();
574
+ });
575
+ });
576
+ }
577
+ static resetPassword(oPassword, nPassword, pubkey) {
578
+ return __awaiter(this, void 0, void 0, function* () {
579
+ let oldPassword = EncryptUtils.rsaEncrypt(oPassword, pubkey);
580
+ let newPassword = EncryptUtils.rsaEncrypt(nPassword, pubkey);
581
+ let res = yield Super.super({
582
+ url: '/v3/auth/password',
583
+ query: {
584
+ oldPassword, newPassword
585
+ },
586
+ method: "POST"
587
+ });
588
+ return res;
589
+ });
590
+ }
591
+ static getContextSourceConfig() {
592
+ return __awaiter(this, void 0, void 0, function* () {
593
+ let res = yield Super.super({
594
+ url: '/v3/context-source-config',
595
+ method: "GET"
596
+ });
597
+ if (res) {
598
+ return res.config;
599
+ }
600
+ else {
601
+ return null;
602
+ }
603
+ });
604
+ }
605
+ static getContextSourceValue() {
606
+ return __awaiter(this, void 0, void 0, function* () {
607
+ let res = yield Super.super({
608
+ url: '/v3/auth/context-source-value',
609
+ method: "GET"
610
+ });
611
+ return res.value;
612
+ });
613
+ }
614
+ static login(json, kaptchaToken, kaptchaText, pubkey) {
615
+ return __awaiter(this, void 0, void 0, function* () {
616
+ let datetime = format(new Date()).format("YYYY-MM-DD HH:mm:ss");
617
+ let programCode;
618
+ json['datetime'] = datetime;
619
+ let userInfo = EncryptUtils.rsaEncrypt(JSON.stringify(json), pubkey);
620
+ let res = yield Super.super({
621
+ url: '/v3/auth/hctoken',
622
+ query: {
623
+ userInfo, kaptchaToken, kaptchaText
624
+ },
625
+ method: "GET"
626
+ });
627
+ if (res.status === 'success') {
628
+ //window.location.hash = "#/home";
629
+ HCDataSource.clear();
630
+ window.location.hash = "#/context-setter";
631
+ Units.setHydrocarbonToken(res.token);
632
+ }
633
+ return res;
634
+ });
635
+ }
636
+ static setContext(json) {
637
+ return __awaiter(this, void 0, void 0, function* () {
638
+ const formData = new FormData();
639
+ formData.append("context", JSON.stringify(json));
640
+ let res = yield Super.super({
641
+ url: '/v3/auth/context',
642
+ data: formData,
643
+ method: 'POST'
644
+ }, 'formdata');
645
+ if (res.status === 'success') {
646
+ window.location.hash = "#/home";
647
+ }
648
+ return res;
649
+ });
650
+ }
651
+ static getKaptchaToken() {
652
+ return __awaiter(this, void 0, void 0, function* () {
653
+ let res = yield Super.super({
654
+ url: '/v3/auth/kaptcha',
655
+ method: "POST"
656
+ });
657
+ if (res.status === 'success') {
658
+ return res;
659
+ }
660
+ else {
661
+ return null;
662
+ }
663
+ });
664
+ }
665
+ static getRasPubkey() {
666
+ return __awaiter(this, void 0, void 0, function* () {
667
+ let res = yield Super.super({
668
+ url: '/v3/auth/ras-pubkey',
669
+ method: "GET"
670
+ });
671
+ if (res.status === 'success') {
672
+ return res.rasPubkey;
673
+ }
674
+ else {
675
+ return null;
676
+ }
677
+ });
678
+ }
679
+ static getUser() {
680
+ return __awaiter(this, void 0, void 0, function* () {
681
+ let res = yield Super.super({
682
+ url: '/v3/current-user',
683
+ });
684
+ return res.user;
685
+ });
686
+ }
687
+ static requestMessagebar() {
688
+ return __awaiter(this, void 0, void 0, function* () {
689
+ let url = `/v3/menu/messagebar`;
690
+ let res = yield Super.super({
691
+ url: url,
692
+ method: "GET",
693
+ });
694
+ return res.l2Menus;
695
+ });
696
+ }
697
+ static requestSimpleCharts() {
698
+ return __awaiter(this, void 0, void 0, function* () {
699
+ let url = `/v3/menu/simple-charts`;
700
+ let res = yield Super.super({
701
+ url: url,
702
+ method: "GET",
703
+ });
704
+ return res.l2Menus;
705
+ });
706
+ }
707
+ static requestKsList(path, params, depth = 1, pageinfo = { pageNo: 1, pageSize: 100 }) {
708
+ return __awaiter(this, void 0, void 0, function* () {
709
+ let url = Units.joinPath("/v3/ks/list", path);
710
+ let res = yield Super.super({
711
+ url: url,
712
+ method: "GET",
713
+ query: Object.assign(Object.assign({ depth }, params), { pageNo: pageinfo.pageNo, pageSize: pageinfo.pageSize })
714
+ });
715
+ //console.log("ks list:", res);
716
+ if (res.status == 'error') {
717
+ return null;
718
+ }
719
+ else {
720
+ return res.result;
721
+ }
722
+ });
723
+ }
724
+ static requestKsListTopPage(queryKey, pageNo, pageSize) {
725
+ return __awaiter(this, void 0, void 0, function* () {
726
+ let url = `/v3/ks/query/data`;
727
+ let res = yield Super.super({
728
+ url: url,
729
+ method: "GET",
730
+ query: {
731
+ pageNo,
732
+ pageSize, queryKey
733
+ }
734
+ });
735
+ //console.log("requestKsListToPage:", res);
736
+ return res.result;
737
+ });
738
+ }
739
+ static requestKsUnique(path, depth = 1) {
740
+ return __awaiter(this, void 0, void 0, function* () {
741
+ let url = Units.joinPath("/v3/ks/unique", path);
742
+ let res = yield Super.super({
743
+ url: url,
744
+ depth,
745
+ method: "GET",
746
+ });
747
+ //console.log("ks unique:", res);
748
+ return res.result;
749
+ });
750
+ }
751
+ static reload() {
752
+ return __awaiter(this, void 0, void 0, function* () {
753
+ let url = `/v3/tmpl/reload`;
754
+ let res = yield Super.super({
755
+ url: url,
756
+ method: "GET",
757
+ });
758
+ return res;
759
+ });
760
+ }
761
+ static doCopy(sourceId, code, copyRelation, copyOpp2One) {
762
+ return __awaiter(this, void 0, void 0, function* () {
763
+ let res = yield Super.super({
764
+ url: `/v3/mstruc/copy-data`,
765
+ method: "POST",
766
+ query: {
767
+ sourceId,
768
+ code, copyRelation, copyOpp2One
769
+ }
770
+ }, null, null);
771
+ if (res.status != 'success') {
772
+ message.error("错误消息:" + res.message);
773
+ }
774
+ return res;
775
+ });
776
+ }
777
+ static initProgramConfig(ProgramConfigJson) {
778
+ return __awaiter(this, void 0, void 0, function* () {
779
+ //设置项目配置信息
780
+ if (ProgramConfigJson['programCode']) {
781
+ ProgramConfig.setProgramCode(ProgramConfigJson['programCode']);
782
+ }
783
+ if (ProgramConfigJson['hydrocarbonServer']) {
784
+ ProgramConfig.setHydrocarbonServer(ProgramConfigJson['hydrocarbonServer']);
785
+ }
786
+ ProgramConfig.setProgramName(ProgramConfigJson['programName']);
787
+ ProgramConfig.setProgramName_sub(ProgramConfigJson['programName_sub']);
788
+ ProgramConfig.setProgramName_NavLeft(ProgramConfigJson['programName_NavLeft']);
789
+ ProgramConfig.setProgramName_Logo(ProgramConfigJson['programName_Logo']);
790
+ let result = yield Super.getProramConfig();
791
+ if (result) {
792
+ console.log('result', result);
793
+ //先放入programCode
794
+ ProgramConfig.setProgramCode(result.programCode);
795
+ ProgramConfig.setHydrocarbonServer(result.hydrocarbonServer);
796
+ ProgramConfig.setProgramName(result.programName);
797
+ ProgramConfig.setProgramName_sub(result.programName_NavLeft);
798
+ ProgramConfig.setProgramName_NavLeft(result.programName_NavLeft);
799
+ ProgramConfig.setProgramName_Logo(result.programName_Logo);
800
+ }
801
+ });
802
+ }
803
+ }
788
804
  //# sourceMappingURL=hcservice-v3.js.map