Commit 836eb59b authored by nick zheng's avatar nick zheng

Merge branch 'beta' into 'master'

chore: agent应用分析样式调整

See merge request !109
parents 165b230d b7a4f248
...@@ -19,8 +19,8 @@ const defaultEchartOption: EChartsOption = { ...@@ -19,8 +19,8 @@ const defaultEchartOption: EChartsOption = {
title: [ title: [
{ {
subtext: t('analysis_module.send_messages'), subtext: t('analysis_module.send_messages'),
left: '24.5%', left: '27%',
top: '190px', top: '175px',
subtextStyle: { subtextStyle: {
fontSize: 14, fontSize: 14,
color: '#333333', color: '#333333',
...@@ -29,8 +29,8 @@ const defaultEchartOption: EChartsOption = { ...@@ -29,8 +29,8 @@ const defaultEchartOption: EChartsOption = {
}, },
{ {
subtext: t('analysis_module.consume_points'), subtext: t('analysis_module.consume_points'),
left: '74.5%', left: '72%',
top: '190px', top: '175px',
subtextStyle: { subtextStyle: {
fontSize: 14, fontSize: 14,
color: '#333333', color: '#333333',
...@@ -41,9 +41,8 @@ const defaultEchartOption: EChartsOption = { ...@@ -41,9 +41,8 @@ const defaultEchartOption: EChartsOption = {
legend: { legend: {
top: '20px', top: '20px',
right: '54px', right: '54px',
data: [{ name: t(ChannelText.link_share) }, { name: t(ChannelText.mall) }],
}, },
color: ['#00C2FF', '#454FFF'], color: ['#454FFF', '#00C2FF'],
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
textStyle: { textStyle: {
...@@ -53,10 +52,11 @@ const defaultEchartOption: EChartsOption = { ...@@ -53,10 +52,11 @@ const defaultEchartOption: EChartsOption = {
series: [ series: [
{ {
type: 'pie', type: 'pie',
top: '90px', top: '60px',
radius: ['50%', '70%'], radius: ['50%', '70%'],
center: ['50%', '50%'], center: ['50%', '50%'],
encode: { value: 'count1', itemName: 'channel' }, encode: { value: 'count1', itemName: 'channel' },
clockwise: false,
label: { label: {
position: 'outer', position: 'outer',
alignTo: 'labelLine', alignTo: 'labelLine',
...@@ -64,21 +64,22 @@ const defaultEchartOption: EChartsOption = { ...@@ -64,21 +64,22 @@ const defaultEchartOption: EChartsOption = {
bleedMargin: 5, bleedMargin: 5,
}, },
left: 0, left: 0,
right: '50%', right: '45%',
}, },
{ {
type: 'pie', type: 'pie',
top: '90px', top: '60px',
radius: ['50%', '70%'], radius: ['50%', '70%'],
center: ['50%', '50%'], center: ['50%', '50%'],
encode: { value: 'count2', itemName: 'channel' }, encode: { value: 'count2', itemName: 'channel' },
clockwise: false,
label: { label: {
position: 'outer', position: 'outer',
alignTo: 'labelLine', alignTo: 'labelLine',
formatter: '{d}%', formatter: '{d}%',
bleedMargin: 5, bleedMargin: 5,
}, },
left: '50%', left: '45%',
right: 0, right: 0,
}, },
], ],
...@@ -103,13 +104,17 @@ async function handleGetMonthChannelProportion() { ...@@ -103,13 +104,17 @@ async function handleGetMonthChannelProportion() {
const dataSource = consumePointChannelCountList.value.map((consumePointChannelCountItem) => { const dataSource = consumePointChannelCountList.value.map((consumePointChannelCountItem) => {
const sendMessageChannelCountItem = channelMap.get(consumePointChannelCountItem.channel) const sendMessageChannelCountItem = channelMap.get(consumePointChannelCountItem.channel)
return sendMessageChannelCountItem return {
? { channel: consumePointChannelCountItem.channel,
channel: t(ChannelText[consumePointChannelCountItem.channel]), count1: sendMessageChannelCountItem?.count || 0,
count1: sendMessageChannelCountItem.count, count2: consumePointChannelCountItem?.count || 0,
count2: consumePointChannelCountItem.count, }
} })
: consumePointChannelCountItem
const newDataSource = handleDataSourceSort(dataSource)
newDataSource.forEach((item) => {
;(item.channel as string) = t(ChannelText[item.channel])
}) })
channelUsageChartOption.dataset = { channelUsageChartOption.dataset = {
...@@ -119,6 +124,19 @@ async function handleGetMonthChannelProportion() { ...@@ -119,6 +124,19 @@ async function handleGetMonthChannelProportion() {
channelUsageChartRef.value?.echartHideLoading() channelUsageChartRef.value?.echartHideLoading()
} }
function handleDataSourceSort(dataSource: { channel: ChannelType; count1: number; count2: number }[]) {
const channelSortMap = {
[ChannelType.link_share]: 1,
[ChannelType.mall]: 2,
[ChannelType.index]: 3,
[ChannelType.api]: 4,
[ChannelType.preview]: 5,
[ChannelType.multi_preview]: 6,
}
return dataSource.sort((a, b) => channelSortMap[a.channel] - channelSortMap[b.channel])
}
async function handleGetMonthSendMessageCount() { async function handleGetMonthSendMessageCount() {
const res = await fetchGetMonthSendMessageCount<ChannelCountItem[]>(params.agentId as string, [ const res = await fetchGetMonthSendMessageCount<ChannelCountItem[]>(params.agentId as string, [
ChannelType.link_share, ChannelType.link_share,
......
...@@ -61,7 +61,7 @@ const defaultEchartOption: EChartsOption = { ...@@ -61,7 +61,7 @@ const defaultEchartOption: EChartsOption = {
grid: { grid: {
left: '58px', left: '58px',
right: '54px', right: '54px',
bottom: '46px', bottom: '48px',
top: '100px', top: '100px',
}, },
} }
......
...@@ -118,7 +118,7 @@ function defaultEchartOption( ...@@ -118,7 +118,7 @@ function defaultEchartOption(
grid: { grid: {
left: '58px', left: '58px',
right: '40px', right: '40px',
bottom: '20px', bottom: '18px',
}, },
color: ['#000DFF'], color: ['#000DFF'],
} }
...@@ -180,7 +180,7 @@ async function handleUpdateDateRange(_value: [number, number], formattedValue: [ ...@@ -180,7 +180,7 @@ async function handleUpdateDateRange(_value: [number, number], formattedValue: [
</script> </script>
<template> <template>
<div class="h-[356px] w-full rounded-[20px] bg-white"> <div class="flex h-[356px] w-full flex-col rounded-[20px] bg-white">
<div class="mx-[34px] flex justify-between py-5"> <div class="mx-[34px] flex justify-between py-5">
<AnalysisContentTitle :title="t('analysis_module.usage_trend_chart')" /> <AnalysisContentTitle :title="t('analysis_module.usage_trend_chart')" />
...@@ -203,7 +203,7 @@ async function handleUpdateDateRange(_value: [number, number], formattedValue: [ ...@@ -203,7 +203,7 @@ async function handleUpdateDateRange(_value: [number, number], formattedValue: [
</div> </div>
</div> </div>
<div class="flex h-[240px]"> <div class="mb-10 flex flex-1">
<div class="text-font-color relative h-full flex-1 border-r border-r-[#E2E2E2]"> <div class="text-font-color relative h-full flex-1 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]" />
......
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