Commit 2f2173a32d953eb9eaa02c2098c88a5ad8e8c4d8

Authored by 温伟
Committed by xp.Huang
1 parent b764a398

fix: 修复调用统计数据排序

... ... @@ -34,4 +34,7 @@
34 34 "vueuse",
35 35 "windicss"
36 36 ],
  37 + "[vue]": {
  38 + "editor.defaultFormatter": "Vue.volar"
  39 + },
37 40 }
... ...
... ... @@ -54,8 +54,12 @@ export const formSchema: DescItem[] = [
54 54
55 55 function generateFullXAxis(type: DateInterval) {
56 56 if (type === 'hour') {
  57 + let minute = dateUtil().minute();
  58 + minute = minute - (minute % 10);
  59 +
57 60 return Array.from({ length: 60 / 5 }, (_, index) =>
58 61 dateUtil()
  62 + .minute(minute)
59 63 .subtract(index * 5, 'minute')
60 64 .startOf('minute')
61 65 .valueOf()
... ... @@ -119,14 +123,14 @@ export function transformChartsOptionsByClassifyRecord(
119 123 return {
120 124 type: 'line',
121 125 name: formatClassifyText[classify],
122   - data: dts.map(({ count }) => count),
  126 + data: dts.map(({ count }) => count).reverse(),
123 127 };
124 128 });
125 129
126 130 const xAxisData = generateFullXAxis(type).map((timeSpan) => formatDateFromType(timeSpan, type));
127 131
128 132 return {
129   - series: series.reverse(),
  133 + series,
130 134 xAxis: {
131 135 type: 'category',
132 136 data: xAxisData.reverse(),
... ...
... ... @@ -90,8 +90,6 @@
90 90 // 接口调用历史
91 91 const getClassify = async (type: DateInterval) => {
92 92 timeType.value = type;
93   - // const findValue = configTime.find((configItem) => configItem.name === type)?.value;
94   - // chartData.timeLineXAxisData = timeFormat(type, findValue);
95 93 const res = await getApplicationRecordClassify(type);
96 94
97 95 const transformData = transformClassifyItem(res, type);
... ...