| 1 | <script setup lang="ts"> | 1 | <script setup lang="ts"> | 
|  |  | 2 | +  import { ref } from 'vue'; | 
| 2 | import LineChart from './components/LineChart.vue'; | 3 | import LineChart from './components/LineChart.vue'; | 
| 3 | import PieChart from './components/PieChart.vue'; | 4 | import PieChart from './components/PieChart.vue'; | 
| 4 | import Table from './components/Table.vue'; | 5 | import Table from './components/Table.vue'; | 
|  | @@ -27,6 +28,7 @@ |  | @@ -27,6 +28,7 @@ | 
| 27 | pieChartData: Recordable[]; | 28 | pieChartData: Recordable[]; | 
| 28 | timeLineChartData: Recordable[]; | 29 | timeLineChartData: Recordable[]; | 
| 29 | totalData: Recordable[]; | 30 | totalData: Recordable[]; | 
|  |  | 31 | +    timeLineXAxisData?: string[]; | 
| 30 | } | 32 | } | 
| 31 |  | 33 |  | 
| 32 | const chartData = reactive<ChartData>({ | 34 | const chartData = reactive<ChartData>({ | 
|  | @@ -34,6 +36,7 @@ |  | @@ -34,6 +36,7 @@ | 
| 34 | pieChartData: [], | 36 | pieChartData: [], | 
| 35 | timeLineChartData: [], | 37 | timeLineChartData: [], | 
| 36 | totalData: [], | 38 | totalData: [], | 
|  |  | 39 | +    timeLineXAxisData: [], | 
| 37 | }); | 40 | }); | 
| 38 |  | 41 |  | 
| 39 | // API统计 | 42 | // API统计 | 
|  | @@ -155,10 +158,13 @@ |  | @@ -155,10 +158,13 @@ | 
| 155 | ]; | 158 | ]; | 
| 156 | //代码保留 | 159 | //代码保留 | 
| 157 |  | 160 |  | 
|  |  | 161 | +  const timeType = ref(''); | 
|  |  | 162 | + | 
| 158 | // 接口调用历史 | 163 | // 接口调用历史 | 
| 159 | const getClassify = async (type?: string) => { | 164 | const getClassify = async (type?: string) => { | 
|  |  | 165 | +    timeType.value = type as string; | 
| 160 | const findValue = configTime.find((configItem) => configItem.name === type)?.value; | 166 | const findValue = configTime.find((configItem) => configItem.name === type)?.value; | 
| 161 | -    timeFormat(type, findValue); | 167 | +    chartData.timeLineXAxisData = timeFormat(type, findValue); | 
| 162 | const res = (await getApplicationRecordClassify(type)) as any as ClassifyItemType[]; | 168 | const res = (await getApplicationRecordClassify(type)) as any as ClassifyItemType[]; | 
| 163 | chartData.timeLineChartData = res?.map((classifyItem: ClassifyItemType) => ({ | 169 | chartData.timeLineChartData = res?.map((classifyItem: ClassifyItemType) => ({ | 
| 164 | type: 'line', | 170 | type: 'line', | 
|  | @@ -201,6 +207,8 @@ |  | @@ -201,6 +207,8 @@ | 
| 201 | <TimeLineChart | 207 | <TimeLineChart | 
| 202 | @emitTimeRange="handleReceiveTimeRange" | 208 | @emitTimeRange="handleReceiveTimeRange" | 
| 203 | :seriesData="chartData.timeLineChartData" | 209 | :seriesData="chartData.timeLineChartData" | 
|  |  | 210 | +        :timeLineXAxisData="chartData.timeLineXAxisData" | 
|  |  | 211 | +        :timeType="timeType" | 
| 204 | /> | 212 | /> | 
| 205 | </div> | 213 | </div> | 
| 206 | <div> | 214 | <div> |