|
@@ -124,7 +124,9 @@
|
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
|
v-infinite-scroll="loadMore"
|
|
v-infinite-scroll="loadMore"
|
|
|
:infinite-scroll-distance="50"
|
|
:infinite-scroll-distance="50"
|
|
|
- :infinite-scroll-disabled="loadingMore || deviceData.length >= total"
|
|
|
|
|
|
|
+ :infinite-scroll-disabled="
|
|
|
|
|
+ loadingMore || deviceData.length >= total
|
|
|
|
|
+ "
|
|
|
:infinite-scroll-immediate="false"
|
|
:infinite-scroll-immediate="false"
|
|
|
>
|
|
>
|
|
|
<el-row :gutter="10">
|
|
<el-row :gutter="10">
|
|
@@ -143,6 +145,24 @@
|
|
|
}"
|
|
}"
|
|
|
@click="details(item)"
|
|
@click="details(item)"
|
|
|
>
|
|
>
|
|
|
|
|
+ <!-- 告警闪灯 -->
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-if="item.alarmLogStatusDTO?.alarmId"
|
|
|
|
|
+ class="alarm-badge"
|
|
|
|
|
+ :class="{
|
|
|
|
|
+ 'alarm-yellow': item.alarmLogStatusDTO?.alarmId == 1,
|
|
|
|
|
+ 'alarm-orange': item.alarmLogStatusDTO?.alarmId == 2,
|
|
|
|
|
+ 'alarm-red':
|
|
|
|
|
+ item.alarmLogStatusDTO?.alarmId == 3 ||
|
|
|
|
|
+ item.alarmLogStatusDTO?.alarmId == 5 ||
|
|
|
|
|
+ item.alarmLogStatusDTO?.alarmId == 4
|
|
|
|
|
+ }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="alarm-text">{{
|
|
|
|
|
+ getAlarmLevelText(item.alarmLogStatusDTO?.alarmId)
|
|
|
|
|
+ }}</span>
|
|
|
|
|
+ <i class="el-icon-bell alarm-icon"></i>
|
|
|
|
|
+ </div>
|
|
|
<div class="card-header">
|
|
<div class="card-header">
|
|
|
<div>{{item.postName|}}</div>
|
|
<div>{{item.postName|}}</div>
|
|
|
<div class="card-header-value">
|
|
<div class="card-header-value">
|
|
@@ -335,7 +355,16 @@
|
|
|
this.deviceData = [];
|
|
this.deviceData = [];
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // 加载设备数据
|
|
|
|
|
|
|
+ getAlarmLevelText(level) {
|
|
|
|
|
+ const textMap = {
|
|
|
|
|
+ 1: '轻微告警',
|
|
|
|
|
+ 2: '中等告警',
|
|
|
|
|
+ 3: '严重告警',
|
|
|
|
|
+ 4: '紧急告警',
|
|
|
|
|
+ 5: '致命告警'
|
|
|
|
|
+ };
|
|
|
|
|
+ return textMap[level] || '';
|
|
|
|
|
+ },
|
|
|
loadDeviceData(isLoadMore = false) {
|
|
loadDeviceData(isLoadMore = false) {
|
|
|
if (this.loadingMore) return;
|
|
if (this.loadingMore) return;
|
|
|
this.loadingMore = true;
|
|
this.loadingMore = true;
|
|
@@ -354,48 +383,50 @@
|
|
|
areaId: this.areaId,
|
|
areaId: this.areaId,
|
|
|
keyWord: this.keyWord,
|
|
keyWord: this.keyWord,
|
|
|
postId: this.postId
|
|
postId: this.postId
|
|
|
- }).then((res) => {
|
|
|
|
|
- this.loadingMore = false;
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- this.updateTime = dayjs().format('YYYY-M-D HH:mm:ss');
|
|
|
|
|
- const list = res.list.map((item) => {
|
|
|
|
|
- let iotList = [];
|
|
|
|
|
- if (item.iotPointDataList) {
|
|
|
|
|
- item.iotPointDataList.forEach((element) => {
|
|
|
|
|
- let data = item.iotModel.properties.find(
|
|
|
|
|
- (iotModel) => iotModel.identifier == element.identifier
|
|
|
|
|
- );
|
|
|
|
|
- if (data) {
|
|
|
|
|
- iotList.push({
|
|
|
|
|
- ...element,
|
|
|
|
|
- dataType: data.dataType
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.loadingMore = false;
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ this.updateTime = dayjs().format('YYYY-M-D HH:mm:ss');
|
|
|
|
|
+ const list = res.list.map((item) => {
|
|
|
|
|
+ let iotList = [];
|
|
|
|
|
+ if (item.iotPointDataList) {
|
|
|
|
|
+ item.iotPointDataList.forEach((element) => {
|
|
|
|
|
+ let data = item.iotModel.properties.find(
|
|
|
|
|
+ (iotModel) => iotModel.identifier == element.identifier
|
|
|
|
|
+ );
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ iotList.push({
|
|
|
|
|
+ ...element,
|
|
|
|
|
+ dataType: data.dataType
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- item['iotList'] = item.iotDashboardPoint.length
|
|
|
|
|
- ? iotList.filter((iotListItem) =>
|
|
|
|
|
- item.iotDashboardPoint.find(
|
|
|
|
|
- (Point) =>
|
|
|
|
|
- Point.identifier == iotListItem.identifier &&
|
|
|
|
|
- Point.checked1
|
|
|
|
|
|
|
+ item['iotList'] = item.iotDashboardPoint.length
|
|
|
|
|
+ ? iotList.filter((iotListItem) =>
|
|
|
|
|
+ item.iotDashboardPoint.find(
|
|
|
|
|
+ (Point) =>
|
|
|
|
|
+ Point.identifier == iotListItem.identifier &&
|
|
|
|
|
+ Point.checked1
|
|
|
|
|
+ )
|
|
|
)
|
|
)
|
|
|
- )
|
|
|
|
|
- : iotList.filter((iotListItem, index) => index < 4);
|
|
|
|
|
- return item;
|
|
|
|
|
|
|
+ : iotList.filter((iotListItem, index) => index < 4);
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
|
|
+ if (isLoadMore) {
|
|
|
|
|
+ this.deviceData = this.deviceData.concat(list);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.deviceData = list;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.total = res.count;
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.loadingMore = false;
|
|
|
|
|
+ this.loading = false;
|
|
|
});
|
|
});
|
|
|
- if (isLoadMore) {
|
|
|
|
|
- this.deviceData = this.deviceData.concat(list);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.deviceData = list;
|
|
|
|
|
- }
|
|
|
|
|
- this.total = res.count;
|
|
|
|
|
- console.log(res);
|
|
|
|
|
- }).catch(() => {
|
|
|
|
|
- this.loadingMore = false;
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
// 加载更多
|
|
// 加载更多
|
|
|
loadMore() {
|
|
loadMore() {
|
|
@@ -791,6 +822,40 @@
|
|
|
transition: all 0.3s;
|
|
transition: all 0.3s;
|
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
|
|
|
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
|
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+
|
|
|
|
|
+ .alarm-badge {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 10px;
|
|
|
|
|
+ right: 10px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 4px;
|
|
|
|
|
+ z-index: 2;
|
|
|
|
|
+ animation: alarm-pulse 1.5s infinite;
|
|
|
|
|
+
|
|
|
|
|
+ .alarm-text {
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .alarm-icon {
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &.alarm-yellow {
|
|
|
|
|
+ color: #f0a030;
|
|
|
|
|
+ text-shadow: 0 0 8px #f0a030;
|
|
|
|
|
+ }
|
|
|
|
|
+ &.alarm-orange {
|
|
|
|
|
+ color: #e67e22;
|
|
|
|
|
+ text-shadow: 0 0 8px #e67e22;
|
|
|
|
|
+ }
|
|
|
|
|
+ &.alarm-red {
|
|
|
|
|
+ color: #ff4d4f;
|
|
|
|
|
+ text-shadow: 0 0 8px #ff4d4f;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
&:hover {
|
|
&:hover {
|
|
|
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5),
|
|
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5),
|
|
@@ -995,6 +1060,15 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @keyframes alarm-pulse {
|
|
|
|
|
+ 0%,
|
|
|
|
|
+ 100% {
|
|
|
|
|
+ transform: scale(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ 50% {
|
|
|
|
|
+ transform: scale(1.15);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
@keyframes bellshake {
|
|
@keyframes bellshake {
|
|
|
0%,
|
|
0%,
|
|
|
100% {
|
|
100% {
|
|
@@ -1014,6 +1088,15 @@
|
|
|
transform: rotate(10deg);
|
|
transform: rotate(10deg);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ @keyframes blink {
|
|
|
|
|
+ 0%,
|
|
|
|
|
+ 100% {
|
|
|
|
|
+ opacity: 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ 50% {
|
|
|
|
|
+ opacity: 0.3;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.fullscreen-btn {
|
|
.fullscreen-btn {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
right: 15px;
|
|
right: 15px;
|