src/utils/dateUtil.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/data/point/DaPointChart.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/utils/dateUtil.ts
@@ -38,3 +38,17 @@ if (second < 10) { second = '0' + second } return year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + second } export function getYMDHM0 (timestamp: number | string | Date) { const time = new Date(timestamp) const year = time.getFullYear() let month = time.getMonth() + 1 + '' let date = time.getDate() + '' let hours = time.getHours() + '' let minute = time.getMinutes() + '' if (month < 10) { month = '0' + month } if (date < 10) { date = '0' + date } if (hours < 10) { hours = '0' + hours } if (minute < 10) { minute = '0' + minute } return year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + '00' } src/views/data/point/DaPointChart.vue
@@ -24,8 +24,8 @@ <el-date-picker size="mini" v-model="dataForm.endTime" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:00" value-format="YYYY-MM-DD HH:mm:00" type="datetime" :clearable="false" placeholder="选择日期时间"/> @@ -53,7 +53,7 @@ import {ref} from 'vue'; import * as echarts from 'echarts'; import * as DaPoint from '@/api/data/da/point/daPointChart' import {getYMDHMS} from "@/utils/dateUtil" import {getYMDHM0} from "@/utils/dateUtil" import download from "@/utils/download"; const message = useMessage() // 消息弹窗 const visible = ref(false); @@ -69,7 +69,7 @@ pointNo: "", pointName: "", pointTypeName: "", startTime: getYMDHMS(new Date() - 60 * 60 * 1000), startTime: getYMDHM0(new Date() - 60 * 60 * 1000), endTime: "", });