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

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

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