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

@ -43,7 +43,7 @@ export const TABLE_COLUMNS = [
},
{
title: '总赞藏数',
dataIndex: 'like_number',
dataIndex: 'like_collect_number',
width: 180,
tooltip: '账号所有内容的点赞和收藏总数',
align: 'right',

View File

@ -4,9 +4,16 @@
-->
<template>
<div class="action-row mb-12px flex justify-between">
<a-checkbox :model-value="checkedAll" :indeterminate="indeterminate" class="!pl-13px" @change="handleSelectAll"
>全选</a-checkbox
>
<div>
<a-checkbox
v-if="dataSource.length > 0"
:model-value="checkedAll"
:indeterminate="indeterminate"
class="!pl-13px"
@change="handleSelectAll"
>全选</a-checkbox
>
</div>
<div class="flex items-center">
<a-button class="w-110px search-btn mr-12px" size="medium" @click="handleExport">
<template #icon> <icon-download /> </template>
@ -35,6 +42,9 @@
@select="handleSelect"
@select-all="handleSelectAll"
>
<template #empty>
<NoData />
</template>
<template #columns>
<a-table-column
v-for="column in TABLE_COLUMNS"
@ -84,6 +94,9 @@
</div>
</div>
</template>
<template v-else-if="column.dataIndex === 'like_collect_number'" #cell="{ record }">
{{ formatNumberShow({ value: record.like_number + record.collect_number, showExactValue: true }) }}
</template>
<template v-else-if="column.dataIndex === 'operation'" #cell="{ record }">
<a-button type="outline" size="small" class="search-btn" @click="handleDetail(record)">详情</a-button>
</template>
@ -107,7 +120,7 @@
</template>
</a-table>
<CustomTableColumnModal ref="modalRef" type="media_account" @success="onCustomColumnSuccess" />
<CustomTableColumnModal ref="customTableColumnModalRef" type="media_account" @success="onCustomColumnSuccess" />
</template>
<script setup>
@ -115,7 +128,7 @@ import { ref, computed } from 'vue';
import { useRouter } from 'vue-router';
import { STATUS_LIST } from '../../constants';
import { formatTableField } from '@/utils/tools';
import { formatTableField, formatNumberShow } from '@/utils/tools';
import { TABLE_COLUMNS } from './constants';
import CustomTableColumnModal from '@/components/custom-table-column-modal';
@ -138,7 +151,7 @@ const router = useRouter();
const selectedItems = ref([]);
const tableRef = ref(null);
const modalRef = ref(null);
const customTableColumnModalRef = ref(null);
const checkedAll = computed(
() => selectedItems.value.length > 0 && selectedItems.value.length === props.dataSource.length,
@ -167,6 +180,7 @@ const handleDetail = (record) => {
// 处理排序变化
const handleSorterChange = (column, order) => {
console.log(column, order);
emit('sorterChange', column, order === 'ascend' ? 'asc' : 'desc');
};
@ -181,11 +195,10 @@ const handleExport = () => {
const resetTable = () => {
selectedItems.value = [];
tableRef.value?.clearSorters();
};
const openCustomColumn = () => {
modalRef.value.open();
customTableColumnModalRef.value.open();
};
const onCustomColumnSuccess = (selectedColumns) => {

View File

@ -5,7 +5,7 @@
-->
<template>
<div class="container">
<div class="filter-row flex mb-20px">
<div class="filter-row flex">
<div class="filter-row-item flex items-center">
<span class="label">账号名称</span>
<a-space size="medium" class="w-240px">
@ -42,26 +42,7 @@
</a-select>
</a-space>
</div>
</div>
<div class="filter-row flex">
<div class="filter-row-item flex items-center">
<span class="label">时间筛选</span>
<a-space class="w-240px">
<a-select
v-model="query.date_range"
size="medium"
placeholder="全部"
class="w-120px"
allow-clear
@change="handleSearch"
>
<template #arrow-icon> <icon-calendar size="16" /> </template>
<a-option :value="7" label="近7天">近7天</a-option>
<a-option :value="14" label="近14天">近14天</a-option>
<a-option :value="30" label="近30天">近30天</a-option>
</a-select>
</a-space>
</div>
<a-button class="w-84px search-btn mr-12px" size="medium" @click="handleSearch">
<template #icon>
<icon-search />