💥 feat(模块): 添加了个很棒的功能
This commit is contained in:
parent
1c14dfe878
commit
6398dbbcec
@ -66,6 +66,11 @@ export default [
|
||||
path: '/examine/recordSummary',
|
||||
name: '考核记录汇总',
|
||||
component: "@/pages/examine/recordSummary/index",
|
||||
},
|
||||
{
|
||||
path: '/examine/errorLog',
|
||||
name: '异常日志',
|
||||
component: "@/pages/setting/errorLog/index",
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -20,6 +20,7 @@ const authority: PageAuthority = {
|
||||
'/examine/errorRecord': [
|
||||
'/examine/errorRecord'
|
||||
],
|
||||
'/examine/errorLog': ['/examine/errorLog'],
|
||||
'/setting/menu': ['/setting/menu']
|
||||
};
|
||||
|
||||
|
||||
@ -58,25 +58,25 @@ const ErrorRecord: React.FC<{ currentUser: any }> = (props) => {
|
||||
// format: 'YYYY-MM',
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// title: "统计日期",
|
||||
// dataIndex: "staticDate",
|
||||
// hideInTable: true,
|
||||
// valueType: "dateRange",
|
||||
// initialValue: [moment().startOf('M'), moment()],
|
||||
// search: {
|
||||
// transform: (value: any) => {
|
||||
// return {
|
||||
// startTime: moment(value[0]).format('YYYY-MM-DD'),
|
||||
// endTime: moment(value[1]).format('YYYY-MM-DD')
|
||||
// };
|
||||
// },
|
||||
// },
|
||||
// fieldProps: {
|
||||
// picker: "day",
|
||||
// format: 'YYYY-MM-DD',
|
||||
// }
|
||||
// },
|
||||
{
|
||||
title: "统计日期",
|
||||
dataIndex: "staticDate",
|
||||
hideInTable: true,
|
||||
valueType: "dateRange",
|
||||
initialValue: [moment().startOf('M'), moment()],
|
||||
search: {
|
||||
transform: (value: any) => {
|
||||
return {
|
||||
startTime: moment(value[0]).format('YYYY-MM-DD'),
|
||||
endTime: moment(value[1]).format('YYYY-MM-DD')
|
||||
};
|
||||
},
|
||||
},
|
||||
fieldProps: {
|
||||
picker: "day",
|
||||
format: 'YYYY-MM-DD',
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: "服务区",
|
||||
// dataIndex: "serverPartId",
|
||||
@ -457,21 +457,15 @@ const ErrorRecord: React.FC<{ currentUser: any }> = (props) => {
|
||||
|
||||
const req: any = {
|
||||
serverPartIds: selectedId && selectedId.length > 0 ? selectedId : [],
|
||||
// startTime: params?.search_months ? `${moment(params?.search_months).startOf('M').format('YYYY-MM-DD')}` : "",
|
||||
// endTime: params?.search_months ? `${moment(params?.search_months).endOf('M').format('YYYY-MM-DD')}` : "",
|
||||
startTime: params?.startTime ? params?.startTime : "",
|
||||
endTime: params?.endTime ? params?.endTime: "",
|
||||
// serverPartId: params?.serverPartId ? params?.serverPartId : undefined,
|
||||
extend: params?.errorStatus ? [{
|
||||
key: "situation",
|
||||
value: '1'
|
||||
},
|
||||
extend: params?.errorStatus ? [
|
||||
{
|
||||
key: "errorStatus",
|
||||
value: params?.errorStatus
|
||||
}
|
||||
] : [{
|
||||
key: "situation",
|
||||
value: '1'
|
||||
}]
|
||||
] : []
|
||||
|
||||
}
|
||||
console.log('req', req);
|
||||
|
||||
205
src/pages/setting/errorLog/index.tsx
Normal file
205
src/pages/setting/errorLog/index.tsx
Normal file
@ -0,0 +1,205 @@
|
||||
import { connect } from "umi";
|
||||
import { Children, useRef, useState } from "react";
|
||||
import { Button, message, Modal, Popconfirm, Space, type FormInstance } from "antd";
|
||||
import type { ActionType } from "@ant-design/pro-table";
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
import moment from "moment";
|
||||
import LeftSelectTree from "@/components/leftSelectTree/leftSelectTree";
|
||||
import { ProForm, ProFormSwitch, ProFormText, ProFormTextArea, ProFormTreeSelect } from "@ant-design/pro-components";
|
||||
import { handleGetExamineTypeList } from "./service";
|
||||
|
||||
|
||||
const ErrorLog: React.FC<{ currentUser: any }> = (props) => {
|
||||
const { currentUser } = props
|
||||
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
// 弹出框的表单实例
|
||||
const modalRef = useRef<FormInstance>()
|
||||
// 查询的条件
|
||||
const [searchParams, setSearchParams] = useState<any>()
|
||||
// 打开新增的悬浮框
|
||||
const [openAddModal, setOpenAddModal] = useState<boolean>(false)
|
||||
// 当前行数据
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
const [columnsStateMap, setColumnsStateMap] = useState<any>({
|
||||
operator: { show: false }
|
||||
})
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
title: '统计时间',
|
||||
dataIndex: 'search_date',
|
||||
valueType: 'dateRange',
|
||||
hideInTable: true,
|
||||
hideInDescriptions: true,
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return {
|
||||
StartDate: value[0],
|
||||
EndDate: value[1],
|
||||
};
|
||||
},
|
||||
},
|
||||
fieldProps: {
|
||||
ranges: {
|
||||
"近七天": [moment().subtract(7, 'd'), moment()],
|
||||
"本月": [moment().startOf('M'), moment()],
|
||||
}
|
||||
},
|
||||
initialValue: [moment(), moment()],
|
||||
},
|
||||
{
|
||||
title: "日志类型",
|
||||
dataIndex: "queryType",
|
||||
hideInTable: true,
|
||||
valueType: 'select',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ label: "全部", value: 'all' },
|
||||
{ label: "成功", value: 'success' },
|
||||
{ label: "异常", value: 'error' },
|
||||
]
|
||||
},
|
||||
initialValue: 'error'
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>报错接口</div>,
|
||||
width: 300,
|
||||
dataIndex: "requestUrl",
|
||||
align: 'left',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.requestUrl ?
|
||||
record?.requestUrl.indexOf('questionnaire-templates/search/tree') !== -1 ? '点位数据' :
|
||||
record?.requestUrl.indexOf('questionnaire-responses/save') !== -1 ? '新增巡检记录' :
|
||||
record?.requestUrl.indexOf('questionnaire-responses/update') !== -1 ? '审核巡检记录' :
|
||||
record?.requestUrl.indexOf('questionnaire-responses/extend/update') !== -1 ? '审核巡检记录' :
|
||||
record?.requestUrl.indexOf('questionnaire-responses/getList') !== -1 ? '巡检记录' :
|
||||
record?.requestUrl.indexOf('questionnaire-templates/get') !== -1 ? '巡检详情' :
|
||||
record?.requestUrl.indexOf('questionnaire-responses/tree/list') !== -1 ? '巡检记录' :
|
||||
record?.requestUrl.indexOf('questionnaire-responses/get') !== -1 ? '巡检详情' : '' :
|
||||
''
|
||||
}
|
||||
// 问卷相关接口(QuestionnaireResponsesController):
|
||||
// - questionnaire - responses / get - 查询单条问卷详情
|
||||
// - questionnaire - responses / getList - 查询问卷列表(分页)
|
||||
// - questionnaire - responses / saveAndUpdate - 新增或更新问卷(通用方法)
|
||||
// - questionnaire - responses / save - 新增问卷
|
||||
// - questionnaire - responses / update - 更新问卷
|
||||
// - questionnaire - responses / extend / update - 更新问卷扩展字段
|
||||
// - questionnaire - responses / searchMany - 多筛选条件查询列表
|
||||
// - questionnaire - responses / tree - 树形结构数据
|
||||
// - questionnaire - responses / tree / list - 统计数据使用的树形
|
||||
// - questionnaire - responses / statistic - 走动式统计
|
||||
// - questionnaire - responses / delete - 删除问卷
|
||||
|
||||
// 问卷模板相关接口(QuestionnaireTemplatesController):
|
||||
// - questionnaire - templates / get - 查询单个问卷模板详情
|
||||
// - questionnaire - templates / getList - 查询问卷模板列表
|
||||
// - questionnaire - templates / saveAndUpdate - 新增或更新问卷模板
|
||||
// - questionnaire - templates / batchSave - 批量保存问卷模板
|
||||
// - questionnaire - templates / update - 更新问卷模板
|
||||
// - questionnaire - templates / delete - 删除问卷模板
|
||||
// - questionnaire - templates / search / tree - 树形结构搜索问卷模板
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>错误信息</div>,
|
||||
width: 300,
|
||||
dataIndex: "errorTypeText",
|
||||
align: 'left',
|
||||
hideInSearch: true,
|
||||
},
|
||||
// {
|
||||
// title: <div style={{ textAlign: 'center' }}>执行耗时(毫秒)</div>,
|
||||
// width: 120,
|
||||
// dataIndex: "executionTime",
|
||||
// align: 'right',
|
||||
// hideInSearch: true,
|
||||
// },
|
||||
// {
|
||||
// title: <div style={{ textAlign: 'center' }}>响应时间</div>,
|
||||
// width: 120,
|
||||
// dataIndex: "responseTime",
|
||||
// align: 'right',
|
||||
// hideInSearch: true,
|
||||
// },
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>操作人姓名</div>,
|
||||
width: 150,
|
||||
dataIndex: "membershipName",
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>操作人电话</div>,
|
||||
width: 120,
|
||||
dataIndex: "membershipPhone",
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>调用时间</div>,
|
||||
width: 150,
|
||||
dataIndex: "callTime",
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<div style={{
|
||||
width: '100%',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
}}>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
rowKey={(record) => {
|
||||
return `${record?.id}`
|
||||
}}
|
||||
scroll={{ x: "100%", y: 'calc(100vh - 400px)' }}
|
||||
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}>异常日志</span>}
|
||||
search={{ span: 6 }}
|
||||
request={async (params) => {
|
||||
const req: any = {
|
||||
startDate: params?.StartDate,
|
||||
endDate: params?.EndDate,
|
||||
queryType: params?.queryType || "",
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
}
|
||||
const data = await handleGetExamineTypeList(req)
|
||||
console.log('dasdjaskdjaslkdjas', data);
|
||||
if (data && data.length > 0) {
|
||||
return { data, success: true }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
|
||||
]
|
||||
}}
|
||||
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user }: ConnectState) => ({
|
||||
currentUser: user.currentUser
|
||||
}))(ErrorLog);
|
||||
13
src/pages/setting/errorLog/service.ts
Normal file
13
src/pages/setting/errorLog/service.ts
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
import request from "@/utils/requestJava"
|
||||
|
||||
|
||||
// 拿到类别列表接口
|
||||
export async function handleGetExamineTypeList(params?: any) {
|
||||
const data = await request.post('/api-monitor/logs', params)
|
||||
if (data.Result_Code === 100) {
|
||||
return data.Result_Data.List
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
@ -161,6 +161,22 @@ export async function retrieveUserAuthority(params: any) {
|
||||
"operateDate": "2025-04-29 18:44:48",
|
||||
"systemmoduleDesc": null,
|
||||
"systemmoduleAiDesc": null
|
||||
},
|
||||
{
|
||||
"systemmoduleId": "406",
|
||||
"systemmenuId": 67,
|
||||
"systemmoduleType": null,
|
||||
"systemmoduleName": "异常日志",
|
||||
"systemmoduleIndex": 6,
|
||||
"systemmoduleGuid": "6A4CmfBQViWvSE4iup3TG",
|
||||
"systemmoduleUrl": "/examine/errorLog",
|
||||
"systemmoduleIco": null,
|
||||
"systemmoduleStatus": 1,
|
||||
"staffId": 1,
|
||||
"staffName": "系统开发者",
|
||||
"operateDate": "2025-04-29 18:44:48",
|
||||
"systemmoduleDesc": null,
|
||||
"systemmoduleAiDesc": null
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -292,6 +308,22 @@ export async function retrieveMenuData(params: any) {
|
||||
"operateDate": "2025-04-29 18:44:48",
|
||||
"systemmoduleDesc": null,
|
||||
"systemmoduleAiDesc": null
|
||||
},
|
||||
{
|
||||
"systemmoduleId": "406",
|
||||
"systemmenuId": 67,
|
||||
"systemmoduleType": null,
|
||||
"systemmoduleName": "异常日志",
|
||||
"systemmoduleIndex": 6,
|
||||
"systemmoduleGuid": "6A4CmfBQViWvSE4iup3TG",
|
||||
"systemmoduleUrl": "/examine/errorLog",
|
||||
"systemmoduleIco": null,
|
||||
"systemmoduleStatus": 1,
|
||||
"staffId": 1,
|
||||
"staffName": "系统开发者",
|
||||
"operateDate": "2025-04-29 18:44:48",
|
||||
"systemmoduleDesc": null,
|
||||
"systemmoduleAiDesc": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ const { UMI_APP_BASEURL } = process.env;
|
||||
|
||||
// const instance = axios.create({ baseURL: 'https://admin.es.eshangtech.com/platform' });
|
||||
|
||||
// const instance = axios.create({ baseURL: 'http://111.229.213.193:18072/' });
|
||||
// const instance = axios.create({ baseURL: 'http://111.229.213.193:18071/' });
|
||||
const instance = axios.create({ baseURL: 'https://java.es.eshangtech.com:443/' });
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user