5fcc1352
Andy
add 车主模板 左侧菜单
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
import DateUtils from './DateUtils.js';
/**
* 将制定格式的时间字符串转换成long
* <li>0-yyyyMMdd</li>
* <li>1-yyyy-MM-dd</li>
* <li>2-HHmmss</li>
* <li>3-HH:mm:ss</li>
* <li>4-HHmmssSSS</li>
* <li>5-HH:mm:ss.SSS</li>
* <li>6-yyyyMMddHHmmss</li>
* <li>7-yyyy-MM-dd HH:mm:ss</li>
* <li>8-yyyyMMddHHmmssSSS</li>
* <li>9-yyyy-MM-dd HH:mm:ss.SSS</li>
* <li>10-yyyy/MM/dd HH:mm</li>
* <li>11-yyyy/MM/dd HH:mm:ss</li>
*/
// 日期格式处理 精确到时分秒 如:2018-10-24 08:41:33
export function timeFormatter(value, row, index) {
if (value == null || value == undefined || value == '') {
return "-";
} else {
return DateUtils.long2String(value, 7);
}
}
// 日期格式处理 精确到年月日 如:2018-10-24
export function timeOneFormatter(value, row, index) {
if (value == null || value == undefined || value == '') {
return "-";
} else {
return DateUtils.long2String(value, 1);
}
}
// 时间处理,获取日期的当天开始时间:'2019-06-01 00:00:00'
export function getBeginOfTheDay(value) {
if (value == null || value == undefined || value == '') {
return new Date(new Date(new Date().toLocaleDateString()).getTime());
} else {
return new Date(new Date(value.toLocaleDateString()).getTime());
}
}
// 时间处理,获取日期的当天开始时间:'2019-06-01 23:59:59
export function getEndOfTheDay(value) {
if (value == null || value == undefined || value == '') {
return new Date(new Date(new Date().toLocaleDateString()).getTime()+24*60*60*1000-1);
} else {
return new Date(new Date(value.toLocaleDateString()).getTime()+24*60*60*1000-1);
}
}
// 日期格式处理 精确到年月 如:2018-10
export function yearMonthFormatter(value, row, index) {
if (value == null || value == undefined || value == '') {
return "-";
} else {
var str = DateUtils.long2String(value, 1);
return str.substr(0, 7);
}
}
// 金钱格式处理
export function moneyFormatter(value) {
if (value == '0' || value == undefined || value == null || value === '') {
return '0.00';
} else {
return (value / 100).toFixed(2);
}
}
|