@cloudbase/weda-ui 3.1.9 → 3.2.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 (422) hide show
  1. package/dist/configs/components/chart/bar.json +3 -3
  2. package/dist/configs/components/chart/line.json +3 -3
  3. package/dist/configs/components/chart/pie.json +3 -3
  4. package/dist/configs/components/form/departTreeSelect.json +124 -0
  5. package/dist/configs/components/form/userTreeSelect.json +128 -0
  6. package/dist/configs/components/formdetail.json +105 -0
  7. package/dist/configs/components/listView.json +9 -1
  8. package/dist/configs/components/lottery.json +1 -1
  9. package/dist/configs/components/tabs.json +10 -9
  10. package/dist/configs/components/wxOpenApi/share.json +5 -2
  11. package/dist/configs/index.d.ts +6 -0
  12. package/dist/configs/index.js +6 -0
  13. package/dist/cypress/support/commands.d.ts +1 -0
  14. package/dist/cypress/support/commands.js +40 -0
  15. package/dist/cypress/support/e2e.d.ts +24 -0
  16. package/dist/cypress/support/e2e.js +22 -0
  17. package/dist/src/configs/actions/showModal.json +48 -0
  18. package/dist/src/configs/actions/showToast.json +41 -0
  19. package/dist/src/configs/components/auth.json +16 -0
  20. package/dist/src/configs/components/button.json +239 -0
  21. package/dist/src/configs/components/calendar.json +81 -0
  22. package/dist/src/configs/components/carousel.json +292 -0
  23. package/dist/src/configs/components/chart/bar.json +954 -0
  24. package/dist/src/configs/components/chart/line.json +870 -0
  25. package/dist/src/configs/components/chart/pie.json +677 -0
  26. package/dist/src/configs/components/chart/statisticsCard.json +376 -0
  27. package/dist/src/configs/components/container.json +50 -0
  28. package/dist/src/configs/components/dataView.json +247 -0
  29. package/dist/src/configs/components/drawer.json +115 -0
  30. package/dist/src/configs/components/form/checkbox.json +179 -0
  31. package/dist/src/configs/components/form/departTreeSelect.json +124 -0
  32. package/dist/src/configs/components/form/form.json +73 -0
  33. package/dist/src/configs/components/form/input.json +154 -0
  34. package/dist/src/configs/components/form/location.json +216 -0
  35. package/dist/src/configs/components/form/radio.json +203 -0
  36. package/dist/src/configs/components/form/richText.json +133 -0
  37. package/dist/src/configs/components/form/select.json +449 -0
  38. package/dist/src/configs/components/form/switch.json +58 -0
  39. package/dist/src/configs/components/form/textarea.json +116 -0
  40. package/dist/src/configs/components/form/tips.json +34 -0
  41. package/dist/src/configs/components/form/uploader.json +171 -0
  42. package/dist/src/configs/components/form/uploaderFile.json +158 -0
  43. package/dist/src/configs/components/form/userTreeSelect.json +128 -0
  44. package/dist/src/configs/components/formdetail.json +105 -0
  45. package/dist/src/configs/components/graphicCard.json +413 -0
  46. package/dist/src/configs/components/image.json +187 -0
  47. package/dist/src/configs/components/link.json +79 -0
  48. package/dist/src/configs/components/listView.json +378 -0
  49. package/dist/src/configs/components/lottery.json +163 -0
  50. package/dist/src/configs/components/modal.json +72 -0
  51. package/dist/src/configs/components/navLayout.json +368 -0
  52. package/dist/src/configs/components/navigationBar.json +62 -0
  53. package/dist/src/configs/components/richtextview.json +26 -0
  54. package/dist/src/configs/components/scrollVeiw.json +253 -0
  55. package/dist/src/configs/components/slot.json +17 -0
  56. package/dist/src/configs/components/swiper.json +90 -0
  57. package/dist/src/configs/components/tabs.json +122 -0
  58. package/dist/src/configs/components/text.json +95 -0
  59. package/dist/src/configs/components/wedaVideo.json +89 -0
  60. package/dist/src/configs/components/wxOpenApi/phone.json +127 -0
  61. package/dist/src/configs/components/wxOpenApi/phoneCode.json +109 -0
  62. package/dist/src/configs/components/wxOpenApi/share.json +160 -0
  63. package/dist/src/configs/components/wxOpenApi/userInfo.json +156 -0
  64. package/dist/src/configs/index.d.ts +103 -0
  65. package/dist/src/configs/index.js +111 -0
  66. package/dist/src/docs/common/format.d.ts +13 -0
  67. package/dist/src/docs/common/format.js +122 -0
  68. package/dist/src/docs/common/tableView.d.ts +30 -0
  69. package/dist/src/docs/common/tableView.js +156 -0
  70. package/dist/src/index.d.ts +2 -0
  71. package/dist/src/index.js +3 -0
  72. package/dist/src/setupTests.d.ts +2 -0
  73. package/dist/src/setupTests.js +19 -0
  74. package/dist/src/web/actions/index.d.ts +2 -0
  75. package/dist/src/web/actions/index.js +2 -0
  76. package/dist/src/web/actions/showModal/index.d.ts +4 -0
  77. package/dist/src/web/actions/showModal/index.js +67 -0
  78. package/dist/src/web/actions/showToast/index.d.ts +1 -0
  79. package/dist/src/web/actions/showToast/index.js +3 -0
  80. package/dist/src/web/components/button/index.d.ts +32 -0
  81. package/dist/src/web/components/button/index.js +48 -0
  82. package/dist/src/web/components/calendar/index.d.ts +19 -0
  83. package/dist/src/web/components/calendar/index.js +189 -0
  84. package/dist/src/web/components/calendar/util.d.ts +13 -0
  85. package/dist/src/web/components/calendar/util.js +74 -0
  86. package/dist/src/web/components/carousel/index.d.ts +41 -0
  87. package/dist/src/web/components/carousel/index.js +244 -0
  88. package/dist/src/web/components/chart/bar/index.d.ts +3 -0
  89. package/dist/src/web/components/chart/bar/index.js +41 -0
  90. package/dist/src/web/components/chart/bar/index.old.d.ts +40 -0
  91. package/dist/src/web/components/chart/bar/index.old.js +56 -0
  92. package/dist/src/web/components/chart/common/Chart.d.ts +9 -0
  93. package/dist/src/web/components/chart/common/Chart.js +23 -0
  94. package/dist/src/web/components/chart/common/chart-custom-connector.d.ts +6 -0
  95. package/dist/src/web/components/chart/common/chart-custom-connector.js +35 -0
  96. package/dist/src/web/components/chart/common/chart-error.d.ts +2 -0
  97. package/dist/src/web/components/chart/common/chart-error.js +2 -0
  98. package/dist/src/web/components/chart/common/config/bar.d.ts +48 -0
  99. package/dist/src/web/components/chart/common/config/bar.js +49 -0
  100. package/dist/src/web/components/chart/common/config/global.d.ts +13 -0
  101. package/dist/src/web/components/chart/common/config/global.js +16 -0
  102. package/dist/src/web/components/chart/common/config/line.d.ts +46 -0
  103. package/dist/src/web/components/chart/common/config/line.js +49 -0
  104. package/dist/src/web/components/chart/common/config/pie.d.ts +29 -0
  105. package/dist/src/web/components/chart/common/config/pie.js +36 -0
  106. package/dist/src/web/components/chart/common/core/eChartBar.d.ts +66 -0
  107. package/dist/src/web/components/chart/common/core/eChartBar.js +201 -0
  108. package/dist/src/web/components/chart/common/core/eChartBase.d.ts +127 -0
  109. package/dist/src/web/components/chart/common/core/eChartBase.js +394 -0
  110. package/dist/src/web/components/chart/common/core/eChartLine.d.ts +60 -0
  111. package/dist/src/web/components/chart/common/core/eChartLine.js +173 -0
  112. package/dist/src/web/components/chart/common/core/eChartPie.d.ts +48 -0
  113. package/dist/src/web/components/chart/common/core/eChartPie.js +135 -0
  114. package/dist/src/web/components/chart/common/core/type.d.ts +35 -0
  115. package/dist/src/web/components/chart/common/core/type.js +9 -0
  116. package/dist/src/web/components/chart/common/data-transform.d.ts +6 -0
  117. package/dist/src/web/components/chart/common/data-transform.js +246 -0
  118. package/dist/src/web/components/chart/common/echarts.d.ts +5 -0
  119. package/dist/src/web/components/chart/common/echarts.js +24 -0
  120. package/dist/src/web/components/chart/common/error-boundary.d.ts +5 -0
  121. package/dist/src/web/components/chart/common/error-boundary.js +26 -0
  122. package/dist/src/web/components/chart/common/useChart.d.ts +8 -0
  123. package/dist/src/web/components/chart/common/useChart.js +61 -0
  124. package/dist/src/web/components/chart/line/index.d.ts +3 -0
  125. package/dist/src/web/components/chart/line/index.js +42 -0
  126. package/dist/src/web/components/chart/line/index.old.d.ts +38 -0
  127. package/dist/src/web/components/chart/line/index.old.js +53 -0
  128. package/dist/src/web/components/chart/pie/index.d.ts +3 -0
  129. package/dist/src/web/components/chart/pie/index.js +42 -0
  130. package/dist/src/web/components/chart/pie/index.old.d.ts +27 -0
  131. package/dist/src/web/components/chart/pie/index.old.js +40 -0
  132. package/dist/src/web/components/chart/statisticsCard/index.d.ts +85 -0
  133. package/dist/src/web/components/chart/statisticsCard/index.js +203 -0
  134. package/dist/src/web/components/chart/statisticsCard/interface.d.ts +13 -0
  135. package/dist/src/web/components/chart/statisticsCard/interface.js +1 -0
  136. package/dist/src/web/components/common/portal.d.ts +7 -0
  137. package/dist/src/web/components/common/portal.js +14 -0
  138. package/dist/src/web/components/container/index.d.ts +6 -0
  139. package/dist/src/web/components/container/index.js +6 -0
  140. package/dist/src/web/components/dataView/index.d.ts +6 -0
  141. package/dist/src/web/components/dataView/index.js +8 -0
  142. package/dist/src/web/components/dataView/interface.d.ts +5 -0
  143. package/dist/src/web/components/dataView/interface.js +1 -0
  144. package/dist/src/web/components/drawer/index.d.ts +13 -0
  145. package/dist/src/web/components/drawer/index.js +12 -0
  146. package/dist/src/web/components/form/checkbox/index.d.ts +13 -0
  147. package/dist/src/web/components/form/checkbox/index.js +167 -0
  148. package/dist/src/web/components/form/enumSelect/MultipleSelect.d.ts +78 -0
  149. package/dist/src/web/components/form/enumSelect/MultipleSelect.js +52 -0
  150. package/dist/src/web/components/form/enumSelect/NormalSelect.d.ts +83 -0
  151. package/dist/src/web/components/form/enumSelect/NormalSelect.js +52 -0
  152. package/dist/src/web/components/form/enumSelect/SelectContainer.d.ts +16 -0
  153. package/dist/src/web/components/form/enumSelect/SelectContainer.js +30 -0
  154. package/dist/src/web/components/form/enumSelect/index.d.ts +82 -0
  155. package/dist/src/web/components/form/enumSelect/index.js +6 -0
  156. package/dist/src/web/components/form/enumSelect/props/defaultProps.d.ts +34 -0
  157. package/dist/src/web/components/form/enumSelect/props/defaultProps.js +40 -0
  158. package/dist/src/web/components/form/enumSelect/props/propsTypes.d.ts +39 -0
  159. package/dist/src/web/components/form/enumSelect/props/propsTypes.js +47 -0
  160. package/dist/src/web/components/form/form/index.d.ts +32 -0
  161. package/dist/src/web/components/form/form/index.js +141 -0
  162. package/dist/src/web/components/form/formcell/index.d.ts +8 -0
  163. package/dist/src/web/components/form/formcell/index.js +40 -0
  164. package/dist/src/web/components/form/input/index.d.ts +14 -0
  165. package/dist/src/web/components/form/input/index.js +86 -0
  166. package/dist/src/web/components/form/location/common/mapChoose.d.ts +15 -0
  167. package/dist/src/web/components/form/location/common/mapChoose.js +495 -0
  168. package/dist/src/web/components/form/location/common/mapView.d.ts +19 -0
  169. package/dist/src/web/components/form/location/common/mapView.js +172 -0
  170. package/dist/src/web/components/form/location/common/propsConfig.d.ts +59 -0
  171. package/dist/src/web/components/form/location/common/propsConfig.js +50 -0
  172. package/dist/src/web/components/form/location/common/selectModal.d.ts +21 -0
  173. package/dist/src/web/components/form/location/common/selectModal.js +44 -0
  174. package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +36 -0
  175. package/dist/src/web/components/form/location/common/useLocationInfo.js +104 -0
  176. package/dist/src/web/components/form/location/components/LocationH5/location.h5.d.ts +8 -0
  177. package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +325 -0
  178. package/dist/src/web/components/form/location/components/LocationPC/Header.d.ts +12 -0
  179. package/dist/src/web/components/form/location/components/LocationPC/Header.js +43 -0
  180. package/dist/src/web/components/form/location/components/LocationPC/location.PC.d.ts +8 -0
  181. package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +224 -0
  182. package/dist/src/web/components/form/location/constants.d.ts +2 -0
  183. package/dist/src/web/components/form/location/constants.js +3 -0
  184. package/dist/src/web/components/form/location/index.d.ts +1 -0
  185. package/dist/src/web/components/form/location/index.js +17 -0
  186. package/dist/src/web/components/form/radio/index.d.ts +11 -0
  187. package/dist/src/web/components/form/radio/index.js +115 -0
  188. package/dist/src/web/components/form/renderDecorator.d.ts +6 -0
  189. package/dist/src/web/components/form/renderDecorator.js +20 -0
  190. package/dist/src/web/components/form/select/allTimePicker/calendar.d.ts +13 -0
  191. package/dist/src/web/components/form/select/allTimePicker/calendar.js +104 -0
  192. package/dist/src/web/components/form/select/allTimePicker/dataUtils.d.ts +24 -0
  193. package/dist/src/web/components/form/select/allTimePicker/dataUtils.js +265 -0
  194. package/dist/src/web/components/form/select/allTimePicker/index.d.ts +14 -0
  195. package/dist/src/web/components/form/select/allTimePicker/index.js +943 -0
  196. package/dist/src/web/components/form/select/dropdown-select/ui.d.ts +15 -0
  197. package/dist/src/web/components/form/select/dropdown-select/ui.js +55 -0
  198. package/dist/src/web/components/form/select/h5.d.ts +16 -0
  199. package/dist/src/web/components/form/select/h5.js +452 -0
  200. package/dist/src/web/components/form/select/index.d.ts +66 -0
  201. package/dist/src/web/components/form/select/index.js +241 -0
  202. package/dist/src/web/components/form/select/region/index.d.ts +6 -0
  203. package/dist/src/web/components/form/select/region/index.js +147 -0
  204. package/dist/src/web/components/form/select/time.d.ts +9 -0
  205. package/dist/src/web/components/form/select/time.js +146 -0
  206. package/dist/src/web/components/form/select/use-options.d.ts +26 -0
  207. package/dist/src/web/components/form/select/use-options.js +103 -0
  208. package/dist/src/web/components/form/select/year.d.ts +7 -0
  209. package/dist/src/web/components/form/select/year.js +72 -0
  210. package/dist/src/web/components/form/switch/index.d.ts +6 -0
  211. package/dist/src/web/components/form/switch/index.js +58 -0
  212. package/dist/src/web/components/form/textarea/index.d.ts +12 -0
  213. package/dist/src/web/components/form/textarea/index.js +66 -0
  214. package/dist/src/web/components/form/tips/index.d.ts +8 -0
  215. package/dist/src/web/components/form/tips/index.js +17 -0
  216. package/dist/src/web/components/form/uploader/index.d.ts +3 -0
  217. package/dist/src/web/components/form/uploader/index.js +42 -0
  218. package/dist/src/web/components/form/uploader/uploader.h5.d.ts +20 -0
  219. package/dist/src/web/components/form/uploader/uploader.h5.js +199 -0
  220. package/dist/src/web/components/form/uploader/uploader.pc.d.ts +29 -0
  221. package/dist/src/web/components/form/uploader/uploader.pc.js +208 -0
  222. package/dist/src/web/components/form/uploaderFile/index.d.ts +4 -0
  223. package/dist/src/web/components/form/uploaderFile/index.js +19 -0
  224. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.d.ts +23 -0
  225. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +328 -0
  226. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
  227. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +299 -0
  228. package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +8 -0
  229. package/dist/src/web/components/form/userOrgSelect/comTool.js +107 -0
  230. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +19 -0
  231. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +247 -0
  232. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
  233. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +158 -0
  234. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
  235. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
  236. package/dist/src/web/components/form/userOrgSelect/index.d.ts +2 -0
  237. package/dist/src/web/components/form/userOrgSelect/index.js +17 -0
  238. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +26 -0
  239. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +258 -0
  240. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
  241. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +271 -0
  242. package/dist/src/web/components/form/userOrgSelect/utils.d.ts +35 -0
  243. package/dist/src/web/components/form/userOrgSelect/utils.js +72 -0
  244. package/dist/src/web/components/formdetail/index.d.ts +28 -0
  245. package/dist/src/web/components/formdetail/index.js +170 -0
  246. package/dist/src/web/components/graphicCard/index.d.ts +46 -0
  247. package/dist/src/web/components/graphicCard/index.js +179 -0
  248. package/dist/src/web/components/image/image.d.ts +9 -0
  249. package/dist/src/web/components/image/image.js +119 -0
  250. package/dist/src/web/components/image/index.d.ts +13 -0
  251. package/dist/src/web/components/image/index.js +77 -0
  252. package/dist/src/web/components/index.d.ts +50 -0
  253. package/dist/src/web/components/index.js +99 -0
  254. package/dist/src/web/components/link/index.d.ts +24 -0
  255. package/dist/src/web/components/link/index.js +71 -0
  256. package/dist/src/web/components/listView/index.d.ts +7 -0
  257. package/dist/src/web/components/listView/index.js +296 -0
  258. package/dist/src/web/components/listView/interface.d.ts +127 -0
  259. package/dist/src/web/components/listView/interface.js +1 -0
  260. package/dist/src/web/components/lottery/index.d.ts +22 -0
  261. package/dist/src/web/components/lottery/index.js +391 -0
  262. package/dist/src/web/components/lottery/lotteryUtil.d.ts +23 -0
  263. package/dist/src/web/components/lottery/lotteryUtil.js +181 -0
  264. package/dist/src/web/components/modal/index.d.ts +17 -0
  265. package/dist/src/web/components/modal/index.js +11 -0
  266. package/dist/src/web/components/modal/modal.h5.d.ts +4 -0
  267. package/dist/src/web/components/modal/modal.h5.js +46 -0
  268. package/dist/src/web/components/modal/modal.pc.d.ts +3 -0
  269. package/dist/src/web/components/modal/modal.pc.js +31 -0
  270. package/dist/src/web/components/navLayout/index.d.ts +61 -0
  271. package/dist/src/web/components/navLayout/index.js +127 -0
  272. package/dist/src/web/components/navigationBar/common.d.ts +15 -0
  273. package/dist/src/web/components/navigationBar/common.js +127 -0
  274. package/dist/src/web/components/navigationBar/h5Menu.d.ts +14 -0
  275. package/dist/src/web/components/navigationBar/h5Menu.js +72 -0
  276. package/dist/src/web/components/navigationBar/horizontalMenu.d.ts +12 -0
  277. package/dist/src/web/components/navigationBar/horizontalMenu.js +99 -0
  278. package/dist/src/web/components/navigationBar/index.d.ts +13 -0
  279. package/dist/src/web/components/navigationBar/index.js +157 -0
  280. package/dist/src/web/components/navigationBar/verticalMenu.d.ts +13 -0
  281. package/dist/src/web/components/navigationBar/verticalMenu.js +38 -0
  282. package/dist/src/web/components/phone/index.d.ts +18 -0
  283. package/dist/src/web/components/phone/index.js +4 -0
  284. package/dist/src/web/components/phoneCode/index.d.ts +18 -0
  285. package/dist/src/web/components/phoneCode/index.js +4 -0
  286. package/dist/src/web/components/picker/datePicker.d.ts +10 -0
  287. package/dist/src/web/components/picker/datePicker.js +31 -0
  288. package/dist/src/web/components/picker/picker.d.ts +6 -0
  289. package/dist/src/web/components/picker/picker.js +45 -0
  290. package/dist/src/web/components/picker/timePicker.d.ts +7 -0
  291. package/dist/src/web/components/picker/timePicker.js +42 -0
  292. package/dist/src/web/components/richText/const.d.ts +1 -0
  293. package/dist/src/web/components/richText/const.js +2 -0
  294. package/dist/src/web/components/richText/index.d.ts +50 -0
  295. package/dist/src/web/components/richText/index.js +352 -0
  296. package/dist/src/web/components/richTextView/index.d.ts +7 -0
  297. package/dist/src/web/components/richTextView/index.js +44 -0
  298. package/dist/src/web/components/scrollView/index.d.ts +27 -0
  299. package/dist/src/web/components/scrollView/index.js +95 -0
  300. package/dist/src/web/components/share/index.d.ts +34 -0
  301. package/dist/src/web/components/share/index.js +4 -0
  302. package/dist/src/web/components/slot/index.d.ts +6 -0
  303. package/dist/src/web/components/slot/index.js +9 -0
  304. package/dist/src/web/components/swiper/index.d.ts +24 -0
  305. package/dist/src/web/components/swiper/index.js +153 -0
  306. package/dist/src/web/components/tabs/index.d.ts +13 -0
  307. package/dist/src/web/components/tabs/index.js +15 -0
  308. package/dist/src/web/components/tabs/tabs.h5.d.ts +4 -0
  309. package/dist/src/web/components/tabs/tabs.h5.js +42 -0
  310. package/dist/src/web/components/tabs/tabs.pc.d.ts +3 -0
  311. package/dist/src/web/components/tabs/tabs.pc.js +40 -0
  312. package/dist/src/web/components/text/index.d.ts +14 -0
  313. package/dist/src/web/components/text/index.js +17 -0
  314. package/dist/src/web/components/uploaderFileView/index.d.ts +10 -0
  315. package/dist/src/web/components/uploaderFileView/index.js +46 -0
  316. package/dist/src/web/components/uploaderView/index.d.ts +17 -0
  317. package/dist/src/web/components/uploaderView/index.js +48 -0
  318. package/dist/src/web/components/userInfo/index.d.ts +26 -0
  319. package/dist/src/web/components/userInfo/index.js +4 -0
  320. package/dist/src/web/components/wedaVideo/index.d.ts +17 -0
  321. package/dist/src/web/components/wedaVideo/index.js +144 -0
  322. package/dist/src/web/index.d.ts +8 -0
  323. package/dist/src/web/index.js +4 -0
  324. package/dist/src/web/utils/classnames.d.ts +2 -0
  325. package/dist/src/web/utils/classnames.js +37 -0
  326. package/dist/src/web/utils/constant.d.ts +23 -0
  327. package/dist/src/web/utils/constant.js +24 -0
  328. package/dist/src/web/utils/debounce.d.ts +2 -0
  329. package/dist/src/web/utils/debounce.js +92 -0
  330. package/dist/src/web/utils/getLocalCounter.d.ts +1 -0
  331. package/dist/src/web/utils/getLocalCounter.js +4 -0
  332. package/dist/src/web/utils/getUserService.d.ts +11 -0
  333. package/dist/src/web/utils/getUserService.js +156 -0
  334. package/dist/src/web/utils/isObjectEqual.d.ts +2 -0
  335. package/dist/src/web/utils/isObjectEqual.js +12 -0
  336. package/dist/src/web/utils/loading-fallback.d.ts +2 -0
  337. package/dist/src/web/utils/loading-fallback.js +2 -0
  338. package/dist/src/web/utils/lodash.d.ts +1 -0
  339. package/dist/src/web/utils/lodash.js +2 -0
  340. package/dist/src/web/utils/platform.d.ts +18 -0
  341. package/dist/src/web/utils/platform.js +193 -0
  342. package/dist/src/web/utils/tcb.d.ts +33 -0
  343. package/dist/src/web/utils/tcb.js +118 -0
  344. package/dist/src/web/utils/tmap.d.ts +3 -0
  345. package/dist/src/web/utils/tmap.js +21 -0
  346. package/dist/src/web/utils/use-cloud-id-temp-url.d.ts +1 -0
  347. package/dist/src/web/utils/use-cloud-id-temp-url.js +15 -0
  348. package/dist/src/web/utils/useSetState.d.ts +1 -0
  349. package/dist/src/web/utils/useSetState.js +8 -0
  350. package/dist/src/web/utils/useSyncValue.d.ts +4 -0
  351. package/dist/src/web/utils/useSyncValue.js +15 -0
  352. package/dist/src/web/utils/weui.d.ts +1 -0
  353. package/dist/src/web/utils/weui.js +2 -0
  354. package/dist/web/components/calendar/index.js +10 -2
  355. package/dist/web/components/carousel/index.js +4 -0
  356. package/dist/web/components/chart/common/core/eChartBase.js +8 -2
  357. package/dist/web/components/form/form/index.js +10 -7
  358. package/dist/web/components/form/location/common/mapChoose.js +2 -0
  359. package/dist/web/components/form/location/common/mapView.js +2 -0
  360. package/dist/web/components/form/location/components/LocationH5/location.h5.js +3 -1
  361. package/dist/web/components/form/location/components/LocationH5/location.module.css +3 -0
  362. package/dist/web/components/form/select/allTimePicker/calendar.css +114 -0
  363. package/dist/web/components/form/select/allTimePicker/index.css +136 -0
  364. package/dist/web/components/form/select/h5.js +4 -0
  365. package/dist/web/components/form/select/index.js +2 -8
  366. package/dist/web/components/form/switch/index.js +3 -2
  367. package/dist/web/components/form/switch/switch.module.css +7 -0
  368. package/dist/web/components/form/uploader/uploader.h5.d.ts +1 -0
  369. package/dist/web/components/form/uploader/uploader.h5.js +14 -10
  370. package/dist/web/components/form/uploader/uploader.pc.js +1 -1
  371. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +14 -12
  372. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +8 -8
  373. package/dist/web/components/form/userOrgSelect/comTool.d.ts +7 -0
  374. package/dist/web/components/form/userOrgSelect/comTool.js +89 -0
  375. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +20 -0
  376. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +259 -0
  377. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
  378. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +153 -0
  379. package/dist/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
  380. package/dist/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
  381. package/dist/web/components/form/userOrgSelect/index.d.ts +2 -0
  382. package/dist/web/components/form/userOrgSelect/index.js +17 -0
  383. package/dist/web/components/form/userOrgSelect/userOrgSelect.css +805 -0
  384. package/dist/web/components/form/userOrgSelect/userOrgSelect.less +643 -0
  385. package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +24 -0
  386. package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +276 -0
  387. package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
  388. package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +229 -0
  389. package/dist/web/components/form/userOrgSelect/utils.d.ts +35 -0
  390. package/dist/web/components/form/userOrgSelect/utils.js +72 -0
  391. package/dist/web/components/formdetail/index.css +115 -0
  392. package/dist/web/components/formdetail/index.d.ts +28 -0
  393. package/dist/web/components/formdetail/index.js +170 -0
  394. package/dist/web/components/index.d.ts +3 -0
  395. package/dist/web/components/index.js +3 -0
  396. package/dist/web/components/listView/index.css +35 -5
  397. package/dist/web/components/listView/index.js +92 -68
  398. package/dist/web/components/listView/interface.d.ts +5 -0
  399. package/dist/web/components/lottery/index.js +2 -1
  400. package/dist/web/components/lottery/lotteryUtil.js +1 -0
  401. package/dist/web/components/navigationBar/index.css +21 -29
  402. package/dist/web/components/richText/index.css +1 -0
  403. package/dist/web/components/swiper/index.js +5 -1
  404. package/dist/web/components/wedaVideo/index.js +1 -0
  405. package/dist/web/utils/getUserService.d.ts +17 -0
  406. package/dist/web/utils/getUserService.js +148 -0
  407. package/dist/web/utils/platform.js +2 -0
  408. package/dist/web/weda-ui.css +9 -0
  409. package/package.json +27 -13
  410. package/dist/asset-manifest.json +0 -17
  411. package/dist/index.html +0 -88
  412. package/dist/static/js/bundle.js +0 -963
  413. package/dist/static/js/bundle.js.map +0 -1
  414. package/dist/static/js/main.chunk.js +0 -8841
  415. package/dist/static/js/main.chunk.js.map +0 -1
  416. package/dist/static/js/vendors~main.chunk.js +0 -247885
  417. package/dist/static/js/vendors~main.chunk.js.map +0 -1
  418. package/dist/static/media/ef6fa527e24e354765d806b826b41391.fa67580a.svg +0 -627
  419. package/dist/web/components/auth/index.d.ts +0 -10
  420. package/dist/web/components/auth/index.js +0 -37
  421. package/dist/web/utils/events.d.ts +0 -1
  422. package/dist/web/utils/events.js +0 -2
