mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-07 01:46:43 +08:00
完善ai调用日志页面代码
This commit is contained in:
@@ -57,7 +57,7 @@
|
|||||||
<div class="tableBox">
|
<div class="tableBox">
|
||||||
<a-table style="border: 1px solid #f2f6fe" :columns="column" :data-source="tableData" :loading="loading"
|
<a-table style="border: 1px solid #f2f6fe" :columns="column" :data-source="tableData" :loading="loading"
|
||||||
:scroll="{ x: 1100 }" :pagination="false">
|
:scroll="{ x: 1100 }" :pagination="false">
|
||||||
<template #actions="{ text, record, index }">
|
<template #actions="{ record }">
|
||||||
<a-space :key="record.id">
|
<a-space :key="record.id">
|
||||||
<a-button @click="() => handleMark(record)" type="link">
|
<a-button @click="() => handleMark(record)" type="link">
|
||||||
查看
|
查看
|
||||||
@@ -89,6 +89,8 @@
|
|||||||
import { defineComponent, onMounted, reactive, toRefs } from "vue";
|
import { defineComponent, onMounted, reactive, toRefs } from "vue";
|
||||||
import dialog from "@/utils/dialog";
|
import dialog from "@/utils/dialog";
|
||||||
import { getAiLogList, getClearLogs, getRetry } from "@/api/case";
|
import { getAiLogList, getClearLogs, getRetry } from "@/api/case";
|
||||||
|
import {message} from "ant-design-vue";
|
||||||
|
import { get } from "jquery";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
@@ -125,16 +127,7 @@ export default defineComponent({
|
|||||||
width: "10%",
|
width: "10%",
|
||||||
className: "h",
|
className: "h",
|
||||||
customRender: ({ text }) => {
|
customRender: ({ text }) => {
|
||||||
switch (text) {
|
return text ? text : "-";
|
||||||
case 'create':
|
|
||||||
return <span>新增</ span>;
|
|
||||||
case 'delete':
|
|
||||||
return <span>删除</span>;
|
|
||||||
case 'update':
|
|
||||||
return <span>更改</span>;
|
|
||||||
default:
|
|
||||||
return <span>-</span>;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -149,8 +142,8 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "调用时间",
|
title: "调用时间",
|
||||||
dataIndex: "callTime",
|
dataIndex: "optTime",
|
||||||
key: "callTime",
|
key: "optTime",
|
||||||
width: "15%",
|
width: "15%",
|
||||||
className: "h",
|
className: "h",
|
||||||
customRender: ({ text }) => {
|
customRender: ({ text }) => {
|
||||||
@@ -241,18 +234,20 @@ export default defineComponent({
|
|||||||
let res = await getAiLogList({
|
let res = await getAiLogList({
|
||||||
pageIndex: state.pageIndex,
|
pageIndex: state.pageIndex,
|
||||||
pageSize: state.pageSize,
|
pageSize: state.pageSize,
|
||||||
caseTitle: state.caseTitle,
|
caseTitle: state.searchData.caseTitle,
|
||||||
optType: state.optType,
|
optType: state.searchData.optType,
|
||||||
optStatus: state.optStatus,
|
optStatus: state.searchData.optStatus,
|
||||||
caseStatus: state.caseStatus,
|
caseStatus: state.searchData.caseStatus,
|
||||||
startTime: state.callTimeList[0],
|
optTimeStart: state.searchData.callTimeList && state.searchData.callTimeList[0] ? state.searchData.callTimeList[0] + ' 00:00:00' : '',
|
||||||
endTime: state.callTimeList[1],
|
optTimeEnd: state.searchData.callTimeList && state.searchData.callTimeList[1] ? state.searchData.callTimeList[1] + ' 00:00:00' : '',
|
||||||
});
|
});
|
||||||
const { records, totalPages } = res.data.data.content;
|
console.log(res);
|
||||||
const { count } = res.data.data
|
|
||||||
|
// const { records, totalPages } = res.data.result.list;
|
||||||
|
const { count } = res.data.result
|
||||||
state.count = count
|
state.count = count
|
||||||
state.tableData = records;
|
state.tableData = res.data.result.list;
|
||||||
state.total = totalPages;
|
state.total = res.data.result.totalPages;
|
||||||
}
|
}
|
||||||
getTableDate()
|
getTableDate()
|
||||||
// 搜索
|
// 搜索
|
||||||
@@ -281,26 +276,35 @@ export default defineComponent({
|
|||||||
|
|
||||||
}
|
}
|
||||||
const handleClearLogOk = async () => {
|
const handleClearLogOk = async () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 这里应该调用实际的API接口
|
// 这里应该调用实际的API接口
|
||||||
let paramsData = {
|
let paramsData = {
|
||||||
caseTitle: state.caseTitle,
|
caseTitle: state.searchData.caseTitle,
|
||||||
optType: state.optType,
|
optType: state.searchData.optType,
|
||||||
optStatus: state.optStatus,
|
optStatus: state.searchData.optStatus,
|
||||||
caseStatus: state.caseStatus,
|
caseStatus: state.searchData.caseStatus,
|
||||||
startTime: state.callTimeList[0],
|
optTimeStart: state.searchData.callTimeList && state.searchData.callTimeList[0] ? state.searchData.callTimeList[0] + ' 00:00:00' : '',
|
||||||
endTime: state.callTimeList[1],
|
optTimeEnd: state.searchData.callTimeList && state.searchData.callTimeList[1] ? state.searchData.callTimeList[1] + ' 00:00:00' : '',
|
||||||
};
|
};
|
||||||
let res = await getClearLogs(paramsData);
|
let res = await getClearLogs(paramsData);
|
||||||
console.log(res, '清空日志接口返回参数');
|
console.log(res, '清空日志接口返回参数');
|
||||||
|
if (res.data.status == 200) {
|
||||||
// if (res.data.data.status == 200) {
|
message.success(res.data.message);
|
||||||
// message.success(res.data.data.message);
|
state.searchData = {
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
caseTitle: "",
|
||||||
|
optType: "",
|
||||||
|
optStatus: "",
|
||||||
|
caseStatus: "",
|
||||||
|
callTimeList: [],
|
||||||
|
};
|
||||||
// 重新加载数据
|
// 重新加载数据
|
||||||
// getTableDate();
|
getTableDate();
|
||||||
// } else {
|
} else {
|
||||||
// message.error(res.data.data.message);
|
message.error(res.data.data.message);
|
||||||
// }
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
||||||
@@ -315,12 +319,18 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
// 重试
|
// 重试
|
||||||
function handleRetry(record) {
|
function handleRetry(record) {
|
||||||
dialog({ content: '确定重试当前失败请求吗?', ok: handleRetryOk(record) });
|
dialog({ content: '确定重试当前失败请求吗?', ok: () => handleRetryOk(record) });
|
||||||
}
|
}
|
||||||
const handleRetryOk = async (record) => {
|
const handleRetryOk = async (record) => {
|
||||||
try {
|
try {
|
||||||
let res = await getRetry({ logId: record.id });
|
let res = await getRetry({ logId: record.id });
|
||||||
console.log(res, '重试接口返回参数');
|
console.log(res, '重试接口返回参数');
|
||||||
|
if(res.data.status == 200){
|
||||||
|
message.success(res.data.message);
|
||||||
|
getTableDate();
|
||||||
|
}else{
|
||||||
|
message.error(res.data.message);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user