Commit 16c6a2ff authored by 陈龙's avatar 陈龙

feat: 报警滚动条增加prefix参数

parent f38802ff
...@@ -5,5 +5,5 @@ window.globalConfig = { ...@@ -5,5 +5,5 @@ window.globalConfig = {
userInfo: { OID: 1 }, userInfo: { OID: 1 },
}; };
export default () => { export default () => {
return <AlarmScrollAssembly deviceType={'二供泵房,二供机组'} />; // 最小宽度930px return <AlarmScrollAssembly deviceType={'二供泵房,二供机组'} prefix={'报警信息:'} />; // 最小宽度930px
}; };
...@@ -95,13 +95,14 @@ const AlarmScrollAssembly = (props) => { ...@@ -95,13 +95,14 @@ const AlarmScrollAssembly = (props) => {
getData(); getData();
}, []); }, []);
return ( return (
<> <div className={styles.alarmScrollAssemblyWrapper}>
{realTimeDataList && realTimeDataList.length ? <> {realTimeDataList && realTimeDataList.length ? <div className={styles.content} style={{display: 'flex'}}>
{ {
props.prefix ? <span>{props.prefix}</span> : '' props.prefix ?
<span style={{...props.style, flex: 'none', marginRight: 10}}>{props.prefix}</span> : ''
} }
<div <div
className={classnames(styles.alarScrollAssembly, (realTimeDataList?.length > 1000 ? styles.moreThan1000 : styles.lessThan1000))} className={classnames(styles.alarmScrollAssembly, (realTimeDataList?.length > 1000 ? styles.moreThan1000 : styles.lessThan1000))}
id={'alarmListDiv'}> id={'alarmListDiv'}>
<Swiper <Swiper
slidesPerView={1} slidesPerView={1}
...@@ -152,8 +153,8 @@ const AlarmScrollAssembly = (props) => { ...@@ -152,8 +153,8 @@ const AlarmScrollAssembly = (props) => {
</Modal> </Modal>
)} )}
</div> </div>
</> : ''} </div> : ''}
</> </div>
); );
}; };
AlarmScrollAssembly.defaultProps = { AlarmScrollAssembly.defaultProps = {
......
.alarScrollAssembly { .alarmScrollAssemblyWrapper {
width: 100%;
.content {
display: flex;
align-items: center;
.alarmScrollAssembly {
&.moreThan1000 { &.moreThan1000 {
:global { :global {
.swiper-container { .swiper-container {
...@@ -35,6 +42,7 @@ ...@@ -35,6 +42,7 @@
} }
} }
} }
&.lessThan1000 { &.lessThan1000 {
:global { :global {
.swiper-container { .swiper-container {
...@@ -71,13 +79,14 @@ ...@@ -71,13 +79,14 @@
} }
} }
} }
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
width: 100%; //width: 100%;
min-width: 930px; min-width: 930px;
height: 42px; height: 42px;
overflow-y: scroll; //overflow-y: scroll;
.warningWrapper { .warningWrapper {
display: flex; display: flex;
...@@ -170,4 +179,6 @@ ...@@ -170,4 +179,6 @@
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
}
}
} }
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