antd-management-fast-framework 1.1.63 → 1.1.67

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 (578) hide show
  1. package/es/customComponents/AMap/UIPoiPicker.d.ts +7 -0
  2. package/es/customComponents/AMap/UIPoiPicker.js +78 -0
  3. package/es/customComponents/AMap/UIPositionPicker.d.ts +7 -0
  4. package/es/customComponents/AMap/UIPositionPicker.js +87 -0
  5. package/es/customComponents/ActiveChart/index.d.ts +8 -0
  6. package/es/customComponents/ActiveChart/index.js +168 -0
  7. package/{src → es}/customComponents/ActiveChart/index.less +0 -0
  8. package/es/customComponents/AnimalBox/FadeBox/index.d.ts +13 -0
  9. package/es/customComponents/AnimalBox/FadeBox/index.js +82 -0
  10. package/{src → es}/customComponents/AnimalBox/FadeBox/index.less +0 -0
  11. package/es/customComponents/AnimalBox/QueueBox/index.d.ts +14 -0
  12. package/es/customComponents/AnimalBox/QueueBox/index.js +117 -0
  13. package/{src → es}/customComponents/AnimalBox/QueueBox/index.less +0 -0
  14. package/es/customComponents/ArticleListContent/index.d.ts +10 -0
  15. package/es/customComponents/ArticleListContent/index.js +46 -0
  16. package/{src → es}/customComponents/ArticleListContent/index.less +0 -0
  17. package/es/customComponents/Authorized/Authorized.d.ts +6 -0
  18. package/es/customComponents/Authorized/Authorized.js +33 -0
  19. package/es/customComponents/Authorized/AuthorizedRoute.d.ts +8 -0
  20. package/es/customComponents/Authorized/AuthorizedRoute.js +50 -0
  21. package/es/customComponents/Authorized/CheckPermissions.d.ts +11 -0
  22. package/es/customComponents/Authorized/CheckPermissions.js +106 -0
  23. package/es/customComponents/Authorized/PromiseRender.d.ts +7 -0
  24. package/es/customComponents/Authorized/PromiseRender.js +159 -0
  25. package/es/customComponents/Authorized/Secured.d.ts +18 -0
  26. package/{src/customComponents/Authorized/Secured.jsx → es/customComponents/Authorized/Secured.js} +41 -22
  27. package/es/customComponents/Authorized/index.d.ts +2 -0
  28. package/es/customComponents/Authorized/index.js +22 -0
  29. package/es/customComponents/Authorized/renderAuthorize.d.ts +3 -0
  30. package/es/customComponents/Authorized/renderAuthorize.js +37 -0
  31. package/es/customComponents/AvatarList/index.d.ts +17 -0
  32. package/es/customComponents/AvatarList/index.js +99 -0
  33. package/{src → es}/customComponents/AvatarList/index.less +0 -0
  34. package/es/customComponents/AvatarList/index.test.d.ts +1 -0
  35. package/es/customComponents/Canvas/Bubbly/index.d.ts +20 -0
  36. package/es/customComponents/Canvas/Bubbly/index.js +178 -0
  37. package/es/customComponents/Canvas/Core/index.d.ts +24 -0
  38. package/es/customComponents/Canvas/Core/index.js +163 -0
  39. package/es/customComponents/Canvas/RadarScanning/index.d.ts +20 -0
  40. package/es/customComponents/Canvas/RadarScanning/index.js +247 -0
  41. package/{src → es}/customComponents/Canvas/Ribbon.7z +0 -0
  42. package/es/customComponents/Canvas/Spirit/index.d.ts +19 -0
  43. package/es/customComponents/Canvas/Spirit/index.js +115 -0
  44. package/es/customComponents/Canvas/index.d.ts +12 -0
  45. package/es/customComponents/Canvas/index.js +27 -0
  46. package/es/customComponents/CenterBox/index.d.ts +6 -0
  47. package/es/customComponents/CenterBox/index.js +70 -0
  48. package/es/customComponents/Charts/Bar/index.d.ts +6 -0
  49. package/es/customComponents/Charts/Bar/index.js +129 -0
  50. package/es/customComponents/Charts/ChartCard/index.d.ts +7 -0
  51. package/es/customComponents/Charts/ChartCard/index.js +167 -0
  52. package/{src → es}/customComponents/Charts/ChartCard/index.less +0 -0
  53. package/es/customComponents/Charts/Field/index.d.ts +6 -0
  54. package/es/customComponents/Charts/Field/index.js +37 -0
  55. package/{src → es}/customComponents/Charts/Field/index.less +0 -0
  56. package/es/customComponents/Charts/Gauge/index.d.ts +2 -0
  57. package/es/customComponents/Charts/Gauge/index.js +185 -0
  58. package/es/customComponents/Charts/MiniArea/index.d.ts +2 -0
  59. package/es/customComponents/Charts/MiniArea/index.js +107 -0
  60. package/es/customComponents/Charts/MiniBar/index.d.ts +2 -0
  61. package/es/customComponents/Charts/MiniBar/index.js +62 -0
  62. package/es/customComponents/Charts/MiniProgress/index.d.ts +8 -0
  63. package/es/customComponents/Charts/MiniProgress/index.js +55 -0
  64. package/{src → es}/customComponents/Charts/MiniProgress/index.less +0 -0
  65. package/es/customComponents/Charts/Pie/index.d.ts +8 -0
  66. package/es/customComponents/Charts/Pie/index.js +195 -0
  67. package/{src → es}/customComponents/Charts/Pie/index.less +0 -0
  68. package/es/customComponents/Charts/TagCloud/index.d.ts +14 -0
  69. package/es/customComponents/Charts/TagCloud/index.js +279 -0
  70. package/{src → es}/customComponents/Charts/TagCloud/index.less +0 -0
  71. package/es/customComponents/Charts/TimelineChart/index.d.ts +2 -0
  72. package/es/customComponents/Charts/TimelineChart/index.js +173 -0
  73. package/{src → es}/customComponents/Charts/TimelineChart/index.less +0 -0
  74. package/es/customComponents/Charts/WaterWave/index.d.ts +11 -0
  75. package/es/customComponents/Charts/WaterWave/index.js +319 -0
  76. package/{src → es}/customComponents/Charts/WaterWave/index.less +0 -0
  77. package/es/customComponents/Charts/autoHeight.d.ts +8 -0
  78. package/es/customComponents/Charts/autoHeight.js +123 -0
  79. package/es/customComponents/Charts/bizcharts.d.ts +2 -0
  80. package/es/customComponents/Charts/bizcharts.js +17 -0
  81. package/es/customComponents/Charts/index.d.ts +27 -0
  82. package/es/customComponents/Charts/index.js +119 -0
  83. package/{src → es}/customComponents/Charts/index.less +0 -0
  84. package/es/customComponents/ColorText/index.d.ts +18 -0
  85. package/es/customComponents/ColorText/index.js +127 -0
  86. package/es/customComponents/Countdown/index.d.ts +12 -0
  87. package/es/customComponents/Countdown/index.js +158 -0
  88. package/{src → es}/customComponents/Countdown/index.less +0 -0
  89. package/es/customComponents/DataPreviewDrawer/index.d.ts +13 -0
  90. package/es/customComponents/DataPreviewDrawer/index.js +176 -0
  91. package/{src → es}/customComponents/DataPreviewDrawer/index.less +0 -0
  92. package/es/customComponents/DecorateAvatar/index.d.ts +33 -0
  93. package/es/customComponents/DecorateAvatar/index.js +198 -0
  94. package/es/customComponents/DisplayCopyData/index.d.ts +9 -0
  95. package/es/customComponents/DisplayCopyData/index.js +88 -0
  96. package/es/customComponents/EditableItem/index.d.ts +7 -0
  97. package/es/customComponents/EditableItem/index.js +121 -0
  98. package/{src → es}/customComponents/EditableItem/index.less +0 -0
  99. package/es/customComponents/EditableLinkGroup/index.d.ts +22 -0
  100. package/es/customComponents/EditableLinkGroup/index.js +99 -0
  101. package/{src → es}/customComponents/EditableLinkGroup/index.less +0 -0
  102. package/es/customComponents/Ellipsis/index.d.ts +19 -0
  103. package/es/customComponents/Ellipsis/index.js +380 -0
  104. package/{src → es}/customComponents/Ellipsis/index.less +0 -0
  105. package/es/customComponents/Ellipsis/index.test.d.ts +1 -0
  106. package/es/customComponents/EllipsisCustom/index.d.ts +19 -0
  107. package/es/customComponents/EllipsisCustom/index.js +355 -0
  108. package/{src → es}/customComponents/EllipsisCustom/index.less +0 -0
  109. package/es/customComponents/EverySpace/index.d.ts +15 -0
  110. package/es/customComponents/EverySpace/index.js +105 -0
  111. package/es/customComponents/Exception/index.d.ts +6 -0
  112. package/es/customComponents/Exception/index.js +121 -0
  113. package/{src → es}/customComponents/Exception/index.less +0 -0
  114. package/es/customComponents/Exception/typeConfig.d.ts +18 -0
  115. package/{src → es}/customComponents/Exception/typeConfig.js +13 -7
  116. package/es/customComponents/FigureRange/index.d.ts +126 -0
  117. package/es/customComponents/FigureRange/index.js +335 -0
  118. package/{src → es}/customComponents/FigureRange/index.less +0 -0
  119. package/es/customComponents/FileBase64Upload/index.d.ts +22 -0
  120. package/es/customComponents/FileBase64Upload/index.js +205 -0
  121. package/es/customComponents/FlexBox/index.d.ts +22 -0
  122. package/es/customComponents/FlexBox/index.js +152 -0
  123. package/es/customComponents/FlexText/index.d.ts +17 -0
  124. package/es/customComponents/FlexText/index.js +96 -0
  125. package/{src → es}/customComponents/FlexText/index.less +0 -0
  126. package/es/customComponents/FooterToolbar/index.d.ts +10 -0
  127. package/es/customComponents/FooterToolbar/index.js +132 -0
  128. package/{src → es}/customComponents/FooterToolbar/index.less +0 -0
  129. package/es/customComponents/FromDisplayItem/index.d.ts +13 -0
  130. package/es/customComponents/FromDisplayItem/index.js +73 -0
  131. package/{src → es}/customComponents/FromDisplayItem/index.less +0 -0
  132. package/es/customComponents/FunctionComponent/index.d.ts +353 -0
  133. package/es/customComponents/FunctionComponent/index.js +2443 -0
  134. package/{src → es}/customComponents/FunctionComponent/index.less +0 -0
  135. package/es/customComponents/FunctionSupplement/Whether/index.d.ts +46 -0
  136. package/es/customComponents/FunctionSupplement/Whether/index.js +181 -0
  137. package/es/customComponents/GlobalFooter/index.d.ts +6 -0
  138. package/es/customComponents/GlobalFooter/index.js +39 -0
  139. package/{src → es}/customComponents/GlobalFooter/index.less +0 -0
  140. package/es/customComponents/HelpBox/index.d.ts +16 -0
  141. package/es/customComponents/HelpBox/index.js +166 -0
  142. package/{src → es}/customComponents/HelpBox/index.less +0 -0
  143. package/es/customComponents/HelpCard/index.d.ts +17 -0
  144. package/es/customComponents/HelpCard/index.js +91 -0
  145. package/es/customComponents/HtmlBox/index.d.ts +11 -0
  146. package/es/customComponents/HtmlBox/index.js +98 -0
  147. package/{src → es}/customComponents/HtmlBox/index.less +0 -0
  148. package/es/customComponents/IconInfo/index.d.ts +27 -0
  149. package/es/customComponents/IconInfo/index.js +281 -0
  150. package/{src → es}/customComponents/IconInfo/index.less +0 -0
  151. package/es/customComponents/ImageBox/index.d.ts +39 -0
  152. package/es/customComponents/ImageBox/index.js +376 -0
  153. package/{src → es}/customComponents/ImageBox/index.less +0 -0
  154. package/es/customComponents/ImageContentPreview/index.d.ts +13 -0
  155. package/es/customComponents/ImageContentPreview/index.js +173 -0
  156. package/{src → es}/customComponents/ImageContentPreview/index.less +0 -0
  157. package/es/customComponents/ImageUpload/index.d.ts +33 -0
  158. package/es/customComponents/ImageUpload/index.js +367 -0
  159. package/{src → es}/customComponents/ImageUpload/index.less +0 -0
  160. package/es/customComponents/Login/LoginItem.d.ts +2 -0
  161. package/es/customComponents/Login/LoginItem.js +237 -0
  162. package/es/customComponents/Login/LoginSubmit.d.ts +5 -0
  163. package/es/customComponents/Login/LoginSubmit.js +48 -0
  164. package/es/customComponents/Login/LoginTab.d.ts +5 -0
  165. package/es/customComponents/Login/LoginTab.js +100 -0
  166. package/es/customComponents/Login/index.d.ts +38 -0
  167. package/es/customComponents/Login/index.js +222 -0
  168. package/{src → es}/customComponents/Login/index.less +0 -0
  169. package/es/customComponents/Login/loginContext.d.ts +2 -0
  170. package/es/customComponents/Login/loginContext.js +12 -0
  171. package/es/customComponents/Login/map.d.ts +71 -0
  172. package/es/customComponents/Login/map.js +76 -0
  173. package/es/customComponents/MobileContainor/index.d.ts +6 -0
  174. package/es/customComponents/MobileContainor/index.js +77 -0
  175. package/{src → es}/customComponents/MobileContainor/index.less +0 -0
  176. package/es/customComponents/NoticeIconCustom/NoticeList.d.ts +10 -0
  177. package/es/customComponents/NoticeIconCustom/NoticeList.js +83 -0
  178. package/{src → es}/customComponents/NoticeIconCustom/NoticeList.less +0 -0
  179. package/es/customComponents/NoticeIconCustom/index.d.ts +24 -0
  180. package/es/customComponents/NoticeIconCustom/index.js +201 -0
  181. package/{src → es}/customComponents/NoticeIconCustom/index.less +0 -0
  182. package/es/customComponents/NumberInfo/index.d.ts +12 -0
  183. package/es/customComponents/NumberInfo/index.js +60 -0
  184. package/{src → es}/customComponents/NumberInfo/index.less +0 -0
  185. package/es/customComponents/PercentageBox/index.d.ts +11 -0
  186. package/es/customComponents/PercentageBox/index.js +70 -0
  187. package/es/customComponents/PriceBox/index.d.ts +17 -0
  188. package/es/customComponents/PriceBox/index.js +115 -0
  189. package/es/customComponents/Result/index.d.ts +9 -0
  190. package/es/customComponents/Result/index.js +57 -0
  191. package/{src → es}/customComponents/Result/index.less +0 -0
  192. package/es/customComponents/StandardFormRow/index.d.ts +9 -0
  193. package/es/customComponents/StandardFormRow/index.js +47 -0
  194. package/{src → es}/customComponents/StandardFormRow/index.less +0 -0
  195. package/es/customComponents/StandardTable/index.d.ts +12 -0
  196. package/es/customComponents/StandardTable/index.js +217 -0
  197. package/{src → es}/customComponents/StandardTable/index.less +0 -0
  198. package/es/customComponents/StandardTableCustom/index.d.ts +17 -0
  199. package/es/customComponents/StandardTableCustom/index.js +236 -0
  200. package/{src → es}/customComponents/StandardTableCustom/index.less +0 -0
  201. package/es/customComponents/StatusBar/index.d.ts +12 -0
  202. package/es/customComponents/StatusBar/index.js +128 -0
  203. package/es/customComponents/TagSelect/index.d.ts +29 -0
  204. package/es/customComponents/TagSelect/index.js +226 -0
  205. package/{src → es}/customComponents/TagSelect/index.less +0 -0
  206. package/es/customComponents/TimeLineCustom/index.d.ts +32 -0
  207. package/es/customComponents/TimeLineCustom/index.js +263 -0
  208. package/{src → es}/customComponents/TimeLineCustom/index.less +0 -0
  209. package/es/customComponents/Trend/index.d.ts +10 -0
  210. package/es/customComponents/Trend/index.js +49 -0
  211. package/{src → es}/customComponents/Trend/index.less +0 -0
  212. package/es/customComponents/VerticalBox/index.d.ts +14 -0
  213. package/es/customComponents/VerticalBox/index.js +138 -0
  214. package/{src → es}/customComponents/VerticalBox/index.less +0 -0
  215. package/es/customComponents/VideoUpload/index.d.ts +30 -0
  216. package/es/customComponents/VideoUpload/index.js +472 -0
  217. package/es/customComponents/_utils/pathTools.d.ts +1 -0
  218. package/es/customComponents/_utils/pathTools.js +15 -0
  219. package/es/customComponents/_utils/pathTools.test.d.ts +1 -0
  220. package/es/customComponents/index.d.ts +7 -0
  221. package/{src → es}/customComponents/index.js +9 -2
  222. package/es/framework/AuthorizationWrapper/index.d.ts +9 -0
  223. package/es/framework/AuthorizationWrapper/index.js +120 -0
  224. package/es/framework/Base/index.d.ts +17 -0
  225. package/es/framework/Base/index.js +141 -0
  226. package/es/framework/ButtonExtension/SelectButton/Base/index.d.ts +15 -0
  227. package/es/framework/ButtonExtension/SelectButton/Base/index.js +116 -0
  228. package/es/framework/ButtonExtension/SelectButton/InteractiveBase/index.d.ts +19 -0
  229. package/es/framework/ButtonExtension/SelectButton/InteractiveBase/index.js +177 -0
  230. package/es/framework/Common/index.d.ts +151 -0
  231. package/es/framework/Common/index.js +1867 -0
  232. package/{src → es}/framework/Common/index.less +0 -0
  233. package/es/framework/Core/index.d.ts +9 -0
  234. package/es/framework/Core/index.js +79 -0
  235. package/es/framework/CustomBase/index.d.ts +6 -0
  236. package/es/framework/CustomBase/index.js +77 -0
  237. package/es/framework/CustomWrapper/Supplement/index.d.ts +10 -0
  238. package/es/framework/CustomWrapper/Supplement/index.js +64 -0
  239. package/es/framework/CustomWrapper/SupplementCore/index.d.ts +4 -0
  240. package/es/framework/CustomWrapper/SupplementCore/index.js +112 -0
  241. package/es/framework/CustomWrapper/SupplementWrapper/index.d.ts +4 -0
  242. package/es/framework/CustomWrapper/SupplementWrapper/index.js +58 -0
  243. package/es/framework/DataDrawer/Base/index.d.ts +54 -0
  244. package/es/framework/DataDrawer/Base/index.js +385 -0
  245. package/{src → es}/framework/DataDrawer/Base/index.less +0 -0
  246. package/es/framework/DataDrawer/BaseAddDrawer/index.d.ts +5 -0
  247. package/es/framework/DataDrawer/BaseAddDrawer/index.js +102 -0
  248. package/es/framework/DataDrawer/BaseLoadDrawer/index.d.ts +4 -0
  249. package/es/framework/DataDrawer/BaseLoadDrawer/index.js +81 -0
  250. package/es/framework/DataDrawer/BaseNeedlessLoadDrawer/index.d.ts +5 -0
  251. package/es/framework/DataDrawer/BaseNeedlessLoadDrawer/index.js +86 -0
  252. package/es/framework/DataDrawer/BaseSaveDrawer/index.d.ts +5 -0
  253. package/es/framework/DataDrawer/BaseSaveDrawer/index.js +85 -0
  254. package/es/framework/DataDrawer/BaseUpdateDrawer/index.d.ts +4 -0
  255. package/es/framework/DataDrawer/BaseUpdateDrawer/index.js +83 -0
  256. package/es/framework/DataForm/BaseAddForm/index.d.ts +34 -0
  257. package/es/framework/DataForm/BaseAddForm/index.js +274 -0
  258. package/es/framework/DataForm/BaseUpdateForm/index.d.ts +10 -0
  259. package/es/framework/DataForm/BaseUpdateForm/index.js +189 -0
  260. package/es/framework/DataForm/BaseUpdateFormContent/index.d.ts +4 -0
  261. package/es/framework/DataForm/BaseUpdateFormContent/index.js +62 -0
  262. package/es/framework/DataForm/BaseUpdateFormTab/index.d.ts +4 -0
  263. package/es/framework/DataForm/BaseUpdateFormTab/index.js +45 -0
  264. package/es/framework/DataListView/Base/index.d.ts +141 -0
  265. package/es/framework/DataListView/Base/index.js +1391 -0
  266. package/{src → es}/framework/DataListView/Base/index.less +0 -0
  267. package/es/framework/DataListView/BatchAction/index.d.ts +21 -0
  268. package/es/framework/DataListView/BatchAction/index.js +97 -0
  269. package/{src → es}/framework/DataListView/BatchAction/index.less +0 -0
  270. package/es/framework/DataListView/ColumnSetting/DndItem.d.ts +8 -0
  271. package/es/framework/DataListView/ColumnSetting/DndItem.js +155 -0
  272. package/es/framework/DataListView/ColumnSetting/index.d.ts +3 -0
  273. package/es/framework/DataListView/ColumnSetting/index.js +366 -0
  274. package/{src → es}/framework/DataListView/ColumnSetting/index.less +0 -0
  275. package/es/framework/DataListView/DensityAction/index.d.ts +6 -0
  276. package/es/framework/DataListView/DensityAction/index.js +112 -0
  277. package/es/framework/DataMenuContainer/index.d.ts +30 -0
  278. package/es/framework/DataMenuContainer/index.js +341 -0
  279. package/es/framework/DataMenuContainer/index.less +107 -0
  280. package/es/framework/DataModal/Base/index.d.ts +67 -0
  281. package/es/framework/DataModal/Base/index.js +292 -0
  282. package/{src → es}/framework/DataModal/Base/index.less +0 -0
  283. package/es/framework/DataModal/BaseAddModal/index.d.ts +4 -0
  284. package/es/framework/DataModal/BaseAddModal/index.js +70 -0
  285. package/es/framework/DataModal/BaseLoadModal/index.d.ts +4 -0
  286. package/es/framework/DataModal/BaseLoadModal/index.js +81 -0
  287. package/es/framework/DataModal/BaseNeedlessLoadModal/index.d.ts +10 -0
  288. package/es/framework/DataModal/BaseNeedlessLoadModal/index.js +135 -0
  289. package/es/framework/DataModal/BaseSelectModal/index.d.ts +4 -0
  290. package/es/framework/DataModal/BaseSelectModal/index.js +69 -0
  291. package/es/framework/DataModal/BaseUpdateModal/index.d.ts +4 -0
  292. package/es/framework/DataModal/BaseUpdateModal/index.js +45 -0
  293. package/es/framework/DataModal/BaseUpdateTransferModal/index.d.ts +10 -0
  294. package/es/framework/DataModal/BaseUpdateTransferModal/index.js +164 -0
  295. package/es/framework/DataMultiPageView/InnerMultiPage/index.d.ts +4 -0
  296. package/es/framework/DataMultiPageView/InnerMultiPage/index.js +58 -0
  297. package/{src → es}/framework/DataMultiPageView/InnerMultiPage/index.less +0 -0
  298. package/es/framework/DataMultiPageView/MultiPage/index.d.ts +24 -0
  299. package/es/framework/DataMultiPageView/MultiPage/index.js +480 -0
  300. package/{src → es}/framework/DataMultiPageView/MultiPage/index.less +0 -0
  301. package/es/framework/DataMultiPageView/MultiPageDrawer/index.d.ts +32 -0
  302. package/es/framework/DataMultiPageView/MultiPageDrawer/index.js +535 -0
  303. package/{src → es}/framework/DataMultiPageView/MultiPageDrawer/index.less +0 -0
  304. package/es/framework/DataMultiPageView/MultiPageSelectDrawer/index.d.ts +11 -0
  305. package/es/framework/DataMultiPageView/MultiPageSelectDrawer/index.js +121 -0
  306. package/es/framework/DataOperation/Base/index.d.ts +76 -0
  307. package/es/framework/DataOperation/Base/index.js +369 -0
  308. package/es/framework/DataOperation/BaseView/index.d.ts +11 -0
  309. package/es/framework/DataOperation/BaseView/index.js +74 -0
  310. package/es/framework/DataOperation/BaseWindow/index.d.ts +53 -0
  311. package/es/framework/DataOperation/BaseWindow/index.js +342 -0
  312. package/es/framework/DataSinglePageView/InnerSinglePage/index.d.ts +5 -0
  313. package/es/framework/DataSinglePageView/InnerSinglePage/index.js +58 -0
  314. package/{src → es}/framework/DataSinglePageView/InnerSinglePage/index.less +0 -0
  315. package/es/framework/DataSinglePageView/SinglePage/index.d.ts +13 -0
  316. package/es/framework/DataSinglePageView/SinglePage/index.js +282 -0
  317. package/es/framework/DataSinglePageView/SinglePageDrawer/index.d.ts +25 -0
  318. package/es/framework/DataSinglePageView/SinglePageDrawer/index.js +454 -0
  319. package/{src → es}/framework/DataSinglePageView/SinglePageDrawer/index.less +0 -0
  320. package/es/framework/DataSingleView/DataCore/index.d.ts +29 -0
  321. package/es/framework/DataSingleView/DataCore/index.js +269 -0
  322. package/{src → es}/framework/DataSingleView/DataCore/index.less +0 -0
  323. package/es/framework/DataSingleView/DataLoad/index.d.ts +52 -0
  324. package/es/framework/DataSingleView/DataLoad/index.js +169 -0
  325. package/es/framework/DataTabContainer/index.d.ts +46 -0
  326. package/es/framework/DataTabContainer/index.js +315 -0
  327. package/{src → es}/framework/DataTabContainer/index.less +0 -0
  328. package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.d.ts +24 -0
  329. package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.js +184 -0
  330. package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldDrawerBase/index.d.ts +20 -0
  331. package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldDrawerBase/index.js +191 -0
  332. package/es/framework/Wrapper/index.d.ts +4 -0
  333. package/es/framework/Wrapper/index.js +58 -0
  334. package/es/framework/index.d.ts +7 -0
  335. package/{src → es}/framework/index.js +9 -2
  336. package/es/index.d.ts +1 -0
  337. package/es/index.js +8 -0
  338. package/es/utils/Authorized.d.ts +4 -0
  339. package/es/utils/Authorized.js +49 -0
  340. package/es/utils/Yuan.d.ts +10 -0
  341. package/es/utils/Yuan.js +92 -0
  342. package/es/utils/actionAssist.d.ts +39 -0
  343. package/es/utils/actionAssist.js +286 -0
  344. package/es/utils/authority.d.ts +4 -0
  345. package/es/utils/authority.js +89 -0
  346. package/es/utils/constants.d.ts +329 -0
  347. package/{src → es}/utils/constants.js +140 -115
  348. package/es/utils/defaultSettingsSpecial.d.ts +33 -0
  349. package/es/utils/defaultSettingsSpecial.js +276 -0
  350. package/es/utils/globalModel.d.ts +17 -0
  351. package/es/utils/globalModel.js +40 -0
  352. package/es/utils/globalStorageAssist.d.ts +74 -0
  353. package/es/utils/globalStorageAssist.js +210 -0
  354. package/es/utils/proLayoutCollection.d.ts +11 -0
  355. package/es/utils/proLayoutCollection.js +37 -0
  356. package/es/utils/request.d.ts +5 -0
  357. package/es/utils/request.js +202 -0
  358. package/es/utils/requestAssistor.d.ts +63 -0
  359. package/es/utils/requestAssistor.js +538 -0
  360. package/es/utils/tools.d.ts +736 -0
  361. package/es/utils/tools.js +2176 -0
  362. package/es/utils/utils.d.ts +5 -0
  363. package/es/utils/utils.js +70 -0
  364. package/{src → es}/utils/utils.less +0 -0
  365. package/es/utils/utils.test.d.ts +1 -0
  366. package/es/utils/virtualRequest.d.ts +50 -0
  367. package/es/utils/virtualRequest.js +325 -0
  368. package/lib/customComponents/FileBase64Upload/index.js +3 -1
  369. package/lib/customComponents/FunctionComponent/index.d.ts +8 -0
  370. package/lib/customComponents/FunctionComponent/index.js +106 -77
  371. package/lib/customComponents/ImageUpload/index.js +3 -1
  372. package/lib/customComponents/VideoUpload/index.js +3 -1
  373. package/lib/framework/Base/index.d.ts +2 -0
  374. package/lib/framework/Base/index.js +6 -0
  375. package/lib/framework/Common/index.d.ts +14 -1
  376. package/lib/framework/Common/index.js +143 -85
  377. package/lib/framework/DataForm/BaseUpdateFormContent/index.d.ts +4 -0
  378. package/lib/framework/DataForm/BaseUpdateFormContent/index.js +62 -0
  379. package/lib/framework/DataForm/BaseUpdateFormTab/index.d.ts +2 -2
  380. package/lib/framework/DataForm/BaseUpdateFormTab/index.js +4 -21
  381. package/lib/framework/DataMenuContainer/index.d.ts +30 -0
  382. package/lib/framework/DataMenuContainer/index.js +341 -0
  383. package/lib/framework/DataMenuContainer/index.less +107 -0
  384. package/lib/utils/constants.d.ts +8 -0
  385. package/lib/utils/constants.js +7 -1
  386. package/lib/utils/defaultSettingsSpecial.d.ts +3 -0
  387. package/lib/utils/defaultSettingsSpecial.js +30 -0
  388. package/lib/utils/tools.d.ts +15 -0
  389. package/lib/utils/tools.js +72 -2
  390. package/package.json +15 -11
  391. package/LICENSE.md +0 -21
  392. package/lib/framework/DataForm/BaseUpdateForm/index.less +0 -3
  393. package/lib/framework/DataForm/BaseUpdateFormTab/index.less +0 -3
  394. package/src/customComponents/AMap/UIPoiPicker.js +0 -32
  395. package/src/customComponents/AMap/UIPositionPicker.js +0 -42
  396. package/src/customComponents/ActiveChart/index.jsx +0 -106
  397. package/src/customComponents/AnimalBox/FadeBox/index.jsx +0 -26
  398. package/src/customComponents/AnimalBox/QueueBox/index.jsx +0 -72
  399. package/src/customComponents/ArticleListContent/index.jsx +0 -22
  400. package/src/customComponents/Authorized/Authorized.jsx +0 -22
  401. package/src/customComponents/Authorized/AuthorizedRoute.jsx +0 -35
  402. package/src/customComponents/Authorized/CheckPermissions.jsx +0 -80
  403. package/src/customComponents/Authorized/PromiseRender.jsx +0 -79
  404. package/src/customComponents/Authorized/index.jsx +0 -9
  405. package/src/customComponents/Authorized/renderAuthorize.js +0 -27
  406. package/src/customComponents/AvatarList/demo/maxLength.md +0 -46
  407. package/src/customComponents/AvatarList/demo/simple.md +0 -30
  408. package/src/customComponents/AvatarList/index.en-US.md +0 -24
  409. package/src/customComponents/AvatarList/index.jsx +0 -69
  410. package/src/customComponents/AvatarList/index.test.js +0 -31
  411. package/src/customComponents/AvatarList/index.zh-CN.md +0 -25
  412. package/src/customComponents/Canvas/Bubbly/index.jsx +0 -117
  413. package/src/customComponents/Canvas/Core/index.jsx +0 -120
  414. package/src/customComponents/Canvas/RadarScanning/index.jsx +0 -188
  415. package/src/customComponents/Canvas/Spirit/index.jsx +0 -75
  416. package/src/customComponents/Canvas/index.jsx +0 -13
  417. package/src/customComponents/CenterBox/index.jsx +0 -24
  418. package/src/customComponents/Charts/Bar/index.jsx +0 -67
  419. package/src/customComponents/Charts/ChartCard/index.jsx +0 -112
  420. package/src/customComponents/Charts/Field/index.jsx +0 -11
  421. package/src/customComponents/Charts/Gauge/index.jsx +0 -184
  422. package/src/customComponents/Charts/MiniArea/index.jsx +0 -99
  423. package/src/customComponents/Charts/MiniBar/index.jsx +0 -49
  424. package/src/customComponents/Charts/MiniProgress/index.jsx +0 -45
  425. package/src/customComponents/Charts/Pie/index.jsx +0 -129
  426. package/src/customComponents/Charts/TagCloud/index.jsx +0 -200
  427. package/src/customComponents/Charts/TimelineChart/index.jsx +0 -151
  428. package/src/customComponents/Charts/WaterWave/index.jsx +0 -258
  429. package/src/customComponents/Charts/autoHeight.jsx +0 -71
  430. package/src/customComponents/Charts/bizcharts.jsx +0 -3
  431. package/src/customComponents/Charts/index.jsx +0 -44
  432. package/src/customComponents/ColorText/index.jsx +0 -73
  433. package/src/customComponents/Countdown/demo/simple.md +0 -25
  434. package/src/customComponents/Countdown/index.en-US.md +0 -15
  435. package/src/customComponents/Countdown/index.jsx +0 -122
  436. package/src/customComponents/Countdown/index.zh-CN.md +0 -16
  437. package/src/customComponents/DataPreviewDrawer/index.jsx +0 -139
  438. package/src/customComponents/DecorateAvatar/index.jsx +0 -149
  439. package/src/customComponents/DisplayCopyData/index.js +0 -50
  440. package/src/customComponents/EditableItem/index.jsx +0 -56
  441. package/src/customComponents/EditableLinkGroup/index.jsx +0 -52
  442. package/src/customComponents/Ellipsis/demo/line.md +0 -40
  443. package/src/customComponents/Ellipsis/demo/number.md +0 -32
  444. package/src/customComponents/Ellipsis/index.en-US.md +0 -16
  445. package/src/customComponents/Ellipsis/index.jsx +0 -286
  446. package/src/customComponents/Ellipsis/index.test.js +0 -13
  447. package/src/customComponents/Ellipsis/index.zh-CN.md +0 -17
  448. package/src/customComponents/EllipsisCustom/index.jsx +0 -293
  449. package/src/customComponents/EverySpace/index.jsx +0 -64
  450. package/src/customComponents/Exception/demo/403.md +0 -27
  451. package/src/customComponents/Exception/demo/404.md +0 -20
  452. package/src/customComponents/Exception/demo/500.md +0 -20
  453. package/src/customComponents/Exception/index.en-US.md +0 -20
  454. package/src/customComponents/Exception/index.jsx +0 -53
  455. package/src/customComponents/Exception/index.zh-CN.md +0 -21
  456. package/src/customComponents/FigureRange/index.jsx +0 -290
  457. package/src/customComponents/FileBase64Upload/index.jsx +0 -139
  458. package/src/customComponents/FlexBox/index.jsx +0 -104
  459. package/src/customComponents/FlexText/index.jsx +0 -59
  460. package/src/customComponents/FooterToolbar/demo/basic.md +0 -45
  461. package/src/customComponents/FooterToolbar/index.en-US.md +0 -18
  462. package/src/customComponents/FooterToolbar/index.jsx +0 -51
  463. package/src/customComponents/FooterToolbar/index.zh-CN.md +0 -19
  464. package/src/customComponents/FromDisplayItem/index.jsx +0 -23
  465. package/src/customComponents/FunctionComponent/index.jsx +0 -2613
  466. package/src/customComponents/FunctionSupplement/Whether/index.jsx +0 -139
  467. package/src/customComponents/GlobalFooter/index.jsx +0 -29
  468. package/src/customComponents/GlobalFooter/index.md +0 -17
  469. package/src/customComponents/HelpBox/index.jsx +0 -146
  470. package/src/customComponents/HelpCard/index.jsx +0 -48
  471. package/src/customComponents/HtmlBox/index.jsx +0 -36
  472. package/src/customComponents/IconInfo/index.jsx +0 -302
  473. package/src/customComponents/ImageBox/index.jsx +0 -402
  474. package/src/customComponents/ImageContentPreview/index.jsx +0 -146
  475. package/src/customComponents/ImageUpload/index.jsx +0 -340
  476. package/src/customComponents/Login/LoginItem.js +0 -144
  477. package/src/customComponents/Login/LoginSubmit.js +0 -23
  478. package/src/customComponents/Login/LoginTab.js +0 -41
  479. package/src/customComponents/Login/demo/basic.md +0 -142
  480. package/src/customComponents/Login/index.en-US.md +0 -49
  481. package/src/customComponents/Login/index.jsx +0 -138
  482. package/src/customComponents/Login/index.zh-CN.md +0 -50
  483. package/src/customComponents/Login/loginContext.js +0 -4
  484. package/src/customComponents/Login/map.js +0 -71
  485. package/src/customComponents/MobileContainor/index.jsx +0 -29
  486. package/src/customComponents/NoticeIconCustom/NoticeList.js +0 -78
  487. package/src/customComponents/NoticeIconCustom/demo/basic.md +0 -12
  488. package/src/customComponents/NoticeIconCustom/demo/popover.md +0 -202
  489. package/src/customComponents/NoticeIconCustom/index.jsx +0 -117
  490. package/src/customComponents/NumberInfo/demo/basic.md +0 -31
  491. package/src/customComponents/NumberInfo/index.en-US.md +0 -19
  492. package/src/customComponents/NumberInfo/index.jsx +0 -59
  493. package/src/customComponents/NumberInfo/index.zh-CN.md +0 -20
  494. package/src/customComponents/PercentageBox/index.jsx +0 -23
  495. package/src/customComponents/PriceBox/index.jsx +0 -73
  496. package/src/customComponents/Result/index.jsx +0 -30
  497. package/src/customComponents/Result/index.md +0 -20
  498. package/src/customComponents/StandardFormRow/index.jsx +0 -24
  499. package/src/customComponents/StandardTable/index.jsx +0 -126
  500. package/src/customComponents/StandardTableCustom/index.jsx +0 -156
  501. package/src/customComponents/StatusBar/index.jsx +0 -74
  502. package/src/customComponents/TagSelect/demo/controlled.md +0 -54
  503. package/src/customComponents/TagSelect/demo/expandable.md +0 -32
  504. package/src/customComponents/TagSelect/demo/simple.md +0 -26
  505. package/src/customComponents/TagSelect/index.jsx +0 -141
  506. package/src/customComponents/TagSelect/index.md +0 -29
  507. package/src/customComponents/TimeLineCustom/index.jsx +0 -225
  508. package/src/customComponents/Trend/demo/basic.md +0 -20
  509. package/src/customComponents/Trend/demo/reverse.md +0 -22
  510. package/src/customComponents/Trend/index.jsx +0 -35
  511. package/src/customComponents/Trend/index.md +0 -22
  512. package/src/customComponents/VerticalBox/index.jsx +0 -81
  513. package/src/customComponents/VideoUpload/index.jsx +0 -422
  514. package/src/customComponents/_utils/pathTools.js +0 -7
  515. package/src/customComponents/_utils/pathTools.test.js +0 -20
  516. package/src/framework/AuthorizationWrapper/index.jsx +0 -68
  517. package/src/framework/Base/index.jsx +0 -93
  518. package/src/framework/ButtonExtension/SelectButton/Base/index.jsx +0 -67
  519. package/src/framework/ButtonExtension/SelectButton/InteractiveBase/index.jsx +0 -130
  520. package/src/framework/Common/index.jsx +0 -2235
  521. package/src/framework/Core/index.jsx +0 -34
  522. package/src/framework/CustomBase/index.jsx +0 -33
  523. package/src/framework/CustomWrapper/Supplement/index.jsx +0 -17
  524. package/src/framework/CustomWrapper/SupplementCore/index.jsx +0 -65
  525. package/src/framework/CustomWrapper/SupplementWrapper/index.jsx +0 -11
  526. package/src/framework/DataDrawer/Base/index.jsx +0 -314
  527. package/src/framework/DataDrawer/BaseAddDrawer/index.jsx +0 -50
  528. package/src/framework/DataDrawer/BaseLoadDrawer/index.jsx +0 -20
  529. package/src/framework/DataDrawer/BaseNeedlessLoadDrawer/index.jsx +0 -37
  530. package/src/framework/DataDrawer/BaseSaveDrawer/index.jsx +0 -35
  531. package/src/framework/DataDrawer/BaseUpdateDrawer/index.jsx +0 -33
  532. package/src/framework/DataForm/BaseAddForm/index.jsx +0 -231
  533. package/src/framework/DataForm/BaseUpdateForm/index.jsx +0 -145
  534. package/src/framework/DataForm/BaseUpdateForm/index.less +0 -3
  535. package/src/framework/DataForm/BaseUpdateFormTab/index.jsx +0 -18
  536. package/src/framework/DataForm/BaseUpdateFormTab/index.less +0 -3
  537. package/src/framework/DataListView/Base/index.jsx +0 -1583
  538. package/src/framework/DataListView/BatchAction/index.jsx +0 -78
  539. package/src/framework/DataListView/ColumnSetting/DndItem.jsx +0 -105
  540. package/src/framework/DataListView/ColumnSetting/index.jsx +0 -346
  541. package/src/framework/DataListView/DensityAction/index.jsx +0 -46
  542. package/src/framework/DataModal/Base/index.jsx +0 -238
  543. package/src/framework/DataModal/BaseAddModal/index.jsx +0 -17
  544. package/src/framework/DataModal/BaseLoadModal/index.jsx +0 -30
  545. package/src/framework/DataModal/BaseNeedlessLoadModal/index.jsx +0 -83
  546. package/src/framework/DataModal/BaseSelectModal/index.jsx +0 -28
  547. package/src/framework/DataModal/BaseUpdateModal/index.jsx +0 -5
  548. package/src/framework/DataModal/BaseUpdateTransferModal/index.jsx +0 -103
  549. package/src/framework/DataMultiPageView/InnerMultiPage/index.jsx +0 -18
  550. package/src/framework/DataMultiPageView/MultiPage/index.jsx +0 -461
  551. package/src/framework/DataMultiPageView/MultiPageDrawer/index.jsx +0 -549
  552. package/src/framework/DataMultiPageView/MultiPageSelectDrawer/index.jsx +0 -50
  553. package/src/framework/DataOperation/Base/index.jsx +0 -323
  554. package/src/framework/DataOperation/BaseView/index.jsx +0 -26
  555. package/src/framework/DataOperation/BaseWindow/index.jsx +0 -291
  556. package/src/framework/DataSinglePageView/InnerSinglePage/index.jsx +0 -18
  557. package/src/framework/DataSinglePageView/SinglePage/index.jsx +0 -245
  558. package/src/framework/DataSinglePageView/SinglePageDrawer/index.jsx +0 -474
  559. package/src/framework/DataSingleView/DataCore/index.jsx +0 -216
  560. package/src/framework/DataSingleView/DataLoad/index.jsx +0 -127
  561. package/src/framework/DataTabContainer/index.jsx +0 -304
  562. package/src/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.jsx +0 -149
  563. package/src/framework/FieldExtension/SelectFieldDrawer/SelectFieldDrawerBase/index.jsx +0 -140
  564. package/src/framework/Wrapper/index.jsx +0 -10
  565. package/src/utils/Authorized.js +0 -42
  566. package/src/utils/Yuan.js +0 -31
  567. package/src/utils/actionAssist.js +0 -231
  568. package/src/utils/authority.js +0 -85
  569. package/src/utils/defaultSettingsSpecial.js +0 -235
  570. package/src/utils/globalModel.js +0 -33
  571. package/src/utils/globalStorageAssist.js +0 -193
  572. package/src/utils/proLayoutCollection.js +0 -25
  573. package/src/utils/request.js +0 -160
  574. package/src/utils/requestAssistor.js +0 -485
  575. package/src/utils/tools.js +0 -1947
  576. package/src/utils/utils.js +0 -45
  577. package/src/utils/utils.test.js +0 -35
  578. package/src/utils/virtualRequest.js +0 -216
