shijiplus-web-plugin 0.1.26 → 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,6 +1,6 @@
1
1
  {
2
2
  "name": "shijiplus-web-plugin",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "files": [
5
5
  "src"
6
6
  ],
@@ -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() {
@@ -50,7 +49,8 @@ export default {
50
49
  endDate: intervalEnd,
51
50
  pageNo: 1,
52
51
  currentPage: 1,
53
- pageSize: 1
52
+ pageSize: 1,
53
+ timestamp: new Date().getTime()
54
54
  }
55
55
  await this.delay()
56
56
  const res = await apiFunction(intervalSearchForm)
@@ -90,12 +90,19 @@ export default {
90
90
 
91
91
  // Main export function
92
92
  async invokeExportExcel(searchForm, apiFunction) {
93
+ // 3. Initialize the progress modal
94
+ let instance = null
93
95
  try {
94
96
  // 0. Validate the date range (limit to 1 month)
95
- const startDate = new Date(searchForm.startDate || searchForm.startTime)
96
- const endDate = new Date(searchForm.endDate || searchForm.startTime)
97
+ const startDate = new Date(searchForm.startDate || searchForm.startTime || "")
98
+ const endDate = new Date(searchForm.endDate || searchForm.startTime || "")
97
99
  const oneMonthInMs = 31 * 24 * 60 * 60 * 1000 // 1 个月的毫秒数
98
-
100
+ if (!startDate || !endDate) {
101
+ setTimeout(() => {
102
+ this.$Message.error('请选择导出开始和结束时间', 3)
103
+ }, 0)
104
+ return
105
+ }
99
106
  if (endDate - startDate > oneMonthInMs) {
100
107
  setTimeout(() => {
101
108
  this.$Message.error('导出时间范围不能超过1个月,请调整后重试', 3)
@@ -125,9 +132,7 @@ export default {
125
132
 
126
133
  // 2. Get the 4-hour intervals from startDate to endDate
127
134
  const intervals = this.getDateRange(startDate, endDate)
128
-
129
- // 3. Initialize the progress modal
130
- const instance = this.$getComponentInstance(PlusCircleProgressModal)
135
+ instance = this.$getComponentInstance(PlusCircleProgressModal)
131
136
  instance.$on('on-close', () => {
132
137
  setTimeout(() => {
133
138
  this.$removeVComp(instance)