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

fix: '表字段字段配置界面样式修改'

parent 5f3f16f2
...@@ -168,6 +168,7 @@ const AddModal = props => { ...@@ -168,6 +168,7 @@ const AddModal = props => {
const { TreeNode } = TreeSelect; const { TreeNode } = TreeSelect;
const [timeData, setTimeData] = useState(''); const [timeData, setTimeData] = useState('');
const { Option } = Select; const { Option } = Select;
const [synchronization, setSynchronization] = useState('');
// 提交 // 提交
const onSubmit = () => { const onSubmit = () => {
// 不切换树 // 不切换树
...@@ -177,6 +178,12 @@ const AddModal = props => { ...@@ -177,6 +178,12 @@ const AddModal = props => {
if (validate) { if (validate) {
setLoading(true); setLoading(true);
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
let aa = '';
if (synchronization == true) {
aa = 1;
} else {
aa = 0;
}
let data = [ let data = [
{ {
Unit: obj.Unit || '', Unit: obj.Unit || '',
...@@ -194,7 +201,7 @@ const AddModal = props => { ...@@ -194,7 +201,7 @@ const AddModal = props => {
Order: pramData.Order, Order: pramData.Order,
Name: obj.Name, Name: obj.Name,
Alias: obj.Alias, Alias: obj.Alias,
SyncEvent: obj.SyncEvent, SyncEvent: aa,
ValidationRule: obj.ValidationRule, ValidationRule: obj.ValidationRule,
ExceptionEventFields: characterValue, ExceptionEventFields: characterValue,
}, },
...@@ -358,6 +365,13 @@ const AddModal = props => { ...@@ -358,6 +365,13 @@ const AddModal = props => {
setCharacterValue(res[0].data.root.ExceptionEventFields); setCharacterValue(res[0].data.root.ExceptionEventFields);
setCheckedList(res[0].data.root.ExceptionEventFields.split(',')); setCheckedList(res[0].data.root.ExceptionEventFields.split(','));
} }
if (res[0].data.root.SyncEvent === 1) {
form.setFieldsValue({ SyncEvent: true });
setSynchronization(true);
} else {
form.setFieldsValue({ SyncEvent: false });
setSynchronization(false);
}
setShape(res[0].data.root.Shape); setShape(res[0].data.root.Shape);
console.log(res[0].data.root.Shape); console.log(res[0].data.root.Shape);
if (res[0].data.root.Shape == '文本') { if (res[0].data.root.Shape == '文本') {
...@@ -632,6 +646,13 @@ const AddModal = props => { ...@@ -632,6 +646,13 @@ const AddModal = props => {
setRadio(''); setRadio('');
setRadio1(''); setRadio1('');
setRadio3(''); setRadio3('');
setPep('');
setCho('');
setCheckboxAll1('');
setCheckboxAllID1('');
setFlag(false);
setHide(true);
setSynchronization(false);
} }
}, [isVisible]); }, [isVisible]);
...@@ -958,6 +979,13 @@ const AddModal = props => { ...@@ -958,6 +979,13 @@ const AddModal = props => {
setCharacterValue(aa.ExceptionEventFields); setCharacterValue(aa.ExceptionEventFields);
setCheckedList(aa.ExceptionEventFields.split(',')); setCheckedList(aa.ExceptionEventFields.split(','));
} }
if (aa.SyncEvent === 1) {
form.setFieldsValue({ SyncEvent: true });
setSynchronization(true);
} else {
form.setFieldsValue({ SyncEvent: false });
setSynchronization(false);
}
setShape(aa.Shape); setShape(aa.Shape);
if (aa.Shape == '文本') { if (aa.Shape == '文本') {
setDetail('输入内容将显示在前端输入框提示信息中'); setDetail('输入内容将显示在前端输入框提示信息中');
...@@ -979,6 +1007,7 @@ const AddModal = props => { ...@@ -979,6 +1007,7 @@ const AddModal = props => {
setDetail(''); setDetail('');
} }
console.log(aa.Shape); console.log(aa.Shape);
console.log(aa.Config);
let coordinates = false, let coordinates = false,
picture = false, picture = false,
must = false; must = false;
...@@ -1216,6 +1245,13 @@ const AddModal = props => { ...@@ -1216,6 +1245,13 @@ const AddModal = props => {
setCharacterValue(res[0].data.root.ExceptionEventFields); setCharacterValue(res[0].data.root.ExceptionEventFields);
setCheckedList(res[0].data.root.ExceptionEventFields.split(',')); setCheckedList(res[0].data.root.ExceptionEventFields.split(','));
} }
if (res[0].data.root.SyncEvent === 1) {
form.setFieldsValue({ SyncEvent: true });
setSynchronization(true);
} else {
form.setFieldsValue({ SyncEvent: false });
setSynchronization(false);
}
setShape(res[0].data.root.Shape); setShape(res[0].data.root.Shape);
console.log(res[0].data.root.Shape); console.log(res[0].data.root.Shape);
let coordinates = false, let coordinates = false,
...@@ -1426,11 +1462,13 @@ const AddModal = props => { ...@@ -1426,11 +1462,13 @@ const AddModal = props => {
}); });
} }
if (res[0].data.root.Config.endsWith('.n')) { if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({ choose: true }); console.log(111);
setCho(true);
} else {
form.setFieldsValue({ choose: false }); form.setFieldsValue({ choose: false });
setCho(false); setCho(false);
} else {
console.log(222);
form.setFieldsValue({ choose: true });
setCho(true);
} }
break; break;
} }
...@@ -1450,6 +1488,12 @@ const AddModal = props => { ...@@ -1450,6 +1488,12 @@ const AddModal = props => {
if (validate) { if (validate) {
setLoading(true); setLoading(true);
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
let aa = '';
if (synchronization == true) {
aa = 1;
} else {
aa = 0;
}
let data = [ let data = [
{ {
Unit: obj.Unit || '', Unit: obj.Unit || '',
...@@ -1467,7 +1511,7 @@ const AddModal = props => { ...@@ -1467,7 +1511,7 @@ const AddModal = props => {
Order: pramData.Order, Order: pramData.Order,
Name: obj.Name, Name: obj.Name,
Alias: obj.Alias, Alias: obj.Alias,
SyncEvent: obj.SyncEvent, SyncEvent: aa,
ValidationRule: obj.ValidationRule, ValidationRule: obj.ValidationRule,
ExceptionEventFields: characterValue, ExceptionEventFields: characterValue,
}, },
...@@ -1605,6 +1649,7 @@ const AddModal = props => { ...@@ -1605,6 +1649,7 @@ const AddModal = props => {
ShowConfig: '', ShowConfig: '',
pepole: '', pepole: '',
choose: '', choose: '',
SyncEvent: '',
}); });
setRadio(0); setRadio(0);
setRadio3('0'); setRadio3('0');
...@@ -1613,6 +1658,7 @@ const AddModal = props => { ...@@ -1613,6 +1658,7 @@ const AddModal = props => {
setCho(''); setCho('');
setCheckboxAll1(''); setCheckboxAll1('');
setCheckboxAllID1(''); setCheckboxAllID1('');
setSynchronization(false);
setFlag(false); setFlag(false);
setHide(true); setHide(true);
if (i == 1.14) { if (i == 1.14) {
...@@ -1827,6 +1873,10 @@ const AddModal = props => { ...@@ -1827,6 +1873,10 @@ const AddModal = props => {
setCheckboxAllID1(e.target.checked); setCheckboxAllID1(e.target.checked);
}; };
const changeSy = e => {
setSynchronization(e.target.checked);
};
return ( return (
<> <>
<Drawer <Drawer
...@@ -1898,15 +1948,19 @@ const AddModal = props => { ...@@ -1898,15 +1948,19 @@ const AddModal = props => {
</div> </div>
</Item> </Item>
<Item label="同步" name="SyncEvent" labelCol={{ span: 4 }}> <Item label="同步" name="SyncEvent" labelCol={{ span: 4 }}>
<Radio.Group> <Checkbox checked={synchronization} onChange={changeSy}>
工单 → 事件
</Checkbox>
{/* <Radio.Group>
<Radio value={0} style={{ marginRight: '0.5rem' }}> <Radio value={0} style={{ marginRight: '0.5rem' }}>
不同步 不同步
</Radio> </Radio>
<Radio value={1} style={{ marginRight: '0.5rem' }}> <Radio value={1} style={{ marginRight: '0.5rem' }}>
工单 → 事件 工单 → 事件
</Radio> </Radio>
{/* <Radio value={2}>事件(上报时) → 工单</Radio> */}
</Radio.Group> </Radio.Group> */}
{/* <Radio value={2}>事件(上报时) → 工单</Radio> */}
</Item> </Item>
<Row> <Row>
{/* <Col span={1} /> */} {/* <Col span={1} /> */}
...@@ -2270,8 +2324,8 @@ const AddModal = props => { ...@@ -2270,8 +2324,8 @@ const AddModal = props => {
<Tooltip <Tooltip
title={ title={
<> <>
<span>默认展示形式为下拉框</span> <span>弹窗显示人员所属机构</span>
<Image width={200} src={partImage} /> <Image width={200} src={AllImage} />
</> </>
} }
> >
...@@ -2286,21 +2340,6 @@ const AddModal = props => { ...@@ -2286,21 +2340,6 @@ const AddModal = props => {
</div> </div>
} }
> >
<Tooltip
title={
<>
<span>展示形式为弹窗显示人员所属机构</span>
<Image width={200} src={AllImage} />
</>
}
>
<InfoCircleOutlined
style={{
color: 'rgb(24 144 255)',
marginRight: '5px',
}}
/>
</Tooltip>
<div style={{ display: 'inline-block', marginRight: '10px' }}> <div style={{ display: 'inline-block', marginRight: '10px' }}>
<Item name="All1" style={{ marginBottom: '0' }}> <Item name="All1" style={{ marginBottom: '0' }}>
<Checkbox <Checkbox
...@@ -2342,7 +2381,7 @@ const AddModal = props => { ...@@ -2342,7 +2381,7 @@ const AddModal = props => {
return ( return (
<> <>
<Item <Item
label="角色|机构" label="过滤"
name="ConfigName" name="ConfigName"
labelCol={{ span: 4 }} labelCol={{ span: 4 }}
rules={[ rules={[
...@@ -2369,7 +2408,7 @@ const AddModal = props => { ...@@ -2369,7 +2408,7 @@ const AddModal = props => {
return ( return (
<> <>
<Item <Item
label="角色|机构" label="过滤:"
name="Config" name="Config"
labelCol={{ span: 4 }} labelCol={{ span: 4 }}
rules={[ rules={[
...@@ -2445,11 +2484,7 @@ const AddModal = props => { ...@@ -2445,11 +2484,7 @@ const AddModal = props => {
case '位置坐标': case '位置坐标':
return ( return (
<Item label="字段名称" name="Config" labelCol={{ span: 4 }}> <Item label="字段名称" name="Config" labelCol={{ span: 4 }}>
<Input <Input allowClear placeholder="请输入坐标位置" />
allowClear
style={{ width: '93%' }}
placeholder="请输入坐标位置"
/>
</Item> </Item>
); );
case '地址': case '地址':
...@@ -2512,7 +2547,7 @@ const AddModal = props => { ...@@ -2512,7 +2547,7 @@ const AddModal = props => {
fontSize: '24px', fontSize: '24px',
color: '#1890FF', color: '#1890FF',
marginTop: '8px', marginTop: '8px',
marginLeft: '-10px', marginLeft: '-3px',
}} }}
/> />
</Tooltip> </Tooltip>
......
...@@ -587,7 +587,6 @@ const AddModal = props => { ...@@ -587,7 +587,6 @@ const AddModal = props => {
} }
}; };
const mapTree = org => { const mapTree = org => {
console.log(org);
const haveChildren = Array.isArray(org.children) && org.children.length > 0; const haveChildren = Array.isArray(org.children) && org.children.length > 0;
return haveChildren ? ( return haveChildren ? (
<TreeNode value={org.name} title={org.name} disabled> <TreeNode value={org.name} title={org.name} disabled>
......
...@@ -10,10 +10,11 @@ import { ...@@ -10,10 +10,11 @@ import {
notification, notification,
message, message,
Spin, Spin,
Tooltip,
Pagination,
} from 'antd'; } from 'antd';
import { SwapRightOutlined, SyncOutlined } from '@ant-design/icons'; import { SwapRightOutlined, SyncOutlined, CaretUpFilled, CaretDownFilled } from '@ant-design/icons';
import { Chart, Interval, Line, Tooltip, Axis } from 'bizcharts'; import { Chart, Interval, Line, Axis } from 'bizcharts';
// import { DataSet } from '@antv/data-set';
import moment from 'moment'; import moment from 'moment';
import { post, PUBLISH_SERVICE } from '@/services/index'; import { post, PUBLISH_SERVICE } from '@/services/index';
import styles from './index.less'; import styles from './index.less';
...@@ -26,14 +27,22 @@ const ServiceLog = () => { ...@@ -26,14 +27,22 @@ const ServiceLog = () => {
const [visitedCount, setVisitedCount] = useState([]); // 访问量,统计数据 const [visitedCount, setVisitedCount] = useState([]); // 访问量,统计数据
const [pathCount, setPathCount] = useState([]); // 接口调用次数,统计数据 const [pathCount, setPathCount] = useState([]); // 接口调用次数,统计数据
const [reponseTime, setReponseTime] = useState([]); // 接口调用时长,统计数据 const [reponseTime, setReponseTime] = useState([]); // 接口调用时长,统计数据
const [timeInterval, setTimeInterval] = useState('3'); // 时间间隔,1/2/3/4(每分钟/5分钟/小时/天),默认每小时 const [timeInterval, setTimeInterval] = useState('4'); // 时间间隔,1/2/3/4(每分钟/5分钟/小时/天),默认每小时
const [startTime, setStartTime] = useState(moment().startOf('week')); // 默认值,当天0点00:00:00 const [startTime, setStartTime] = useState(moment().startOf('month')); // 默认值,当天0点00:00:00
const [endTime, setEndTime] = useState( const [endTime, setEndTime] = useState(
moment(new Date(), 'YYYY-MM-DD HH:mm:ss'), // 默认值,当前时间 moment(new Date(), 'YYYY-MM-DD HH:mm:ss'), // 默认值,当前时间
); );
const [logType, setLogType] = useState('9999'); // 请求参数,日志类型,默认是正常,0:成功 -1:异常 9999:全部 const [logType, setLogType] = useState('9999'); // 请求参数,日志类型,默认是正常,0:成功 -1:异常 9999:全部
const [searchWord, setSearchWord] = useState(''); // 关键字 const [searchWord, setSearchWord] = useState(''); // 关键字
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式 const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const [total, setTotal] = useState();
const [pageSize, setPageSize] = useState(20);
const [currentPage, setCurrentPage] = useState(1);
const [show1, setShow1] = useState('block');
const [show2, setShow2] = useState('none');
const [keepType, setKeepType] = useState('');
const [keepOrder, setKeepOrder] = useState('');
// 计算时间间隔(分钟) // 计算时间间隔(分钟)
const start = new Date(startTime).getTime(); const start = new Date(startTime).getTime();
...@@ -77,10 +86,36 @@ const ServiceLog = () => { ...@@ -77,10 +86,36 @@ const ServiceLog = () => {
render: item => searchStyle(item), render: item => searchStyle(item),
}, },
{ {
title: '调用时间',
dataIndex: 'CallTime', dataIndex: 'CallTime',
key: 'CallTime', key: 'CallTime',
width: 160, width: 160,
title: (
<div>
录入时间
<Tooltip title="点击降序">
<CaretUpFilled
style={{
display: show1,
color: '#1890ff',
marginTop: '-13px',
marginLeft: '60%',
}}
onClick={() => shengxu(1)}
/>
</Tooltip>
<Tooltip title="点击升序">
<CaretDownFilled
style={{
display: show2,
color: '#1890ff',
marginTop: '-13px',
marginLeft: '60%',
}}
onClick={() => jiangxu(1)}
/>
</Tooltip>
</div>
),
}, },
// { // {
// title: 'IP', // title: 'IP',
...@@ -98,12 +133,20 @@ const ServiceLog = () => { ...@@ -98,12 +133,20 @@ const ServiceLog = () => {
title: '异常信息', title: '异常信息',
dataIndex: 'ErrorMsg', dataIndex: 'ErrorMsg',
key: 'ErrorMsg', key: 'ErrorMsg',
render: record => { onCell: () => ({
if (!record) { style: {
return '-'; maxWidth: 300,
} overflow: 'hidden',
return record; whiteSpace: 'nowrap',
}, textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: record => (
<Tooltip placement="topLeft" title={record}>
{record}
</Tooltip>
),
}, },
{ {
title: '请求方法', title: '请求方法',
...@@ -112,24 +155,149 @@ const ServiceLog = () => { ...@@ -112,24 +155,149 @@ const ServiceLog = () => {
width: 100, width: 100,
}, },
{ {
title: '耗时/ms',
dataIndex: 'ConsumerTime', dataIndex: 'ConsumerTime',
key: 'ConsumerTime', key: 'ConsumerTime',
width: 100, width: 100,
defaultSortOrder: 'descend', title: (
sortDirections: ['descend', 'ascend'], <div>
sorter: (a, b) => a.ConsumerTime - b.ConsumerTime, 耗时/ms
<Tooltip title="点击降序">
<CaretUpFilled
style={{
display: show1,
color: '#1890ff',
marginTop: '-13px',
marginLeft: '60%',
}}
onClick={() => shengxu(2)}
/>
</Tooltip>
<Tooltip title="点击升序">
<CaretDownFilled
style={{
display: show2,
color: '#1890ff',
marginTop: '-13px',
marginLeft: '60%',
}}
onClick={() => jiangxu(2)}
/>
</Tooltip>
</div>
),
}, },
{ {
title: '返回体大小/byte', title: '返回体大小/byte',
dataIndex: 'ResponseSize', dataIndex: 'ResponseSize',
key: 'ResponseSize', key: 'ResponseSize',
width: 140, width: 140,
sortDirections: ['descend', 'ascend'],
sorter: (a, b) => a.ResponseSize - b.ResponseSize,
}, },
]; ];
const shengxu = e => {
setKeepType(e);
setKeepOrder('desc');
console.log(e);
setShow1('none');
setShow2('block');
setPageSize(20);
setCurrentPage(1);
setLoading(true);
post(`${PUBLISH_SERVICE}/LogCenter/GetOMSLog`, {
// 获取日志表数据时PageSize设置为200,其他接口默认值20
PageIndex: 1,
PageSize: 20,
DateFrom: startTime.format('YYYY-MM-DD HH:mm:ss'),
DateTo: endTime.format('YYYY-MM-DD HH:mm:ss'),
IP: '',
Module: searchWord,
LogType: +logType,
Description: '',
LoginName: '',
UserName: '',
StaticsType: +timeInterval,
sort: e == 1 ? 'callTime' : 'consumerTime',
order: 'desc',
})
.then(res => {
if (res.code === 0) {
if (!res.data) {
setDataTable([]);
} else {
const result = res.data.list;
setTotal(res.data.TotalCount);
setDataTable(
result.map((item, index) => {
item.key = index;
return item;
}),
);
}
} else {
notification.error({
message: '数据获取失败',
description: res.msg,
});
}
setLoading(false);
})
.catch(err => {
message.error(err);
setLoading(false);
});
};
const jiangxu = e => {
setKeepType(e);
setKeepOrder('asc');
setShow2('none');
setShow1('block');
setPageSize(20);
setCurrentPage(1);
setLoading(true);
post(`${PUBLISH_SERVICE}/LogCenter/GetOMSLog`, {
// 获取日志表数据时PageSize设置为200,其他接口默认值20
PageIndex: 1,
PageSize: 20,
DateFrom: startTime.format('YYYY-MM-DD HH:mm:ss'),
DateTo: endTime.format('YYYY-MM-DD HH:mm:ss'),
IP: '',
Module: searchWord,
LogType: +logType,
Description: '',
LoginName: '',
UserName: '',
StaticsType: +timeInterval,
sort: e == 1 ? 'callTime' : 'consumerTime',
order: 'asc',
})
.then(res => {
if (res.code === 0) {
if (!res.data) {
setDataTable([]);
} else {
const result = res.data.list;
setTotal(res.data.TotalCount);
setDataTable(
result.map((item, index) => {
item.key = index;
return item;
}),
);
}
} else {
notification.error({
message: '数据获取失败',
description: res.msg,
});
}
setLoading(false);
})
.catch(err => {
message.error(err);
setLoading(false);
});
};
// 模糊查询匹配的样式 // 模糊查询匹配的样式
const searchStyle = val => { const searchStyle = val => {
let n; let n;
...@@ -184,7 +352,7 @@ const ServiceLog = () => { ...@@ -184,7 +352,7 @@ const ServiceLog = () => {
post(`${PUBLISH_SERVICE}/LogCenter${url}`, { post(`${PUBLISH_SERVICE}/LogCenter${url}`, {
// 获取日志表数据时PageSize设置为200,其他接口默认值20 // 获取日志表数据时PageSize设置为200,其他接口默认值20
PageIndex: 1, PageIndex: 1,
PageSize: url === '/GetOMSLog' ? 1000 : 20, PageSize: 20,
DateFrom: startTime.format('YYYY-MM-DD HH:mm:ss'), DateFrom: startTime.format('YYYY-MM-DD HH:mm:ss'),
DateTo: endTime.format('YYYY-MM-DD HH:mm:ss'), DateTo: endTime.format('YYYY-MM-DD HH:mm:ss'),
IP: '', IP: '',
...@@ -201,6 +369,9 @@ const ServiceLog = () => { ...@@ -201,6 +369,9 @@ const ServiceLog = () => {
set([]); set([]);
} else { } else {
const result = url === '/GetOMSLog' ? res.data.list : res.data; const result = url === '/GetOMSLog' ? res.data.list : res.data;
if (url === '/GetOMSLog') {
setTotal(res.data.TotalCount);
}
set( set(
result.map((item, index) => { result.map((item, index) => {
item.key = index; item.key = index;
...@@ -211,6 +382,74 @@ const ServiceLog = () => { ...@@ -211,6 +382,74 @@ const ServiceLog = () => {
}), }),
); );
} }
setKeepType('');
setKeepOrder('');
setPageSize(20);
setCurrentPage(1);
} else {
notification.error({
message: '数据获取失败',
description: res.msg,
});
}
setLoading(false);
})
.catch(err => {
message.error(err);
setLoading(false);
});
};
const getData1 = (url, set, page, size) => {
console.log(keepType);
console.log(keepOrder);
let data = {};
if (keepType) {
data = {
PageIndex: page,
PageSize: size,
DateFrom: startTime.format('YYYY-MM-DD HH:mm:ss'),
DateTo: endTime.format('YYYY-MM-DD HH:mm:ss'),
IP: '',
Module: searchWord,
LogType: +logType,
Description: '',
LoginName: '',
UserName: '',
StaticsType: +timeInterval,
sort: keepType == 1 ? 'callTime' : 'consumerTime',
order: keepOrder,
};
} else {
data = {
PageIndex: page,
PageSize: size,
DateFrom: startTime.format('YYYY-MM-DD HH:mm:ss'),
DateTo: endTime.format('YYYY-MM-DD HH:mm:ss'),
IP: '',
Module: searchWord,
LogType: +logType,
Description: '',
LoginName: '',
UserName: '',
StaticsType: +timeInterval,
};
}
post(`${PUBLISH_SERVICE}/LogCenter${url}`, data)
.then(res => {
if (res.code === 0) {
if (!res.data) {
set([]);
} else {
const result = res.data.list;
setTotal(res.data.TotalCount);
set(
result.map((item, index) => {
item.key = index;
return item;
}),
);
}
} else { } else {
notification.error({ notification.error({
message: '数据获取失败', message: '数据获取失败',
...@@ -252,12 +491,24 @@ const ServiceLog = () => { ...@@ -252,12 +491,24 @@ const ServiceLog = () => {
}; };
const handleReset = () => { const handleReset = () => {
setLogType('9999'); setLogType('9999');
setTimeInterval('3'); setTimeInterval('4');
setStartTime(moment().startOf('week')); setStartTime(moment().startOf('month'));
setEndTime(moment(new Date(), 'YYYY-MM-DD HH:mm:ss')); setEndTime(moment(new Date(), 'YYYY-MM-DD HH:mm:ss'));
setSearchWord(''); setSearchWord('');
setShowSearchStyle(false); setShowSearchStyle(false);
}; };
const dayTime = () => {
let date = new Date();
return date.getDate() - 1;
};
// 监听分页
const paginationChange = (page, pageSizes) => {
getData1('/GetOMSLog', setDataTable, page, pageSizes);
setCurrentPage(page);
setPageSize(pageSizes);
};
return ( return (
<> <>
<div className={styles.serviceLog}> <div className={styles.serviceLog}>
...@@ -287,6 +538,7 @@ const ServiceLog = () => { ...@@ -287,6 +538,7 @@ const ServiceLog = () => {
<Button onClick={() => setTime(12 * 60, '3')}>近12小时</Button> <Button onClick={() => setTime(12 * 60, '3')}>近12小时</Button>
<Button onClick={() => setTime(24 * 60, '3')}>近1天</Button> <Button onClick={() => setTime(24 * 60, '3')}>近1天</Button>
<Button onClick={() => setTime(24 * 7 * 60, '4')}>近1周</Button> <Button onClick={() => setTime(24 * 7 * 60, '4')}>近1周</Button>
<Button onClick={() => setTime(24 * dayTime() * 60, '4')}>本月</Button>
<span style={{ marginLeft: '20px' }}>返回状态:</span> <span style={{ marginLeft: '20px' }}>返回状态:</span>
<Select <Select
defaultValue="全部" defaultValue="全部"
...@@ -418,16 +670,22 @@ const ServiceLog = () => { ...@@ -418,16 +670,22 @@ const ServiceLog = () => {
bordered bordered
columns={columns} columns={columns}
dataSource={dataTable} dataSource={dataTable}
scroll={{ x: 'max-content', y: 'calc(100vh - 580px)' }} scroll={{ x: 'max-content', y: 'calc(100vh - 565px)' }}
pagination={{ pagination={false}
showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`,
pageSizeOptions: [10, 20, 50, 100],
defaultPageSize: 20,
showQuickJumper: true,
showSizeChanger: true,
}}
/> />
</div> </div>
<Pagination
style={{ display: 'flex', justifyContent: 'end', padding: '10px' }}
total={total}
showTotal={(aa, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`}
defaultPageSize={pageSize}
defaultCurrent={1}
pageSizeOptions={[10, 20, 40, 100]}
current={currentPage}
onChange={paginationChange}
size="small"
showQuickJumper
/>
</Spin> </Spin>
</div> </div>
</> </>
......
.serviceLog{ .serviceLog {
.head{ .head {
padding: 10px; padding: 10px;
background: white; background: white;
margin-bottom: 2px; margin-bottom: 2px;
min-width: 1030px; min-width: 1030px;
}
.foot {
padding: 10px;
background: white;
font-size: 20px;
}
.table {
border-top: 1px solid #f0eded;
// overflow: auto;//不要这个,pagination否则无法固定底部
.ant-table-thead tr th {
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
background-color: #f6f9fe;
} }
.chart{ .ant-table-body {
padding: 10px; height: calc(100vh - 565px);
background: white; border-right: white;
font-size:20px; overflow: auto !important;
} }
.table{ .ant-pagination {
border-top: 1px solid #f0eded; z-index: 999;
// overflow: auto;//不要这个,pagination否则无法固定底部 border-top: 1px solid #f0eded;
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
background-color:#F6F9FE;
}
.ant-table-body{
height:calc(100vh - 580px);
border-right: white;
overflow: auto !important;
}
.ant-pagination{
z-index: 999;
border-top: 1px solid #f0eded;
}
.ant-table-pagination{
padding-right: 12px;
background: white;
margin: 1px 0;
padding:8px;
padding-right: 20px;
}
.ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last{
border-right: 1px solid #DBE7FB !important;
}
.ant-table.ant-table-small {
width: 99%;
margin: 10px auto;
}
.ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last{
border: 1px solid #DBE7FB;
}
} }
.ant-spin-container { .ant-table-pagination {
background-color: white; padding-right: 12px;
} background: white;
.fontColor{ margin: 1px 0;
font-weight: 600; padding: 8px;
padding-right: 20px;
} }
.icon{ .ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last {
margin-top: -5px !important; border-right: 1px solid #dbe7fb !important;
vertical-align: text-bottom;
} }
.sel{ .ant-table.ant-table-small {
width: 100px; width: 99%;
margin: 10px auto;
} }
} .ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last {
\ No newline at end of file border: 1px solid #dbe7fb;
}
}
.ant-spin-container {
background-color: white;
}
.fontColor {
font-weight: 600;
}
.icon {
// margin-top: -5px !important;
vertical-align: text-bottom;
}
.sel {
width: 100px;
}
}
.ant-table-column-sorter-up + .ant-table-column-sorter-down {
margin-top: 0;
}
.ant-select-arrow .anticon > svg {
vertical-align: middle;
}
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