feat: 组织预警通知列弹窗

This commit is contained in:
汪少伟
2025-03-16 12:22:52 +08:00
parent cbf515d61c
commit 2adec4c984

View File

@@ -2,24 +2,20 @@
<Card simple class="jyh-card mt-3"> <Card simple class="jyh-card mt-3">
<div class="card-title">组织预警通知列表</div> <div class="card-title">组织预警通知列表</div>
<div class="mb-3"> <div class="mb-3">
<d-table <d-table class="jyh-table jyh-table-2" :header-bg="true" :data="licenseTableData">
class="jyh-table jyh-table-2"
:header-bg="true"
:data="licenseTableData"
>
<d-column field="code" header="时间"></d-column> <d-column field="code" header="时间"></d-column>
<d-column field="name" header="标题"> <d-column field="name" header="标题">
<template #default="scope"> <template #default="scope">
<a>{{scope.row.name}}</a> <a @click="openWarningDetail(scope.row)">{{ scope.row.name }}</a>
</template> </template>
</d-column> </d-column>
<d-column field="detail" header="详情"></d-column> <d-column field="detail" header="详情"></d-column>
<d-column field="level" header="级别"> <d-column field="level" header="级别">
<template #default="scope,text"> <template #default="scope, text">
<d-status v-if="scope.row.level===4" type="error">危险</d-status> <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 === 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 === 2" class="yellow-status">一般</d-status>
<d-status v-if="scope.row.level===1" type="running">提示</d-status> <d-status v-if="scope.row.level === 1" type="running">提示</d-status>
</template> </template>
</d-column> </d-column>
<d-column field="status" header="状态"> <d-column field="status" header="状态">
@@ -31,23 +27,34 @@
</d-table> </d-table>
</div> </div>
</Card> </Card>
<d-modal class="warning-modal" v-model="warningModalVisable" title="主题:">
<EarlyWarningDetail @close="colseWarningDetail" :warningData="currentWarning" type="user"></EarlyWarningDetail>
</d-modal>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import EarlyWarningDetail from '@/views/Jyh/PersonalCenter/Detail/EarlyWarningDetail.vue';
const licenseTableData = ref([ const licenseTableData = ref([
{code: '05822156', name:'MIT License',detail: 'integer',level: 4, status: 1}, { code: '05822156', name: 'MIT License', detail: 'integer', level: 4, status: 1 },
{code: '05822156', name:'MIT License',detail: 'integer',level: 3, status: 2}, { code: '05822156', name: 'MIT License', detail: 'integer', level: 3, status: 2 },
{code: '05822156', name:'MIT License',detail: 'integer',level: 2, status: 2}, { code: '05822156', name: 'MIT License', detail: 'integer', level: 2, status: 2 },
{code: '05822156', name:'MIT License',detail: 'integer',level: 1, status: 2}, { code: '05822156', name: 'MIT License', detail: 'integer', level: 1, status: 2 }
]); ]);
const warningModalVisable = ref(false);
const currentWarning = ref();
const openWarningDetail = (row) => {
warningModalVisable.value = true;
currentWarning.value = row;
};
const colseWarningDetail = () => {
warningModalVisable.value = false;
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import 'devui-theme/styles-var/devui-var.scss'; @import 'devui-theme/styles-var/devui-var.scss';
</style> </style>