@cloudbase/weda-ui 3.1.0 → 3.1.3

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