@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.
- package/LICENSE +201 -0
- package/README.md +31 -0
- package/dist/iclient-leaflet-vue.css +24471 -0
- package/dist/iclient-leaflet-vue.js +190317 -0
- package/dist/iclient-leaflet-vue.min.css +9 -0
- package/dist/iclient-leaflet-vue.min.js +517 -0
- package/dist/index.js +15 -0
- package/lib/_assets/iconfont/icon-sm-components.css +245 -0
- package/lib/_assets/iconfont/icon-sm-components.eot +0 -0
- package/lib/_assets/iconfont/icon-sm-components.svg +197 -0
- package/lib/_assets/iconfont/icon-sm-components.ttf +0 -0
- package/lib/_assets/iconfont/icon-sm-components.woff +0 -0
- package/lib/_assets/iconfont/icon-sm-components.woff2 +0 -0
- package/lib/_lang/en.js +446 -0
- package/lib/_lang/index.js +385 -0
- package/lib/_lang/zh.js +445 -0
- package/lib/_mixin/AntdRender.js +686 -0
- package/lib/_mixin/Card.js +197 -0
- package/lib/_mixin/GridLayer.js +153 -0
- package/lib/_mixin/Layer.js +140 -0
- package/lib/_mixin/Options.js +114 -0
- package/lib/_mixin/Popper.js +134 -0
- package/lib/_mixin/Theme.js +441 -0
- package/lib/_mixin/ThirdService.js +243 -0
- package/lib/_mixin/TileLayer.js +138 -0
- package/lib/_mixin/Timer.js +230 -0
- package/lib/_mixin/VmUpdater.js +204 -0
- package/lib/_mixin/WebMapBase.js +3467 -0
- package/lib/_mixin/map-events.js +200 -0
- package/lib/_mixin/map-getter.js +341 -0
- package/lib/_types/AddressMatchParameter.js +118 -0
- package/lib/_types/GeoJSONParamter.js +113 -0
- package/lib/_types/RestDataParameter.js +141 -0
- package/lib/_types/RestMapParameter.js +141 -0
- package/lib/_types/RestParameter.js +121 -0
- package/lib/_types/event/BaseTypes.js +124 -0
- package/lib/_types/event/Event.js +442 -0
- package/lib/_types/event/Events.js +484 -0
- package/lib/_types/event/Pixel.js +295 -0
- package/lib/_types/event/Util.js +305 -0
- package/lib/_types/iPortalDataParameter.js +121 -0
- package/lib/_types/iServerBaseParameter.js +111 -0
- package/lib/_types/iServerDataParameter.js +154 -0
- package/lib/_types/iServerMapParameter.js +154 -0
- package/lib/_types/index.js +231 -0
- package/lib/_types/map-event.js +163 -0
- package/lib/_utils/EchartsDataService.js +843 -0
- package/lib/_utils/RestService.js +7096 -0
- package/lib/_utils/WebMapService.js +1607 -0
- package/lib/_utils/epsg-define.js +181 -0
- package/lib/_utils/get-features.js +232 -0
- package/lib/_utils/global-event.js +134 -0
- package/lib/_utils/iPortalDataService.js +7459 -0
- package/lib/_utils/iServerRestService.js +7603 -0
- package/lib/_utils/props-binder.js +129 -0
- package/lib/_utils/statistics.js +147 -0
- package/lib/_utils/style/color/colorPalette.js +192 -0
- package/lib/_utils/style/color/serialColors.js +352 -0
- package/lib/_utils/style/common/common.css +1 -0
- package/lib/_utils/style/mixins/config.css +0 -0
- package/lib/_utils/style/mixins/mixins.css +0 -0
- package/lib/_utils/style/theme/antd.css +25242 -0
- package/lib/_utils/style/theme/antdVar.css +0 -0
- package/lib/_utils/style/theme/chart.js +7477 -0
- package/lib/_utils/style/theme/set-theme.js +200 -0
- package/lib/_utils/style/theme/theme.css +0 -0
- package/lib/_utils/style/theme/theme.json +356 -0
- package/lib/_utils/util.js +484 -0
- package/lib/_utils/vue-types/index.js +396 -0
- package/lib/_utils/vue-types/utils.js +318 -0
- package/lib/avatar/index.js +656 -0
- package/lib/avatar/style/avatar.css +1 -0
- package/lib/avatar/style/css.js +9 -0
- package/lib/avatar/style/index.css +2135 -0
- package/lib/avatar/style/index.js +9 -0
- package/lib/border/index.js +642 -0
- package/lib/border/style/border.css +1 -0
- package/lib/border/style/css.js +7 -0
- package/lib/border/style/index.js +7 -0
- package/lib/breadcrumb/index.js +813 -0
- package/lib/breadcrumb/style/breadcrumb.css +1 -0
- package/lib/breadcrumb/style/css.js +9 -0
- package/lib/breadcrumb/style/index.css +2102 -0
- package/lib/breadcrumb/style/index.js +9 -0
- package/lib/button/index.js +758 -0
- package/lib/button/style/button.css +1 -0
- package/lib/button/style/css.js +9 -0
- package/lib/button/style/index.css +3571 -0
- package/lib/button/style/index.js +9 -0
- package/lib/card/index.js +824 -0
- package/lib/card/style/card.css +1 -0
- package/lib/card/style/css.js +9 -0
- package/lib/card/style/index.css +2379 -0
- package/lib/card/style/index.js +9 -0
- package/lib/chart/index.js +9471 -0
- package/lib/chart/style/chart.css +1 -0
- package/lib/chart/style/css.js +11 -0
- package/lib/chart/style/index.js +11 -0
- package/lib/checkbox/index.js +756 -0
- package/lib/checkbox/style/checkbox.css +1 -0
- package/lib/checkbox/style/css.js +9 -0
- package/lib/checkbox/style/index.css +2286 -0
- package/lib/checkbox/style/index.js +9 -0
- package/lib/collapse/index.js +446 -0
- package/lib/collapse/style/collapse.css +1 -0
- package/lib/collapse/style/css.js +9 -0
- package/lib/collapse/style/index.css +2187 -0
- package/lib/collapse/style/index.js +9 -0
- package/lib/collapse-card/index.js +588 -0
- package/lib/collapse-card/style/collapse-card.css +1 -0
- package/lib/collapse-card/style/css.js +7 -0
- package/lib/collapse-card/style/index.js +7 -0
- package/lib/color-picker/index.js +521 -0
- package/lib/color-picker/style/color-picker.css +1 -0
- package/lib/color-picker/style/css.js +7 -0
- package/lib/color-picker/style/index.js +7 -0
- package/lib/date-picker/index.js +680 -0
- package/lib/date-picker/style/css.js +9 -0
- package/lib/date-picker/style/date-picker.css +1 -0
- package/lib/date-picker/style/index.css +4236 -0
- package/lib/date-picker/style/index.js +9 -0
- package/lib/dropdown/index.js +347 -0
- package/lib/dropdown/style/css.js +9 -0
- package/lib/dropdown/style/dropdown.css +1 -0
- package/lib/dropdown/style/index.css +2344 -0
- package/lib/dropdown/style/index.js +9 -0
- package/lib/empty/index.js +643 -0
- package/lib/empty/style/css.js +9 -0
- package/lib/empty/style/empty.css +1 -0
- package/lib/empty/style/index.css +2095 -0
- package/lib/empty/style/index.js +9 -0
- package/lib/icon/index.js +681 -0
- package/lib/icon/style/css.js +9 -0
- package/lib/icon/style/icon.css +1 -0
- package/lib/icon/style/index.css +2058 -0
- package/lib/icon/style/index.js +9 -0
- package/lib/identify/index.js +1081 -0
- package/lib/identify/style/css.js +9 -0
- package/lib/identify/style/identify.css +1 -0
- package/lib/identify/style/index.js +9 -0
- package/lib/iframe/index.js +344 -0
- package/lib/iframe/style/css.js +7 -0
- package/lib/iframe/style/iframe.css +1 -0
- package/lib/iframe/style/index.js +7 -0
- package/lib/image/index.js +446 -0
- package/lib/image/style/css.js +7 -0
- package/lib/image/style/image.css +1 -0
- package/lib/image/style/index.js +7 -0
- package/lib/index.js +1040 -0
- package/lib/indicator/index.js +996 -0
- package/lib/indicator/style/countTo.css +1 -0
- package/lib/indicator/style/css.js +7 -0
- package/lib/indicator/style/index.js +7 -0
- package/lib/indicator/style/indicator.css +1 -0
- package/lib/init.js +207 -0
- package/lib/input/index.js +1151 -0
- package/lib/input/style/css.js +9 -0
- package/lib/input/style/index.css +2549 -0
- package/lib/input/style/index.js +9 -0
- package/lib/input/style/input.css +1 -0
- package/lib/input-number/index.js +739 -0
- package/lib/input-number/style/css.js +9 -0
- package/lib/input-number/style/index.css +2360 -0
- package/lib/input-number/style/index.js +9 -0
- package/lib/input-number/style/input-number.css +1 -0
- package/lib/layout/index.js +700 -0
- package/lib/layout/style/css.js +9 -0
- package/lib/layout/style/index.css +2185 -0
- package/lib/layout/style/index.js +9 -0
- package/lib/layout/style/layout.css +0 -0
- package/lib/liquid-fill/index.js +983 -0
- package/lib/liquid-fill/style/css.js +7 -0
- package/lib/liquid-fill/style/index.js +7 -0
- package/lib/liquid-fill/style/liquid-fill.css +1 -0
- package/lib/marker/index.js +649 -0
- package/lib/marker/style/css.js +0 -0
- package/lib/marker/style/index.js +0 -0
- package/lib/menu/index.js +858 -0
- package/lib/menu/style/css.js +9 -0
- package/lib/menu/style/index.css +2777 -0
- package/lib/menu/style/index.js +9 -0
- package/lib/menu/style/menu.css +0 -0
- package/lib/message/index.js +174 -0
- package/lib/message/style/css.js +9 -0
- package/lib/message/style/index.css +2143 -0
- package/lib/message/style/index.js +9 -0
- package/lib/message/style/message.css +1 -0
- package/lib/modal/index.js +742 -0
- package/lib/modal/style/css.js +9 -0
- package/lib/modal/style/index.css +2289 -0
- package/lib/modal/style/index.js +9 -0
- package/lib/modal/style/modal.css +1 -0
- package/lib/nav/style/css.js +9 -0
- package/lib/nav/style/index.js +9 -0
- package/lib/nav/style/nav.css +1 -0
- package/lib/notification/index.js +151 -0
- package/lib/notification/style/css.js +9 -0
- package/lib/notification/style/index.css +2285 -0
- package/lib/notification/style/index.js +9 -0
- package/lib/notification/style/notification.css +1 -0
- package/lib/pagination/index.js +352 -0
- package/lib/pagination/style/css.js +9 -0
- package/lib/pagination/style/index.css +2529 -0
- package/lib/pagination/style/index.js +9 -0
- package/lib/pagination/style/pagination.css +1 -0
- package/lib/popup/index.js +800 -0
- package/lib/popup/style/css.js +0 -0
- package/lib/popup/style/index.js +0 -0
- package/lib/progress/index.js +1146 -0
- package/lib/progress/style/css.js +9 -0
- package/lib/progress/style/index.css +2226 -0
- package/lib/progress/style/index.js +9 -0
- package/lib/progress/style/progress.css +1 -0
- package/lib/radio/index.js +852 -0
- package/lib/radio/style/css.js +9 -0
- package/lib/radio/style/index.css +2381 -0
- package/lib/radio/style/index.js +9 -0
- package/lib/radio/style/radio.css +1 -0
- package/lib/select/index.js +836 -0
- package/lib/select/style/css.js +9 -0
- package/lib/select/style/index.css +2655 -0
- package/lib/select/style/index.js +9 -0
- package/lib/select/style/select.css +1 -0
- package/lib/slider/index.js +347 -0
- package/lib/slider/style/css.js +9 -0
- package/lib/slider/style/index.css +2233 -0
- package/lib/slider/style/index.js +9 -0
- package/lib/slider/style/slider.css +1 -0
- package/lib/slideshow/index.js +913 -0
- package/lib/slideshow/style/css.js +9 -0
- package/lib/slideshow/style/index.js +9 -0
- package/lib/slideshow/style/slideshow.css +1 -0
- package/lib/spin/index.js +357 -0
- package/lib/spin/style/css.js +9 -0
- package/lib/spin/style/index.css +2268 -0
- package/lib/spin/style/index.js +9 -0
- package/lib/spin/style/spin.css +1 -0
- package/lib/steps/index.js +748 -0
- package/lib/steps/style/css.js +9 -0
- package/lib/steps/style/index.css +2724 -0
- package/lib/steps/style/index.js +9 -0
- package/lib/steps/style/steps.css +1 -0
- package/lib/style.js +7 -0
- package/lib/switch/index.js +654 -0
- package/lib/switch/style/css.js +9 -0
- package/lib/switch/style/index.css +2241 -0
- package/lib/switch/style/index.js +9 -0
- package/lib/switch/style/switch.css +1 -0
- package/lib/table/index.js +810 -0
- package/lib/table/style/css.js +9 -0
- package/lib/table/style/index.css +2909 -0
- package/lib/table/style/index.js +9 -0
- package/lib/table/style/table.css +1 -0
- package/lib/table-popup/index.js +438 -0
- package/lib/table-popup/style/css.js +9 -0
- package/lib/table-popup/style/index.js +9 -0
- package/lib/table-popup/style/table-popup.css +1 -0
- package/lib/tabs/index.js +743 -0
- package/lib/tabs/style/css.js +9 -0
- package/lib/tabs/style/index.css +2692 -0
- package/lib/tabs/style/index.js +9 -0
- package/lib/tabs/style/tabs.css +1 -0
- package/lib/text/index.js +434 -0
- package/lib/text/style/css.js +7 -0
- package/lib/text/style/index.js +7 -0
- package/lib/text/style/text.css +1 -0
- package/lib/tile-layer/index.js +535 -0
- package/lib/tile-layer/style/css.js +0 -0
- package/lib/tile-layer/style/index.js +0 -0
- package/lib/time-line/index.js +654 -0
- package/lib/time-line/style/css.js +7 -0
- package/lib/time-line/style/index.js +7 -0
- package/lib/time-line/style/time-line.css +1 -0
- package/lib/time-picker/index.js +669 -0
- package/lib/time-picker/style/css.js +9 -0
- package/lib/time-picker/style/index.css +2418 -0
- package/lib/time-picker/style/index.js +9 -0
- package/lib/time-picker/style/time-picker.css +1 -0
- package/lib/time-range/index.js +526 -0
- package/lib/time-range/style/css.js +7 -0
- package/lib/time-range/style/index.js +7 -0
- package/lib/time-range/style/time-range.css +1 -0
- package/lib/time-slider/index.js +1169 -0
- package/lib/time-slider/style/css.js +7 -0
- package/lib/time-slider/style/index.js +7 -0
- package/lib/time-slider/style/time-slider.css +1 -0
- package/lib/time-text/index.js +393 -0
- package/lib/time-text/style/css.js +7 -0
- package/lib/time-text/style/index.js +7 -0
- package/lib/time-text/style/time-text.css +1 -0
- package/lib/tooltip/index.js +635 -0
- package/lib/tooltip/style/css.js +9 -0
- package/lib/tooltip/style/index.css +2231 -0
- package/lib/tooltip/style/index.js +9 -0
- package/lib/tooltip/style/tooltip.css +0 -0
- package/lib/transfer/index.js +636 -0
- package/lib/transfer/style/css.js +9 -0
- package/lib/transfer/style/index.css +2302 -0
- package/lib/transfer/style/index.js +9 -0
- package/lib/transfer/style/transfer.css +1 -0
- package/lib/tree/index.js +857 -0
- package/lib/tree/style/css.js +9 -0
- package/lib/tree/style/index.css +2644 -0
- package/lib/tree/style/index.js +9 -0
- package/lib/tree/style/tree.css +1 -0
- package/lib/tree-select/index.js +765 -0
- package/lib/tree-select/style/css.js +9 -0
- package/lib/tree-select/style/index.css +2508 -0
- package/lib/tree-select/style/index.js +9 -0
- package/lib/tree-select/style/tree-select.css +1 -0
- package/lib/video-player/index.js +1472 -0
- package/lib/video-player/style/css.js +11 -0
- package/lib/video-player/style/index.js +11 -0
- package/lib/video-player/style/video-player.css +1 -0
- package/lib/web-map/index.js +2241 -0
- package/lib/web-map/style/css.js +15 -0
- package/lib/web-map/style/index.js +15 -0
- package/lib/web-map/style/web-map.css +1 -0
- package/package.json +97 -0
- package/src/common/_assets/iconfont/icon-sm-components.css +245 -0
- package/src/common/_assets/iconfont/icon-sm-components.eot +0 -0
- package/src/common/_assets/iconfont/icon-sm-components.svg +197 -0
- package/src/common/_assets/iconfont/icon-sm-components.ttf +0 -0
- package/src/common/_assets/iconfont/icon-sm-components.woff +0 -0
- package/src/common/_assets/iconfont/icon-sm-components.woff2 +0 -0
- package/src/common/_lang/en.js +355 -0
- package/src/common/_lang/index.js +177 -0
- package/src/common/_lang/zh.js +342 -0
- package/src/common/_mixin/AntdRender.ts +114 -0
- package/src/common/_mixin/Card.ts +22 -0
- package/src/common/_mixin/Theme.ts +222 -0
- package/src/common/_mixin/ThirdService.ts +58 -0
- package/src/common/_mixin/Timer.ts +58 -0
- package/src/common/_mixin/VmUpdater.ts +46 -0
- package/src/common/_types/AddressMatchParameter.js +9 -0
- package/src/common/_types/GeoJSONParamter.ts +17 -0
- package/src/common/_types/RestDataParameter.js +8 -0
- package/src/common/_types/RestMapParameter.js +8 -0
- package/src/common/_types/RestParameter.js +12 -0
- package/src/common/_types/event/BaseTypes.js +24 -0
- package/src/common/_types/event/Event.js +315 -0
- package/src/common/_types/event/Events.js +353 -0
- package/src/common/_types/event/Pixel.js +177 -0
- package/src/common/_types/event/Util.js +173 -0
- package/src/common/_types/iPortalDataParameter.js +12 -0
- package/src/common/_types/iServerBaseParameter.ts +28 -0
- package/src/common/_types/iServerDataParameter.ts +13 -0
- package/src/common/_types/iServerMapParameter.ts +13 -0
- package/src/common/_utils/EchartsDataService.js +527 -0
- package/src/common/_utils/RestService.js +130 -0
- package/src/common/_utils/WebMapService.ts +1292 -0
- package/src/common/_utils/epsg-define.js +55 -0
- package/src/common/_utils/get-features.js +92 -0
- package/src/common/_utils/global-event.js +6 -0
- package/src/common/_utils/iPortalDataService.js +444 -0
- package/src/common/_utils/iServerRestService.js +487 -0
- package/src/common/_utils/statistics.js +36 -0
- package/src/common/_utils/style/color/colorPalette.ts +63 -0
- package/src/common/_utils/style/color/serialColors.ts +207 -0
- package/src/common/_utils/style/common/common.scss +39 -0
- package/src/common/_utils/style/mixins/config.scss +4 -0
- package/src/common/_utils/style/mixins/mixins.scss +48 -0
- package/src/common/_utils/style/theme/antd.less +2 -0
- package/src/common/_utils/style/theme/antdVar.less +371 -0
- package/src/common/_utils/style/theme/chart.js +548 -0
- package/src/common/_utils/style/theme/set-theme.ts +43 -0
- package/src/common/_utils/style/theme/theme.json +356 -0
- package/src/common/_utils/style/theme/theme.scss +495 -0
- package/src/common/_utils/util.js +251 -0
- package/src/common/_utils/vue-types/index.js +267 -0
- package/src/common/_utils/vue-types/utils.js +194 -0
- package/src/common/avatar/Avatar.vue +41 -0
- package/src/common/avatar/index.js +9 -0
- package/src/common/avatar/style/avatar.scss +8 -0
- package/src/common/avatar/style/index.js +4 -0
- package/src/common/avatar/style/index.less +3 -0
- package/src/common/border/Border.vue +121 -0
- package/src/common/border/assets/border.config.json +67 -0
- package/src/common/border/assets/image/border1.png +0 -0
- package/src/common/border/assets/image/border10.png +0 -0
- package/src/common/border/assets/image/border11.png +0 -0
- package/src/common/border/assets/image/border12.png +0 -0
- package/src/common/border/assets/image/border13.png +0 -0
- package/src/common/border/assets/image/border2.png +0 -0
- package/src/common/border/assets/image/border3.png +0 -0
- package/src/common/border/assets/image/border4.png +0 -0
- package/src/common/border/assets/image/border5.png +0 -0
- package/src/common/border/assets/image/border6.png +0 -0
- package/src/common/border/assets/image/border7.png +0 -0
- package/src/common/border/assets/image/border8.png +0 -0
- package/src/common/border/assets/image/border9.png +0 -0
- package/src/common/border/index.js +9 -0
- package/src/common/border/style/border.scss +19 -0
- package/src/common/border/style/index.js +4 -0
- package/src/common/breadcrumb/Breadcrumb.vue +21 -0
- package/src/common/breadcrumb/BreadcrumbItem.vue +21 -0
- package/src/common/breadcrumb/BreadcrumbSeparator.vue +19 -0
- package/src/common/breadcrumb/index.js +13 -0
- package/src/common/breadcrumb/style/breadcrumb.scss +21 -0
- package/src/common/breadcrumb/style/index.js +4 -0
- package/src/common/breadcrumb/style/index.less +3 -0
- package/src/common/button/Button.vue +34 -0
- package/src/common/button/Group.vue +31 -0
- package/src/common/button/index.js +11 -0
- package/src/common/button/style/button.scss +91 -0
- package/src/common/button/style/index.js +4 -0
- package/src/common/button/style/index.less +3 -0
- package/src/common/button/style/mixin.scss +56 -0
- package/src/common/card/Card.vue +32 -0
- package/src/common/card/Grid.vue +20 -0
- package/src/common/card/Meta.vue +20 -0
- package/src/common/card/index.js +13 -0
- package/src/common/card/style/card.scss +43 -0
- package/src/common/card/style/index.js +4 -0
- package/src/common/card/style/index.less +3 -0
- package/src/common/chart/ChartMixin.vue +1572 -0
- package/src/common/chart/index.js +9 -0
- package/src/common/chart/style/chart.scss +10 -0
- package/src/common/chart/style/index.js +5 -0
- package/src/common/checkbox/Checkbox.vue +37 -0
- package/src/common/checkbox/Group.vue +36 -0
- package/src/common/checkbox/index.js +11 -0
- package/src/common/checkbox/style/checkbox.scss +40 -0
- package/src/common/checkbox/style/index.js +4 -0
- package/src/common/checkbox/style/index.less +3 -0
- package/src/common/collapse/Collapse.vue +32 -0
- package/src/common/collapse/Panel.vue +26 -0
- package/src/common/collapse/index.js +11 -0
- package/src/common/collapse/style/collapse.scss +10 -0
- package/src/common/collapse/style/index.js +4 -0
- package/src/common/collapse/style/index.less +3 -0
- package/src/common/collapse-card/CollapseCard.vue +150 -0
- package/src/common/collapse-card/index.js +9 -0
- package/src/common/collapse-card/style/collapse-card.scss +176 -0
- package/src/common/collapse-card/style/index.js +4 -0
- package/src/common/color-picker/ColorPicker.vue +106 -0
- package/src/common/color-picker/index.js +9 -0
- package/src/common/color-picker/style/color-picker.scss +37 -0
- package/src/common/color-picker/style/index.js +4 -0
- package/src/common/config-provider/ConfigProvider.vue +31 -0
- package/src/common/config-provider/index.js +9 -0
- package/src/common/date-picker/BaseMixin.vue +23 -0
- package/src/common/date-picker/DatePicker.vue +20 -0
- package/src/common/date-picker/MonthPicker.vue +20 -0
- package/src/common/date-picker/RangePicker.vue +20 -0
- package/src/common/date-picker/WeekPicker.vue +20 -0
- package/src/common/date-picker/index.js +15 -0
- package/src/common/date-picker/style/date-picker.scss +290 -0
- package/src/common/date-picker/style/index.js +4 -0
- package/src/common/date-picker/style/index.less +3 -0
- package/src/common/date-picker/style/mixin.scss +75 -0
- package/src/common/dropdown/Dropdown.vue +31 -0
- package/src/common/dropdown/index.js +9 -0
- package/src/common/dropdown/style/dropdown.scss +22 -0
- package/src/common/dropdown/style/index.js +4 -0
- package/src/common/dropdown/style/index.less +3 -0
- package/src/common/empty/Empty.vue +26 -0
- package/src/common/empty/RenderEmpty.ts +50 -0
- package/src/common/empty/assets/image/empty.png +0 -0
- package/src/common/empty/index.js +9 -0
- package/src/common/empty/style/empty.scss +31 -0
- package/src/common/empty/style/index.js +4 -0
- package/src/common/empty/style/index.less +3 -0
- package/src/common/icon/Icon.vue +66 -0
- package/src/common/icon/index.js +9 -0
- package/src/common/icon/style/icon.scss +12 -0
- package/src/common/icon/style/index.js +4 -0
- package/src/common/icon/style/index.less +3 -0
- package/src/common/iframe/Iframe.vue +17 -0
- package/src/common/iframe/index.js +9 -0
- package/src/common/iframe/style/iframe.scss +7 -0
- package/src/common/iframe/style/index.js +4 -0
- package/src/common/image/Image.vue +83 -0
- package/src/common/image/index.js +9 -0
- package/src/common/image/style/image.scss +33 -0
- package/src/common/image/style/index.js +4 -0
- package/src/common/indicator/CountTo.vue +92 -0
- package/src/common/indicator/Indicator.vue +308 -0
- package/src/common/indicator/index.js +11 -0
- package/src/common/indicator/style/countTo.scss +7 -0
- package/src/common/indicator/style/index.js +4 -0
- package/src/common/indicator/style/indicator.scss +47 -0
- package/src/common/input/BaseMixin.vue +24 -0
- package/src/common/input/Group.vue +31 -0
- package/src/common/input/Input.vue +41 -0
- package/src/common/input/Password.vue +41 -0
- package/src/common/input/Search.vue +40 -0
- package/src/common/input/TextArea.vue +25 -0
- package/src/common/input/index.js +17 -0
- package/src/common/input/style/index.js +4 -0
- package/src/common/input/style/index.less +3 -0
- package/src/common/input/style/input.scss +72 -0
- package/src/common/input/style/mixin.scss +42 -0
- package/src/common/input-number/InputNumber.vue +44 -0
- package/src/common/input-number/index.js +9 -0
- package/src/common/input-number/style/index.js +4 -0
- package/src/common/input-number/style/index.less +3 -0
- package/src/common/input-number/style/input-number.scss +43 -0
- package/src/common/layout/Content.vue +25 -0
- package/src/common/layout/Footer.vue +25 -0
- package/src/common/layout/Header.vue +25 -0
- package/src/common/layout/Layout.vue +25 -0
- package/src/common/layout/Sider.vue +33 -0
- package/src/common/layout/index.js +17 -0
- package/src/common/layout/style/index.js +4 -0
- package/src/common/layout/style/index.less +3 -0
- package/src/common/layout/style/layout.scss +5 -0
- package/src/common/liquid-fill/LiquidFill.vue +209 -0
- package/src/common/liquid-fill/index.js +9 -0
- package/src/common/liquid-fill/style/index.js +4 -0
- package/src/common/liquid-fill/style/liquid-fill.scss +6 -0
- package/src/common/menu/Menu.vue +31 -0
- package/src/common/menu/MenuItem.vue +37 -0
- package/src/common/menu/SubMenu.vue +51 -0
- package/src/common/menu/index.js +13 -0
- package/src/common/menu/style/index.js +4 -0
- package/src/common/menu/style/index.less +3 -0
- package/src/common/menu/style/menu.scss +0 -0
- package/src/common/message/Message.js +12 -0
- package/src/common/message/index.js +3 -0
- package/src/common/message/style/index.js +4 -0
- package/src/common/message/style/index.less +3 -0
- package/src/common/message/style/message.scss +16 -0
- package/src/common/modal/Modal.vue +64 -0
- package/src/common/modal/index.js +9 -0
- package/src/common/modal/main.ts +49 -0
- package/src/common/modal/style/index.js +4 -0
- package/src/common/modal/style/index.less +3 -0
- package/src/common/modal/style/modal.scss +23 -0
- package/src/common/nav/Nav.vue +158 -0
- package/src/common/nav/assets/image/background_image.png +0 -0
- package/src/common/nav/assets/image/item_active.png +0 -0
- package/src/common/nav/index.js +9 -0
- package/src/common/nav/style/index.js +5 -0
- package/src/common/nav/style/nav.scss +55 -0
- package/src/common/notification/Notification.js +10 -0
- package/src/common/notification/index.js +3 -0
- package/src/common/notification/style/index.js +4 -0
- package/src/common/notification/style/index.less +3 -0
- package/src/common/notification/style/notification.scss +30 -0
- package/src/common/pagination/Pagination.vue +32 -0
- package/src/common/pagination/index.js +9 -0
- package/src/common/pagination/style/index.js +4 -0
- package/src/common/pagination/style/index.less +3 -0
- package/src/common/pagination/style/pagination.scss +131 -0
- package/src/common/progress/Progress.vue +98 -0
- package/src/common/progress/index.js +9 -0
- package/src/common/progress/style/index.js +4 -0
- package/src/common/progress/style/index.less +3 -0
- package/src/common/progress/style/progress.scss +43 -0
- package/src/common/radio/Button.vue +18 -0
- package/src/common/radio/Group.vue +48 -0
- package/src/common/radio/Radio.vue +36 -0
- package/src/common/radio/index.js +13 -0
- package/src/common/radio/style/index.js +4 -0
- package/src/common/radio/style/index.less +3 -0
- package/src/common/radio/style/radio.scss +127 -0
- package/src/common/select/OptGroup.vue +20 -0
- package/src/common/select/Option.vue +22 -0
- package/src/common/select/Select.vue +49 -0
- package/src/common/select/index.js +13 -0
- package/src/common/select/style/index.js +4 -0
- package/src/common/select/style/index.less +3 -0
- package/src/common/select/style/select.scss +140 -0
- package/src/common/slider/Slider.vue +31 -0
- package/src/common/slider/index.js +9 -0
- package/src/common/slider/style/index.js +4 -0
- package/src/common/slider/style/index.less +3 -0
- package/src/common/slider/style/slider.scss +8 -0
- package/src/common/slideshow/Slideshow.vue +354 -0
- package/src/common/slideshow/SlideshowItem.vue +17 -0
- package/src/common/slideshow/Swiper.js +29 -0
- package/src/common/slideshow/index.js +11 -0
- package/src/common/slideshow/style/index.js +5 -0
- package/src/common/slideshow/style/slideshow.scss +48 -0
- package/src/common/spin/Spin.vue +17 -0
- package/src/common/spin/index.js +9 -0
- package/src/common/spin/main.ts +13 -0
- package/src/common/spin/style/index.js +4 -0
- package/src/common/spin/style/index.less +3 -0
- package/src/common/spin/style/spin.scss +14 -0
- package/src/common/steps/Step.vue +33 -0
- package/src/common/steps/Steps.vue +39 -0
- package/src/common/steps/index.js +11 -0
- package/src/common/steps/style/index.js +4 -0
- package/src/common/steps/style/index.less +3 -0
- package/src/common/steps/style/mixin.scss +67 -0
- package/src/common/steps/style/steps.scss +98 -0
- package/src/common/switch/Switch.vue +41 -0
- package/src/common/switch/index.js +9 -0
- package/src/common/switch/style/index.js +4 -0
- package/src/common/switch/style/index.less +3 -0
- package/src/common/switch/style/switch.scss +20 -0
- package/src/common/table/Column.vue +18 -0
- package/src/common/table/ColumnGroup.vue +19 -0
- package/src/common/table/Table.vue +18 -0
- package/src/common/table/index.js +13 -0
- package/src/common/table/style/index.js +4 -0
- package/src/common/table/style/index.less +3 -0
- package/src/common/table/style/table.scss +138 -0
- package/src/common/table-popup/TablePopup.vue +73 -0
- package/src/common/table-popup/index.js +9 -0
- package/src/common/table-popup/style/index.js +5 -0
- package/src/common/table-popup/style/table-popup.scss +52 -0
- package/src/common/tabs/TabPane.vue +26 -0
- package/src/common/tabs/Tabs.vue +41 -0
- package/src/common/tabs/index.js +11 -0
- package/src/common/tabs/style/index.js +4 -0
- package/src/common/tabs/style/index.less +3 -0
- package/src/common/tabs/style/tabs.scss +95 -0
- package/src/common/text/Text.vue +69 -0
- package/src/common/text/index.js +9 -0
- package/src/common/text/style/index.js +4 -0
- package/src/common/text/style/text.scss +23 -0
- package/src/common/time-line/TimeLine.vue +260 -0
- package/src/common/time-line/index.js +9 -0
- package/src/common/time-line/style/index.js +4 -0
- package/src/common/time-line/style/time-line.scss +10 -0
- package/src/common/time-picker/TimePicker.vue +47 -0
- package/src/common/time-picker/index.js +9 -0
- package/src/common/time-picker/style/index.js +4 -0
- package/src/common/time-picker/style/index.less +3 -0
- package/src/common/time-picker/style/time-picker.scss +69 -0
- package/src/common/time-range/TimeRange.vue +122 -0
- package/src/common/time-range/index.js +9 -0
- package/src/common/time-range/style/index.js +4 -0
- package/src/common/time-range/style/time-range.scss +10 -0
- package/src/common/time-slider/TimeSlider.vue +591 -0
- package/src/common/time-slider/index.js +9 -0
- package/src/common/time-slider/style/index.js +4 -0
- package/src/common/time-slider/style/mixin.scss +36 -0
- package/src/common/time-slider/style/time-slider.scss +147 -0
- package/src/common/time-text/TimeText.vue +51 -0
- package/src/common/time-text/index.js +9 -0
- package/src/common/time-text/style/index.js +4 -0
- package/src/common/time-text/style/time-text.scss +14 -0
- package/src/common/tooltip/Tooltip.vue +21 -0
- package/src/common/tooltip/index.js +9 -0
- package/src/common/tooltip/style/index.js +4 -0
- package/src/common/tooltip/style/index.less +3 -0
- package/src/common/tooltip/style/tooltip.scss +5 -0
- package/src/common/transfer/Transfer.vue +19 -0
- package/src/common/transfer/index.js +9 -0
- package/src/common/transfer/style/index.js +4 -0
- package/src/common/transfer/style/index.less +3 -0
- package/src/common/transfer/style/transfer.scss +52 -0
- package/src/common/tree/DirectoryTree.vue +32 -0
- package/src/common/tree/Tree.vue +32 -0
- package/src/common/tree/TreeNode.vue +49 -0
- package/src/common/tree/index.js +13 -0
- package/src/common/tree/style/index.js +4 -0
- package/src/common/tree/style/index.less +3 -0
- package/src/common/tree/style/tree.scss +16 -0
- package/src/common/tree-select/TreeSelect.vue +43 -0
- package/src/common/tree-select/TreeSelectNode.vue +49 -0
- package/src/common/tree-select/index.js +11 -0
- package/src/common/tree-select/style/index.js +4 -0
- package/src/common/tree-select/style/index.less +3 -0
- package/src/common/tree-select/style/tree-select.scss +38 -0
- package/src/common/video-player/VideoPlayer.vue +423 -0
- package/src/common/video-player/index.js +9 -0
- package/src/common/video-player/style/index.js +5 -0
- package/src/common/video-player/style/video-player.scss +266 -0
- package/src/common/web-map/WebMapBase.ts +1178 -0
- package/src/common/web-map/config/MunicipalCenter.json +1 -0
- package/src/common/web-map/config/ProvinceCenter.json +1 -0
- package/src/image.d.ts +7 -0
- package/src/init.js +38 -0
- package/src/leaflet/README.md +31 -0
- package/src/leaflet/_mixin/GridLayer.js +33 -0
- package/src/leaflet/_mixin/Layer.js +26 -0
- package/src/leaflet/_mixin/Options.js +10 -0
- package/src/leaflet/_mixin/Popper.js +25 -0
- package/src/leaflet/_mixin/TileLayer.js +18 -0
- package/src/leaflet/_mixin/map-getter.ts +122 -0
- package/src/leaflet/_types/index.js +17 -0
- package/src/leaflet/_types/map-event.js +34 -0
- package/src/leaflet/_utils/props-binder.js +23 -0
- package/src/leaflet/chart/Chart.vue +25 -0
- package/src/leaflet/chart/ChartViewModel.js +44 -0
- package/src/leaflet/chart/index.js +9 -0
- package/src/leaflet/components.ts +206 -0
- package/src/leaflet/css.js +3 -0
- package/src/leaflet/entrys.json +106 -0
- package/src/leaflet/identify/Identify.vue +233 -0
- package/src/leaflet/identify/IdentifyViewModel.js +114 -0
- package/src/leaflet/identify/index.js +9 -0
- package/src/leaflet/identify/style/identify.scss +30 -0
- package/src/leaflet/identify/style/index.js +4 -0
- package/src/leaflet/index.ts +5 -0
- package/src/leaflet/leaflet-wrapper.js +125 -0
- package/src/leaflet/marker/Marker.vue +46 -0
- package/src/leaflet/marker/MarkerViewModel.js +31 -0
- package/src/leaflet/marker/index.js +9 -0
- package/src/leaflet/package.json +97 -0
- package/src/leaflet/popup/Popup.vue +93 -0
- package/src/leaflet/popup/PopupViewModel.js +75 -0
- package/src/leaflet/popup/index.js +9 -0
- package/src/leaflet/style.js +3 -0
- package/src/leaflet/style.scss +52 -0
- package/src/leaflet/web-map/WebMap.vue +213 -0
- package/src/leaflet/web-map/WebMapViewModel.ts +1102 -0
- package/src/leaflet/web-map/_mixin/map-events.ts +65 -0
- package/src/leaflet/web-map/index.js +9 -0
- package/src/leaflet/web-map/layer/tile/TileLayer.vue +88 -0
- package/src/leaflet/web-map/layer/tile/TileLayerViewModel.js +66 -0
- package/src/leaflet/web-map/layer/tile/index.js +9 -0
- package/src/leaflet/web-map/style/index.js +7 -0
- package/src/leaflet/web-map/style/web-map.scss +32 -0
- package/src/sfc.d.ts +50 -0
- package/src/vue-i18n.d.ts +26 -0
- package/src/vue-options.d.ts +18 -0
- package/static/libs/echarts-layer/EchartsLayer.js +390 -0
- package/static/libs/geostats/geostats.js +1227 -0
- package/static/libs/iclient-common/iclient-common.js +2 -0
- package/static/libs/iclient-leaflet/iclient-leaflet.min.css +8 -0
- package/static/libs/iclient-leaflet/iclient-leaflet.min.js +1741 -0
- package/static/libs/json-sql/jsonsql.js +125 -0
- 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>
|