预警通知列表接口对接

This commit is contained in:
付民康
2025-03-19 12:27:37 +08:00
parent e7eda07de7
commit 17c0df7379
3 changed files with 40 additions and 24 deletions

View File

@@ -2,7 +2,7 @@
<div class="home-container"> <div class="home-container">
<div class="home-content"> <div class="home-content">
<div class="home-title"> <div class="home-title">
<img src="@/assets/imgs/home/home-title-logo-2x.webp" alt="logo" /> <img src="@/assets/imgs/logo.png" alt="logo" />
<h1>可信开源代码库</h1> <h1>可信开源代码库</h1>
</div> </div>
<div class="home-search" ref="homeSearch" :class="{ 'glow-border': inputGlow }"> <div class="home-search" ref="homeSearch" :class="{ 'glow-border': inputGlow }">
@@ -187,7 +187,7 @@ const openWarningDetail = (event, index) => {
item.dotColor = ''; item.dotColor = '';
} }
}) })
warningModalVisable.value = true; warningModalVisable.value = true;
currentWarning.value = event; currentWarning.value = event;
} }
@@ -255,7 +255,7 @@ getNoticeList();
img { img {
width: 50px; width: 50px;
filter: brightness(0); //filter: brightness(0);
} }
} }
@@ -395,7 +395,7 @@ getNoticeList();
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
margin-right: 8px; margin-right: 8px;
span { span {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
@@ -423,4 +423,4 @@ getNoticeList();
padding: 0px !important; padding: 0px !important;
} }
} }
</style> </style>

View File

@@ -13,13 +13,23 @@
<a @click="openWarningDetail(scope.row)">{{ scope.row.name }}</a> <a @click="openWarningDetail(scope.row)">{{ scope.row.name }}</a>
</template> </template>
</d-column> </d-column>
<d-column field="alertMsg" header="详情"></d-column> <d-column field="alertMsg" header="详情">
<template #default="scope">
<span>{{ JSON.parse(scope.row.alertMsg)?.overview || ''}}</span>
</template>
</d-column>
<d-column field="level" header="级别"> <d-column field="level" header="级别">
<template #default="scope, text"> <template #default="scope">
<d-status v-if="scope.row.level === 4" type="error">危险</d-status> <d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '高'" type="error">
<d-status v-if="scope.row.level === 3" type="warning">严重</d-status> {{ JSON.parse(scope.row.alertMsg)?.importance || ''}}
<d-status v-if="scope.row.level === 2" class="yellow-status">一般</d-status> </d-status>
<d-status v-if="scope.row.level === 1" type="running">提示</d-status> <d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '中'" type="warning">
{{ JSON.parse(scope.row.alertMsg)?.importance || ''}}
</d-status>
<d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '低'" class="yellow-status">
{{ JSON.parse(scope.row.alertMsg)?.importance || ''}}
</d-status>
<!-- <d-status v-if="scope.row.importance === 1" type="running">提示</d-status>-->
</template> </template>
</d-column> </d-column>
<d-column field="status" header="状态"> <d-column field="status" header="状态">

View File

@@ -3,29 +3,35 @@
<div class="card-title">个人预警通知列表</div> <div class="card-title">个人预警通知列表</div>
<div class="mb-3"> <div class="mb-3">
<d-table v-if="tableData.length>0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData"> <d-table v-if="tableData.length>0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="updateTime" header="时间"> <d-column field="updateTime" header="时间"></d-column>
<template #default="scope">
<span>{{ formatTime(scope.row.updateTime, 'YYYY-MM-DD') }}</span>
</template>
</d-column>
<d-column field="name" header="标题"> <d-column field="name" header="标题">
<template #default="scope"> <template #default="scope">
<a @click="openWarningDetail(scope.row)">{{ scope.row.name }}</a> <a @click="openWarningDetail(scope.row)">{{ scope.row.name }}</a>
</template> </template>
</d-column> </d-column>
<d-column field="alertMsg" header="详情"></d-column> <d-column field="alertMsg" header="详情">
<template #default="scope">
<span>{{ JSON.parse(scope.row.alertMsg)?.overview || ''}}</span>
</template>
</d-column>
<d-column field="level" header="级别"> <d-column field="level" header="级别">
<template #default="scope, text"> <template #default="scope">
<d-status v-if="scope.row.level === 4" type="error">危险</d-status> <d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '高'" type="error">
<d-status v-if="scope.row.level === 3" type="warning">严重</d-status> {{ JSON.parse(scope.row.alertMsg)?.importance || ''}}
<d-status v-if="scope.row.level === 2" class="yellow-status">一般</d-status> </d-status>
<d-status v-if="scope.row.level === 1" type="running">提示</d-status> <d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '中'" type="warning">
{{ JSON.parse(scope.row.alertMsg)?.importance || ''}}
</d-status>
<d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '低'" class="yellow-status">
{{ JSON.parse(scope.row.alertMsg)?.importance || ''}}
</d-status>
<!-- <d-status v-if="scope.row.importance === 1" type="running">提示</d-status>-->
</template> </template>
</d-column> </d-column>
<d-column field="status" header="状态"> <d-column field="status" header="状态">
<template #default="scope, text"> <template #default="scope, text">
<d-tag v-if="scope.row.status === 1" type="danger" size="sm">未读</d-tag> <d-tag v-if="scope.row.status === 0" type="danger" size="sm">未读</d-tag>
<d-tag v-if="scope.row.status === 2" type="success" size="sm">已读</d-tag> <d-tag v-if="scope.row.status === 1" type="success" size="sm">已读</d-tag>
</template> </template>
</d-column> </d-column>
</d-table> </d-table>