Skip to content

Commit

Permalink
feat(projects): 补充更多的ECharts示例
Browse files Browse the repository at this point in the history
ISSUES CLOSED: \
  • Loading branch information
honghuangdc committed May 31, 2022
1 parent 4558c24 commit c776249
Show file tree
Hide file tree
Showing 5 changed files with 635 additions and 160 deletions.
164 changes: 82 additions & 82 deletions mock/model/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,47 @@ export const routeModel: Record<Auth.RoleType, AuthRoute.Route[]> = {
path: '/plugin',
component: 'basic',
children: [
{
name: 'plugin_charts',
path: '/plugin/charts',
component: 'multi',
children: [
{
name: 'plugin_charts_echarts',
path: '/plugin/charts/echarts',
component: 'self',
meta: {
title: 'ECharts',
requiresAuth: true,
icon: 'simple-icons:apacheecharts'
}
},
{
name: 'plugin_charts_d3',
path: '/plugin/charts/d3',
component: 'self',
meta: {
title: 'D3',
requiresAuth: true,
icon: 'simple-icons:d3dotjs'
}
},
{
name: 'plugin_charts_antv',
path: '/plugin/charts/antv',
component: 'self',
meta: {
title: 'AntV',
requiresAuth: true,
icon: 'ant-design:bar-chart-outlined'
}
}
],
meta: {
title: '图表',
icon: 'material-symbols:bar-chart-rounded'
}
},
{
name: 'plugin_map',
path: '/plugin/map',
Expand Down Expand Up @@ -221,47 +262,6 @@ export const routeModel: Record<Auth.RoleType, AuthRoute.Route[]> = {
requiresAuth: true,
icon: 'ic:baseline-local-printshop'
}
},
{
name: 'plugin_charts',
path: '/plugin/charts',
component: 'multi',
children: [
{
name: 'plugin_charts_echarts',
path: '/plugin/charts/echarts',
component: 'self',
meta: {
title: 'ECharts',
requiresAuth: true,
icon: 'simple-icons:apacheecharts'
}
},
{
name: 'plugin_charts_d3',
path: '/plugin/charts/d3',
component: 'self',
meta: {
title: 'D3',
requiresAuth: true,
icon: 'simple-icons:d3dotjs'
}
},
{
name: 'plugin_charts_antv',
path: '/plugin/charts/antv',
component: 'self',
meta: {
title: 'AntV',
requiresAuth: true,
icon: 'ant-design:bar-chart-outlined'
}
}
],
meta: {
title: '图表',
icon: 'material-symbols:bar-chart-rounded'
}
}
],
meta: {
Expand Down Expand Up @@ -543,6 +543,47 @@ export const routeModel: Record<Auth.RoleType, AuthRoute.Route[]> = {
path: '/plugin',
component: 'basic',
children: [
{
name: 'plugin_charts',
path: '/plugin/charts',
component: 'multi',
children: [
{
name: 'plugin_charts_echarts',
path: '/plugin/charts/echarts',
component: 'self',
meta: {
title: 'ECharts',
requiresAuth: true,
icon: 'simple-icons:apacheecharts'
}
},
{
name: 'plugin_charts_d3',
path: '/plugin/charts/d3',
component: 'self',
meta: {
title: 'D3',
requiresAuth: true,
icon: 'simple-icons:d3dotjs'
}
},
{
name: 'plugin_charts_antv',
path: '/plugin/charts/antv',
component: 'self',
meta: {
title: 'AntV',
requiresAuth: true,
icon: 'ant-design:bar-chart-outlined'
}
}
],
meta: {
title: '图表',
icon: 'material-symbols:bar-chart-rounded'
}
},
{
name: 'plugin_map',
path: '/plugin/map',
Expand Down Expand Up @@ -633,47 +674,6 @@ export const routeModel: Record<Auth.RoleType, AuthRoute.Route[]> = {
requiresAuth: true,
icon: 'ic:baseline-local-printshop'
}
},
{
name: 'plugin_charts',
path: '/plugin/charts',
component: 'multi',
children: [
{
name: 'plugin_charts_echarts',
path: '/plugin/charts/echarts',
component: 'self',
meta: {
title: 'ECharts',
requiresAuth: true,
icon: 'simple-icons:apacheecharts'
}
},
{
name: 'plugin_charts_d3',
path: '/plugin/charts/d3',
component: 'self',
meta: {
title: 'D3',
requiresAuth: true,
icon: 'simple-icons:d3dotjs'
}
},
{
name: 'plugin_charts_antv',
path: '/plugin/charts/antv',
component: 'self',
meta: {
title: 'AntV',
requiresAuth: true,
icon: 'ant-design:bar-chart-outlined'
}
}
],
meta: {
title: '图表',
icon: 'material-symbols:bar-chart-rounded'
}
}
],
meta: {
Expand Down
18 changes: 16 additions & 2 deletions src/composables/echarts.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { ref, watch, nextTick, onUnmounted } from 'vue';
import type { Ref, ComputedRef } from 'vue';
import * as echarts from 'echarts/core';
import { BarChart, LineChart, PieChart, ScatterChart } from 'echarts/charts';
import type { BarSeriesOption, LineSeriesOption, PieSeriesOption, ScatterSeriesOption } from 'echarts/charts';
import { BarChart, LineChart, PieChart, ScatterChart, PictorialBarChart, RadarChart, GaugeChart } from 'echarts/charts';
import type {
BarSeriesOption,
LineSeriesOption,
PieSeriesOption,
ScatterSeriesOption,
PictorialBarSeriesOption,
RadarSeriesOption,
GaugeSeriesOption
} from 'echarts/charts';
import {
TitleComponent,
LegendComponent,
Expand Down Expand Up @@ -30,6 +38,9 @@ export type ECOption = echarts.ComposeOption<
| LineSeriesOption
| PieSeriesOption
| ScatterSeriesOption
| PictorialBarSeriesOption
| RadarSeriesOption
| GaugeSeriesOption
| TitleComponentOption
| LegendComponentOption
| TooltipComponentOption
Expand All @@ -50,6 +61,9 @@ echarts.use([
LineChart,
PieChart,
ScatterChart,
PictorialBarChart,
RadarChart,
GaugeChart,
LabelLayout,
UniversalTransition,
CanvasRenderer
Expand Down
43 changes: 0 additions & 43 deletions src/router/modules/charts.ts

This file was deleted.

41 changes: 41 additions & 0 deletions src/router/modules/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,47 @@ const plugin: AuthRoute.Route = {
path: '/plugin',
component: 'basic',
children: [
{
name: 'plugin_charts',
path: '/plugin/charts',
component: 'multi',
children: [
{
name: 'plugin_charts_echarts',
path: '/plugin/charts/echarts',
component: 'self',
meta: {
title: 'ECharts',
requiresAuth: true,
icon: 'simple-icons:apacheecharts'
}
},
{
name: 'plugin_charts_d3',
path: '/plugin/charts/d3',
component: 'self',
meta: {
title: 'D3',
requiresAuth: true,
icon: 'simple-icons:d3dotjs'
}
},
{
name: 'plugin_charts_antv',
path: '/plugin/charts/antv',
component: 'self',
meta: {
title: 'AntV',
requiresAuth: true,
icon: 'ant-design:bar-chart-outlined'
}
}
],
meta: {
title: '图表',
icon: 'material-symbols:bar-chart-rounded'
}
},
{
name: 'plugin_map',
path: '/plugin/map',
Expand Down
Loading

1 comment on commit c776249

@vercel
Copy link

@vercel vercel bot commented on c776249 May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.