revert: remove unrelated formatting changes, keep only the fix for duplicate deletePersistentNotification method

Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-30 10:16:43 +00:00
co-authored by Sunwuyuan
parent 8d8e338d34
commit 7049c35f2a
61 changed files with 999 additions and 2825 deletions
+37 -83
View File
@@ -28,6 +28,8 @@
<v-row>
<v-col cols="12">
<v-card>
<v-card-text>
<v-form>
<v-row>
@@ -40,14 +42,15 @@
label="强调通知"
color="red"
inset
/>
>
</v-switch>
<v-checkbox
v-model="notificationForm.isPersistent"
label="常驻展示"
color="primary"
hide-details
class="mt-0"
/>
></v-checkbox>
</v-col>
<v-col cols="12">
<v-textarea
@@ -78,6 +81,8 @@
</v-btn>
<v-spacer />
</v-card-actions>
</v-card>
</v-col>
@@ -88,16 +93,11 @@
<v-col cols="12">
<v-card>
<v-card-title>
<v-icon class="mr-2">
mdi-pin
</v-icon>
<v-icon class="mr-2">mdi-pin</v-icon>
常驻通知管理
</v-card-title>
<v-card-text>
<div
v-if="persistentNotifications.length === 0"
class="text-center text-grey py-4"
>
<div v-if="persistentNotifications.length === 0" class="text-center text-grey py-4">
暂无常驻通知
</div>
<v-list v-else>
@@ -108,25 +108,14 @@
:subtitle="formatTime(item.timestamp)"
lines="two"
>
<template #prepend>
<template v-slot:prepend>
<v-icon :color="item.isUrgent ? 'error' : 'primary'">
{{ item.isUrgent ? 'mdi-alert-circle' : 'mdi-information' }}
</v-icon>
</template>
<template #append>
<v-btn
icon="mdi-pencil"
variant="text"
size="small"
@click="openEditDialog(item)"
/>
<v-btn
icon="mdi-delete"
variant="text"
color="error"
size="small"
@click="deletePersistentNotification(item.id)"
/>
<template v-slot:append>
<v-btn icon="mdi-pencil" variant="text" size="small" @click="openEditDialog(item)"></v-btn>
<v-btn icon="mdi-delete" variant="text" color="error" size="small" @click="deletePersistentNotification(item.id)"></v-btn>
</template>
</v-list-item>
</v-list>
@@ -212,14 +201,17 @@
>
<v-card-text class="pa-2">
<div class="align-center">
<span class="text-body-2 font-weight-medium">{{ device.deviceName }} </span>
<br>
<br/>
{{ device.deviceType }}
</div>
<div class="text-caption mt-1">
已读于 {{ formatDeviceTime(device.timestamp) }}
</div>
</v-card-text>
</v-card>
@@ -234,6 +226,7 @@
>
<v-card-text class="pa-2">
<div class="align-center">
<span class="text-body-2 font-weight-medium">{{ device.deviceName }}</span>
<v-spacer />
<span class="text-caption text-grey">
@@ -245,9 +238,9 @@
</div>
</v-card-text>
</v-card>
</div>
<div v-else>
<v-card
<div v-else> <v-card
color="info-lighten-4"
variant="outlined"
@@ -256,10 +249,9 @@
title="无设备在线"
>
<v-card-text>
如果数秒后任然显示这个提示,则可能没有任何设备在线接收通知。
如果数秒后任然显示这个提示,则可能没有任何设备在线接收通知。
</v-card-text>
</v-card>
</div>
</v-card></div>
</v-col>
</v-row>
</v-card-text>
@@ -274,22 +266,12 @@
<EventSender ref="eventSender" />
<!-- 编辑常驻通知对话框 -->
<v-dialog
v-model="editDialog"
max-width="500"
:fullscreen="$vuetify.display.xs"
>
<v-dialog v-model="editDialog" max-width="500" :fullscreen="$vuetify.display.xs">
<v-card>
<v-toolbar
flat
density="compact"
>
<v-toolbar flat density="compact">
<v-toolbar-title>编辑常驻通知</v-toolbar-title>
<v-spacer />
<v-btn
icon="mdi-close"
@click="editDialog = false"
/>
<v-spacer></v-spacer>
<v-btn icon="mdi-close" @click="editDialog = false"></v-btn>
</v-toolbar>
<v-card-text>
<v-form>
@@ -298,66 +280,38 @@
label="通知内容"
rows="3"
auto-grow
/>
></v-textarea>
<v-switch
v-model="editForm.isUrgent"
label="强调通知"
color="error"
hide-details
/>
></v-switch>
<v-checkbox
v-model="editForm.resend"
label="保存并重新发送通知"
hint="勾选后将作为新通知发送给所有在线设备"
persistent-hint
/>
></v-checkbox>
</v-form>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
variant="text"
@click="editDialog = false"
>
取消
</v-btn>
<v-btn
color="primary"
:loading="savingEdit"
@click="saveEdit"
>
保存
</v-btn>
<v-spacer></v-spacer>
<v-btn variant="text" @click="editDialog = false">取消</v-btn>
<v-btn color="primary" :loading="savingEdit" @click="saveEdit">保存</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- 删除确认对话框 -->
<v-dialog
v-model="deleteConfirmDialog"
max-width="400"
>
<v-dialog v-model="deleteConfirmDialog" max-width="400">
<v-card>
<v-card-title class="text-h5">
确认删除
</v-card-title>
<v-card-title class="text-h5">确认删除</v-card-title>
<v-card-text>确定要删除这条常驻通知吗?此操作无法撤销。</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
color="grey-darken-1"
variant="text"
@click="deleteConfirmDialog = false"
>
取消
</v-btn>
<v-btn
color="error"
variant="text"
@click="executeDelete"
>
删除
</v-btn>
<v-spacer></v-spacer>
<v-btn color="grey-darken-1" variant="text" @click="deleteConfirmDialog = false">取消</v-btn>
<v-btn color="error" variant="text" @click="executeDelete">删除</v-btn>
</v-card-actions>
</v-card>
</v-dialog>