Commit f73e9489 authored by 罗林杰's avatar 罗林杰

修改API监控

parent 53b8aa6c
import {getAllRoleList} from '@/api/system/role/role'; import { getAllRoleList } from '@/api/system/role/role';
import { BasicColumn, FormSchema } from '@/components/Table'; import { BasicColumn, FormSchema } from '@/components/Table';
import {h} from "vue"; import { h } from 'vue';
import {Tag} from "ant-design-vue"; import { Tag, Switch } from 'ant-design-vue';
import { Switch } from 'ant-design-vue'; import { useMessage } from '@/hooks/web/useMessage';
import {useMessage} from "@/hooks/web/useMessage"; import { changeFlagApi } from '@/api/system/user/user';
import {changeFlagApi} from "@/api/system/user/user"; // 引入开关组件 // 引入开关组件
type CheckedType = boolean | string | number; type CheckedType = boolean | string | number;
export const columns1: BasicColumn[] = [ export const columns1: BasicColumn[] = [
{ {
title: 'gateway', title: 'gateway',
...@@ -40,12 +39,12 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -40,12 +39,12 @@ export const searchFormSchema: FormSchema[] = [
field: 'callBy', field: 'callBy',
label: '调用者', label: '调用者',
component: 'Select', component: 'Select',
labelWidth:50, labelWidth: 50,
componentProps: { componentProps: {
options:[ options: [
{ {
label:'admin', label: 'admin',
value:'admin' value: 'admin',
}, },
], ],
placeholder: '请选择调用者', placeholder: '请选择调用者',
...@@ -55,9 +54,35 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -55,9 +54,35 @@ export const searchFormSchema: FormSchema[] = [
{ {
field: 'callTime', field: 'callTime',
label: ' 调用时间', label: ' 调用时间',
labelWidth:100, labelWidth: 100,
component: 'DatePicker', component: 'DatePicker',
colProps: { lg: 7, md: 24 }, colProps: { lg: 7, md: 24 },
}, },
]; ];
export const partitionColumns: BasicColumn[] = [
{
title: '调用时间',
dataIndex: 'date',
width: 120,
},
{
title: '调用时长',
dataIndex: 'time',
width: 120,
},
{
title: 'Http错误码',
dataIndex: 'code',
width: 120,
},
{
title: '业务错误码',
dataIndex: 'bizCode',
width: 120,
},
{
title: '调用者',
dataIndex: 'user',
width: 120,
},
];
...@@ -311,3 +311,40 @@ export const second4Data = [ ...@@ -311,3 +311,40 @@ export const second4Data = [
{ date: '10/06', value: 333 }, { date: '10/06', value: 333 },
{ date: '10/07', value: 223 }, { date: '10/07', value: 223 },
]; ];
export const partitionData: any[] = [
{
date: '2024-11-30 08:00',
time: '0.25s',
code: 200,
bizCode: 0,
user: 'user1',
},
{
date: '2024-11-30 09:15',
time: '1.50s',
code: 404,
bizCode: 1001,
user: 'user2',
},
{
date: '2024-11-30 10:30',
time: '0.75s',
code: 500,
bizCode: 1002,
user: 'user3',
},
{
date: '2024-11-30 11:45',
time: '0.10s',
code: 200,
bizCode: 0,
user: 'user4',
},
{
date: '2024-11-30 13:00',
time: '2.00s',
code: 400,
bizCode: 1003,
user: 'user5',
},
];
<template> <template>
<Card :loading="loading"> <BasicTable @register="registerPartitionTable">
666 <template #bodyCell="{ column }">
</Card> <template v-if="column.key === 'action'">
<TableAction
:actions="[
{
label: '查看日志',
},
]"
/>
</template>
</template>
</BasicTable>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { BasicTable, TableAction, useTable } from '@/components/Table';
import { Tag, Card,Select } from 'ant-design-vue'; import { partitionColumns } from '@/views/dataSharingAndExchange/ApiMonitor/ApiMonitor.data';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { partitionData } from '@/views/dataSharingAndExchange/ApiMonitor/ApiMonitorData';
import {} from "./ApiMonitor.data";
import {} from "./ApiMonitorData";
import Icon from '@/components/Icon/Icon.vue';
const [registerPartitionTable] = useTable({
title: '调用失败记录',
dataSource: partitionData,
columns: partitionColumns,
pagination: false,
showIndexColumn: false,
pagination: true,
actionColumn: {
width: 120,
title: '操作',
dataIndex: 'action',
fixed: 'right',
},
scroll: { y: 300 },
});
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment