Commit 7d0c808c authored by 潘自豪's avatar 潘自豪

营业额明显页面修改

parent abfc53f5
......@@ -62,7 +62,7 @@ export default {
components: {LineBarChart, WinnersList, DisplayBoard, ContrastCard, TableColumn, TitleContentMark},
data() {
return {
today: '2022-06-26',
today: moment().format("yyyy-MM-DD"),
currentHeadData:[],
currentDetailData:[],
chart: null,
......
......@@ -17,6 +17,7 @@
<script>
import axios from "axios";
import {prefixZero} from "../utils/numUtil";
window.axios = axios
window.$ = window.jQuery = require('materialize-css/node_modules/jquery/dist/jquery.js')
require('materialize-css')
......@@ -45,8 +46,8 @@ export default {
},
setCurrentDateTime(){
let now = new Date();
this.currentDate = now.getFullYear() + "-" + (now.getMonth()+1) + "-" + now.getDate();
this.currentTime = now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds();
this.currentDate = now.getFullYear() + "-" + prefixZero(now.getMonth()+1,2) + "-" + prefixZero(now.getDate(),2);
this.currentTime = prefixZero(now.getHours(),2) + ":" + prefixZero(now.getMinutes(),2) + ":" + prefixZero(now.getSeconds(),2);
this.currentWeek = this.week[now.getDay()];
},
},
......
......@@ -69,3 +69,11 @@ function formater(data) {
}
return intPartFormat + floatPart
}
/**
* @param num: 被操作数
* @param n: 固定的总位数
*/
export const prefixZero = function (num, n) {
return (Array(n).join(0) + num).slice(-n);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment