MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / getTimeUnit

Function getTimeUnit

frontend/packages/dashboard/src/utils/dashboard.ts:39–65  ·  view source on GitHub ↗
(timeInterval: string)

Source from the content-addressed store, hash-verified

37}
38
39export function getTimeUnit(timeInterval: string): string {
40 let timeUnit = ''
41 // 相差秒数
42 switch (timeInterval) {
43 case '1m': {
44 timeUnit = '每分钟'
45 break
46 }
47 case '5m': {
48 timeUnit = '每5分钟'
49 break
50 }
51 case '1h': {
52 timeUnit = '每小时'
53 break
54 }
55 case '1d': {
56 timeUnit = '每天'
57 break
58 }
59 case '1w': {
60 timeUnit = '每周'
61 break
62 }
63 }
64 return timeUnit
65}
66
67// 当数据超过10万时,保留两个小数点,单位为万,如123212,显示12.32万;
68export function changeNumberUnit(value?: number): { value: string; unit: string } {

Callers 3

getInvokeDataFunction · 0.90
getInvokeDataFunction · 0.90
openModalFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected