Commit 1fbd9367 authored by 陈龙's avatar 陈龙

feat: 去除弹窗

parent eedda5c4
......@@ -4,10 +4,8 @@ import PropTypes from 'prop-types';
import { Tag, Tooltip, Modal } from 'antd';
import { EnvironmentOutlined } from '@ant-design/icons';
import { monitorService } from './api';
import moment from 'moment';
import classnames from 'classnames';
import { switchTimeToPeriod } from './utils';
import NormChart from './NormChart/NormChart';
import { Swiper, SwiperSlide } from 'swiper/react';
import 'swiper/swiper.min.css';
import 'swiper/components/pagination/pagination.min.css';
......@@ -56,7 +54,7 @@ const InfoItem = ({ info }) => {
};
let timer = null;
const AlarmScrollAssembly = (props) => {
const [modalVisible, setModalVisible] = useState(false);
// const [modalVisible, setModalVisible] = useState(false);
const [currentInfo, setCurrentInfo] = useState({});
const [enableToGetData, setEnableToGetData] = useState(false);
const constanceRef = useRef({
......@@ -66,14 +64,7 @@ const AlarmScrollAssembly = (props) => {
userAccess: true,
});
const [realTimeDataList, setRealTimeDataList] = useState(null);
// const getDeviceNumber = () => {
// return monitorService.getEquipmentInfo({
// deviceTypes: props.deviceType,
// pageIndex: 1,
// pageSize: 1,
// ...constanceRef.current,
// });
// };
const getRealTimeData = (pagination) => {
return monitorService.GetAlarmListRealTime({
deviceType: props.deviceType,
......@@ -81,15 +72,11 @@ const AlarmScrollAssembly = (props) => {
pageIndex: pagination.pageIndex,
pageSize: pagination.pageSize,
userAccess: props.userAccess === void 0 ? true : props.userAccess,
/* dateFrom: moment().subtract(1, 'days').format('YYYY-MM-DD 00:00:00'),
dateTo: moment().format('YYYY-MM-DD 23:59:59'),*/
});
};
const getData = async () => {
// let firstRequest = await getDeviceNumber();
let secondRequest = await getRealTimeData({
pageIndex: 1,
// pageSize: firstRequest.data.totalCount,
pageSize: 10,
});
setRealTimeDataList(secondRequest?.data?.list || []);
......@@ -124,16 +111,6 @@ const AlarmScrollAssembly = (props) => {
>
<Swiper
slidesPerView={1}
// modules={[Pagination]}
// pagination={
// props.showTotal
// ? {
// type: 'fraction',
// formatFractionCurrent: (num) => `第${num}条`,
// formatFractionTotal: (num) => `共${num}条`,
// }
// : false
// }
navigation={props.showTotal ? true : false}
autoplay={{
delay: 3000,
......@@ -152,7 +129,7 @@ const AlarmScrollAssembly = (props) => {
virtualIndex={index}
onClick={() => {
setCurrentInfo(item);
setModalVisible(true);
// setModalVisible(true);
}}
>
<InfoItem key={index} info={item} />
......@@ -160,20 +137,6 @@ const AlarmScrollAssembly = (props) => {
);
})}
</Swiper>
{modalVisible && (
<Modal
visible={modalVisible}
onCancel={() => setModalVisible(false)}
width={'80%'}
destroyOnClose
>
<NormChart
info={currentInfo}
deviceType={currentInfo.deviceType}
deviceCode={currentInfo.stationCode}
/>
</Modal>
)}
</div>
</div>
) : (
......
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