Skip to content

Commit

Permalink
perf(web ui): dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
xudaotutou authored and hengyunabc committed Nov 18, 2022
1 parent f74167b commit e9e2c57
Show file tree
Hide file tree
Showing 10 changed files with 309 additions and 379 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<script setup lang="ts">
import Chart from "./Base.vue"
import * as echarts from 'echarts/core';
import { DatasetComponentOption, DataZoomComponent, DataZoomComponentOption, GridComponent, GridComponentOption, LegendComponent, LegendComponentOption, TitleComponentOption, ToolboxComponentOption, TooltipComponentOption } from 'echarts/components';
import { BarChart, BarSeriesOption, } from 'echarts/charts';
import { DataZoomComponent, GridComponent } from 'echarts/components';
import { BarChart,} from 'echarts/charts';
import { LabelLayout } from 'echarts/features';
import { BarChartOption } from "@/echart";
let useList = ([
// LegendComponent,
BarChart,
LabelLayout,
GridComponent,
Expand Down
10 changes: 2 additions & 8 deletions web-ui/arthasWebConsole/all/ui/ui/src/components/charts/Base.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
<script setup lang="ts">
import * as echarts from 'echarts/core';
import { SVGRenderer } from 'echarts/renderers';
import { TitleComponent, TitleComponentOption, TooltipComponent, TooltipComponentOption, ToolboxComponent, LegendComponent} from 'echarts/components'
import { TitleComponent, TooltipComponent, ToolboxComponent, LegendComponent} from 'echarts/components'
import { onBeforeUnmount, onMounted, Ref, ref, watch } from 'vue';
// option && myChart.setOption(option);
type GetTuple<T extends unknown> = T extends T
? T extends [...infer E]
? T extends [...infer _E]
? T
: never
: never
type UseType = GetTuple<Parameters<typeof echarts.use>[0]>
// echarts.ECharts
type OptionType = Parameters<echarts.ECharts["setOption"]>[0]
const props = defineProps<{
useList: UseType,
option: OptionType,
}>()
// type EChartsOption = echarts.ComposeOption<TooltipComponentOption | TitleComponentOption | DatasetComponentOption | PieSeriesOption>;
const container = ref(null)
let myChart: echarts.ECharts
echarts.use([
Expand All @@ -36,7 +31,6 @@ const resizeDom = () => {
myChart && myChart.resize()
}
onMounted(() => {
// container.value.el.id = chartId.toString()
let dom = container.value
myChart = echarts.init(dom as unknown as HTMLElement)
myChart && myChart.setOption<OptionType>({
Expand Down
20 changes: 0 additions & 20 deletions web-ui/arthasWebConsole/all/ui/ui/src/components/charts/Circle.vue

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup lang="ts">
import Chart from "./Base.vue"
import * as echarts from 'echarts/core';
import { DataZoomComponent, GridComponent } from 'echarts/components';
import { LineChart } from 'echarts/charts';
import { LabelLayout } from 'echarts/features';
Expand Down
7 changes: 0 additions & 7 deletions web-ui/arthasWebConsole/all/ui/ui/src/echart.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,3 @@ type BarChartOption = echarts.ComposeOption<
| ToolboxComponentOption
>;

type CircleChartOption = echarts.ComposeOption<
| TooltipComponentOption
| TitleComponentOption
| DatasetComponentOption
| PieSeriesOption
| LegendComponentOption
>;
6 changes: 6 additions & 0 deletions web-ui/arthasWebConsole/all/ui/ui/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import router from "./router/index";
import { createPinia } from "pinia";
import App from "./App.vue";
import "highlight.js/styles/stackoverflow-light.css";
import timezone from "dayjs/plugin/timezone"
import utc from "dayjs/plugin/utc"
import dayjs from "dayjs";
dayjs.extend(utc)
dayjs.extend(timezone)

const app = createApp(App);

app.use(router)
Expand Down
Loading

0 comments on commit e9e2c57

Please sign in to comment.