feat: 新增账户仪表盘组件和优化投放指南操作功能

This commit is contained in:
林志军
2025-06-27 18:31:53 +08:00
parent 7b4d2e6034
commit aeb7ab15a3
14 changed files with 465 additions and 407 deletions

View File

@ -0,0 +1,109 @@
<template>
<div class="chart-container">
<a-card :bordered="false" class="echart-item-card">
<template #title>
<span>{{ title.name }}</span>
<a-popover position="tl">
<icon-question-circle />
<template #content>
<p style="margin: 0">{{ title.popover }}</p>
</template>
</a-popover>
</template>
<div id="echarts-line" style="width: 100%; height: 450px"></div>
</a-card>
</div>
</template>
<script setup>
import { defineProps, onMounted } from 'vue';
import * as echarts from 'echarts';
import { Card } from '@arco-design/web-vue';
import { IconQuestionCircle } from '@arco-design/web-vue/es/icon';
//子组件参数传递
const props = defineProps({
title: {
type: Object,
default: {
name: '',
popover: '',
},
},
xAxisData: {
type: Array,
default: [],
},
seriesData: {
type: Array,
default: [],
},
});
const xAxisData = props.xAxisData;
const seriesData = props.seriesData;
onMounted(() => {
const myChart = echarts.init(document.getElementById('echarts-line'));
const option = {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'cross' },
backgroundColor: 'rgba(255, 255, 255, 0.9)',
borderColor: '#ccc',
borderWidth: 1,
textStyle: { color: '#333' },
formatter: function (params) {
let date = params[0].axisValue;
let tooltipHtml = `<div style="font-weight:bold;">消耗量 ${date}</div>`;
params.forEach((item) => {
tooltipHtml += `
<div style="display:flex;align-items:center;">
<span style="display:inline-block;width:10px;height:10px;border-radius:5px;margin-right:5px;background-color:${item.color}"></span>
<span style="margin-right:10px;">${item.seriesName}</span>
<span>${item.value}</span>
</div>
`;
});
return tooltipHtml;
},
},
legend: {
type: 'scroll',
orient: 'horizontal',
top: 10, // 将图例位置调整到顶部
itemWidth: 10,
itemHeight: 10,
pageButtonItemGap: 5,
pageButtonStyle: { color: '#666' },
textStyle: { color: '#666' },
data: seriesData.map((item) => item.name),
},
grid: {
top: 80, // 调整图表内容位置,避免与图例重叠
left: 40,
right: 40,
bottom: 40,
},
xAxis: {
type: 'category',
data: xAxisData,
axisLabel: { color: '#666' },
},
yAxis: {
type: 'value',
axisLabel: { color: '#666' },
splitLine: { lineStyle: { type: 'dashed', color: '#eee' } },
},
series: seriesData,
};
myChart.setOption(option);
window.addEventListener('resize', () => {
myChart.resize();
});
});
</script>
<style scoped lang="scss">
@import './style.scss';
</style>

View File

@ -0,0 +1,7 @@
.echart-item-card {
width: 100%;
height: 50%;
margin:13px;
border-radius: 10px;
}

View File

@ -0,0 +1,164 @@
<template>
<view>
<div class="part-div">
<div>
<a-tabs v-model:activeKey="tabData" class="a-tab-class" default-active-key="acctoun">
<a-tab-pane key="acctoun" title="账户"></a-tab-pane>
<a-tab-pane key="project">
<template #title>项目</template>
</a-tab-pane>
</a-tabs>
</div>
<a-space size="large" direction="vertical" class="search-form">
<a-row class="grid-demo" :gutter="{ md: 8, lg: 24, xl: 32 }">
<a-col :span="5">
<a-space>
<span>项目名称</span>
<a-select :style="{ width: '320px' }" placeholder="全部">
<a-option>Beijing</a-option>
<a-option>Shanghai</a-option>
<a-option>Guangzhou</a-option>
</a-select>
</a-space>
</a-col>
<a-col :span="5">
<a-space>
<span>平台</span>
<a-select :style="{ width: '320px' }" placeholder="全部">
<a-option>Beijing</a-option>
<a-option>Shanghai</a-option>
<a-option>Guangzhou</a-option>
</a-select>
</a-space>
</a-col>
<a-col :span="5">
<a-space>
<span>运营人员</span>
<a-select :style="{ width: '320px' }" placeholder="全部">
<a-option>Beijing</a-option>
<a-option>Shanghai</a-option>
<a-option>Guangzhou</a-option>
</a-select>
</a-space>
</a-col>
</a-row>
<a-row class="grid-demo" :gutter="{ md: 8, lg: 24, xl: 32 }">
<a-col :span="6">
<a-space>
<span>时间筛选</span>
<a-range-picker
showTime
:time-picker-props="{
defaultValue: ['00:00:00', '00:00:00'],
}"
@change="onChange"
@select="onSelect"
style="width: 380px"
/>
</a-space>
</a-col>
<a-col :span="5">
<a-space>
<a-button type="outline" class="search-btn" @click="handleSearch">
<template #icon>
<icon-search />
</template>
<template #default>搜索</template>
</a-button>
<a-button type="outline" class="reset-btn" @click="handleSearch">
<template #icon>
<icon-refresh />
</template>
<template #default>重置</template>
</a-button>
</a-space>
</a-col>
</a-row>
</a-space>
</div>
<div>
<a-row class="grid-demo" :gutter="24">
<a-col :span="12">
<EchartsItem
:xAxisData="xhlEcharts.xAxisData"
:seriesData="xhlEcharts.seriesData"
:title="{ name: '消耗量', popover: '消耗量' }"
></EchartsItem>
</a-col>
<a-col :span="12">
<EchartsItem
:xAxisData="xhlEcharts.xAxisData"
:seriesData="xhlEcharts.seriesData"
:title="{ name: '消耗量', popover: '消耗量' }"
></EchartsItem>
</a-col>
</a-row>
</div>
</view>
</template>
<script setup lang="ts">
import EchartsItem from './components/echarts-item/index.vue';
const xhlEcharts = reactive({
xAxisData: ['06-05', '06-06', '06-07', '06-08', '06-09', '06-10', '06-11'],
seriesData: [
{
name: '本地推-小庭院推广计划',
type: 'line',
data: [30000, 40000, 25000, 20000, 29019, 29019, 29019],
color: '#7b68ee',
emphasis: { focus: 'series' },
},
{
name: '全球旅行小助手推广',
type: 'line',
data: [25000, 27000, 23000, 20000, 29019, 29019, 29019],
color: '#32c5ff',
emphasis: { focus: 'series' },
},
{
name: '定向旅居推广顶级套餐',
type: 'line',
data: [10000, 5000, 12000, 15000, 29019, 29019, 29019],
color: '#feb62f',
emphasis: { focus: 'series' },
},
{
name: '城市探索者特惠活动',
type: 'line',
data: [15000, 18000, 12000, 16000, 20000, 22000, 24000],
color: '#ff7d00',
emphasis: { focus: 'series' },
},
{
name: '高端民宿精选推荐',
type: 'line',
data: [22000, 20000, 25000, 23000, 21000, 19000, 22000],
color: '#f5222d',
emphasis: { focus: 'series' },
},
{
name: '美食探店达人计划',
type: 'line',
data: [18000, 19000, 17000, 16000, 18000, 20000, 21000],
color: '#722ed1',
emphasis: { focus: 'series' },
},
{
name: '户外探险装备推荐',
type: 'line',
data: [12000, 14000, 13000, 15000, 17000, 16000, 18000],
color: '#13c2c2',
emphasis: { focus: 'series' },
},
],
});
</script>
<style scoped lang="scss">
@import './style.scss';
</style>

View File

