Commit 7e83e3ae authored by 陈龙's avatar 陈龙

feat: 删除部分注释

parent 9d829d3e
import React, {useState, useEffect, useRef} from 'react'; import React, { useState, useEffect, useRef } from 'react';
import styles from './index.less'; import styles from './index.less';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import {Tag, Tooltip, Modal} from 'antd'; import { Tag, Tooltip, Modal } from 'antd';
import {EnvironmentOutlined} from '@ant-design/icons'; import { EnvironmentOutlined } from '@ant-design/icons';
import {monitorService} from './api'; import { monitorService } from './api';
import moment from 'moment'; import moment from 'moment';
import classnames from 'classnames'; import classnames from 'classnames';
import {switchTimeToPeriod} from './utils'; import { switchTimeToPeriod } from './utils';
import NormChart from './NormChart/NormChart'; import NormChart from './NormChart/NormChart';
import {Swiper, SwiperSlide} from 'swiper/react'; import { Swiper, SwiperSlide } from 'swiper/react';
import 'swiper/swiper.min.css'; import 'swiper/swiper.min.css';
import 'swiper/components/pagination/pagination.min.css'; import 'swiper/components/pagination/pagination.min.css';
import 'swiper/components/navigation/navigation.min.css'; import 'swiper/components/navigation/navigation.min.css';
import SwiperCore, {Autoplay, Pagination, Navigation} from 'swiper/core'; import SwiperCore, { Autoplay, Pagination, Navigation } from 'swiper/core';
SwiperCore.use([Autoplay, Pagination, Navigation]); SwiperCore.use([Autoplay, Pagination, Navigation]);
/* /*
...@@ -21,7 +21,7 @@ SwiperCore.use([Autoplay, Pagination, Navigation]); ...@@ -21,7 +21,7 @@ SwiperCore.use([Autoplay, Pagination, Navigation]);
* 3. 初始化进入时,取截止到当前时间为止的所有的实时报警数据。 * 3. 初始化进入时,取截止到当前时间为止的所有的实时报警数据。
* 4. 播放结束后,重新获取实时报警数据进行第二轮的播放。 * 4. 播放结束后,重新获取实时报警数据进行第二轮的播放。
* */ * */
const InfoItem = ({info}) => { const InfoItem = ({ info }) => {
const returnClassName = (type, key) => { const returnClassName = (type, key) => {
let _className = ''; let _className = '';
if (type === '普通') { if (type === '普通') {
...@@ -31,7 +31,7 @@ const InfoItem = ({info}) => { ...@@ -31,7 +31,7 @@ const InfoItem = ({info}) => {
} }
return `${_className}${key}`; return `${_className}${key}`;
}; };
const {alertLevel, startTime, stationName, alertMsg, deviceAddress} = info; const { alertLevel, startTime, stationName, alertMsg, deviceAddress } = info;
return ( return (
<div className={styles[returnClassName(alertLevel, 'Wrapper')]}> <div className={styles[returnClassName(alertLevel, 'Wrapper')]}>
<Tag className={styles[returnClassName(alertLevel, 'Tag')]}>{alertLevel}</Tag> <Tag className={styles[returnClassName(alertLevel, 'Tag')]}>{alertLevel}</Tag>
...@@ -39,7 +39,7 @@ const InfoItem = ({info}) => { ...@@ -39,7 +39,7 @@ const InfoItem = ({info}) => {
<Tooltip title={deviceAddress} placement={'topLeft'}> <Tooltip title={deviceAddress} placement={'topLeft'}>
<span className={styles.location}> <span className={styles.location}>
<EnvironmentOutlined <EnvironmentOutlined
style={{fontSize: 12, color: '#666666', marginRight: 5, verticalAlign: 'middle'}} style={{ fontSize: 12, color: '#666666', marginRight: 5, verticalAlign: 'middle' }}
/> />
{deviceAddress} {deviceAddress}
</span> </span>
...@@ -69,7 +69,7 @@ const AlarmScrollAssembly = (props) => { ...@@ -69,7 +69,7 @@ const AlarmScrollAssembly = (props) => {
pageIndex: 1, pageIndex: 1,
pageSize: 1, pageSize: 1,
...constanceRef.current, ...constanceRef.current,
}) });
}; };
const getRealTimeData = (pagination) => { const getRealTimeData = (pagination) => {
return monitorService.GetAlarmListRealTime({ return monitorService.GetAlarmListRealTime({
...@@ -95,10 +95,8 @@ const AlarmScrollAssembly = (props) => { ...@@ -95,10 +95,8 @@ const AlarmScrollAssembly = (props) => {
}, []); }, []);
return ( return (
<div className={styles.alarScrollAssembly} id={'alarmListDiv'}> <div className={styles.alarScrollAssembly} id={'alarmListDiv'}>
{/*{realTimeDataList && realTimeDataList.length ? <Swiper*/}
{realTimeDataList && realTimeDataList.length ? ( {realTimeDataList && realTimeDataList.length ? (
<Swiper <Swiper
// spaceBetween={50}
slidesPerView={1} slidesPerView={1}
modules={[Pagination]} modules={[Pagination]}
pagination={{ pagination={{
...@@ -127,7 +125,7 @@ const AlarmScrollAssembly = (props) => { ...@@ -127,7 +125,7 @@ const AlarmScrollAssembly = (props) => {
setModalVisible(true); setModalVisible(true);
}} }}
> >
<InfoItem key={index} info={item}/> <InfoItem key={index} info={item} />
</SwiperSlide> </SwiperSlide>
); );
})} })}
......
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