feat: 账号数据看板、账户详情、投放数据

This commit is contained in:
rd
2025-06-28 15:28:54 +08:00
parent 4873cedefe
commit cfd86b1408
28 changed files with 1684 additions and 34 deletions

View File

@ -2,6 +2,8 @@
* @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));
}
@ -82,3 +84,12 @@ export function formatTableField(fieldItem: any, rowValue: any, showExactValue =
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);
}