From 5d237ec6186f5adfb092a471a1623bf61b959909 Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Mon, 7 Jul 2025 10:01:59 +0800 Subject: [PATCH 01/10] =?UTF-8?q?perf:=20=E8=A1=A8=E6=A0=BC=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/custom-column-modal/index.vue | 13 +- .../account-dashboard/constants.ts | 15 +- .../components/board-table/constants.ts | 134 ++++++++---------- .../components/filter-block/index.vue | 2 +- .../components/plan-table/constants.ts | 72 +++++----- .../put-account/account-data/index.vue | 28 ++-- .../components/add-account-modal/index.vue | 6 +- 7 files changed, 140 insertions(+), 130 deletions(-) diff --git a/src/views/property-marketing/media-account/account-dashboard/components/custom-column-modal/index.vue b/src/views/property-marketing/media-account/account-dashboard/components/custom-column-modal/index.vue index f76889b..bb32412 100644 --- a/src/views/property-marketing/media-account/account-dashboard/components/custom-column-modal/index.vue +++ b/src/views/property-marketing/media-account/account-dashboard/components/custom-column-modal/index.vue @@ -28,7 +28,7 @@ :disabled="option.is_require === ENUM_STATUS.NO" @change="(checked) => onCheckChange(checked, option)" > - {{ option.label }} + {{ localFields.find((item) => item.prop === option.value)?.title }} @@ -77,7 +77,7 @@ import { ref, defineExpose } from 'vue'; import { VueDraggable } from 'vue-draggable-plus'; import { getCustomColumns, updateCustomColumns } from '@/api/all/common'; -import { getPropPrefix } from '@/views/property-marketing/media-account/account-dashboard/constants'; +import { getPropPrefix, getDefaultColumns } from '@/views/property-marketing/media-account/account-dashboard/constants'; import icon1 from './img/icon-lock.png'; @@ -106,9 +106,13 @@ const dataSource = ref([]); const checkColumns = ref([]); // 选中字段 const allColumns = ref([]); // 所有字段 const requiredGroupNames = ref([]); // 必选分组名称 +const localFields = ref([]); const open = () => { initData(); + + localFields.value = getDefaultColumns(props.dateType); + visible.value = true; }; @@ -118,6 +122,7 @@ const close = () => { dataSource.value = []; checkColumns.value = []; allColumns.value = []; + localFields.value = []; requiredGroupNames.value = []; }; @@ -150,8 +155,8 @@ const isCheck = (option) => { return checkColumns.value.includes(option.value); }; const getCheckColumnLabel = (value) => { - const column = allColumns.value.find((column) => column.value === value); - return column?.label; + const column = localFields.value.find((column) => column.prop === value); + return column?.title; }; const isRequiredColumn = (value) => { const column = allColumns.value.find((column) => column.value === value); diff --git a/src/views/property-marketing/media-account/account-dashboard/constants.ts b/src/views/property-marketing/media-account/account-dashboard/constants.ts index 9ca7e76..898c27c 100644 --- a/src/views/property-marketing/media-account/account-dashboard/constants.ts +++ b/src/views/property-marketing/media-account/account-dashboard/constants.ts @@ -72,7 +72,7 @@ export const getDefaultColumns = (type = 'week') => { fixed: 'left', }, { - title: '项目分组', + title: '账号分组', dataIndex: 'group.name', prop: 'group', width: 180, @@ -111,7 +111,7 @@ export const getDefaultColumns = (type = 'week') => { { title: '总赞藏数', dataIndex: 'like_collect_number', - prop: 'like_collect_number', + prop: 'like_number', width: 180, tooltip: '账号所有内容获得的点赞数与收藏数总和,用于衡量历史内容的整体吸引力与认可度。', align: 'right', @@ -222,6 +222,17 @@ export const getDefaultColumns = (type = 'week') => { sortDirections: ['ascend', 'descend'], }, }, + { + title: '次新作品收藏数', + dataIndex: 'second_new_work_collect_number', + prop: 'second_new_work_collect_number', + width: 180, + tooltip: '次新作品内容的收藏数', + align: 'right', + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, { title: '次新作品评论数', dataIndex: 'second_new_work_comment_number', diff --git a/src/views/property-marketing/put-account/account-data/components/board-table/constants.ts b/src/views/property-marketing/put-account/account-data/components/board-table/constants.ts index 0c2764a..4bed58a 100644 --- a/src/views/property-marketing/put-account/account-data/components/board-table/constants.ts +++ b/src/views/property-marketing/put-account/account-data/components/board-table/constants.ts @@ -20,7 +20,7 @@ export const TABLE_COLUMNS = [ { title: '运营人员', dataIndex: 'operator_ame', - prop: 'operator_ame', + prop: 'operator', width: 180, }, { @@ -73,8 +73,8 @@ export const TABLE_COLUMNS = [ }, // { // title: '账户余额', - // dataIndex: 'balance', - // prop: 'balance', + // dataIndex: 'balance_amount', + // prop: 'balance_amount', // width: 180, // tooltip: '当前账户剩余的可用余额,用于后续广告投放。', // prefix: '¥', @@ -83,23 +83,23 @@ export const TABLE_COLUMNS = [ // sortDirections: ['ascend', 'descend'], // }, // }, - // { - // title: 'AI评价', - // dataIndex: 'ai_evaluate', - // prop: 'ai_evaluate', - // width: 260, - // }, - // { - // title: '投资回报率', - // dataIndex: 'roi', - // prop: 'roi', - // width: 180, - // tooltip: '投入产出比(ROI),等于收益 ÷ 投入,反映投放带来的商业价值。', - // align: 'right', - // sortable: { - // sortDirections: ['ascend', 'descend'], - // }, - // }, + { + title: 'AI评价', + dataIndex: 'ai_evaluate', + prop: 'ai_evaluate', + width: 260, + }, + { + title: '投资回报率', + dataIndex: 'roi', + prop: 'roi', + width: 180, + tooltip: '投入产出比(ROI),等于收益 ÷ 投入,反映投放带来的商业价值。', + align: 'right', + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, // { // title: '投资回报率环比', // dataIndex: 'roi_chain', @@ -114,7 +114,7 @@ export const TABLE_COLUMNS = [ // }, // }, { - title: '展示量', + title: '展示数', dataIndex: 'show_number', prop: 'show_number', width: 180, @@ -124,21 +124,21 @@ export const TABLE_COLUMNS = [ sortDirections: ['ascend', 'descend'], }, }, - // { - // title: '展示量环比', - // dataIndex: 'view_number_chain', - // prop: 'view_number_chain', - // width: 180, - // tooltip: '展示量与上一周期的变化百分比,反映广告曝光趋势。', - // align: 'right', - // suffix: '%', - // isRateField: true, - // sortable: { - // sortDirections: ['ascend', 'descend'], - // }, - // }, { - title: '点击量', + title: '展示数环比', + dataIndex: 'show_number_chain', + prop: 'show_number_chain', + width: 180, + tooltip: '展示数与上一周期的变化百分比,反映广告曝光趋势。', + align: 'right', + suffix: '%', + isRateField: true, + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, + { + title: '点击数', dataIndex: 'click_number', prop: 'click_number', width: 180, @@ -148,19 +148,19 @@ export const TABLE_COLUMNS = [ sortDirections: ['ascend', 'descend'], }, }, - // { - // title: '点击量环比', - // dataIndex: 'click_number_chain', - // prop: 'click_number_chain', - // width: 180, - // tooltip: '当前周期点击量相较上一周期的变化百分比。', - // align: 'right', - // suffix: '%', - // isRateField: true, - // sortable: { - // sortDirections: ['ascend', 'descend'], - // }, - // }, + { + title: '点击数环比', + dataIndex: 'click_number_chain', + prop: 'click_number_chain', + width: 180, + tooltip: '当前周期点击数相较上一周期的变化百分比。', + align: 'right', + suffix: '%', + isRateField: true, + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, { title: '点击率', dataIndex: 'click_rate', @@ -172,19 +172,19 @@ export const TABLE_COLUMNS = [ sortDirections: ['ascend', 'descend'], }, }, - // { - // title: '点击率环比', - // dataIndex: 'click_rate_chain', - // prop: 'click_rate_chain', - // width: 180, - // tooltip: '当前 CTR 相较上一周期的变化百分比,评估广告表现是否优化。', - // align: 'right', - // suffix: '%', - // isRateField: true, - // sortable: { - // sortDirections: ['ascend', 'descend'], - // }, - // }, + { + title: '点击率环比', + dataIndex: 'click_rate_chain', + prop: 'click_rate_chain', + width: 180, + tooltip: '当前 CTR 相较上一周期的变化百分比,评估广告表现是否优化。', + align: 'right', + suffix: '%', + isRateField: true, + sortable: { + sortDirections: ['ascend', 'descend'], + }, + }, { title: '平均点击成本', dataIndex: 'avg_click_cost', @@ -197,7 +197,7 @@ export const TABLE_COLUMNS = [ }, }, { - title: '千次展现费用', + title: '千次展示费用', dataIndex: 'thousand_show_cost', prop: 'thousand_show_cost', width: 180, @@ -296,14 +296,4 @@ export const TABLE_COLUMNS = [ // prop: 'newest_work_title', // width: 260, // }, - // { - // title: '投放回报率', - // dataIndex: 'roi_chain1', - // prop: 'roi_chain1', - // width: 180, - // align: 'right', - // sortable: { - // sortDirections: ['ascend', 'descend'], - // }, - // }, ]; diff --git a/src/views/property-marketing/put-account/account-data/components/filter-block/index.vue b/src/views/property-marketing/put-account/account-data/components/filter-block/index.vue index 80ddf5b..1e661c1 100644 --- a/src/views/property-marketing/put-account/account-data/components/filter-block/index.vue +++ b/src/views/property-marketing/put-account/account-data/components/filter-block/index.vue @@ -48,7 +48,7 @@
activeTab.value === '1'); +const init = () => { + query.value = cloneDeep(INITIAL_QUERY); + dataSource.value = []; + pageInfo.value = cloneDeep(INITIAL_PAGE_INFO); + selectedRowKeys.value = []; + accountTableRef.value?.resetTable(); + + const data_time = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]; + query.value.data_time = data_time; + + getData(); +}; + const getData = async () => { const _fn = isAccountTab.value ? getPlacementAccountData : getPlacementAccountDataList; const { page, page_size } = pageInfo.value; @@ -113,14 +126,6 @@ const reload = () => { getData(); }; -const handleReset = () => { - pageInfo.value = cloneDeep(INITIAL_PAGE_INFO); - selectedRowKeys.value = []; - accountTableRef.value?.resetTable(); - query.value = cloneDeep(INITIAL_QUERY); - reload(); -}; - const handleSorterChange = (column, order) => { query.value.column = column; query.value.order = order; @@ -132,8 +137,7 @@ const handleSelectionChange = (selectedRows) => { const handleTabClick = (key) => { activeTab.value = key; - dataSource.value = []; - handleReset(); + init(); }; const handleExport = () => { @@ -153,7 +157,7 @@ const handleOpenGroupModal = () => { }; onMounted(() => { - getData(); + init(); }); diff --git a/src/views/property-marketing/put-account/account-manage/components/add-account-modal/index.vue b/src/views/property-marketing/put-account/account-manage/components/add-account-modal/index.vue index fda9e1d..021d701 100644 --- a/src/views/property-marketing/put-account/account-manage/components/add-account-modal/index.vue +++ b/src/views/property-marketing/put-account/account-manage/components/add-account-modal/index.vue @@ -119,14 +119,14 @@ - + - + @@ -173,7 +173,7 @@ const INITIAL_FORM = { operator_name: '', holder_name: '', platform: 0, - is_sync: 0, + is_sync_project: 0, }; const visible = ref(false); From d054f67652c35d4ab3aa62db713161aebc158788 Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Mon, 7 Jul 2025 10:33:42 +0800 Subject: [PATCH 02/10] =?UTF-8?q?perf:=20=E6=8A=95=E6=94=BE=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7-=E5=90=8C=E6=AD=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/all/propertyMarketing.ts | 8 ++- .../authorized-account-modal/index.vue | 51 +++++++++++++++---- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/src/api/all/propertyMarketing.ts b/src/api/all/propertyMarketing.ts index 4495d02..e617401 100644 --- a/src/api/all/propertyMarketing.ts +++ b/src/api/all/propertyMarketing.ts @@ -285,7 +285,6 @@ export const getPlacementAccountsTrend = (params = {}) => { return Http.get(`/v1/placement-accounts/trend`, params); }; - // 投放账号计划数据-趋势 export const getPlacementAccountProjectsTrend = (params = {}) => { return Http.get(`/v1/placement-account-projects/trend`, params); @@ -293,7 +292,7 @@ export const getPlacementAccountProjectsTrend = (params = {}) => { // 投放指南查询 export const getPlacementGuide = (params: {}) => { - return Http.get(`/v1/placement-account-projects/getGuideList`,params); + return Http.get(`/v1/placement-account-projects/getGuideList`, params); }; // 前端定时轮询获取ai检测结果 @@ -305,3 +304,8 @@ export const getAiResult = (params: {}) => { export const getPlacementAccountsList = (params = {}) => { return Http.get('/v1/placement-accounts/list', params); }; + +// 投放账号-同步数据 +export const postPlacementAccountsSync = (id: string) => { + return Http.post(`/v1/placement-accounts/${id}/sync-data`); +}; diff --git a/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue b/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue index 6f8efa2..4f5bb36 100644 --- a/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue +++ b/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue @@ -16,9 +16,9 @@

- 检测到该账户最后更新日期为{{ exactFormatTime(lastSyncedAt, 'MM-DD', 'YYYY-MM-DD') }},已有{{ - dayjs().diff(dayjs(lastSyncedAt * 1000), 'day') - }}天未同步最新数据。 + 检测到该账户最后更新日期为{{ exactFormatTime(lastSyncedAt, 'MM月DD日HH:mm', 'YYYY年MM月DD日 HH:mm') }},已有{{ + getDaysDiffText(lastSyncedAt) + }}未同步最新数据。

@@ -65,14 +65,18 @@ import dayjs from 'dayjs'; import { defineExpose, ref, computed, defineEmits } from 'vue'; import { exactFormatTime } from '@/utils/tools'; -import { putPlacementAccountsAuthorized, getPlacementAccountsAuthorizedStatus } from '@/api/all/propertyMarketing'; +import { + putPlacementAccountsAuthorized, + getPlacementAccountsAuthorizedStatus, + postPlacementAccountsSync, +} from '@/api/all/propertyMarketing'; import icon1 from '@/assets/img/media-account/icon-warn-1.png'; import icon2 from '@/assets/img/media-account/icon-feedback-success.png'; import icon3 from '@/assets/img/media-account/icon-feedback-fail.png'; const emits = defineEmits(['update']); - +const INITIAL_SYNC_TYPE = 'sync'; const visible = ref(false); const isLoading = ref(false); const isCompleted = ref(false); @@ -81,9 +85,10 @@ const formRef = ref(null); const failReason = ref(''); const progress = ref(0); const id = ref(''); -const lastSyncedAt = ref(null); -const syncType = ref('sync'); // sync | no_sync + +const lastSyncedAt = ref(null); // 上次同步时间戳 const showSyncTip = ref(false); +const syncType = ref(INITIAL_SYNC_TYPE); // sync | no_sync const INITIAL_FORM = { account: '', @@ -111,6 +116,15 @@ const confirmBtnText = computed(() => { return isSuccess.value ? '继续添加' : '重试'; }); +const getDaysDiffText = (lastSyncedAt) => { + if (!lastSyncedAt) return '0天'; + + const daysDiff = dayjs().diff(dayjs(lastSyncedAt * 1000), 'day'); + + if (daysDiff === 0) return '不到1天'; + return `${daysDiff}天`; +}; + const open = (accountId, last_synced_at = null) => { id.value = accountId; lastSyncedAt.value = last_synced_at; @@ -129,7 +143,7 @@ const close = () => { progress.value = 0; id.value = ''; lastSyncedAt.value = null; - syncType.value = 'sync'; + syncType.value = INITIAL_SYNC_TYPE; showSyncTip.value = false; clearFakeProgressTimer(); clearStatusPollingTimer(); @@ -206,8 +220,8 @@ const clearFakeProgressTimer = () => { } }; -const handleOk = () => { - if (lastSyncedAt.value) { +const handleSyncData = () => { + if (!showSyncTip.value) { formRef.value.validate(async (errors) => { if (!errors) { showSyncTip.value = true; @@ -216,6 +230,23 @@ const handleOk = () => { return; } + if (syncType.value === INITIAL_SYNC_TYPE) { + postPlacementAccountsSync(id.value).then((res) => { + if (res.code === 200) { + close(); + } + }); + } else { + close(); + } +}; + +const handleOk = () => { + if (lastSyncedAt.value && lastSyncedAt.value < dayjs().startOf('day').valueOf()) { + handleSyncData(); + return; + } + if (isCompleted.value) { if (isSuccess.value) { emits('update'); From f8f1301989b0c2edd5e33a3b6e8bb9904909d109 Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Mon, 7 Jul 2025 10:42:38 +0800 Subject: [PATCH 03/10] =?UTF-8?q?style:=20=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/dataEngine/keyWord.vue | 2 +- src/views/components/dataEngine/topHeader.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/components/dataEngine/keyWord.vue b/src/views/components/dataEngine/keyWord.vue index d860e32..65a8959 100644 --- a/src/views/components/dataEngine/keyWord.vue +++ b/src/views/components/dataEngine/keyWord.vue @@ -5,7 +5,7 @@
关键词热度榜 diff --git a/src/views/components/dataEngine/topHeader.vue b/src/views/components/dataEngine/topHeader.vue index aca2867..60367cc 100644 --- a/src/views/components/dataEngine/topHeader.vue +++ b/src/views/components/dataEngine/topHeader.vue @@ -3,8 +3,8 @@ 行业大类 From 0766c7c1ad77f976120f2be52b29f53ec068015e Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Mon, 7 Jul 2025 13:46:24 +0800 Subject: [PATCH 04/10] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0column-resizabl?= =?UTF-8?q?e=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/account-table/index.vue | 1 + .../account-detail/components/note-table/index.vue | 10 +++++++++- .../components/batch-group-modal/index.vue | 2 +- .../components/batch-tag-modal/index.vue | 2 +- .../components/group-manage-modal/index.vue | 1 + .../account-data/components/board-table/index.vue | 1 + .../components/group-manage-modal/index.vue | 1 + .../account-data/components/plan-table/index.vue | 1 + 8 files changed, 16 insertions(+), 3 deletions(-) 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 582dc23..6c51cd1 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 @@ -32,6 +32,7 @@ ref="tableRef" :data="dataSource" row-key="id" + column-resizable :row-selection="{ type: 'checkbox', showCheckedAll: true, diff --git a/src/views/property-marketing/media-account/account-detail/components/note-table/index.vue b/src/views/property-marketing/media-account/account-detail/components/note-table/index.vue index 96e673d..85e88f2 100644 --- a/src/views/property-marketing/media-account/account-detail/components/note-table/index.vue +++ b/src/views/property-marketing/media-account/account-detail/components/note-table/index.vue @@ -49,7 +49,15 @@
- + diff --git a/src/views/property-marketing/media-account/account-manage/components/batch-group-modal/index.vue b/src/views/property-marketing/media-account/account-manage/components/batch-group-modal/index.vue index 401c218..36ca462 100644 --- a/src/views/property-marketing/media-account/account-manage/components/batch-group-modal/index.vue +++ b/src/views/property-marketing/media-account/account-manage/components/batch-group-modal/index.vue @@ -37,7 +37,7 @@