af-mobile-client-vue3 1.6.21 → 1.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/common/otherCharge/ChargePrintSelectorAndRemarks.vue +137 -137
- package/src/components/common/otherCharge/CodePayment.vue +357 -357
- package/src/components/common/otherCharge/FileUploader.vue +602 -602
- package/src/components/common/otherCharge/GridFileUploader.vue +846 -846
- package/src/components/common/otherCharge/PaymentMethodSelector.vue +202 -202
- package/src/components/common/otherCharge/PaymentMethodSelectorCard.vue +45 -45
- package/src/components/common/otherCharge/ReceiptModal.vue +273 -273
- package/src/components/common/otherCharge/index.ts +43 -43
- package/src/components/data/OtherCharge/OtherChargeGroupModal.vue +542 -542
- package/src/components/data/OtherCharge/OtherChargeItemModal.vue +547 -547
- package/src/components/data/UserDetail/recordEntries.ts +178 -178
- package/src/utils/queryFormDefaultRangePicker.ts +57 -57
- package/src/views/SafeInspection/SecurityCertificate/index.vue +1 -0
- package/src/views/component/XCellListView/index.vue +117 -101
- package/src/views/component/XFormGroupView/index.vue +47 -10
- package/src/views/component/XFormView/index.vue +20 -30
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
// 记录入口默认配置
|
|
2
|
-
// 此处如果导入getConfigByNameAsync,则项目无法启动且无法提交
|
|
3
|
-
// import { getConfigByNameAsync } from '@af-mobile-client-vue3/services/api/common'
|
|
4
|
-
// import { ref } from 'vue'
|
|
5
|
-
|
|
6
|
-
export interface RecordEntry {
|
|
7
|
-
id: string
|
|
8
|
-
title: string
|
|
9
|
-
icon: string
|
|
10
|
-
bgColor: string
|
|
11
|
-
textColor: string
|
|
12
|
-
dateLabel: string
|
|
13
|
-
route: string
|
|
14
|
-
path: string
|
|
15
|
-
forMeterTypes: string[]
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// 默认记录入口配置(静态默认值,用于插件初始化等场景)
|
|
19
|
-
export const defaultRecordEntries: RecordEntry[] = [
|
|
20
|
-
{
|
|
21
|
-
id: 'OperateRecords',
|
|
22
|
-
title: '操作记录',
|
|
23
|
-
icon: 'i-fa-solid-list',
|
|
24
|
-
bgColor: 'bg-gray-100',
|
|
25
|
-
textColor: 'text-gray-500',
|
|
26
|
-
dateLabel: '操作记录',
|
|
27
|
-
route: 'OperateRecords',
|
|
28
|
-
path: '/OperateRecords',
|
|
29
|
-
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: 'payment',
|
|
33
|
-
title: '缴费记录',
|
|
34
|
-
icon: 'i-fa6-solid-money-bill-wave',
|
|
35
|
-
bgColor: 'bg-blue-100',
|
|
36
|
-
textColor: 'text-blue-500',
|
|
37
|
-
dateLabel: '缴费',
|
|
38
|
-
route: 'PaymentRecords',
|
|
39
|
-
path: '/PaymentRecords',
|
|
40
|
-
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: 'meter',
|
|
44
|
-
title: '抄表记录',
|
|
45
|
-
icon: 'i-fa6-solid-chart-line',
|
|
46
|
-
bgColor: 'bg-green-100',
|
|
47
|
-
textColor: 'text-green-500',
|
|
48
|
-
dateLabel: '抄表',
|
|
49
|
-
route: 'MeterRecords',
|
|
50
|
-
path: '/MeterRecords',
|
|
51
|
-
forMeterTypes: ['物联网表', '机表'],
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 'transfer',
|
|
55
|
-
title: '过户记录',
|
|
56
|
-
icon: 'i-fa-solid-exchange-alt',
|
|
57
|
-
bgColor: 'bg-purple-100',
|
|
58
|
-
textColor: 'text-purple-500',
|
|
59
|
-
dateLabel: '过户',
|
|
60
|
-
route: 'TransferRecords',
|
|
61
|
-
path: '/TransferRecords',
|
|
62
|
-
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
id: 'replacement',
|
|
66
|
-
title: '换表记录',
|
|
67
|
-
icon: 'i-fa-solid-sync-alt',
|
|
68
|
-
bgColor: 'bg-orange-100',
|
|
69
|
-
textColor: 'text-orange-500',
|
|
70
|
-
dateLabel: '换表',
|
|
71
|
-
route: 'ReplacementRecords',
|
|
72
|
-
path: '/ReplacementRecords',
|
|
73
|
-
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: 'otherCharge',
|
|
77
|
-
title: '其他收费记录',
|
|
78
|
-
icon: 'i-fa-solid-receipt',
|
|
79
|
-
bgColor: 'bg-indigo-100',
|
|
80
|
-
textColor: 'text-indigo-500',
|
|
81
|
-
dateLabel: '其他收费',
|
|
82
|
-
route: 'OtherChargeRecords',
|
|
83
|
-
path: '/OtherChargeRecords',
|
|
84
|
-
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
id: 'abnormalAlarm',
|
|
88
|
-
title: '异常报警记录',
|
|
89
|
-
icon: 'i-fa-solid-exclamation-triangle',
|
|
90
|
-
bgColor: 'bg-red-100',
|
|
91
|
-
textColor: 'text-red-500',
|
|
92
|
-
dateLabel: '异常报警',
|
|
93
|
-
route: 'AbnormalAlarmRecords',
|
|
94
|
-
path: '/AbnormalAlarmRecords',
|
|
95
|
-
forMeterTypes: ['物联网表', '机表'],
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: 'cardReplacement',
|
|
99
|
-
title: '补卡记录',
|
|
100
|
-
icon: 'i-fa-solid-sync-alt',
|
|
101
|
-
bgColor: 'bg-orange-100',
|
|
102
|
-
textColor: 'text-orange-500',
|
|
103
|
-
dateLabel: '补卡',
|
|
104
|
-
route: 'CardReplacementRecords',
|
|
105
|
-
path: '/CardReplacementRecords',
|
|
106
|
-
forMeterTypes: ['气量卡表', '金额卡表', '机表'],
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
id: 'change',
|
|
110
|
-
title: '变更记录',
|
|
111
|
-
icon: 'i-fa-solid-exchange-alt',
|
|
112
|
-
bgColor: 'bg-purple-100',
|
|
113
|
-
textColor: 'text-purple-500',
|
|
114
|
-
dateLabel: '变更',
|
|
115
|
-
route: 'ChangeRecords',
|
|
116
|
-
path: '/ChangeRecords',
|
|
117
|
-
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: 'commandView',
|
|
121
|
-
title: '指令查看',
|
|
122
|
-
icon: 'i-fa-solid-eye',
|
|
123
|
-
bgColor: 'bg-blue-100',
|
|
124
|
-
textColor: 'text-blue-500',
|
|
125
|
-
dateLabel: '指令查看',
|
|
126
|
-
route: 'CommandViewRecords',
|
|
127
|
-
path: '/CommandViewRecords',
|
|
128
|
-
forMeterTypes: ['物联网表', '机表'],
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: 'gasCompensation',
|
|
132
|
-
title: '补气记录',
|
|
133
|
-
icon: 'i-fa-solid-plus',
|
|
134
|
-
bgColor: 'bg-green-100',
|
|
135
|
-
textColor: 'text-green-500',
|
|
136
|
-
dateLabel: '流水',
|
|
137
|
-
route: 'GasCompensationRecords',
|
|
138
|
-
path: '/GasCompensationRecords',
|
|
139
|
-
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
id: 'instrumentCollection',
|
|
143
|
-
title: '表具采集记录',
|
|
144
|
-
icon: 'i-fa-solid-list',
|
|
145
|
-
bgColor: 'bg-gray-100',
|
|
146
|
-
textColor: 'text-gray-500',
|
|
147
|
-
dateLabel: '表具采集',
|
|
148
|
-
route: 'InstrumentCollectionRecords',
|
|
149
|
-
path: '/InstrumentCollectionRecords',
|
|
150
|
-
forMeterTypes: ['物联网表', '机表'],
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
id: 'priceAdjustment',
|
|
154
|
-
title: '价格调整记录',
|
|
155
|
-
icon: 'i-fa-solid-dollar-sign',
|
|
156
|
-
bgColor: 'bg-red-100',
|
|
157
|
-
textColor: 'text-red-500',
|
|
158
|
-
dateLabel: '价格调整',
|
|
159
|
-
route: 'PriceAdjustmentRecords',
|
|
160
|
-
path: '/PriceAdjustmentRecords',
|
|
161
|
-
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
162
|
-
},
|
|
163
|
-
]
|
|
164
|
-
|
|
165
|
-
// 响应式记录入口配置,可被 API 数据更新
|
|
166
|
-
// export const recordEntries = ref<RecordEntry[]>([...defaultRecordEntries])
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* 从 API 获取记录入口配置并更新 recordEntries
|
|
170
|
-
* @returns API 返回的配置数据
|
|
171
|
-
*/
|
|
172
|
-
// export async function initRecordEntries() {
|
|
173
|
-
// const data = await getConfigByNameAsync('userInfoAndListConfig', 'af-revenue')
|
|
174
|
-
// if (data) {
|
|
175
|
-
// recordEntries.value = data?.records as RecordEntry[]
|
|
176
|
-
// }
|
|
177
|
-
// return data
|
|
178
|
-
// }
|
|
1
|
+
// 记录入口默认配置
|
|
2
|
+
// 此处如果导入getConfigByNameAsync,则项目无法启动且无法提交
|
|
3
|
+
// import { getConfigByNameAsync } from '@af-mobile-client-vue3/services/api/common'
|
|
4
|
+
// import { ref } from 'vue'
|
|
5
|
+
|
|
6
|
+
export interface RecordEntry {
|
|
7
|
+
id: string
|
|
8
|
+
title: string
|
|
9
|
+
icon: string
|
|
10
|
+
bgColor: string
|
|
11
|
+
textColor: string
|
|
12
|
+
dateLabel: string
|
|
13
|
+
route: string
|
|
14
|
+
path: string
|
|
15
|
+
forMeterTypes: string[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// 默认记录入口配置(静态默认值,用于插件初始化等场景)
|
|
19
|
+
export const defaultRecordEntries: RecordEntry[] = [
|
|
20
|
+
{
|
|
21
|
+
id: 'OperateRecords',
|
|
22
|
+
title: '操作记录',
|
|
23
|
+
icon: 'i-fa-solid-list',
|
|
24
|
+
bgColor: 'bg-gray-100',
|
|
25
|
+
textColor: 'text-gray-500',
|
|
26
|
+
dateLabel: '操作记录',
|
|
27
|
+
route: 'OperateRecords',
|
|
28
|
+
path: '/OperateRecords',
|
|
29
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'payment',
|
|
33
|
+
title: '缴费记录',
|
|
34
|
+
icon: 'i-fa6-solid-money-bill-wave',
|
|
35
|
+
bgColor: 'bg-blue-100',
|
|
36
|
+
textColor: 'text-blue-500',
|
|
37
|
+
dateLabel: '缴费',
|
|
38
|
+
route: 'PaymentRecords',
|
|
39
|
+
path: '/PaymentRecords',
|
|
40
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'meter',
|
|
44
|
+
title: '抄表记录',
|
|
45
|
+
icon: 'i-fa6-solid-chart-line',
|
|
46
|
+
bgColor: 'bg-green-100',
|
|
47
|
+
textColor: 'text-green-500',
|
|
48
|
+
dateLabel: '抄表',
|
|
49
|
+
route: 'MeterRecords',
|
|
50
|
+
path: '/MeterRecords',
|
|
51
|
+
forMeterTypes: ['物联网表', '机表'],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'transfer',
|
|
55
|
+
title: '过户记录',
|
|
56
|
+
icon: 'i-fa-solid-exchange-alt',
|
|
57
|
+
bgColor: 'bg-purple-100',
|
|
58
|
+
textColor: 'text-purple-500',
|
|
59
|
+
dateLabel: '过户',
|
|
60
|
+
route: 'TransferRecords',
|
|
61
|
+
path: '/TransferRecords',
|
|
62
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'replacement',
|
|
66
|
+
title: '换表记录',
|
|
67
|
+
icon: 'i-fa-solid-sync-alt',
|
|
68
|
+
bgColor: 'bg-orange-100',
|
|
69
|
+
textColor: 'text-orange-500',
|
|
70
|
+
dateLabel: '换表',
|
|
71
|
+
route: 'ReplacementRecords',
|
|
72
|
+
path: '/ReplacementRecords',
|
|
73
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 'otherCharge',
|
|
77
|
+
title: '其他收费记录',
|
|
78
|
+
icon: 'i-fa-solid-receipt',
|
|
79
|
+
bgColor: 'bg-indigo-100',
|
|
80
|
+
textColor: 'text-indigo-500',
|
|
81
|
+
dateLabel: '其他收费',
|
|
82
|
+
route: 'OtherChargeRecords',
|
|
83
|
+
path: '/OtherChargeRecords',
|
|
84
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'abnormalAlarm',
|
|
88
|
+
title: '异常报警记录',
|
|
89
|
+
icon: 'i-fa-solid-exclamation-triangle',
|
|
90
|
+
bgColor: 'bg-red-100',
|
|
91
|
+
textColor: 'text-red-500',
|
|
92
|
+
dateLabel: '异常报警',
|
|
93
|
+
route: 'AbnormalAlarmRecords',
|
|
94
|
+
path: '/AbnormalAlarmRecords',
|
|
95
|
+
forMeterTypes: ['物联网表', '机表'],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'cardReplacement',
|
|
99
|
+
title: '补卡记录',
|
|
100
|
+
icon: 'i-fa-solid-sync-alt',
|
|
101
|
+
bgColor: 'bg-orange-100',
|
|
102
|
+
textColor: 'text-orange-500',
|
|
103
|
+
dateLabel: '补卡',
|
|
104
|
+
route: 'CardReplacementRecords',
|
|
105
|
+
path: '/CardReplacementRecords',
|
|
106
|
+
forMeterTypes: ['气量卡表', '金额卡表', '机表'],
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: 'change',
|
|
110
|
+
title: '变更记录',
|
|
111
|
+
icon: 'i-fa-solid-exchange-alt',
|
|
112
|
+
bgColor: 'bg-purple-100',
|
|
113
|
+
textColor: 'text-purple-500',
|
|
114
|
+
dateLabel: '变更',
|
|
115
|
+
route: 'ChangeRecords',
|
|
116
|
+
path: '/ChangeRecords',
|
|
117
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 'commandView',
|
|
121
|
+
title: '指令查看',
|
|
122
|
+
icon: 'i-fa-solid-eye',
|
|
123
|
+
bgColor: 'bg-blue-100',
|
|
124
|
+
textColor: 'text-blue-500',
|
|
125
|
+
dateLabel: '指令查看',
|
|
126
|
+
route: 'CommandViewRecords',
|
|
127
|
+
path: '/CommandViewRecords',
|
|
128
|
+
forMeterTypes: ['物联网表', '机表'],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: 'gasCompensation',
|
|
132
|
+
title: '补气记录',
|
|
133
|
+
icon: 'i-fa-solid-plus',
|
|
134
|
+
bgColor: 'bg-green-100',
|
|
135
|
+
textColor: 'text-green-500',
|
|
136
|
+
dateLabel: '流水',
|
|
137
|
+
route: 'GasCompensationRecords',
|
|
138
|
+
path: '/GasCompensationRecords',
|
|
139
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: 'instrumentCollection',
|
|
143
|
+
title: '表具采集记录',
|
|
144
|
+
icon: 'i-fa-solid-list',
|
|
145
|
+
bgColor: 'bg-gray-100',
|
|
146
|
+
textColor: 'text-gray-500',
|
|
147
|
+
dateLabel: '表具采集',
|
|
148
|
+
route: 'InstrumentCollectionRecords',
|
|
149
|
+
path: '/InstrumentCollectionRecords',
|
|
150
|
+
forMeterTypes: ['物联网表', '机表'],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 'priceAdjustment',
|
|
154
|
+
title: '价格调整记录',
|
|
155
|
+
icon: 'i-fa-solid-dollar-sign',
|
|
156
|
+
bgColor: 'bg-red-100',
|
|
157
|
+
textColor: 'text-red-500',
|
|
158
|
+
dateLabel: '价格调整',
|
|
159
|
+
route: 'PriceAdjustmentRecords',
|
|
160
|
+
path: '/PriceAdjustmentRecords',
|
|
161
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
162
|
+
},
|
|
163
|
+
]
|
|
164
|
+
|
|
165
|
+
// 响应式记录入口配置,可被 API 数据更新
|
|
166
|
+
// export const recordEntries = ref<RecordEntry[]>([...defaultRecordEntries])
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* 从 API 获取记录入口配置并更新 recordEntries
|
|
170
|
+
* @returns API 返回的配置数据
|
|
171
|
+
*/
|
|
172
|
+
// export async function initRecordEntries() {
|
|
173
|
+
// const data = await getConfigByNameAsync('userInfoAndListConfig', 'af-revenue')
|
|
174
|
+
// if (data) {
|
|
175
|
+
// recordEntries.value = data?.records as RecordEntry[]
|
|
176
|
+
// }
|
|
177
|
+
// return data
|
|
178
|
+
// }
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 根据类型获取日期区间字符串
|
|
3
|
-
* @param type '当年' | 'curMonth' | '当日'
|
|
4
|
-
* @param show 区分实际值还是显示值, true为实际值, false为显示值
|
|
5
|
-
* @returns [start, end] 例:['2024-01-01 00:00:00', '2024-12-31 23:59:59']
|
|
6
|
-
*/
|
|
7
|
-
export function getRangeByType(type: string, show: boolean): [string, string] {
|
|
8
|
-
const now = new Date()
|
|
9
|
-
const year = now.getFullYear()
|
|
10
|
-
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
|
11
|
-
const day = now.getDate().toString().padStart(2, '0')
|
|
12
|
-
|
|
13
|
-
if (!show) {
|
|
14
|
-
if (type === 'curYear') {
|
|
15
|
-
return [
|
|
16
|
-
`${year}-01-01 00:00:00`,
|
|
17
|
-
`${year}-12-31 23:59:59`,
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
if (type === 'curMonth') {
|
|
21
|
-
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
22
|
-
return [
|
|
23
|
-
`${year}-${month}-01 00:00:00`,
|
|
24
|
-
`${year}-${month}-${lastDay.toString().padStart(2, '0')} 23:59:59`,
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
if (type === 'curDay') {
|
|
28
|
-
return [
|
|
29
|
-
`${year}-${month}-${day} 00:00:00`,
|
|
30
|
-
`${year}-${month}-${day} 23:59:59`,
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (show) {
|
|
35
|
-
if (type === 'curYear') {
|
|
36
|
-
return [
|
|
37
|
-
`${year}-01-01`,
|
|
38
|
-
`${year}-12-31`,
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
if (type === 'curMonth') {
|
|
42
|
-
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
43
|
-
return [
|
|
44
|
-
`${year}-${month}-01`,
|
|
45
|
-
`${year}-${month}-${lastDay.toString().padStart(2, '0')}`,
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
if (type === 'curDay') {
|
|
49
|
-
return [
|
|
50
|
-
`${year}-${month}-${day}`,
|
|
51
|
-
`${year}-${month}-${day}`,
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// 兜底返回空字符串数组
|
|
56
|
-
return ['', '']
|
|
57
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 根据类型获取日期区间字符串
|
|
3
|
+
* @param type '当年' | 'curMonth' | '当日'
|
|
4
|
+
* @param show 区分实际值还是显示值, true为实际值, false为显示值
|
|
5
|
+
* @returns [start, end] 例:['2024-01-01 00:00:00', '2024-12-31 23:59:59']
|
|
6
|
+
*/
|
|
7
|
+
export function getRangeByType(type: string, show: boolean): [string, string] {
|
|
8
|
+
const now = new Date()
|
|
9
|
+
const year = now.getFullYear()
|
|
10
|
+
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
|
11
|
+
const day = now.getDate().toString().padStart(2, '0')
|
|
12
|
+
|
|
13
|
+
if (!show) {
|
|
14
|
+
if (type === 'curYear') {
|
|
15
|
+
return [
|
|
16
|
+
`${year}-01-01 00:00:00`,
|
|
17
|
+
`${year}-12-31 23:59:59`,
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
if (type === 'curMonth') {
|
|
21
|
+
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
22
|
+
return [
|
|
23
|
+
`${year}-${month}-01 00:00:00`,
|
|
24
|
+
`${year}-${month}-${lastDay.toString().padStart(2, '0')} 23:59:59`,
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
if (type === 'curDay') {
|
|
28
|
+
return [
|
|
29
|
+
`${year}-${month}-${day} 00:00:00`,
|
|
30
|
+
`${year}-${month}-${day} 23:59:59`,
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (show) {
|
|
35
|
+
if (type === 'curYear') {
|
|
36
|
+
return [
|
|
37
|
+
`${year}-01-01`,
|
|
38
|
+
`${year}-12-31`,
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
if (type === 'curMonth') {
|
|
42
|
+
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
43
|
+
return [
|
|
44
|
+
`${year}-${month}-01`,
|
|
45
|
+
`${year}-${month}-${lastDay.toString().padStart(2, '0')}`,
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
if (type === 'curDay') {
|
|
49
|
+
return [
|
|
50
|
+
`${year}-${month}-${day}`,
|
|
51
|
+
`${year}-${month}-${day}`,
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// 兜底返回空字符串数组
|
|
56
|
+
return ['', '']
|
|
57
|
+
}
|