Commit e89bdbec authored by 皮倩雯's avatar 皮倩雯

fix: '日志管理优化,巡检反馈搜索状态选中优化,流程中心新建流程优化提示'

parent 1f17f45d
Pipeline #78548 passed with stages
......@@ -247,7 +247,7 @@ const patrolFeedback = () => {
});
};
const getTableList = val => {
const getTableList = (val, i) => {
setTreeLoading(true);
CM_Feedback_LoadPatrolFeedbacks({
pageIndex: tableList.current.pageIndex,
......@@ -258,6 +258,9 @@ const patrolFeedback = () => {
if (list) {
setPickItem('');
}
if (i) {
setPickItem('区域巡检');
}
setTreeLoading(false);
if (res.code === 0) {
let newGroupNum = {
......@@ -298,9 +301,13 @@ const patrolFeedback = () => {
}
if (searchValue.current) {
setNewTableData(res.data.list);
} else {
if (i) {
setNewTableData(data['区域巡检']);
} else {
setNewTableData(data[pickItem]);
}
}
setTableData(data);
let list = [];
res.data.list.map(i => {
......@@ -386,7 +393,8 @@ const patrolFeedback = () => {
const handleSearch = e => {
searchValue.current = e;
tableList.current.pageIndex = 1;
getTableList(e);
let data = e === '' ? 1 : '';
getTableList(e, data);
};
const paginationChange = (page, pageSizes) => {
......
import React, { useState, useEffect } from 'react';
import { CreateFlow } from '@/services/workflow/workflow';
import { Form, Modal, Input, notification, Select, Radio, Switch } from 'antd';
import { Form, Modal, Input, notification, Select, Radio, Switch, Tooltip, Row, Col } from 'antd';
import { InfoCircleOutlined } from '@ant-design/icons';
const { Option } = Select;
const { TextArea } = Input;
const FlowModal = props => {
......@@ -412,7 +413,7 @@ const FlowModal = props => {
if (validate) {
let datas = JSON.parse(JSON.stringify(validate));
for (let key in datas) {
if(key === 'isPrint') {
if (key === 'isPrint') {
if (datas[key] === false) {
datas[key] = 0;
} else if (datas[key] === true) {
......@@ -617,12 +618,84 @@ const FlowModal = props => {
<Form.Item label="流程描述" name="Text">
<Input placeholder="请输入流程描述" />
</Form.Item>
<Form.Item label="流程结束" name="FlowEndBehavior" initialValue={0}>
<Form.Item label="流程结束" name="FlowEndBehavior" initialValue={1}>
<Radio.Group>
<Radio value={0}>不做任何事情</Radio>
<Radio value={1}>直接关闭事件</Radio>
<Radio value={2}>事件转为待审核</Radio>
<Radio value={3}>重新处理事件</Radio>
<Row>
<Col span={24}>
<Radio value={1}>
<Tooltip
title={
<div>当事件发起的任一工单关单后,则该事件状态直接转为已处理,事件关闭</div>
}
>
<InfoCircleOutlined
style={{
color: '#1890ff',
marginRight: '2px',
}}
/>
</Tooltip>
直接关闭事件
</Radio>
</Col>
<Col span={24}>
<Radio value={0}>
<Tooltip
title={
<div>
不论事件发起的工单怎么操作,事件状态保持不变,除非由调度员在调度中修改事件状态
</div>
}
>
<InfoCircleOutlined
style={{
color: '#1890ff',
marginRight: '2px',
}}
/>
</Tooltip>
不做任何事情
</Radio>
</Col>
<Col span={24}>
<Radio value={2}>
<Tooltip
title={
<div>
当事件发起的任一工单关单后,则该事件状态直接转为待审核,由调度员确定事件的最终状态,调度员有权限进行修改
</div>
}
>
<InfoCircleOutlined
style={{
color: '#1890ff',
marginRight: '2px',
}}
/>
</Tooltip>
事件转为待审核
</Radio>
</Col>
<Col span={24}>
<Radio value={3}>
<Tooltip
title={
<div>
当事件发起的任一工单关单后,该事件状态直接转为待处理,由调度员重新确定事件状态并进行调整
</div>
}
>
<InfoCircleOutlined
style={{
color: '#1890ff',
marginRight: '2px',
}}
/>
</Tooltip>
重新处理事件
</Radio>
</Col>
</Row>
</Radio.Group>
</Form.Item>
<Form.Item
......
......@@ -37,6 +37,7 @@ import abnormalRed from '@/assets/images/icons/异常红色.png';
import abnormalGreen from '@/assets/images/icons/异常绿色.png';
import abnormalYellow from '@/assets/images/icons/异常黄色.png';
import { useHistory } from 'react-router-dom';
import moment from 'moment';
import {
publishGetSolutionList,
getDataBaseConfigNew,
......@@ -77,6 +78,10 @@ const HomePage = () => {
const [mapConfig, setMapConfig] = useState();
const [flag, setFlag] = useState(0);
const [show, setShow] = useState();
const [allTime, setAllTime] = useState([
moment().startOf('month'),
moment(new Date(), 'YYYY-MM-DD HH:mm:ss'),
]);
useEffect(() => {
setLoading(true);
......@@ -88,7 +93,6 @@ const HomePage = () => {
}
getOMSDashboard();
newGetSolution();
getDataBaseConfig();
getSiteCode();
getGateWay();
pipeNetwork();
......@@ -97,6 +101,7 @@ const HomePage = () => {
onGetProduct();
getLimits();
getMapLayer();
getDataBaseConfig();
}, [flag]);
const getLimits = () => {
......@@ -296,13 +301,13 @@ const HomePage = () => {
GetWayPages({
pageIndex: 1,
pageSize: 10,
dateFrom: '2023-08-01 07:38:00',
dateTo: '2023-08-30 23:59:59',
dateFrom: allTime[0].format('YYYY-MM-DD HH:mm:ss'),
dateTo: allTime[1].format('YYYY-MM-DD HH:mm:ss'),
info: '',
isSuccess: false,
}).then(res => {
if (res.code === 0) {
setKeepTableList(res.data.list);
setKeepTableList(res.data.listData.list);
} else {
setKeepTableList([]);
notification.error({
......
/* eslint-disable no-else-return */
/* eslint-disable no-unneeded-ternary */
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useRef } from 'react';
import {
DatePicker,
Input,
......@@ -23,8 +23,10 @@ import 'moment/dist/locale/zh-cn';
import locale from 'antd/es/date-picker/locale/zh_CN';
import styles from './index.less';
import { GetCallLogPages } from '@/services/logCenter/api';
import { GetWayPages } from '@/services/homePage/api';
const { RangePicker } = DatePicker;
const { Option } = Select;
const LogCenter = () => {
const [loading, setLoading] = useState(false); // 源数据
......@@ -38,49 +40,62 @@ const LogCenter = () => {
const [total, setTotal] = useState();
const [pageSize, setPageSize] = useState(20);
const [currentPage, setCurrentPage] = useState(1);
const [keepTableList, setKeepTableList] = useState([]);
const [loginCodeFilters, setLoginCodeFilters] = useState([]);
const [loginStateCodeFilters, setLoginStateCodeFilters] = useState([]);
const [filteredValue, setFilteredValue] = useState([]);
const [content, setContent] = useState();
const [modalVisible, setModalVisible] = useState(false);
const [tableData, setTableData] = useState([]);
const [selectState, setSelectState] = useState('失败');
const timeSorter = useRef('desc');
const filterSorter = useRef('requestDate');
useEffect(() => {
getTableList();
}, []);
const getTableList = (pageIndex, page, time, url, tag) => {
const getTableList = (pageIndex, page, time, url, tag, success, flag) => {
setLoading(true);
GetCallLogPages({
let successState = '';
if (success) {
if (success === '成功') {
successState = true;
} else if (success === '失败') {
successState = false;
}
} else {
if (selectState === '全部') {
successState = '';
} else if (selectState === '成功') {
successState = true;
} else if (selectState === '失败') {
successState = false;
}
}
let newUrl = url ? url : requestUrl;
GetWayPages({
pageIndex: pageIndex ? pageIndex : currentPage,
pageSize: page ? page : pageSize,
sortFieldsAndDirection: '',
isAll: true,
dateFrom: time
? time[0].format('YYYY-MM-DD HH:mm:ss')
: allTime[0].format('YYYY-MM-DD HH:mm:ss'),
dateTo: time
? time[1].format('YYYY-MM-DD HH:mm:ss')
: allTime[1].format('YYYY-MM-DD HH:mm:ss'),
requestUrl: url === '' ? '' : requestUrl,
thirdUrl: '',
label: tag === '' ? '' : label,
info: flag ? '' : newUrl,
methodType: 0,
sortFieldsAndDirection: `${filterSorter.current} ${timeSorter.current}`,
isSuccess: successState,
}).then(res => {
setLoading(false);
if (res.code === 0) {
setKeepTableList(res.data.list);
setTotal(res.data.totalCount);
setPageSize(res.data.pageSize);
setCurrentPage(res.data.pageIndex);
let arr1 = res.data.list.map(item => item.code);
arr1 = arr1.filter((value, index) => arr1.indexOf(value) === index);
// setLoginCodeFilters(arr1.map(item => ({ text: item, value: item })));
setLoginCodeFilters([{ text: '成功', value: 0 }, { text: '失败', value: '-' }]);
let arr2 = res.data.list.map(item => item.statusCode);
setTableData(res.data.listData.list);
setTotal(res.data.listData.totalCount);
setLoginCodeFilters([{ text: '成功', value: 1 }, { text: '失败', value: 0 }]);
let arr2 = res.data.listData.list.map(item => item.result);
arr2 = arr2.filter((value, index) => arr2.indexOf(value) === index);
setLoginStateCodeFilters(arr2.map(item => ({ text: item, value: item })));
} else {
setKeepTableList([]);
setTableData([]);
notification.error({
message: '提示',
duration: 3,
......@@ -91,21 +106,12 @@ const LogCenter = () => {
};
const columns = [
{
title: '接口标签',
dataIndex: 'label',
key: 'label',
width: 150,
fixed: 'left',
render: item => searchStyle1(item),
},
{
title: '接口名称',
dataIndex: 'requestUrl',
key: 'requestUrl',
dataIndex: 'path',
key: 'path',
width: 300,
fixed: 'left',
// render: item => searchStyle(item),
onCell: () => ({
style: {
maxWidth: 400,
......@@ -123,26 +129,23 @@ const LogCenter = () => {
},
{
title: '调用时间',
dataIndex: 'time',
key: 'time',
dataIndex: 'requestDate',
key: 'requestDate',
width: 140,
align: 'center',
sorter: true,
},
{
title: '调用结果',
dataIndex: 'code',
key: 'code',
dataIndex: 'errorMsg',
key: 'errorMsg',
width: 100,
align: 'center',
filters: loginCodeFilters,
// onFilter: (value, record) => record.code === value,
onFilter: (value, record) => record.code.toString().indexOf(value) === 0,
filteredValue,
render: record => {
if (record === 0) {
return <span style={{ color: '#6ecd3d', fontWeight: 'bold' }}>成功</span>;
} else {
if (record) {
return <span style={{ color: 'red', fontWeight: 'bold' }}>失败</span>;
} else {
return <span style={{ color: '#6ecd3d', fontWeight: 'bold' }}>成功</span>;
}
},
},
......@@ -152,30 +155,31 @@ const LogCenter = () => {
key: 'consumerTime',
align: 'center',
width: 80,
sorter: true,
},
{
title: '返回状态码',
dataIndex: 'statusCode',
key: 'statusCode',
width: 100,
align: 'center',
filters: loginStateCodeFilters,
onFilter: (value, record) => record.statusCode === value,
filteredValue,
},
// {
// title: '返回状态码',
// dataIndex: 'result',
// key: 'result',
// width: 100,
// align: 'center',
// },
{
title: '请求方法',
dataIndex: 'method',
key: 'method',
width: 80,
align: 'center',
// render: record => {
// if (record === 'GET') {
// return <span style={{ color: '#6ecd3d', fontWeight: 'bold' }}>GET</span>;
// } else if (record === 'POST') {
// return <span style={{ color: '#ffb880', fontWeight: 'bold' }}>POST</span>;
// }
// },
render: record => {
if (record === 'GET') {
return (
<Tag color="orange" style={{ width: '44.44px' }}>
GET
</Tag>
);
}
return <Tag color="green">POST</Tag>;
},
},
{
title: '返回体大小/byte',
......@@ -184,29 +188,10 @@ const LogCenter = () => {
width: 130,
align: 'center',
},
{
title: '返回信息',
dataIndex: 'message',
key: 'message',
onCell: () => ({
style: {
maxWidth: 400,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: record => (
<Tooltip placement="topLeft" title={record}>
{record}
</Tooltip>
),
},
{
title: '异常信息',
dataIndex: 'exception',
key: 'exception',
dataIndex: 'errorMsg',
key: 'errorMsg',
align: 'center',
width: 100,
render: record => {
......@@ -277,6 +262,7 @@ const LogCenter = () => {
setAllTime([moment().startOf('month'), moment(new Date(), 'YYYY-MM-DD HH:mm:ss')]);
setRequestUrl('');
setLabel('');
setSelectState('失败');
setShowSearchStyle(false);
getTableList(
1,
......@@ -284,6 +270,8 @@ const LogCenter = () => {
[moment().startOf('month'), moment(new Date(), 'YYYY-MM-DD HH:mm:ss')],
'',
'',
'失败',
'rest',
);
};
......@@ -293,8 +281,15 @@ const LogCenter = () => {
setPageSize(pageSizes);
};
const onChangeInput = filters => {
setFilteredValue(filters.code, filters.statusCode);
const onChangeInput = (pagination, filters, sorter) => {
timeSorter.current = sorter.order === 'ascend' ? 'asc' : 'desc';
filterSorter.current = sorter.field ? sorter.field : 'requestDate';
getTableList();
};
const changeSuccess = e => {
setSelectState(e);
getTableList('', '', '', '', '', e);
};
return (
<div className={styles.centerLog}>
......@@ -308,6 +303,12 @@ const LogCenter = () => {
value={allTime}
allowClear={false}
/>
<span style={{ marginLeft: '20px' }}>调用结果:</span>
<Select style={{ width: '180px' }} value={selectState} onSelect={e => changeSuccess(e)}>
<Option value="全部">全部</Option>
<Option value="成功">成功</Option>
<Option value="失败">失败</Option>
</Select>
<span style={{ marginLeft: '20px' }}>接口名称:</span>
<Input
style={{ width: '200px' }}
......@@ -318,16 +319,6 @@ const LogCenter = () => {
value={requestUrl}
allowClear
/>
<span style={{ marginLeft: '20px' }}>接口标签:</span>
<Input
style={{ width: '200px' }}
placeholder="请输入接口标签"
onChange={e => {
setLabel(e.target.value);
}}
value={label}
allowClear
/>
<Button
type="primary"
style={{ marginLeft: '10px' }}
......@@ -356,7 +347,7 @@ const LogCenter = () => {
size="small"
bordered
columns={columns}
dataSource={keepTableList}
dataSource={tableData}
scroll={{ y: 'calc(100% - 35px)' }}
pagination={false}
onChange={onChangeInput}
......
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