@@ -1,1947 +0,0 @@
1
- import { message, notification } from 'antd';
2
- import moment from 'moment';
3
- import { v4 as uuidv4 } from 'uuid';
4
- import copy from 'copy-to-clipboard';
5
- import queue from 'queue';
6
- import numeral from 'numeral';
7
- import { arrayMoveImmutable, arrayMoveMutable } from 'array-move';
8
- import {
9
- isEqual as isEqualLodash,
10
- isFunction as isFunctionLodash,
11
- filter as filterLodash,
12
- sortBy as sortByLodash,
13
- findIndex as findIndexLodash,
14
- find as findLodash,
15
- reverse as reverseLodash,
16
- replace as replaceLodash,
17
- trim as trimLodash,
18
- isEmpty as isEmptyLodash,
19
- isBoolean as isBooleanLodash,
20
- isUndefined as isUndefinedLodash,
21
- isNull as isNullLodash,
22
- isDate as isDateLodash,
23
- isArray as isArrayLodash,
24
- isString as isStringLodash,
25
- remove as removeLodash,
26
- isObject as isObjectLodash,
27
- difference as differenceLodash,
28
- toNumber as toNumberLodash,
29
- split as splitLodash,
30
- toString as toStringLodash,
31
- get as getLodash,
32
- toLower,
33
- } from 'lodash';
34
-
35
- import {
36
- listViewModeCollection,
37
- emptyDatetime,
38
- notificationTypeCollection,
39
- messageTypeCollection,
40
- logLevel,
41
- logShowMode,
42
- appInitDefault,
43
- convertCollection,
44
- formatCollection,
45
- datetimeFormat,
46
- } from './constants';
47
-
48
- const storageKeyCollection = {
49
- nearestLocalhostNotify: 'nearestLocalhostNotify',
50
- };
51
-
52
- function isBrowser() {
53
- return (
54
- typeof window !== 'undefined' &&
55
- typeof window.document !== 'undefined' &&
56
- typeof window.document.createElement !== 'undefined'
57
- );
58
- }
59
-
60
- export function getAppInitConfigData() {
61
- let appInitConfig = appInitDefault;
62
-
63
- if (isBrowser()) {
64
- if ((window.appInitCustom || null) != null) {
65
- appInitConfig = { ...appInitConfig, ...window.appInitCustom };
66
- }
67
- }
68
-
69
- return appInitConfig;
70
- }
71
-
72
- export function defaultBaseState() {
73
- return {
74
- dataLoading: false,
75
- processing: false,
76
- reloading: false,
77
- searching: false,
78
- refreshing: false,
79
- paging: false,
80
- firstLoadSuccess: false,
81
- loadSuccess: false,
82
-
83
- urlParams: null,
84
- externalData: null,
85
- };
86
- }
87
-
88
- export function defaultCoreState() {
89
- const data = { ...defaultBaseState(), ...{ dataLoading: true } };
90
-
91
- return data;
92
- }
93
-
94
- export function defaultCommonState() {
95
- const data = {
96
- ...defaultCoreState(),
97
- ...{
98
- loadApiPath: '',
99
- pageName: '',
100
- metaData: null,
101
- metaExtra: null,
102
- metaListData: [],
103
- metaOriginalData: null,
104
- },
105
- };
106
-
107
- return data;
108
- }
109
-
110
- export function defaultListState() {
111
- const data = {
112
- ...defaultCommonState(),
113
- ...{
114
- dateRangeFieldName: '发生时间',
115
- tableScroll: { x: 1520 },
116
- formValues: {},
117
- startTimeAlias: '',
118
- endTimeAlias: '',
119
- startTime: '',
120
- endTime: '',
121
- listViewMode: listViewModeCollection.table,
122
- showSelect: false,
123
- selectedDataTableDataRows: [],
124
- },
125
- };
126
-
127
- return data;
128
- }
129
-
130
- export function defaultPageListState() {
131
- const data = {
132
- ...defaultCommonState(),
133
- ...{
134
- paramsKey: '',
135
- loadApiPath: '',
136
- dateRangeFieldName: '发生时间',
137
- tableScroll: { x: 1520 },
138
- formValues: {},
139
- pageNo: 1,
140
- pageSize: 10,
141
- startTime: '',
142
- endTime: '',
143
- listViewMode: listViewModeCollection.table,
144
- showSelect: false,
145
- selectedDataTableDataRows: [],
146
- },
147
- };
148
-
149
- return data;
150
- }
151
-
152
- export function defaultFormState() {
153
- const data = {
154
- ...defaultCommonState(),
155
- ...{ errorFieldName: '', submitApiPath: '' },
156
- };
157
-
158
- return data;
159
- }
160
-
161
- export function getValue(obj) {
162
- return Object.keys(obj)
163
- .map((key) => obj[key])
164
- .join(',');
165
- }
166
-
167
- /**
168
- * 复制到剪贴板
169
- * @param {*} text
170
- * @param {*} showText
171
- */
172
- export function copyToClipboard(text, showCopyText = true, otherShowText = '') {
173
- copy(text);
174
-
175
- if (showCopyText) {
176
- message.success(`已经将 ${text} 复制到剪贴板!`);
177
- } else if (stringIsNullOrWhiteSpace(otherShowText)) {
178
- message.success('已经复制到剪贴板!');
179
- } else {
180
- message.success(`已经将${otherShowText}复制到剪贴板!`);
181
- }
182
- }
183
-
184
- /**
185
- * 复制到剪贴板
186
- * @param {*} text
187
- */
188
- export function stringIsEmpty(text) {
189
- return isEmptyLodash(toString(text || '').replace(' ', ''));
190
- }
191
-
192
- /**
193
- *替换指定字符串
194
- *
195
- * @export
196
- * @param {*} text
197
- * @param {*} replaceText
198
- * @param {*} beforeKeepNumber
199
- * @param {*} afterKeepNumber
200
- * @returns
201
- */
202
- export function replaceTargetText(
203
- text,
204
- replaceText,
205
- beforeKeepNumber,
206
- afterKeepNumber,
207
- ) {
208
- let result = toString(text);
209
-
210
- const textLength = (text || '').length;
211
- if (textLength > 0 && (beforeKeepNumber >= 0 || afterKeepNumber >= 0)) {
212
- if (
213
- beforeKeepNumber >= textLength ||
214
- afterKeepNumber >= textLength ||
215
- (beforeKeepNumber || 0) + (afterKeepNumber || 0) >= textLength
216
- ) {
217
- result = text;
218
- } else {
219
- const beforeKeep = text.substr(0, beforeKeepNumber);
220
-
221
- const afterKeep = text.substr(
222
- textLength - afterKeepNumber,
223
- afterKeepNumber,
224
- );
225
-
226
- // const replaceTargetLength = textLength - (beforeKeepNumber || 0) - (afterKeepNumber || 0);
227
-
228
- // const replaceTarget = text.substring(
229
- // (beforeKeepNumber || 0) <= 0 ? 0 : beforeKeepNumber - 1,
230
- // textLength - (beforeKeepNumber || 0) - (afterKeepNumber || 0)
231
- // );
232
-
233
- // const replaced = [];
234
-
235
- // let i = 1;
236
- // while (i <= replaceTargetLength) {
237
- // replaced.push(replaceText);
238
- // i += 1;
239
- // }
240
-
241
- result = beforeKeep + replaceText + afterKeep;
242
- }
243
- }
244
-
245
- return result || '';
246
- }
247
-
248
- export function checkDevelopment() {
249
- return process.env.NODE_ENV === 'development';
250
- }
251
-
252
- /**
253
- * corsTarget
254
- * 跨域域名配置
255
- * @export
256
- * @param {*} v
257
- * @returns
258
- */
259
- export function corsTarget() {
260
- const appInit = getAppInitConfigData();
261
- let corsTargetDomain = '';
262
-
263
- if (appInit.apiPrefix != null) {
264
- if (appInit.apiPrefix.corsTargetDomain != null) {
265
- const {
266
- apiPrefix: { corsTargetDomain: corsTargetDomainRemote },
267
- } = appInit;
268
-
269
- corsTargetDomain = corsTargetDomainRemote;
270
- }
271
- }
272
-
273
- return corsTargetDomain;
274
- }
275
-
276
- export function showError(text) {
277
- showErrorMessage({
278
- message: text,
279
- });
280
- }
281
-
282
- export function showRuntimeError({ message: messageText, showStack = true }) {
283
- try {
284
- if (!stringIsNullOrWhiteSpace(messageText || '')) {
285
- showErrorMessage({
286
- message: messageText,
287
- });
288
- }
289
-
290
- if (showStack) {
291
- throw new Error(
292
- `${
293
- stringIsNullOrWhiteSpace(messageText || '')
294
- ? ''
295
- : `${toString(messageText)},`
296
- }调用堆栈:`,
297
- );
298
- }
299
- } catch (e) {
300
- // eslint-disable-next-line no-console
301
- console.log(e.stack);
302
- }
303
- }
304
-
305
- export function showSuccessMessage({
306
- duration = 3,
307
- message: messageText,
308
- onClose = () => {},
309
- }) {
310
- showMessage({
311
- type: messageTypeCollection.success,
312
- message: messageText,
313
- duration,
314
- onClose,
315
- });
316
- }
317
-
318
- export function showErrorMessage({
319
- duration = 3,
320
- message: messageText,
321
- onClose = () => {},
322
- }) {
323
- showMessage({
324
- type: messageTypeCollection.error,
325
- message: messageText,
326
- duration,
327
- onClose,
328
- });
329
- }
330
-
331
- export function showWarnMessage({
332
- duration = 3,
333
- message: messageText,
334
- onClose = () => {},
335
- }) {
336
- showMessage({
337
- type: messageTypeCollection.warn,
338
- message: messageText,
339
- duration,
340
- onClose,
341
- });
342
- }
343
-
344
- export function showWarningMessage({
345
- duration = 3,
346
- message: messageText,
347
- onClose = () => {},
348
- }) {
349
- showMessage({
350
- type: messageTypeCollection.warning,
351
- message: messageText,
352
- duration,
353
- onClose,
354
- });
355
- }
356
-
357
- /**
358
- * 显示消息信息
359
- */
360
- export function showInfoMessage({
361
- duration = 3,
362
- message: messageText,
363
- onClose = () => {},
364
- }) {
365
- showMessage({
366
- type: messageTypeCollection.info,
367
- message: messageText,
368
- duration,
369
- onClose,
370
- });
371
- }
372
-
373
- export function showLoadingMessage({
374
- duration = 3,
375
- message: messageText,
376
- onClose = () => {},
377
- }) {
378
- showMessage({
379
- type: messageTypeCollection.loading,
380
- message: messageText,
381
- duration,
382
- onClose,
383
- });
384
- }
385
-
386
- export function showOpenMessage({
387
- duration = 3,
388
- message: messageText,
389
- onClose = () => {},
390
- }) {
391
- showMessage({
392
- type: messageTypeCollection.open,
393
- message: messageText,
394
- duration,
395
- onClose,
396
- });
397
- }
398
-
399
- export function showMessage({
400
- type,
401
- duration = 3,
402
- message: messageText,
403
- onClose = () => {},
404
- }) {
405
- requestAnimationFrame(() => {
406
- switch (type) {
407
- case messageTypeCollection.success:
408
- message.success(messageText, duration, onClose);
409
-
410
- break;
411
-
412
- case messageTypeCollection.error:
413
- message.warn(messageText, duration, onClose);
414
-
415
- break;
416
-
417
- case messageTypeCollection.info:
418
- message.info(messageText, duration, onClose);
419
-
420
- break;
421
-
422
- case messageTypeCollection.warning:
423
- message.warning(messageText, duration, onClose);
424
-
425
- break;
426
-
427
- case messageTypeCollection.warn:
428
- message.warn(messageText, duration, onClose);
429
-
430
- break;
431
-
432
- case messageTypeCollection.loading:
433
- message.loading(messageText, duration, onClose);
434
-
435
- break;
436
-
437
- default:
438
- message.open(messageText, duration, onClose);
439
-
440
- break;
441
- }
442
- });
443
- }
444
-
445
- /**
446
- * 记录日志
447
- *
448
- * @export
449
- * @param {*} str
450
- * @returns
451
- */
452
- export function recordLog(record, showMode, level = logLevel.debug) {
453
- let showModeModified =
454
- (showMode || null) == null || stringIsNullOrWhiteSpace(showMode)
455
- ? logShowMode.unknown
456
- : showMode;
457
-
458
- if (
459
- !inCollection(
460
- [logShowMode.unknown, logShowMode.text, logShowMode.object],
461
- showModeModified,
462
- )
463
- ) {
464
- throw new Error(`无效的日志显示模式:${showModeModified}`);
465
- }
466
-
467
- if (showModeModified === logShowMode.unknown) {
468
- if (isString(record)) {
469
- showModeModified = logShowMode.text;
470
- } else {
471
- showModeModified = logShowMode.object;
472
- }
473
- }
474
-
475
- if (logShowInConsole() && level === logLevel.debug) {
476
- if (showModeModified === logShowMode.text) {
477
- const data = { level, record };
478
-
479
- // eslint-disable-next-line no-console
480
- console.log(JSON.stringify(data));
481
- }
482
-
483
- if (showModeModified === logShowMode.object) {
484
- // eslint-disable-next-line no-console
485
- console.log({ level, record });
486
- }
487
- }
488
-
489
- if (level === logLevel.error) {
490
- if (showModeModified === logShowMode.text) {
491
- const data = { level, record };
492
-
493
- // eslint-disable-next-line no-console
494
- console.log(JSON.stringify(data));
495
- }
496
-
497
- if (showModeModified === logShowMode.object) {
498
- // eslint-disable-next-line no-console
499
- console.log({ level, record });
500
- }
501
- }
502
- }
503
-
504
- /**
505
- * 记录错误信息
506
- */
507
- export function recordError(record) {
508
- if (isString(record)) {
509
- recordText(record, logLevel.error);
510
- } else {
511
- recordObject(record, logLevel.error);
512
- }
513
- }
514
-
515
- /**
516
- * 记录日志
517
- *
518
- * @export
519
- * @param {*} str
520
- * @returns
521
- */
522
- export function recordText(record, level = logLevel.debug) {
523
- recordLog(record, logShowMode.text, level);
524
- }
525
-
526
- /**
527
- * 记录日志
528
- *
529
- * @export
530
- * @param {*} str
531
- * @returns
532
- */
533
- export function recordObject(record, level = logLevel.debug) {
534
- recordLog(record, logShowMode.object, level);
535
- }
536
-
537
- function logShowInConsole() {
538
- const appInit = getAppInitConfigData();
539
- const result = !!(appInit.showLogInConsole || false);
540
-
541
- return result;
542
- }
543
-
544
- /**
545
- * 获取Guid
546
- *
547
- * @export
548
- * @param {*} v
549
- * @returns
550
- */
551
- export function getGuid() {
552
- return uuidv4();
553
- }
554
-
555
- /**
556
- * 检测目标是否在数组址之中
557
- */
558
- export function inCollection(collection, value) {
559
- let result = false;
560
-
561
- if (!isArray(collection)) {
562
- return result;
563
- }
564
-
565
- collection.some((o) => {
566
- if (o === value) {
567
- result = true;
568
-
569
- return true;
570
- }
571
-
572
- return false;
573
- });
574
-
575
- return result;
576
- }
577
-
578
- /**
579
- * 格式化时间
580
- *
581
- * @export
582
- * @param {*} v
583
- * @returns
584
- */
585
- export function isInvalid(v) {
586
- return typeof v === 'undefined';
587
- }
588
-
589
- export function toDatetime(v) {
590
- if ((v || null) == null) {
591
- return null;
592
- }
593
-
594
- if (isDate(v)) {
595
- return v;
596
- }
597
-
598
- if (isString(v)) {
599
- const i = v.indexOf('T');
600
-
601
- if (i < 0) {
602
- // eslint-disable-next-line no-useless-escape
603
- const value = v.replace(/\-/g, '/');
604
- const result = new Date(value);
605
-
606
- return result;
607
- }
608
- }
609
-
610
- return new Date(v);
611
- }
612
-
613
- /**
614
- * 格式化时间
615
- *
616
- * @export
617
- * @param {*} v
618
- * @returns
619
- */
620
- export function formatDatetime(
621
- v,
622
- formatString = datetimeFormat.yearMonthDayHourMinuteSecond,
623
- defaultValue = '',
624
- ) {
625
- if ((v || '') === '') {
626
- return defaultValue;
627
- }
628
-
629
- const m = moment(typeof v === 'object' ? v : new Date(v.replace('/', '-')));
630
-
631
- if (m.isSame(emptyDatetime)) {
632
- return defaultValue;
633
- }
634
-
635
- return m.format(formatString);
636
- }
637
-
638
- export function numeralFormat(v, formatString) {
639
- return numeral(v).format(formatString);
640
- }
641
-
642
- /**
643
- * 转化为Moment时间
644
- *
645
- * @export
646
- * @param {*} v
647
- * @returns
648
- */
649
- export function stringToMoment(v) {
650
- if (moment.isMoment(v)) return v;
651
-
652
- const d = (v || '').toString();
653
-
654
- if (stringIsNullOrWhiteSpace(d)) {
655
- return null;
656
- }
657
-
658
- return moment(new Date(d.replace('/', '-')));
659
- }
660
-
661
- /**
662
- * 当前Moment时间
663
- *
664
- * @export
665
- * @param {*} v
666
- * @returns
667
- */
668
- export function getMomentNow() {
669
- return moment();
670
- }
671
-
672
- /**
673
- * 转化为Moment时间
674
- *
675
- * @export
676
- * @param {*} v
677
- * @returns
678
- */
679
- export function dateToMoment(v) {
680
- const m = moment(v);
681
-
682
- if (m.isSame(emptyDatetime)) {
683
- return null;
684
- }
685
-
686
- return m;
687
- }
688
-
689
- /**
690
- * 判断是否是时间字符串
691
- *
692
- * @export
693
- * @param {*} v
694
- * @returns
695
- */
696
- export function isDatetime(v) {
697
- const date = `${typeof v === 'undefined' ? null : v}`;
698
- const result = date.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
699
-
700
- if (result == null) {
701
- return false;
702
- }
703
-
704
- const d = new Date(result[1], result[3] - 1, result[4]);
705
- return (
706
- d.getFullYear() === parseInt(result[1], 10) &&
707
- d.getMonth() + 1 === parseInt(result[3], 10) &&
708
- d.getDate() === parseInt(result[4], 10)
709
- );
710
- }
711
-
712
- /**
713
- * 判断是否是数字字符串
714
- *
715
- * @export
716
- * @param {*} str
717
- * @returns
718
- */
719
- export function isNumber(v) {
720
- const str = `${typeof v === 'undefined' ? null : v}`;
721
-
722
- if (str === '') {
723
- return false;
724
- }
725
-
726
- const regular = /^[0-9]*$/;
727
- const re = new RegExp(regular);
728
- return re.test(str);
729
- }
730
-
731
- /**
732
- * 转换为数字
733
- *
734
- * @export
735
- * @param {*} str
736
- * @returns
737
- */
738
- export function toNumber(v) {
739
- const value = toNumberLodash(v);
740
-
741
- return Number.isNaN(value) ? 0 : value;
742
- }
743
-
744
- /**
745
- * 转换为数字
746
- *
747
- * @export
748
- * @param {*} str
749
- * @returns
750
- */
751
- export function split(source, separator, limit = 1000) {
752
- return splitLodash(source, separator, limit);
753
- }
754
-
755
- /**
756
- * 转换为文本
757
- *
758
- * @export
759
- * @param {*} str
760
- * @returns
761
- */
762
- export function toString(value) {
763
- return toStringLodash(value);
764
- }
765
-
766
- /**
767
- *
768
- *@param val 值 len保留小数位数
769
- *
770
- */
771
- export function roundToTarget(v, len) {
772
- const temp = 10 ** len;
773
-
774
- return Math.round(v * temp) / temp;
775
- }
776
-
777
- /**
778
- * 判断是否是数字字符串
779
- *
780
- * @export
781
- * @param {*} str
782
- * @returns
783
- */
784
- export function isMoney(v) {
785
- const str = `${typeof v === 'undefined' ? null : v}`;
786
-
787
- if (str === '') {
788
- return false;
789
- }
790
-
791
- const regular = /^([1-9][\d]{0,15}|0)(\.[\d]{1,2})?$/;
792
- const re = new RegExp(regular);
793
- return re.test(str);
794
- }
795
-
796
- /**
797
- * 转换为数字
798
- *
799
- * @export
800
- * @param {*} str
801
- * @returns
802
- */
803
- export function toMoney(v) {
804
- if (isMoney(v)) {
805
- return parseFloat(v, 10);
806
- }
807
-
808
- return 0;
809
- }
810
-
811
- /**
812
- * 通过 key 获取对应得值
813
- */
814
- export function getValueByKey({
815
- data,
816
- key,
817
- defaultValue = null,
818
- convert = null,
819
- convertBuilder = null,
820
- format = null,
821
- formatBuilder = null,
822
- }) {
823
- const v = getPathValue(data, key, defaultValue);
824
-
825
- let result = v;
826
-
827
- if (isFunction(convertBuilder)) {
828
- result = convertBuilder(v);
829
- } else if ((convert || null) != null) {
830
- switch (convert) {
831
- case convertCollection.number:
832
- result = toNumber(v);
833
- break;
834
-
835
- case convertCollection.datetime:
836
- result = toDatetime(v);
837
- break;
838
-
839
- case convertCollection.string:
840
- result = toString(v);
841
- break;
842
-
843
- case convertCollection.moment:
844
- result = stringToMoment(toString(v));
845
- break;
846
-
847
- case convertCollection.money:
848
- result = toMoney(v);
849
- break;
850
-
851
- default:
852
- result = v;
853
- break;
854
- }
855
- }
856
-
857
- if (isFunction(formatBuilder)) {
858
- result = formatBuilder(v);
859
- } else if ((format || null) != null) {
860
- switch (format) {
861
- case formatCollection.money:
862
- result = formatMoney(v);
863
- break;
864
-
865
- case formatCollection.datetime:
866
- result = formatDatetime(v);
867
- break;
868
-
869
- case formatCollection.chineseMoney:
870
- result = formatMoneyToChinese(v);
871
- break;
872
-
873
- default:
874
- result = v;
875
- break;
876
- }
877
- }
878
-
879
- return result;
880
- }
881
-
882
- /**
883
- * 通过 path 获取对应得值
884
- */
885
- export function getPathValue(o, path, defaultValue = null) {
886
- if (isUndefined(o)) {
887
- return null || defaultValue;
888
- }
889
-
890
- if (o == null) {
891
- return null || defaultValue;
892
- }
893
-
894
- if (!isString(path)) {
895
- const text = 'getPathValue Function param path must be string';
896
-
897
- showRuntimeError({
898
- message: text,
899
- });
900
-
901
- return null;
902
- }
903
-
904
- const v = getLodash(o, path, defaultValue);
905
-
906
- if (isUndefined(defaultValue) || isNull(defaultValue)) {
907
- return v;
908
- }
909
-
910
- return v || defaultValue;
911
- }
912
-
913
- /**
914
- * 格式化货币
915
- *
916
- * @export
917
- * @param {*} str
918
- * @returns
919
- */
920
- export function formatDecimal(
921
- numberSource,
922
- placesSource = 2,
923
- thousandSource = ',',
924
- decimalSource = '.',
925
- ) {
926
- return formatMoney(
927
- numberSource,
928
- placesSource,
929
- '',
930
- thousandSource,
931
- decimalSource,
932
- );
933
- }
934
-
935
- /**
936
- * 格式化货币
937
- *
938
- * @export
939
- * @param {*} str
940
- * @returns
941
- */
942
- export function formatMoney(
943
- numberSource,
944
- symbolSource = '¥',
945
- format = '0,0.00',
946
- ) {
947
- return `${symbolSource}${numeral(numberSource).format(format)}`;
948
- }
949
-
950
- export function toPercentage(val, format = '0,0.00') {
951
- numeral(val);
952
- return `${numeral(toNumber(val * 1000) / 10).format(format)}%`;
953
- }
954
-
955
- /**
956
- * 转换金额为人民币大写
957
- *
958
- * @export
959
- * @param {*} v
960
- * @returns
961
- */
962
- export function formatMoneyToChinese(v) {
963
- let money = v;
964
-
965
- const cnNumber = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; // 汉字的数字
966
- const cnIntBasic = ['', '拾', '佰', '仟']; // 基本单位
967
- const cnIntUnits = ['', '万', '亿', '兆']; // 对应整数部分扩展单位
968
- const cnDecUnits = ['角', '分', '毫', '厘']; // 对应小数部分单位
969
- // var cnInteger = "整"; // 整数金额时后面跟的字符
970
- const cnIntLast = '元'; // 整型完以后的单位
971
- const maxNum = 999999999999999.9999; // 最大处理的数字
972
-
973
- let IntegerNum; // 金额整数部分
974
- let DecimalNum; // 金额小数部分
975
- let ChineseString = ''; // 输出的中文金额字符串
976
- let parts; // 分离金额后用的数组,预定义
977
- if (money === '') {
978
- return '';
979
- }
980
- money = parseFloat(money);
981
- if (money >= maxNum) {
982
- return '超出最大处理数字';
983
- }
984
- if (money === 0) {
985
- ChineseString = cnNumber[0] + cnIntLast;
986
-
987
- return ChineseString;
988
- }
989
- money = money.toString(); // 转换为字符串
990
- if (money.indexOf('.') === -1) {
991
- IntegerNum = money;
992
- DecimalNum = '';
993
- } else {
994
- parts = money.split('.');
995
-
996
- [IntegerNum, DecimalNum] = parts;
997
- DecimalNum = parts[1].substr(0, 4);
998
- }
999
- if (parseInt(IntegerNum, 10) > 0) {
1000
- // 获取整型部分转换
1001
- let zeroCount = 0;
1002
- const IntLen = IntegerNum.length;
1003
- for (let i = 0; i < IntLen; i += 1) {
1004
- const n = IntegerNum.substr(i, 1);
1005
- const p = IntLen - i - 1;
1006
- const q = p / 4;
1007
- const m = p % 4;
1008
- if (n === '0') {
1009
- zeroCount += 1;
1010
- } else {
1011
- if (zeroCount > 0) {
1012
- ChineseString += cnNumber[0];
1013
- }
1014
- zeroCount = 0; // 归零
1015
- ChineseString += cnNumber[parseInt(n, 10)] + cnIntBasic[m];
1016
- }
1017
- if (m === 0 && zeroCount < 4) {
1018
- ChineseString += cnIntUnits[q];
1019
- }
1020
- }
1021
- ChineseString += cnIntLast;
1022
- // 整型部分处理完毕
1023
- }
1024
- if (DecimalNum !== '') {
1025
- // 小数部分
1026
- const decLen = DecimalNum.length;
1027
- for (let i = 0; i < decLen; i += 1) {
1028
- const n = DecimalNum.substr(i, 1);
1029
- if (n !== '0') {
1030
- ChineseString += cnNumber[Number(n)] + cnDecUnits[i];
1031
- }
1032
- }
1033
- }
1034
- if (ChineseString === '') {
1035
- ChineseString += cnNumber[0] + cnIntLast;
1036
- }
1037
-
1038
- return ChineseString;
1039
- }
1040
-
1041
- function seededRandom(seed, min, max) {
1042
- const maxValue = max || 1;
1043
- const minValue = min || 0;
1044
- const seedValue = (seed * 9301 + 49297) % 233280;
1045
- const rnd = seedValue / 233280.0;
1046
- return minValue + rnd * (maxValue - minValue);
1047
- }
1048
-
1049
- /**
1050
- * 通过种子返回随机颜色值
1051
- *
1052
- * @export
1053
- * @param {*} seed
1054
- * @returns
1055
- */
1056
- export function getRandomColor(seed) {
1057
- // eslint-disable-next-line
1058
- return `#${`00000${((seededRandom(seed) * 0x1000000) << 0).toString(
1059
- 16,
1060
- )}`.substr(-6)}`;
1061
- }
1062
-
1063
- function getBrowserInfoCore() {
1064
- const getBrowserVersion = () => {
1065
- const u = navigator.userAgent;
1066
- return {
1067
- // 移动终端浏览器版本信息
1068
- trident: u.indexOf('Trident') > -1, // IE内核
1069
- presto: u.indexOf('Presto') > -1, // opera内核
1070
- webKit: u.indexOf('AppleWebKit') > -1, // 苹果、谷歌内核
1071
- gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') === -1, // 火狐内核
1072
- mobile: !!u.match(/AppleWebKit.*Mobile.*/), // 是否为移动终端
1073
- ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), // ios终端
1074
- android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, // android 终端或uc浏览器
1075
- iPhone: u.indexOf('iPhone') > -1, // 是否为 iPhone 或者 QQHD 浏览器
1076
- iPad: u.indexOf('iPad') > -1, // 是否iPad
1077
- webApp: u.indexOf('Safari') === -1, // 是否web应该程序,没有头部与底部
1078
- };
1079
- };
1080
-
1081
- return {
1082
- versions: getBrowserVersion(),
1083
- language: (navigator.browserLanguage || navigator.language).toLowerCase(),
1084
- };
1085
- }
1086
-
1087
- /**
1088
- * 获取浏览器信息
1089
- *
1090
- * @export
1091
- * @returns
1092
- */
1093
- export function getBrowserInfo() {
1094
- return getBrowserInfoCore();
1095
- }
1096
-
1097
- /**
1098
- * 封装表单项配置
1099
- *
1100
- * @export
1101
- * @param {*} v
1102
- * @param {*} justice
1103
- * @param {*} defaultValue
1104
- * @param {*} originalOption
1105
- * @param {*} convertCallback
1106
- */
1107
- export function refitFieldDecoratorOption(
1108
- v,
1109
- justice,
1110
- defaultValue,
1111
- originalOption,
1112
- convertCallback,
1113
- ) {
1114
- const result = originalOption;
1115
- const justiceV = typeof justice !== 'undefined' && justice !== null;
1116
- const defaultV = typeof defaultValue === 'undefined' ? null : defaultValue;
1117
-
1118
- if (justiceV) {
1119
- if (typeof convertValue === 'function') {
1120
- result.initialValue = convertCallback(v) || defaultV;
1121
- } else {
1122
- result.initialValue = v || defaultV;
1123
- }
1124
- }
1125
-
1126
- return result;
1127
- }
1128
-
1129
- /**
1130
- * 封装公共数据
1131
- *
1132
- * @export 数据集合
1133
- * @param {*} listData 源数据集合
1134
- * @param {*} empty 要添加的首个数据
1135
- * @param {*} otherListData 要添加的其他数据集合
1136
- * @returns 封装后的数据集合
1137
- */
1138
- export function refitCommonData(listData, empty, otherListData) {
1139
- let result = [];
1140
-
1141
- if (typeof listData !== 'undefined') {
1142
- if (listData !== null) {
1143
- result = [...listData];
1144
- }
1145
- }
1146
-
1147
- if (typeof otherListData !== 'undefined') {
1148
- if (otherListData !== null) {
1149
- result = [...result, ...otherListData];
1150
- }
1151
- }
1152
-
1153
- if (typeof empty !== 'undefined') {
1154
- if (empty !== null) {
1155
- result = [empty, ...result];
1156
- }
1157
- }
1158
-
1159
- return result;
1160
- }
1161
-
1162
- /**
1163
- * 计算表达式的值
1164
- *
1165
- * @export
1166
- * @param {*} fn
1167
- * @returns
1168
- */
1169
- export function evil(fn) {
1170
- // 一个变量指向Function,防止有些前端编译工具报错
1171
- const Fn = Function;
1172
- return new Fn(`return ${fn}`)();
1173
- }
1174
-
1175
- /**
1176
- * 搜索集合中的匹配项
1177
- *
1178
- * @export
1179
- * @param {*} itemKey
1180
- * @param {*} itemValue
1181
- * @param {*} sourceData
1182
- * @returns
1183
- */
1184
- export function searchFromList(itemKey, itemValue, sourceData) {
1185
- const d = sourceData || [];
1186
- let result = null;
1187
-
1188
- if (itemValue == null) {
1189
- return result;
1190
- }
1191
-
1192
- d.forEach((o) => {
1193
- if (o[itemKey] === itemValue) {
1194
- result = o;
1195
- }
1196
- });
1197
-
1198
- return result;
1199
- }
1200
-
1201
- /**
1202
- * 构建描述文本
1203
- * @param {*} v
1204
- * @param {*} op
1205
- * @param {*} other
1206
- */
1207
- export function buildFieldDescription(v, op, other) {
1208
- const o = (other || '') === '' ? '' : `,${other}`;
1209
- return `请${op || '输入'}${v}${o}`;
1210
- }
1211
-
1212
- /**
1213
- * 获取SessionStorage数据
1214
- * @export
1215
- * @param {*} key
1216
- * @param {*} value
1217
- */
1218
- export function getStringFromSessionStorage(key) {
1219
- const storage = window.sessionStorage;
1220
- const value = storage.getItem(key);
1221
-
1222
- if (process.env.NODE_ENV === 'development') {
1223
- return value;
1224
- }
1225
-
1226
- const decode = decodeBase64(value);
1227
- const v = encodeBase64(decode);
1228
-
1229
- if (value !== v) {
1230
- return null;
1231
- }
1232
-
1233
- return decode;
1234
- }
1235
-
1236
- /**
1237
- * 获取LocalStorage数据
1238
- * @export
1239
- * @param {*} key
1240
- * @param {*} value
1241
- */
1242
- export function getStringFromLocalStorage(key) {
1243
- const storage = window.localStorage;
1244
- const value = storage.getItem(key);
1245
-
1246
- if (process.env.NODE_ENV === 'development') {
1247
- return value;
1248
- }
1249
-
1250
- const decode = decodeBase64(value);
1251
- const v = encodeBase64(decode);
1252
-
1253
- if (value !== v) {
1254
- return null;
1255
- }
1256
-
1257
- return decode;
1258
- }
1259
-
1260
- /**
1261
- * 获取SessionStorage数据
1262
- * @export
1263
- * @param {*} key
1264
- * @param {*} value
1265
- */
1266
- export function getJsonFromSessionStorage(key) {
1267
- const jsonString = getStringFromSessionStorage(key);
1268
-
1269
- if (jsonString) {
1270
- return JSON.parse(jsonString || '{}');
1271
- }
1272
-
1273
- return null;
1274
- }
1275
-
1276
- /**
1277
- * 获取LocalStorage数据
1278
- * @export
1279
- * @param {*} key
1280
- * @param {*} value
1281
- */
1282
- export function getJsonFromLocalStorage(key) {
1283
- const jsonString = getStringFromLocalStorage(key);
1284
-
1285
- if (jsonString) {
1286
- return JSON.parse(jsonString || '{}');
1287
- }
1288
-
1289
- return null;
1290
- }
1291
-
1292
- /**
1293
- * 存储SessionStorage数据
1294
- * @export
1295
- * @param {*} key
1296
- * @param {*} value
1297
- */
1298
- export function saveStringToSessionStorage(key, value) {
1299
- const storage = window.sessionStorage;
1300
-
1301
- if (process.env.NODE_ENV === 'development') {
1302
- storage.setItem(key, value);
1303
- } else {
1304
- storage.setItem(key, encodeBase64(value));
1305
- }
1306
- }
1307
-
1308
- /**
1309
- * 存储本地数据
1310
- * @export
1311
- * @param {*} key
1312
- * @param {*} value
1313
- */
1314
- export function saveStringToLocalStorage(key, value) {
1315
- const storage = window.localStorage;
1316
-
1317
- if (process.env.NODE_ENV === 'development') {
1318
- storage.setItem(key, value);
1319
- } else {
1320
- storage.setItem(key, encodeBase64(value));
1321
- }
1322
- }
1323
-
1324
- /**
1325
- * 存储SessionStorage数据
1326
- * @export
1327
- * @param {*} key
1328
- * @param {*} value
1329
- */
1330
- export function saveJsonToSessionStorage(key, json) {
1331
- saveStringToSessionStorage(key, JSON.stringify(json || {}));
1332
- }
1333
-
1334
- /**
1335
- * 存储本地数据
1336
- * @export
1337
- * @param {*} key
1338
- * @param {*} value
1339
- */
1340
- export function saveJsonToLocalStorage(key, json) {
1341
- saveStringToLocalStorage(key, JSON.stringify(json || {}));
1342
- }
1343
-
1344
- /**
1345
- * 移除SessionStorage数据
1346
- * @export
1347
- * @param {*} key
1348
- */
1349
- export function removeSessionStorage(key) {
1350
- const storage = window.sessionStorage;
1351
- storage.removeItem(key);
1352
- }
1353
-
1354
- /**
1355
- * 移除LocalStorage数据
1356
- * @export
1357
- * @param {*} key
1358
- */
1359
- export function removeLocalStorage(key) {
1360
- const storage = window.localStorage;
1361
- storage.removeItem(key);
1362
- }
1363
-
1364
- /**
1365
- * 清空SessionStorage数据
1366
- * @export
1367
- * @param {*} key
1368
- */
1369
- export function clearSessionStorage() {
1370
- const storage = window.sessionStorage;
1371
- storage.clear();
1372
- }
1373
-
1374
- /**
1375
- * 清空LocalStorage数据
1376
- * @export
1377
- * @param {*} key
1378
- */
1379
- export function clearLocalStorage() {
1380
- const storage = window.localStorage;
1381
- storage.clear();
1382
- }
1383
-
1384
- /**
1385
- * 获取工作队列
1386
- * @export
1387
- */
1388
- export function getQueue() {
1389
- if (typeof window.queue === 'undefined') {
1390
- window.queueCustom = queue({ concurrency: 3 });
1391
- window.queueCustom.start();
1392
- }
1393
-
1394
- return window.queueCustom;
1395
- }
1396
-
1397
- /**
1398
- * Reacts生命周期getDerivedStateFromProps 辅助函数用于将url参数解析到返回值中用于设定state,
1399
- * @export
1400
- */
1401
- export function getDerivedStateFromPropsForUrlParamsCore(nextProps) {
1402
- const { match } = nextProps;
1403
-
1404
- if ((match || null) != null) {
1405
- const { params } = match;
1406
-
1407
- if ((params || null) != null) {
1408
- return { urlParams: params };
1409
- }
1410
- }
1411
-
1412
- return null;
1413
- }
1414
-
1415
- /**
1416
- * Reacts生命周期getDerivedStateFromProps 辅助函数用于将url参数解析到返回值中用于设定state,如果值重复,则返回null,
1417
- * @export
1418
- */
1419
- export function getDerivedStateFromPropsForUrlParams(
1420
- nextProps,
1421
- prevState,
1422
- defaultUrlParams = { id: '' },
1423
- parseUrlParamsForSetState = null,
1424
- ) {
1425
- let stateUrlParams = getDerivedStateFromPropsForUrlParamsCore(
1426
- nextProps,
1427
- prevState,
1428
- );
1429
-
1430
- stateUrlParams = stateUrlParams || { urlParams: defaultUrlParams };
1431
-
1432
- const { urlParams: urlParamsPrev } = prevState;
1433
-
1434
- const { urlParams } = stateUrlParams;
1435
-
1436
- if (
1437
- isEqualBySerialize(
1438
- { ...(urlParamsPrev || {}), ...{} },
1439
- { ...(urlParams || {}), ...{} },
1440
- )
1441
- ) {
1442
- return prevState;
1443
- }
1444
-
1445
- if (isFunction(parseUrlParamsForSetState)) {
1446
- const data = parseUrlParamsForSetState(stateUrlParams);
1447
-
1448
- return { ...prevState, ...stateUrlParams, ...data };
1449
- }
1450
-
1451
- return { ...prevState, ...stateUrlParams };
1452
- }
1453
-
1454
- export function arrayMove(array, from, to) {
1455
- return arrayMoveImmutable(array, from, to);
1456
- }
1457
-
1458
- export function arrayMoveMutate(array, from, to) {
1459
- return arrayMoveMutable(array, from, to);
1460
- }
1461
-
1462
- /**
1463
- * 获取本地数据
1464
- * @export
1465
- * @param {value} 对比源
1466
- * @param {other} 对比对象
1467
- * 执行深比较来确定两者的值是否相等。
1468
- * 这个方法支持比较 arrays, array buffers, booleans, date objects, error objects, maps, numbers, Object objects, regexes, sets, strings, symbols, 以及 typed arrays. Object 对象值比较自身的属性,不包括继承的和可枚举的属性。 不支持函数和DOM节点比较。
1469
- */
1470
- export function isEqual(value, other) {
1471
- return isEqualLodash(value, other);
1472
- }
1473
-
1474
- export function isEqualBySerialize(value, other) {
1475
- const d1 = JSON.stringify(value || {});
1476
- const d2 = JSON.stringify(other || {});
1477
-
1478
- return d1 === d2;
1479
- }
1480
-
1481
- export function cloneWithoutMethod(value) {
1482
- if (value == null) {
1483
- return null;
1484
- }
1485
-
1486
- return JSON.parse(JSON.stringify(value));
1487
- }
1488
-
1489
- export function isFunction(value) {
1490
- return isFunctionLodash(value);
1491
- }
1492
-
1493
- export function isArray(value) {
1494
- return isArrayLodash(value);
1495
- }
1496
-
1497
- export function isObject(o) {
1498
- return isObjectLodash(o);
1499
- }
1500
-
1501
- export function difference(array, values) {
1502
- return differenceLodash(array, values);
1503
- }
1504
-
1505
- /**
1506
- * 筛选需要的集合
1507
- * @param {collection} 可筛选的对象,例如数组
1508
- * @param {predicateFunction} 每次迭代调用的筛选函数
1509
- */
1510
- export function filter(collection, predicateFunction) {
1511
- return filterLodash(collection, predicateFunction);
1512
- }
1513
-
1514
- /**
1515
- * 创建一个元素数组。 以 iteratee 处理的结果升序排序。 这个方法执行稳定排序,也就是说相同元素会保持原始排序。 iteratees 调用1个参数: (value)。
1516
- * @param {collection} (Array|Object), 用来迭代的集合。
1517
- * @param {predicateFunction} 这个函数决定排序
1518
- */
1519
- export function sortBy(collection, predicateFunction) {
1520
- return sortByLodash(collection, predicateFunction);
1521
- }
1522
-
1523
- /**
1524
- * 该方法返回第一个通过 predicateFunction 判断为真值的元素的索引值(index),而不是元素本身。
1525
- * @param {array} (Array): 要搜索的数组。
1526
- * @param {predicateFunction} 这个函数会在每一次迭代调用
1527
- * @param {fromIndex} (number): The index to search from.
1528
- */
1529
- export function findIndex(array, predicateFunction, fromIndex = 0) {
1530
- return findIndexLodash(array, predicateFunction, fromIndex);
1531
- }
1532
-
1533
- /**
1534
- * 该方法返回第一个通过 predicateFunction 判断为真值的元素的索引值(index),而不是元素本身,返回匹配元素,否则返回 undefined。。
1535
- * @param {array} (Array): 要搜索的数组。
1536
- * @param {predicateFunction} 这个函数会在每一次迭代调用
1537
- * @param {fromIndex} (number): The index to search from.
1538
- */
1539
- export function find(array, predicateFunction, fromIndex = 0) {
1540
- return findLodash(array, predicateFunction, fromIndex);
1541
- }
1542
-
1543
- export function checkExist(array, predicateFunction, fromIndex = 0) {
1544
- const result = find(array, predicateFunction, fromIndex);
1545
-
1546
- return !isUndefined(result);
1547
- }
1548
-
1549
- export function reverse(array) {
1550
- return reverseLodash(array);
1551
- }
1552
-
1553
- export function trim(source) {
1554
- return trimLodash(source);
1555
- }
1556
-
1557
- export function replace(source, pattern, replacement) {
1558
- return replaceLodash(source, pattern, replacement);
1559
- }
1560
-
1561
- export function isBoolean(value) {
1562
- return isBooleanLodash(value);
1563
- }
1564
-
1565
- /**
1566
- * check value is undefined
1567
- */
1568
- export function isUndefined(value) {
1569
- return isUndefinedLodash(value);
1570
- }
1571
-
1572
- /**
1573
- * check value is null
1574
- */
1575
- export function isNull(value) {
1576
- return isNullLodash(value);
1577
- }
1578
-
1579
- /**
1580
- * check value is date
1581
- */
1582
- export function isDate(value) {
1583
- return isDateLodash(value);
1584
- }
1585
-
1586
- /**
1587
- * check value is string
1588
- */
1589
- export function isString(value) {
1590
- return isStringLodash(value);
1591
- }
1592
-
1593
- /**
1594
- * 移除数组中predicate(断言)返回为真值的所有元素,并返回移除元素组成的数组。predicate(断言) 会传入3个参数: (value, index, array)。
1595
- * @param {*} array
1596
- * @param {*} predicate (Array|Function|Object|string): 每次迭代调用的函数
1597
- */
1598
- export function removeFromArray(array, predicate) {
1599
- return removeLodash(array, predicate);
1600
- }
1601
-
1602
- export function stringIsNullOrWhiteSpace(value) {
1603
- return trim(replace(value || '', ' ', '')) === '';
1604
- }
1605
-
1606
- /**
1607
- * base64解码
1608
- */
1609
- export function decodeBase64(target) {
1610
- let commonContent = (target || '').replace(/\s/g, '+');
1611
- commonContent = Buffer.from(commonContent, 'base64').toString();
1612
- return commonContent;
1613
- }
1614
-
1615
- /**
1616
- * base64编码
1617
- */
1618
- export function encodeBase64(target) {
1619
- const base64Content = Buffer.from(target).toString('base64');
1620
- return base64Content;
1621
- }
1622
-
1623
- export function fixedZero(val) {
1624
- return val * 1 < 10 ? `0${val}` : val;
1625
- }
1626
-
1627
- /**
1628
- * getTimeDistance
1629
- */
1630
- export function getTimeDistance(type) {
1631
- const now = new Date();
1632
- const oneDay = 1000 * 60 * 60 * 24;
1633
-
1634
- if (type === 'today') {
1635
- now.setHours(0);
1636
- now.setMinutes(0);
1637
- now.setSeconds(0);
1638
- return [moment(now), moment(now.getTime() + (oneDay - 1000))];
1639
- }
1640
-
1641
- if (type === 'week') {
1642
- let day = now.getDay();
1643
- now.setHours(0);
1644
- now.setMinutes(0);
1645
- now.setSeconds(0);
1646
-
1647
- if (day === 0) {
1648
- day = 6;
1649
- } else {
1650
- day -= 1;
1651
- }
1652
-
1653
- const beginTime = now.getTime() - day * oneDay;
1654
-
1655
- return [moment(beginTime), moment(beginTime + (7 * oneDay - 1000))];
1656
- }
1657
-
1658
- if (type === 'month') {
1659
- const year = now.getFullYear();
1660
- const month = now.getMonth();
1661
- const nextDate = moment(now).add(1, 'months');
1662
- const nextYear = nextDate.year();
1663
- const nextMonth = nextDate.month();
1664
-
1665
- return [
1666
- moment(`${year}-${fixedZero(month + 1)}-01 00:00:00`),
1667
- moment(
1668
- moment(
1669
- `${nextYear}-${fixedZero(nextMonth + 1)}-01 00:00:00`,
1670
- ).valueOf() - 1000,
1671
- ),
1672
- ];
1673
- }
1674
-
1675
- const year = now.getFullYear();
1676
- return [moment(`${year}-01-01 00:00:00`), moment(`${year}-12-31 23:59:59`)];
1677
- }
1678
-
1679
- /**
1680
- * 构建描述文本
1681
- * @param {*} v
1682
- * @param {*} op
1683
- * @param {*} other
1684
- */
1685
- export function buildFieldHelper(v, prefix = '注:') {
1686
- return `${prefix}${v}。`;
1687
- }
1688
-
1689
- export function checkLocalhost() {
1690
- const hostname = toLower(window.location.hostname);
1691
-
1692
- return hostname === '127.0.0.1' || hostname === 'localhost';
1693
- }
1694
-
1695
- export function getNearestLocalhostNotifyCache() {
1696
- const key = storageKeyCollection.nearestLocalhostNotify;
1697
-
1698
- const d = getJsonFromLocalStorage(key);
1699
-
1700
- if ((d || null) == null) {
1701
- return null;
1702
- }
1703
-
1704
- if ((d.nearestTime || null) == null) {
1705
- return null;
1706
- }
1707
-
1708
- return d || null;
1709
- }
1710
-
1711
- export function setNearestLocalhostNotifyCache() {
1712
- const key = storageKeyCollection.nearestLocalhostNotify;
1713
-
1714
- const now = parseInt(new Date().getTime() / 1000, 10);
1715
-
1716
- const d = {
1717
- nearestTime: now,
1718
- };
1719
-
1720
- return saveJsonToLocalStorage(key, d);
1721
- }
1722
-
1723
- export function removeNearestLocalhostNotifyCache() {
1724
- const key = storageKeyCollection.nearestLocalhostNotify;
1725
- removeLocalStorage(key);
1726
- }
1727
-
1728
- /**
1729
- * 尝试发送最近一次本地调用通知(一般用于开发阶段,提示调用的接口域)
1730
- */
1731
- export function trySendNearestLocalhostNotify({ text }) {
1732
- let needSend = false;
1733
- let nearestTime = 0;
1734
-
1735
- if (checkLocalhost()) {
1736
- const nearestLocalhostNotify = getNearestLocalhostNotifyCache() || null;
1737
-
1738
- if (nearestLocalhostNotify == null) {
1739
- needSend = true;
1740
- } else {
1741
- nearestTime = nearestLocalhostNotify.nearestTime || 0;
1742
- }
1743
-
1744
- const now = parseInt(new Date().getTime() / 1000, 10);
1745
-
1746
- try {
1747
- if (nearestTime + 30 < now) {
1748
- needSend = true;
1749
- }
1750
-
1751
- if (needSend) {
1752
- notification.open({
1753
- placement: 'bottomLeft',
1754
- message: '开发提示',
1755
- description: `当前接口域名:${text}。`,
1756
- });
1757
-
1758
- setNearestLocalhostNotifyCache();
1759
- }
1760
- } catch (error) {
1761
- recordLog(error);
1762
- }
1763
- }
1764
- }
1765
-
1766
- /**
1767
- * 文本缩略
1768
- */
1769
- export function ellipsis(value, length) {
1770
- if (value && value.length > length) {
1771
- return `${toString(value).substr(0, length)}...`;
1772
- }
1773
- return toString(value);
1774
- }
1775
-
1776
- export function notifySuccess(text) {
1777
- const description = text || '数据已经操作成功,请进行后续操作。';
1778
-
1779
- notify({
1780
- type: notificationTypeCollection.success,
1781
- placement: 'bottomRight',
1782
- message: '操作结果',
1783
- description,
1784
- });
1785
- }
1786
-
1787
- /**
1788
- * 发送页面通知
1789
- */
1790
- export function notify({
1791
- type,
1792
- placement: placementValue,
1793
- message: messageValue,
1794
- description: descriptionValue,
1795
- }) {
1796
- const {
1797
- placement,
1798
- message: messageText,
1799
- description,
1800
- } = {
1801
- ...{
1802
- placement: 'bottomRight',
1803
- message: '操作结果',
1804
- description: '操作结果描述',
1805
- },
1806
- ...{
1807
- placement: placementValue,
1808
- message: messageValue,
1809
- description: descriptionValue,
1810
- },
1811
- };
1812
-
1813
- requestAnimationFrame(() => {
1814
- switch (type) {
1815
- case notificationTypeCollection.success:
1816
- notification.success({
1817
- placement,
1818
- message: messageText,
1819
- description,
1820
- });
1821
-
1822
- break;
1823
-
1824
- case notificationTypeCollection.warning:
1825
- notification.warning({
1826
- placement,
1827
- message: messageText,
1828
- description,
1829
- });
1830
-
1831
- break;
1832
-
1833
- case notificationTypeCollection.error:
1834
- notification.error({
1835
- placement,
1836
- message: messageText,
1837
- description,
1838
- });
1839
-
1840
- break;
1841
-
1842
- case notificationTypeCollection.info:
1843
- notification.info({
1844
- placement,
1845
- message: messageText,
1846
- description,
1847
- });
1848
-
1849
- break;
1850
-
1851
- case notificationTypeCollection.warn:
1852
- notification.warn({
1853
- placement,
1854
- message: messageText,
1855
- description,
1856
- });
1857
-
1858
- break;
1859
-
1860
- default:
1861
- notification.open({
1862
- placement,
1863
- message: messageText,
1864
- description,
1865
- });
1866
-
1867
- break;
1868
- }
1869
- });
1870
- }
1871
-
1872
- export function checkFromConfig({ label, name, helper }) {
1873
- let labelText = 'object';
1874
- let nameText = 'object';
1875
- let helperText = 'object';
1876
-
1877
- if (isObject(label)) {
1878
- const text = 'label必须为文本';
1879
-
1880
- showRuntimeError({
1881
- message: text,
1882
- });
1883
-
1884
- recordObject(label);
1885
- } else {
1886
- labelText = label;
1887
- }
1888
-
1889
- if (isObject(name)) {
1890
- const text = 'name必须为文本';
1891
-
1892
- showRuntimeError({
1893
- message: text,
1894
- });
1895
-
1896
- recordObject(name);
1897
- } else {
1898
- nameText = name;
1899
- }
1900
-
1901
- if (isObject(helper)) {
1902
- const text = 'helper必须为文本';
1903
-
1904
- showRuntimeError({
1905
- message: text,
1906
- });
1907
-
1908
- recordObject(helper);
1909
- } else {
1910
- helperText = helper;
1911
- }
1912
-
1913
- return {
1914
- label: labelText,
1915
- name: nameText,
1916
- helper: helperText,
1917
- };
1918
- }
1919
-
1920
- const requestAnimFrameCustom = (() => {
1921
- if (isBrowser()) {
1922
- return (
1923
- window.requestAnimationFrame ||
1924
- window.webkitRequestAnimationFrame ||
1925
- window.mozRequestAnimationFrame ||
1926
- window.oRequestAnimationFrame ||
1927
- window.msRequestAnimationFrame ||
1928
- ((a) => {
1929
- window.setTimeout(a, 1e3 / 60);
1930
- })
1931
- );
1932
- }
1933
-
1934
- return () => {};
1935
- })();
1936
-
1937
- export const requestAnimFrame = requestAnimFrameCustom;
1938
-
1939
- /**
1940
- * 占位函数
1941
- *
1942
- * @export
1943
- * @returns
1944
- */
1945
- export function emptyExport() {
1946
- return {};
1947
- }