Commit a83c15c1 authored by nick zheng's avatar nick zheng

Merge branch 'beta' into 'master'

chore: echart渲染类型更换&调整agent应用分析样式

See merge request !110
parents 836eb59b 91ee4115
...@@ -34,10 +34,8 @@ watch( ...@@ -34,10 +34,8 @@ watch(
) )
const chartResizeHandler = debounce(() => { const chartResizeHandler = debounce(() => {
if (customChart.value) { customChart.value?.resize()
customChart.value.resize() }, 200)
}
}, 100)
onMounted(() => { onMounted(() => {
drawEChart() drawEChart()
...@@ -54,7 +52,7 @@ function drawEChart() { ...@@ -54,7 +52,7 @@ function drawEChart() {
customChart.value.dispose() customChart.value.dispose()
} }
customChart.value = echarts.init(customChartRef.value as HTMLDivElement) customChart.value = echarts.init(customChartRef.value as HTMLDivElement, null, { renderer: 'svg' })
customChart.value?.setOption(props.option, true) customChart.value?.setOption(props.option, true)
} }
......
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
ToolboxComponent, ToolboxComponent,
} from 'echarts/components' } from 'echarts/components'
import { LabelLayout, UniversalTransition } from 'echarts/features' import { LabelLayout, UniversalTransition } from 'echarts/features'
import { CanvasRenderer } from 'echarts/renderers' import { SVGRenderer } from 'echarts/renderers'
import type { BarSeriesOption, PieSeriesOption, LineSeriesOption } from 'echarts/charts' import type { BarSeriesOption, PieSeriesOption, LineSeriesOption } from 'echarts/charts'
import type { import type {
TitleComponentOption, TitleComponentOption,
...@@ -31,7 +31,7 @@ Echarts.use([ ...@@ -31,7 +31,7 @@ Echarts.use([
ToolboxComponent, ToolboxComponent,
LabelLayout, LabelLayout,
UniversalTransition, UniversalTransition,
CanvasRenderer, SVGRenderer,
BarChart, BarChart,
PieChart, PieChart,
LineChart, LineChart,
......
...@@ -19,7 +19,7 @@ const defaultEchartOption: EChartsOption = { ...@@ -19,7 +19,7 @@ const defaultEchartOption: EChartsOption = {
title: [ title: [
{ {
subtext: t('analysis_module.send_messages'), subtext: t('analysis_module.send_messages'),
left: '27%', left: '26.8%',
top: '175px', top: '175px',
subtextStyle: { subtextStyle: {
fontSize: 14, fontSize: 14,
......
...@@ -118,7 +118,7 @@ function defaultEchartOption( ...@@ -118,7 +118,7 @@ function defaultEchartOption(
grid: { grid: {
left: '58px', left: '58px',
right: '40px', right: '40px',
bottom: '18px', bottom: '20px',
}, },
color: ['#000DFF'], color: ['#000DFF'],
} }
...@@ -203,29 +203,35 @@ async function handleUpdateDateRange(_value: [number, number], formattedValue: [ ...@@ -203,29 +203,35 @@ async function handleUpdateDateRange(_value: [number, number], formattedValue: [
</div> </div>
</div> </div>
<div class="mb-10 flex flex-1"> <div class="mb-10 grid h-full grid-cols-3">
<div class="text-font-color relative h-full flex-1 border-r border-r-[#E2E2E2]"> <div class="text-font-color relative h-full w-full border-r border-r-[#E2E2E2]">
<div class="absolute left-1/2 flex translate-x-[-50%] items-center gap-[5px]"> <div class="absolute left-1/2 flex translate-x-[-50%] items-center gap-[5px]">
<i class="iconfont icon-user text-[14px]" /> <i class="iconfont icon-user text-[14px]" />
<span>{{ t('analysis_module.agent_users') }}</span> <span>{{ t('analysis_module.agent_users') }}</span>
</div> </div>
<CustomEchart ref="usageEchartRef" :option="usageEchartOption" /> <div class="h-full w-full">
<CustomEchart ref="usageEchartRef" :option="usageEchartOption" />
</div>
</div> </div>
<div class="text-font-color relative h-full flex-1 border-r border-r-[#E2E2E2]"> <div class="text-font-color relative h-full border-r border-r-[#E2E2E2]">
<div class="absolute left-1/2 flex translate-x-[-50%] items-center gap-[5px]"> <div class="absolute left-1/2 flex translate-x-[-50%] items-center gap-[5px]">
<i class="iconfont icon-send-times text-[14px]" /> <i class="iconfont icon-send-times text-[14px]" />
<span>{{ t('analysis_module.send_messages') }}</span> <span>{{ t('analysis_module.send_messages') }}</span>
</div> </div>
<CustomEchart ref="sendMessagesEchartRef" :option="sendTimesEchartOption" /> <div class="h-full w-full">
<CustomEchart ref="sendMessagesEchartRef" :option="sendTimesEchartOption" />
</div>
</div> </div>
<div class="relative h-full flex-1"> <div class="relative h-full">
<div class="absolute left-1/2 flex translate-x-[-50%] items-center gap-[5px]"> <div class="absolute left-1/2 flex translate-x-[-50%] items-center gap-[5px]">
<i class="iconfont icon-consume text-[14px]" /> <i class="iconfont icon-consume text-[14px]" />
<span>{{ t('analysis_module.consume_points') }}</span> <span>{{ t('analysis_module.consume_points') }}</span>
</div> </div>
<CustomEchart ref="consumePointsEchartRef" :option="consumePointsEchartOption" /> <div class="h-full w-full">
<CustomEchart ref="consumePointsEchartRef" :option="consumePointsEchartOption" />
</div>
</div> </div>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment