fix: code style
parent
023a6ee29a
commit
0defca66e2
|
@ -15,14 +15,22 @@ export function getRangePickerDefaultProps() {
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
placeholder: ['开始时间', '结束时间'],
|
placeholder: ['开始时间', '结束时间'],
|
||||||
// prettier-ignore
|
|
||||||
ranges: {
|
ranges: {
|
||||||
'今天': [dayjs().startOf('day'), dayjs().endOf('day')],
|
今天: [dayjs().startOf('day'), dayjs().endOf('day')],
|
||||||
'昨天': [dayjs().subtract(1, 'day').startOf('day'), dayjs().subtract(1, 'day').endOf('day')],
|
昨天: [
|
||||||
'本周': [dayjs().startOf('week'), dayjs().endOf('day')],
|
dayjs().subtract(1, 'day').startOf('day'),
|
||||||
'本月': [dayjs().startOf('month'), dayjs().endOf('day')],
|
dayjs().subtract(1, 'day').endOf('day'),
|
||||||
'最近 7 天': [dayjs().subtract(7, 'day').startOf('day'), dayjs().endOf('day')],
|
],
|
||||||
'最近 30 天': [dayjs().subtract(30, 'day').startOf('day'), dayjs().endOf('day')],
|
本周: [dayjs().startOf('week'), dayjs().endOf('day')],
|
||||||
|
本月: [dayjs().startOf('month'), dayjs().endOf('day')],
|
||||||
|
'最近 7 天': [
|
||||||
|
dayjs().subtract(7, 'day').startOf('day'),
|
||||||
|
dayjs().endOf('day'),
|
||||||
|
],
|
||||||
|
'最近 30 天': [
|
||||||
|
dayjs().subtract(30, 'day').startOf('day'),
|
||||||
|
dayjs().endOf('day'),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
transformDateFunc: (dates: any) => {
|
transformDateFunc: (dates: any) => {
|
||||||
if (dates && dates.length === 2) {
|
if (dates && dates.length === 2) {
|
||||||
|
|
|
@ -39,14 +39,22 @@ export function getRangePickerDefaultProps() {
|
||||||
return {
|
return {
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
placeholder: ['开始时间', '结束时间'],
|
placeholder: ['开始时间', '结束时间'],
|
||||||
// prettier-ignore
|
|
||||||
ranges: {
|
ranges: {
|
||||||
'今天': [dayjs().startOf('day'), dayjs().endOf('day')],
|
今天: [dayjs().startOf('day'), dayjs().endOf('day')],
|
||||||
'最近 7 天': [dayjs().subtract(7, 'day').startOf('day'), dayjs().endOf('day')],
|
'最近 7 天': [
|
||||||
'最近 30 天': [dayjs().subtract(30, 'day').startOf('day'), dayjs().endOf('day')],
|
dayjs().subtract(7, 'day').startOf('day'),
|
||||||
'昨天': [dayjs().subtract(1, 'day').startOf('day'), dayjs().subtract(1, 'day').endOf('day')],
|
dayjs().endOf('day'),
|
||||||
'本周': [dayjs().startOf('week'), dayjs().endOf('day')],
|
],
|
||||||
'本月': [dayjs().startOf('month'), dayjs().endOf('day')],
|
'最近 30 天': [
|
||||||
|
dayjs().subtract(30, 'day').startOf('day'),
|
||||||
|
dayjs().endOf('day'),
|
||||||
|
],
|
||||||
|
昨天: [
|
||||||
|
dayjs().subtract(1, 'day').startOf('day'),
|
||||||
|
dayjs().subtract(1, 'day').endOf('day'),
|
||||||
|
],
|
||||||
|
本周: [dayjs().startOf('week'), dayjs().endOf('day')],
|
||||||
|
本月: [dayjs().startOf('month'), dayjs().endOf('day')],
|
||||||
},
|
},
|
||||||
showTime: {
|
showTime: {
|
||||||
defaultValue: [
|
defaultValue: [
|
||||||
|
@ -57,7 +65,8 @@ export function getRangePickerDefaultProps() {
|
||||||
},
|
},
|
||||||
transformDateFunc: (dates: any) => {
|
transformDateFunc: (dates: any) => {
|
||||||
if (dates && dates.length === 2) {
|
if (dates && dates.length === 2) {
|
||||||
return [dates.createTime[0], dates.createTime[1]].join(','); // 格式化为后台支持的时间格式
|
// 格式化为后台支持的时间格式
|
||||||
|
return [dates.createTime[0], dates.createTime[1]].join(',');
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,28 +3,24 @@ import dayjs from 'dayjs';
|
||||||
/** 时间段选择器拓展 */
|
/** 时间段选择器拓展 */
|
||||||
export function rangePickerExtend() {
|
export function rangePickerExtend() {
|
||||||
return {
|
return {
|
||||||
format: 'YYYY-MM-DD HH:mm:ss', // 显示格式
|
// 显示格式
|
||||||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
placeholder: ['开始时间', '结束时间'],
|
placeholder: ['开始时间', '结束时间'],
|
||||||
ranges: {
|
ranges: {
|
||||||
今天: [dayjs().startOf('day'), dayjs().endOf('day')],
|
今天: [dayjs().startOf('day'), dayjs().endOf('day')],
|
||||||
|
|
||||||
最近7天: [
|
最近7天: [
|
||||||
dayjs().subtract(7, 'day').startOf('day'),
|
dayjs().subtract(7, 'day').startOf('day'),
|
||||||
dayjs().endOf('day'),
|
dayjs().endOf('day'),
|
||||||
],
|
],
|
||||||
|
|
||||||
最近30天: [
|
最近30天: [
|
||||||
dayjs().subtract(30, 'day').startOf('day'),
|
dayjs().subtract(30, 'day').startOf('day'),
|
||||||
dayjs().endOf('day'),
|
dayjs().endOf('day'),
|
||||||
],
|
],
|
||||||
|
|
||||||
昨天: [
|
昨天: [
|
||||||
dayjs().subtract(1, 'day').startOf('day'),
|
dayjs().subtract(1, 'day').startOf('day'),
|
||||||
dayjs().subtract(1, 'day').endOf('day'),
|
dayjs().subtract(1, 'day').endOf('day'),
|
||||||
],
|
],
|
||||||
|
|
||||||
本周: [dayjs().startOf('week'), dayjs().endOf('day')],
|
本周: [dayjs().startOf('week'), dayjs().endOf('day')],
|
||||||
|
|
||||||
本月: [dayjs().startOf('month'), dayjs().endOf('day')],
|
本月: [dayjs().startOf('month'), dayjs().endOf('day')],
|
||||||
},
|
},
|
||||||
showTime: {
|
showTime: {
|
||||||
|
@ -36,7 +32,8 @@ export function rangePickerExtend() {
|
||||||
},
|
},
|
||||||
transformDateFunc: (dates: any) => {
|
transformDateFunc: (dates: any) => {
|
||||||
if (dates && dates.length === 2) {
|
if (dates && dates.length === 2) {
|
||||||
return [dates.createTime[0], dates.createTime[1]].join(','); // 格式化为后台支持的时间格式
|
// 格式化为后台支持的时间格式
|
||||||
|
return [dates.createTime[0], dates.createTime[1]].join(',');
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue