Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
1fbd9367
Commit
1fbd9367
authored
Jun 29, 2023
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 去除弹窗
parent
eedda5c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
40 deletions
+3
-40
index.js
packages/base-components/AlarmScrollAssembly/src/index.js
+3
-40
No files found.
packages/base-components/AlarmScrollAssembly/src/index.js
View file @
1fbd9367
...
...
@@ -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
>
)
:
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment