|
@@ -79,13 +79,15 @@ const _GXGetList = async () => {
|
|
|
})),
|
|
})),
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- // 对年份进行自定义排序
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 对年份进行排序
|
|
|
formattedTreeData.sort((a, b) => {
|
|
formattedTreeData.sort((a, b) => {
|
|
|
- // 提取年份的后两位作为月份进行比较
|
|
|
|
|
- const monthA = parseInt(a.label.slice(-2), 10);
|
|
|
|
|
- const monthB = parseInt(b.label.slice(-2), 10);
|
|
|
|
|
- return monthB - monthA; // 降序排序
|
|
|
|
|
|
|
+ // 提取完整的“年份”(实际上是年月组合,但按整数比较会正确排序)
|
|
|
|
|
+ const fullYearA = parseInt(a.label, 10);
|
|
|
|
|
+ const fullYearB = parseInt(b.label, 10);
|
|
|
|
|
+
|
|
|
|
|
+ // 按“年份”降序排序
|
|
|
|
|
+ return fullYearB - fullYearA;
|
|
|
});
|
|
});
|
|
|
treeData.splice(0, treeData.length, ...formattedTreeData);
|
|
treeData.splice(0, treeData.length, ...formattedTreeData);
|
|
|
} catch (error) {
|
|
} catch (error) {
|