shijiplus-web-plugin 0.1.27 → 0.1.28
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
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
1
|
import PlusCircleProgressModal from './plus-circle-progress-modal.vue'
|
|
3
2
|
export default {
|
|
4
3
|
data() {
|
|
@@ -92,18 +91,18 @@ export default {
|
|
|
92
91
|
// Main export function
|
|
93
92
|
async invokeExportExcel(searchForm, apiFunction) {
|
|
94
93
|
// 3. Initialize the progress modal
|
|
95
|
-
|
|
96
|
-
instance.$on('on-close', () => {
|
|
97
|
-
setTimeout(() => {
|
|
98
|
-
this.$removeVComp(instance)
|
|
99
|
-
}, 500)
|
|
100
|
-
})
|
|
94
|
+
let instance = null
|
|
101
95
|
try {
|
|
102
96
|
// 0. Validate the date range (limit to 1 month)
|
|
103
97
|
const startDate = new Date(searchForm.startDate || searchForm.startTime || "")
|
|
104
98
|
const endDate = new Date(searchForm.endDate || searchForm.startTime || "")
|
|
105
99
|
const oneMonthInMs = 31 * 24 * 60 * 60 * 1000 // 1 个月的毫秒数
|
|
106
|
-
|
|
100
|
+
if (!startDate || !endDate) {
|
|
101
|
+
setTimeout(() => {
|
|
102
|
+
this.$Message.error('请选择导出开始和结束时间', 3)
|
|
103
|
+
}, 0)
|
|
104
|
+
return
|
|
105
|
+
}
|
|
107
106
|
if (endDate - startDate > oneMonthInMs) {
|
|
108
107
|
setTimeout(() => {
|
|
109
108
|
this.$Message.error('导出时间范围不能超过1个月,请调整后重试', 3)
|
|
@@ -133,7 +132,12 @@ export default {
|
|
|
133
132
|
|
|
134
133
|
// 2. Get the 4-hour intervals from startDate to endDate
|
|
135
134
|
const intervals = this.getDateRange(startDate, endDate)
|
|
136
|
-
|
|
135
|
+
instance = this.$getComponentInstance(PlusCircleProgressModal)
|
|
136
|
+
instance.$on('on-close', () => {
|
|
137
|
+
setTimeout(() => {
|
|
138
|
+
this.$removeVComp(instance)
|
|
139
|
+
}, 500)
|
|
140
|
+
})
|
|
137
141
|
instance.show()
|
|
138
142
|
|
|
139
143
|
// 4. Fetch data interval by interval and update progress
|