feat(system): 通知管理与文件选择器来源筛选
Build and Deploy Vue3 / build (push) Successful in 1m27s
Build and Deploy Vue3 / deploy (push) Successful in 34s

- 新增通知管理(渠道卡片化、模板 CRUD、参数按钮插入)

- ImageSelector/AvatarSelector 增加上传来源 is_admin 筛选

- 宿主机详情页实时指标与硬件/网卡 IPv6 展示优化

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
shiran
2026-06-04 16:38:47 +08:00
parent 0829dc9ce4
commit a827fc5c41
7 changed files with 977 additions and 13 deletions
+29 -7
View File
@@ -13,9 +13,15 @@
<div class="file-list-container">
<div class="file-list-header">
<h4>文件列表</h4>
<el-button type="primary" @click="switchToUpload" :icon="Upload">
上传新文件
</el-button>
<div class="header-actions">
<el-select v-model="sourceFilter" placeholder="上传来源" clearable size="default" style="width: 120px" @change="handleSourceChange">
<el-option label="管理员" :value="true" />
<el-option label="用户" :value="false" />
</el-select>
<el-button type="primary" @click="switchToUpload" :icon="Upload">
上传新文件
</el-button>
</div>
</div>
<div class="file-grid" v-loading="loading">
<div
@@ -137,6 +143,7 @@ import { closeAllMessage } from '../../utils/message'
const currentPage = ref(1)
const pageSize = ref(10)
const total = ref(0)
const sourceFilter = ref(undefined)
// 监听 modelValue 变化
watch(() => props.modelValue, (newVal) => {
@@ -144,6 +151,7 @@ import { closeAllMessage } from '../../utils/message'
if (newVal) {
selectedId.value = props.currentCoverId
currentPage.value = 1
sourceFilter.value = undefined
fetchFileList()
}
})
@@ -161,10 +169,11 @@ import { closeAllMessage } from '../../utils/message'
fileList.value = [] // 清空列表
try {
const res = await getFileList({
page: currentPage.value,
count: pageSize.value
})
const params = { page: currentPage.value, count: pageSize.value }
if (sourceFilter.value !== undefined && sourceFilter.value !== null && sourceFilter.value !== '') {
params.is_admin = sourceFilter.value
}
const res = await getFileList(params)
console.log("获取文件列表:", res)
@@ -219,6 +228,12 @@ import { closeAllMessage } from '../../utils/message'
fetchFileList()
}
// 来源筛选变化
const handleSourceChange = () => {
currentPage.value = 1
fetchFileList()
}
// 切换到上传标签页
const switchToUpload = () => {
activeTab.value = 'upload'
@@ -312,6 +327,7 @@ import { closeAllMessage } from '../../utils/message'
fileList.value = []
currentPage.value = 1
total.value = 0
sourceFilter.value = undefined
}
// 确认选择
@@ -347,6 +363,12 @@ import { closeAllMessage } from '../../utils/message'
margin: 0;
color: #303133;
}
.header-actions {
display: flex;
align-items: center;
gap: 10px;
}
.file-grid {
display: grid;