diff --git a/src/api/all/propertyMarketing.ts b/src/api/all/propertyMarketing.ts index bae28e9..9364a8b 100644 --- a/src/api/all/propertyMarketing.ts +++ b/src/api/all/propertyMarketing.ts @@ -121,3 +121,13 @@ export const startPatchAccount = (id: string) => { export const getAuthorizedImage = (id: string) => { return Http.get(`/v1/media-accounts/${id}/authorized-image`); }; + +// 账号看板-数据总览 +export const getAccountBoardOverview = (params = {}) => { + return Http.get('/v1/media-account-boards/overview', params); +}; + +// 账号看板-分页 +export const getAccountBoardList = (params = {}) => { + return Http.get('/v1/media-account-boards', params); +}; diff --git a/src/assets/img/media-account/icon-custom.png b/src/assets/img/media-account/icon-custom.png new file mode 100644 index 0000000..2f2fe8a Binary files /dev/null and b/src/assets/img/media-account/icon-custom.png differ diff --git a/src/assets/img/media-account/icon1.png b/src/assets/img/media-account/icon1.png new file mode 100644 index 0000000..9244b7f Binary files /dev/null and b/src/assets/img/media-account/icon1.png differ diff --git a/src/assets/img/media-account/icon2.png b/src/assets/img/media-account/icon2.png new file mode 100644 index 0000000..84c631c Binary files /dev/null and b/src/assets/img/media-account/icon2.png differ diff --git a/src/assets/img/media-account/icon3.png b/src/assets/img/media-account/icon3.png new file mode 100644 index 0000000..792d535 Binary files /dev/null and b/src/assets/img/media-account/icon3.png differ diff --git a/src/assets/img/media-account/icon4.png b/src/assets/img/media-account/icon4.png new file mode 100644 index 0000000..164776b Binary files /dev/null and b/src/assets/img/media-account/icon4.png differ diff --git a/src/router/routes/modules/propertyMarketing.ts b/src/router/routes/modules/propertyMarketing.ts index affcb1e..b1ba38b 100644 --- a/src/router/routes/modules/propertyMarketing.ts +++ b/src/router/routes/modules/propertyMarketing.ts @@ -59,11 +59,11 @@ const COMPONENTS: AppRouteRecordRaw[] = [ path: 'accountDashboard', name: 'MediaAccountAccountDashboard', meta: { - locale: '账号看板', + locale: '账号数据看板', requiresAuth: true, roles: ['*'], }, - component: () => import('@/views/property-marketing/repository/test'), + component: () => import('@/views/property-marketing/media-account/account-dashboard'), }, { path: 'accountDetails', diff --git a/src/utils/tools.ts b/src/utils/tools.ts new file mode 100644 index 0000000..395b1b3 --- /dev/null +++ b/src/utils/tools.ts @@ -0,0 +1,56 @@ +/* + * @Author: RenXiaoDong + * @Date: 2025-06-27 17:36:31 + */ +export function toFixed(num: number | string, n: number): number { + return parseFloat(parseFloat(num.toString()).toFixed(n)); +} + +export function isNotData(n: number): boolean { + if (n === undefined) { + return true; + } + return n === -2147483648; +} + +export function splitNumber(num: number): string | number { + if (!num) { + return num; + } + const parts = num.toString().split('.'); + parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ','); + return parts.join('.'); +} + +export function formatNumberShow(...args: any[]): string | number { + const [_args] = args; + const { value, len = 2, split = true, showExactValue = false } = typeof _args === 'object' ? _args : { value: _args }; + const getNumber = (value: number) => { + return split ? splitNumber(value) : value; + }; + + if (isNotData(value)) { + return '-'; + } + if (value < 0) { + return `-${formatNumberShow({ + value: -value, + len, + split, + showExactValue, + })}`; + } + if (showExactValue) { + return getNumber(toFixed(value, len)); + } + if (value < 10000) { + return getNumber(toFixed(value, len)); + } else if (value < 100000000) { + const _n = Math.round((value / 10000) * 100) / 100; + return split ? `${splitNumber(_n)}w` : `${toFixed(_n, len)}w`; + } else { + const _n = Math.round((value / 100000000) * 100) / 100; + + return split ? `${splitNumber(_n)}亿` : `${toFixed(_n, len)}亿`; + } +} 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 new file mode 100644 index 0000000..b159b9a --- /dev/null +++ b/src/views/property-marketing/media-account/account-dashboard/components/account-table/index.vue @@ -0,0 +1,131 @@ + + + + + + diff --git a/src/views/property-marketing/media-account/account-dashboard/components/account-table/style.scss b/src/views/property-marketing/media-account/account-dashboard/components/account-table/style.scss new file mode 100644 index 0000000..475cd8b --- /dev/null +++ b/src/views/property-marketing/media-account/account-dashboard/components/account-table/style.scss @@ -0,0 +1,10 @@ +.container { + width: 100%; + .action-row { + :deep(.arco-btn) { + .arco-btn-icon { + line-height: 14px; + } + } + } +} diff --git a/src/views/property-marketing/media-account/account-dashboard/components/filter-block/index.vue b/src/views/property-marketing/media-account/account-dashboard/components/filter-block/index.vue new file mode 100644 index 0000000..df72627 --- /dev/null +++ b/src/views/property-marketing/media-account/account-dashboard/components/filter-block/index.vue @@ -0,0 +1,129 @@ + + + + + + + diff --git a/src/views/property-marketing/media-account/account-dashboard/components/filter-block/style.scss b/src/views/property-marketing/media-account/account-dashboard/components/filter-block/style.scss new file mode 100644 index 0000000..3a33894 --- /dev/null +++ b/src/views/property-marketing/media-account/account-dashboard/components/filter-block/style.scss @@ -0,0 +1,36 @@ +.container { + :deep(.arco-input-wrapper), + :deep(.arco-select-view-single), + :deep(.arco-select-view-multiple) { + border-radius: 4px; + border-color: #d7d7d9; + background-color: #fff; + &:focus-within, + &.arco-input-focus { + background-color: var(--color-bg-2); + border-color: rgb(var(--primary-6)); + box-shadow: 0 0 0 0 var(--color-primary-light-2); + } + } + .filter-row { + .filter-row-item { + &:not(:last-child) { + margin-right: 24px; + } + .label { + margin-right: 8px; + color: #211f24; + font-family: 'Alibaba PuHuiTi'; + font-size: 14px; + font-style: normal; + font-weight: 400; + flex-shrink: 0; + line-height: 22px; /* 157.143% */ + } + :deep(.arco-space-item) { + width: 100%; + } + } + } + +} diff --git a/src/views/property-marketing/media-account/account-dashboard/components/group-select/index.vue b/src/views/property-marketing/media-account/account-dashboard/components/group-select/index.vue new file mode 100644 index 0000000..a736c92 --- /dev/null +++ b/src/views/property-marketing/media-account/account-dashboard/components/group-select/index.vue @@ -0,0 +1,64 @@ + + + + diff --git a/src/views/property-marketing/media-account/account-dashboard/constants.ts b/src/views/property-marketing/media-account/account-dashboard/constants.ts new file mode 100644 index 0000000..97bf6bc --- /dev/null +++ b/src/views/property-marketing/media-account/account-dashboard/constants.ts @@ -0,0 +1,94 @@ +/* + * @Author: RenXiaoDong + * @Date: 2025-06-27 17:23:56 + */ + +import icon1 from '@/assets/img/media-account/icon1.png'; +import icon2 from '@/assets/img/media-account/icon2.png'; +import icon3 from '@/assets/img/media-account/icon3.png'; +import icon4 from '@/assets/img/media-account/icon4.png'; + +export const CARD_FIELDS = [ + { + label: '账号总数', + prop: 'total_number', + icon: icon1, + }, + { + label: '总粉丝数', + prop: 'total_fans_number', + icon: icon2, + tooltip: '总粉丝数', + }, + { + label: '总赞藏数', + prop: 'total_like_number', + icon: icon3, + tooltip: '总赞藏数', + }, + { + label: '近7日观看数', + prop: 'in_the_past_seven_days_view_number', + icon: icon4, + tooltip: '近7日观看数', + }, +]; + +export const INITIAL_QUERY = { + name: '', + status: '', + operator_id: '', + group_ids: [], + date_range: '', +}; + +export enum EnumStatus { + NORMAL = 1, + PAUSE = 3, + UNAUTHORIZED = 0, + ABNORMAL = 2, + ABNORMAL_LOGIN = 4, + ABNORMAL_REQUEST = 5, + ABNORMAL_FREEZE = 6, +} + +export const STATUS_LIST = [ + { + text: '正常', + label: '正常', + value: EnumStatus.NORMAL, + }, + { + text: '暂停同步', + label: '暂停同步', + value: EnumStatus.PAUSE, + }, + { + text: '未授权', + label: '未授权', + value: EnumStatus.UNAUTHORIZED, + }, + { + text: '异常', + label: '异常', + value: EnumStatus.ABNORMAL, + }, + { + text: '异常-登录状态失效', + label: '异常', + value: EnumStatus.ABNORMAL_LOGIN, + tooltip: '登录状态失效,需重新扫码授权', + }, + { + text: '异常-请求过于频繁', + label: '异常', + value: EnumStatus.ABNORMAL_REQUEST, + tooltip: '请求过于频繁,需等待24小时后重试', + }, + { + text: '异常-账号被冻结/封禁', + label: '异常', + value: EnumStatus.ABNORMAL_FREEZE, + tooltip: '账号被冻结/封禁', + }, +]; diff --git a/src/views/property-marketing/media-account/account-dashboard/index.vue b/src/views/property-marketing/media-account/account-dashboard/index.vue index d7d4473..e6b3750 100644 --- a/src/views/property-marketing/media-account/account-dashboard/index.vue +++ b/src/views/property-marketing/media-account/account-dashboard/index.vue @@ -3,9 +3,289 @@ * @Date: 2025-06-25 10:02:20 --> - + - +