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

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

parent f38802ff
......@@ -5,5 +5,5 @@ window.globalConfig = {
userInfo: { OID: 1 },
};
export default () => {
return <AlarmScrollAssembly deviceType={'二供泵房,二供机组'} />; // 最小宽度930px
return <AlarmScrollAssembly deviceType={'二供泵房,二供机组'} prefix={'报警信息:'} />; // 最小宽度930px
};
......@@ -95,13 +95,14 @@ const AlarmScrollAssembly = (props) => {
getData();
}, []);
return (
<>
{realTimeDataList && realTimeDataList.length ? <>
<div className={styles.alarmScrollAssemblyWrapper}>
{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
className={classnames(styles.alarScrollAssembly, (realTimeDataList?.length > 1000 ? styles.moreThan1000 : styles.lessThan1000))}
className={classnames(styles.alarmScrollAssembly, (realTimeDataList?.length > 1000 ? styles.moreThan1000 : styles.lessThan1000))}
id={'alarmListDiv'}>
<Swiper
slidesPerView={1}
......@@ -152,8 +153,8 @@ const AlarmScrollAssembly = (props) => {
</Modal>
)}
</div>
</> : ''}
</>
</div> : ''}
</div>
);
};
AlarmScrollAssembly.defaultProps = {
......
.alarScrollAssembly {
&.moreThan1000 {
:global {
.swiper-container {
width: 950px;
height: 42px;
.swiper-button-prev {
right: 150px;
left: auto !important;
}
.swiper-button-next:after,
.swiper-button-prev:after {
font-size: 12px;
}
.swiper-pagination-fraction {
top: 15px;
right: 24px;
left: auto;
width: 130px;
line-height: 12px;
}
.alarmScrollAssemblyWrapper {
width: 100%;
.swiper-wrapper {
width: calc(100% - 140px);
}
.content {
display: flex;
align-items: center;
.swiper-slide {
height: 32px;
line-height: 32px;
text-align: center;
.alarmScrollAssembly {
&.moreThan1000 {
:global {
.swiper-container {
width: 950px;
height: 42px;
.swiper-button-prev {
right: 150px;
left: auto !important;
}
.swiper-button-next:after,
.swiper-button-prev:after {
font-size: 12px;
}
.swiper-pagination-fraction {
top: 15px;
right: 24px;
left: auto;
width: 130px;
line-height: 12px;
}
.swiper-wrapper {
width: calc(100% - 140px);
}
.swiper-slide {
height: 32px;
line-height: 32px;
text-align: center;
}
}
}
}
}
}
&.lessThan1000 {
:global {
.swiper-container {
width: 950px;
height: 42px;
.swiper-button-prev {
right: 150px;
left: auto !important;
}
.swiper-button-next:after,
.swiper-button-prev:after {
font-size: 12px;
}
.swiper-pagination-fraction {
top: 15px;
right: 24px;
left: auto;
width: 130px;
line-height: 12px;
&.lessThan1000 {
:global {
.swiper-container {
width: 950px;
height: 42px;
.swiper-button-prev {
right: 150px;
left: auto !important;
}
.swiper-button-next:after,
.swiper-button-prev:after {
font-size: 12px;
}
.swiper-pagination-fraction {
top: 15px;
right: 24px;
left: auto;
width: 130px;
line-height: 12px;
}
.swiper-wrapper {
width: calc(100% - 140px);
}
.swiper-slide {
height: 32px;
line-height: 32px;
text-align: center;
}
}
}
}
.swiper-wrapper {
width: calc(100% - 140px);
}
display: flex;
flex-direction: column;
gap: 8px;
//width: 100%;
min-width: 930px;
height: 42px;
//overflow-y: scroll;
.warningWrapper {
display: flex;
align-items: center;
max-width: 760px;
padding: 4px 12px;
background: #ffeeee;
border: 1px solid #ffceca;
border-radius: 3px;
}
.swiper-slide {
height: 32px;
line-height: 32px;
text-align: center;
}
.normalWrapper {
display: flex;
align-items: center;
max-width: 760px;
padding: 4px 12px;
background: #fffbeb;
border: 1px solid #ffd9a7;
border-radius: 3px;
}
}
}
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
min-width: 930px;
height: 42px;
overflow-y: scroll;
.warningWrapper {
display: flex;
align-items: center;
max-width: 760px;
padding: 4px 12px;
background: #ffeeee;
border: 1px solid #ffceca;
border-radius: 3px;
}
.warningTag {
color: #ffffff;
background: linear-gradient(180deg, #f98b5e 0%, #f44545 100%);
border: none !important;
}
.normalWrapper {
display: flex;
align-items: center;
max-width: 760px;
padding: 4px 12px;
background: #fffbeb;
border: 1px solid #ffd9a7;
border-radius: 3px;
}
.normalTag {
color: #ffffff;
background: linear-gradient(180deg, #ffbf11 0%, #ff9c00 100%);
border: none !important;
}
.warningTag {
color: #ffffff;
background: linear-gradient(180deg, #f98b5e 0%, #f44545 100%);
border: none !important;
}
.fontSize13 {
font-size: 13px;
}
.normalTag {
color: #ffffff;
background: linear-gradient(180deg, #ffbf11 0%, #ff9c00 100%);
border: none !important;
}
.time {
display: inline-block;
width: 120px;
color: #333333;
}
.fontSize13 {
font-size: 13px;
}
.location {
display: inline-block;
//flex: 230;
//width: 230px;
//min-width: 100px;
flex: 1;
align-items: center;
margin-left: 14px;
overflow: hidden;
color: #333333;
white-space: nowrap;
text-overflow: ellipsis;
}
.time {
display: inline-block;
width: 120px;
color: #333333;
}
.periodWrapper {
display: flex;
align-items: center;
justify-content: right;
max-width: 190px;
.period {
display: inline-block;
width: 120px;
margin-left: 10px;
color: #333333;
}
}
.location {
display: inline-block;
//flex: 230;
//width: 230px;
//min-width: 100px;
flex: 1;
align-items: center;
margin-left: 14px;
overflow: hidden;
color: #333333;
white-space: nowrap;
text-overflow: ellipsis;
}
.normalContent {
display: inline-block;
flex: 2;
margin-left: 14px;
overflow: hidden;
//width: 290px;
color: #fe7200;
white-space: nowrap;
text-overflow: ellipsis;
}
.periodWrapper {
display: flex;
align-items: center;
justify-content: right;
max-width: 190px;
.period {
display: inline-block;
width: 120px;
margin-left: 10px;
color: #333333;
.warningContent {
display: inline-block;
flex: 2;
margin-left: 14px;
overflow: hidden;
//width: 290px;
color: #ff2929;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
.normalContent {
display: inline-block;
flex: 2;
margin-left: 14px;
overflow: hidden;
//width: 290px;
color: #fe7200;
white-space: nowrap;
text-overflow: ellipsis;
}
.warningContent {
display: inline-block;
flex: 2;
margin-left: 14px;
overflow: hidden;
//width: 290px;
color: #ff2929;
white-space: nowrap;
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