Commit 2f2173a32d953eb9eaa02c2098c88a5ad8e8c4d8
Committed by
xp.Huang
1 parent
b764a398
fix: 修复调用统计数据排序
Showing
3 changed files
with
9 additions
and
4 deletions
| @@ -54,8 +54,12 @@ export const formSchema: DescItem[] = [ | @@ -54,8 +54,12 @@ export const formSchema: DescItem[] = [ | ||
| 54 | 54 | ||
| 55 | function generateFullXAxis(type: DateInterval) { | 55 | function generateFullXAxis(type: DateInterval) { |
| 56 | if (type === 'hour') { | 56 | if (type === 'hour') { |
| 57 | + let minute = dateUtil().minute(); | ||
| 58 | + minute = minute - (minute % 10); | ||
| 59 | + | ||
| 57 | return Array.from({ length: 60 / 5 }, (_, index) => | 60 | return Array.from({ length: 60 / 5 }, (_, index) => |
| 58 | dateUtil() | 61 | dateUtil() |
| 62 | + .minute(minute) | ||
| 59 | .subtract(index * 5, 'minute') | 63 | .subtract(index * 5, 'minute') |
| 60 | .startOf('minute') | 64 | .startOf('minute') |
| 61 | .valueOf() | 65 | .valueOf() |
| @@ -119,14 +123,14 @@ export function transformChartsOptionsByClassifyRecord( | @@ -119,14 +123,14 @@ export function transformChartsOptionsByClassifyRecord( | ||
| 119 | return { | 123 | return { |
| 120 | type: 'line', | 124 | type: 'line', |
| 121 | name: formatClassifyText[classify], | 125 | name: formatClassifyText[classify], |
| 122 | - data: dts.map(({ count }) => count), | 126 | + data: dts.map(({ count }) => count).reverse(), |
| 123 | }; | 127 | }; |
| 124 | }); | 128 | }); |
| 125 | 129 | ||
| 126 | const xAxisData = generateFullXAxis(type).map((timeSpan) => formatDateFromType(timeSpan, type)); | 130 | const xAxisData = generateFullXAxis(type).map((timeSpan) => formatDateFromType(timeSpan, type)); |
| 127 | 131 | ||
| 128 | return { | 132 | return { |
| 129 | - series: series.reverse(), | 133 | + series, |
| 130 | xAxis: { | 134 | xAxis: { |
| 131 | type: 'category', | 135 | type: 'category', |
| 132 | data: xAxisData.reverse(), | 136 | data: xAxisData.reverse(), |
| @@ -90,8 +90,6 @@ | @@ -90,8 +90,6 @@ | ||
| 90 | // 接口调用历史 | 90 | // 接口调用历史 |
| 91 | const getClassify = async (type: DateInterval) => { | 91 | const getClassify = async (type: DateInterval) => { |
| 92 | timeType.value = type; | 92 | timeType.value = type; |
| 93 | - // const findValue = configTime.find((configItem) => configItem.name === type)?.value; | ||
| 94 | - // chartData.timeLineXAxisData = timeFormat(type, findValue); | ||
| 95 | const res = await getApplicationRecordClassify(type); | 93 | const res = await getApplicationRecordClassify(type); |
| 96 | 94 | ||
| 97 | const transformData = transformClassifyItem(res, type); | 95 | const transformData = transformClassifyItem(res, type); |