fix: 服务质量折线图接口更改、满屏滚动修复
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import _ from 'lodash'
|
||||
import { storageKey } from '@/utils/constants'
|
||||
// 获取初始化时间,默认最近一周
|
||||
Date.prototype.setStart = function () {
|
||||
this.setHours(0)
|
||||
@@ -44,3 +45,19 @@ export function getNowTime (interval) {
|
||||
export function rTime (date) {
|
||||
return window.$dayJs.tz(new Date(date)).format('MM-DD HH:mm')
|
||||
}
|
||||
// 时间格式转换
|
||||
export function dateFormat (date, format = 'YYYY-MM-DD HH:mm:ss') {
|
||||
let d = date
|
||||
// date不是数字,则视为时间字符串,例如2022-02-22 22:22
|
||||
if (isNaN(date)) {
|
||||
d = window.$dayJs(date).valueOf() + parseInt(localStorage.getItem('cn-timezone-local-offset'))
|
||||
} else {
|
||||
d = getMillisecond(date)
|
||||
}
|
||||
d = window.$dayJs(d).tz().format(format)
|
||||
return d
|
||||
}
|
||||
// 时间格式转换,使用appearance的时间格式
|
||||
export function dateFormatByAppearance (date) {
|
||||
return dateFormat(date, localStorage.getItem(storageKey.dateFormat))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user