vap1 0.0.1

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 (441) hide show
  1. package/basetype.d.ts +62 -0
  2. package/basetype.js +2 -0
  3. package/components/Box/Box.d.ts +118 -0
  4. package/components/Box/Box.js +150 -0
  5. package/components/Box/SelectBar.d.ts +90 -0
  6. package/components/Box/SelectBar.js +93 -0
  7. package/components/Box/_register.d.ts +49 -0
  8. package/components/Box/_register.js +29 -0
  9. package/components/Box/index.d.ts +9 -0
  10. package/components/Box/index.js +6 -0
  11. package/components/Lists/SList.d.ts +58 -0
  12. package/components/Lists/SList.js +167 -0
  13. package/components/SearchBar/ActionButtons.d.ts +49 -0
  14. package/components/SearchBar/ActionButtons.js +96 -0
  15. package/components/SearchBar/ByField.d.ts +3 -0
  16. package/components/SearchBar/ByField.js +193 -0
  17. package/components/SearchBar/ByKeyword.d.ts +3 -0
  18. package/components/SearchBar/ByKeyword.js +34 -0
  19. package/components/SearchBar/SearchField.d.ts +15 -0
  20. package/components/SearchBar/SearchField.js +25 -0
  21. package/components/SearchBar/SearchTags.d.ts +2 -0
  22. package/components/SearchBar/SearchTags.js +18 -0
  23. package/components/SearchBar/_FieldType.d.ts +8 -0
  24. package/components/SearchBar/_FieldType.js +45 -0
  25. package/components/SearchBar/_register.d.ts +65 -0
  26. package/components/SearchBar/_register.js +29 -0
  27. package/components/SearchBar/index.d.ts +134 -0
  28. package/components/SearchBar/index.js +33 -0
  29. package/components/Tables/ApiTable.d.ts +18 -0
  30. package/components/Tables/ApiTable.js +48 -0
  31. package/components/Tables/ApiTableModal.d.ts +22 -0
  32. package/components/Tables/ApiTableModal.js +73 -0
  33. package/components/Tables/Components/ActionBar.d.ts +56 -0
  34. package/components/Tables/Components/ActionBar.js +100 -0
  35. package/components/Tables/Components/Actions.d.ts +47 -0
  36. package/components/Tables/Components/Actions.js +91 -0
  37. package/components/Tables/Components/Summary.d.ts +11 -0
  38. package/components/Tables/Components/Summary.js +11 -0
  39. package/components/Tables/Components/index.d.ts +17 -0
  40. package/components/Tables/Components/index.js +19 -0
  41. package/components/Tables/STable.d.ts +5 -0
  42. package/components/Tables/STable.js +37 -0
  43. package/components/Tables/TopTable.d.ts +24 -0
  44. package/components/Tables/TopTable.js +157 -0
  45. package/components/Tables/TopTableModal.d.ts +5 -0
  46. package/components/Tables/TopTableModal.js +20 -0
  47. package/components/Tables/Util.d.ts +3 -0
  48. package/components/Tables/Util.js +41 -0
  49. package/components/Tables/VTable.d.ts +11 -0
  50. package/components/Tables/VTable.js +237 -0
  51. package/components/Tables/index.d.ts +81 -0
  52. package/components/Tables/index.js +20 -0
  53. package/components/TreeSelect/BaseTreeSelect.d.ts +33 -0
  54. package/components/TreeSelect/BaseTreeSelect.js +190 -0
  55. package/components/TreeSelect/DTreeSelect.d.ts +24 -0
  56. package/components/TreeSelect/DTreeSelect.js +66 -0
  57. package/components/TreeSelect/FTreeSelect.d.ts +11 -0
  58. package/components/TreeSelect/FTreeSelect.js +39 -0
  59. package/components/TreeSelect/STreeSelect.d.ts +14 -0
  60. package/components/TreeSelect/STreeSelect.js +52 -0
  61. package/components/TreeSelect/index.d.ts +94 -0
  62. package/components/TreeSelect/index.js +9 -0
  63. package/components/Trees/ActionTree.d.ts +54 -0
  64. package/components/Trees/ActionTree.js +657 -0
  65. package/components/Trees/BaseTree.d.ts +31 -0
  66. package/components/Trees/BaseTree.js +185 -0
  67. package/components/Trees/DTree.d.ts +48 -0
  68. package/components/Trees/DTree.js +142 -0
  69. package/components/Trees/FTree.d.ts +33 -0
  70. package/components/Trees/FTree.js +79 -0
  71. package/components/Trees/STree.d.ts +21 -0
  72. package/components/Trees/STree.js +92 -0
  73. package/components/Trees/index.d.ts +134 -0
  74. package/components/Trees/index.js +9 -0
  75. package/components/UForm/FormWrapper.d.ts +22 -0
  76. package/components/UForm/FormWrapper.js +270 -0
  77. package/components/UForm/UDescriptions.d.ts +5 -0
  78. package/components/UForm/UDescriptions.js +134 -0
  79. package/components/UForm/UForm.d.ts +33 -0
  80. package/components/UForm/UForm.js +484 -0
  81. package/components/UForm/UFormModal.d.ts +3 -0
  82. package/components/UForm/UFormModal.js +149 -0
  83. package/components/UForm/UInfo.d.ts +10 -0
  84. package/components/UForm/UInfo.js +75 -0
  85. package/components/UForm/UInfoModal.d.ts +3 -0
  86. package/components/UForm/UInfoModal.js +50 -0
  87. package/components/UForm/UModal.d.ts +3 -0
  88. package/components/UForm/UModal.js +24 -0
  89. package/components/UForm/_FieldType.d.ts +8 -0
  90. package/components/UForm/_FieldType.js +100 -0
  91. package/components/UForm/_FormUtils.d.ts +5 -0
  92. package/components/UForm/_FormUtils.js +75 -0
  93. package/components/UForm/_input.d.ts +59 -0
  94. package/components/UForm/_input.js +147 -0
  95. package/components/UForm/_register.d.ts +87 -0
  96. package/components/UForm/_register.js +44 -0
  97. package/components/UForm/index.d.ts +387 -0
  98. package/components/UForm/index.js +15 -0
  99. package/components/Upload/UploadFile.d.ts +3 -0
  100. package/components/Upload/UploadFile.js +40 -0
  101. package/components/Upload/UploadImage.d.ts +24 -0
  102. package/components/Upload/UploadImage.js +93 -0
  103. package/components/Upload/UploadModal.d.ts +50 -0
  104. package/components/Upload/UploadModal.js +140 -0
  105. package/components/Upload/index.d.ts +77 -0
  106. package/components/Upload/index.js +9 -0
  107. package/components/Upload/useUpload.d.ts +15 -0
  108. package/components/Upload/useUpload.js +93 -0
  109. package/components/_RegisterUtil.d.ts +1 -0
  110. package/components/_RegisterUtil.js +25 -0
  111. package/components/_adapt/Alert.d.ts +11 -0
  112. package/components/_adapt/Alert.js +43 -0
  113. package/components/_adapt/Button.d.ts +20 -0
  114. package/components/_adapt/Button.js +26 -0
  115. package/components/_adapt/Col.d.ts +53 -0
  116. package/components/_adapt/Col.js +90 -0
  117. package/components/_adapt/Collapse.d.ts +30 -0
  118. package/components/_adapt/Collapse.js +33 -0
  119. package/components/_adapt/Drawer.d.ts +12 -0
  120. package/components/_adapt/Drawer.js +11 -0
  121. package/components/_adapt/Dropdown.d.ts +15 -0
  122. package/components/_adapt/Dropdown.js +38 -0
  123. package/components/_adapt/Icon.d.ts +14 -0
  124. package/components/_adapt/Icon.js +34 -0
  125. package/components/_adapt/Image.d.ts +4 -0
  126. package/components/_adapt/Image.js +11 -0
  127. package/components/_adapt/Menu.d.ts +32 -0
  128. package/components/_adapt/Menu.js +25 -0
  129. package/components/_adapt/Modal.d.ts +23 -0
  130. package/components/_adapt/Modal.js +69 -0
  131. package/components/_adapt/Popconfirm.d.ts +5 -0
  132. package/components/_adapt/Popconfirm.js +34 -0
  133. package/components/_adapt/Popover.d.ts +5 -0
  134. package/components/_adapt/Popover.js +34 -0
  135. package/components/_adapt/Progress.d.ts +14 -0
  136. package/components/_adapt/Progress.js +56 -0
  137. package/components/_adapt/Row.d.ts +10 -0
  138. package/components/_adapt/Row.js +23 -0
  139. package/components/_adapt/Select.d.ts +14 -0
  140. package/components/_adapt/Select.js +47 -0
  141. package/components/_adapt/Tag.d.ts +7 -0
  142. package/components/_adapt/Tag.js +12 -0
  143. package/components/_adapt/Tooltip.d.ts +5 -0
  144. package/components/_adapt/Tooltip.js +11 -0
  145. package/components/_adapt/todo/ColorPicker.d.ts +3 -0
  146. package/components/_adapt/todo/ColorPicker.js +42 -0
  147. package/components/_adapt/todo/FloatButton.d.ts +2 -0
  148. package/components/_adapt/todo/FloatButton.js +6 -0
  149. package/components/_adapt/todo/Image.d.ts +2 -0
  150. package/components/_adapt/todo/Image.js +6 -0
  151. package/components/_adapt/todo/Segmented.d.ts +2 -0
  152. package/components/_adapt/todo/Segmented.js +6 -0
  153. package/components/_adapt/todo/Space.d.ts +2 -0
  154. package/components/_adapt/todo/Space.js +6 -0
  155. package/components/_adapt/utils.d.ts +12 -0
  156. package/components/_adapt/utils.js +93 -0
  157. package/components/_common/AutoComplete.d.ts +32 -0
  158. package/components/_common/AutoComplete.js +87 -0
  159. package/components/_common/CountUp.d.ts +38 -0
  160. package/components/_common/CountUp.js +60 -0
  161. package/components/_common/DateRange.d.ts +52 -0
  162. package/components/_common/DateRange.js +108 -0
  163. package/components/_common/HighLight.d.ts +15 -0
  164. package/components/_common/HighLight.js +37 -0
  165. package/components/_common/I18N.d.ts +7 -0
  166. package/components/_common/I18N.js +6 -0
  167. package/components/_common/Loading.d.ts +9 -0
  168. package/components/_common/Loading.js +52 -0
  169. package/components/_common/MonthRange.d.ts +46 -0
  170. package/components/_common/MonthRange.js +130 -0
  171. package/components/_common/PromiseLabel.d.ts +11 -0
  172. package/components/_common/PromiseLabel.js +34 -0
  173. package/components/_common/Role.d.ts +5 -0
  174. package/components/_common/Role.js +11 -0
  175. package/components/_common/Upagination.d.ts +21 -0
  176. package/components/_common/Upagination.js +106 -0
  177. package/components/_setup/Const.d.ts +205 -0
  178. package/components/_setup/Const.js +112 -0
  179. package/components/_setup/I18N/enUS.d.ts +1 -0
  180. package/components/_setup/I18N/enUS.js +106 -0
  181. package/components/_setup/I18N/index.d.ts +3 -0
  182. package/components/_setup/I18N/index.js +5 -0
  183. package/components/_setup/I18N/zhCN.d.ts +3 -0
  184. package/components/_setup/I18N/zhCN.js +109 -0
  185. package/components/_setup/I18N/zhHK.d.ts +1 -0
  186. package/components/_setup/I18N/zhHK.js +107 -0
  187. package/components/_setup/ICON/IconTypes.d.ts +1 -0
  188. package/components/_setup/ICON/IconTypes.js +10 -0
  189. package/components/_setup/SearchField/SearchFieldAdvance.d.ts +1 -0
  190. package/components/_setup/SearchField/SearchFieldAdvance.js +57 -0
  191. package/components/_setup/SearchField/SearchFieldDate.d.ts +1 -0
  192. package/components/_setup/SearchField/SearchFieldDate.js +186 -0
  193. package/components/_setup/SearchField/SearchFieldInput.d.ts +3 -0
  194. package/components/_setup/SearchField/SearchFieldInput.js +20 -0
  195. package/components/_setup/SearchField/SearchFieldSelect.d.ts +1 -0
  196. package/components/_setup/SearchField/SearchFieldSelect.js +106 -0
  197. package/components/_setup/SearchField/SearchFieldTree.d.ts +1 -0
  198. package/components/_setup/SearchField/SearchFieldTree.js +191 -0
  199. package/components/_setup/SelectBar/SelectList.d.ts +1 -0
  200. package/components/_setup/SelectBar/SelectList.js +21 -0
  201. package/components/_setup/SelectBar/SelectTree.d.ts +1 -0
  202. package/components/_setup/SelectBar/SelectTree.js +11 -0
  203. package/components/_setup/UForm/UFormAdvanceInput.d.ts +1 -0
  204. package/components/_setup/UForm/UFormAdvanceInput.js +300 -0
  205. package/components/_setup/UForm/UFormAdvanceSelect.d.ts +0 -0
  206. package/components/_setup/UForm/UFormAdvanceSelect.js +26 -0
  207. package/components/_setup/UForm/UFormCrontab.d.ts +1 -0
  208. package/components/_setup/UForm/UFormCrontab.js +199 -0
  209. package/components/_setup/UForm/UFormDate.d.ts +1 -0
  210. package/components/_setup/UForm/UFormDate.js +313 -0
  211. package/components/_setup/UForm/UFormInput.d.ts +1 -0
  212. package/components/_setup/UForm/UFormInput.js +159 -0
  213. package/components/_setup/UForm/UFormJSON.d.ts +1 -0
  214. package/components/_setup/UForm/UFormJSON.js +219 -0
  215. package/components/_setup/UForm/UFormOrg.d.ts +1 -0
  216. package/components/_setup/UForm/UFormOrg.js +121 -0
  217. package/components/_setup/UForm/UFormRole.d.ts +1 -0
  218. package/components/_setup/UForm/UFormRole.js +47 -0
  219. package/components/_setup/UForm/UFormSearch.d.ts +0 -0
  220. package/components/_setup/UForm/UFormSearch.js +35 -0
  221. package/components/_setup/UForm/UFormSelect.d.ts +1 -0
  222. package/components/_setup/UForm/UFormSelect.js +179 -0
  223. package/components/_setup/UForm/UFormTree.d.ts +0 -0
  224. package/components/_setup/UForm/UFormTree.js +134 -0
  225. package/components/_setup/UForm/UFormUpload.d.ts +1 -0
  226. package/components/_setup/UForm/UFormUpload.js +173 -0
  227. package/components/_setup/UForm/_utils.d.ts +11 -0
  228. package/components/_setup/UForm/_utils.js +41 -0
  229. package/components/_setup/index.d.ts +21 -0
  230. package/components/_setup/index.js +25 -0
  231. package/components/index.d.ts +7 -0
  232. package/components/index.js +16 -0
  233. package/deps/JsonView.d.ts +6 -0
  234. package/deps/JsonView.js +57 -0
  235. package/deps/SpringBoot.d.ts +4 -0
  236. package/deps/SpringBoot.js +18 -0
  237. package/deps/SpringCloud.d.ts +14 -0
  238. package/deps/SpringCloud.js +29 -0
  239. package/deps/_editor/advance/_Audio.d.ts +0 -0
  240. package/deps/_editor/advance/_Audio.js +1 -0
  241. package/deps/_editor/advance/_Image.d.ts +2 -0
  242. package/deps/_editor/advance/_Image.js +89 -0
  243. package/deps/_editor/advance/_Table.d.ts +0 -0
  244. package/deps/_editor/advance/_Table.js +1 -0
  245. package/deps/_editor/advance/_Video.d.ts +0 -0
  246. package/deps/_editor/advance/_Video.js +1 -0
  247. package/deps/_editor/base/Element.d.ts +5 -0
  248. package/deps/_editor/base/Element.js +43 -0
  249. package/deps/_editor/base/Leaf.d.ts +3 -0
  250. package/deps/_editor/base/Leaf.js +36 -0
  251. package/deps/_editor/base/Support.d.ts +2 -0
  252. package/deps/_editor/base/Support.js +78 -0
  253. package/deps/_editor/base/types.d.ts +156 -0
  254. package/deps/_editor/base/types.js +10 -0
  255. package/deps/_editor/i18n.d.ts +1 -0
  256. package/deps/_editor/i18n.js +31 -0
  257. package/deps/_editor/tools/Button.d.ts +6 -0
  258. package/deps/_editor/tools/Button.js +86 -0
  259. package/deps/_editor/tools/ToolBar.d.ts +8 -0
  260. package/deps/_editor/tools/ToolBar.js +10 -0
  261. package/deps/_editor/tools/_BlockButton.d.ts +4 -0
  262. package/deps/_editor/tools/_BlockButton.js +77 -0
  263. package/deps/_editor/tools/_InsertButton.d.ts +6 -0
  264. package/deps/_editor/tools/_InsertButton.js +65 -0
  265. package/deps/_editor/tools/_MarkButton.d.ts +6 -0
  266. package/deps/_editor/tools/_MarkButton.js +45 -0
  267. package/deps/_editor/tools/_TxtButton.d.ts +7 -0
  268. package/deps/_editor/tools/_TxtButton.js +187 -0
  269. package/deps/_editor/utils/ParseHtml.d.ts +0 -0
  270. package/deps/_editor/utils/ParseHtml.js +220 -0
  271. package/deps/api-audit.d.ts +1 -0
  272. package/deps/api-audit.js +6 -0
  273. package/deps/api-data.d.ts +0 -0
  274. package/deps/api-data.js +1 -0
  275. package/deps/apis/useSource.d.ts +0 -0
  276. package/deps/apis/useSource.js +152 -0
  277. package/deps/echarts.d.ts +26 -0
  278. package/deps/echarts.js +71 -0
  279. package/deps/editor.d.ts +34 -0
  280. package/deps/editor.js +111 -0
  281. package/deps/registerEditor.d.ts +1 -0
  282. package/deps/registerEditor.js +15 -0
  283. package/hooks/_list.d.ts +87 -0
  284. package/hooks/_list.js +13 -0
  285. package/hooks/index.d.ts +14 -0
  286. package/hooks/index.js +49 -0
  287. package/hooks/useAjax.d.ts +14 -0
  288. package/hooks/useAjax.js +43 -0
  289. package/hooks/useAjaxAction.d.ts +13 -0
  290. package/hooks/useAjaxAction.js +42 -0
  291. package/hooks/useAjaxQuery.d.ts +40 -0
  292. package/hooks/useAjaxQuery.js +81 -0
  293. package/hooks/useApi.d.ts +69 -0
  294. package/hooks/useApi.js +352 -0
  295. package/hooks/useApiGlobal.d.ts +0 -0
  296. package/hooks/useApiGlobal.js +5 -0
  297. package/hooks/useApp.d.ts +243 -0
  298. package/hooks/useApp.js +17 -0
  299. package/hooks/useArray.d.ts +21 -0
  300. package/hooks/useArray.js +182 -0
  301. package/hooks/useCounter.d.ts +0 -0
  302. package/hooks/useCounter.js +82 -0
  303. package/hooks/useDefault.d.ts +6 -0
  304. package/hooks/useDefault.js +16 -0
  305. package/hooks/useDoLoad.d.ts +17 -0
  306. package/hooks/useDoLoad.js +44 -0
  307. package/hooks/useEffectFunction.d.ts +8 -0
  308. package/hooks/useEffectFunction.js +16 -0
  309. package/hooks/useEffectOnce.d.ts +5 -0
  310. package/hooks/useEffectOnce.js +23 -0
  311. package/hooks/useError.d.ts +5 -0
  312. package/hooks/useError.js +21 -0
  313. package/hooks/useFirstMountState.d.ts +6 -0
  314. package/hooks/useFirstMountState.js +18 -0
  315. package/hooks/useGenkey.d.ts +2 -0
  316. package/hooks/useGenkey.js +16 -0
  317. package/hooks/useGetSet.d.ts +11 -0
  318. package/hooks/useGetSet.js +27 -0
  319. package/hooks/useGlobal.d.ts +19 -0
  320. package/hooks/useGlobal.js +62 -0
  321. package/hooks/useGlobal_back.d.ts +1 -0
  322. package/hooks/useGlobal_back.js +11 -0
  323. package/hooks/useHover.d.ts +8 -0
  324. package/hooks/useHover.js +49 -0
  325. package/hooks/useMemoPromise.d.ts +6 -0
  326. package/hooks/useMemoPromise.js +42 -0
  327. package/hooks/useModals.d.ts +40 -0
  328. package/hooks/useModals.js +98 -0
  329. package/hooks/useMountedState.d.ts +5 -0
  330. package/hooks/useMountedState.js +20 -0
  331. package/hooks/useOpenState.d.ts +28 -0
  332. package/hooks/useOpenState.js +23 -0
  333. package/hooks/usePromise.d.ts +7 -0
  334. package/hooks/usePromise.js +22 -0
  335. package/hooks/useQueue.d.ts +12 -0
  336. package/hooks/useQueue.js +34 -0
  337. package/hooks/useSetState.d.ts +9 -0
  338. package/hooks/useSetState.js +26 -0
  339. package/hooks/useStateList.d.ts +13 -0
  340. package/hooks/useStateList.js +59 -0
  341. package/hooks/useToggle.d.ts +6 -0
  342. package/hooks/useToggle.js +12 -0
  343. package/hooks/useUnmountPromise.d.ts +6 -0
  344. package/hooks/useUnmountPromise.js +36 -0
  345. package/hooks/useUpdate.d.ts +7 -0
  346. package/hooks/useUpdate.js +15 -0
  347. package/hooks/useUpdateEffect.d.ts +6 -0
  348. package/hooks/useUpdateEffect.js +18 -0
  349. package/index.d.ts +139 -0
  350. package/index.js +161 -0
  351. package/login/Base65.d.ts +8 -0
  352. package/login/Base65.js +65 -0
  353. package/login/Password.d.ts +61 -0
  354. package/login/Password.js +124 -0
  355. package/login/SM4.d.ts +20 -0
  356. package/login/SM4.js +193 -0
  357. package/login/cems/index.d.ts +10 -0
  358. package/login/cems/index.js +17 -0
  359. package/login/jit/index.d.ts +32 -0
  360. package/login/jit/index.js +180 -0
  361. package/login/jit/pnxclient.d.ts +54 -0
  362. package/login/jit/pnxclient.js +575 -0
  363. package/login/sso/index.d.ts +0 -0
  364. package/login/sso/index.js +0 -0
  365. package/login/vap/index.d.ts +1 -0
  366. package/login/vap/index.js +6 -0
  367. package/login/xrtx/index.d.ts +2 -0
  368. package/login/xrtx/index.js +33 -0
  369. package/package.json +1 -0
  370. package/screen/Comment.d.ts +31 -0
  371. package/screen/Comment.js +29 -0
  372. package/screen/EchartContent.d.ts +0 -0
  373. package/screen/EchartContent.js +63 -0
  374. package/screen/Page.d.ts +13 -0
  375. package/screen/Page.js +74 -0
  376. package/screen/index.d.ts +3 -0
  377. package/screen/index.js +9 -0
  378. package/screen/render.d.ts +5 -0
  379. package/screen/render.js +10 -0
  380. package/utils/Ajax.d.ts +85 -0
  381. package/utils/Ajax.js +147 -0
  382. package/utils/ArrayUtil.d.ts +22 -0
  383. package/utils/ArrayUtil.js +51 -0
  384. package/utils/CacheUtil.d.ts +20 -0
  385. package/utils/CacheUtil.js +86 -0
  386. package/utils/Const.d.ts +14 -0
  387. package/utils/Const.js +37 -0
  388. package/utils/CustomApp.d.ts +242 -0
  389. package/utils/CustomApp.js +18 -0
  390. package/utils/EventUtil.d.ts +22 -0
  391. package/utils/EventUtil.js +63 -0
  392. package/utils/Format.d.ts +28 -0
  393. package/utils/Format.js +206 -0
  394. package/utils/Global.d.ts +276 -0
  395. package/utils/Global.js +125 -0
  396. package/utils/Logger.d.ts +5 -0
  397. package/utils/Logger.js +32 -0
  398. package/utils/PageUtil.d.ts +24 -0
  399. package/utils/PageUtil.js +87 -0
  400. package/utils/Renders/ApiGetRender.d.ts +23 -0
  401. package/utils/Renders/ApiGetRender.js +192 -0
  402. package/utils/Renders/ApiPostRender.d.ts +17 -0
  403. package/utils/Renders/ApiPostRender.js +161 -0
  404. package/utils/Renders/DateRender.d.ts +8 -0
  405. package/utils/Renders/DateRender.js +35 -0
  406. package/utils/Renders/DictRender.d.ts +23 -0
  407. package/utils/Renders/DictRender.js +258 -0
  408. package/utils/Renders/FileRender.d.ts +3 -0
  409. package/utils/Renders/FileRender.js +46 -0
  410. package/utils/Renders/ListRender.d.ts +23 -0
  411. package/utils/Renders/ListRender.js +111 -0
  412. package/utils/Renders/NumberRender.d.ts +19 -0
  413. package/utils/Renders/NumberRender.js +65 -0
  414. package/utils/Renders/StatusRender.d.ts +12 -0
  415. package/utils/Renders/StatusRender.js +68 -0
  416. package/utils/Renders/StringRender.d.ts +14 -0
  417. package/utils/Renders/StringRender.js +194 -0
  418. package/utils/Renders/_define.d.ts +26 -0
  419. package/utils/Renders/_define.js +64 -0
  420. package/utils/Renders/index.d.ts +9 -0
  421. package/utils/Renders/index.js +42 -0
  422. package/utils/StringUtil.d.ts +124 -0
  423. package/utils/StringUtil.js +352 -0
  424. package/utils/TreeUtil.d.ts +42 -0
  425. package/utils/TreeUtil.js +69 -0
  426. package/utils/VAP.d.ts +16 -0
  427. package/utils/VAP.js +78 -0
  428. package/utils/XHR.d.ts +9 -0
  429. package/utils/XHR.js +53 -0
  430. package/utils/_AjaxUtil.d.ts +11 -0
  431. package/utils/_AjaxUtil.js +45 -0
  432. package/utils/_Support.d.ts +22 -0
  433. package/utils/_Support.js +106 -0
  434. package/utils/i18n.d.ts +60 -0
  435. package/utils/i18n.js +184 -0
  436. package/utils/index.d.ts +19 -0
  437. package/utils/index.js +54 -0
  438. package/utils/screenful.d.ts +15 -0
  439. package/utils/screenful.js +64 -0
  440. package/widget/index.d.ts +39 -0
  441. package/widget/index.js +21 -0
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUFormInput = exports.registerFormField = void 0;
4
+ const _Support_1 = require("../../utils/_Support");
5
+ const Global_1 = require("../../utils/Global");
6
+ const StringUtil_1 = require("../../utils/StringUtil");
7
+ const _RegisterUtil_1 = require("../_RegisterUtil");
8
+ const _C_FORM_FIELD = (0, _Support_1.globalDefault)('_C_FORM_FIELD', new Map());
9
+ const DEFAULT = {
10
+ breakCol: false,
11
+ breakDes: false,
12
+ breakTitle: false,
13
+ isMultiple: false,
14
+ render: null,
15
+ rules: null,
16
+ };
17
+ /**
18
+ * @param type
19
+ * 类型名称
20
+ * @param element
21
+ * 输入组件,为一个React 类型,自动注入 props @see FieldProps
22
+ * @param options
23
+ * 注册选项 @see FieldOptions
24
+ * @param forceOverWrite
25
+ * 强制覆盖掉已注册的组件,默认重复注册相同的类型时,后注册的不能生效,使用 true 后,强㓡覆盖掉之前注册的组件
26
+ */
27
+ const registerFormField = (type, component, options = null, forceOverWrite = false) => {
28
+ (0, _RegisterUtil_1.register)(_C_FORM_FIELD, type, DEFAULT, component, options, forceOverWrite);
29
+ };
30
+ exports.registerFormField = registerFormField;
31
+ const getUFormInput = (type) => {
32
+ let key = (0, StringUtil_1.trimLower)(type);
33
+ if (Global_1.CONFIG.FORM.USE_POWER_INPUT) {
34
+ if (_C_FORM_FIELD.has('_' + key)) {
35
+ return _C_FORM_FIELD.get('_' + key);
36
+ }
37
+ }
38
+ if (!_C_FORM_FIELD.has(key)) {
39
+ // console.warn('Not has type : ' + type);
40
+ return _C_FORM_FIELD.get('text');
41
+ }
42
+ return _C_FORM_FIELD.get(key);
43
+ };
44
+ exports.getUFormInput = getUFormInput;
@@ -0,0 +1,387 @@
1
+ /// <reference types="react" />
2
+ export { UForm } from './UForm';
3
+ export { UFormModal } from './UFormModal';
4
+ export { UInfo } from './UInfo';
5
+ export { UInfoModal } from './UInfoModal';
6
+ export { UModal } from './UModal';
7
+ export { UDescriptions } from './UDescriptions';
8
+ import type { BaseOption, PlainObject, BaseItem } from '../../basetype';
9
+ import type { VModalProps } from '../_adapt/Modal';
10
+ import type { OButtonProps as ButtonProps } from '../_adapt/Button';
11
+ import type { ValidationRule } from 'antd/es/form/Form';
12
+ /**
13
+ * 表单布局方式 simple = 1 列 (比较宽松) | common = 2 列 (常规) | compress = 3列 (紧凑)
14
+ * 说明,如果不传此值时,将以 输入参数的数量决定默认值 :规则
15
+ * 1. 小于8全字段时,默认使用 simple
16
+ * 2. 大于8个字段时,默认使用 common
17
+ */
18
+ export type UFormLayout = 'common' | 'simple' | 'compress';
19
+ /**
20
+ * 分组展示的方式 default = 默认 | tabs = 标签 | collapse = 折叠风琴
21
+ */
22
+ export type GroupType = 'default' | 'tabs' | 'collapse';
23
+ export type LinkValue = string | number | boolean;
24
+ import type { _FieldType } from './_FieldType';
25
+ /**
26
+ * 联动结果 : 改变目标字段的交互属性
27
+ * 所有属性为可选,需要改变几项属性,则只返回包含几个属性的对象,
28
+ * 比如 return {show:false} // 仅改变显示状态
29
+ * return {show:false,required:false} // 同时改变显示状态,必填状态
30
+ */
31
+ export type LinkResult = {
32
+ /**
33
+ * 是否显示
34
+ */
35
+ show?: boolean;
36
+ /**
37
+ * 是否可以输入
38
+ */
39
+ disabled?: boolean;
40
+ /**
41
+ * 是否必填
42
+ */
43
+ required?: boolean;
44
+ /**
45
+ * 选项
46
+ * 说明: 需要清空之前的选择,使用初始 options 时,请返回 `null`
47
+ * 如 : return { options: null}
48
+ */
49
+ options?: BaseOption[];
50
+ /**
51
+ * 值
52
+ */
53
+ value?: LinkValue;
54
+ };
55
+ /**
56
+ * 联动
57
+ */
58
+ export type Link = {
59
+ /**
60
+ * 联动字段
61
+ */
62
+ field: string;
63
+ /**
64
+ * 联动事件
65
+ * 返回值为 string | number | boolean 时,改变目标field 的 value
66
+ * 返回值为 LinkResult, 类型时,根据返回结果改变目标 filed 的 显示/置灰/选项集/值的状态
67
+ * 支持 返回 Promise 对象,返回Promise时,resolve也必须为一个LinkResult
68
+ *
69
+ * 参数
70
+ * 第一个参数 value : 为当前最新的值
71
+ * 第二个参数 formData : 为当前表单的所有字段的值
72
+ * 第三个参数 extra : 额外信息,部分类型会存在,比如类型 select 会将 select option 的信息也带回
73
+ *
74
+ */
75
+ call: (value: any, formData?: PlainObject, extra?: any) => LinkValue | LinkResult | Promise<LinkValue | LinkResult>;
76
+ };
77
+ /**
78
+ * 说明:属性配置支持三种模式
79
+ * I = Info = 查看详情
80
+ * A = Add = 添加
81
+ * E = Edit = 修改模式
82
+ * 目前自动判断规则 = 通过 data 参数判断
83
+ * 1. 传 **data** = Update ,
84
+ * 2. 不传= Add
85
+ */
86
+ export type APPEAR_MODE = 'I' | 'A' | 'E' | 'IE' | 'IE' | 'AE' | 'IAE' | false | true;
87
+ /**
88
+ * 表单的字段定义
89
+ */
90
+ export type UFormField = BaseItem & {
91
+ /**
92
+ * 列名称
93
+ */
94
+ title: string;
95
+ /**
96
+ * 列字段
97
+ */
98
+ field: string;
99
+ /**
100
+ * 输入提示
101
+ */
102
+ placeholder?: string;
103
+ /**
104
+ * 是否显示,默认显示,不显示可以设置为show:false
105
+ */
106
+ show?: APPEAR_MODE;
107
+ /**
108
+ * 是否必选
109
+ */
110
+ required?: boolean;
111
+ /**
112
+ * 是否禁用,默认不禁用,禁用可以设置为 disabled:true
113
+ */
114
+ disabled?: APPEAR_MODE;
115
+ /**
116
+ * Type 类型列表 : http://192.168.119.213:9999/vap2/components/form/
117
+ *
118
+ * 系统内置 Type :
119
+ *
120
+ * 1. 目前 vap 内置了 30 多个内置类型
121
+ * 2. 类型在Form系组件内通用 : UFrom / UFormModal / UInfo / UInfoModal / UModal 。
122
+ * 3. 部分类型是需要多个字段的,用逗号隔开, 如 { type:'timerange', field:'start,end' }
123
+ * 4. 部分类型需要 config 设定,请按规定传入 config数据 ,如 { type:'jsonarray',config:{...} }
124
+ * 5. 如果内置的 type 满足不了需求,可以通过自定义的方式进行扩展
125
+ *
126
+ *
127
+ * 自定义 Type :
128
+ *
129
+ * 1. 一个 type 名称只能注册一次, 建议以 功能-操作 命名type,避免冲突
130
+ * 2. 如果是全局多模块都需要的 type ,可以在 app-portal 里面注册
131
+ * 3. 如果只是某个业务使用的 type , 就在 业务app项目 里面注册
132
+ * 4. UFrom 提供了 UFormInput / UFormMultiInput / UFormTableButton 等类型用于注册,
133
+ * 可以方便的注册为,单字段/多字段/多字段(弹出列表选择)的输入方式。
134
+ * */
135
+ type?: typeof _FieldType[number] | (string & {});
136
+ /**
137
+ * 说明:通过设置 ignore = true 时,可以忽略掉一些VAP自动附加的规则:
138
+ * 如部分输入自带的 长度限制, 特殊字符验证,等
139
+ */
140
+ ignore?: true;
141
+ /**
142
+ * 占用 SPAN 大小
143
+ */
144
+ span?: 1 | 2 | 3;
145
+ /**
146
+ * 字段选项,适用于 `checkbox` `radio` `switch` 等
147
+ * 当字段类型为 `switch`时, 数组长度必须为 2, 第一个参数放正常状态,第二个参数放异常状态
148
+ */
149
+ options?: BaseOption[];
150
+ /**
151
+ * 提示信息,仅type 为 input 时有效
152
+ * 1. 为字文本时,提示文本
153
+ * 2. 为对象时,提示标题,文本,提示图标可指定
154
+ */
155
+ tip?: React.ReactNode;
156
+ /**
157
+ * FormItem 的 extra 信息
158
+ * 说明 `tip` 显示在label 旁边,以 Icon图标显示
159
+ * extra 直接显示
160
+ */
161
+ extra?: React.ReactNode;
162
+ /**
163
+ * FormItem 的 help 信息
164
+ */
165
+ help?: React.ReactNode;
166
+ /**
167
+ * rules 用法: https://github.com/yiminghe/async-validator
168
+ */
169
+ rules?: ValidationRule[];
170
+ /**
171
+ * 字段联动,目前只支持 `text` `select` 类型,受影响的字段只能是具有 `options` 属性的类型
172
+ *
173
+ */
174
+ link?: Link[];
175
+ /**
176
+ * 扩展字段说明:
177
+ * 自定义
178
+ */
179
+ config?: any;
180
+ /**
181
+ * render
182
+ * 回显方法
183
+ */
184
+ render?: (txt: any, obj?: any) => React.ReactNode;
185
+ };
186
+ export type UFormFieldGroup = BaseItem & {
187
+ /**
188
+ * 分组标题
189
+ */
190
+ title: string;
191
+ /**
192
+ * 分组里面的字段
193
+ */
194
+ fields: UFormField[];
195
+ };
196
+ /**
197
+ * 新版 UForm 使用 说明 :
198
+ *http://192.168.119.213:9999/vap2/components/form/
199
+ */
200
+ export type UFromProps = {
201
+ /**
202
+ * 自定义样式
203
+ */
204
+ className?: string;
205
+ /**
206
+ * 自定义样式
207
+ */
208
+ style?: React.CSSProperties;
209
+ /**
210
+ * 列表
211
+ */
212
+ layout?: UFormLayout;
213
+ /**
214
+ * 字段列表
215
+ * 字段/字段组必选其一
216
+ */
217
+ fields: (UFormField[]) | (UFormFieldGroup[]);
218
+ /**
219
+ * 分组模式时的分组方式
220
+ */
221
+ groupType?: GroupType;
222
+ /**
223
+ * 表单宽度,仅支持数字,一般不传,需要时使用,
224
+ */
225
+ width?: number;
226
+ /**
227
+ * 说明:
228
+ *
229
+ * isEdit 将会告诉表单是 (true) UPDATE/EDIT 模式, 还是 (false) ADD/NEW 模式
230
+ * 如果不传此参数时,判断依据为 data 字段 是否有传且不为空
231
+ *
232
+ * 作用于字段的 show,disabled 属性
233
+ */
234
+ isEdit?: boolean;
235
+ /**
236
+ * 提示信息
237
+ */
238
+ tip?: React.ReactNode;
239
+ /**
240
+ * 默认
241
+ */
242
+ default?: PlainObject;
243
+ /**
244
+ * 数据
245
+ */
246
+ data?: PlainObject;
247
+ /**
248
+ * UForm 自动判断说明
249
+ * 1. 传 mode 则为 mode 【END】
250
+ * 2. 没有传 mode 时, 如果传入了 isEdit = true 则为 EDIT 【END】
251
+ * 3. 如果 传入了 data ,且 data不为 null ,则为 INFO 【END】
252
+ * 4. 否则, 为 ADD 模式 【END】
253
+ */
254
+ mode?: 'INFO' | 'EDIT' | 'ADD';
255
+ /**
256
+ * 操作
257
+ */
258
+ buttons?: UFromAction[];
259
+ };
260
+ export type UFromAction = ButtonProps & {
261
+ /**
262
+ * 按钮里面的文本
263
+ */
264
+ label: string;
265
+ /**
266
+ * icon
267
+ */
268
+ /**
269
+ * 1. submit 点击时会触发验证,不通过不回调 onClick
270
+ * 2. button 不会触发验证
271
+ * 3. reset 的 onClick 方法不会传参数
272
+ * 4. 默认为 submit
273
+ *
274
+ */
275
+ action?: 'submit' | 'reset' | 'button';
276
+ /**
277
+ * 高
278
+ */
279
+ onClick?: (data?: PlainObject) => void;
280
+ /**
281
+ * 点击前的提示
282
+ */
283
+ confirm?: React.ReactNode;
284
+ };
285
+ /**
286
+ * 新版本 ModalProps 只支持 open 且必传,
287
+ * 不使用 deprecated 属性
288
+ */
289
+ export type UModalProps = UFromProps & Omit<VModalProps, 'children'> & {
290
+ /**
291
+ * open 为必填项,不使用废弃的 visable 属性
292
+ */
293
+ open: boolean;
294
+ /**
295
+ * 自动为弹框命名:
296
+ * 当没有传 title 时,根据填框信息自动给一个标题
297
+ * 传 布尔 true : 标题中不会带名称
298
+ * 传 字串 string : 传数据字名称字段
299
+ * 传 { field: string, label: string } : 以 label: data[field] 展示
300
+ */
301
+ autoTitle?: true | string | {
302
+ field: string;
303
+ label: string;
304
+ };
305
+ };
306
+ /**
307
+ * 需要隐藏边框的位置
308
+ *
309
+ * top : 最上面的边
310
+ * bottom : 最下面的边
311
+ * left : 左边的边
312
+ * right : 右边的边
313
+ * row : 行与行之间的边
314
+ * row : 列与列之间的边
315
+ * label : 列中间:label 与 value 之间的边
316
+ * border : 等同于 'top' + 'bottom' + 'left' + 'right'
317
+ * all : 全部
318
+ */
319
+ type BorderPos = 'border' | 'top' | 'bottom' | 'left' | 'right' | 'row' | 'col' | 'label' | 'all';
320
+ /***
321
+ * UDescriptions 类似于 Descriptions
322
+ * 由于 Descriptions 显示的不确定性,导致页面上经常出现对齐等问题。
323
+ * 使用 UDescriptions 可严格显示,但必需传 labelWidth
324
+ */
325
+ export type UDescriptionsProps = {
326
+ /**
327
+ * 样式名称
328
+ */
329
+ className?: string;
330
+ /**
331
+ * 样式
332
+ */
333
+ style?: React.CSSProperties;
334
+ /**
335
+ * 标题
336
+ */
337
+ title?: React.ReactNode;
338
+ /**
339
+ * 标题 i18n Key
340
+ */
341
+ ik?: string;
342
+ /**
343
+ * columns 数量 ,最多支持4
344
+ */
345
+ column?: 1 | 2 | 3 | 4;
346
+ /**
347
+ * 配色方案
348
+ * label :(默认) Label 处为背景色
349
+ * row : 基数行处为背景色
350
+ * none : 无背景色
351
+ */
352
+ theme?: 'label' | 'row' | 'none';
353
+ /**
354
+ * 默认展示所有边 border, 如果需要隐藏,可以指定一些隐藏
355
+ */
356
+ hideBorder?: BorderPos | BorderPos[];
357
+ /**
358
+ * 说明: leblel width 目前支持 1 - 20,
359
+ * 请传字数: 传本详情页中,所有label里面最长的一个的汉字长度
360
+ */
361
+ labelWidth: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
362
+ };
363
+ /**
364
+ * 详情条目
365
+ */
366
+ export type UDescriptionsItemProps = BaseItem & {
367
+ /**
368
+ * 自定义 Class
369
+ */
370
+ className?: string;
371
+ /**
372
+ * label 名称
373
+ */
374
+ label?: React.ReactNode;
375
+ /**
376
+ * 横跨制表格数,默认:1
377
+ */
378
+ span?: number;
379
+ /**
380
+ * 不显示 label
381
+ */
382
+ breakLabel?: boolean;
383
+ /**
384
+ * 显示内容
385
+ */
386
+ children: React.ReactNode;
387
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UDescriptions = exports.UModal = exports.UInfoModal = exports.UInfo = exports.UFormModal = exports.UForm = void 0;
4
+ var UForm_1 = require("./UForm");
5
+ Object.defineProperty(exports, "UForm", { enumerable: true, get: function () { return UForm_1.UForm; } });
6
+ var UFormModal_1 = require("./UFormModal");
7
+ Object.defineProperty(exports, "UFormModal", { enumerable: true, get: function () { return UFormModal_1.UFormModal; } });
8
+ var UInfo_1 = require("./UInfo");
9
+ Object.defineProperty(exports, "UInfo", { enumerable: true, get: function () { return UInfo_1.UInfo; } });
10
+ var UInfoModal_1 = require("./UInfoModal");
11
+ Object.defineProperty(exports, "UInfoModal", { enumerable: true, get: function () { return UInfoModal_1.UInfoModal; } });
12
+ var UModal_1 = require("./UModal");
13
+ Object.defineProperty(exports, "UModal", { enumerable: true, get: function () { return UModal_1.UModal; } });
14
+ var UDescriptions_1 = require("./UDescriptions");
15
+ Object.defineProperty(exports, "UDescriptions", { enumerable: true, get: function () { return UDescriptions_1.UDescriptions; } });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { BaseUploadProps } from './index';
3
+ export declare const UploadFile: React.FC<BaseUploadProps>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UploadFile = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const utils_1 = require("../../utils");
9
+ // import { Icon } from '../../components/_adapt/Icon';
10
+ const useUpload_1 = require("./useUpload");
11
+ const antd_1 = require("antd");
12
+ const Button_1 = require("../_adapt/Button");
13
+ const Const_1 = require("../../components/_setup/Const");
14
+ const UploadFile = props => {
15
+ const [state, onChange] = (0, useUpload_1.useUpload)(props);
16
+ const uploadProps = (0, useUpload_1.getBaseOptions)(props);
17
+ if (uploadProps.accept == null)
18
+ uploadProps.accept = 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
19
+ if (state.uploading) {
20
+ uploadProps.disabled = true;
21
+ uploadProps.className = 'c-upload-file c-upload-file-p' + state.percent;
22
+ }
23
+ else if (state.error)
24
+ uploadProps.className = 'c-upload-file c-upload-file-error';
25
+ else if (state.uploaded)
26
+ uploadProps.className = 'c-upload-file c-upload-file-success';
27
+ else
28
+ uploadProps.className = 'c-upload-file';
29
+ let title;
30
+ if (props.value) {
31
+ title = props.value.fileName || props.value.fileId;
32
+ }
33
+ else {
34
+ title = state.name ? state.name : utils_1.i18n.getText(props.ik, props.label, Const_1.V.UPLOAD_FILE);
35
+ }
36
+ return react_1.default.createElement(antd_1.Upload, Object.assign({}, uploadProps, { onChange: onChange }),
37
+ react_1.default.createElement(Button_1.Button, { loading: state.uploading, disabled: state.uploading || props.disabled, icon: "upload" }, title),
38
+ state.error && react_1.default.createElement("span", { className: 'c-upload-file-message' }, state.errMsg));
39
+ };
40
+ exports.UploadFile = UploadFile;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import type { BaseUploadProps } from './index';
3
+ import type { PlainObject } from '../../basetype';
4
+ export type UploadImageProps = BaseUploadProps & {
5
+ /**
6
+ * 宽度,默认:80
7
+ */
8
+ width?: number;
9
+ /**
10
+ * 高度,默认:80
11
+ */
12
+ height?: number;
13
+ /**
14
+ * 获取预览地址,返回一个可预览的链接地址
15
+ * 默认使用系统上传,不需要
16
+ * 如果自定义api上传,需要传此参数
17
+ */
18
+ preview?: (uploadResponse: PlainObject) => string;
19
+ /**
20
+ * 显示预览按钮,默认为显示
21
+ */
22
+ showPreview?: boolean;
23
+ };
24
+ export declare const UploadImage: React.FC<UploadImageProps>;
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.UploadImage = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const lodash_1 = __importDefault(require("lodash"));
32
+ const antd_1 = require("antd");
33
+ const Modal_1 = require("../../components/_adapt/Modal");
34
+ const useUpload_1 = require("./useUpload");
35
+ const utils_1 = require("../../utils");
36
+ const Const_1 = require("../../components/_setup/Const");
37
+ const Icon_1 = require("../../components/_adapt/Icon");
38
+ const hooks_1 = require("../../hooks");
39
+ const ImagePreview = (props) => {
40
+ const { state, ik, label, width, height, showPreview, preview } = props;
41
+ const [open, show] = (0, hooks_1.useToggle)();
42
+ if (state.info != null) {
43
+ let imgUrl = lodash_1.default.isFunction(preview) ? preview(state.info) : (utils_1.GLOBAL.CONFIG.UPLOAD.PREVIEW + (state.info.guid || state.info.fileId));
44
+ return react_1.default.createElement("div", { className: 'c-upload-img-root', style: { width, height, backgroundImage: `url(${imgUrl})` } },
45
+ showPreview && react_1.default.createElement(Icon_1.Icon, { type: "zoom-in", onClick: show }),
46
+ showPreview && react_1.default.createElement(Modal_1.Modal, { className: 'picture-card-preview', style: { top: 0, backgroundImage: `url(${imgUrl})` }, open: open, maskClosable: true, width: '100%', footer: null, onCancel: show }));
47
+ }
48
+ return react_1.default.createElement("div", { style: { width, height } },
49
+ react_1.default.createElement("div", { className: 'c-upload-placehoder' },
50
+ react_1.default.createElement(Icon_1.Icon, { type: state.uploading ? 'loading' : 'plus' }),
51
+ react_1.default.createElement("span", { className: "c-upload-img-text" }, utils_1.i18n.getText(ik, label, Const_1.V.UPLOAD_PIC))));
52
+ };
53
+ const RATIO = 1280 / 1920;
54
+ const UploadImage = props => {
55
+ const [state, onChange] = (0, useUpload_1.useUpload)(props);
56
+ const uploadProps = (0, useUpload_1.getBaseOptions)(props);
57
+ const [width, height] = (0, react_1.useMemo)(() => {
58
+ utils_1.StringUtil.px(props.width);
59
+ if (props.width == null && props.height == null)
60
+ return [96, 96];
61
+ if (props.width && props.height)
62
+ return [props.width, props.height];
63
+ if (props.width) {
64
+ if (props.width <= 96)
65
+ return [96, 96];
66
+ return [props.width, props.width * RATIO];
67
+ }
68
+ if (props.height) {
69
+ if (props.height <= 96)
70
+ return [96, 96];
71
+ return [props.height / RATIO, props.height];
72
+ }
73
+ return [96, 96];
74
+ }, []);
75
+ uploadProps.accept = props.accept || "image/*";
76
+ uploadProps.listType = "picture";
77
+ if (state.uploading) {
78
+ uploadProps.disabled = true;
79
+ uploadProps.className = 'c-upload-img c-upload-file-p' + state.percent;
80
+ }
81
+ else if (state.error) {
82
+ uploadProps.className = 'c-upload-img c-upload-img-error';
83
+ }
84
+ else if (state.uploaded) {
85
+ uploadProps.className = 'c-upload-img c-upload-img-success';
86
+ }
87
+ else {
88
+ uploadProps.className = 'c-upload-img';
89
+ }
90
+ return react_1.default.createElement(antd_1.Upload.Dragger, Object.assign({}, uploadProps, { onChange: onChange, style: { width, height } }),
91
+ react_1.default.createElement(ImagePreview, { state: state, ik: props.ik, label: props.label, width: width, height: height, showPreview: props.showPreview === false ? false : true }));
92
+ };
93
+ exports.UploadImage = UploadImage;
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import type { BaseUploadProps } from './index';
3
+ import type { VModalProps } from '../../components/_adapt/Modal';
4
+ import type { PlainObject } from '../../basetype';
5
+ /**
6
+ * 导入结果
7
+ * 返回 boolean : true / false ,成功 / 失败
8
+ * 如果需要显示提示信息,则返回结构体 ,例如
9
+ * return {ok:true, message:'成功导入111条记录'}
10
+ */
11
+ type ImportResult = boolean | {
12
+ message: React.ReactNode;
13
+ ok: boolean;
14
+ };
15
+ /**
16
+ * 通用上传弹框
17
+ *
18
+ * 1. 约束:表格右上角的按钮,不再直接上传,统一改为 “导入”
19
+ 2. 点击导入后,弹出文件上传弹框
20
+ 3. 标题要体现导入的信息
21
+ 4. 提示要说明需要上传的数据描述,也可以提供模板下载
22
+ 5. 上传按钮仅支持单选,需要指定上传格式
23
+ 6. 选择文件后立即开始上传。
24
+ 7. 上传完成后显示上传结果,成功 OR 失败,失败时重新上传
25
+ 8. 成功后直接进行导入
26
+ 9. 导入成功后显示结果,成功 OR 失败,失败时重新上传
27
+ 0. 成功后可关闭窗体,关闭后可自行刷新数据。
28
+ */
29
+ export type UploadModalProps = VModalProps & Omit<BaseUploadProps, 'onChange' | 'disabled'> & {
30
+ /**
31
+ * 上传提示,通常包括上传数据说明,数据模板文件下载等内容。
32
+ * 默认 : 请注意:导入的Excel数据字段须与Excel模版保持一致,否则无法导入数据。点击确认时将仅导入正常数据。
33
+ */
34
+ tip?: React.ReactNode;
35
+ /**
36
+ * 二步模式,且上传接口非标准接口时,必传 onUpload
37
+ * 返回上传结果 boolean 成功 OR 失败
38
+ */
39
+ onChange?: (data: PlainObject) => ImportResult;
40
+ /**
41
+ * 上传
42
+ */
43
+ onResult: (result: PlainObject) => Promise<ImportResult> | ImportResult;
44
+ /**
45
+ * onCancel 强制为必传
46
+ */
47
+ onCancel: () => void;
48
+ };
49
+ export declare const UploadModal: React.FC<UploadModalProps>;
50
+ export {};