预警通知列表接口对接

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-content">
<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>
</div>
<div class="home-search" ref="homeSearch" :class="{ 'glow-border': inputGlow }">
@@ -187,7 +187,7 @@ const openWarningDetail = (event, index) => {
item.dotColor = '';
}
})
warningModalVisable.value = true;
currentWarning.value = event;
}
@@ -255,7 +255,7 @@ getNoticeList();
img {
width: 50px;
filter: brightness(0);
//filter: brightness(0);
}
}
@@ -395,7 +395,7 @@ getNoticeList();
flex: 1;
overflow: hidden;
margin-right: 8px;
span {
white-space: nowrap;
overflow: hidden;
@@ -423,4 +423,4 @@ getNoticeList();
padding: 0px !important;
}
}
</style>
</style>

View File

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

View File

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