|
@@ -2101,8 +2101,19 @@ export default {
|
|
|
|
|
|
|
|
/** 初始化当前训练营期数列表 */
|
|
/** 初始化当前训练营期数列表 */
|
|
|
initCurrentCampPeriods() {
|
|
initCurrentCampPeriods() {
|
|
|
- this.currentCampPeriods = [...(this.periodList || [])];
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // 对当前营期列表按照创建时间倒序排序(最新的在前面)
|
|
|
|
|
+ this.currentCampPeriods = [...(this.periodList || [])].sort((a, b) => {
|
|
|
|
|
+ // 如果没有创建时间,按原始顺序
|
|
|
|
|
+ if (!a.createTime || !b.createTime) return 0;
|
|
|
|
|
+
|
|
|
|
|
+ // 将时间字符串转换为时间戳进行比较
|
|
|
|
|
+ const timeA = new Date(a.createTime).getTime();
|
|
|
|
|
+ const timeB = new Date(b.createTime).getTime();
|
|
|
|
|
+
|
|
|
|
|
+ // 按创建时间倒序排列(最新的在前面)
|
|
|
|
|
+ return timeB - timeA;
|
|
|
|
|
+ });
|
|
|
|
|
+},
|
|
|
|
|
|
|
|
/** 处理创建方式变更 */
|
|
/** 处理创建方式变更 */
|
|
|
async handlePeriodTypeChange(value) {
|
|
async handlePeriodTypeChange(value) {
|