@ -0,0 +1,68 @@
.part-div {
width: 100%;
background: var(--BG-white, white);
overflow: hidden;
border-radius: 8px;
outline: 1px var(--BG-300, #E6E6E8) solid;
outline-offset: -1px;
flex-direction: column;
justify-content: flex-start;
display: inline-flex;
margin: 10px;
}
.part-div-header {
align-self: stretch;
height: 64px;
padding: 10px 24px 10px 24px;
justify-content: flex-start;
align-items: center;
display: inline-flex
}
:deep(.arco-select-view-single),
:deep(.arco-select-view-multiple),
:deep(.arco-picker),
:deep(.arco-input-wrapper) {
border-radius: 4px;
border-color: #d7d7d9;
background-color: #fff;
width: 224px;
height: 32px;
&:focus-within,
&.arco-input-focus {
background-color: var(--color-bg-2);
border-color: rgb(var(--primary-6));
box-shadow: 0 0 0 0 var(--color-primary-light-2);
}
}
.search-btn {
// 搜索
color: var(--Brand-6, #6d4cfe);
font-size: 14px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 22px;
height: 32px;
border-radius: 3px;
word-wrap: break-word;
}
.reset-btn {
// 重置
color: var(--Text-2, #3c4043);
font-size: 14px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 22px;
height: 32px;
border-radius: 3px;
word-wrap: break-word;
}
.search-form {
margin: 20px;
}

View File

@ -25,11 +25,11 @@
</div>
</div>
</div>
</view>
</template>
<script setup lang="ts">
import { IconQuestionCircle } from '@arco-design/web-vue/es/icon';
import './style.scss';
</script>
<style scoped lang="less"></style>

View File

@ -0,0 +1,46 @@
//本月摘要数据-div
.month-data-div {
align-self: stretch;
padding: 16px 30px 16px 16px;
margin-left: 20px;
margin-right: 20px;
margin-bottom: 20px;
background: var(--Brand-Brand-1, #F0EDFF);
overflow: hidden;
border-radius: 8px;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
gap: 12px;
display: flex;
}
//本月摘要-蓝色字体
.month-text-blue {
color: var(--Brand-Brand-6, #6D4CFE);
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 24px;
word-wrap: break-word
}
//红色字体
.month-text-red {
color: var(--Functional-Danger-6, #F64B31);
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 24px;
word-wrap: break-word
}
//黑色字体
.month-text-black {
color: var(--Text-1, #211F24);
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 24px;
word-wrap: break-word
}

View File

@ -12,7 +12,7 @@
</div>
<div>
<a-row>
<a-row class="grid-demo" :gutter="{ md: 8, lg: 24, xl: 32 }">
<a-col :span="24">
<div class="overall-strategy">
<span class="placement-optimization-title">总体策略</span>
@ -20,7 +20,7 @@
</div>
</a-col>
</a-row>
<a-row class="grid-demo" :gutter="24">
<a-row class="grid-demo" :gutter="{ md: 8, lg: 24, xl: 32 }">
<a-col :span="12">
<div class="overall-strategy">
<span class="placement-optimization-title">预算分配</span>
@ -40,7 +40,7 @@
</div>
</a-col>
</a-row>
<a-row class="grid-demo" :gutter="24">
<a-row class="grid-demo" :gutter="{ md: 8, lg: 24, xl: 32 }">
<a-col :span="12">
<div class="overall-strategy">
<span class="placement-optimization-title">人群包优化</span>

View File

@ -7,7 +7,25 @@
:filter-icon-align-left="alignLeft"
:pagination="false"
>
<template #operation="{ record }">
<a-space size="medium">
<a-space>
<a-popconfirm
content="确定删除吗?"
type="warning"
ok-text="确认删除"
cancel-text="取消"
@ok="deleteBrand(record.id)"
>
<icon-delete></icon-delete>
</a-popconfirm>
</a-space>
<a-space>
<a-button type="outline" class="operation-btn">下载</a-button>
<a-button type="outline" class="operation-btn">详情</a-button>
</a-space>
</a-space>
</template>
</a-table>
</view>
</template>
@ -15,6 +33,7 @@
import top1 from '@/assets/img/captcha/top1.svg';
import top2 from '@/assets/img/captcha/top2.svg';
import top3 from '@/assets/img/captcha/top3.svg';
import { IconDelete } from '@arco-design/web-vue/es/icon';
const listQuery = reactive({
project_id: ref(''),
@ -53,7 +72,7 @@ const columns = [
},
{
title: '操作',
dataIndex: 'date',
dataIndex: 'operation',
slotName: 'operation',
width: 60,
minWidth: 60,
@ -114,4 +133,13 @@ const topImages = [top1, top2, top3];
}
}
.operation-btn {
// 下载
color: var(--Brand-6, #6d4cfe);
font-size: 14px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 22px;
word-wrap: break-word;
}
</style>

View File

@ -52,13 +52,13 @@
</a-col>
<a-col :span="8">
<a-space>
<a-button type="outline" @click="handleSearch">
<a-button type="outline" class="search-btn" @click="handleSearch">
<template #icon>
<icon-search />
</template>
<template #default>搜索</template>
</a-button>
<a-button type="outline" @click="handleSearch">
<a-button type="outline" class="reset-btn" @click="handleSearch">
<template #icon>
<icon-refresh />
</template>
@ -95,4 +95,28 @@ const handleSearch = () => {
box-shadow: 0 0 0 0 var(--color-primary-light-2);
}
}
.search-btn {
// 搜索
color: var(--Brand-6, #6d4cfe);
font-size: 14px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 22px;
height: 32px;
border-radius: 3px;
word-wrap: break-word;
}
.reset-btn {
// 重置
color: var(--Text-2, #3c4043);
font-size: 14px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 22px;
height: 32px;
border-radius: 3px;
word-wrap: break-word;
}
</style>

View File

@ -56,7 +56,6 @@
}
.month-data-body {
width: 100%;
padding-bottom: 20px;
@ -98,58 +97,11 @@
word-wrap: break-word
}
//本月摘要-蓝色字体
.month-text-blue {
color: var(--Brand-Brand-6, #6D4CFE);
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 24px;
word-wrap: break-word
}
//红色字体
.month-text-red {
color: var(--Functional-Danger-6, #F64B31);
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 24px;
word-wrap: break-word
}
//黑色字体
.month-text-black {
color: var(--Text-1, #211F24);
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
line-height: 24px;
word-wrap: break-word
}
//本月摘要数据-div
.month-data-div {
align-self: stretch;
padding: 16px 30px 16px 16px;
margin-left: 20px;
margin-right: 20px;
margin-bottom: 20px;
background: var(--Brand-Brand-1, #F0EDFF);
overflow: hidden;
border-radius: 8px;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
gap: 12px;
display: flex;
}
//投放建议-总体策略
.overall-strategy {
width: 100%;
height: 40%;
padding: 20px 24px 20px 16px;
padding: 20px 10px 20px 16px;
background: var(--BG-100, #F7F8FA);
overflow: hidden;
border-radius: 8px;
@ -158,7 +110,7 @@
align-items: flex-start;
gap: 12px;
display: inline-flex;
margin: 10px 0px 15px 20px;
margin: 10px 24px 15px 20px;
}