fix: 服务质量折线图接口更改、满屏滚动修复

This commit is contained in:
chenjinsong
2022-04-19 13:11:26 +08:00
parent d3632a5b30
commit 78108f0e05
16 changed files with 146 additions and 94 deletions

View File

@@ -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))
}