diff --git a/src/api/all/propertyMarketing.ts b/src/api/all/propertyMarketing.ts index bae28e9..c4c3ced 100644 --- a/src/api/all/propertyMarketing.ts +++ b/src/api/all/propertyMarketing.ts @@ -121,3 +121,23 @@ 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); +}; + +// 账号看板-导出 +export const postAccountBoardExport = (params = {}) => { + return Http.post('/v1/media-account-boards/export', params); +}; + +// 账号看板-详情 +export const getAccountBoardDetail = (id: string) => { + return Http.get(`/v1/media-account-boards/${id}`); +}; 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/assets/img/media-account/icon5.png b/src/assets/img/media-account/icon5.png new file mode 100644 index 0000000..52a520f Binary files /dev/null and b/src/assets/img/media-account/icon5.png differ diff --git a/src/router/routes/modules/propertyMarketing.ts b/src/router/routes/modules/propertyMarketing.ts index 1b1073b..8a9035d 100644 --- a/src/router/routes/modules/propertyMarketing.ts +++ b/src/router/routes/modules/propertyMarketing.ts @@ -46,7 +46,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [ }, children: [ { - path: 'accountManagement', + path: 'manage', name: 'MediaAccountAccountManagement', meta: { locale: '账号管理', @@ -56,24 +56,26 @@ const COMPONENTS: AppRouteRecordRaw[] = [ component: () => import('@/views/property-marketing/media-account/account-manage'), }, { - path: 'account-dashboard', + path: 'dashboard', 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', + path: 'detail/:id', name: 'MediaAccountAccountDetails', meta: { locale: '账号详情', requiresAuth: true, roles: ['*'], + hideInMenu: true, + activeMenu: 'MediaAccountAccountDashboard', }, - component: () => import('@/views/property-marketing/repository/test'), + component: () => import('@/views/property-marketing/media-account/account-detail'), }, ], }, @@ -91,7 +93,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [ }, children: [ { - path: 'accountManagement', + path: 'manage', name: 'PutAccountAccountManagement', meta: { locale: '账号管理', @@ -101,14 +103,14 @@ const COMPONENTS: AppRouteRecordRaw[] = [ component: () => import('@/views/property-marketing/put-account/account-manage'), }, { - path: 'accountData', + path: 'data', name: 'PutAccountAccountData', meta: { locale: '账号数据', requiresAuth: true, roles: ['*'], }, - component: () => import('@/views/property-marketing/repository/test'), + component: () => import('@/views/property-marketing/put-account/account-data'), }, { path: 'account-dashboard', diff --git a/src/styles/components/checkbox.scss b/src/styles/components/checkbox.scss new file mode 100644 index 0000000..2bc38b0 --- /dev/null +++ b/src/styles/components/checkbox.scss @@ -0,0 +1,31 @@ +.arco-checkbox { + .arco-checkbox-icon { + width: 16px; + height: 16px; + border-color: #d7d7d9; + } + &.arco-checkbox-disabled { + .arco-checkbox-icon { + background-color: #f2f3f5; + border-color: #d7d7d9; + } + &.arco-checkbox-checked { + .arco-checkbox-icon { + background-color: #A794FE !important; + } + } + &.arco-checkbox-indeterminate { + .arco-checkbox-icon { + border: none; + background-color: #A794FE !important; + } + } + } + &.arco-checkbox-checked, + &.arco-checkbox-indeterminate { + .arco-checkbox-icon { + background-color: #6D4CFE !important; + } + } + +} diff --git a/src/styles/components/index.scss b/src/styles/components/index.scss index 85aca0b..4655cb9 100644 --- a/src/styles/components/index.scss +++ b/src/styles/components/index.scss @@ -1 +1,5 @@ -@import "./input.scss"; \ No newline at end of file +@import './input.scss'; +@import './table.scss'; +@import './checkbox.scss'; +@import './pagination.scss'; +@import './tabs.scss'; \ No newline at end of file diff --git a/src/styles/components/pagination.scss b/src/styles/components/pagination.scss new file mode 100644 index 0000000..d0fa4f8 --- /dev/null +++ b/src/styles/components/pagination.scss @@ -0,0 +1,41 @@ +.arco-pagination { + .arco-pagination-list { + .arco-pagination-item { + border-radius: 4px; + border: 1px solid var(--BG-300, #e6e6e8); + &-ellipsis { + border: none; + } + + &-active { + background-color: transparent; + border: 1px solid var(--Brand-Brand-6, #6d4cfe); + } + } + } + .arco-pagination-options { + .arco-select { + background-color: transparent; + border-radius: 4px; + border: 1px solid var(--BG-300, #e6e6e8); + } + } + .arco-pagination-jumper { + &-input { + border-radius: 4px; + border: 1px solid var(--BG-300, #e6e6e8); + } + &-prepend { + color: var(--Text-2, #3c4043); + text-align: right; + font-family: 'Alibaba PuHuiTi'; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; + } + .arco-input-wrapper { + background-color: transparent; + } + } +} diff --git a/src/styles/components/table.scss b/src/styles/components/table.scss new file mode 100644 index 0000000..b0b3d7c --- /dev/null +++ b/src/styles/components/table.scss @@ -0,0 +1,41 @@ +.arco-table { + @mixin table-cell-text { + color: var(--Text-1, #211f24); + font-family: 'Alibaba PuHuiTi'; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; + } + .arco-table-container { + border: none !important; + .arco-table-element { + thead { + .arco-table-tr { + .arco-table-th { + border-bottom: 1px solid var(--Border-1, #d7d7d9); + background: var(--BG-100, #f7f8fa); + .arco-table-cell { + padding: 13px 16px; + .arco-table-th-title { + @include table-cell-text; + } + } + } + } + } + tbody { + .arco-table-tr { + .arco-table-td { + .arco-table-cell { + padding: 13px 16px; + .arco-table-cell-content { + @include table-cell-text; + } + } + } + } + } + } + } +} diff --git a/src/styles/components/tabs.scss b/src/styles/components/tabs.scss new file mode 100644 index 0000000..422d644 --- /dev/null +++ b/src/styles/components/tabs.scss @@ -0,0 +1,29 @@ +.arco-tabs { + .arco-tabs-nav-tab { + &-list { + .arco-tabs-tab { + .arco-tabs-tab-title { + color: var(--Text-2, #3c4043); + font-family: 'Alibaba PuHuiTi'; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 24px; + } + &-active { + .arco-tabs-tab-title { + color: #6d4cfe; + } + } + &:hover { + .arco-tabs-tab-title::before { + display: none; + } + } + } + .arco-tabs-nav-ink { + background-color: #6d4cfe; + } + } + } +} diff --git a/src/styles/index.ts b/src/styles/index.ts index c40f6c5..23b5667 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -1,3 +1,7 @@ +/* + * @Author: RenXiaoDong + * @Date: 2025-06-27 14:03:21 + */ import './vars.css'; import './components/index.scss'; import 'normalize.css'; diff --git a/src/utils/tools.ts b/src/utils/tools.ts new file mode 100644 index 0000000..256ec57 --- /dev/null +++ b/src/utils/tools.ts @@ -0,0 +1,95 @@ +/* + * @Author: RenXiaoDong + * @Date: 2025-06-27 17:36:31 + */ +import dayjs from 'dayjs'; + +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)}亿`; + } +} + +export function formatTableField(fieldItem: any, rowValue: any, showExactValue = false) { + // 获取嵌套属性值的函数 + const getNestedValue = (obj: any, path: string) => { + if (!obj || !path) return undefined; + + // 如果路径包含点号,说明是链式取值 + if (path.includes('.')) { + return path.split('.').reduce((current, key) => { + return current && current[key] !== undefined ? current[key] : undefined; + }, obj); + } + + // 普通属性取值 + return obj[path]; + }; + + const _getValue = (value: any) => { + if (isNaN(value)) return value; + return formatNumberShow({ value, showExactValue }); + }; + + // 使用链式取值获取数据 + const rawValue = getNestedValue(rowValue, fieldItem.dataIndex); + const value = _getValue(rawValue ?? '-'); + + return `${fieldItem.prefix || ''}${value}${fieldItem.suffix || ''}`; +} + +export function exactFormatTime(val: number, curYearFmt = 'MM-DD HH:mm', otherYearFmt = 'YYYY-MM-DD HH:mm') { + if (!val) return '-'; + const year = dayjs(val * 1000).year(); + const currYear = dayjs().year(); + const diff = year - currYear; + const fmt = diff === 0 ? curYearFmt : otherYearFmt; + return dayjs(val * 1000).format(fmt); +} diff --git a/src/views/components/dataEngine/keyWord.vue b/src/views/components/dataEngine/keyWord.vue index 6c54794..112182e 100644 --- a/src/views/components/dataEngine/keyWord.vue +++ b/src/views/components/dataEngine/keyWord.vue @@ -20,9 +20,9 @@ :columns="columns" :data="dataList" :filter-icon-align-left="alignLeft" - @change="handleChange" :scroll="true" :pagination="false" + @change="handleChange" > @@ -126,7 +114,7 @@
- + 正面情绪 @@ -144,9 +132,9 @@ :data="rowData" :span-method="spanMethod" :filter-icon-align-left="alignLeft" - @change="handleChange" :scroll="true" :pagination="false" + @change="handleChange" >