vue2-client 1.17.48 → 1.17.49

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.
@@ -93,15 +93,26 @@ export default {
93
93
  groupedFiles () {
94
94
  const groups = {}
95
95
  this.files.forEach(file => {
96
- const date = file.upload_time.split(' ')[0]
97
- if (!groups[date]) {
98
- groups[date] = []
96
+ const originalDate = file.upload_time?.split(' ')[0]
97
+
98
+ let displayDate
99
+ if (!originalDate || !/^\d{4}-\d{2}-\d{2}$/.test(originalDate)) {
100
+ displayDate = '无日期'
101
+ } else {
102
+ displayDate = originalDate
99
103
  }
100
- groups[date].push(file)
104
+
105
+ groups[displayDate] = groups[displayDate] || []
106
+ groups[displayDate].push(file)
101
107
  })
102
- // 按日期降序排序
108
+
109
+ // 自定义排序:有日期的按日期降序,无日期在最后
103
110
  return Object.fromEntries(
104
- Object.entries(groups).sort(([a], [b]) => b.localeCompare(a))
111
+ Object.entries(groups).sort(([dateA], [dateB]) => {
112
+ if (dateA === '无日期') return 1
113
+ if (dateB === '无日期') return -1
114
+ return dateB.localeCompare(dateA)
115
+ })
105
116
  )
106
117
  }
107
118
  },
@@ -120,10 +131,12 @@ export default {
120
131
  queryDate = undefined
121
132
  }
122
133
  const callback = (res) => {
134
+ console.warn('>>>callback', res)
123
135
  this.files = res.files
124
136
  this.loading = false
125
137
  }
126
138
  const errorCallback = (e) => {
139
+ console.warn('>>>errorCallback', e)
127
140
  this.$message.error('获取文件列表失败:' + e.getMessage())
128
141
  this.loading = false
129
142
  }
@@ -134,6 +147,9 @@ export default {
134
147
  })
135
148
  },
136
149
  formatDate (date) {
150
+ if (date === '无日期') {
151
+ return '无日期'
152
+ }
137
153
  const today = new Date().toISOString().split('T')[0]
138
154
  const yesterday = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString().split('T')[0]
139
155