|
@@ -1,36 +1,37 @@
|
|
<template>
|
|
<template>
|
|
<div class="alarmBox" :class="alarmList?.length ? 'notEmpty' : ''">
|
|
<div class="alarmBox" :class="alarmList?.length ? 'notEmpty' : ''">
|
|
<div
|
|
<div
|
|
- class="alarmItem animate__animated"
|
|
|
|
- :class="item.class"
|
|
|
|
|
|
+ :class="`${index < 6 ? item.class + ' alarmItem animate__animated' : ''}`"
|
|
v-for="(item, index) in alarmList"
|
|
v-for="(item, index) in alarmList"
|
|
:key="index"
|
|
:key="index"
|
|
>
|
|
>
|
|
- <div class="alarmTitle">{{ item.alarmName }}</div>
|
|
|
|
- <div class="alarmContent">
|
|
|
|
- <div class="contentItem">报警描述: {{ item.description }}</div>
|
|
|
|
- <div class="contentItem">报警时间: {{ item.tsName }}</div>
|
|
|
|
- </div>
|
|
|
|
- <div class="btntBox" :class="`lv${item.lv}BdColor`">
|
|
|
|
- <div class="btnItem" :class="`lv${item.lv}BdColor`">
|
|
|
|
- <el-button
|
|
|
|
- class="comfirmAll"
|
|
|
|
- size="small"
|
|
|
|
- type="text"
|
|
|
|
- @click="comfirm(item)"
|
|
|
|
- >确认本条</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <template v-if="index < 6">
|
|
|
|
+ <div class="alarmTitle">{{ item.alarmName }}</div>
|
|
|
|
+ <div class="alarmContent">
|
|
|
|
+ <div class="contentItem">报警描述: {{ item.description }}</div>
|
|
|
|
+ <div class="contentItem">报警时间: {{ item.tsName }}</div>
|
|
</div>
|
|
</div>
|
|
- <div class="btnItem">
|
|
|
|
- <el-button
|
|
|
|
- class="comfirmAll"
|
|
|
|
- size="small"
|
|
|
|
- type="text"
|
|
|
|
- @click="comfirmAll"
|
|
|
|
- >全部确认</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <div class="btnBox" :class="`lv${item.lv}BdColor`">
|
|
|
|
+ <div class="btnItem" :class="`lv${item.lv}BdColor lv${item.lv}`">
|
|
|
|
+ <el-button
|
|
|
|
+ class="comfirmBtn"
|
|
|
|
+ size="small"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="comfirm(item)"
|
|
|
|
+ >确认本条</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <div class="btnItem" :class="`lv${item.lv}`">
|
|
|
|
+ <el-button
|
|
|
|
+ class="comfirmBtn"
|
|
|
|
+ size="small"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="comfirmAll"
|
|
|
|
+ >全部确认</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -75,6 +76,20 @@ export default {
|
|
return `${alarmName}报警`;
|
|
return `${alarmName}报警`;
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ getLvName(alarmItem) {
|
|
|
|
+ if (alarmItem.rank === 1) {
|
|
|
|
+ return "低级";
|
|
|
|
+ } else if (alarmItem.rank === 2) {
|
|
|
|
+ return "低中级";
|
|
|
|
+ } else if (alarmItem.rank === 3) {
|
|
|
|
+ return "中级";
|
|
|
|
+ } else if (alarmItem.rank === 4) {
|
|
|
|
+ return "中高级";
|
|
|
|
+ } else if (alarmItem.rank === 5) {
|
|
|
|
+ return "高级";
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
comfirm(item) {
|
|
comfirm(item) {
|
|
this.$confirm("您确定要执行此操作吗?", "提示", {
|
|
this.$confirm("您确定要执行此操作吗?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
@@ -186,8 +201,10 @@ export default {
|
|
let alarmItem = JSON.parse(res.data);
|
|
let alarmItem = JSON.parse(res.data);
|
|
if (alarmItem) {
|
|
if (alarmItem) {
|
|
const alarmOption = {
|
|
const alarmOption = {
|
|
- lv: alarmItem.rank,
|
|
|
|
id: alarmItem.id,
|
|
id: alarmItem.id,
|
|
|
|
+ lv: alarmItem.rank,
|
|
|
|
+ lvName: this.getLvName(alarmItem),
|
|
|
|
+ rank: alarmItem.rank,
|
|
class: `animate__bounceInRight lv${alarmItem.rank}`,
|
|
class: `animate__bounceInRight lv${alarmItem.rank}`,
|
|
confirm: alarmItem.isClose,
|
|
confirm: alarmItem.isClose,
|
|
alarmType: alarmItem.alarmType,
|
|
alarmType: alarmItem.alarmType,
|
|
@@ -248,8 +265,8 @@ export default {
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.alarmBox {
|
|
.alarmBox {
|
|
- width: 200px;
|
|
|
|
- height: 100%;
|
|
|
|
|
|
+ width: 240px;
|
|
|
|
+ height: calc(100% - 85px);
|
|
padding: 0 12px 0 30px;
|
|
padding: 0 12px 0 30px;
|
|
position: absolute;
|
|
position: absolute;
|
|
right: 0;
|
|
right: 0;
|
|
@@ -261,6 +278,7 @@ export default {
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
overflow-y: scroll;
|
|
overflow-y: scroll;
|
|
pointer-events: none;
|
|
pointer-events: none;
|
|
|
|
+ border-radius: 8px;
|
|
transition: 0.2s;
|
|
transition: 0.2s;
|
|
|
|
|
|
.alarmItem {
|
|
.alarmItem {
|
|
@@ -269,7 +287,7 @@ export default {
|
|
border-radius: 8px;
|
|
border-radius: 8px;
|
|
border: 1px solid #ebeef5;
|
|
border: 1px solid #ebeef5;
|
|
background: #1890ff;
|
|
background: #1890ff;
|
|
- margin-bottom: 12px;
|
|
|
|
|
|
+ margin-bottom: 4px;
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
color: #fff;
|
|
color: #fff;
|
|
pointer-events: auto;
|
|
pointer-events: auto;
|
|
@@ -278,7 +296,7 @@ export default {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
justify-content: flex-start;
|
|
align-content: center;
|
|
align-content: center;
|
|
- width: 100%;
|
|
|
|
|
|
+ width: calc(100% - 16px);
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
@@ -309,7 +327,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- .btntBox {
|
|
|
|
|
|
+ .btnBox {
|
|
display: flex;
|
|
display: flex;
|
|
width: 100%;
|
|
width: 100%;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
@@ -331,11 +349,18 @@ export default {
|
|
min-height: 20px;
|
|
min-height: 20px;
|
|
}
|
|
}
|
|
|
|
|
|
- .confirmCurrent {
|
|
|
|
- color: #67c23a;
|
|
|
|
|
|
+ &.lv1 .el-button,
|
|
|
|
+ &.lv2 .el-button,
|
|
|
|
+ &.lv3 .el-button {
|
|
|
|
+ color: var(--el-color-info) !important;
|
|
}
|
|
}
|
|
- .confirmAll {
|
|
|
|
- color: #e6a23c;
|
|
|
|
|
|
+
|
|
|
|
+ &.lv4 .el-button {
|
|
|
|
+ color: rgb(50, 65, 87) !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &.lv5 .el-button {
|
|
|
|
+ color: #242f42;
|
|
}
|
|
}
|
|
|
|
|
|
&:first-child {
|
|
&:first-child {
|
|
@@ -345,36 +370,36 @@ export default {
|
|
}
|
|
}
|
|
&.lv5 {
|
|
&.lv5 {
|
|
background: #fef0f0;
|
|
background: #fef0f0;
|
|
- border: 1px solid #f56c6c;
|
|
|
|
- color: #f56c6c;
|
|
|
|
|
|
+ border: 1px solid #242f42;
|
|
|
|
+ color: #242f42;
|
|
}
|
|
}
|
|
|
|
|
|
&.lv4 {
|
|
&.lv4 {
|
|
background: #f0f9eb;
|
|
background: #f0f9eb;
|
|
- border: 1px solid #e6a23c;
|
|
|
|
- color: #e6a23c;
|
|
|
|
|
|
+ border: 1px solid rgb(50, 65, 87);
|
|
|
|
+ color: rgb(50, 65, 87);
|
|
}
|
|
}
|
|
|
|
|
|
&.lv1,
|
|
&.lv1,
|
|
&.lv2,
|
|
&.lv2,
|
|
&.lv3 {
|
|
&.lv3 {
|
|
background: #fdf6ec;
|
|
background: #fdf6ec;
|
|
- border: 1px solid #67c23a;
|
|
|
|
- color: #67c23a;
|
|
|
|
|
|
+ border: 1px solid var(--el-color-info);
|
|
|
|
+ color: var(--el-color-info);
|
|
}
|
|
}
|
|
|
|
|
|
.lv1BdColor,
|
|
.lv1BdColor,
|
|
.lv2BdColor,
|
|
.lv2BdColor,
|
|
.lv3BdColor {
|
|
.lv3BdColor {
|
|
- border-color: #67c23a !important;
|
|
|
|
|
|
+ border-color: var(--el-color-info) !important;
|
|
}
|
|
}
|
|
|
|
|
|
.lv4BdColor {
|
|
.lv4BdColor {
|
|
- border-color: #e6a23c !important;
|
|
|
|
|
|
+ border-color: rgb(50, 65, 87) !important;
|
|
}
|
|
}
|
|
|
|
|
|
.lv5BdColor {
|
|
.lv5BdColor {
|
|
- border-color: #f56c6c !important;
|
|
|
|
|
|
+ border-color: #242f42 !important;
|
|
}
|
|
}
|
|
|
|
|
|
&.hidden {
|
|
&.hidden {
|