@supermapgis/vue-iclient-leaflet 11.2.0

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 (719) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +31 -0
  3. package/dist/iclient-leaflet-vue.css +24471 -0
  4. package/dist/iclient-leaflet-vue.js +190317 -0
  5. package/dist/iclient-leaflet-vue.min.css +9 -0
  6. package/dist/iclient-leaflet-vue.min.js +517 -0
  7. package/dist/index.js +15 -0
  8. package/lib/_assets/iconfont/icon-sm-components.css +245 -0
  9. package/lib/_assets/iconfont/icon-sm-components.eot +0 -0
  10. package/lib/_assets/iconfont/icon-sm-components.svg +197 -0
  11. package/lib/_assets/iconfont/icon-sm-components.ttf +0 -0
  12. package/lib/_assets/iconfont/icon-sm-components.woff +0 -0
  13. package/lib/_assets/iconfont/icon-sm-components.woff2 +0 -0
  14. package/lib/_lang/en.js +446 -0
  15. package/lib/_lang/index.js +385 -0
  16. package/lib/_lang/zh.js +445 -0
  17. package/lib/_mixin/AntdRender.js +686 -0
  18. package/lib/_mixin/Card.js +197 -0
  19. package/lib/_mixin/GridLayer.js +153 -0
  20. package/lib/_mixin/Layer.js +140 -0
  21. package/lib/_mixin/Options.js +114 -0
  22. package/lib/_mixin/Popper.js +134 -0
  23. package/lib/_mixin/Theme.js +441 -0
  24. package/lib/_mixin/ThirdService.js +243 -0
  25. package/lib/_mixin/TileLayer.js +138 -0
  26. package/lib/_mixin/Timer.js +230 -0
  27. package/lib/_mixin/VmUpdater.js +204 -0
  28. package/lib/_mixin/WebMapBase.js +3467 -0
  29. package/lib/_mixin/map-events.js +200 -0
  30. package/lib/_mixin/map-getter.js +341 -0
  31. package/lib/_types/AddressMatchParameter.js +118 -0
  32. package/lib/_types/GeoJSONParamter.js +113 -0
  33. package/lib/_types/RestDataParameter.js +141 -0
  34. package/lib/_types/RestMapParameter.js +141 -0
  35. package/lib/_types/RestParameter.js +121 -0
  36. package/lib/_types/event/BaseTypes.js +124 -0
  37. package/lib/_types/event/Event.js +442 -0
  38. package/lib/_types/event/Events.js +484 -0
  39. package/lib/_types/event/Pixel.js +295 -0
  40. package/lib/_types/event/Util.js +305 -0
  41. package/lib/_types/iPortalDataParameter.js +121 -0
  42. package/lib/_types/iServerBaseParameter.js +111 -0
  43. package/lib/_types/iServerDataParameter.js +154 -0
  44. package/lib/_types/iServerMapParameter.js +154 -0
  45. package/lib/_types/index.js +231 -0
  46. package/lib/_types/map-event.js +163 -0
  47. package/lib/_utils/EchartsDataService.js +843 -0
  48. package/lib/_utils/RestService.js +7096 -0
  49. package/lib/_utils/WebMapService.js +1607 -0
  50. package/lib/_utils/epsg-define.js +181 -0
  51. package/lib/_utils/get-features.js +232 -0
  52. package/lib/_utils/global-event.js +134 -0
  53. package/lib/_utils/iPortalDataService.js +7459 -0
  54. package/lib/_utils/iServerRestService.js +7603 -0
  55. package/lib/_utils/props-binder.js +129 -0
  56. package/lib/_utils/statistics.js +147 -0
  57. package/lib/_utils/style/color/colorPalette.js +192 -0
  58. package/lib/_utils/style/color/serialColors.js +352 -0
  59. package/lib/_utils/style/common/common.css +1 -0
  60. package/lib/_utils/style/mixins/config.css +0 -0
  61. package/lib/_utils/style/mixins/mixins.css +0 -0
  62. package/lib/_utils/style/theme/antd.css +25242 -0
  63. package/lib/_utils/style/theme/antdVar.css +0 -0
  64. package/lib/_utils/style/theme/chart.js +7477 -0
  65. package/lib/_utils/style/theme/set-theme.js +200 -0
  66. package/lib/_utils/style/theme/theme.css +0 -0
  67. package/lib/_utils/style/theme/theme.json +356 -0
  68. package/lib/_utils/util.js +484 -0
  69. package/lib/_utils/vue-types/index.js +396 -0
  70. package/lib/_utils/vue-types/utils.js +318 -0
  71. package/lib/avatar/index.js +656 -0
  72. package/lib/avatar/style/avatar.css +1 -0
  73. package/lib/avatar/style/css.js +9 -0
  74. package/lib/avatar/style/index.css +2135 -0
  75. package/lib/avatar/style/index.js +9 -0
  76. package/lib/border/index.js +642 -0
  77. package/lib/border/style/border.css +1 -0
  78. package/lib/border/style/css.js +7 -0
  79. package/lib/border/style/index.js +7 -0
  80. package/lib/breadcrumb/index.js +813 -0
  81. package/lib/breadcrumb/style/breadcrumb.css +1 -0
  82. package/lib/breadcrumb/style/css.js +9 -0
  83. package/lib/breadcrumb/style/index.css +2102 -0
  84. package/lib/breadcrumb/style/index.js +9 -0
  85. package/lib/button/index.js +758 -0
  86. package/lib/button/style/button.css +1 -0
  87. package/lib/button/style/css.js +9 -0
  88. package/lib/button/style/index.css +3571 -0
  89. package/lib/button/style/index.js +9 -0
  90. package/lib/card/index.js +824 -0
  91. package/lib/card/style/card.css +1 -0
  92. package/lib/card/style/css.js +9 -0
  93. package/lib/card/style/index.css +2379 -0
  94. package/lib/card/style/index.js +9 -0
  95. package/lib/chart/index.js +9471 -0
  96. package/lib/chart/style/chart.css +1 -0
  97. package/lib/chart/style/css.js +11 -0
  98. package/lib/chart/style/index.js +11 -0
  99. package/lib/checkbox/index.js +756 -0
  100. package/lib/checkbox/style/checkbox.css +1 -0
  101. package/lib/checkbox/style/css.js +9 -0
  102. package/lib/checkbox/style/index.css +2286 -0
  103. package/lib/checkbox/style/index.js +9 -0
  104. package/lib/collapse/index.js +446 -0
  105. package/lib/collapse/style/collapse.css +1 -0
  106. package/lib/collapse/style/css.js +9 -0
  107. package/lib/collapse/style/index.css +2187 -0
  108. package/lib/collapse/style/index.js +9 -0
  109. package/lib/collapse-card/index.js +588 -0
  110. package/lib/collapse-card/style/collapse-card.css +1 -0
  111. package/lib/collapse-card/style/css.js +7 -0
  112. package/lib/collapse-card/style/index.js +7 -0
  113. package/lib/color-picker/index.js +521 -0
  114. package/lib/color-picker/style/color-picker.css +1 -0
  115. package/lib/color-picker/style/css.js +7 -0
  116. package/lib/color-picker/style/index.js +7 -0
  117. package/lib/date-picker/index.js +680 -0
  118. package/lib/date-picker/style/css.js +9 -0
  119. package/lib/date-picker/style/date-picker.css +1 -0
  120. package/lib/date-picker/style/index.css +4236 -0
  121. package/lib/date-picker/style/index.js +9 -0
  122. package/lib/dropdown/index.js +347 -0
  123. package/lib/dropdown/style/css.js +9 -0
  124. package/lib/dropdown/style/dropdown.css +1 -0
  125. package/lib/dropdown/style/index.css +2344 -0
  126. package/lib/dropdown/style/index.js +9 -0
  127. package/lib/empty/index.js +643 -0
  128. package/lib/empty/style/css.js +9 -0
  129. package/lib/empty/style/empty.css +1 -0
  130. package/lib/empty/style/index.css +2095 -0
  131. package/lib/empty/style/index.js +9 -0
  132. package/lib/icon/index.js +681 -0
  133. package/lib/icon/style/css.js +9 -0
  134. package/lib/icon/style/icon.css +1 -0
  135. package/lib/icon/style/index.css +2058 -0
  136. package/lib/icon/style/index.js +9 -0
  137. package/lib/identify/index.js +1081 -0
  138. package/lib/identify/style/css.js +9 -0
  139. package/lib/identify/style/identify.css +1 -0
  140. package/lib/identify/style/index.js +9 -0
  141. package/lib/iframe/index.js +344 -0
  142. package/lib/iframe/style/css.js +7 -0
  143. package/lib/iframe/style/iframe.css +1 -0
  144. package/lib/iframe/style/index.js +7 -0
  145. package/lib/image/index.js +446 -0
  146. package/lib/image/style/css.js +7 -0
  147. package/lib/image/style/image.css +1 -0
  148. package/lib/image/style/index.js +7 -0
  149. package/lib/index.js +1040 -0
  150. package/lib/indicator/index.js +996 -0
  151. package/lib/indicator/style/countTo.css +1 -0
  152. package/lib/indicator/style/css.js +7 -0
  153. package/lib/indicator/style/index.js +7 -0
  154. package/lib/indicator/style/indicator.css +1 -0
  155. package/lib/init.js +207 -0
  156. package/lib/input/index.js +1151 -0
  157. package/lib/input/style/css.js +9 -0
  158. package/lib/input/style/index.css +2549 -0
  159. package/lib/input/style/index.js +9 -0
  160. package/lib/input/style/input.css +1 -0
  161. package/lib/input-number/index.js +739 -0
  162. package/lib/input-number/style/css.js +9 -0
  163. package/lib/input-number/style/index.css +2360 -0
  164. package/lib/input-number/style/index.js +9 -0
  165. package/lib/input-number/style/input-number.css +1 -0
  166. package/lib/layout/index.js +700 -0
  167. package/lib/layout/style/css.js +9 -0
  168. package/lib/layout/style/index.css +2185 -0
  169. package/lib/layout/style/index.js +9 -0
  170. package/lib/layout/style/layout.css +0 -0
  171. package/lib/liquid-fill/index.js +983 -0
  172. package/lib/liquid-fill/style/css.js +7 -0
  173. package/lib/liquid-fill/style/index.js +7 -0
  174. package/lib/liquid-fill/style/liquid-fill.css +1 -0
  175. package/lib/marker/index.js +649 -0
  176. package/lib/marker/style/css.js +0 -0
  177. package/lib/marker/style/index.js +0 -0
  178. package/lib/menu/index.js +858 -0
  179. package/lib/menu/style/css.js +9 -0
  180. package/lib/menu/style/index.css +2777 -0
  181. package/lib/menu/style/index.js +9 -0
  182. package/lib/menu/style/menu.css +0 -0
  183. package/lib/message/index.js +174 -0
  184. package/lib/message/style/css.js +9 -0
  185. package/lib/message/style/index.css +2143 -0
  186. package/lib/message/style/index.js +9 -0
  187. package/lib/message/style/message.css +1 -0
  188. package/lib/modal/index.js +742 -0
  189. package/lib/modal/style/css.js +9 -0
  190. package/lib/modal/style/index.css +2289 -0
  191. package/lib/modal/style/index.js +9 -0
  192. package/lib/modal/style/modal.css +1 -0
  193. package/lib/nav/style/css.js +9 -0
  194. package/lib/nav/style/index.js +9 -0
  195. package/lib/nav/style/nav.css +1 -0
  196. package/lib/notification/index.js +151 -0
  197. package/lib/notification/style/css.js +9 -0
  198. package/lib/notification/style/index.css +2285 -0
  199. package/lib/notification/style/index.js +9 -0
  200. package/lib/notification/style/notification.css +1 -0
  201. package/lib/pagination/index.js +352 -0
  202. package/lib/pagination/style/css.js +9 -0
  203. package/lib/pagination/style/index.css +2529 -0
  204. package/lib/pagination/style/index.js +9 -0
  205. package/lib/pagination/style/pagination.css +1 -0
  206. package/lib/popup/index.js +800 -0
  207. package/lib/popup/style/css.js +0 -0
  208. package/lib/popup/style/index.js +0 -0
  209. package/lib/progress/index.js +1146 -0
  210. package/lib/progress/style/css.js +9 -0
  211. package/lib/progress/style/index.css +2226 -0
  212. package/lib/progress/style/index.js +9 -0
  213. package/lib/progress/style/progress.css +1 -0
  214. package/lib/radio/index.js +852 -0
  215. package/lib/radio/style/css.js +9 -0
  216. package/lib/radio/style/index.css +2381 -0
  217. package/lib/radio/style/index.js +9 -0
  218. package/lib/radio/style/radio.css +1 -0
  219. package/lib/select/index.js +836 -0
  220. package/lib/select/style/css.js +9 -0
  221. package/lib/select/style/index.css +2655 -0
  222. package/lib/select/style/index.js +9 -0
  223. package/lib/select/style/select.css +1 -0
  224. package/lib/slider/index.js +347 -0
  225. package/lib/slider/style/css.js +9 -0
  226. package/lib/slider/style/index.css +2233 -0
  227. package/lib/slider/style/index.js +9 -0
  228. package/lib/slider/style/slider.css +1 -0
  229. package/lib/slideshow/index.js +913 -0
  230. package/lib/slideshow/style/css.js +9 -0
  231. package/lib/slideshow/style/index.js +9 -0
  232. package/lib/slideshow/style/slideshow.css +1 -0
  233. package/lib/spin/index.js +357 -0
  234. package/lib/spin/style/css.js +9 -0
  235. package/lib/spin/style/index.css +2268 -0
  236. package/lib/spin/style/index.js +9 -0
  237. package/lib/spin/style/spin.css +1 -0
  238. package/lib/steps/index.js +748 -0
  239. package/lib/steps/style/css.js +9 -0
  240. package/lib/steps/style/index.css +2724 -0
  241. package/lib/steps/style/index.js +9 -0
  242. package/lib/steps/style/steps.css +1 -0
  243. package/lib/style.js +7 -0
  244. package/lib/switch/index.js +654 -0
  245. package/lib/switch/style/css.js +9 -0
  246. package/lib/switch/style/index.css +2241 -0
  247. package/lib/switch/style/index.js +9 -0
  248. package/lib/switch/style/switch.css +1 -0
  249. package/lib/table/index.js +810 -0
  250. package/lib/table/style/css.js +9 -0
  251. package/lib/table/style/index.css +2909 -0
  252. package/lib/table/style/index.js +9 -0
  253. package/lib/table/style/table.css +1 -0
  254. package/lib/table-popup/index.js +438 -0
  255. package/lib/table-popup/style/css.js +9 -0
  256. package/lib/table-popup/style/index.js +9 -0
  257. package/lib/table-popup/style/table-popup.css +1 -0
  258. package/lib/tabs/index.js +743 -0
  259. package/lib/tabs/style/css.js +9 -0
  260. package/lib/tabs/style/index.css +2692 -0
  261. package/lib/tabs/style/index.js +9 -0
  262. package/lib/tabs/style/tabs.css +1 -0
  263. package/lib/text/index.js +434 -0
  264. package/lib/text/style/css.js +7 -0
  265. package/lib/text/style/index.js +7 -0
  266. package/lib/text/style/text.css +1 -0
  267. package/lib/tile-layer/index.js +535 -0
  268. package/lib/tile-layer/style/css.js +0 -0
  269. package/lib/tile-layer/style/index.js +0 -0
  270. package/lib/time-line/index.js +654 -0
  271. package/lib/time-line/style/css.js +7 -0
  272. package/lib/time-line/style/index.js +7 -0
  273. package/lib/time-line/style/time-line.css +1 -0
  274. package/lib/time-picker/index.js +669 -0
  275. package/lib/time-picker/style/css.js +9 -0
  276. package/lib/time-picker/style/index.css +2418 -0
  277. package/lib/time-picker/style/index.js +9 -0
  278. package/lib/time-picker/style/time-picker.css +1 -0
  279. package/lib/time-range/index.js +526 -0
  280. package/lib/time-range/style/css.js +7 -0
  281. package/lib/time-range/style/index.js +7 -0
  282. package/lib/time-range/style/time-range.css +1 -0
  283. package/lib/time-slider/index.js +1169 -0
  284. package/lib/time-slider/style/css.js +7 -0
  285. package/lib/time-slider/style/index.js +7 -0
  286. package/lib/time-slider/style/time-slider.css +1 -0
  287. package/lib/time-text/index.js +393 -0
  288. package/lib/time-text/style/css.js +7 -0
  289. package/lib/time-text/style/index.js +7 -0
  290. package/lib/time-text/style/time-text.css +1 -0
  291. package/lib/tooltip/index.js +635 -0
  292. package/lib/tooltip/style/css.js +9 -0
  293. package/lib/tooltip/style/index.css +2231 -0
  294. package/lib/tooltip/style/index.js +9 -0
  295. package/lib/tooltip/style/tooltip.css +0 -0
  296. package/lib/transfer/index.js +636 -0
  297. package/lib/transfer/style/css.js +9 -0
  298. package/lib/transfer/style/index.css +2302 -0
  299. package/lib/transfer/style/index.js +9 -0
  300. package/lib/transfer/style/transfer.css +1 -0
  301. package/lib/tree/index.js +857 -0
  302. package/lib/tree/style/css.js +9 -0
  303. package/lib/tree/style/index.css +2644 -0
  304. package/lib/tree/style/index.js +9 -0
  305. package/lib/tree/style/tree.css +1 -0
  306. package/lib/tree-select/index.js +765 -0
  307. package/lib/tree-select/style/css.js +9 -0
  308. package/lib/tree-select/style/index.css +2508 -0
  309. package/lib/tree-select/style/index.js +9 -0
  310. package/lib/tree-select/style/tree-select.css +1 -0
  311. package/lib/video-player/index.js +1472 -0
  312. package/lib/video-player/style/css.js +11 -0
  313. package/lib/video-player/style/index.js +11 -0
  314. package/lib/video-player/style/video-player.css +1 -0
  315. package/lib/web-map/index.js +2241 -0
  316. package/lib/web-map/style/css.js +15 -0
  317. package/lib/web-map/style/index.js +15 -0
  318. package/lib/web-map/style/web-map.css +1 -0
  319. package/package.json +97 -0
  320. package/src/common/_assets/iconfont/icon-sm-components.css +245 -0
  321. package/src/common/_assets/iconfont/icon-sm-components.eot +0 -0
  322. package/src/common/_assets/iconfont/icon-sm-components.svg +197 -0
  323. package/src/common/_assets/iconfont/icon-sm-components.ttf +0 -0
  324. package/src/common/_assets/iconfont/icon-sm-components.woff +0 -0
  325. package/src/common/_assets/iconfont/icon-sm-components.woff2 +0 -0
  326. package/src/common/_lang/en.js +355 -0
  327. package/src/common/_lang/index.js +177 -0
  328. package/src/common/_lang/zh.js +342 -0
  329. package/src/common/_mixin/AntdRender.ts +114 -0
  330. package/src/common/_mixin/Card.ts +22 -0
  331. package/src/common/_mixin/Theme.ts +222 -0
  332. package/src/common/_mixin/ThirdService.ts +58 -0
  333. package/src/common/_mixin/Timer.ts +58 -0
  334. package/src/common/_mixin/VmUpdater.ts +46 -0
  335. package/src/common/_types/AddressMatchParameter.js +9 -0
  336. package/src/common/_types/GeoJSONParamter.ts +17 -0
  337. package/src/common/_types/RestDataParameter.js +8 -0
  338. package/src/common/_types/RestMapParameter.js +8 -0
  339. package/src/common/_types/RestParameter.js +12 -0
  340. package/src/common/_types/event/BaseTypes.js +24 -0
  341. package/src/common/_types/event/Event.js +315 -0
  342. package/src/common/_types/event/Events.js +353 -0
  343. package/src/common/_types/event/Pixel.js +177 -0
  344. package/src/common/_types/event/Util.js +173 -0
  345. package/src/common/_types/iPortalDataParameter.js +12 -0
  346. package/src/common/_types/iServerBaseParameter.ts +28 -0
  347. package/src/common/_types/iServerDataParameter.ts +13 -0
  348. package/src/common/_types/iServerMapParameter.ts +13 -0
  349. package/src/common/_utils/EchartsDataService.js +527 -0
  350. package/src/common/_utils/RestService.js +130 -0
  351. package/src/common/_utils/WebMapService.ts +1292 -0
  352. package/src/common/_utils/epsg-define.js +55 -0
  353. package/src/common/_utils/get-features.js +92 -0
  354. package/src/common/_utils/global-event.js +6 -0
  355. package/src/common/_utils/iPortalDataService.js +444 -0
  356. package/src/common/_utils/iServerRestService.js +487 -0
  357. package/src/common/_utils/statistics.js +36 -0
  358. package/src/common/_utils/style/color/colorPalette.ts +63 -0
  359. package/src/common/_utils/style/color/serialColors.ts +207 -0
  360. package/src/common/_utils/style/common/common.scss +39 -0
  361. package/src/common/_utils/style/mixins/config.scss +4 -0
  362. package/src/common/_utils/style/mixins/mixins.scss +48 -0
  363. package/src/common/_utils/style/theme/antd.less +2 -0
  364. package/src/common/_utils/style/theme/antdVar.less +371 -0
  365. package/src/common/_utils/style/theme/chart.js +548 -0
  366. package/src/common/_utils/style/theme/set-theme.ts +43 -0
  367. package/src/common/_utils/style/theme/theme.json +356 -0
  368. package/src/common/_utils/style/theme/theme.scss +495 -0
  369. package/src/common/_utils/util.js +251 -0
  370. package/src/common/_utils/vue-types/index.js +267 -0
  371. package/src/common/_utils/vue-types/utils.js +194 -0
  372. package/src/common/avatar/Avatar.vue +41 -0
  373. package/src/common/avatar/index.js +9 -0
  374. package/src/common/avatar/style/avatar.scss +8 -0
  375. package/src/common/avatar/style/index.js +4 -0
  376. package/src/common/avatar/style/index.less +3 -0
  377. package/src/common/border/Border.vue +121 -0
  378. package/src/common/border/assets/border.config.json +67 -0
  379. package/src/common/border/assets/image/border1.png +0 -0
  380. package/src/common/border/assets/image/border10.png +0 -0
  381. package/src/common/border/assets/image/border11.png +0 -0
  382. package/src/common/border/assets/image/border12.png +0 -0
  383. package/src/common/border/assets/image/border13.png +0 -0
  384. package/src/common/border/assets/image/border2.png +0 -0
  385. package/src/common/border/assets/image/border3.png +0 -0
  386. package/src/common/border/assets/image/border4.png +0 -0
  387. package/src/common/border/assets/image/border5.png +0 -0
  388. package/src/common/border/assets/image/border6.png +0 -0
  389. package/src/common/border/assets/image/border7.png +0 -0
  390. package/src/common/border/assets/image/border8.png +0 -0
  391. package/src/common/border/assets/image/border9.png +0 -0
  392. package/src/common/border/index.js +9 -0
  393. package/src/common/border/style/border.scss +19 -0
  394. package/src/common/border/style/index.js +4 -0
  395. package/src/common/breadcrumb/Breadcrumb.vue +21 -0
  396. package/src/common/breadcrumb/BreadcrumbItem.vue +21 -0
  397. package/src/common/breadcrumb/BreadcrumbSeparator.vue +19 -0
  398. package/src/common/breadcrumb/index.js +13 -0
  399. package/src/common/breadcrumb/style/breadcrumb.scss +21 -0
  400. package/src/common/breadcrumb/style/index.js +4 -0
  401. package/src/common/breadcrumb/style/index.less +3 -0
  402. package/src/common/button/Button.vue +34 -0
  403. package/src/common/button/Group.vue +31 -0
  404. package/src/common/button/index.js +11 -0
  405. package/src/common/button/style/button.scss +91 -0
  406. package/src/common/button/style/index.js +4 -0
  407. package/src/common/button/style/index.less +3 -0
  408. package/src/common/button/style/mixin.scss +56 -0
  409. package/src/common/card/Card.vue +32 -0
  410. package/src/common/card/Grid.vue +20 -0
  411. package/src/common/card/Meta.vue +20 -0
  412. package/src/common/card/index.js +13 -0
  413. package/src/common/card/style/card.scss +43 -0
  414. package/src/common/card/style/index.js +4 -0
  415. package/src/common/card/style/index.less +3 -0
  416. package/src/common/chart/ChartMixin.vue +1572 -0
  417. package/src/common/chart/index.js +9 -0
  418. package/src/common/chart/style/chart.scss +10 -0
  419. package/src/common/chart/style/index.js +5 -0
  420. package/src/common/checkbox/Checkbox.vue +37 -0
  421. package/src/common/checkbox/Group.vue +36 -0
  422. package/src/common/checkbox/index.js +11 -0
  423. package/src/common/checkbox/style/checkbox.scss +40 -0
  424. package/src/common/checkbox/style/index.js +4 -0
  425. package/src/common/checkbox/style/index.less +3 -0
  426. package/src/common/collapse/Collapse.vue +32 -0
  427. package/src/common/collapse/Panel.vue +26 -0
  428. package/src/common/collapse/index.js +11 -0
  429. package/src/common/collapse/style/collapse.scss +10 -0
  430. package/src/common/collapse/style/index.js +4 -0
  431. package/src/common/collapse/style/index.less +3 -0
  432. package/src/common/collapse-card/CollapseCard.vue +150 -0
  433. package/src/common/collapse-card/index.js +9 -0
  434. package/src/common/collapse-card/style/collapse-card.scss +176 -0
  435. package/src/common/collapse-card/style/index.js +4 -0
  436. package/src/common/color-picker/ColorPicker.vue +106 -0
  437. package/src/common/color-picker/index.js +9 -0
  438. package/src/common/color-picker/style/color-picker.scss +37 -0
  439. package/src/common/color-picker/style/index.js +4 -0
  440. package/src/common/config-provider/ConfigProvider.vue +31 -0
  441. package/src/common/config-provider/index.js +9 -0
  442. package/src/common/date-picker/BaseMixin.vue +23 -0
  443. package/src/common/date-picker/DatePicker.vue +20 -0
  444. package/src/common/date-picker/MonthPicker.vue +20 -0
  445. package/src/common/date-picker/RangePicker.vue +20 -0
  446. package/src/common/date-picker/WeekPicker.vue +20 -0
  447. package/src/common/date-picker/index.js +15 -0
  448. package/src/common/date-picker/style/date-picker.scss +290 -0
  449. package/src/common/date-picker/style/index.js +4 -0
  450. package/src/common/date-picker/style/index.less +3 -0
  451. package/src/common/date-picker/style/mixin.scss +75 -0
  452. package/src/common/dropdown/Dropdown.vue +31 -0
  453. package/src/common/dropdown/index.js +9 -0
  454. package/src/common/dropdown/style/dropdown.scss +22 -0
  455. package/src/common/dropdown/style/index.js +4 -0
  456. package/src/common/dropdown/style/index.less +3 -0
  457. package/src/common/empty/Empty.vue +26 -0
  458. package/src/common/empty/RenderEmpty.ts +50 -0
  459. package/src/common/empty/assets/image/empty.png +0 -0
  460. package/src/common/empty/index.js +9 -0
  461. package/src/common/empty/style/empty.scss +31 -0
  462. package/src/common/empty/style/index.js +4 -0
  463. package/src/common/empty/style/index.less +3 -0
  464. package/src/common/icon/Icon.vue +66 -0
  465. package/src/common/icon/index.js +9 -0
  466. package/src/common/icon/style/icon.scss +12 -0
  467. package/src/common/icon/style/index.js +4 -0
  468. package/src/common/icon/style/index.less +3 -0
  469. package/src/common/iframe/Iframe.vue +17 -0
  470. package/src/common/iframe/index.js +9 -0
  471. package/src/common/iframe/style/iframe.scss +7 -0
  472. package/src/common/iframe/style/index.js +4 -0
  473. package/src/common/image/Image.vue +83 -0
  474. package/src/common/image/index.js +9 -0
  475. package/src/common/image/style/image.scss +33 -0
  476. package/src/common/image/style/index.js +4 -0
  477. package/src/common/indicator/CountTo.vue +92 -0
  478. package/src/common/indicator/Indicator.vue +308 -0
  479. package/src/common/indicator/index.js +11 -0
  480. package/src/common/indicator/style/countTo.scss +7 -0
  481. package/src/common/indicator/style/index.js +4 -0
  482. package/src/common/indicator/style/indicator.scss +47 -0
  483. package/src/common/input/BaseMixin.vue +24 -0
  484. package/src/common/input/Group.vue +31 -0
  485. package/src/common/input/Input.vue +41 -0
  486. package/src/common/input/Password.vue +41 -0
  487. package/src/common/input/Search.vue +40 -0
  488. package/src/common/input/TextArea.vue +25 -0
  489. package/src/common/input/index.js +17 -0
  490. package/src/common/input/style/index.js +4 -0
  491. package/src/common/input/style/index.less +3 -0
  492. package/src/common/input/style/input.scss +72 -0
  493. package/src/common/input/style/mixin.scss +42 -0
  494. package/src/common/input-number/InputNumber.vue +44 -0
  495. package/src/common/input-number/index.js +9 -0
  496. package/src/common/input-number/style/index.js +4 -0
  497. package/src/common/input-number/style/index.less +3 -0
  498. package/src/common/input-number/style/input-number.scss +43 -0
  499. package/src/common/layout/Content.vue +25 -0
  500. package/src/common/layout/Footer.vue +25 -0
  501. package/src/common/layout/Header.vue +25 -0
  502. package/src/common/layout/Layout.vue +25 -0
  503. package/src/common/layout/Sider.vue +33 -0
  504. package/src/common/layout/index.js +17 -0
  505. package/src/common/layout/style/index.js +4 -0
  506. package/src/common/layout/style/index.less +3 -0
  507. package/src/common/layout/style/layout.scss +5 -0
  508. package/src/common/liquid-fill/LiquidFill.vue +209 -0
  509. package/src/common/liquid-fill/index.js +9 -0
  510. package/src/common/liquid-fill/style/index.js +4 -0
  511. package/src/common/liquid-fill/style/liquid-fill.scss +6 -0
  512. package/src/common/menu/Menu.vue +31 -0
  513. package/src/common/menu/MenuItem.vue +37 -0
  514. package/src/common/menu/SubMenu.vue +51 -0
  515. package/src/common/menu/index.js +13 -0
  516. package/src/common/menu/style/index.js +4 -0
  517. package/src/common/menu/style/index.less +3 -0
  518. package/src/common/menu/style/menu.scss +0 -0
  519. package/src/common/message/Message.js +12 -0
  520. package/src/common/message/index.js +3 -0
  521. package/src/common/message/style/index.js +4 -0
  522. package/src/common/message/style/index.less +3 -0
  523. package/src/common/message/style/message.scss +16 -0
  524. package/src/common/modal/Modal.vue +64 -0
  525. package/src/common/modal/index.js +9 -0
  526. package/src/common/modal/main.ts +49 -0
  527. package/src/common/modal/style/index.js +4 -0
  528. package/src/common/modal/style/index.less +3 -0
  529. package/src/common/modal/style/modal.scss +23 -0
  530. package/src/common/nav/Nav.vue +158 -0
  531. package/src/common/nav/assets/image/background_image.png +0 -0
  532. package/src/common/nav/assets/image/item_active.png +0 -0
  533. package/src/common/nav/index.js +9 -0
  534. package/src/common/nav/style/index.js +5 -0
  535. package/src/common/nav/style/nav.scss +55 -0
  536. package/src/common/notification/Notification.js +10 -0
  537. package/src/common/notification/index.js +3 -0
  538. package/src/common/notification/style/index.js +4 -0
  539. package/src/common/notification/style/index.less +3 -0
  540. package/src/common/notification/style/notification.scss +30 -0
  541. package/src/common/pagination/Pagination.vue +32 -0
  542. package/src/common/pagination/index.js +9 -0
  543. package/src/common/pagination/style/index.js +4 -0
  544. package/src/common/pagination/style/index.less +3 -0
  545. package/src/common/pagination/style/pagination.scss +131 -0
  546. package/src/common/progress/Progress.vue +98 -0
  547. package/src/common/progress/index.js +9 -0
  548. package/src/common/progress/style/index.js +4 -0
  549. package/src/common/progress/style/index.less +3 -0
  550. package/src/common/progress/style/progress.scss +43 -0
  551. package/src/common/radio/Button.vue +18 -0
  552. package/src/common/radio/Group.vue +48 -0
  553. package/src/common/radio/Radio.vue +36 -0
  554. package/src/common/radio/index.js +13 -0
  555. package/src/common/radio/style/index.js +4 -0
  556. package/src/common/radio/style/index.less +3 -0
  557. package/src/common/radio/style/radio.scss +127 -0
  558. package/src/common/select/OptGroup.vue +20 -0
  559. package/src/common/select/Option.vue +22 -0
  560. package/src/common/select/Select.vue +49 -0
  561. package/src/common/select/index.js +13 -0
  562. package/src/common/select/style/index.js +4 -0
  563. package/src/common/select/style/index.less +3 -0
  564. package/src/common/select/style/select.scss +140 -0
  565. package/src/common/slider/Slider.vue +31 -0
  566. package/src/common/slider/index.js +9 -0
  567. package/src/common/slider/style/index.js +4 -0
  568. package/src/common/slider/style/index.less +3 -0
  569. package/src/common/slider/style/slider.scss +8 -0
  570. package/src/common/slideshow/Slideshow.vue +354 -0
  571. package/src/common/slideshow/SlideshowItem.vue +17 -0
  572. package/src/common/slideshow/Swiper.js +29 -0
  573. package/src/common/slideshow/index.js +11 -0
  574. package/src/common/slideshow/style/index.js +5 -0
  575. package/src/common/slideshow/style/slideshow.scss +48 -0
  576. package/src/common/spin/Spin.vue +17 -0
  577. package/src/common/spin/index.js +9 -0
  578. package/src/common/spin/main.ts +13 -0
  579. package/src/common/spin/style/index.js +4 -0
  580. package/src/common/spin/style/index.less +3 -0
  581. package/src/common/spin/style/spin.scss +14 -0
  582. package/src/common/steps/Step.vue +33 -0
  583. package/src/common/steps/Steps.vue +39 -0
  584. package/src/common/steps/index.js +11 -0
  585. package/src/common/steps/style/index.js +4 -0
  586. package/src/common/steps/style/index.less +3 -0
  587. package/src/common/steps/style/mixin.scss +67 -0
  588. package/src/common/steps/style/steps.scss +98 -0
  589. package/src/common/switch/Switch.vue +41 -0
  590. package/src/common/switch/index.js +9 -0
  591. package/src/common/switch/style/index.js +4 -0
  592. package/src/common/switch/style/index.less +3 -0
  593. package/src/common/switch/style/switch.scss +20 -0
  594. package/src/common/table/Column.vue +18 -0
  595. package/src/common/table/ColumnGroup.vue +19 -0
  596. package/src/common/table/Table.vue +18 -0
  597. package/src/common/table/index.js +13 -0
  598. package/src/common/table/style/index.js +4 -0
  599. package/src/common/table/style/index.less +3 -0
  600. package/src/common/table/style/table.scss +138 -0
  601. package/src/common/table-popup/TablePopup.vue +73 -0
  602. package/src/common/table-popup/index.js +9 -0
  603. package/src/common/table-popup/style/index.js +5 -0
  604. package/src/common/table-popup/style/table-popup.scss +52 -0
  605. package/src/common/tabs/TabPane.vue +26 -0
  606. package/src/common/tabs/Tabs.vue +41 -0
  607. package/src/common/tabs/index.js +11 -0
  608. package/src/common/tabs/style/index.js +4 -0
  609. package/src/common/tabs/style/index.less +3 -0
  610. package/src/common/tabs/style/tabs.scss +95 -0
  611. package/src/common/text/Text.vue +69 -0
  612. package/src/common/text/index.js +9 -0
  613. package/src/common/text/style/index.js +4 -0
  614. package/src/common/text/style/text.scss +23 -0
  615. package/src/common/time-line/TimeLine.vue +260 -0
  616. package/src/common/time-line/index.js +9 -0
  617. package/src/common/time-line/style/index.js +4 -0
  618. package/src/common/time-line/style/time-line.scss +10 -0
  619. package/src/common/time-picker/TimePicker.vue +47 -0
  620. package/src/common/time-picker/index.js +9 -0
  621. package/src/common/time-picker/style/index.js +4 -0
  622. package/src/common/time-picker/style/index.less +3 -0
  623. package/src/common/time-picker/style/time-picker.scss +69 -0
  624. package/src/common/time-range/TimeRange.vue +122 -0
  625. package/src/common/time-range/index.js +9 -0
  626. package/src/common/time-range/style/index.js +4 -0
  627. package/src/common/time-range/style/time-range.scss +10 -0
  628. package/src/common/time-slider/TimeSlider.vue +591 -0
  629. package/src/common/time-slider/index.js +9 -0
  630. package/src/common/time-slider/style/index.js +4 -0
  631. package/src/common/time-slider/style/mixin.scss +36 -0
  632. package/src/common/time-slider/style/time-slider.scss +147 -0
  633. package/src/common/time-text/TimeText.vue +51 -0
  634. package/src/common/time-text/index.js +9 -0
  635. package/src/common/time-text/style/index.js +4 -0
  636. package/src/common/time-text/style/time-text.scss +14 -0
  637. package/src/common/tooltip/Tooltip.vue +21 -0
  638. package/src/common/tooltip/index.js +9 -0
  639. package/src/common/tooltip/style/index.js +4 -0
  640. package/src/common/tooltip/style/index.less +3 -0
  641. package/src/common/tooltip/style/tooltip.scss +5 -0
  642. package/src/common/transfer/Transfer.vue +19 -0
  643. package/src/common/transfer/index.js +9 -0
  644. package/src/common/transfer/style/index.js +4 -0
  645. package/src/common/transfer/style/index.less +3 -0
  646. package/src/common/transfer/style/transfer.scss +52 -0
  647. package/src/common/tree/DirectoryTree.vue +32 -0
  648. package/src/common/tree/Tree.vue +32 -0
  649. package/src/common/tree/TreeNode.vue +49 -0
  650. package/src/common/tree/index.js +13 -0
  651. package/src/common/tree/style/index.js +4 -0
  652. package/src/common/tree/style/index.less +3 -0
  653. package/src/common/tree/style/tree.scss +16 -0
  654. package/src/common/tree-select/TreeSelect.vue +43 -0
  655. package/src/common/tree-select/TreeSelectNode.vue +49 -0
  656. package/src/common/tree-select/index.js +11 -0
  657. package/src/common/tree-select/style/index.js +4 -0
  658. package/src/common/tree-select/style/index.less +3 -0
  659. package/src/common/tree-select/style/tree-select.scss +38 -0
  660. package/src/common/video-player/VideoPlayer.vue +423 -0
  661. package/src/common/video-player/index.js +9 -0
  662. package/src/common/video-player/style/index.js +5 -0
  663. package/src/common/video-player/style/video-player.scss +266 -0
  664. package/src/common/web-map/WebMapBase.ts +1178 -0
  665. package/src/common/web-map/config/MunicipalCenter.json +1 -0
  666. package/src/common/web-map/config/ProvinceCenter.json +1 -0
  667. package/src/image.d.ts +7 -0
  668. package/src/init.js +38 -0
  669. package/src/leaflet/README.md +31 -0
  670. package/src/leaflet/_mixin/GridLayer.js +33 -0
  671. package/src/leaflet/_mixin/Layer.js +26 -0
  672. package/src/leaflet/_mixin/Options.js +10 -0
  673. package/src/leaflet/_mixin/Popper.js +25 -0
  674. package/src/leaflet/_mixin/TileLayer.js +18 -0
  675. package/src/leaflet/_mixin/map-getter.ts +122 -0
  676. package/src/leaflet/_types/index.js +17 -0
  677. package/src/leaflet/_types/map-event.js +34 -0
  678. package/src/leaflet/_utils/props-binder.js +23 -0
  679. package/src/leaflet/chart/Chart.vue +25 -0
  680. package/src/leaflet/chart/ChartViewModel.js +44 -0
  681. package/src/leaflet/chart/index.js +9 -0
  682. package/src/leaflet/components.ts +206 -0
  683. package/src/leaflet/css.js +3 -0
  684. package/src/leaflet/entrys.json +106 -0
  685. package/src/leaflet/identify/Identify.vue +233 -0
  686. package/src/leaflet/identify/IdentifyViewModel.js +114 -0
  687. package/src/leaflet/identify/index.js +9 -0
  688. package/src/leaflet/identify/style/identify.scss +30 -0
  689. package/src/leaflet/identify/style/index.js +4 -0
  690. package/src/leaflet/index.ts +5 -0
  691. package/src/leaflet/leaflet-wrapper.js +125 -0
  692. package/src/leaflet/marker/Marker.vue +46 -0
  693. package/src/leaflet/marker/MarkerViewModel.js +31 -0
  694. package/src/leaflet/marker/index.js +9 -0
  695. package/src/leaflet/package.json +97 -0
  696. package/src/leaflet/popup/Popup.vue +93 -0
  697. package/src/leaflet/popup/PopupViewModel.js +75 -0
  698. package/src/leaflet/popup/index.js +9 -0
  699. package/src/leaflet/style.js +3 -0
  700. package/src/leaflet/style.scss +52 -0
  701. package/src/leaflet/web-map/WebMap.vue +213 -0
  702. package/src/leaflet/web-map/WebMapViewModel.ts +1102 -0
  703. package/src/leaflet/web-map/_mixin/map-events.ts +65 -0
  704. package/src/leaflet/web-map/index.js +9 -0
  705. package/src/leaflet/web-map/layer/tile/TileLayer.vue +88 -0
  706. package/src/leaflet/web-map/layer/tile/TileLayerViewModel.js +66 -0
  707. package/src/leaflet/web-map/layer/tile/index.js +9 -0
  708. package/src/leaflet/web-map/style/index.js +7 -0
  709. package/src/leaflet/web-map/style/web-map.scss +32 -0
  710. package/src/sfc.d.ts +50 -0
  711. package/src/vue-i18n.d.ts +26 -0
  712. package/src/vue-options.d.ts +18 -0
  713. package/static/libs/echarts-layer/EchartsLayer.js +390 -0
  714. package/static/libs/geostats/geostats.js +1227 -0
  715. package/static/libs/iclient-common/iclient-common.js +2 -0
  716. package/static/libs/iclient-leaflet/iclient-leaflet.min.css +8 -0
  717. package/static/libs/iclient-leaflet/iclient-leaflet.min.js +1741 -0
  718. package/static/libs/json-sql/jsonsql.js +125 -0
  719. package/tsconfig.json +43 -0
