diff --git a/src/api/all/common.ts b/src/api/all/common.ts index 1e19878..9b210da 100644 --- a/src/api/all/common.ts +++ b/src/api/all/common.ts @@ -6,10 +6,10 @@ import Http from '@/api'; // 获取用户自定义列 export const getCustomColumns = (params = {}) => { - return Http.get('/v1/user-custom-columns', params); + return Http.get('/v1/custom-columns', params); }; // 保存用户自定义列 export const updateCustomColumns = (params = {}) => { - return Http.put('/v1/user-custom-columns', params); + return Http.put('/v1/custom-columns', params); }; diff --git a/src/api/all/propertyMarketing.ts b/src/api/all/propertyMarketing.ts index 2a5ae02..c00fd03 100644 --- a/src/api/all/propertyMarketing.ts +++ b/src/api/all/propertyMarketing.ts @@ -19,16 +19,21 @@ export const fetchAccountOperators = (params = {}) => { return Http.get('/v1/media-account-operators/list', params); }; -// 投放账户运营人员分组-列表 -export const fetchPlacementAccountOperators = (params = {}) => { - return Http.get('/v1/placement-account-operators/list', params); -}; - // 媒体账号-分页 export const getMediaAccounts = (params = {}) => { return Http.get('/v1/media-accounts', params); }; +// 媒体账号-健康情况 +export const getMediaAccountsHealth = (params = {}) => { + return Http.get('/v1/media-accounts/health', params); +}; + +// 投放账号-健康情况 +export const getPlacementAccountsHealth = (params = {}) => { + return Http.get('/v1/placement-accounts/health', params); +}; + // 媒体账号-添加 export const postMediaAccounts = (params = {}) => { return Http.post('/v1/media-accounts', params); diff --git a/src/components/custom-table-column-modal/index.vue b/src/components/custom-table-column-modal/index.vue index 675ea98..1125f00 100644 --- a/src/components/custom-table-column-modal/index.vue +++ b/src/components/custom-table-column-modal/index.vue @@ -39,7 +39,7 @@ 已添加({{ checkColumns.length }})
-
+
icon {{ groupName }} @@ -117,48 +117,13 @@ const close = () => { }; const initData = async () => { - const data = { - selected_columns: [], - groups: [ - { - label: '基础信息', - is_require: 1, - columns: [ - { label: '账号名称', value: 'account_name', is_require: 1 }, - { label: '项目分组', value: 'project_group', is_require: 1 }, - { label: '状态', value: 'status', is_require: 1 }, - { label: '运营人员', value: 'operator', is_require: 1 }, - { label: 'AI评价', value: 'ai_score', is_require: 1 }, - ], - }, - { - label: '分析数据', - is_require: 0, - columns: [ - { label: '粉丝量', value: 'fans', is_require: 0 }, - { label: '总赞藏数', value: 'total_likes', is_require: 0 }, - { label: '观看量', value: 'views', is_require: 0 }, - { label: '观看量环比', value: 'views_ratio', is_require: 0 }, - { label: '点赞量', value: 'likes', is_require: 0 }, - { label: '点赞量环比', value: 'likes_ratio', is_require: 0 }, - { label: '最新内容标题/日期', value: 'latest_content', is_require: 0 }, - { label: '最新作品观看数', value: 'latest_views', is_require: 0 }, - { label: '最新作品日增长', value: 'latest_growth', is_require: 0 }, - { label: '次新内容标题/日期', value: 'second_latest_content', is_require: 0 }, - { label: '次新作品观看数', value: 'second_latest_views', is_require: 0 }, - { label: '次新作品日增长', value: 'second_latest_growth', is_require: 0 }, - ], - }, - ], - }; - - // const { code, data } = await getCustomColumns({ type: props.type }); - // if (code === 0) { - const { selected_columns, groups } = data; - dataSource.value = groups; - setDefaultCheckColumns(groups, selected_columns); - allColumns.value = groups.flatMap((group) => group.columns); - // } + const { code, data } = await getCustomColumns({ type: props.type }); + if (code === 200) { + const { selected_columns, groups } = data; + dataSource.value = groups; + setDefaultCheckColumns(groups, selected_columns); + allColumns.value = groups.flatMap((group) => group.columns); + } }; const isCheck = (option) => { diff --git a/src/views/property-marketing/media-account/account-dashboard/components/account-table/constants.ts b/src/views/property-marketing/media-account/account-dashboard/components/account-table/constants.ts index 4bfb578..90b8c90 100644 --- a/src/views/property-marketing/media-account/account-dashboard/components/account-table/constants.ts +++ b/src/views/property-marketing/media-account/account-dashboard/components/account-table/constants.ts @@ -2,152 +2,177 @@ * @Author: RenXiaoDong * @Date: 2025-06-28 10:33:06 */ -export const TABLE_COLUMNS = [ - { - title: '账号名称', - dataIndex: 'name', - width: 180, - fixed: 'left', - }, - { - title: '项目分组', - dataIndex: 'group.name', - width: 180, - fixed: 'left', - }, - { - title: '状态', - dataIndex: 'status', - width: 180, - fixed: 'left', - }, - { - title: '运营人员', - dataIndex: 'operator.name', - width: 180, - }, - { - title: 'AI评价', - dataIndex: 'ai_evaluation', - width: 260, - }, - { - title: '粉丝量', - dataIndex: 'fans_number', - width: 180, - tooltip: '账号当前粉丝总数', - align: 'right', - sortable: { - sortDirections: ['ascend', 'descend'], +export const getDefaultColumns = (type = 'week') => { + const isWeek = type === 'week'; + const viewChain = isWeek ? 'week_view_chain' : 'month_view_chain'; + const likeChain = isWeek ? 'week_like_chain' : 'month_like_chain'; + const viewChainText = isWeek ? '近7天观看量环比' : '近30天观看量环比'; + const likeChainText = isWeek ? '近7天点赞量环比' : '近30天点赞量环比'; + + return [ + { + title: '账号名称', + dataIndex: 'name', + prop: 'name', + width: 180, + fixed: 'left', }, - }, - { - title: '总赞藏数', - dataIndex: 'like_collect_number', - width: 180, - tooltip: '账号所有内容的点赞和收藏总数', - align: 'right', - sortable: { - sortDirections: ['ascend', 'descend'], + { + title: '项目分组', + dataIndex: 'group.name', + prop: 'group', + width: 180, + fixed: 'left', }, - }, - { - title: '观看量', - dataIndex: 'view_number', - width: 180, - tooltip: '账号所有内容的总观看次数', - align: 'right', - sortable: { - sortDirections: ['ascend', 'descend'], + { + title: '状态', + dataIndex: 'status', + prop: 'status', + width: 180, + fixed: 'left', }, - }, - { - title: '观看量环比', - dataIndex: 'view_chain', - width: 180, - tooltip: '相比上一周期的观看量变化百分比', - align: 'right', - suffix: '%', - sortable: { - sortDirections: ['ascend', 'descend'], + { + title: '运营人员', + dataIndex: 'operator.name', + prop: 'operator', + width: 180, }, - }, - { - title: '点赞量', - dataIndex: 'like_number', - width: 180, - tooltip: '账号所有内容的总点赞数', - align: 'right', - sortable: { - sortDirections: ['ascend', 'descend'], + { + title: 'AI评价', + dataIndex: 'ai_evaluate', + prop: 'ai_evaluate', + width: 260, }, - }, - { - title: '点赞量环比', - dataIndex: 'like_chain', - width: 180, - tooltip: '相比上一周期的点赞量变化百分比', - align: 'right', - suffix: '%', - sortable: { - sortDirections: ['ascend', 'descend'], + { + title: '粉丝量', + dataIndex: 'fans_number', + prop: 'fans_number', + width: 180, + tooltip: '账号当前粉丝总数', + align: 'right', + sortable: { + sortDirections: ['ascend', 'descend'], + }, }, - }, - { - title: '最新内容标题/日期', - dataIndex: 'like_chain1', - width: 240, - tooltip: '最新发布内容的标题和发布日期', - }, - { - title: '最新作品观看数', - dataIndex: 'latest_view_number', - width: 180, - tooltip: '最新发布内容的观看次数', - align: 'right', - sortable: { - sortDirections: ['ascend', 'descend'], + { + title: '总赞藏数', + dataIndex: 'like_collect_number', + prop: 'like_collect_number', + width: 180, + tooltip: '账号所有内容的点赞和收藏总数', + align: 'right', + sortable: { + sortDirections: ['ascend', 'descend'], + }, }, - }, - { - title: '最新作品日增长', - dataIndex: 'latest_daily_growth', - width: 180, - tooltip: '最新作品每日观看量的增长情况', - align: 'right', - sortable: { - sortDirections: ['ascend', 'descend'], + { + title: '观看量', + dataIndex: 'view_number', + prop: 'view_number', + width: 180, + tooltip: '账号所有内容的总观看次数', + align: 'right', + sortable: { + sortDirections: ['ascend', 'descend'], + }, }, - }, - { - title: '次新内容标题/日期', - dataIndex: 'like_chain4', - width: 240, - }, - { - title: '次新作品观看数', - dataIndex: 'second_latest_view_number', - width: 180, - tooltip: '倒数第二个发布内容的观看次数', - align: 'right', - sortable: { - sortDirections: ['ascend', 'descend'], + { + title: viewChainText, + dataIndex: viewChain, + prop: viewChain, + width: 180, + tooltip: '相比上一周期的观看量变化百分比', + align: 'right', + suffix: '%', + sortable: { + sortDirections: ['ascend', 'descend'], + }, }, - }, - { - title: '次新作品日增长', - dataIndex: 'second_latest_daily_growth', - width: 180, - tooltip: '倒数第二个作品每日观看量的增长情况', - align: 'right', - sortable: { - sortDirections: ['ascend', 'descend'], + { + title: '点赞量', + dataIndex: 'like_number', + prop: 'like_number', + width: 180, + tooltip: '账号所有内容的总点赞数', + align: 'right', + sortable: { + sortDirections: ['ascend', 'descend'], + }, }, - }, - { - title: '操作', - dataIndex: 'operation', - width: 100, - fixed: 'right', - }, -]; + { + title: likeChainText, + dataIndex: likeChain, + prop: likeChain, + width: 180, + tooltip: '相比上一周期的点赞量变化百分比', + align: 'right', + suffix: '%', + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, + { + title: '最新内容标题/日期', + dataIndex: 'newest_work_title_and_publish_time', + prop: 'newest_work_title_and_publish_time', + width: 240, + tooltip: '最新发布内容的标题和发布日期', + }, + { + title: '最新作品观看数', + dataIndex: 'newest_work_view_number', + prop: 'newest_work_view_number', + width: 180, + tooltip: '最新发布内容的观看次数', + align: 'right', + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, + { + title: '最新作品日增长', + dataIndex: 'newest_work_view_grow_number', + prop: 'newest_work_view_grow_number', + width: 180, + tooltip: '最新作品每日观看量的增长情况', + align: 'right', + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, + { + title: '次新内容标题/日期', + dataIndex: 'second_new_work_title_and_publish_time', + prop: 'second_new_work_title_and_publish_time', + width: 240, + }, + { + title: '次新作品观看数', + dataIndex: 'second_new_work_view_number', + prop: 'second_new_work_view_number', + width: 180, + tooltip: '倒数第二个发布内容的观看次数', + align: 'right', + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, + { + title: '次新作品日增长', + dataIndex: 'second_new_work_view_grow_number', + prop: 'second_new_work_view_grow_number', + width: 180, + tooltip: '倒数第二个作品每日观看量的增长情况', + align: 'right', + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, + { + title: '操作', + dataIndex: 'operation', + width: 100, + fixed: 'right', + }, + ]; +}; diff --git a/src/views/property-marketing/media-account/account-dashboard/components/account-table/index.vue b/src/views/property-marketing/media-account/account-dashboard/components/account-table/index.vue index c7b65ac..16fad76 100644 --- a/src/views/property-marketing/media-account/account-dashboard/components/account-table/index.vue +++ b/src/views/property-marketing/media-account/account-dashboard/components/account-table/index.vue @@ -47,7 +47,7 @@