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

营业额明显页面修改

parent abfc53f5
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
components: {LineBarChart, WinnersList, DisplayBoard, ContrastCard, TableColumn, TitleContentMark}, components: {LineBarChart, WinnersList, DisplayBoard, ContrastCard, TableColumn, TitleContentMark},
data() { data() {
return { return {
today: '2022-06-26', today: moment().format("yyyy-MM-DD"),
currentHeadData:[], currentHeadData:[],
currentDetailData:[], currentDetailData:[],
chart: null, chart: null,
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<script> <script>
import axios from "axios"; import axios from "axios";
import {prefixZero} from "../utils/numUtil";
window.axios = axios window.axios = axios
window.$ = window.jQuery = require('materialize-css/node_modules/jquery/dist/jquery.js') window.$ = window.jQuery = require('materialize-css/node_modules/jquery/dist/jquery.js')
require('materialize-css') require('materialize-css')
...@@ -45,8 +46,8 @@ export default { ...@@ -45,8 +46,8 @@ export default {
}, },
setCurrentDateTime(){ setCurrentDateTime(){
let now = new Date(); let now = new Date();
this.currentDate = now.getFullYear() + "-" + (now.getMonth()+1) + "-" + now.getDate(); this.currentDate = now.getFullYear() + "-" + prefixZero(now.getMonth()+1,2) + "-" + prefixZero(now.getDate(),2);
this.currentTime = now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds(); this.currentTime = prefixZero(now.getHours(),2) + ":" + prefixZero(now.getMinutes(),2) + ":" + prefixZero(now.getSeconds(),2);
this.currentWeek = this.week[now.getDay()]; this.currentWeek = this.week[now.getDay()];
}, },
}, },
......
...@@ -69,3 +69,11 @@ function formater(data) { ...@@ -69,3 +69,11 @@ function formater(data) {
} }
return intPartFormat + floatPart 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