2025-06-27 18:31:53 +08:00
|
|
|
|
<template>
|
2025-07-01 13:55:54 +08:00
|
|
|
|
<div class="account-dashboard-wrap">
|
|
|
|
|
|
<div class="filter-wrap bg-#fff rounded-8px border-1px border-#D7D7D9 border-solid pb-24px mb-16px">
|
2025-07-04 10:35:16 +08:00
|
|
|
|
<a-tabs v-model:activeKey="accountType" @tab-click="handleTabClick">
|
|
|
|
|
|
<a-tab-pane key="1" title="账户"></a-tab-pane>
|
|
|
|
|
|
<a-tab-pane key="2" title="计划"></a-tab-pane>
|
2025-07-01 13:55:54 +08:00
|
|
|
|
</a-tabs>
|
2025-06-27 18:31:53 +08:00
|
|
|
|
|
2025-07-01 13:55:54 +08:00
|
|
|
|
<div class="container px-24px">
|
|
|
|
|
|
<div class="filter-row flex mb-20px">
|
|
|
|
|
|
<div class="filter-row-item flex items-center">
|
2025-07-04 10:35:16 +08:00
|
|
|
|
<span class="label">{{ accountType == 1 ? '账号名称' : '计划名称' }}</span>
|
|
|
|
|
|
<a-space size="medium" class="w-240px">
|
2025-07-09 19:18:17 +08:00
|
|
|
|
<AccountSelect v-model="query.ids"></AccountSelect>
|
2025-07-04 10:35:16 +08:00
|
|
|
|
</a-space>
|
2025-07-01 13:55:54 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="filter-row-item flex items-center">
|
|
|
|
|
|
<span class="label">平台</span>
|
2025-07-04 10:35:16 +08:00
|
|
|
|
<a-select
|
|
|
|
|
|
v-model="query.platform"
|
|
|
|
|
|
class="w-150"
|
|
|
|
|
|
size="medium"
|
|
|
|
|
|
placeholder="全部"
|
|
|
|
|
|
allow-clear
|
|
|
|
|
|
@change="handleSearch"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-option v-for="(item, index) in PLATFORM_LIST" :key="index" :value="item.value" :label="item.label"
|
|
|
|
|
|
>{{ item.label }}
|
|
|
|
|
|
</a-option>
|
2025-07-01 13:55:54 +08:00
|
|
|
|
</a-select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="filter-row-item flex items-center">
|
|
|
|
|
|
<span class="label">运营人员</span>
|
2025-07-06 23:25:33 +08:00
|
|
|
|
<a-space class="w-160px">
|
2025-07-09 19:18:17 +08:00
|
|
|
|
<OperatorSelect v-model="query.operator_id" :options="operators" />
|
2025-07-06 23:25:33 +08:00
|
|
|
|
</a-space>
|
2025-07-01 13:55:54 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="filter-row flex">
|
|
|
|
|
|
<div class="filter-row-item flex items-center">
|
|
|
|
|
|
<span class="label">时间筛选</span>
|
|
|
|
|
|
<a-space class="w-240px">
|
2025-07-07 20:59:54 +08:00
|
|
|
|
<a-range-picker v-model="query.data_time" size="medium" allow-clear format="YYYY-MM-DD" class="w-100%" />
|
2025-06-27 18:31:53 +08:00
|
|
|
|
</a-space>
|
2025-07-01 13:55:54 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<a-button class="w-84px search-btn mr-12px" size="medium" @click="handleSearch">
|
|
|
|
|
|
<template #icon>
|
|
|
|
|
|
<icon-search />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template #default>搜索</template>
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
<a-button class="w-84px reset-btn" size="medium" @click="handleReset">
|
|
|
|
|
|
<template #icon>
|
|
|
|
|
|
<icon-refresh />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template #default>重置</template>
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-27 18:31:53 +08:00
|
|
|
|
</div>
|
2025-07-06 23:25:33 +08:00
|
|
|
|
<div class="table-wrap rounded-8px py-5px flex-1 flex flex-col" v-if="onLoading == false">
|
2025-06-27 18:31:53 +08:00
|
|
|
|
<a-row class="grid-demo" :gutter="24">
|
2025-07-09 19:18:17 +08:00
|
|
|
|
<a-col v-for="(chart, index) in chartConfigs" :key="index" :span="12">
|
2025-06-27 18:31:53 +08:00
|
|
|
|
<EchartsItem
|
2025-07-09 19:18:17 +08:00
|
|
|
|
:key="chart.dataKey"
|
|
|
|
|
|
:xAxisData="xhlEcharts?.[chart.dataKey]?.date"
|
|
|
|
|
|
:seriesData="xhlEcharts?.[chart.dataKey]?.series_data"
|
|
|
|
|
|
:title="{ name: chart.title.name, popover: chart.title.popover }"
|
2025-06-27 18:31:53 +08:00
|
|
|
|
></EchartsItem>
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
</a-row>
|
|
|
|
|
|
</div>
|
2025-07-01 13:55:54 +08:00
|
|
|
|
</div>
|
2025-06-27 18:31:53 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
2025-07-01 13:55:54 +08:00
|
|
|
|
import EchartsItem from './components/echarts-item/index';
|
2025-07-04 10:35:16 +08:00
|
|
|
|
import { PLATFORM_LIST } from '../common_constants';
|
|
|
|
|
|
import {
|
|
|
|
|
|
getPlacementAccountsList,
|
|
|
|
|
|
getPlacementAccountsTrend,
|
|
|
|
|
|
getPlacementAccountProjectsTrend,
|
2025-07-06 23:25:33 +08:00
|
|
|
|
fetchAccountOperators,
|
2025-07-04 10:35:16 +08:00
|
|
|
|
} from '@/api/all/propertyMarketing';
|
2025-07-06 23:25:33 +08:00
|
|
|
|
import OperatorSelect from '@/views/property-marketing/media-account/components/operator-select/index.vue';
|
2025-07-09 19:18:17 +08:00
|
|
|
|
import AccountSelect from '@/views/components/common/AccountSelect.vue';
|
2025-07-04 10:35:16 +08:00
|
|
|
|
|
2025-07-06 23:25:33 +08:00
|
|
|
|
const accountType = ref(1);
|
2025-06-27 18:31:53 +08:00
|
|
|
|
|
2025-07-06 23:25:33 +08:00
|
|
|
|
const onLoading = ref(true);
|
|
|
|
|
|
|
|
|
|
|
|
const getOperators = async () => {
|
|
|
|
|
|
const { code, data } = await fetchAccountOperators();
|
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
|
operators.value = data;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2025-07-04 10:35:16 +08:00
|
|
|
|
const query = reactive({
|
|
|
|
|
|
names: '',
|
|
|
|
|
|
platform: '',
|
|
|
|
|
|
operator_id: '',
|
2025-07-07 20:59:54 +08:00
|
|
|
|
data_time: [],
|
2025-07-04 10:35:16 +08:00
|
|
|
|
});
|
2025-07-06 23:25:33 +08:00
|
|
|
|
const xhlEcharts = reactive({});
|
|
|
|
|
|
const getAccountsTrends = async () => {
|
2025-07-04 10:35:16 +08:00
|
|
|
|
const { code, data } = await getPlacementAccountsTrend(query);
|
|
|
|
|
|
if (code === 200) {
|
2025-07-06 23:25:33 +08:00
|
|
|
|
Object.assign(xhlEcharts, data);
|
2025-07-04 10:35:16 +08:00
|
|
|
|
}
|
2025-07-06 23:25:33 +08:00
|
|
|
|
onLoading.value = false;
|
2025-07-04 10:35:16 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-07-06 23:25:33 +08:00
|
|
|
|
const getAccountProjectsTrend = async () => {
|
2025-07-04 10:35:16 +08:00
|
|
|
|
const { code, data } = await getPlacementAccountProjectsTrend(query);
|
|
|
|
|
|
if (code === 200) {
|
2025-07-06 23:25:33 +08:00
|
|
|
|
Object.assign(xhlEcharts, data);
|
2025-07-04 10:35:16 +08:00
|
|
|
|
}
|
2025-07-06 23:25:33 +08:00
|
|
|
|
onLoading.value = false;
|
2025-07-04 10:35:16 +08:00
|
|
|
|
};
|
2025-07-06 23:25:33 +08:00
|
|
|
|
|
|
|
|
|
|
const handleSearch = async () => {
|
|
|
|
|
|
if (accountType.value == 1) {
|
|
|
|
|
|
getAccountsTrends();
|
|
|
|
|
|
} else if (accountType.value == 2) {
|
|
|
|
|
|
getAccountProjectsTrend();
|
2025-07-04 10:35:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
2025-07-09 19:18:17 +08:00
|
|
|
|
// 定义图表配置
|
|
|
|
|
|
const chartConfigs = [
|
|
|
|
|
|
{
|
|
|
|
|
|
dataKey: 'total_use_amount',
|
|
|
|
|
|
title: { name: '消耗量', popover: '广告投放期间已使用的预算总额,代表该账户的实际广告花费。' },
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
dataKey: 'avg_conversion_cost',
|
|
|
|
|
|
title: { name: '展示量', popover: '广告被用户看到的总次数,是衡量广告曝光覆盖的核心指标。' },
|
|
|
|
|
|
},
|
|
|
|
|
|
{ dataKey: 'click_number', title: { name: '点击量', popover: '用户点击广告的次数,表示广告对用户产生了实际吸引。' } },
|
|
|
|
|
|
{
|
|
|
|
|
|
dataKey: 'click_rate',
|
|
|
|
|
|
title: { name: '点击率', popover: '点击率(CTR)= 点击量 ÷ 展示量,衡量广告吸引力与内容质量。' },
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
dataKey: 'avg_click_cost',
|
|
|
|
|
|
title: { name: '平均点击成本', popover: '每次点击广告的平均花费(CPC),= 消耗量 ÷ 点击量。' },
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
dataKey: 'thousand_show_cost',
|
|
|
|
|
|
title: { name: '千次展示成本', popover: '每千次展示带来的平均成本(CPM),= 消耗量 ÷ 展示量 × 1000。' },
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
dataKey: 'conversion_number',
|
|
|
|
|
|
title: { name: '转化数', popover: '用户完成设定行为(如注册、下单)的总次数,衡量广告实际效果。' },
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
dataKey: 'conversion_rate',
|
|
|
|
|
|
title: { name: '转化率', popover: '转化率(CVR)= 转化数 ÷ 点击量,代表广告引导行为转化的能力。' },
|
|
|
|
|
|
},
|
|
|
|
|
|
];
|
2025-07-06 23:25:33 +08:00
|
|
|
|
const handleReset = async () => {};
|
2025-07-04 10:35:16 +08:00
|
|
|
|
|
2025-07-06 23:25:33 +08:00
|
|
|
|
const operators = ref([]);
|
|
|
|
|
|
const accountList = ref([]);
|
|
|
|
|
|
const handleTabClick = (key) => {
|
|
|
|
|
|
handleSearch();
|
2025-07-04 10:35:16 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 获取账户名称
|
|
|
|
|
|
const getAccountList = async () => {
|
|
|
|
|
|
const { code, data } = await getPlacementAccountsList(query);
|
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
|
accountList.value = data;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
2025-07-06 23:25:33 +08:00
|
|
|
|
handleSearch();
|
2025-07-04 10:35:16 +08:00
|
|
|
|
getAccountList();
|
|
|
|
|
|
getOperators();
|
|
|
|
|
|
});
|
2025-06-27 18:31:53 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
@import './style.scss';
|
|
|
|
|
|
</style>
|