feat: 投放账户数据

This commit is contained in:
rd
2025-07-02 17:55:20 +08:00
parent b8d88cd6cb
commit 2b4e691f4e
21 changed files with 222 additions and 860 deletions

View File

@ -41,7 +41,6 @@
</span>
</div>
</template>
<!-- 其他项占1/4宽度 -->
<template v-else>
<div class="flex items-center mb-4px">
<p class="cts !color-#737478 !mr-4px">{{ field.label }}</p>
@ -50,7 +49,6 @@
</a-tooltip>
</div>
<p class="cts">
<!-- 状态特殊渲染 -->
<template v-if="field.type === 'status'">
<span v-if="detailData.status === 1" style="color: #4ad991">正常</span>
<span v-else style="color: #ff4d4f">异常</span>
@ -63,7 +61,6 @@
{{ detailData[field.dataIndex] }}%
</span>
</template>
<!-- 普通字段支持多层key -->
<template v-else>
{{ formatTableField(field, detailData, true) }}
</template>
@ -89,38 +86,39 @@ import icon4 from '@/assets/img/media-account/icon-success.png';
const route = useRoute();
const id = route.params.id;
const detailData = ref({
id: 1,
name: '抖音官方账号',
mobile: '13800138001',
account_id: 'douyin_001',
holder_name: '张三',
operator_id: 1,
platform: 0,
group_id: 1,
status: 1,
is_pause: 0,
fans_number: 1250000,
like_number: 890000,
collect_number: 45000,
view_number: 5600000,
view_chain: -12.5,
like_chain: 8.3,
ai_evaluation: {
status: 1,
text: '表现优质 | 建议保持',
look_chain: 12.5,
like_chain: 8.3,
},
operator: {
id: 1,
name: '李运营',
},
group: {
id: 1,
name: '抖音组',
},
});
const detailData = ref({});
// const detailData = ref({
// id: 1,
// name: '抖音官方账号',
// mobile: '13800138001',
// account_id: 'douyin_001',
// holder_name: '张三',
// operator_id: 1,
// platform: 0,
// group_id: 1,
// status: 1,
// is_pause: 0,
// fans_number: 1250000,
// like_number: 890000,
// collect_number: 45000,
// view_number: 5600000,
// view_chain: -12.5,
// like_chain: 8.3,
// ai_evaluation: {
// status: 1,
// text: '表现优质 | 建议保持',
// look_chain: 12.5,
// like_chain: 8.3,
// },
// operator: {
// id: 1,
// name: '李运营',
// },
// group: {
// id: 1,
// name: '抖音组',
// },
// });
const getDetail = async () => {
const { code, data } = await getAccountBoardDetail(id);

View File

@ -5,19 +5,21 @@
export const INITIAL_QUERY = {
name: '',
publish_date: [],
published_at: [],
};
export const TABLE_COLUMNS = [
{
title: '笔记标题',
dataIndex: 'name',
dataIndex: 'title',
width: 240,
fixed: 'left',
},
{
title: '发布日期',
dataIndex: 'publish_date',
dataIndex: 'published_at',
width: 160,
fixed: 'left',
},
{
title: '曝光量',
@ -35,28 +37,28 @@ export const TABLE_COLUMNS = [
},
{
title: '点赞量',
dataIndex: 'like_count',
dataIndex: 'like_number',
width: 180,
tooltip: '账号所有内容的总点赞数',
align: 'right',
},
{
title: '收藏量',
dataIndex: 'collect_count',
dataIndex: 'collect_number',
width: 180,
tooltip: '账号所有内容的总收藏数',
align: 'right',
},
{
title: '评论数',
dataIndex: 'comment_count',
dataIndex: 'comment_number',
width: 180,
tooltip: '账号所有内容的总评论数',
align: 'right',
},
{
title: '分享量',
dataIndex: 'share_count',
dataIndex: 'share_number',
width: 180,
tooltip: '账号所有内容的总转发数',
align: 'right',

View File

@ -25,7 +25,7 @@
<span class="label">发布日期</span>
<a-space size="medium" class="w-240px">
<a-range-picker
v-model="query.publish_date"
v-model="query.published_at"
size="medium"
allow-clear
format="YYYY-MM-DD HH:mm"
@ -47,6 +47,9 @@
</a-button>
</div>
<a-table :data="dataSource" row-key="id" :pagination="false" :scroll="{ x: '100%' }" class="w-100%" bordered>
<template #empty>
<NoData />
</template>
<template #columns>
<a-table-column
v-for="column in TABLE_COLUMNS"
@ -62,7 +65,6 @@
>
<template #title>
<div class="flex items-center">
<img v-if="column.dataIndex === 'ai_evaluation'" width="16" height="16" :src="icon5" class="mr-4px" />
<span class="cts mr-4px">{{ column.title }}</span>
<a-tooltip v-if="column.tooltip" :content="column.tooltip" position="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
@ -71,8 +73,8 @@
</template>
<template #cell="{ record }">
<template v-if="column.dataIndex === 'publish_date'">
{{ exactFormatTime(record.publish_date) }}
<template v-if="column.dataIndex === 'published_at'">
{{ exactFormatTime(record.published_at) }}
</template>
<template v-else>
{{ formatTableField(column, record, true) }}
@ -81,7 +83,7 @@
</a-table-column>
</template>
</a-table>
<div class="pagination-box">
<div v-if="pageInfo.total > 0" class="pagination-box">
<a-pagination
:total="pageInfo.total"
size="mini"
@ -101,14 +103,15 @@
import { TABLE_COLUMNS, INITIAL_QUERY } from './constants';
import { useRoute } from 'vue-router';
import { formatTableField, exactFormatTime } from '@/utils/tools';
import { getMediaAccountBoardWorks } from '@/api/all/propertyMarketing';
const route = useRoute();
const id = route.params.id;
const dataSource = ref([]);
const pageInfo = reactive({
const pageInfo = ref({
page: 1,
pageSize: 20,
total: 100,
total: 0,
});
const query = ref(cloneDeep(INITIAL_QUERY));
@ -118,34 +121,34 @@ const handleSearch = () => {
};
const handleReset = () => {
pageInfo.page = 1;
pageInfo.pageSize = 20;
pageInfo.total = 0;
pageInfo.value.page = 1;
pageInfo.value.pageSize = 20;
pageInfo.value.total = 0;
query.value = cloneDeep(INITIAL_QUERY);
reload();
};
const onPageChange = (current) => {
pageInfo.page = current;
pageInfo.value.page = current;
getData();
};
const onPageSizeChange = (pageSize) => {
pageInfo.pageSize = pageSize;
pageInfo.value.pageSize = pageSize;
reload();
};
const reload = () => {
pageInfo.page = 1;
pageInfo.value.page = 1;
getData();
};
const getData = async () => {
// const { code, data } = await getAccountBoardList(query.value);
// if (code === 200) {
// dataSource.value = data?.list || [];
// pageInfo.total = data.total;
// }
const { code, data } = await getMediaAccountBoardWorks(query.value);
if (code === 200) {
dataSource.value = data?.data || [];
pageInfo.value.total = data.total;
}
};
onMounted(() => {