feat: 组织预警列表

This commit is contained in:
汪少伟
2025-03-16 11:15:06 +08:00
parent ef07ed1484
commit 24d1195d37
6 changed files with 137 additions and 55 deletions

View File

@@ -473,3 +473,20 @@ input {
transform-origin: center; transform-origin: center;
transform: rotateZ(180deg) !important; transform: rotateZ(180deg) !important;
} }
// 二次确认框
.popover-content {
p {
margin: 10px 0;
font-size: 14px;
max-width: 200px;
white-space: break-spaces;
}
footer {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 10px;
margin-bottom: 10px;
}
}

View File

@@ -22,6 +22,12 @@
<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="状态">
<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>
</template>
</d-column>
</d-table> </d-table>
</div> </div>
</Card> </Card>
@@ -32,10 +38,10 @@
import { ref } from 'vue'; import { ref } from 'vue';
const licenseTableData = ref([ const licenseTableData = ref([
{code: '05822156', name:'MIT License',detail: 'integer',level: 4}, {code: '05822156', name:'MIT License',detail: 'integer',level: 4, status: 1},
{code: '05822156', name:'MIT License',detail: 'integer',level: 3}, {code: '05822156', name:'MIT License',detail: 'integer',level: 3, status: 2},
{code: '05822156', name:'MIT License',detail: 'integer',level: 2}, {code: '05822156', name:'MIT License',detail: 'integer',level: 2, status: 2},
{code: '05822156', name:'MIT License',detail: 'integer',level: 1}, {code: '05822156', name:'MIT License',detail: 'integer',level: 1, status: 2},
]); ]);
</script> </script>

View File

@@ -2,11 +2,7 @@
<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">
@@ -14,6 +10,7 @@
</template> </template>
</d-column> </d-column>
<d-column field="detail" header="详情"></d-column> <d-column field="detail" header="详情"></d-column>
<d-column field="owner" 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>
@@ -22,26 +19,28 @@
<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="状态">
<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>
</template>
</d-column>
</d-table> </d-table>
</div> </div>
</Card> </Card>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
const licenseTableData = ref([ const licenseTableData = ref([
{code: '05822156', name:'MIT License',detail: 'integer',level: 4}, { code: '05822156', name: 'MIT License', detail: 'integer', owner: 'admin', level: 4, status: 1 },
{code: '05822156', name:'MIT License',detail: 'integer',level: 3}, { code: '05822156', name: 'MIT License', detail: 'integer', owner: 'admin', level: 3, status: 2 },
{code: '05822156', name:'MIT License',detail: 'integer',level: 2}, { code: '05822156', name: 'MIT License', detail: 'integer', owner: 'admin', level: 2, status: 1 },
{code: '05822156', name:'MIT License',detail: 'integer',level: 1}, { code: '05822156', name: 'MIT License', detail: 'integer', owner: 'admin', level: 1, status: 2 }
]); ]);
</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>

View File

@@ -0,0 +1,41 @@
<template>
<Card simple class="jyh-card mt-3">
<div class="card-title">组织订阅列表</div>
<div class="mb-3">
<d-table class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="code" header="订阅时间"></d-column>
<d-column field="name" header="软件/组件名称"></d-column>
<d-column field="detail" header="版本号"></d-column>
<d-column header="操作" width="100">
<template #default="scope">
<d-popover>
<d-button variant="text" color="primary"> 取消订阅 </d-button>
<template #content>
<div class="popover-content">
<p>确定取消{{ scope.row.name }}订阅吗</p>
<footer>
<d-button @click="hidden" size="sm">取消</d-button>
<d-button @click="hidden" size="sm" color="danger" variant="solid">确认</d-button>
</footer>
</div>
</template>
</d-popover>
</template>
</d-column>
</d-table>
</div>
</Card>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const tableData = ref([{ code: '05822156', name: 'MIT License', detail: 'integer', owner: 'admin' }]);
const hidden = () => {
// 模拟body点击操作
document.querySelector('body')?.click();
};
</script>
<style scoped lang="scss">
@import 'devui-theme/styles-var/devui-var.scss';
</style>

View File

@@ -0,0 +1,42 @@
<template>
<Card simple class="jyh-card mt-3">
<div class="card-title">个人订阅列表</div>
<div class="mb-3">
<d-table class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="code" header="订阅时间"></d-column>
<d-column field="name" header="软件/组件名称"></d-column>
<d-column field="detail" header="版本号"></d-column>
<d-column field="owner" header="订阅人"></d-column>
<d-column header="操作" width="100">
<template #default="scope">
<d-popover>
<d-button variant="text" color="primary"> 取消订阅 </d-button>
<template #content>
<div class="popover-content">
<p>确定取消{{ scope.row.name }}订阅吗</p>
<footer>
<d-button @click="hidden" size="sm">取消</d-button>
<d-button @click="hidden" size="sm" color="danger" variant="solid">确认</d-button>
</footer>
</div>
</template>
</d-popover>
</template>
</d-column>
</d-table>
</div>
</Card>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const tableData = ref([{ code: '05822156', name: 'MIT License', detail: 'integer', owner: 'admin' }]);
const hidden = () => {
// 模拟body点击操作
document.querySelector('body')?.click();
};
</script>
<style scoped lang="scss">
@import 'devui-theme/styles-var/devui-var.scss';
</style>

View File

@@ -1,44 +1,21 @@
<template> <template>
<div class="version-info"> <div class="version-info">
<Card simple class="jyh-card mt-3"> <d-tabs class="jyh-tabs jyh-tabs-2 jyh-tabs-4" type="wrapped" v-model="selectTab">
<div class="card-title">订阅列表</div> <d-tab id="gryj" title="个人订阅列表"></d-tab>
<div class="mb-3"> <d-tab id="zzyj" title="组织订阅列表"></d-tab>
<d-table </d-tabs>
class="jyh-table jyh-table-2" <OrgSubscription v-if="selectTab === 'zzyj'" />
:header-bg="true" <PersonageSubscription v-else />
:data="licenseTableData"
>
<d-column field="code" header="订阅时间"></d-column>
<d-column field="name" header="名称"></d-column>
<d-column field="detail" header="版本号"></d-column>
<d-column header="操作" width="300">
<template #default="scope">
<d-button
variant="text"
color="primary"
>
取消订阅
</d-button>
</template>
</d-column>
<d-column field="detail" header="订阅人"></d-column>
</d-table>
</div>
</Card>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import OrgSubscription from './OrgSubscription.vue';
const licenseTableData = ref([{code: '05822156', name:'MIT License',detail: 'integer'}]); import PersonageSubscription from './PersonageSubscription.vue';
const CopyrightTableData = ref([{code: '05822156',detail: 'integer'}]); const selectTab = ref('gryj');
</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>