@@ -0,0 +1,1572 @@
1
+ <template>
2
+ <sm-collapse-card
3
+ v-show="isShow"
4
+ :icon-class="iconClass"
5
+ :icon-position="position"
6
+ :header-name="headerName"
7
+ :auto-rotate="autoRotate"
8
+ :collapsed="collapsed"
9
+ :split-line="splitLine"
10
+ class="sm-component-chart"
11
+ >
12
+ <v-chart
13
+ :id="chartId"
14
+ :ref="chartId"
15
+ :options="_chartOptions"
16
+ :initOptions="initOptions"
17
+ :group="group"
18
+ :manual-update="manualUpdate"
19
+ :theme="theme || chartTheme"
20
+ :style="_chartStyle"
21
+ @datazoom="dataZoomHandler"
22
+ />
23
+ <TablePopup
24
+ v-show="false"
25
+ ref="chartTablePopup"
26
+ v-bind="tablePopupProps"
27
+ :split-line="splitLine"
28
+ :text-color="textColor"
29
+ :background="background"
30
+ />
31
+ </sm-collapse-card>
32
+ </template>
33
+ <script>
34
+ import 'echarts';
35
+ import ECharts from 'vue-echarts';
36
+ import UniqueId from 'lodash.uniqueid';
37
+ import merge from 'lodash.merge';
38
+ import isEqual from 'lodash.isequal';
39
+ import debounce from 'lodash.debounce';
40
+ import cloneDeep from 'lodash.clonedeep';
41
+ import Card from 'vue-iclient/src/common/_mixin/Card';
42
+ import Theme from 'vue-iclient/src/common/_mixin/Theme';
43
+ import Timer from 'vue-iclient/src/common/_mixin/Timer';
44
+ import { chartThemeUtil, handleMultiGradient, getMultiColorGroup } from 'vue-iclient/src/common/_utils/style/theme/chart';
45
+ import EchartsDataService from 'vue-iclient/src/common/_utils/EchartsDataService';
46
+ import { getFeatureCenter, getColorWithOpacity, setPopupArrowStyle } from 'vue-iclient/src/common/_utils/util';
47
+ import { ColorsPickerUtil } from 'vue-iclient/static/libs/iclient-common/iclient-common';
48
+ import TablePopup from 'vue-iclient/src/common/table-popup/TablePopup.vue';
49
+ import Message from 'vue-iclient/src/common/message/index.js';
50
+ import { addListener, removeListener } from 'resize-detector';
51
+
52
+ // 枚举事件类型
53
+ const EVENTS = [
54
+ 'legendselectchanged',
55
+ 'legendselected',
56
+ 'legendunselected',
57
+ 'legendscroll',
58
+ 'datazoom',
59
+ 'datarangeselected',
60
+ 'timelinechanged',
61
+ 'timelineplaychanged',
62
+ 'restore',
63
+ 'dataviewchanged',
64
+ 'magictypechanged',
65
+ 'geoselectchanged',
66
+ 'geoselected',
67
+ 'geounselected',
68
+ 'pieselectchanged',
69
+ 'pieselected',
70
+ 'pieunselected',
71
+ 'mapselectchanged',
72
+ 'mapselected',
73
+ 'mapunselected',
74
+ 'axisareaselected',
75
+ 'focusnodeadjacency',
76
+ 'unfocusnodeadjacency',
77
+ 'brush',
78
+ 'brushselected',
79
+ 'rendered',
80
+ 'finished',
81
+ 'click',
82
+ 'dblclick',
83
+ 'mouseover',
84
+ 'mouseout',
85
+ 'mousemove',
86
+ 'mousedown',
87
+ 'mouseup',
88
+ 'globalout',
89
+ 'contextmenu'
90
+ ];
91
+
92
+ export default {
93
+ components: {
94
+ 'v-chart': ECharts,
95
+ TablePopup
96
+ },
97
+ mixins: [Theme, Card, Timer],
98
+ props: {
99
+ iconClass: {
100
+ type: String,
101
+ default: 'sm-components-icon-chart'
102
+ },
103
+ dataset: {
104
+ type: Object,
105
+ default() {
106
+ return null;
107
+ }
108
+ },
109
+ datasetOptions: {
110
+ type: Array,
111
+ default() {
112
+ return null;
113
+ }
114
+ },
115
+ colorGroup: {
116
+ type: Array
117
+ },
118
+ options: {
119
+ type: Object,
120
+ default() {
121
+ return {};
122
+ }
123
+ },
124
+ autoresize: {
125
+ type: Boolean,
126
+ default: true
127
+ },
128
+ theme: {
129
+ type: [Object, String]
130
+ },
131
+ initOptions: {
132
+ type: Object
133
+ },
134
+ group: {
135
+ type: String
136
+ },
137
+ manualUpdate: {
138
+ type: Boolean,
139
+ default: false
140
+ },
141
+ autoPlay: {
142
+ type: Boolean,
143
+ default: false
144
+ },
145
+ associatedMap: {
146
+ type: Boolean,
147
+ default: false
148
+ },
149
+ highlightOptions: {
150
+ type: Array,
151
+ default() {
152
+ return [];
153
+ }
154
+ },
155
+ highlightColor: {
156
+ type: String,
157
+ default: '#01ffff'
158
+ },
159
+ isShow: {
160
+ type: Boolean,
161
+ default: true
162
+ }
163
+ },
164
+ data() {
165
+ return {
166
+ chartId: UniqueId(`${this.$options.name.toLowerCase()}-`),
167
+ chartTheme: {}, // 图表的主题
168
+ echartOptions: {}, // 最后生成的echart数据
169
+ datasetChange: false, // dataset是否改变
170
+ dataSeriesCache: {},
171
+ tablePopupProps: {},
172
+ startSpin: null,
173
+ customSeries: [],
174
+ dataZoomHandler: function () {}
175
+ };
176
+ },
177
+ computed: {
178
+ width() {
179
+ return this.smChart && this.smChart.width;
180
+ },
181
+ height() {
182
+ return this.smChart && this.smChart.height;
183
+ },
184
+ computedOptions() {
185
+ return this.smChart && this.smChart.computedOptions;
186
+ },
187
+ _chartStyle() {
188
+ return {
189
+ width: '100%',
190
+ height: this.headerName ? 'calc(100% - 30px)' : '100%'
191
+ };
192
+ },
193
+ parseOptions() {
194
+ if (!this.options.series) {
195
+ return this.options;
196
+ }
197
+ if (this.options.series.find(item => item.type === '2.5Bar')) {
198
+ return {
199
+ ...this.options,
200
+ series: []
201
+ };
202
+ }
203
+ if (this.options.series[0] && this.options.series[0].customType === 'customRingsSeries') {
204
+ return {
205
+ ...this.options,
206
+ series: [...this.options.series, ...this.customSeries]
207
+ };
208
+ }
209
+ let series = this.options.series.map(serie => {
210
+ if (serie.label) {
211
+ let cloneSerie = cloneDeep(serie);
212
+ cloneSerie.label.normal = this._controlLabel(cloneSerie.label.normal, cloneSerie.maxLabels);
213
+ return cloneSerie;
214
+ }
215
+ return serie;
216
+ });
217
+ return {
218
+ ...this.options,
219
+ series
220
+ };
221
+ },
222
+ _chartOptions() {
223
+ return (this._isRequestData && this.echartOptions) || this.parseOptions;
224
+ },
225
+ // 是否传入dataset和datasetOptions
226
+ _isRequestData() {
227
+ return (
228
+ this.dataset &&
229
+ Object.keys(this.dataset).length > 0 &&
230
+ (this.dataset.url || this.dataset.geoJSON) &&
231
+ this.datasetOptions &&
232
+ this.datasetOptions.length > 0
233
+ );
234
+ },
235
+ xBar() {
236
+ return this.options && this.options.yAxis && this.options.yAxis.type === 'category';
237
+ },
238
+ colorNumber() {
239
+ let length =
240
+ (this.datasetOptions && this.datasetOptions.length) ||
241
+ (this.echartOptions.series && this.echartOptions.series.length);
242
+ let colorNumber = this.colorGroupsData.length;
243
+ if (length && length > colorNumber) {
244
+ colorNumber = length;
245
+ }
246
+ return colorNumber;
247
+ }
248
+ },
249
+ watch: {
250
+ theme() {
251
+ this.chartTheme = null;
252
+ },
253
+ colorGroupsData(newVal, oldVal) {
254
+ if (!isEqual(newVal, oldVal)) {
255
+ this._setChartTheme();
256
+ }
257
+ },
258
+ textColorsData(newVal, oldVal) {
259
+ if (!isEqual(newVal, oldVal)) {
260
+ this._setChartTheme();
261
+ }
262
+ },
263
+ getBackground(newVal, oldVal) {
264
+ if (!isEqual(newVal, oldVal)) {
265
+ this._setChartTheme();
266
+ }
267
+ },
268
+ dataset: {
269
+ handler: function () {
270
+ this._isRequestData && this._setEchartOptions(this.dataset, this.datasetOptions, this.options);
271
+ this.datasetChange = true;
272
+ },
273
+ deep: true
274
+ },
275
+ datasetOptions: {
276
+ handler: function (newVal, oldVal) {
277
+ if (!isEqual(newVal, oldVal)) {
278
+ this._setChartTheme();
279
+ this.registerShape();
280
+ }
281
+ !this.echartsDataService &&
282
+ this._isRequestData &&
283
+ this._setEchartOptions(this.dataset, this.datasetOptions, this.options);
284
+ this.echartsDataService && this.echartsDataService.setDatasetOptions(this.datasetOptions);
285
+ this.echartsDataService &&
286
+ this.dataSeriesCache &&
287
+ this._changeChartData(this.echartsDataService, this.datasetOptions, this.options);
288
+ }
289
+ },
290
+ options: {
291
+ handler: function () {
292
+ if (this.datasetChange && !this.dataSeriesCache) {
293
+ return;
294
+ }
295
+ if (this.dataSeriesCache && JSON.stringify(this.dataSeriesCache) !== '{}') {
296
+ this.echartOptions = this._optionsHandler(this.options, this.dataSeriesCache);
297
+ } else {
298
+ this.echartOptions = Object.assign({}, this.parseOptions);
299
+ }
300
+ },
301
+ deep: true
302
+ },
303
+ autoresize() {
304
+ if (this.autoresize) {
305
+ addListener(this.$el, this.__resizeHandler);
306
+ } else {
307
+ removeListener(this.$el, this.__resizeHandler);
308
+ }
309
+ },
310
+ autoPlay() {
311
+ this._handlePieAutoPlay();
312
+ },
313
+ associatedMap() {
314
+ if (!this.associatedMap) {
315
+ this.clearPopup && this.clearPopup();
316
+ }
317
+ },
318
+ highlightOptions: {
319
+ handler() {
320
+ this.setItemStyleColor();
321
+ },
322
+ deep: true
323
+ }
324
+ },
325
+ created() {
326
+ this._setChartTheme();
327
+ // // 切换主题
328
+ // this.$on('theme-style-changed', () => {
329
+ // this._setChartTheme();
330
+ // });
331
+ this.registerShape();
332
+ },
333
+ mounted() {
334
+ // 设置echarts实例
335
+ this.smChart = this.$refs[this.chartId];
336
+ // 派发echart所有事件
337
+ let smChart = this._getEchart();
338
+ const self = this;
339
+ EVENTS.forEach(event => {
340
+ smChart.$on(event, params => {
341
+ if (event === 'click') {
342
+ self.handleChartClick(params);
343
+ }
344
+ self.$emit(event, params);
345
+ });
346
+ });
347
+ this._initAutoResize();
348
+ this._initDataZoom();
349
+ if (this.options.series && this.options.series[0] && this.options.series[0].customType === 'customRingsSeries') {
350
+ this.startEffect();
351
+ }
352
+ !this._isRequestData && this.autoPlay && this._handlePieAutoPlay();
353
+ // 请求数据, 合并echartopiton, 设置echartOptions
354
+ this._isRequestData && this._setEchartOptions(this.dataset, this.datasetOptions, this.options);
355
+ },
356
+ updated() {
357
+ this._handlePieAutoPlay(); // 更新自动播放
358
+ },
359
+ beforeDestroy() {
360
+ clearInterval(this.pieAutoPlay); // clear 自动播放
361
+ clearInterval(this.startAngle);
362
+ if (this.autoresize) {
363
+ removeListener(this.$el, this.__resizeHandler);
364
+ }
365
+ },
366
+ methods: {
367
+ _initAutoResize() {
368
+ this.__resizeHandler = debounce(
369
+ () => {
370
+ this.resize();
371
+ },
372
+ 100,
373
+ { leading: true }
374
+ );
375
+ if (this.autoresize) {
376
+ // @ts-ignore
377
+ addListener(this.$el, this.__resizeHandler);
378
+ }
379
+ },
380
+ _initDataZoom() {
381
+ this.dataZoomHandler = debounce(
382
+ () => {
383
+ this._dataZoomChanged();
384
+ },
385
+ 500,
386
+ { leading: true }
387
+ );
388
+ },
389
+ getStringColor(color) {
390
+ if (color instanceof Object) {
391
+ return ((color.colorStops || [])[0] || {}).color;
392
+ }
393
+ return color;
394
+ },
395
+ setGradientColor(color, nextColor) {
396
+ if (typeof color === 'string') {
397
+ return new this.$options.graphic.LinearGradient(0, 0, 0, 1, [
398
+ { offset: 0, color },
399
+ { offset: 1, color: nextColor || color }
400
+ ]);
401
+ }
402
+ return color;
403
+ },
404
+ _initAxisLabel(axisLabel, data, visualMap, series) {
405
+ if (!this.xBar) {
406
+ return;
407
+ }
408
+ const sortSeriesIndex = this.datasetOptions.findIndex(item => item.sort !== 'unsort' && item.rankLabel);
409
+ if (sortSeriesIndex > -1 && axisLabel && data) {
410
+ const orderNumLength = data.length.toString().length;
411
+ for (let index = 0, len = data.length, rankIndex = len - 1; index < len; index++, rankIndex--) {
412
+ const paddedNumber = rankIndex.toString().padStart(orderNumLength, '0');
413
+ data[index] = `${paddedNumber}${data[index]}`;
414
+ }
415
+ const firstVisualMap = visualMap && visualMap.find(item => item.seriesIndex === sortSeriesIndex);
416
+ axisLabel.rich = axisLabel.rich || {};
417
+ axisLabel.rich.default = {
418
+ backgroundColor: this.getStringColor(this.colorGroup[sortSeriesIndex]),
419
+ width: 20,
420
+ height: 20,
421
+ align: 'center',
422
+ borderRadius: 2
423
+ };
424
+ firstVisualMap &&
425
+ firstVisualMap.pieces.forEach((item, index) => {
426
+ axisLabel.rich[`color_${index}`] = {
427
+ backgroundColor: item.color,
428
+ width: 20,
429
+ height: 20,
430
+ align: 'center',
431
+ borderRadius: 2
432
+ };
433
+ });
434
+ const serieData = series && series[sortSeriesIndex].data;
435
+ axisLabel.formatter = function (label, index) {
436
+ const orderNum = parseInt(label.slice(0, orderNumLength)) + 1;
437
+ const leftLabel = label.slice(orderNumLength);
438
+ const labelValue = serieData && +serieData[index];
439
+ if (firstVisualMap) {
440
+ const matchItemIndex = firstVisualMap.pieces.findIndex(item => {
441
+ let condition = true;
442
+ if (item.min) {
443
+ condition = condition && labelValue >= item.min;
444
+ }
445
+ if (item.max) {
446
+ condition = condition && labelValue <= item.max;
447
+ }
448
+ if (item.lte) {
449
+ condition = condition && labelValue <= item.lte;
450
+ }
451
+ if (item.gte) {
452
+ condition = condition && labelValue >= item.gte;
453
+ }
454
+ if (item.lt) {
455
+ condition = condition && labelValue < item.lt;
456
+ }
457
+ if (item.gt) {
458
+ condition = condition && labelValue > item.gt;
459
+ }
460
+ if (item.value) {
461
+ condition = condition && labelValue === item.value;
462
+ }
463
+ return condition;
464
+ });
465
+ if (matchItemIndex > -1) {
466
+ return [`{color_${matchItemIndex}|${orderNum}} ${leftLabel}`].join('\n');
467
+ }
468
+ }
469
+ return [`{default|${orderNum}} ${leftLabel}`].join('\n');
470
+ };
471
+ }
472
+ },
473
+ setItemStyleColor(isSet = true, series, highlightOptions = this.highlightOptions, color = this.highlightColor) {
474
+ series = series || cloneDeep(this.echartOptions && this.echartOptions.series) || [];
475
+ series.forEach((serie, seriesIndex) => {
476
+ const dataIndexs = highlightOptions.map(item => {
477
+ if (item.seriesIndex && item.seriesIndex.includes(seriesIndex)) {
478
+ return item.dataIndex;
479
+ }
480
+ });
481
+ const colors = highlightOptions.map(item => {
482
+ if (item.seriesIndex && item.seriesIndex.includes(seriesIndex)) {
483
+ return item.color || color;
484
+ }
485
+ });
486
+ const serieColor =
487
+ this.options.series &&
488
+ this.options.series[seriesIndex] &&
489
+ this.options.series[seriesIndex].itemStyle &&
490
+ this.options.series[seriesIndex].itemStyle.color;
491
+ serie.itemStyle = serie.itemStyle || { color: '' };
492
+ serie.itemStyle.color = ({ dataIndex }) => {
493
+ const index = dataIndexs.indexOf(dataIndex);
494
+ if (index > -1) {
495
+ return colors[index];
496
+ } else if (serie.type === 'pie') {
497
+ let colorGroup = this._handlerColorGroup(serie.data.length);
498
+ return colorGroup[dataIndex];
499
+ } else {
500
+ return serieColor;
501
+ }
502
+ };
503
+ });
504
+ isSet && this.$set(this.echartOptions, 'series', series);
505
+ },
506
+ _handlePieAutoPlay() {
507
+ let seriesType = this._chartOptions.series && this._chartOptions.series[0] && this._chartOptions.series[0].type;
508
+ let echartsNode = this.smChart.chart;
509
+ if (
510
+ this._chartOptions.legend &&
511
+ this._chartOptions.legend.data &&
512
+ this._chartOptions.legend.data.length &&
513
+ echartsNode &&
514
+ seriesType === 'pie'
515
+ ) {
516
+ this.clearPieAutoPlay(echartsNode);
517
+ if (this.autoPlay) {
518
+ this.setPieAutoPlay(echartsNode);
519
+ }
520
+ }
521
+ },
522
+ setPieAutoPlay(echartsNode) {
523
+ let i = -1;
524
+ this.pieAutoPlay = setInterval(() => {
525
+ echartsNode.dispatchAction({
526
+ type: 'downplay',
527
+ seriesIndex: 0,
528
+ dataIndex: i
529
+ });
530
+ i++;
531
+ if (i >= this._chartOptions.legend.data.length) {
532
+ i = 0;
533
+ }
534
+ echartsNode.dispatchAction({
535
+ type: 'highlight',
536
+ seriesIndex: 0,
537
+ dataIndex: i
538
+ });
539
+ }, 2000);
540
+ },
541
+ clearPieAutoPlay(echartsNode) {
542
+ clearInterval(this.pieAutoPlay);
543
+ for (let i = 0; i < this._chartOptions.legend.data.length; i++) {
544
+ echartsNode.dispatchAction({
545
+ type: 'downplay',
546
+ seriesIndex: 0,
547
+ dataIndex: i
548
+ });
549
+ }
550
+ },
551
+ timing() {
552
+ this.echartsDataService &&
553
+ this.echartsDataService.getDataOption(this.dataset, this.xBar).then(options => {
554
+ this.hideLoading();
555
+ // 缓存dataSeriesCache,请求后格式化成echart的数据
556
+ this.dataSeriesCache = Object.assign({}, options);
557
+ this.datasetChange = false;
558
+ // 设置echartOptions
559
+ this.echartOptions = this._optionsHandler(this.options, options);
560
+ });
561
+ },
562
+ // 请求数据,设置echartOptions
563
+ _setEchartOptions(dataset, datasetOptions, echartOptions) {
564
+ this.echartsDataService = null;
565
+ this.dataSeriesCache = null;
566
+ if (this.dataset.type !== 'geoJSON') {
567
+ this.showLoading('default', {
568
+ text: this.$t('info.loading'),
569
+ color: this.colorGroupsData[0],
570
+ textColor: this.textColorsData,
571
+ maskColor: 'rgba(0,0,0,0.8)',
572
+ zlevel: 0
573
+ });
574
+ }
575
+ this.echartsDataService = new EchartsDataService(dataset, datasetOptions);
576
+ this.echartsDataService.getDataOption(dataset, this.xBar).then(options => {
577
+ this.hideLoading();
578
+ // 缓存dataSeriesCache,请求后格式化成echart的数据
579
+ this.dataSeriesCache = Object.assign({}, options);
580
+ this.datasetChange = false;
581
+ // 设置echartOptions
582
+ this.echartOptions = this._optionsHandler(echartOptions, options);
583
+ });
584
+ },
585
+ _optionsHandler(options, dataOptions, dataZoomChanged) {
586
+ dataOptions = dataOptions && cloneDeep(dataOptions); // clone 避免引起重复刷新
587
+ options = options && cloneDeep(options); // clone 避免引起重复刷新
588
+ let extraSeries = [];
589
+ if (options && options.legend && !options.legend.type) {
590
+ options.legend.type = 'scroll';
591
+ }
592
+ let yAxis = options.yAxis;
593
+ let xAxis = options.xAxis;
594
+ if (xAxis && dataOptions.xAxis) {
595
+ let axis = xAxis;
596
+ let axisData = dataOptions.xAxis[0];
597
+ let type = 'xAxis';
598
+ if (yAxis && yAxis.type === 'category') {
599
+ // 处理条形图
600
+ type = 'yAxis';
601
+ axis = yAxis;
602
+ dataOptions.yAxis = dataOptions.xAxis;
603
+ delete dataOptions.xAxis;
604
+ this._initAxisLabel(yAxis.axisLabel, dataOptions.yAxis[0].data, options.visualMap, dataOptions.series);
605
+ }
606
+ if (dataOptions.series.length === 0) {
607
+ axis = [{}];
608
+ } else if (!Array.isArray(axis)) {
609
+ if (axisData.data && axisData.data.length) {
610
+ axis.data = [];
611
+ }
612
+ axis = [Object.assign({}, axisData, axis)];
613
+ }
614
+ options[type] = axis;
615
+ }
616
+ if (options && options.series && dataOptions.series) {
617
+ if (dataOptions.series.length === 0) {
618
+ options.series = [];
619
+ } else {
620
+ options.series = options.series.map((element, index) => {
621
+ return Object.assign({}, element, dataOptions.series[index] || {});
622
+ });
623
+ const dataZoom = options.dataZoom && options.dataZoom[0];
624
+ const parallelShowNumber = this.getParallelShowNumber(options.series);
625
+ if (options.series[0].shape === 'cylinder') {
626
+ this.setCylinderXAxis(parallelShowNumber, options);
627
+ }
628
+ const leftRightCount = parallelShowNumber / 2;
629
+ const baseSpace = 32;
630
+ let seriesSpace = 0;
631
+ let seriesSpaceCount = -Math.floor(leftRightCount);
632
+ let seriesNameTag;
633
+ let colorIndex = 0;
634
+ options.series = options.series.map((serie, index) => {
635
+ if (parallelShowNumber !== 0) {
636
+ const serieName = serie.name.substring(serie.name.indexOf('-') + 1);
637
+ if (!seriesNameTag) {
638
+ seriesNameTag = serieName;
639
+ seriesSpace = this.getSericeSpace(parallelShowNumber, baseSpace, seriesSpaceCount);
640
+ } else {
641
+ if (seriesNameTag === serieName) {
642
+ seriesSpace = this.getSericeSpace(parallelShowNumber, baseSpace, seriesSpaceCount);
643
+ } else {
644
+ seriesSpaceCount = -Math.floor(leftRightCount);
645
+ seriesNameTag = serieName;
646
+ seriesSpace = this.getSericeSpace(parallelShowNumber, baseSpace, seriesSpaceCount);
647
+ colorIndex += 1;
648
+ }
649
+ }
650
+ seriesSpaceCount += 1;
651
+ }
652
+ let label = serie.label && serie.label.normal;
653
+ if (label && !label.smart) {
654
+ serie.label.normal = this._controlLabel(label, serie.maxLabels);
655
+ }
656
+ if (label && label.show && label.smart) {
657
+ label.position = label.position || 'top';
658
+ let data = serie.data || [];
659
+ let startDataIndex = 0;
660
+ let endDataIndex = data.length > 0 ? data.length - 1 : 0;
661
+ if (dataZoom && dataZoom.show !== false) {
662
+ if (dataZoom.start > dataZoom.end) {
663
+ let oldStart = dataZoom.start;
664
+ dataZoom.start = dataZoom.end;
665
+ dataZoom.end = oldStart;
666
+ }
667
+ if (dataZoomChanged) {
668
+ let { startValue, endValue } = this.smChart.chart.getOption().dataZoom[0] || {};
669
+ startDataIndex = startValue;
670
+ endDataIndex = endValue;
671
+ options.dataZoom = options.dataZoom.map(val => {
672
+ if (startValue >= 0 && endValue >= 0) {
673
+ val.startValue = startValue;
674
+ val.endValue = endValue;
675
+ delete val.start;
676
+ delete val.end;
677
+ return val;
678
+ }
679
+ return val;
680
+ });
681
+ } else {
682
+ startDataIndex = Math.floor((dataZoom.start / 100) * data.length);
683
+ endDataIndex = Math.ceil((dataZoom.end / 100) * data.length);
684
+ }
685
+ data = serie.data.slice(startDataIndex, endDataIndex + 1);
686
+ }
687
+
688
+ label.formatter = function ({ dataIndex, value }) {
689
+ let result = '';
690
+ if (
691
+ dataIndex === startDataIndex ||
692
+ dataIndex === endDataIndex ||
693
+ Math.max.apply(null, data) + '' === value + ''
694
+ ) {
695
+ result = value;
696
+ }
697
+ return result;
698
+ };
699
+ } else if (serie && serie.type !== 'pie' && serie.type !== 'radar') {
700
+ const colorGroup = getMultiColorGroup(this.colorGroupsData, this.colorNumber);
701
+ if (serie.type === '2.5Bar') {
702
+ const shape = serie.shape;
703
+ const defaultColor = serie.itemStyle && serie.itemStyle.color;
704
+ if (['square', 'rectangle'].includes(shape)) {
705
+ const cubeType = shape;
706
+ serie.type = 'custom';
707
+ dataOptions.series[index] && (dataOptions.series[index].type = 'custom');
708
+ const _this = this;
709
+ serie.renderItem = this._squareRectangleRenderItem(seriesSpace, defaultColor, colorGroup, _this, cubeType, colorIndex);
710
+ } else if (shape === 'cylinder') {
711
+ this.handleCylinder(parallelShowNumber, dataOptions, index, serie, options, defaultColor, colorGroup, extraSeries);
712
+ }
713
+ delete serie.shape;
714
+ }
715
+ }
716
+ return serie;
717
+ });
718
+ // 玫瑰图多个选中
719
+ if (options.series[0].type === 'pie' && options.series[0].roseType) {
720
+ options.series = options.series.map(serie => {
721
+ if (!serie.roseType) {
722
+ serie.roseType = options.series[0].roseType;
723
+ }
724
+ return serie;
725
+ });
726
+ }
727
+ // pie的图例需要一个扇形是一个图例
728
+ if (options.legend && options.series.length > 0 && options.series[0].type === 'pie') {
729
+ options.legend.data = [];
730
+ options.series.forEach(element => {
731
+ if (element.data) {
732
+ options.legend.data.push(
733
+ ...element.data.map(item => {
734
+ return item.name;
735
+ })
736
+ );
737
+ }
738
+ });
739
+ }
740
+ }
741
+ }
742
+ if (options && options.radar && dataOptions.radar) {
743
+ options.radar.indicator = Object.assign({}, dataOptions.radar.indicator || {});
744
+ }
745
+
746
+ let series = dataOptions.series;
747
+ let isRingShine = options.series && options.series[0] && options.series[0].outerGap >= 0;
748
+ if (series && series.length && series[0].type === 'pie') {
749
+ this.setItemStyleColor(false, series);
750
+ }
751
+ if (isRingShine) {
752
+ dataOptions.series = this._createRingShineSeries(series, options.series);
753
+ }
754
+ if (this.highlightOptions && this.highlightOptions.length > 0) {
755
+ if (isRingShine) {
756
+ dataOptions.series = this._createRingShineHighlight(series, this.highlightOptions);
757
+ } else {
758
+ this.setItemStyleColor(true, series);
759
+ }
760
+ }
761
+ const mergeOptions = merge(options, dataOptions);
762
+ if (extraSeries.length > 0) {
763
+ mergeOptions.series.push(...extraSeries);
764
+ }
765
+ return mergeOptions;
766
+ },
767
+ handleCylinder(parallelShowNumber, dataOptions, index, serie, options, defaultColor, colorGroup, extraSeries) {
768
+ const baseColumnWidth = parallelShowNumber !== 0 ? `${100 / parallelShowNumber}%` : '100%';
769
+ const nextSerieDatas = dataOptions.series[index + 1] && dataOptions.series[index + 1].data;
770
+ serie.type = 'bar';
771
+ serie.barGap = parallelShowNumber === 0 ? '-100%' : '0';
772
+ if (parallelShowNumber !== 0) {
773
+ const serieColor = defaultColor || colorGroup[Math.ceil((index + 1) / parallelShowNumber) - 1];
774
+ if (serie.itemStyle) {
775
+ serie.itemStyle.color = this.setGradientColor(serieColor, '#fff');
776
+ } else {
777
+ serie.itemStyle = {};
778
+ serie.itemStyle.color = this.setGradientColor(serieColor, '#fff');
779
+ }
780
+ }
781
+ options.tooltip && options.tooltip.trigger === 'axis' && (options.tooltip.trigger = 'item');
782
+ dataOptions.series[index] && (dataOptions.series[index].type = 'bar');
783
+ const colorIndex = parallelShowNumber !== 0 ? Math.ceil((index + 1) / parallelShowNumber) - 1 : index;
784
+ let cirCleColor = defaultColor || colorGroup[colorIndex];
785
+ let cirCleColorFnList = [];
786
+ if (typeof cirCleColor === 'string') {
787
+ cirCleColor = this.setGradientColor(cirCleColor, '#fff');
788
+ }
789
+ if (this.highlightOptions && this.highlightOptions.length > 0) {
790
+ const matchDataList = [];
791
+ this.highlightOptions.forEach(item => {
792
+ if (item.seriesIndex.includes(index)) {
793
+ let color = item.color || this.highlightColor;
794
+ if (typeof color === 'string') {
795
+ color = this.setGradientColor(color, '#fff');
796
+ }
797
+ matchDataList.push({ dataIndex: item.dataIndex, color });
798
+ }
799
+ });
800
+ if (matchDataList.length > 0) {
801
+ cirCleColorFnList = ['topCirCleColorFn', 'bottomCirCleColorFn'].map(() => {
802
+ return ({ dataIndex }) => {
803
+ const matchData = matchDataList.find(item => item.dataIndex === dataIndex);
804
+ return matchData ? matchData.color : cirCleColor;
805
+ };
806
+ });
807
+ }
808
+ }
809
+ const offsetDistance = this.getOffsetDistance(parallelShowNumber, index);
810
+ const xAxisIndex = parallelShowNumber !== 0 ? Math.ceil((index + 1) / parallelShowNumber) - 1 : 0;
811
+ serie.xAxisIndex = xAxisIndex;
812
+ extraSeries.push(
813
+ // 头部的圆片
814
+ {
815
+ name: parallelShowNumber !== 0 ? serie.name : '',
816
+ type: 'pictorialBar',
817
+ symbolOffset: parallelShowNumber !== 0 ? [offsetDistance, '-50%'] : [0, -8],
818
+ xAxisIndex: parallelShowNumber !== 0 ? xAxisIndex : 0,
819
+ symbolPosition: 'end',
820
+ z: 12,
821
+ itemStyle: {
822
+ normal: {
823
+ color: cirCleColorFnList[0] || cirCleColor
824
+ }
825
+ },
826
+ data: dataOptions.series[index].data.map((item, dataIndex) => {
827
+ if (parallelShowNumber !== 0) {
828
+ return {
829
+ value: item,
830
+ symbolSize: [baseColumnWidth, 15]
831
+ };
832
+ } else {
833
+ return {
834
+ value: item,
835
+ symbolSize: !nextSerieDatas || (nextSerieDatas[dataIndex] && +item >= +nextSerieDatas[dataIndex])
836
+ ? [baseColumnWidth, 15]
837
+ : [0, 15]
838
+ };
839
+ }
840
+ })
841
+ },
842
+ {
843
+ // 底部的圆片
844
+ name: parallelShowNumber !== 0 ? serie.name : '',
845
+ type: 'pictorialBar',
846
+ xAxisIndex: parallelShowNumber !== 0 ? xAxisIndex : 0,
847
+ symbolSize: parallelShowNumber !== 0 ? [baseColumnWidth, 10] : [offsetDistance, 10],
848
+ symbolOffset: parallelShowNumber !== 0 ? [offsetDistance, '50%'] : [0, 5],
849
+ z: 12,
850
+ itemStyle: {
851
+ normal: {
852
+ color: cirCleColorFnList[1] || cirCleColor
853
+ }
854
+ },
855
+ data: dataOptions.series[index].data
856
+ }
857
+ );
858
+ },
859
+ getParallelShowNumber(series) {
860
+ if (series.length === 0 || !this.multipleYField(series)) {
861
+ // 0表示不进行并列显示
862
+ return 0;
863
+ }
864
+ let parallelShowNumber = 0;
865
+ const symbolPosition = series[0].name.indexOf('-');
866
+ let firstSeriesName = series[0].name.substring(symbolPosition + 1);
867
+ series.forEach(option => {
868
+ const optionName = option.name.substring(symbolPosition + 1);
869
+ if (firstSeriesName === optionName) {
870
+ parallelShowNumber++;
871
+ }
872
+ });
873
+ return parallelShowNumber;
874
+ },
875
+ setCylinderXAxis(parallelShowNumber, options) {
876
+ if (parallelShowNumber === 0) {
877
+ return;
878
+ }
879
+ const xAixsType = options.xAxis[0] && options.xAxis[0].type;
880
+ for (let i = 1; i <= parallelShowNumber; i++) {
881
+ options.xAxis.push({
882
+ type: xAixsType,
883
+ show: false
884
+ });
885
+ }
886
+ },
887
+ getOffsetDistance(parallelShowNumber, index) {
888
+ if (parallelShowNumber === 0) {
889
+ return '100%';
890
+ }
891
+ let distance;
892
+ if (parallelShowNumber % 2) {
893
+ distance = -100 * (Math.floor(parallelShowNumber / 2)) + index % parallelShowNumber * 100;
894
+ return `${distance}%`;
895
+ } else {
896
+ distance = -100 * (Math.floor(parallelShowNumber / 2) - 0.5) + index % parallelShowNumber * 100;
897
+ }
898
+ return `${distance}%`;
899
+ },
900
+ multipleYField(optionSeries) {
901
+ const series = cloneDeep(optionSeries);
902
+ const nameList = series.map(serie => {
903
+ if (!serie.name.includes('-')) {
904
+ return serie.name;
905
+ }
906
+ const position = serie.name.indexOf('-');
907
+ const prefix = serie.name.substring(0, position);
908
+ if(isNaN(+prefix)) {
909
+ return serie.name;
910
+ }
911
+ return serie.name.substring(position + 1);
912
+ });
913
+ return series.length !== new Set(nameList).size;
914
+ },
915
+ _squareRectangleRenderItem(seriesSpace, defaultColor, colorGroup, _this, cubeType, colorIndex) {
916
+ return (params, api) => {
917
+ const location = api.coord([api.value(0), api.value(1)]);
918
+ let fillColor = defaultColor || colorGroup[colorIndex];
919
+ if (_this.highlightOptions && _this.highlightOptions.length > 0) {
920
+ const matchData = _this.highlightOptions.find(
921
+ item => item.seriesIndex.includes(params.seriesIndex) && item.dataIndex === params.dataIndex
922
+ );
923
+ if (matchData && (matchData.color || _this.highlightColor)) {
924
+ fillColor = matchData.color || _this.highlightColor;
925
+ }
926
+ }
927
+ let leftColor, rightColor, topColor;
928
+ if (typeof fillColor === 'object') {
929
+ const copyLeftColor = cloneDeep(fillColor);
930
+ const copyRightColor = cloneDeep(fillColor);
931
+ const copyTopColor = cloneDeep(fillColor);
932
+ copyLeftColor.colorStops[0].color = getColorWithOpacity(copyLeftColor.colorStops[0].color, 0.4);
933
+ copyLeftColor.colorStops[1].color = getColorWithOpacity(copyLeftColor.colorStops[1].color, 0.4);
934
+ copyRightColor.colorStops[0].color = getColorWithOpacity(copyRightColor.colorStops[0].color, 0.7);
935
+ copyRightColor.colorStops[1].color = getColorWithOpacity(copyRightColor.colorStops[1].color, 0.7);
936
+ copyTopColor.colorStops[0].color = getColorWithOpacity(copyTopColor.colorStops[0].color, 0.85);
937
+ copyTopColor.colorStops[1].color = getColorWithOpacity(copyTopColor.colorStops[1].color, 0.85);
938
+ leftColor = copyLeftColor;
939
+ rightColor = copyRightColor;
940
+ topColor = copyTopColor;
941
+ } else {
942
+ leftColor = getColorWithOpacity(fillColor, 0.4);
943
+ rightColor = getColorWithOpacity(fillColor, 0.7);
944
+ topColor = getColorWithOpacity(fillColor, 0.85);
945
+ }
946
+ return {
947
+ type: 'group',
948
+ children: [
949
+ {
950
+ type: `Cube${cubeType}Left`,
951
+ shape: {
952
+ api,
953
+ xValue: api.value(0),
954
+ yValue: api.value(1),
955
+ x: location[0] + seriesSpace,
956
+ y: location[1],
957
+ bottomYAxis: api.coord([api.value(0), 0])[1]
958
+ },
959
+ style: {
960
+ fill: leftColor
961
+ }
962
+ },
963
+ {
964
+ type: `Cube${cubeType}Right`,
965
+ shape: {
966
+ api,
967
+ xValue: api.value(0),
968
+ yValue: api.value(1),
969
+ x: location[0] + seriesSpace,
970
+ y: location[1],
971
+ bottomYAxis: api.coord([api.value(0), 0])[1]
972
+ },
973
+ style: {
974
+ fill: rightColor
975
+ }
976
+ },
977
+ {
978
+ type: `Cube${cubeType}Top`,
979
+ shape: {
980
+ api,
981
+ xValue: api.value(0),
982
+ yValue: api.value(1),
983
+ x: location[0] + seriesSpace,
984
+ y: location[1],
985
+ bottomYAxis: api.coord([api.value(0), 0])[1]
986
+ },
987
+ style: {
988
+ fill: topColor
989
+ }
990
+ }
991
+ ]
992
+ };
993
+ };
994
+ },
995
+ getSericeSpace(sameYFieldSeriesCount, baseSpace, seriesSpaceCount) {
996
+ if (sameYFieldSeriesCount % 2 === 0) {
997
+ return seriesSpaceCount * baseSpace + baseSpace / 2;
998
+ } else {
999
+ return seriesSpaceCount * baseSpace;
1000
+ }
1001
+ },
1002
+ getSameYFieldSeriesCount(series) {
1003
+ const firstSeriesName = series[0].name.split('-')[1];
1004
+ let seriesCount = 0;
1005
+ for (let serie of series) {
1006
+ const serieNname = serie.name.split('-')[1];
1007
+ if (firstSeriesName === serieNname) {
1008
+ seriesCount += 1;
1009
+ } else {
1010
+ return seriesCount;
1011
+ }
1012
+ }
1013
+ return seriesCount;
1014
+ },
1015
+ _createRingShineSeries(series, optionsSeries) {
1016
+ if (optionsSeries) {
1017
+ this.datasetOptions.forEach((datasetOption, index) => {
1018
+ let { type, outerGap, isShine } = optionsSeries[index] || {};
1019
+ if (type === 'pie' && outerGap >= 0) {
1020
+ const data = series[index].data.map(val => val.value);
1021
+ outerGap = outerGap || Math.min.apply(null, data) / 5;
1022
+ series[index].data = this._createRingShineDataOption(series[index].data, outerGap, isShine);
1023
+ delete optionsSeries[index].outerGap;
1024
+ delete optionsSeries[index].isShine;
1025
+ }
1026
+ });
1027
+ }
1028
+ return series;
1029
+ },
1030
+ _createRingShineDataOption(data, outerGap, isShine) {
1031
+ if (!data) {
1032
+ return;
1033
+ }
1034
+ const colors = this._handlerColorGroup(data.length);
1035
+ const gapItem = {
1036
+ value: outerGap,
1037
+ name: '',
1038
+ itemStyle: {
1039
+ normal: {
1040
+ label: {
1041
+ show: false
1042
+ },
1043
+ labelLine: {
1044
+ show: false
1045
+ },
1046
+ color: 'rgba(0, 0, 0, 0)',
1047
+ borderColor: 'rgba(0, 0, 0, 0)',
1048
+ borderWidth: 0
1049
+ }
1050
+ }
1051
+ };
1052
+ let result = [];
1053
+ for (let i = 0; i < data.length; i++) {
1054
+ let dataItem = {
1055
+ value: data[i].value,
1056
+ name: data[i].name
1057
+ };
1058
+ if (isShine) {
1059
+ dataItem.itemStyle = {
1060
+ borderWidth: 5,
1061
+ shadowBlur: 10,
1062
+ color: colors[i],
1063
+ borderColor: colors[i],
1064
+ shadowColor: colors[i]
1065
+ };
1066
+ }
1067
+ result.push(dataItem);
1068
+ if (data.length > 1) {
1069
+ result.push(gapItem);
1070
+ }
1071
+ }
1072
+ return result;
1073
+ },
1074
+ _createRingShineHighlight(series, highlightOptions, color = this.highlightColor) {
1075
+ series = series || [];
1076
+ series = series.map((serie, seriesIndex) => {
1077
+ const dataIndexs = highlightOptions.map(item => {
1078
+ if (item.seriesIndex && item.seriesIndex.includes(seriesIndex)) {
1079
+ return item.dataIndex;
1080
+ }
1081
+ });
1082
+ const colors = highlightOptions.map(item => {
1083
+ if (item.seriesIndex && item.seriesIndex.includes(seriesIndex)) {
1084
+ return item.color || color;
1085
+ }
1086
+ });
1087
+ const serieDatas = (serie && serie.data) || [];
1088
+ dataIndexs.forEach((dataIndex, index) => {
1089
+ serieDatas[dataIndex].itemStyle.color = colors[index];
1090
+ serieDatas[dataIndex].itemStyle.borderColor = colors[index];
1091
+ serieDatas[dataIndex].itemStyle.shadowColor = colors[index];
1092
+ });
1093
+ return serie;
1094
+ });
1095
+ return series;
1096
+ },
1097
+ _handlerColorGroup(serielDataLength) {
1098
+ if (typeof this.colorGroupsData[0] === 'object') {
1099
+ return handleMultiGradient(this.colorGroupsData, serielDataLength);
1100
+ } else {
1101
+ return ColorsPickerUtil.getGradientColors(this.colorGroupsData, serielDataLength, 'RANGE');
1102
+ }
1103
+ },
1104
+ // 控制label显示条数
1105
+ _controlLabel(normalLabel, maxLabels) {
1106
+ if (normalLabel && normalLabel.show && maxLabels) {
1107
+ let endNormalLabel = cloneDeep(normalLabel);
1108
+ let formatMode;
1109
+ if (endNormalLabel.formatter && typeof endNormalLabel.formatter === 'string') {
1110
+ formatMode = endNormalLabel.formatter;
1111
+ }
1112
+ endNormalLabel.formatter = function ({ dataIndex, value, name, percent }) {
1113
+ const FORMATTER_MAP = {
1114
+ '{b}: {c}': `${name}: ${value}`,
1115
+ '{b}': `${name}`,
1116
+ '{c}': `${value}`,
1117
+ '{d}%': `${percent}%`
1118
+ };
1119
+ let result = '';
1120
+ if (dataIndex < maxLabels) {
1121
+ result = FORMATTER_MAP[formatMode || '{c}'];
1122
+ }
1123
+ return result;
1124
+ };
1125
+ return endNormalLabel;
1126
+ }
1127
+ return normalLabel;
1128
+ },
1129
+ // 当datasetUrl不变,datasetOptions改变时
1130
+ _changeChartData(echartsDataService, datasetOptions, echartOptions) {
1131
+ let options;
1132
+
1133
+ options = echartsDataService.formatChartData(datasetOptions, this.xBar);
1134
+
1135
+ // 缓存dataSeriesCache,格式化成echart的数据
1136
+ this.dataSeriesCache = Object.assign({}, options);
1137
+ // 设置echartOptions
1138
+ this.echartOptions = this._optionsHandler(echartOptions, options);
1139
+ },
1140
+ _setChartTheme() {
1141
+ if (!this.theme) {
1142
+ let colorNumber = this.colorNumber;
1143
+ this.chartTheme = chartThemeUtil(this.getBackground, this.textColorsData, this.colorGroupsData, colorNumber);
1144
+ }
1145
+ },
1146
+ // 获取echart实例
1147
+ _getEchart() {
1148
+ return this.smChart;
1149
+ },
1150
+ // 以下全是同名调用echart的方法
1151
+ /**
1152
+ * 提供了一个更贴切的名称来描述 setOption 方法的实际行为。
1153
+ * @param {Object} options - 图表的配置项和数据
1154
+ * @param {Boolean} [notMerge = false] - 可选,是否不跟之前设置的 option 进行合并,默认为 false,即合并
1155
+ * @param {Boolean} [lazyUpdate = false] - 可选,阻止调用 setOption 时抛出事件,默认为 false,即抛出事件
1156
+ */
1157
+ mergeOptions(options, notMerge, lazyUpdate) {
1158
+ this._delegateMethod('mergeOptions', options, notMerge, lazyUpdate);
1159
+ },
1160
+ /**
1161
+ * 此接口用于,在大数据量(百万以上)的渲染场景,分片加载数据和增量渲染。
1162
+ * @param {Object} params - 数据配置
1163
+ */
1164
+ appendData(params) {
1165
+ this._delegateMethod('appendData', params);
1166
+ },
1167
+ /**
1168
+ * 此接口用于,改变图表尺寸,在容器大小发生改变时需要手动调用。
1169
+ * @param {Object} [options] - options可缺省。有下面几个可选项:width, height, silent
1170
+ */
1171
+ resize(options) {
1172
+ this._delegateMethod('resize', options);
1173
+ },
1174
+ /**
1175
+ * 此接口用于,触发图表行为。
1176
+ * @param {Object} payload - 参数可以通过batch属性同时触发多个行为。
1177
+ */
1178
+ dispatchAction(payload) {
1179
+ this._delegateMethod('dispatchAction', payload);
1180
+ },
1181
+ /**
1182
+ * 此接口用于,转换坐标系上的点到像素坐标值。
1183
+ * @param {Object} finder - 用于指示『在哪个坐标系或者系列上判断』。
1184
+ * @param {Array|string} value - 要被转换的值。
1185
+ */
1186
+ convertToPixel(finder, value) {
1187
+ return this._delegateMethod('convertToPixel', finder, value);
1188
+ },
1189
+ /**
1190
+ * 此接口用于,转换像素坐标值到逻辑坐标系上的点。是 convertToPixel 的逆运算。
1191
+ * @param {Object} finder - 用于指示『在哪个坐标系或者系列上判断』。
1192
+ * @param {Array|string} value - 要被转换的值。
1193
+ */
1194
+ convertFromPixel(finder, value) {
1195
+ return this._delegateMethod('convertFromPixel', finder, value);
1196
+ },
1197
+ /**
1198
+ * 此接口用于,判断给定的点是否在指定的坐标系或者系列上。
1199
+ * @param {Object} finder - 用于指示『在哪个坐标系或者系列上判断』。
1200
+ * @param {Array} value - 要被判断的点。
1201
+ */
1202
+ containPixel(finder, value) {
1203
+ return this._delegateMethod('containPixel', finder, value);
1204
+ },
1205
+ /**
1206
+ * 此接口用于,显示加载动画效果。可以在加载数据前手动调用该接口显示加载动画,在数据加载完成后调用 hideLoading 隐藏加载动画。
1207
+ * @param {Object} [type] - 可选,加载动画类型,目前只有一种'default'。
1208
+ * @param {Object} [options] - 可选,加载动画配置项,跟type有关。
1209
+ */
1210
+ showLoading(type, options) {
1211
+ this._delegateMethod('showLoading', type, options);
1212
+ },
1213
+ /**
1214
+ * 此接口用于,隐藏动画加载效果。
1215
+ */
1216
+ hideLoading() {
1217
+ this._delegateMethod('hideLoading');
1218
+ },
1219
+ /**
1220
+ * 此接口用于,导出图表图片,返回一个 base64 的 URL,可以设置为Image的src。
1221
+ * @param {Object} options - 导出配置
1222
+ */
1223
+ getDataURL(options) {
1224
+ return this._delegateMethod('getDataURL', options);
1225
+ },
1226
+ /**
1227
+ * 此接口用于,导出联动的图表图片,返回一个 base64 的 url,可以设置为Image的src。导出图片中每个图表的相对位置跟容器的相对位置有关。
1228
+ * @param {Object} options - 导出配置
1229
+ */
1230
+ getConnectedDataURL(options) {
1231
+ return this._delegateMethod('getConnectedDataURL', options);
1232
+ },
1233
+ /**
1234
+ * 此接口用于,清空当前实例,会移除实例中所有的组件和图表。清空后调用 getOption 方法返回一个{}空对象。
1235
+ */
1236
+ clear() {
1237
+ this._delegateMethod('clear');
1238
+ },
1239
+ /**
1240
+ * 此接口用于,销毁实例,销毁后实例无法再被使用。
1241
+ */
1242
+ dispose() {
1243
+ this._delegateMethod('dispose');
1244
+ },
1245
+
1246
+ // 内部调用的方法
1247
+ _delegateMethod(name, ...args) {
1248
+ return this.smChart[name](...args);
1249
+ },
1250
+ unSupportedFeatureTip() {
1251
+ // @ts-ignore
1252
+ Message.destroy();
1253
+ // @ts-ignore
1254
+ Message.warning(this.$t('chart.unSupportedData'));
1255
+ },
1256
+ handleChartClick(params) {
1257
+ if (this.associatedMap) {
1258
+ const { dataIndex } = params;
1259
+ let features = [];
1260
+ if (this.echartsDataService && this.echartsDataService.sortDataCache) {
1261
+ features = this.echartsDataService.sortDataCache.features || features;
1262
+ }
1263
+ const selectedFeature = features[dataIndex];
1264
+ this.showDetailInfo(selectedFeature);
1265
+ }
1266
+ },
1267
+ showDetailInfo(feature) {
1268
+ const coordinates = ((feature || {}).geometry || {}).coordinates;
1269
+ const hasCoordinates = coordinates && !!coordinates.length;
1270
+ if (hasCoordinates && this.viewModel) {
1271
+ const properties = feature.properties || {};
1272
+ const coordinates = getFeatureCenter(feature);
1273
+ const propsData = this.generateTableData(properties);
1274
+ this.tablePopupProps = { ...propsData };
1275
+ this.$nextTick(() => {
1276
+ this.viewModel.setPopupContent(coordinates, this.$refs.chartTablePopup.$el, () =>
1277
+ setPopupArrowStyle(this.tablePopupBgData)
1278
+ );
1279
+ });
1280
+ } else {
1281
+ const mapNotLoaded = this.mapNotLoadedTip();
1282
+ if (mapNotLoaded) {
1283
+ return;
1284
+ }
1285
+ if (!hasCoordinates) {
1286
+ this.unSupportedFeatureTip();
1287
+ }
1288
+ }
1289
+ },
1290
+ generateTableData(properties) {
1291
+ let propsData = {
1292
+ columns: [
1293
+ { title: this.$t('search.attribute'), dataIndex: 'attribute', width: 120 },
1294
+ { title: this.$t('search.attributeValue'), dataIndex: 'attributeValue', width: 150 }
1295
+ ],
1296
+ data: []
1297
+ };
1298
+ for (let key in properties) {
1299
+ if (key && properties[key]) {
1300
+ let dataItem = {};
1301
+ dataItem.attribute = key;
1302
+ dataItem.attributeValue = properties[key];
1303
+ propsData.data.push(dataItem);
1304
+ }
1305
+ }
1306
+ return propsData;
1307
+ },
1308
+ mapNotLoadedTip() {},
1309
+ _dataZoomChanged() {
1310
+ let flag = false;
1311
+ this.options.series &&
1312
+ this.options.series.forEach(serie => {
1313
+ const labelConfig = serie.label && serie.label.normal;
1314
+ flag = labelConfig.show && labelConfig.smart;
1315
+ });
1316
+ if (flag) {
1317
+ this.echartOptions = this._optionsHandler(this.options, this.dataSeriesCache, true);
1318
+ }
1319
+ },
1320
+ registerShape() {
1321
+ this.datasetOptions &&
1322
+ this.options.series &&
1323
+ this.datasetOptions.forEach((item, index) => {
1324
+ const graphicIntance = this.$options.graphic;
1325
+ if (item.seriesType === '2.5Bar') {
1326
+ const cubeType = this.options.series[index].shape;
1327
+ if (graphicIntance.getShapeClass(`Cube${cubeType}Left`)) {
1328
+ return;
1329
+ }
1330
+ let CubeLeft, CubeRight, CubeTop;
1331
+ switch (cubeType) {
1332
+ case 'square':
1333
+ // 绘制左侧面
1334
+ CubeLeft = graphicIntance.extendShape({
1335
+ shape: {
1336
+ x: 0,
1337
+ y: 0
1338
+ },
1339
+ buildPath: function (ctx, shape) {
1340
+ // 会canvas的应该都能看得懂,shape是从custom传入的
1341
+ const bottomYAxis = shape.bottomYAxis;
1342
+ const c0 = [shape.x, shape.y];
1343
+ const c1 = [shape.x - 13, shape.y - 13];
1344
+ const c2 = [shape.x - 13, bottomYAxis - 13];
1345
+ const c3 = [shape.x, bottomYAxis];
1346
+ ctx.moveTo(c0[0], c0[1]).lineTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).closePath();
1347
+ }
1348
+ });
1349
+ // 绘制右侧面
1350
+ CubeRight = graphicIntance.extendShape({
1351
+ shape: {
1352
+ x: 0,
1353
+ y: 0
1354
+ },
1355
+ buildPath: function (ctx, shape) {
1356
+ const bottomYAxis = shape.bottomYAxis;
1357
+ const c1 = [shape.x, shape.y];
1358
+ const c2 = [shape.x, bottomYAxis];
1359
+ const c3 = [shape.x + 18, bottomYAxis - 9];
1360
+ const c4 = [shape.x + 18, shape.y - 9];
1361
+ ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath();
1362
+ }
1363
+ });
1364
+ // 绘制顶面
1365
+ CubeTop = graphicIntance.extendShape({
1366
+ shape: {
1367
+ x: 0,
1368
+ y: 0
1369
+ },
1370
+ buildPath: function (ctx, shape) {
1371
+ const c1 = [shape.x, shape.y];
1372
+ const c2 = [shape.x + 18, shape.y - 9];
1373
+ const c3 = [shape.x + 5, shape.y - 22];
1374
+ const c4 = [shape.x - 13, shape.y - 13];
1375
+ ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath();
1376
+ }
1377
+ });
1378
+ break;
1379
+ case 'rectangle':
1380
+ // 绘制左侧面
1381
+ CubeLeft = graphicIntance.extendShape({
1382
+ shape: {
1383
+ x: 0,
1384
+ y: 0
1385
+ },
1386
+ buildPath: function (ctx, shape) {
1387
+ const bottomYAxis = shape.bottomYAxis;
1388
+ const c0 = [shape.x, shape.y];
1389
+ const c1 = [shape.x - 9, shape.y - 9];
1390
+ const c2 = [shape.x - 9, bottomYAxis - 9];
1391
+ const c3 = [shape.x, bottomYAxis];
1392
+ ctx.moveTo(c0[0], c0[1]).lineTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).closePath();
1393
+ }
1394
+ });
1395
+ CubeRight = graphicIntance.extendShape({
1396
+ shape: {
1397
+ x: 0,
1398
+ y: 0
1399
+ },
1400
+ buildPath: function (ctx, shape) {
1401
+ const bottomYAxis = shape.bottomYAxis;
1402
+ const c1 = [shape.x, shape.y];
1403
+ const c2 = [shape.x, bottomYAxis];
1404
+ const c3 = [shape.x + 18, bottomYAxis - 9];
1405
+ const c4 = [shape.x + 18, shape.y - 9];
1406
+ ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath();
1407
+ }
1408
+ });
1409
+ CubeTop = graphicIntance.extendShape({
1410
+ shape: {
1411
+ x: 0,
1412
+ y: 0
1413
+ },
1414
+ buildPath: function (ctx, shape) {
1415
+ const c1 = [shape.x, shape.y];
1416
+ const c2 = [shape.x + 18, shape.y - 9];
1417
+ const c3 = [shape.x + 9, shape.y - 18];
1418
+ const c4 = [shape.x - 9, shape.y - 9];
1419
+ ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath();
1420
+ }
1421
+ });
1422
+ break;
1423
+ }
1424
+ CubeLeft && graphicIntance.registerShape(`Cube${cubeType}Left`, CubeLeft);
1425
+ CubeRight && graphicIntance.registerShape(`Cube${cubeType}Right`, CubeRight);
1426
+ CubeTop && graphicIntance.registerShape(`Cube${cubeType}Top`, CubeTop);
1427
+ }
1428
+ });
1429
+ },
1430
+ getCirlPoint(x0, y0, r, angle) {
1431
+ let x1 = x0 + r * Math.cos((angle * Math.PI) / 180);
1432
+ let y1 = y0 + r * Math.sin((angle * Math.PI) / 180);
1433
+ return {
1434
+ x: x1,
1435
+ y: y1
1436
+ };
1437
+ },
1438
+ spinLine(startAngle, endAngle, angle, effectColor, radius) {
1439
+ return (params, api) => {
1440
+ return {
1441
+ type: 'arc',
1442
+ shape: {
1443
+ cx: api.getWidth() / 2,
1444
+ cy: api.getHeight() / 2,
1445
+ r: (Math.min(api.getWidth(), api.getHeight()) / 2) * radius,
1446
+ startAngle: ((startAngle + angle) * Math.PI) / 180,
1447
+ endAngle: ((endAngle + angle) * Math.PI) / 180
1448
+ },
1449
+ style: {
1450
+ stroke: effectColor,
1451
+ fill: 'transparent',
1452
+ lineWidth: 1.5
1453
+ },
1454
+ silent: true
1455
+ };
1456
+ };
1457
+ },
1458
+ spinPoint(angle, spinAngle, effectColor, radius) {
1459
+ return (params, api) => {
1460
+ let x0 = api.getWidth() / 2;
1461
+ let y0 = api.getHeight() / 2;
1462
+ let r = (Math.min(api.getWidth(), api.getHeight()) / 2) * radius;
1463
+ let point = this.getCirlPoint(x0, y0, r, angle + spinAngle);
1464
+ return {
1465
+ type: 'circle',
1466
+ shape: {
1467
+ cx: point.x,
1468
+ cy: point.y,
1469
+ r: 4
1470
+ },
1471
+ style: {
1472
+ stroke: effectColor,
1473
+ fill: effectColor
1474
+ },
1475
+ silent: true
1476
+ };
1477
+ };
1478
+ },
1479
+ customRingsLine(startAngle, endAngle, angle, effectColor, effectRadius) {
1480
+ let series = {
1481
+ name: 'ring0',
1482
+ type: 'custom',
1483
+ coordinateSystem: 'none',
1484
+ renderItem: null,
1485
+ data: [0]
1486
+ };
1487
+ series.renderItem = this.spinLine(startAngle, endAngle, angle, effectColor, effectRadius);
1488
+ return series;
1489
+ },
1490
+ customRingsPoint(startAngle, angle, effectColor, outEffectRadius) {
1491
+ let series = {
1492
+ name: 'ring4',
1493
+ type: 'custom',
1494
+ coordinateSystem: 'none',
1495
+ renderItem: null,
1496
+ data: [0]
1497
+ };
1498
+ series.renderItem = this.spinPoint(startAngle, angle, effectColor, outEffectRadius);
1499
+ return series;
1500
+ },
1501
+ addEffect(angle) {
1502
+ angle = angle || 0;
1503
+ const effectColor = this.options.series[0].customOptions.color;
1504
+ const effectRadius = this.options.series[0].customOptions.radius;
1505
+ const outEffectRadius = effectRadius + 0.1;
1506
+ // customRightBottomLine
1507
+ this.customSeries.push(this.customRingsLine(0, 90, angle, effectColor, effectRadius));
1508
+ // customRightTopLine
1509
+ this.customSeries.push(this.customRingsLine(270, 40, -angle, effectColor, outEffectRadius));
1510
+ // customLeftTopLine
1511
+ this.customSeries.push(this.customRingsLine(180, 270, angle, effectColor, effectRadius));
1512
+ // customLeftBottomLine
1513
+ this.customSeries.push(this.customRingsLine(90, 220, -angle, effectColor, outEffectRadius));
1514
+ if (this.options.series[0].customOptions.pointState === 'startPoint') {
1515
+ this.customSeries.push(this.customRingsPoint(270, -angle, effectColor, outEffectRadius));
1516
+ this.customSeries.push(this.customRingsPoint(90, -angle, effectColor, outEffectRadius));
1517
+ }
1518
+ },
1519
+ startEffect() {
1520
+ let angle = 0;
1521
+ this.startSpin = setInterval(() => {
1522
+ if (!this.options.series) {
1523
+ return;
1524
+ }
1525
+ if (this.options.series[0].customType === 'customRingsSeries') {
1526
+ this.customSeries = [];
1527
+ angle += 3;
1528
+ this.addEffect(angle);
1529
+ }
1530
+ }, 100);
1531
+ },
1532
+ customRenderItem() {}
1533
+ },
1534
+ // echarts所有静态方法
1535
+ /**
1536
+ * @function connect
1537
+ * 多个图表实例实现联动。
1538
+ * @param {string|Array} group - group的id,或者图表实例的数组。
1539
+ */
1540
+ connect(group) {
1541
+ ECharts && ECharts.connect(group);
1542
+ },
1543
+ /**
1544
+ * 解除图表实例的联动,如果只需要移除单个实例,可以将通过将该图表实例 group 设为空。
1545
+ * @param {string} group - group的id。
1546
+ */
1547
+ disconnect(group) {
1548
+ ECharts && ECharts.disConnect(group);
1549
+ },
1550
+ /**
1551
+ * 注册可用的地图,必须在包括 geo 组件或者 map 图表类型的时候才能使用。
1552
+ * @param {string} mapName - 地图名称,在 geo 组件或者 map 图表类型中设置的 map 对应的就是该值。
1553
+ * @param {Object} geoJSON - GeoJson 格式的数据,具体格式见 http://geojson.org/。
1554
+ * @param {Object} [specialAreas] - 可选。将地图中的部分区域缩放到合适的位置,可以使得整个地图的显示更加好看。
1555
+ */
1556
+ registerMap(mapName, geoJSON, specialAreas) {
1557
+ ECharts && ECharts.registerMap(mapName, geoJSON, specialAreas);
1558
+ },
1559
+ /**
1560
+ * 注册主题,用于初始化实例的时候指定。
1561
+ * @param {string} name - 主题命名。
1562
+ * @param {Object} theme - 主题配置。
1563
+ */
1564
+ registerTheme(name, theme) {
1565
+ ECharts && ECharts.registerTheme(name, theme);
1566
+ },
1567
+ /**
1568
+ * @desc 图形相关帮助方法。
1569
+ */
1570
+ graphic: ECharts && ECharts.graphic
1571
+ };
1572
+ </script>