@@ -0,0 +1,394 @@
1
+ import { callDataSource, callWedaApi } from '../../../../utils/tcb';
2
+ import getConfig from '../config/global';
3
+ export class AbstractEchartBaseModal {
4
+ }
5
+ /**
6
+ * 图表处理基类
7
+ * @author loonglong
8
+ **/
9
+ class EchartBase extends AbstractEchartBaseModal {
10
+ constructor() {
11
+ super();
12
+ // config: ECOption;
13
+ // TODO: type
14
+ Object.defineProperty(this, "config", {
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true,
18
+ value: void 0
19
+ });
20
+ this.config = getConfig();
21
+ }
22
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
23
+ async setOptions(_options) { }
24
+ /** 获取所有配置好的图表数据 */
25
+ getOptions() {
26
+ return this.config;
27
+ }
28
+ /** 生成后台查询条件 */
29
+ createWhere({ filterData, xField, xStatistics, xIsCountEmpty, yField, groupKey = {}, groupKeyTimeSpan = '', }) {
30
+ const objReturnData = {
31
+ value: [],
32
+ where: [],
33
+ dimension: {},
34
+ group: {},
35
+ };
36
+ if (filterData && filterData.length > 0) {
37
+ // 协议转化,把首字母改成大写
38
+ objReturnData.where = filterData.map((val) => {
39
+ let arrLogicData = val.logicData;
40
+ if (val.logicData && val.logicData.length > 0) {
41
+ arrLogicData = val.logicData.map((mval) => {
42
+ var _a, _b, _c;
43
+ return {
44
+ Key: mval.key,
45
+ Rel: mval.rel,
46
+ Value: mval.value,
47
+ Logic: mval.logic,
48
+ Extra: {
49
+ Type: (_a = mval === null || mval === void 0 ? void 0 : mval.extra) === null || _a === void 0 ? void 0 : _a.type,
50
+ Format: (_b = mval === null || mval === void 0 ? void 0 : mval.extra) === null || _b === void 0 ? void 0 : _b.format,
51
+ IsExpression: (_c = mval === null || mval === void 0 ? void 0 : mval.extra) === null || _c === void 0 ? void 0 : _c.isExpression,
52
+ },
53
+ ValueType: mval.valueType,
54
+ Expression: mval.expression,
55
+ };
56
+ });
57
+ }
58
+ return {
59
+ GroupLogic: val.groupLogic,
60
+ LogicData: arrLogicData,
61
+ };
62
+ });
63
+ }
64
+ if (xField && xField.name) {
65
+ objReturnData.dimension = {
66
+ Key: xField.name,
67
+ };
68
+ if (xStatistics) {
69
+ objReturnData.dimension.TimeSpan = xStatistics;
70
+ }
71
+ else {
72
+ objReturnData.dimension.IsCountEmpty = xIsCountEmpty;
73
+ }
74
+ }
75
+ if (yField && yField.numValue && yField.numValue.length > 0) {
76
+ yField.numValue.forEach((itemVal) => {
77
+ objReturnData.value.push({
78
+ Key: itemVal.key,
79
+ OperationType: itemVal.operationType,
80
+ });
81
+ });
82
+ }
83
+ if (yField && groupKey && groupKey.name) {
84
+ objReturnData.group.Key = groupKey.name;
85
+ objReturnData.group.TimeSpan = groupKeyTimeSpan;
86
+ }
87
+ return objReturnData;
88
+ }
89
+ /**
90
+ * 从后台获取统计数据
91
+ *
92
+ **/
93
+ async getSourceData(sourceName = '', methods = '', dataSourceType = '', params) {
94
+ var _a, _b, _c;
95
+ if (dataSourceType === 'database' &&
96
+ (!sourceName ||
97
+ Object.keys((_a = params === null || params === void 0 ? void 0 : params.dimension) !== null && _a !== void 0 ? _a : {}).length <= 0 ||
98
+ ((_b = params.value) !== null && _b !== void 0 ? _b : []).length <= 0)) {
99
+ console.warn('charts 参数不完整');
100
+ return [];
101
+ }
102
+ try {
103
+ if (dataSourceType === 'database') {
104
+ return await callWedaApi({
105
+ action: 'DescribeChartData',
106
+ data: {
107
+ DataSourceName: sourceName,
108
+ Value: params.value,
109
+ Where: params.where,
110
+ Dimension: params.dimension,
111
+ Group: params.group,
112
+ },
113
+ });
114
+ }
115
+ const res = await callDataSource({
116
+ dataSourceName: sourceName,
117
+ methodName: methods,
118
+ params,
119
+ });
120
+ return (_c = res.result) !== null && _c !== void 0 ? _c : [];
121
+ }
122
+ catch (err) {
123
+ return [];
124
+ }
125
+ }
126
+ setTitle({ isTitle, title }) {
127
+ this.config.title;
128
+ this.config.title.show = isTitle;
129
+ this.config.title.text = title;
130
+ this.config.title.top = '-1%';
131
+ this.config.title.left = '35%';
132
+ this.config.title.right = null;
133
+ }
134
+ setLegend({ isLegend, legend = 'top' }) {
135
+ this.config.legend.show = isLegend;
136
+ switch (legend) {
137
+ case 'top':
138
+ this.config.legend.orient = 'horizontal';
139
+ this.config.legend.x = 'center';
140
+ this.config.legend.top = '6%';
141
+ break;
142
+ case 'left':
143
+ this.config.legend.orient = 'vertical';
144
+ this.config.legend.top = '30%';
145
+ this.config.legend.left = '1%';
146
+ break;
147
+ case 'right':
148
+ this.config.legend.orient = 'vertical';
149
+ this.config.legend.top = '30%';
150
+ this.config.legend.right = '6%';
151
+ break;
152
+ default:
153
+ this.config.legend.top = '89%';
154
+ this.config.legend.orient = 'horizontal';
155
+ this.config.legend.x = 'center';
156
+ break;
157
+ }
158
+ }
159
+ /**
160
+ * 设置 X轴数据
161
+ * @param { Array<object> } arrData 后台返回的数据
162
+ * @param { string } formatType 类型 datetime:日期时间;date:日期,time:时间,其它
163
+ */
164
+ setXaxis(sortedXAxisData, formatType) {
165
+ const xAxisData = [];
166
+ if (sortedXAxisData.length > 0) {
167
+ sortedXAxisData.forEach((itemSource) => {
168
+ let value = itemSource.XLabel.Value;
169
+ if (formatType === 'datetime') {
170
+ value = this.formatTime(itemSource.XLabel.Value, 'dt');
171
+ }
172
+ else if (formatType === 'date') {
173
+ value = this.formatTime(itemSource.XLabel.Value, 'd');
174
+ }
175
+ else if (formatType === 'time') {
176
+ value = this.formatTime(itemSource.XLabel.Value, 't');
177
+ }
178
+ xAxisData.push(value);
179
+ });
180
+ this.config.xAxis.data = xAxisData;
181
+ }
182
+ return xAxisData;
183
+ }
184
+ sortXAxisData(arrData, formatType = '') {
185
+ const xFields = [...arrData];
186
+ if (['datetime', 'date', 'time'].includes(formatType)) {
187
+ const monthRegex = /^(\d{4}(?:-\d{2}){0,2}) {0,1}(\d{2})$/;
188
+ const weekRegex = /^(\d{4})W(\d+)$/;
189
+ xFields.sort((a, b) => {
190
+ if (a.XLabel.Value && b.XLabel.Value) {
191
+ const monthMathcA = monthRegex.exec(a.XLabel.Value);
192
+ const monthMatchB = monthRegex.exec(b.XLabel.Value);
193
+ if (monthMatchB &&
194
+ monthMatchB &&
195
+ monthMathcA[1] &&
196
+ monthMatchB[1] &&
197
+ monthMathcA[2] &&
198
+ monthMatchB[2]) {
199
+ // 月的 格式 YYYY-MM-DD HH
200
+ const aDate = new Date(monthMathcA[1]).getTime();
201
+ const bDate = new Date(monthMatchB[1]).getTime();
202
+ const aHour = parseInt(monthMathcA[2], 10);
203
+ const bHour = parseInt(monthMatchB[2], 10);
204
+ if (aDate !== bDate) {
205
+ return aDate - bDate;
206
+ }
207
+ return aHour - bHour;
208
+ }
209
+ const weekMathcA = weekRegex.exec(a.XLabel.Value);
210
+ const weekMatchB = weekRegex.exec(b.XLabel.Value);
211
+ if (weekMatchB &&
212
+ weekMatchB &&
213
+ weekMathcA[1] &&
214
+ weekMatchB[1] &&
215
+ weekMathcA[2] &&
216
+ weekMatchB[2]) {
217
+ // 月的格式 2022W5
218
+ const aYear = parseInt(weekMathcA[1], 10);
219
+ const bYear = parseInt(weekMatchB[1], 10);
220
+ const aWeek = parseInt(weekMathcA[2], 10);
221
+ const bWeek = parseInt(weekMatchB[2], 10);
222
+ if (aYear !== bYear) {
223
+ return aYear - bYear;
224
+ }
225
+ return aWeek - bWeek;
226
+ }
227
+ return (new Date(a.XLabel.Value).getTime() -
228
+ new Date(b.XLabel.Value).getTime());
229
+ }
230
+ // 产品需求空值放最后
231
+ if (!a.XLabel.Value) {
232
+ return 1;
233
+ }
234
+ if (!b.XLabel.Value) {
235
+ return -1;
236
+ }
237
+ });
238
+ }
239
+ return xFields;
240
+ }
241
+ /**
242
+ * 时间轴格式化为日期,时间,日期时间
243
+ * @param { number } time 时间戳
244
+ * @param { string } timeType 需要格式化的类型 dt:日期时间,d:日期,t:时间
245
+ * @returns { string } 格式化结果
246
+ */
247
+ formatTime(time, timeType = 'dt') {
248
+ if (typeof time === 'undefined' || time === null) {
249
+ return '空';
250
+ }
251
+ if (typeof time === 'string') {
252
+ // 如果是字符串,代表后台返回的就是格式化的时间格式,则这里不再做格式化处理
253
+ return time;
254
+ }
255
+ const date = new Date(time + 8 * 3600 * 1000);
256
+ let startNum = 0;
257
+ let endNum = 19;
258
+ if (timeType === 'd') {
259
+ startNum = 0;
260
+ endNum = 10;
261
+ }
262
+ else if (timeType === 't') {
263
+ startNum = 11;
264
+ endNum = 5;
265
+ }
266
+ return date.toISOString().substr(startNum, endNum).replace('T', ' ');
267
+ }
268
+ /**
269
+ * 当有分组字段时,该方法用于获取图表 series 里的 data值,自动补全没有的数据
270
+ * @param { array } arrXaxisData - 维度名 eg:['张三','李四','王二']
271
+ * @param { array } arrGroupValue - 所属当前分组的数据 eg:[{value:'统计值',name:'统计名',dimensionality:'维度名'}]
272
+ * @returns 返回补全的数组
273
+ **/
274
+ getSeriesDataGroup(arrXaxisData, arrGroupValue) {
275
+ const xNums = arrXaxisData.length;
276
+ const arrRe = [];
277
+ for (let i = 0; i < xNums; i++) {
278
+ const objIsInArray = this.isInArray(arrXaxisData[i], arrGroupValue);
279
+ if (Object.keys(objIsInArray).length > 0) {
280
+ arrRe.push({
281
+ value: objIsInArray.value,
282
+ name: objIsInArray.name,
283
+ dimensionality: arrXaxisData[i],
284
+ });
285
+ }
286
+ else {
287
+ arrRe.push({
288
+ value: null,
289
+ });
290
+ }
291
+ }
292
+ return arrRe;
293
+ }
294
+ // 判断当前的维度名是否在该数组里
295
+ // TODO: any
296
+ isInArray(strDimensionality, arrGroupValue) {
297
+ let mixStatus = {};
298
+ if (arrGroupValue.length > 0) {
299
+ arrGroupValue.forEach((itemGroupValue) => {
300
+ if (strDimensionality === itemGroupValue.dimensionality) {
301
+ mixStatus = itemGroupValue;
302
+ }
303
+ });
304
+ }
305
+ return mixStatus;
306
+ }
307
+ // 显示 X 轴标签名
308
+ setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow }) {
309
+ this.config.xAxis.axisLabel.show = isXaxisAxisLabelShow;
310
+ // 阻止自动隐藏
311
+ this.config.xAxis.axisLabel.interval = 0;
312
+ }
313
+ // 显示 X 轴名
314
+ setIsXaxisName({ isXaxisName, xAxisName }) {
315
+ this.config.xAxis.name = isXaxisName ? xAxisName : '';
316
+ }
317
+ // 显示X轴刻度线
318
+ setIsXaxisAxisTickShow({ isXaxisAxisTickShow }) {
319
+ this.config.xAxis.axisTick = { show: isXaxisAxisTickShow };
320
+ }
321
+ // X 轴文字倾斜
322
+ setIsXaxisAxisLabelRotate({ isXaxisAxisLabelRotate, xStatistics, angle = 30, }) {
323
+ this.config.xAxis.axisLabel.rotate = isXaxisAxisLabelRotate ? angle : 0;
324
+ if (isXaxisAxisLabelRotate || xStatistics) {
325
+ // 如果X轴是时间类型,自动斜30度展示
326
+ this.config.xAxis.axisLabel.rotate = angle;
327
+ }
328
+ else {
329
+ this.config.xAxis.axisLabel.rotate = 0;
330
+ }
331
+ }
332
+ // 显示网格线 及 线条类型
333
+ setIsYAxisSplitlineLinestyleWidth({ isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, }) {
334
+ this.config.yAxis.splitLine = { lineStyle: {} };
335
+ this.config.yAxis.splitLine.lineStyle.width = isYAxisSplitlineLinestyleWidth
336
+ ? 1
337
+ : 0;
338
+ this.config.yAxis.splitLine.lineStyle.type = yAxisSplitlineLinestyleType;
339
+ }
340
+ // 显示 Y 轴刻度 最大值,最小值
341
+ setYAxisMaxMin({ yAxisMax, yAxisMin }) {
342
+ this.config.yAxis.min = yAxisMin ? yAxisMin : null;
343
+ this.config.yAxis.max = yAxisMax ? yAxisMax : null;
344
+ }
345
+ // 显示 Y 轴名称
346
+ setIsYAxisName({ isYAxisName, yAxisName }) {
347
+ this.config.yAxis.name = isYAxisName ? yAxisName : '';
348
+ }
349
+ // 显示 Y 轴刻度线
350
+ setIsYAxisShow({ isYAxisShow }) {
351
+ this.config.yAxis.show = isYAxisShow;
352
+ }
353
+ /**
354
+ * 当为空值时,重写xAxis, 只处理单Y轴情况
355
+ * @param { array } arrXisCountEmptyIndex Y轴空值key记录
356
+ * @param { boolean } xIsCountEmpty 是否统计空值
357
+ */
358
+ setEmptyValue(xIsCountEmpty) {
359
+ if (!xIsCountEmpty) {
360
+ const nonEmpty = this.config.xAxis.data.filter((item) => item !== undefined && item !== null);
361
+ this.config.xAxis.data = nonEmpty;
362
+ }
363
+ }
364
+ /**
365
+ * 删除数组里面不存在的键值
366
+ * @param { array } arrXAxis 需要处理的数组
367
+ * @returns { array } 返回处理后的数组
368
+ **/
369
+ removeEmpty(arrXAxis) {
370
+ const arrNewxAxis = [];
371
+ if (arrXAxis.length > 0) {
372
+ for (let i = 0; i < arrXAxis.length; i++) {
373
+ if (arrXAxis[i]) {
374
+ arrNewxAxis.push(arrXAxis[i]);
375
+ }
376
+ }
377
+ return arrNewxAxis;
378
+ }
379
+ else {
380
+ return arrXAxis;
381
+ }
382
+ }
383
+ /**
384
+ * 根据值 value,返回指定单位的数
385
+ * @param {number} value 原始值
386
+ * @param {string} unit 单位,'%'百分比,'‰'千分比, K千,W万,BW 百万,Y 亿,B 十亿
387
+ * @returns {object} 返回对象 {value:新值,postfix:'单位'}
388
+ **/
389
+ getValueByUnit(value, unit) {
390
+ value = Number(value);
391
+ return value / unit;
392
+ }
393
+ }
394
+ export default EchartBase;
@@ -0,0 +1,60 @@
1
+ export default EchartLine;
2
+ /**
3
+ * 折线图表
4
+ * @author loonglong
5
+ **/
6
+ declare class EchartLine extends EchartBase {
7
+ setSourceData({ dataSource, filterData, xField, xStatistics, xIsCountEmpty, yField, groupKey, groupKeyTimeSpan, }: {
8
+ dataSource: any;
9
+ filterData: any;
10
+ xField: any;
11
+ xStatistics: any;
12
+ xIsCountEmpty: any;
13
+ yField: any;
14
+ groupKey: any;
15
+ groupKeyTimeSpan: any;
16
+ }): Promise<void>;
17
+ setChartType({ chartType }: {
18
+ chartType: any;
19
+ }): void;
20
+ setIsSeriesShowSymbol({ isSeriesShowSymbol, isUnit, unit, decimalDigits, suffix, }: {
21
+ isSeriesShowSymbol: any;
22
+ isUnit: any;
23
+ unit: any;
24
+ decimalDigits: any;
25
+ suffix: any;
26
+ }): void;
27
+ setOptions({ chartType, isTitle, title, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }: {
28
+ chartType: any;
29
+ isTitle: any;
30
+ title: any;
31
+ dataSource: any;
32
+ filterData: any;
33
+ xField: any;
34
+ xStatistics: any;
35
+ groupKey: any;
36
+ groupKeyTimeSpan: any;
37
+ xIsCountEmpty: any;
38
+ yField: any;
39
+ isLegend: any;
40
+ legend: any;
41
+ isXaxisName: any;
42
+ xAxisName: any;
43
+ isXaxisAxisLabelShow: any;
44
+ isXaxisAxisTickShow: any;
45
+ isXaxisAxisLabelRotate: any;
46
+ isYAxisSplitlineLinestyleWidth: any;
47
+ yAxisSplitlineLinestyleType: any;
48
+ yAxisMax: any;
49
+ yAxisMin: any;
50
+ isYAxisName: any;
51
+ yAxisName: any;
52
+ isSeriesShowSymbol: any;
53
+ isYAxisShow: any;
54
+ isUnit: any;
55
+ unit: any;
56
+ decimalDigits: any;
57
+ suffix: any;
58
+ }): Promise<void>;
59
+ }
60
+ import EchartBase from "./eChartBase";
@@ -0,0 +1,173 @@
1
+ import EchartBase from './eChartBase';
2
+ import getConfig from '../config/line';
3
+ /**
4
+ * 折线图表
5
+ * @author loonglong
6
+ **/
7
+ class EchartLine extends EchartBase {
8
+ constructor() {
9
+ super();
10
+ const config = getConfig();
11
+ this.config = { ...this.config, ...config };
12
+ }
13
+ async setSourceData({ dataSource, filterData, xField, xStatistics, xIsCountEmpty, yField, groupKey, groupKeyTimeSpan, }) {
14
+ const { name = '', type = '', methodName = '' } = dataSource;
15
+ if (name !== '') {
16
+ const params = this.createWhere({
17
+ filterData,
18
+ xField,
19
+ xStatistics,
20
+ xIsCountEmpty,
21
+ yField,
22
+ groupKey,
23
+ groupKeyTimeSpan,
24
+ });
25
+ const arrSourData = await this.getSourceData(name, methodName, type, params);
26
+ // 获取 x 轴数据
27
+ const sortedXAxisData = this.sortXAxisData(arrSourData, xField.format);
28
+ const arrXaxisData = this.setXaxis(sortedXAxisData, xField.format);
29
+ const arrXisCountEmptyIndex = []; // 记录空值的key
30
+ if (Object.keys(groupKey !== null && groupKey !== void 0 ? groupKey : {}).length === 0) {
31
+ const numLine = sortedXAxisData[0].YLabels.length;
32
+ if (numLine > 0) {
33
+ for (let j = 0; j < numLine; j++) {
34
+ this.config.series[j] = {
35
+ type: 'line',
36
+ smooth: true,
37
+ name: '',
38
+ connectNulls: true,
39
+ showSymbol: true,
40
+ label: {
41
+ show: true,
42
+ },
43
+ data: [],
44
+ };
45
+ sortedXAxisData.forEach((itemSource, index) => {
46
+ var _a, _b;
47
+ this.config.series[j].name =
48
+ (_b = (_a = itemSource.YLabels[j]) === null || _a === void 0 ? void 0 : _a.Cn_Name) !== null && _b !== void 0 ? _b : itemSource.YLabels[j].Name;
49
+ if ((itemSource.YLabels[j].Value === undefined ||
50
+ itemSource.YLabels[j].Value === null) &&
51
+ !xIsCountEmpty) {
52
+ arrXisCountEmptyIndex.push(index);
53
+ }
54
+ else {
55
+ const value = itemSource.YLabels[j].Value
56
+ ? itemSource.YLabels[j].Value
57
+ : 0;
58
+ this.config.series[j].data.push(value);
59
+ }
60
+ });
61
+ }
62
+ }
63
+ // 处理显示空值问题
64
+ this.setEmptyValue(xIsCountEmpty);
65
+ }
66
+ else if (groupKey) {
67
+ // 如果是分组,则这里需要特殊处理
68
+ // 按groupKey分组存放数据值
69
+ const objGroupKey = {}; // {'分组字段':[{value:'统计的值', dimensionality:'维度名', name:'统计的数值字段名'}]}
70
+ sortedXAxisData.forEach((itemSourData) => {
71
+ itemSourData.YLabels.forEach((yLabel) => {
72
+ if (!objGroupKey[yLabel.Group_Name]) {
73
+ objGroupKey[yLabel.Group_Name] = [];
74
+ }
75
+ objGroupKey[yLabel.Group_Name].push({
76
+ value: yLabel.Value,
77
+ dimensionality: itemSourData.XLabel.Value,
78
+ name: yLabel.Cn_Name,
79
+ });
80
+ });
81
+ });
82
+ // 组装图表需要的数据
83
+ const groupNames = Object.keys(objGroupKey);
84
+ this.config.series = groupNames.map((groupKey) => {
85
+ // groupKey分组字段中文名
86
+ const serie = {
87
+ name: groupKey,
88
+ connectNulls: true,
89
+ data: this.getSeriesDataGroup(arrXaxisData, objGroupKey[groupKey]),
90
+ type: 'line',
91
+ smooth: true,
92
+ showSymbol: true,
93
+ label: {
94
+ show: true, // 显示线条上的数据
95
+ },
96
+ };
97
+ return serie;
98
+ });
99
+ this.config.tooltip.formatter = (params) => `${params.data.dimensionality}\r\n${params.data.name}\r\n${params.seriesName}:${params.value}`;
100
+ }
101
+ }
102
+ }
103
+ setChartType({ chartType }) {
104
+ this.config.series.length > 0 &&
105
+ this.config.series.forEach((itemSeries) => {
106
+ itemSeries.smooth = chartType !== 'line';
107
+ });
108
+ }
109
+ // 显示图表上的数据标签 单位,标签,小数位数,后缀
110
+ setIsSeriesShowSymbol({ isSeriesShowSymbol, isUnit, unit, decimalDigits, suffix, }) {
111
+ decimalDigits = decimalDigits < 0 ? 0 : decimalDigits;
112
+ this.config.series.length > 0 &&
113
+ this.config.series.forEach((itemSeries) => {
114
+ itemSeries.showSymbol = isSeriesShowSymbol;
115
+ itemSeries.label.show = isSeriesShowSymbol;
116
+ if (isUnit) {
117
+ itemSeries.label.formatter = (params) => {
118
+ const objNewValue = this.getValueByUnit(params.value, unit);
119
+ return `${objNewValue.toFixed(decimalDigits)}${suffix}`;
120
+ };
121
+ }
122
+ });
123
+ if (isUnit) {
124
+ this.config.yAxis.axisLabel.formatter = (value) => {
125
+ const objNewValue = this.getValueByUnit(value, unit);
126
+ return `${objNewValue.toFixed(decimalDigits)}${suffix}`;
127
+ };
128
+ }
129
+ else {
130
+ this.config.yAxis.axisLabel.formatter = null;
131
+ }
132
+ }
133
+ async setOptions({ chartType, isTitle, title,
134
+ // titleLocation,
135
+ dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend,
136
+ // legend2,
137
+ isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }) {
138
+ if (dataSource) {
139
+ await this.setSourceData({
140
+ dataSource,
141
+ filterData,
142
+ xField,
143
+ xStatistics,
144
+ xIsCountEmpty,
145
+ yField,
146
+ groupKey,
147
+ groupKeyTimeSpan,
148
+ });
149
+ }
150
+ this.setChartType({ chartType });
151
+ this.setTitle({ isTitle, title });
152
+ this.setLegend({ isLegend, legend });
153
+ this.setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow });
154
+ this.setIsXaxisName({ isXaxisName, xAxisName });
155
+ this.setIsXaxisAxisTickShow({ isXaxisAxisTickShow });
156
+ this.setIsXaxisAxisLabelRotate({ isXaxisAxisLabelRotate, xStatistics });
157
+ this.setIsYAxisSplitlineLinestyleWidth({
158
+ isYAxisSplitlineLinestyleWidth,
159
+ yAxisSplitlineLinestyleType,
160
+ });
161
+ this.setYAxisMaxMin({ yAxisMax, yAxisMin });
162
+ this.setIsYAxisName({ isYAxisName, yAxisName });
163
+ this.setIsYAxisShow({ isYAxisShow });
164
+ this.setIsSeriesShowSymbol({
165
+ isSeriesShowSymbol,
166
+ isUnit,
167
+ unit,
168
+ decimalDigits,
169
+ suffix,
170
+ });
171
+ }
172
+ }
173
+ export default EchartLine;
@@ -0,0 +1,48 @@
1
+ export default EchartPie;
2
+ /**
3
+ * 饼状图表
4
+ * @author loonglong
5
+ **/
6
+ declare class EchartPie extends EchartBase {
7
+ setSourceData({ dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, }: {
8
+ dataSource: any;
9
+ filterData: any;
10
+ setColor: any;
11
+ xField: any;
12
+ xStatistics: any;
13
+ xIsCountEmpty: any;
14
+ yField: any;
15
+ }): Promise<void>;
16
+ setChartType({ chartType }: {
17
+ chartType: any;
18
+ }): void;
19
+ setIsSeriesShowSymbol({ isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: {
20
+ isSeriesShowSymbol: any;
21
+ isPercent: any;
22
+ isUnit: any;
23
+ unit: any;
24
+ decimalDigits: any;
25
+ suffix: any;
26
+ }): void;
27
+ setOptions({ chartType, isTitle, title, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: {
28
+ chartType: any;
29
+ isTitle: any;
30
+ title: any;
31
+ dataSource: any;
32
+ filterData: any;
33
+ setColor: any;
34
+ xField: any;
35
+ xStatistics: any;
36
+ xIsCountEmpty: any;
37
+ yField: any;
38
+ isLegend: any;
39
+ legend: any;
40
+ isSeriesShowSymbol: any;
41
+ isPercent: any;
42
+ isUnit: any;
43
+ unit: any;
44
+ decimalDigits: any;
45
+ suffix: any;
46
+ }): Promise<void>;
47
+ }
48
+ import EchartBase from "./eChartBase";