(timeInterval: string)
| 37 | } |
| 38 | |
| 39 | export 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万; |
| 68 | export function changeNumberUnit(value?: number): { value: string; unit: string } { |
no outgoing calls
no test coverage detected