| | |
| | | if (!realPhoneNumber) return ''; |
| | | return realPhoneNumber.replace(/^(\d{3})(\d*)(\d{4})$/, '$1 $2 $3'); |
| | | } |
| | | |
| | | /** |
| | | * 字符串脱敏:中间替换为* |
| | | * @param {string} str - 待处理的字符串 |
| | | */ |
| | | static maskString({ str, start = 3, end = 2 }: { str: string; start?: number; end?: number }) { |
| | | // 空值/非字符串处理 |
| | | if (!str || typeof str !== 'string') return str || ''; |
| | | |
| | | const len = str.length; |
| | | // 边界场景:长度≤5时,无需替换(前3+后2已覆盖全部字符) |
| | | if (len <= 5) return str; |
| | | |
| | | // 截取前3个字符 |
| | | const prefix = str.slice(0, start); |
| | | // 截取后2个字符 |
| | | const suffix = str.slice(-end); |
| | | // 中间需要替换的长度 = 总长度 - 前3 - 后2 |
| | | const middleLength = len - start - end; |
| | | // 生成对应长度的* |
| | | const middle = '*'.repeat(middleLength); |
| | | |
| | | // 拼接结果 |
| | | return prefix + middle + suffix; |
| | | } |
| | | } |
| | | |
| | | export function paginateList<T>(list: T[], pageIndex: number, pageSize: number) { |
| | |
| | | </div> |
| | | </div> |
| | | <div class="data-board-home-content-right"> |
| | | <DataBoardContentItem title="交易Top5企业"> |
| | | <DataBoardContentItem title="交易Top企业"> |
| | | <DataBoardTableView |
| | | :tableData="dataBoardOutputValueRankList" |
| | | unit="元" |
| | |
| | | customerName="交易额" |
| | | ></DataBoardTableView> |
| | | </DataBoardContentItem> |
| | | <DataBoardContentItem title="劳务人员Top5企业"> |
| | | <DataBoardContentItem title="劳务人员Top企业"> |
| | | <DataBoardTableView |
| | | :tableData="enterpriseClientUserRankList" |
| | | unit="人" |
| | | customerName="人员数量" |
| | | ></DataBoardTableView> |
| | | </DataBoardContentItem> |
| | | <DataBoardContentItem title="平台消费Top5企业" :hasBottom="false"> |
| | | <DataBoardContentItem title="平台消费Top企业" :hasBottom="false"> |
| | | <DataBoardTableView |
| | | :tableData="bountyUseAmountRankList" |
| | | unit="元" |
| | |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { useIntervalFn } from '@vueuse/core'; |
| | | import * as dataBoardServices from '@/services/api/DataBoard'; |
| | | import { StringUtils } from '@/utils'; |
| | | |
| | | export function useIntervalValue<T>(initValue: T) { |
| | | const value = ref(initValue); |
| | |
| | | |
| | | const bountyUseAmountRankList = computed(() => |
| | | detail.value.items?.map((x) => ({ |
| | | name: x.enterpriseName, |
| | | name: StringUtils.maskString({ str: x.enterpriseName }), |
| | | value: x.amount, |
| | | })) |
| | | ); |
| | |
| | | |
| | | const dataBoardOutputValueRankList = computed(() => |
| | | detail.value.items?.map((x) => ({ |
| | | name: x.enterpriseName, |
| | | name: StringUtils.maskString({ str: x.enterpriseName }), |
| | | value: x.outputValue, |
| | | })) |
| | | ); |
| | |
| | | |
| | | const enterpriseClientUserRankList = computed(() => |
| | | detail.value.items?.map((x) => ({ |
| | | name: x.enterpriseName, |
| | | name: StringUtils.maskString({ str: x.enterpriseName }), |
| | | value: x.count, |
| | | })) |
| | | ); |