@cloudbase/weda-ui 0.2.14 → 0.2.17

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 (400) hide show
  1. package/README.md +41 -167
  2. package/package.json +51 -19
  3. package/src/configs/components/calendar.json +75 -0
  4. package/src/configs/components/carousel.json +273 -0
  5. package/src/configs/components/chart/bar.json +711 -0
  6. package/src/configs/components/chart/line.json +666 -0
  7. package/src/configs/components/chart/pie.json +487 -0
  8. package/src/configs/components/chart/statisticsCard.json +331 -0
  9. package/src/configs/components/dataView.json +139 -0
  10. package/src/configs/components/form/location.json +152 -0
  11. package/src/configs/components/form/uploaderFile.json +2 -1
  12. package/src/configs/components/graphicCard.json +399 -0
  13. package/src/configs/components/image.json +4 -0
  14. package/src/configs/components/link.json +2 -2
  15. package/src/configs/components/listView.json +231 -0
  16. package/src/configs/components/navLayout.json +350 -0
  17. package/src/configs/components/swiper.json +3 -3
  18. package/src/configs/index.js +23 -0
  19. package/src/mp/components/button/index.js +12 -13
  20. package/src/mp/components/button/index.wxml +1 -1
  21. package/src/{web/wedatheme/src/styles/assets → mp/components/calendar}/arrowright--line.svg +3 -4
  22. package/src/mp/components/calendar/index.js +238 -0
  23. package/src/mp/components/calendar/index.json +4 -0
  24. package/src/mp/components/calendar/index.wxml +37 -0
  25. package/src/mp/components/calendar/index.wxss +178 -0
  26. package/src/mp/components/carousel/index.js +88 -0
  27. package/src/mp/components/carousel/index.json +7 -0
  28. package/src/mp/components/carousel/index.wxml +6 -0
  29. package/src/mp/components/chart/bar/index.js +254 -0
  30. package/src/mp/components/chart/bar/index.json +6 -0
  31. package/src/mp/components/chart/bar/index.wxml +3 -0
  32. package/src/mp/components/chart/bar/index.wxss +9 -0
  33. package/src/mp/components/chart/common/config/bar.js +50 -0
  34. package/src/mp/components/chart/common/config/global.js +16 -0
  35. package/src/mp/components/chart/common/config/line.js +48 -0
  36. package/src/mp/components/chart/common/config/pie.js +36 -0
  37. package/src/mp/components/chart/common/core/eChartBar.js +262 -0
  38. package/src/mp/components/chart/common/core/eChartBase.js +371 -0
  39. package/src/mp/components/chart/common/core/eChartLine.js +228 -0
  40. package/src/mp/components/chart/common/core/eChartPie.js +166 -0
  41. package/src/mp/components/chart/common/lib/echarts.min.js +18 -0
  42. package/src/mp/components/chart/ec-canvas/ec-canvas.js +277 -0
  43. package/src/mp/components/chart/ec-canvas/ec-canvas.json +4 -0
  44. package/src/mp/components/chart/ec-canvas/ec-canvas.wxml +4 -0
  45. package/src/mp/components/chart/ec-canvas/ec-canvas.wxss +4 -0
  46. package/src/mp/components/chart/ec-canvas/wx-canvas.js +107 -0
  47. package/src/mp/components/chart/line/index.js +243 -0
  48. package/src/mp/components/chart/line/index.json +6 -0
  49. package/src/mp/components/chart/line/index.wxml +3 -0
  50. package/src/mp/components/chart/line/index.wxss +9 -0
  51. package/src/mp/components/chart/pie/index.js +178 -0
  52. package/src/mp/components/chart/pie/index.json +6 -0
  53. package/src/mp/components/chart/pie/index.wxml +4 -0
  54. package/src/mp/components/chart/pie/index.wxss +9 -0
  55. package/src/mp/components/chart/statisticsCard/index.js +226 -0
  56. package/src/mp/components/chart/statisticsCard/index.json +4 -0
  57. package/src/mp/components/chart/statisticsCard/index.wxml +9 -0
  58. package/src/mp/components/chart/statisticsCard/index.wxss +45 -0
  59. package/src/mp/components/container/index.js +4 -0
  60. package/src/mp/components/dataView/index.js +34 -0
  61. package/src/mp/components/dataView/index.json +7 -0
  62. package/src/mp/components/dataView/index.wxml +15 -0
  63. package/src/{web/wedatheme/src/styles/theme/_icon.scss → mp/components/dataView/index.wxss} +0 -0
  64. package/src/mp/components/form/location/components/mapChoose/index.js +201 -0
  65. package/src/mp/components/form/location/components/mapChoose/index.json +4 -0
  66. package/src/mp/components/form/location/components/mapChoose/index.wxml +42 -0
  67. package/src/mp/components/form/location/components/mapChoose/index.wxss +188 -0
  68. package/src/mp/components/form/location/index.js +341 -0
  69. package/src/mp/components/form/location/index.json +6 -0
  70. package/src/mp/components/form/location/index.wxml +25 -0
  71. package/src/mp/components/form/location/index.wxss +91 -0
  72. package/src/mp/components/form/radio/index.js +5 -0
  73. package/src/mp/components/form/select/index.wxml +4 -4
  74. package/src/mp/components/form/textarea/index.wxml +6 -5
  75. package/src/mp/components/form/uploader/index.js +64 -40
  76. package/src/mp/components/form/uploader/index.wxml +15 -3
  77. package/src/mp/components/form/uploaderFile/index.js +102 -27
  78. package/src/mp/components/graphicCard/chevron-right.svg +3 -0
  79. package/src/mp/components/graphicCard/index.js +203 -0
  80. package/src/mp/components/graphicCard/index.json +4 -0
  81. package/src/mp/components/graphicCard/index.wxml +29 -0
  82. package/src/mp/components/graphicCard/index.wxss +157 -0
  83. package/src/mp/components/image/index.js +53 -52
  84. package/src/mp/components/internals/listView/arrow-right-line.svg +3 -0
  85. package/src/mp/components/internals/listView/index.js +286 -0
  86. package/src/mp/components/internals/listView/index.json +4 -0
  87. package/src/mp/components/internals/listView/index.wxml +40 -0
  88. package/src/mp/components/internals/listView/index.wxss +150 -0
  89. package/src/mp/components/internals/listView/more-line.svg +3 -0
  90. package/src/mp/components/listView/arrow-right-line.svg +3 -0
  91. package/src/mp/components/listView/index.js +279 -0
  92. package/src/mp/components/listView/index.json +4 -0
  93. package/src/mp/components/listView/index.wxml +40 -0
  94. package/src/mp/components/listView/index.wxss +150 -0
  95. package/src/mp/components/listView/more-line.svg +3 -0
  96. package/src/mp/components/navLayout/index.js +123 -0
  97. package/src/mp/components/navLayout/index.json +7 -0
  98. package/src/mp/components/navLayout/index.wxml +25 -0
  99. package/src/mp/components/navLayout/index.wxss +1193 -0
  100. package/src/mp/components/swiper/index.wxml +2 -0
  101. package/src/mp/components/text/index.wxss +6 -6
  102. package/src/mp/index.json +12 -1
  103. package/src/mp/utils/debounce.js +133 -0
  104. package/src/mp/utils/dr_square_point.js +25 -0
  105. package/src/mp/utils/platform.js +15 -0
  106. package/src/mp/utils/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js +1336 -0
  107. package/src/mp/utils/spark-md5.js +776 -0
  108. package/src/mp/utils/tcb.js +18 -0
  109. package/src/setupTests.js +2 -1
  110. package/src/web/components/button/index.tsx +1 -1
  111. package/src/web/components/calendar/index.css +382 -0
  112. package/src/web/components/calendar/index.jsx +312 -0
  113. package/src/web/components/calendar/util.js +90 -0
  114. package/src/web/components/carousel/index.css +119 -0
  115. package/src/web/components/carousel/index.tsx +417 -0
  116. package/src/web/components/chart/bar/index.tsx +139 -0
  117. package/src/web/components/chart/common/config/bar.js +49 -0
  118. package/src/web/components/chart/common/config/global.js +16 -0
  119. package/src/web/components/chart/common/config/line.js +50 -0
  120. package/src/web/components/chart/common/config/pie.js +37 -0
  121. package/src/web/components/chart/common/core/eChartBar.js +264 -0
  122. package/src/web/components/chart/common/core/eChartBase.ts +379 -0
  123. package/src/web/components/chart/common/core/eChartLine.js +229 -0
  124. package/src/web/components/chart/common/core/eChartPie.js +170 -0
  125. package/src/web/components/chart/common/core/type.ts +34 -0
  126. package/src/web/components/chart/common/echart.css +106 -0
  127. package/src/web/components/chart/common/echarts.ts +33 -0
  128. package/src/web/components/chart/common/useChart.tsx +69 -0
  129. package/src/web/components/chart/line/index.tsx +135 -0
  130. package/src/web/components/chart/pie/index.tsx +99 -0
  131. package/src/web/components/chart/statisticsCard/index.css +62 -0
  132. package/src/web/components/chart/statisticsCard/index.tsx +286 -0
  133. package/src/web/components/chart/statisticsCard/interface.ts +14 -0
  134. package/src/web/components/dataView/index.tsx +20 -0
  135. package/src/web/components/dataView/interface.ts +6 -0
  136. package/src/web/components/form/input/index.css +5 -3
  137. package/src/web/components/form/input/index.tsx +1 -0
  138. package/src/web/components/form/location/common/mapChoose.css +178 -0
  139. package/src/web/components/form/location/common/mapChoose.jsx +343 -0
  140. package/src/web/components/form/location/common/mapView.jsx +190 -0
  141. package/src/web/components/form/location/common/propsConfig.js +54 -0
  142. package/src/web/components/form/location/common/selectModal.css +44 -0
  143. package/src/web/components/form/location/common/selectModal.jsx +82 -0
  144. package/src/web/components/form/location/common/useLocationInfo.js +100 -0
  145. package/src/web/components/form/location/components/LocationH5/index.css +243 -0
  146. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +403 -0
  147. package/src/web/components/form/location/components/LocationPC/Header.jsx +109 -0
  148. package/src/web/components/form/location/components/LocationPC/index.css +44 -0
  149. package/src/web/components/form/location/components/LocationPC/location.PC.jsx +323 -0
  150. package/src/web/components/form/location/constants.js +4 -0
  151. package/src/web/{wedatheme/src/styles/theme/_timeline.scss → components/form/location/index.css} +0 -0
  152. package/src/web/components/form/location/index.jsx +25 -0
  153. package/src/web/components/form/select/h5.tsx +3 -1
  154. package/src/web/components/form/select/time.jsx +1 -0
  155. package/src/web/components/form/uploader/uploader.h5.tsx +10 -2
  156. package/src/web/components/form/uploader/uploader.pc.tsx +4 -3
  157. package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +119 -106
  158. package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +3 -6
  159. package/src/web/components/graphicCard/index.css +159 -0
  160. package/src/web/components/graphicCard/index.tsx +310 -0
  161. package/src/web/components/image/image.tsx +107 -94
  162. package/src/web/components/image/index.tsx +1 -1
  163. package/src/web/components/index.js +18 -3
  164. package/src/web/components/listView/arrow-right-line.svg +3 -0
  165. package/src/web/components/listView/index.css +139 -0
  166. package/src/web/components/listView/index.tsx +354 -0
  167. package/src/web/components/listView/interface.ts +98 -0
  168. package/src/web/components/navLayout/index.css +332 -0
  169. package/src/web/components/navLayout/index.tsx +247 -0
  170. package/src/web/components/swiper/index.css +4 -0
  171. package/src/web/components/swiper/index.tsx +9 -4
  172. package/src/web/components/tabs/index.tsx +2 -2
  173. package/src/web/components/tabs/tabs.h5.tsx +7 -4
  174. package/src/web/components/uploaderFileView/index.css +9 -9
  175. package/src/web/components/uploaderFileView/index.jsx +34 -25
  176. package/src/web/types.d.ts +15 -14
  177. package/src/web/utils/debounce.js +98 -0
  178. package/src/web/utils/platform.js +31 -0
  179. package/src/web/utils/tcb.js +23 -0
  180. package/src/web/utils/tmap.js +4 -0
  181. package/CHANGELOG.md +0 -240
  182. package/src/.DS_Store +0 -0
  183. package/src/configs/.DS_Store +0 -0
  184. package/src/mp/.gitignore +0 -10
  185. package/src/web/.DS_Store +0 -0
  186. package/src/web/wedatheme/.code.yml +0 -16
  187. package/src/web/wedatheme/.editorconfig +0 -9
  188. package/src/web/wedatheme/.eslintrc +0 -20
  189. package/src/web/wedatheme/.git +0 -1
  190. package/src/web/wedatheme/.gitignore +0 -5
  191. package/src/web/wedatheme/.npmrc +0 -1
  192. package/src/web/wedatheme/.orange-ci.yml +0 -55
  193. package/src/web/wedatheme/.vscode/extensions.json +0 -3
  194. package/src/web/wedatheme/.vscode/settings.json +0 -11
  195. package/src/web/wedatheme/README.md +0 -50
  196. package/src/web/wedatheme/i18n/README.md +0 -4
  197. package/src/web/wedatheme/i18n/translation/index.js +0 -10
  198. package/src/web/wedatheme/i18n/translation/zh.js +0 -15
  199. package/src/web/wedatheme/jsconfig.json +0 -15
  200. package/src/web/wedatheme/mock/app.js +0 -42
  201. package/src/web/wedatheme/mock/history-context.js +0 -8
  202. package/src/web/wedatheme/mock/index.js +0 -3
  203. package/src/web/wedatheme/mock/layout/AppLayout.jsx +0 -28
  204. package/src/web/wedatheme/mock/layout/MenuWithRouter.jsx +0 -50
  205. package/src/web/wedatheme/mock/layout/index.js +0 -1
  206. package/src/web/wedatheme/package-lock.json +0 -14335
  207. package/src/web/wedatheme/package.json +0 -61
  208. package/src/web/wedatheme/public/index.html +0 -19
  209. package/src/web/wedatheme/src/app.js +0 -22
  210. package/src/web/wedatheme/src/components/README.md +0 -4
  211. package/src/web/wedatheme/src/configs/menu.js +0 -9
  212. package/src/web/wedatheme/src/routes/wedatheme-index/Component.jsx +0 -402
  213. package/src/web/wedatheme/src/routes/wedatheme-index/Form.jsx +0 -729
  214. package/src/web/wedatheme/src/routes/wedatheme-index/FormItem.jsx +0 -18
  215. package/src/web/wedatheme/src/routes/wedatheme-index/WedathemeIndex.jsx +0 -1276
  216. package/src/web/wedatheme/src/routes/wedatheme-index/index.js +0 -1
  217. package/src/web/wedatheme/src/routes/weui2td/WEUI2TD.jsx +0 -3
  218. package/src/web/wedatheme/src/routes/weui2td/index.js +0 -1
  219. package/src/web/wedatheme/src/styles/_btn.scss +0 -24
  220. package/src/web/wedatheme/src/styles/_icon.scss +0 -653
  221. package/src/web/wedatheme/src/styles/_map.scss +0 -12
  222. package/src/web/wedatheme/src/styles/_middle.scss +0 -340
  223. package/src/web/wedatheme/src/styles/_upload.scss +0 -47
  224. package/src/web/wedatheme/src/styles/assets/alert-close.svg +0 -3
  225. package/src/web/wedatheme/src/styles/assets/and.svg +0 -12
  226. package/src/web/wedatheme/src/styles/assets/arrowdown--line.svg +0 -12
  227. package/src/web/wedatheme/src/styles/assets/arrowdown.svg +0 -12
  228. package/src/web/wedatheme/src/styles/assets/arrowleft--line.svg +0 -12
  229. package/src/web/wedatheme/src/styles/assets/arrowleft.svg +0 -12
  230. package/src/web/wedatheme/src/styles/assets/arrowright-blue--line.svg +0 -12
  231. package/src/web/wedatheme/src/styles/assets/arrowright.svg +0 -12
  232. package/src/web/wedatheme/src/styles/assets/arrowup--line.svg +0 -12
  233. package/src/web/wedatheme/src/styles/assets/arrowup.svg +0 -12
  234. package/src/web/wedatheme/src/styles/assets/bell-warning.svg +0 -3
  235. package/src/web/wedatheme/src/styles/assets/btnback.svg +0 -12
  236. package/src/web/wedatheme/src/styles/assets/calendar.svg +0 -12
  237. package/src/web/wedatheme/src/styles/assets/chartcolumn-1.svg +0 -12
  238. package/src/web/wedatheme/src/styles/assets/chartcolumn.svg +0 -12
  239. package/src/web/wedatheme/src/styles/assets/chartline-1.svg +0 -9
  240. package/src/web/wedatheme/src/styles/assets/chartline.svg +0 -9
  241. package/src/web/wedatheme/src/styles/assets/chartpie-1.svg +0 -12
  242. package/src/web/wedatheme/src/styles/assets/chartpie.svg +0 -12
  243. package/src/web/wedatheme/src/styles/assets/check-1.svg +0 -8
  244. package/src/web/wedatheme/src/styles/assets/check-2.svg +0 -1
  245. package/src/web/wedatheme/src/styles/assets/check.svg +0 -8
  246. package/src/web/wedatheme/src/styles/assets/close-1.svg +0 -8
  247. package/src/web/wedatheme/src/styles/assets/close.svg +0 -8
  248. package/src/web/wedatheme/src/styles/assets/consult.svg +0 -8
  249. package/src/web/wedatheme/src/styles/assets/convertip--blue.svg +0 -12
  250. package/src/web/wedatheme/src/styles/assets/convertip.svg +0 -12
  251. package/src/web/wedatheme/src/styles/assets/copy.svg +0 -12
  252. package/src/web/wedatheme/src/styles/assets/cur-active.svg +0 -12
  253. package/src/web/wedatheme/src/styles/assets/cur.svg +0 -12
  254. package/src/web/wedatheme/src/styles/assets/daily.svg +0 -13
  255. package/src/web/wedatheme/src/styles/assets/database.svg +0 -12
  256. package/src/web/wedatheme/src/styles/assets/datasheet.svg +0 -12
  257. package/src/web/wedatheme/src/styles/assets/delete-white.svg +0 -8
  258. package/src/web/wedatheme/src/styles/assets/delete.svg +0 -8
  259. package/src/web/wedatheme/src/styles/assets/detail.svg +0 -13
  260. package/src/web/wedatheme/src/styles/assets/dismiss.svg +0 -8
  261. package/src/web/wedatheme/src/styles/assets/download.svg +0 -12
  262. package/src/web/wedatheme/src/styles/assets/drop.svg +0 -15
  263. package/src/web/wedatheme/src/styles/assets/email-error.svg +0 -14
  264. package/src/web/wedatheme/src/styles/assets/email-warning.svg +0 -12
  265. package/src/web/wedatheme/src/styles/assets/email.svg +0 -14
  266. package/src/web/wedatheme/src/styles/assets/emailv.svg +0 -12
  267. package/src/web/wedatheme/src/styles/assets/error-1.svg +0 -8
  268. package/src/web/wedatheme/src/styles/assets/error-filled.svg +0 -3
  269. package/src/web/wedatheme/src/styles/assets/error.svg +0 -8
  270. package/src/web/wedatheme/src/styles/assets/externallink.svg +0 -12
  271. package/src/web/wedatheme/src/styles/assets/favorable.svg +0 -9
  272. package/src/web/wedatheme/src/styles/assets/filter.svg +0 -12
  273. package/src/web/wedatheme/src/styles/assets/firstpage.svg +0 -13
  274. package/src/web/wedatheme/src/styles/assets/folderclose.svg +0 -8
  275. package/src/web/wedatheme/src/styles/assets/folderopen.svg +0 -8
  276. package/src/web/wedatheme/src/styles/assets/fullscreenquit.svg +0 -12
  277. package/src/web/wedatheme/src/styles/assets/fullsreen.svg +0 -12
  278. package/src/web/wedatheme/src/styles/assets/globe-gray.svg +0 -12
  279. package/src/web/wedatheme/src/styles/assets/guide.svg +0 -9
  280. package/src/web/wedatheme/src/styles/assets/help.svg +0 -8
  281. package/src/web/wedatheme/src/styles/assets/hide.svg +0 -8
  282. package/src/web/wedatheme/src/styles/assets/info.svg +0 -8
  283. package/src/web/wedatheme/src/styles/assets/infoblue-1.svg +0 -8
  284. package/src/web/wedatheme/src/styles/assets/infoblue-filled.svg +0 -3
  285. package/src/web/wedatheme/src/styles/assets/infoblue.svg +0 -8
  286. package/src/web/wedatheme/src/styles/assets/jump-black.svg +0 -12
  287. package/src/web/wedatheme/src/styles/assets/jump.svg +0 -12
  288. package/src/web/wedatheme/src/styles/assets/lastpage.svg +0 -13
  289. package/src/web/wedatheme/src/styles/assets/loading.svg +0 -12
  290. package/src/web/wedatheme/src/styles/assets/local.svg +0 -10
  291. package/src/web/wedatheme/src/styles/assets/menu-fold-white.svg +0 -6
  292. package/src/web/wedatheme/src/styles/assets/menu-fold.svg +0 -6
  293. package/src/web/wedatheme/src/styles/assets/minus.svg +0 -12
  294. package/src/web/wedatheme/src/styles/assets/monitor.svg +0 -12
  295. package/src/web/wedatheme/src/styles/assets/more.svg +0 -8
  296. package/src/web/wedatheme/src/styles/assets/multi-line.svg +0 -12
  297. package/src/web/wedatheme/src/styles/assets/news.svg +0 -3
  298. package/src/web/wedatheme/src/styles/assets/not.svg +0 -12
  299. package/src/web/wedatheme/src/styles/assets/notice.svg +0 -8
  300. package/src/web/wedatheme/src/styles/assets/pencil.svg +0 -12
  301. package/src/web/wedatheme/src/styles/assets/pending-1.svg +0 -8
  302. package/src/web/wedatheme/src/styles/assets/pending-gray.svg +0 -8
  303. package/src/web/wedatheme/src/styles/assets/pending.svg +0 -8
  304. package/src/web/wedatheme/src/styles/assets/percent-blue.svg +0 -16
  305. package/src/web/wedatheme/src/styles/assets/percent.svg +0 -16
  306. package/src/web/wedatheme/src/styles/assets/phone-error.svg +0 -11
  307. package/src/web/wedatheme/src/styles/assets/phone-warning.svg +0 -9
  308. package/src/web/wedatheme/src/styles/assets/phone.svg +0 -12
  309. package/src/web/wedatheme/src/styles/assets/phonev.svg +0 -9
  310. package/src/web/wedatheme/src/styles/assets/plus.svg +0 -12
  311. package/src/web/wedatheme/src/styles/assets/qq.svg +0 -11
  312. package/src/web/wedatheme/src/styles/assets/realname.svg +0 -8
  313. package/src/web/wedatheme/src/styles/assets/realnamev.svg +0 -9
  314. package/src/web/wedatheme/src/styles/assets/refresh-blue.svg +0 -12
  315. package/src/web/wedatheme/src/styles/assets/refresh.svg +0 -12
  316. package/src/web/wedatheme/src/styles/assets/relationship-1.svg +0 -12
  317. package/src/web/wedatheme/src/styles/assets/relationship.svg +0 -12
  318. package/src/web/wedatheme/src/styles/assets/remind.svg +0 -8
  319. package/src/web/wedatheme/src/styles/assets/search.svg +0 -8
  320. package/src/web/wedatheme/src/styles/assets/setting.svg +0 -12
  321. package/src/web/wedatheme/src/styles/assets/shopcart.svg +0 -8
  322. package/src/web/wedatheme/src/styles/assets/show.svg +0 -8
  323. package/src/web/wedatheme/src/styles/assets/sort.svg +0 -12
  324. package/src/web/wedatheme/src/styles/assets/sortdown.svg +0 -12
  325. package/src/web/wedatheme/src/styles/assets/sortup.svg +0 -12
  326. package/src/web/wedatheme/src/styles/assets/success-1.svg +0 -8
  327. package/src/web/wedatheme/src/styles/assets/success-filled.svg +0 -3
  328. package/src/web/wedatheme/src/styles/assets/success.svg +0 -8
  329. package/src/web/wedatheme/src/styles/assets/table-1.svg +0 -12
  330. package/src/web/wedatheme/src/styles/assets/table.svg +0 -12
  331. package/src/web/wedatheme/src/styles/assets/tag.svg +0 -12
  332. package/src/web/wedatheme/src/styles/assets/time.svg +0 -12
  333. package/src/web/wedatheme/src/styles/assets/transfer.svg +0 -8
  334. package/src/web/wedatheme/src/styles/assets/trenddown.svg +0 -12
  335. package/src/web/wedatheme/src/styles/assets/trendup.svg +0 -12
  336. package/src/web/wedatheme/src/styles/assets/viewgrid.svg +0 -12
  337. package/src/web/wedatheme/src/styles/assets/viewlist.svg +0 -12
  338. package/src/web/wedatheme/src/styles/assets/warning-1.svg +0 -8
  339. package/src/web/wedatheme/src/styles/assets/warning-filled.svg +0 -3
  340. package/src/web/wedatheme/src/styles/assets/warning.svg +0 -8
  341. package/src/web/wedatheme/src/styles/assets/wechat-error.svg +0 -14
  342. package/src/web/wedatheme/src/styles/assets/wechat-warning.svg +0 -12
  343. package/src/web/wedatheme/src/styles/assets/wechat.svg +0 -12
  344. package/src/web/wedatheme/src/styles/assets/wechatv.svg +0 -12
  345. package/src/web/wedatheme/src/styles/assets/zoom-in-white.svg +0 -4
  346. package/src/web/wedatheme/src/styles/assets/zoom-in.svg +0 -4
  347. package/src/web/wedatheme/src/styles/assets/zoom-out-white.svg +0 -4
  348. package/src/web/wedatheme/src/styles/assets/zoom-out.svg +0 -4
  349. package/src/web/wedatheme/src/styles/index.scss +0 -18
  350. package/src/web/wedatheme/src/styles/main.css +0 -166
  351. package/src/web/wedatheme/src/styles/theme/_alert.scss +0 -73
  352. package/src/web/wedatheme/src/styles/theme/_badge.scss +0 -38
  353. package/src/web/wedatheme/src/styles/theme/_blank-page-v2.scss +0 -7
  354. package/src/web/wedatheme/src/styles/theme/_breadcrumb.scss +0 -8
  355. package/src/web/wedatheme/src/styles/theme/_bubble.scss +0 -24
  356. package/src/web/wedatheme/src/styles/theme/_button.scss +0 -212
  357. package/src/web/wedatheme/src/styles/theme/_card.scss +0 -12
  358. package/src/web/wedatheme/src/styles/theme/_cascader.scss +0 -43
  359. package/src/web/wedatheme/src/styles/theme/_checkbox&radio.scss +0 -83
  360. package/src/web/wedatheme/src/styles/theme/_datepicker.scss +0 -36
  361. package/src/web/wedatheme/src/styles/theme/_dialog.scss +0 -39
  362. package/src/web/wedatheme/src/styles/theme/_divider.scss +0 -1
  363. package/src/web/wedatheme/src/styles/theme/_drawer.scss +0 -15
  364. package/src/web/wedatheme/src/styles/theme/_dropdown.scss +0 -53
  365. package/src/web/wedatheme/src/styles/theme/_form.scss +0 -38
  366. package/src/web/wedatheme/src/styles/theme/_input&textarea&select.scss +0 -85
  367. package/src/web/wedatheme/src/styles/theme/_inputnumber.scss +0 -16
  368. package/src/web/wedatheme/src/styles/theme/_link.scss +0 -14
  369. package/src/web/wedatheme/src/styles/theme/_list.scss +0 -41
  370. package/src/web/wedatheme/src/styles/theme/_metrics-board.scss +0 -14
  371. package/src/web/wedatheme/src/styles/theme/_notification.scss +0 -27
  372. package/src/web/wedatheme/src/styles/theme/_pagination.scss +0 -22
  373. package/src/web/wedatheme/src/styles/theme/_popconfirm.scss +0 -4
  374. package/src/web/wedatheme/src/styles/theme/_progress.scss +0 -28
  375. package/src/web/wedatheme/src/styles/theme/_region-select.scss +0 -17
  376. package/src/web/wedatheme/src/styles/theme/_search.scss +0 -18
  377. package/src/web/wedatheme/src/styles/theme/_segment.scss +0 -69
  378. package/src/web/wedatheme/src/styles/theme/_slider.scss +0 -18
  379. package/src/web/wedatheme/src/styles/theme/_status.scss +0 -4
  380. package/src/web/wedatheme/src/styles/theme/_steps.scss +0 -68
  381. package/src/web/wedatheme/src/styles/theme/_switch.scss +0 -11
  382. package/src/web/wedatheme/src/styles/theme/_table.scss +0 -44
  383. package/src/web/wedatheme/src/styles/theme/_tabs.scss +0 -44
  384. package/src/web/wedatheme/src/styles/theme/_tag-search.scss +0 -9
  385. package/src/web/wedatheme/src/styles/theme/_tag.scss +0 -48
  386. package/src/web/wedatheme/src/styles/theme/_toast.scss +0 -3
  387. package/src/web/wedatheme/src/styles/theme/_transfer.scss +0 -9
  388. package/src/web/wedatheme/src/styles/theme/_tree.scss +0 -11
  389. package/src/web/wedatheme/src/styles/theme/_upload.scss +0 -14
  390. package/src/web/wedatheme/src/styles/theme/_variables.scss +0 -140
  391. package/src/web/wedatheme/src/styles/theme/index.scss +0 -91
  392. package/src/web/wedatheme/style-package/README.md +0 -31
  393. package/src/web/wedatheme/style-package/ef6fa527e24e354765d806b826b41391.svg +0 -627
  394. package/src/web/wedatheme/style-package/index.css +0 -3
  395. package/src/web/wedatheme/style-package/package.json +0 -15
  396. package/src/web/wedatheme/tea.config.js +0 -66
  397. package/src/web/wedatheme/webpack/css.config.js +0 -114
  398. package/src/web/wedatheme/webpack/plugins/css-package-plugin.js +0 -23
  399. package/src/web/wedatheme/webpack/plugins/inject-assets-plugin.js +0 -32
  400. package/src/web/wedatheme/webpack/plugins/package-json-plugin.js +0 -66
@@ -0,0 +1,277 @@
1
+ import WxCanvas from './wx-canvas';
2
+ import * as echarts from '../common/lib/echarts.min';
3
+
4
+ let ctx;
5
+
6
+ function compareVersion(v1, v2) {
7
+ v1 = v1.split('.');
8
+ v2 = v2.split('.');
9
+ const len = Math.max(v1.length, v2.length);
10
+
11
+ while (v1.length < len) {
12
+ v1.push('0');
13
+ }
14
+ while (v2.length < len) {
15
+ v2.push('0');
16
+ }
17
+
18
+ for (let i = 0; i < len; i++) {
19
+ const num1 = parseInt(v1[i]);
20
+ const num2 = parseInt(v2[i]);
21
+
22
+ if (num1 > num2) {
23
+ return 1;
24
+ } else if (num1 < num2) {
25
+ return -1;
26
+ }
27
+ }
28
+ return 0;
29
+ }
30
+
31
+ Component({
32
+ properties: {
33
+ canvasId: {
34
+ type: String,
35
+ value: 'ec-canvas',
36
+ },
37
+
38
+ ec: {
39
+ type: Object,
40
+ },
41
+
42
+ forceUseOldCanvas: {
43
+ type: Boolean,
44
+ value: false,
45
+ },
46
+ },
47
+
48
+ data: {
49
+ isUseNewCanvas: false,
50
+ },
51
+
52
+ ready: function () {
53
+ // Disable prograssive because drawImage doesn't support DOM as parameter
54
+ // See https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html
55
+ echarts.registerPreprocessor((option) => {
56
+ if (option && option.series) {
57
+ if (option.series.length > 0) {
58
+ option.series.forEach((series) => {
59
+ series.progressive = 0;
60
+ });
61
+ } else if (typeof option.series === 'object') {
62
+ option.series.progressive = 0;
63
+ }
64
+ }
65
+ });
66
+
67
+ if (!this.data.ec) {
68
+ console.warn(
69
+ '组件需绑定 ec 变量,例:<ec-canvas id="mychart-dom-bar" ' +
70
+ 'canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>'
71
+ );
72
+ return;
73
+ }
74
+
75
+ if (!this.data.ec.lazyLoad) {
76
+ this.init();
77
+ }
78
+ },
79
+
80
+ methods: {
81
+ init: function (callback) {
82
+ const version = wx.getSystemInfoSync().SDKVersion;
83
+
84
+ const canUseNewCanvas = compareVersion(version, '2.9.0') >= 0;
85
+ const forceUseOldCanvas = this.data.forceUseOldCanvas;
86
+ const isUseNewCanvas = canUseNewCanvas && !forceUseOldCanvas;
87
+ this.setData({ isUseNewCanvas });
88
+
89
+ if (forceUseOldCanvas && canUseNewCanvas) {
90
+ console.warn('开发者强制使用旧canvas,建议关闭');
91
+ }
92
+
93
+ if (isUseNewCanvas) {
94
+ // console.log('微信基础库版本大于2.9.0,开始使用<canvas type="2d"/>');
95
+ // 2.9.0 可以使用 <canvas type="2d"></canvas>
96
+ this.initByNewWay(callback);
97
+ } else {
98
+ const isValid = compareVersion(version, '1.9.91') >= 0;
99
+ if (!isValid) {
100
+ console.error(
101
+ '微信基础库版本过低,需大于等于 1.9.91。' +
102
+ '参见:https://github.com/ecomfe/echarts-for-weixin' +
103
+ '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82'
104
+ );
105
+ return;
106
+ } else {
107
+ console.warn(
108
+ '建议将微信基础库调整大于等于2.9.0版本。升级后绘图将有更好性能'
109
+ );
110
+ this.initByOldWay(callback);
111
+ }
112
+ }
113
+ },
114
+
115
+ initByOldWay(callback) {
116
+ // 1.9.91 <= version < 2.9.0:原来的方式初始化
117
+ ctx = wx.createCanvasContext(this.data.canvasId, this);
118
+ const canvas = new WxCanvas(ctx, this.data.canvasId, false);
119
+
120
+ echarts.setCanvasCreator(() => {
121
+ return canvas;
122
+ });
123
+ // const canvasDpr = wx.getSystemInfoSync().pixelRatio // 微信旧的canvas不能传入dpr
124
+ const canvasDpr = 1;
125
+ var query = wx.createSelectorQuery().in(this);
126
+ query
127
+ .select('.ec-canvas')
128
+ .boundingClientRect(async (res) => {
129
+ if (typeof callback === 'function') {
130
+ this.chart = callback(canvas, res.width, res.height, canvasDpr);
131
+ } else if (
132
+ this.data.ec &&
133
+ typeof this.data.ec.onInit === 'function'
134
+ ) {
135
+ this.chart = await this.data.ec.onInit(
136
+ canvas,
137
+ res.width,
138
+ res.height,
139
+ canvasDpr
140
+ );
141
+ } else {
142
+ this.triggerEvent('init', {
143
+ canvas: canvas,
144
+ width: res.width,
145
+ height: res.height,
146
+ canvasDpr: canvasDpr, // 增加了dpr,可方便外面echarts.init
147
+ });
148
+ }
149
+ })
150
+ .exec();
151
+ },
152
+
153
+ initByNewWay(callback) {
154
+ // version >= 2.9.0:使用新的方式初始化
155
+ const query = wx.createSelectorQuery().in(this);
156
+ query
157
+ .select('.ec-canvas')
158
+ .fields({ node: true, size: true })
159
+ .exec(async (res) => {
160
+ const canvasNode = res[0].node;
161
+ this.canvasNode = canvasNode;
162
+
163
+ const canvasDpr = wx.getSystemInfoSync().pixelRatio;
164
+ const canvasWidth = res[0].width;
165
+ const canvasHeight = res[0].height;
166
+
167
+ const ctx = canvasNode.getContext('2d');
168
+
169
+ const canvas = new WxCanvas(
170
+ ctx,
171
+ this.data.canvasId,
172
+ true,
173
+ canvasNode
174
+ );
175
+ echarts.setCanvasCreator(() => {
176
+ return canvas;
177
+ });
178
+
179
+ if (typeof callback === 'function') {
180
+ this.chart = callback(canvas, canvasWidth, canvasHeight, canvasDpr);
181
+ } else if (
182
+ this.data.ec &&
183
+ typeof this.data.ec.onInit === 'function'
184
+ ) {
185
+ this.chart = await this.data.ec.onInit(
186
+ canvas,
187
+ canvasWidth,
188
+ canvasHeight,
189
+ canvasDpr
190
+ );
191
+ } else {
192
+ this.triggerEvent('init', {
193
+ canvas: canvas,
194
+ width: canvasWidth,
195
+ height: canvasHeight,
196
+ dpr: canvasDpr,
197
+ });
198
+ }
199
+ });
200
+ },
201
+ canvasToTempFilePath(opt) {
202
+ if (this.data.isUseNewCanvas) {
203
+ // 新版
204
+ const query = wx.createSelectorQuery().in(this);
205
+ query
206
+ .select('.ec-canvas')
207
+ .fields({ node: true, size: true })
208
+ .exec((res) => {
209
+ const canvasNode = res[0].node;
210
+ opt.canvas = canvasNode;
211
+ wx.canvasToTempFilePath(opt);
212
+ });
213
+ } else {
214
+ // 旧的
215
+ if (!opt.canvasId) {
216
+ opt.canvasId = this.data.canvasId;
217
+ }
218
+ ctx.draw(true, () => {
219
+ wx.canvasToTempFilePath(opt, this);
220
+ });
221
+ }
222
+ },
223
+
224
+ touchStart(e) {
225
+ if (this.chart && e.touches.length > 0) {
226
+ var touch = e.touches[0];
227
+ var handler = this.chart.getZr().handler;
228
+ handler.dispatch('mousedown', {
229
+ zrX: touch.x,
230
+ zrY: touch.y,
231
+ });
232
+ handler.dispatch('mousemove', {
233
+ zrX: touch.x,
234
+ zrY: touch.y,
235
+ });
236
+ handler.processGesture(wrapTouch(e), 'start');
237
+ }
238
+ },
239
+
240
+ touchMove(e) {
241
+ if (this.chart && e.touches.length > 0) {
242
+ var touch = e.touches[0];
243
+ var handler = this.chart.getZr().handler;
244
+ handler.dispatch('mousemove', {
245
+ zrX: touch.x,
246
+ zrY: touch.y,
247
+ });
248
+ handler.processGesture(wrapTouch(e), 'change');
249
+ }
250
+ },
251
+
252
+ touchEnd(e) {
253
+ if (this.chart) {
254
+ const touch = e.changedTouches ? e.changedTouches[0] : {};
255
+ var handler = this.chart.getZr().handler;
256
+ handler.dispatch('mouseup', {
257
+ zrX: touch.x,
258
+ zrY: touch.y,
259
+ });
260
+ handler.dispatch('click', {
261
+ zrX: touch.x,
262
+ zrY: touch.y,
263
+ });
264
+ handler.processGesture(wrapTouch(e), 'end');
265
+ }
266
+ },
267
+ },
268
+ });
269
+
270
+ function wrapTouch(event) {
271
+ for (let i = 0; i < event.touches.length; ++i) {
272
+ const touch = event.touches[i];
273
+ touch.offsetX = touch.x;
274
+ touch.offsetY = touch.y;
275
+ }
276
+ return event;
277
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {}
4
+ }
@@ -0,0 +1,4 @@
1
+ <!-- 新的:接口对齐了H5 -->
2
+ <canvas wx:if="{{isUseNewCanvas}}" type="2d" class="ec-canvas" canvas-id="{{ canvasId }}" bindinit="init" bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"></canvas>
3
+ <!-- 旧的 -->
4
+ <canvas wx:else class="ec-canvas" canvas-id="{{ canvasId }}" bindinit="init" bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"></canvas>
@@ -0,0 +1,4 @@
1
+ .ec-canvas {
2
+ width: 100%;
3
+ height: 100%;
4
+ }
@@ -0,0 +1,107 @@
1
+ class WxCanvas {
2
+ constructor(ctx, canvasId, isNew, canvasNode) {
3
+ this.ctx = ctx;
4
+ this.canvasId = canvasId;
5
+ this.chart = null;
6
+ this.isNew = isNew;
7
+ if (isNew) {
8
+ this.canvasNode = canvasNode;
9
+ }
10
+ else {
11
+ this._initStyle(ctx);
12
+ }
13
+
14
+ // this._initCanvas(zrender, ctx);
15
+
16
+ this._initEvent();
17
+ }
18
+
19
+ getContext(contextType) {
20
+ if (contextType === '2d') {
21
+ return this.ctx;
22
+ }
23
+ }
24
+
25
+ // canvasToTempFilePath(opt) {
26
+ // if (!opt.canvasId) {
27
+ // opt.canvasId = this.canvasId;
28
+ // }
29
+ // return wx.canvasToTempFilePath(opt, this);
30
+ // }
31
+
32
+ setChart(chart) {
33
+ this.chart = chart;
34
+ }
35
+
36
+ attachEvent() {
37
+ // noop
38
+ }
39
+
40
+ detachEvent() {
41
+ // noop
42
+ }
43
+
44
+ _initCanvas(zrender, ctx) {
45
+ zrender.util.getContext = function () {
46
+ return ctx;
47
+ };
48
+
49
+ zrender.util.$override('measureText', function (text, font) {
50
+ ctx.font = font || '12px sans-serif';
51
+ return ctx.measureText(text);
52
+ });
53
+ }
54
+
55
+ _initStyle(ctx) {
56
+ ctx.createRadialGradient = () => {
57
+ return ctx.createCircularGradient(arguments);
58
+ };
59
+ }
60
+
61
+ _initEvent() {
62
+ this.event = {};
63
+ const eventNames = [{
64
+ wxName: 'touchStart',
65
+ ecName: 'mousedown'
66
+ }, {
67
+ wxName: 'touchMove',
68
+ ecName: 'mousemove'
69
+ }, {
70
+ wxName: 'touchEnd',
71
+ ecName: 'mouseup'
72
+ }, {
73
+ wxName: 'touchEnd',
74
+ ecName: 'click'
75
+ }];
76
+
77
+ eventNames.forEach(name => {
78
+ this.event[name.wxName] = e => {
79
+ const touch = e.touches[0];
80
+ this.chart.getZr().handler.dispatch(name.ecName, {
81
+ zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
82
+ zrY: name.wxName === 'tap' ? touch.clientY : touch.y
83
+ });
84
+ };
85
+ });
86
+ }
87
+
88
+ set width(w) {
89
+ if (this.canvasNode) this.canvasNode.width = w;
90
+ }
91
+ set height(h) {
92
+ if (this.canvasNode) this.canvasNode.height = h;
93
+ }
94
+
95
+ get width() {
96
+ if (this.canvasNode)
97
+ return this.canvasNode.width;
98
+ return 0;
99
+ }
100
+ get height() {
101
+ if (this.canvasNode)
102
+ return this.canvasNode.height;
103
+ return 0;
104
+ }
105
+ }
106
+
107
+ export default WxCanvas;
@@ -0,0 +1,243 @@
1
+ import * as echarts from '../common/lib/echarts.min';
2
+ import EchartLine from '../common/core/eChartLine';
3
+ Component({
4
+ options: {
5
+ virtualHost: true,
6
+ multipleSlots: true,
7
+ },
8
+ properties: {
9
+ id: {
10
+ type: String,
11
+ value: '',
12
+ },
13
+ className: {
14
+ type: String,
15
+ value: '',
16
+ },
17
+ style: {
18
+ type: String,
19
+ value: '',
20
+ },
21
+ chartType: {
22
+ // 线条类型
23
+ type: String,
24
+ value: 'bight',
25
+ },
26
+ title: {
27
+ // 图表标题
28
+ type: String,
29
+ },
30
+ isTitle: {
31
+ // 是否显示标题
32
+ type: Boolean,
33
+ value: false,
34
+ },
35
+ titleLocation: {
36
+ type: String,
37
+ value: 'top',
38
+ },
39
+ dataSource: {
40
+ // 数据源
41
+ type: Object,
42
+ },
43
+ filterData: {
44
+ // 数据筛选
45
+ type: Array,
46
+ value: [],
47
+ },
48
+ xField: {
49
+ // x轴字段选择
50
+ type: Object,
51
+ value: {
52
+ format: '',
53
+ type: '', // 数据源字段 类型
54
+ title: '', // 字段名中文
55
+ name: '', // 字段名英文
56
+ },
57
+ },
58
+ xStatistics: {
59
+ // x轴统计维度
60
+ type: String,
61
+ value: '', // 统计纬度, 只有选择时间类型才有,y 年,m月,d 日,w周,h时,min 分,s秒
62
+ },
63
+ groupKey: {
64
+ // x轴字段选择
65
+ type: Object,
66
+ value: {
67
+ format: '',
68
+ type: '', // 数据源字段 类型
69
+ title: '', // 字段名中文
70
+ name: '', // 字段名英文
71
+ },
72
+ },
73
+ groupKeyTimeSpan: {
74
+ // x轴统计维度
75
+ type: String,
76
+ value: '', // 统计纬度, 只有选择时间类型才有,y 年,m月,d 日,w周,h时,min 分,s秒
77
+ },
78
+ xIsCountEmpty: {
79
+ // x轴 是否统计空值
80
+ type: Boolean,
81
+ value: false,
82
+ },
83
+ yField: {
84
+ // Y轴字段,分组字段,是否分组
85
+ type: Object,
86
+ value: {
87
+ numValue: [{ key: '', operationType: '' }],
88
+ groupKey: '',
89
+ },
90
+ },
91
+ isLegend: {
92
+ // 是否显示图例
93
+ type: Boolean,
94
+ value: false,
95
+ },
96
+ legend: {
97
+ // 图例
98
+ type: String,
99
+ value: 'bottom', // 左 left 右right, 上top,下 bottom
100
+ },
101
+
102
+ // 高级属性
103
+ isXaxisName: {
104
+ // 是否显示坐标轴名称
105
+ type: Boolean,
106
+ value: true,
107
+ },
108
+ xAxisName: {
109
+ // 是否显示坐标轴名称
110
+ type: String,
111
+ value: '',
112
+ },
113
+ isXaxisAxisLabelShow: {
114
+ // 是否显示标签
115
+ type: Boolean,
116
+ value: true,
117
+ },
118
+ isXaxisAxisTickShow: {
119
+ // 显示X轴刻度线
120
+ type: Boolean,
121
+ value: true,
122
+ },
123
+ isXaxisAxisLabelRotate: {
124
+ // 文字自动倾斜
125
+ type: Boolean,
126
+ value: false,
127
+ },
128
+ isYAxisShow: {
129
+ // 是否显示 Y 轴刻度线
130
+ type: Boolean,
131
+ value: true,
132
+ },
133
+ isYAxisName: {
134
+ // 是否显示 Y坐标轴名称
135
+ type: Boolean,
136
+ value: true,
137
+ },
138
+ isYAxisSplitlineLinestyleWidth: {
139
+ // 是否显示网格线 ,yAxis.splitLine.lineStyle.width设置为0
140
+ type: Boolean,
141
+ value: true,
142
+ },
143
+ yAxisSplitlineLinestyleType: {
144
+ // 网格线线条类型 solid,dashed,dotted
145
+ type: String,
146
+ value: 'dashed',
147
+ },
148
+ yAxisName: {
149
+ // Y坐标轴名称 显示名称后需要设置居中,轴线距离属性 yAxis.nameLocation='middle' yAxis.nameGap =20
150
+ type: String,
151
+ value: '',
152
+ },
153
+ yAxisMin: {
154
+ // Y轴刻度最小值
155
+ type: Number,
156
+ value: 0,
157
+ },
158
+ yAxisMax: {
159
+ // Y轴刻度最大值, 切记如果为0时,则不设置
160
+ type: Number,
161
+ value: 0,
162
+ },
163
+ isSeriesShowSymbol: {
164
+ // 是否显示数据标签 开启后 属性 series.label.show 要同时设置为true
165
+ type: Boolean,
166
+ value: true,
167
+ },
168
+ isUnit: {
169
+ // 显示单位
170
+ type: Boolean,
171
+ value: false,
172
+ },
173
+ unit: {
174
+ // 数字显示的单位 百分比,千分比,千,万,百万,亿,十亿
175
+ type: String,
176
+ value: '%',
177
+ },
178
+ decimalDigits: {
179
+ // 小数位数
180
+ type: Number,
181
+ value: 0,
182
+ },
183
+ suffix: {
184
+ // 后缀
185
+ type: String,
186
+ value: '',
187
+ },
188
+ },
189
+ data: {
190
+ ec: {},
191
+ canvas_id: {
192
+ type: String,
193
+ value: `canvas_line_${Date.now()}_${Math.random() * 100}`,
194
+ },
195
+ },
196
+ lifetimes: {
197
+ attached() {
198
+ // 在组件实例进入页面节点树时执行
199
+ this.initData();
200
+ },
201
+ detached() {
202
+ // 在组件实例被从页面节点树移除时执行
203
+ },
204
+ },
205
+ // 以下是旧式的定义方式,可以保持对 <2.2.3 版本基础库的兼容
206
+ attached() {
207
+ // 在组件实例进入页面节点树时执行
208
+ this.initData();
209
+ },
210
+ detached() {
211
+ // 在组件实例被从页面节点树移除时执行
212
+ },
213
+ observers: {
214
+ // 当参数变化时
215
+ option() {
216
+ this.initData();
217
+ },
218
+ },
219
+ methods: {
220
+ initData() {
221
+ this.setData({
222
+ ec: {
223
+ onInit: this.initChart.bind(this),
224
+ },
225
+ });
226
+ },
227
+ async initChart(canvas, width, height, dpr) {
228
+ const objEchart = echarts.init(canvas, null, {
229
+ width,
230
+ height,
231
+ devicePixelRatio: dpr,
232
+ });
233
+ canvas.setChart(objEchart);
234
+ const objEChartLine = new EchartLine();
235
+ await objEChartLine.setOptions(this.properties);
236
+ const options = await objEChartLine.getOptions();
237
+ // objEchart.clear();
238
+ console.log('设置前参数line', options);
239
+ objEchart.setOption(options);
240
+ return objEchart;
241
+ },
242
+ },
243
+ });
@@ -0,0 +1,6 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "ec-canvas": "../ec-canvas/ec-canvas"
5
+ }
6
+ }
@@ -0,0 +1,3 @@
1
+ <view wx:if="ec" class="{{className}} ec_container" style="{{style}}" id="{{id}}">
2
+ <ec-canvas canvas-id="{{canvas_id}}" ec="{{ ec }}"></ec-canvas>
3
+ </view>
@@ -0,0 +1,9 @@
1
+ /**index.wxss**/
2
+ ec-canvas {
3
+ width: 100%;
4
+ height: 100%;
5
+ }
6
+ .ec_container {
7
+ width: 100%;
8
+ height: 380px;
9
+ }