feat: 全面升级——后台优化 / 动态配置 / 个人中心 / OSS 存储

- OSS 文件存储(RustFS / S3 v4 兼容,零依赖手写 SigV4):
  上传/列表/删除走桶 arcticnewone,/uploads 代理服务 + 本地回退;
  server/utils/sigv4.ts 纯函数 + AWS 测试向量验证
- 业务动态配置:settings 表 + /api/settings(公开) + /api/admin/settings(PATCH),
  useSiteSettings 组合式,footer/contact/tools/app.vue/侧边栏/工具页全部接入,
  后台 /admin/settings 修改前台即时生效(站点/联系/社交/工具箱/页脚/SEO)
- 后台全面优化:Admin* 设计系统(按钮/输入/表单/卡片/徽标/弹窗/确认/空态/骨架/
  分页/页头/Toast)14 组件;Dashboard 增强;各列表页搜索/筛选/批量删除/分页;
  布局与侧边栏分组;统一 toast/确认反馈
- 个人中心全新重设计:顶部资料卡 + 统计、精致化改密/删号(二次确认)、
  收藏封面网格、评论卡片、移动端适配
- deploy.sh 支持 OSS 凭据注入(NUXT_OSS_*);.env.example 更新
- 测试 17 例全过(含 SigV4 AWS 向量、settings 默认结构)
This commit is contained in:
2026-08-06 18:40:17 +08:00
parent 685c7b51d1
commit 5a7ad8de11
55 changed files with 3857 additions and 1993 deletions
+218 -271
View File
@@ -1,14 +1,14 @@
<script setup lang="ts">
/**
* 后台动态管理:列表 + 新建/编辑表单。
* 后台动态管理:列表(搜索/分类/状态筛选 + 前端分页)+ 新建/编辑表单。
* - 列表来自 /api/admin/articles(含未发布)
* - 新建 POST /api/admin/articles;编辑 PATCH /api/admin/articles/[id];删除 DELETE /api/admin/articles/[id]
* - 正文为内容块编辑器(中英各一组)
*/
import { onMounted, reactive, ref } from 'vue'
import { computed, onMounted, reactive, ref, watch } from 'vue'
import { useToastStore } from '~/stores/toast'
definePageMeta({ middleware: 'admin', layout: 'admin' })
useHead({ title: '动态管理' })
interface Block {
@@ -35,6 +35,8 @@ interface Article {
updatedAt: string
}
const toast = useToastStore()
const CATEGORIES = [
{ value: 'insights', label: '行业洞察' },
{ value: 'projects', label: '项目动态' },
@@ -62,18 +64,50 @@ const loadArticles = async () => {
onMounted(loadArticles)
/* ---------- 提示 ---------- */
const message = ref('')
const messageType = ref<'success' | 'error'>('success')
let toastTimer: ReturnType<typeof setTimeout> | undefined
/* ---------- 搜索 / 筛选 / 分页 ---------- */
const keyword = ref('')
const categoryFilter = ref<'all' | Article['category']>('all')
const statusFilter = ref<'all' | 'published' | 'draft'>('all')
const toast = (text: string, type: 'success' | 'error' = 'success') => {
message.value = text
messageType.value = type
if (toastTimer) clearTimeout(toastTimer)
toastTimer = setTimeout(() => (message.value = ''), 3000)
const filteredArticles = computed(() => {
const kw = keyword.value.trim().toLowerCase()
return articles.value.filter((a) => {
if (categoryFilter.value !== 'all' && a.category !== categoryFilter.value) return false
if (statusFilter.value === 'published' && !a.published) return false
if (statusFilter.value === 'draft' && a.published) return false
if (!kw) return true
return (
a.titleZh.toLowerCase().includes(kw) ||
a.titleEn.toLowerCase().includes(kw) ||
a.slug.toLowerCase().includes(kw) ||
a.author.toLowerCase().includes(kw)
)
})
})
const pageSize = 10
const page = ref(1)
const totalPages = computed(() => Math.max(1, Math.ceil(filteredArticles.value.length / pageSize)))
const pagedArticles = computed(() => {
const p = Math.min(page.value, totalPages.value)
const start = (p - 1) * pageSize
return filteredArticles.value.slice(start, start + pageSize)
})
watch([keyword, categoryFilter, statusFilter], () => {
page.value = 1
})
const changePage = (p: number) => {
page.value = Math.min(Math.max(1, p), totalPages.value)
}
const headerSubtitle = computed(() => {
if (view.value === 'form') return editingId.value != null ? '编辑动态' : '新建动态'
return `共 ${articles.value.length} 篇动态`
})
/* ---------- 表单 ---------- */
const view = ref<'list' | 'form'>('list')
const editingId = ref<number | null>(null)
@@ -107,7 +141,7 @@ const openCreate = () => {
const openEdit = (a: Article) => {
if (a.id == null) {
toast('该条目缺少 id 字段,暂时无法编辑(后端待补)', 'error')
toast.error('该条目缺少 id 字段,暂时无法编辑(后端待补)')
return
}
editingId.value = a.id
@@ -165,10 +199,10 @@ const save = async () => {
}
if (editingId.value != null) {
await $fetch(`/api/admin/articles/${editingId.value}`, { method: 'PATCH', body: payload })
toast('动态已更新')
toast.success('动态已更新')
} else {
await $fetch('/api/admin/articles', { method: 'POST', body: payload })
toast('动态已创建')
toast.success('动态已创建')
}
await loadArticles()
view.value = 'list'
@@ -185,7 +219,7 @@ const deleting = ref(false)
const askDelete = (a: Article) => {
if (a.id == null) {
toast('该条目缺少 id 字段,暂时无法删除(后端待补)', 'error')
toast.error('该条目缺少 id 字段,暂时无法删除(后端待补)')
return
}
confirmDelete.value = a
@@ -197,11 +231,11 @@ const doDelete = async () => {
deleting.value = true
try {
await $fetch(`/api/admin/articles/${a.id}`, { method: 'DELETE' })
toast(`已删除「${a.titleZh}」`)
toast.success(`已删除「${a.titleZh}」`)
confirmDelete.value = null
await loadArticles()
} catch (err: any) {
toast(err?.data?.message || '删除失败', 'error')
toast.error(err?.data?.message || '删除失败')
} finally {
deleting.value = false
}
@@ -211,323 +245,236 @@ const doDelete = async () => {
<template>
<div>
<!-- 页头 -->
<div class="flex items-center justify-between gap-4 mb-8">
<div>
<h1 class="text-2xl md:text-3xl font-bold text-black tracking-tight">动态管理</h1>
<p v-if="view === 'list'" class="mt-1 text-sm text-gray-500">共 {{ articles.length }} 篇动态</p>
</div>
<button
v-if="view === 'list'"
type="button"
@click="openCreate"
class="inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-black text-white text-sm font-semibold hover:bg-gray-800 transition-colors"
>
<Icon name="ph:plus" class="w-4 h-4" /> 新建动态
</button>
<button
v-else
type="button"
@click="backToList"
class="inline-flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-200 bg-white text-sm font-semibold text-gray-700 hover:bg-gray-100 transition-colors"
>
<Icon name="ph:arrow-left" class="w-4 h-4" /> 返回列表
</button>
</div>
<!-- 提示 -->
<div
v-if="message"
class="mb-6 px-4 py-3 rounded-xl text-sm font-medium border"
:class="messageType === 'success' ? 'bg-green-50 border-green-200 text-green-700' : 'bg-red-50 border-red-200 text-red-700'"
>
{{ message }}
</div>
<AdminPageHeader title="动态管理" :subtitle="headerSubtitle">
<template #actions>
<AdminButton v-if="view === 'list'" size="sm" @click="openCreate">
<Icon name="ph:plus" class="w-4 h-4" /> 新建动态
</AdminButton>
<AdminButton v-else size="sm" variant="secondary" @click="backToList">
<Icon name="ph:arrow-left" class="w-4 h-4" /> 返回列表
</AdminButton>
</template>
</AdminPageHeader>
<!-- ==================== 列表视图 ==================== -->
<template v-if="view === 'list'">
<!-- 加载态 -->
<div v-if="loading" class="space-y-3">
<div
v-for="i in 6"
:key="i"
class="rounded-2xl bg-white border border-gray-100 shadow-sm p-5 h-16 animate-pulse"
></div>
<!-- 工具栏 -->
<div class="mb-5 flex flex-col sm:flex-row gap-3">
<div class="relative flex-1 sm:max-w-xs">
<Icon name="ph:magnifying-glass" class="w-4 h-4 text-gray-400 absolute left-3.5 top-1/2 -translate-y-1/2 pointer-events-none" />
<input
v-model="keyword"
type="text"
placeholder="搜索标题 / slug / 作者…"
class="w-full rounded-xl border border-gray-200 bg-white py-2.5 pl-10 pr-9 text-sm outline-none transition-all focus:border-black focus:ring-2 focus:ring-black/10"
/>
<button
v-if="keyword"
@click="keyword = ''"
class="absolute right-2.5 top-1/2 -translate-y-1/2 w-5 h-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100 flex items-center justify-center"
aria-label="清空筛选"
>
<Icon name="ph:x" class="w-3.5 h-3.5" />
</button>
</div>
<AdminSelect
v-model="categoryFilter"
:options="[
{ value: 'all', label: '全部分类' },
...CATEGORIES,
]"
class="w-full sm:w-40"
/>
<AdminSelect
v-model="statusFilter"
:options="[
{ value: 'all', label: '全部状态' },
{ value: 'published', label: '已发布' },
{ value: 'draft', label: '草稿' },
]"
class="w-full sm:w-36"
/>
</div>
<!-- 加载态 -->
<AdminCard v-if="loading">
<AdminSkeleton :rows="6" />
</AdminCard>
<!-- 错误态 -->
<div
v-else-if="error"
class="rounded-2xl bg-white border border-gray-100 shadow-sm p-10 text-center"
>
<Icon name="ph:warning-circle" class="w-10 h-10 text-gray-300 mx-auto mb-4" />
<p class="text-gray-500 mb-4">{{ error }}</p>
<button
type="button"
@click="loadArticles"
class="px-5 py-2 rounded-lg bg-black text-white text-sm font-semibold hover:bg-gray-800 transition-colors"
>
重新加载
</button>
</div>
<AdminCard v-else-if="error">
<div class="py-10 text-center">
<Icon name="ph:warning-circle" class="w-10 h-10 text-gray-300 mx-auto mb-4" />
<p class="text-gray-500 mb-4">{{ error }}</p>
<AdminButton size="sm" @click="loadArticles">重新加载</AdminButton>
</div>
</AdminCard>
<!-- 空态 -->
<div
<AdminEmptyState
v-else-if="!articles.length"
class="rounded-2xl bg-white border border-gray-100 shadow-sm p-14 text-center"
>
<Icon name="ph:newspaper" class="w-10 h-10 text-gray-300 mx-auto mb-4" />
<p class="text-gray-500 mb-4">还没有动态,点击右上角「新建动态」创建第一篇</p>
</div>
icon="ph:newspaper"
title="还没有动态"
description="点击右上角「新建动态」创建第一篇。"
/>
<AdminEmptyState
v-else-if="!filteredArticles.length"
icon="ph:magnifying-glass"
title="没有匹配的动态"
description="换个关键词或筛选条件试试。"
/>
<!-- 列表 -->
<div v-else class="rounded-2xl bg-white border border-gray-100 shadow-sm overflow-hidden">
<div class="overflow-x-auto">
<table class="w-full text-sm">
<thead>
<tr class="text-left text-gray-400 border-b border-gray-100">
<th class="px-5 py-4 font-semibold">标题</th>
<th class="px-5 py-4 font-semibold">分类</th>
<th class="px-5 py-4 font-semibold">发布日期</th>
<th class="px-5 py-4 font-semibold">时长</th>
<th class="px-5 py-4 font-semibold">状态</th>
<th class="px-5 py-4 font-semibold text-right">操作</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-50">
<tr
v-for="a in articles"
:key="a.slug"
class="hover:bg-gray-50/60 transition-colors"
>
<td class="px-5 py-4">
<p class="font-semibold text-black">{{ a.titleZh }}</p>
<p class="text-xs text-gray-400 mt-0.5 font-mono">{{ a.slug }}</p>
</td>
<td class="px-5 py-4">
<span class="px-2.5 py-1 rounded-full bg-gray-100 text-gray-700 text-xs font-medium">
{{ catLabel(a.category) }}
</span>
</td>
<td class="px-5 py-4 text-gray-600 whitespace-nowrap">{{ a.date || '-' }}</td>
<td class="px-5 py-4 text-gray-600 whitespace-nowrap">{{ a.readTime }} 分钟</td>
<td class="px-5 py-4">
<span
class="px-2.5 py-1 rounded-full text-xs font-semibold inline-flex items-center gap-1"
:class="a.published ? 'bg-green-50 text-green-700' : 'bg-amber-50 text-amber-700'"
>
<span
class="w-1.5 h-1.5 rounded-full"
:class="a.published ? 'bg-green-500' : 'bg-amber-500'"
></span>
{{ a.published ? '已发布' : '草稿' }}
</span>
</td>
<td class="px-5 py-4">
<div class="flex items-center justify-end gap-2">
<button
type="button"
@click="openEdit(a)"
class="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-gray-100 text-gray-700 text-xs font-semibold hover:bg-gray-200 transition-colors"
>
<Icon name="ph:pencil-simple" class="w-3.5 h-3.5" /> 编辑
</button>
<button
type="button"
@click="askDelete(a)"
class="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-red-50 text-red-600 text-xs font-semibold hover:bg-red-100 transition-colors"
>
<Icon name="ph:trash" class="w-3.5 h-3.5" /> 删除
</button>
</div>
</td>
</tr>
</tbody>
</table>
<template v-else>
<div class="rounded-2xl border border-gray-100 bg-white shadow-sm overflow-hidden">
<div class="overflow-x-auto">
<table class="w-full text-sm">
<thead>
<tr class="text-left text-gray-400 border-b border-gray-100 bg-gray-50">
<th class="px-5 py-4 font-semibold text-xs uppercase tracking-wider">标题</th>
<th class="px-5 py-4 font-semibold text-xs uppercase tracking-wider">分类</th>
<th class="px-5 py-4 font-semibold text-xs uppercase tracking-wider">发布日期</th>
<th class="px-5 py-4 font-semibold text-xs uppercase tracking-wider">时长</th>
<th class="px-5 py-4 font-semibold text-xs uppercase tracking-wider">状态</th>
<th class="px-5 py-4 font-semibold text-xs uppercase tracking-wider text-right">操作</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-50">
<tr
v-for="a in pagedArticles"
:key="a.slug"
class="hover:bg-gray-50/60 transition-colors"
>
<td class="px-5 py-4">
<p class="font-semibold text-black">{{ a.titleZh }}</p>
<p class="text-xs text-gray-400 mt-0.5 font-mono">{{ a.slug }}</p>
</td>
<td class="px-5 py-4">
<AdminBadge tone="gray">{{ catLabel(a.category) }}</AdminBadge>
</td>
<td class="px-5 py-4 text-gray-600 whitespace-nowrap">{{ a.date || '-' }}</td>
<td class="px-5 py-4 text-gray-600 whitespace-nowrap">{{ a.readTime }} 分钟</td>
<td class="px-5 py-4">
<AdminBadge :tone="a.published ? 'green' : 'amber'">
<span
class="w-1.5 h-1.5 rounded-full inline-block"
:class="a.published ? 'bg-green-500' : 'bg-amber-500'"
></span>
{{ a.published ? '已发布' : '草稿' }}
</AdminBadge>
</td>
<td class="px-5 py-4">
<div class="flex items-center justify-end gap-2">
<AdminButton size="sm" variant="secondary" @click="openEdit(a)">
<Icon name="ph:pencil-simple" class="w-3.5 h-3.5" /> 编辑
</AdminButton>
<AdminButton size="sm" variant="danger" @click="askDelete(a)">
<Icon name="ph:trash" class="w-3.5 h-3.5" /> 删除
</AdminButton>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="mt-4">
<AdminPagination :total="filteredArticles.length" :page="page" :page-size="pageSize" @page="changePage" />
</div>
</template>
</template>
<!-- ==================== 表单视图 ==================== -->
<template v-else>
<div class="space-y-6 max-w-4xl">
<!-- 基本信息 -->
<section class="rounded-2xl bg-white border border-gray-100 shadow-sm p-5 md:p-6">
<h3 class="text-sm font-bold text-gray-900 mb-4 flex items-center gap-2">
<Icon name="ph:info" class="w-4 h-4 text-gray-400" /> 基本信息
</h3>
<AdminCard title="基本信息">
<div class="grid grid-cols-1 md:grid-cols-2 gap-5">
<div>
<label class="block text-sm font-semibold text-gray-800 mb-2">
slug<span class="text-red-500">*</span>
</label>
<input
<AdminInput
v-model="form.slug"
type="text"
label="slug"
required
placeholder="如 design-trends-2026"
class="w-full px-3 py-2.5 rounded-lg border border-gray-200 bg-white text-sm outline-none transition-all focus:border-black focus:ring-2 focus:ring-black/5 font-mono"
:error="formError && !/^[a-z0-9-]{2,64}$/.test(form.slug) ? 'slug 需为 2-64 位小写字母/数字/中划线' : ''"
/>
<p class="mt-1 text-xs text-gray-400">2-64 位小写字母 / 数字 / 中划线,用于前台链接</p>
</div>
<div>
<label class="block text-sm font-semibold text-gray-800 mb-2">分类</label>
<select
v-model="form.category"
class="w-full px-3 py-2.5 rounded-lg border border-gray-200 bg-white text-sm outline-none focus:border-black"
>
<option v-for="c in CATEGORIES" :key="c.value" :value="c.value">{{ c.label }}</option>
</select>
</div>
<div>
<label class="block text-sm font-semibold text-gray-800 mb-2">发布日期</label>
<input
v-model="form.date"
type="date"
class="w-full px-3 py-2.5 rounded-lg border border-gray-200 bg-white text-sm outline-none focus:border-black"
/>
</div>
<AdminSelect
v-model="form.category"
label="分类"
:options="CATEGORIES"
/>
<AdminInput v-model="form.date" type="date" label="发布日期" />
<div class="grid grid-cols-2 gap-5">
<div>
<label class="block text-sm font-semibold text-gray-800 mb-2">阅读时长(分钟)</label>
<input
v-model.number="form.readTime"
type="number"
min="1"
class="w-full px-3 py-2.5 rounded-lg border border-gray-200 bg-white text-sm outline-none focus:border-black"
/>
</div>
<div>
<label class="block text-sm font-semibold text-gray-800 mb-2">作者</label>
<input
v-model="form.author"
type="text"
class="w-full px-3 py-2.5 rounded-lg border border-gray-200 bg-white text-sm outline-none focus:border-black"
/>
</div>
<AdminInput
:model-value="String(form.readTime)"
type="number"
label="阅读时长(分钟)"
@update:model-value="form.readTime = Number($event) || 1"
/>
<AdminInput v-model="form.author" label="作者" />
</div>
<div class="md:col-span-2">
<label class="block text-sm font-semibold text-gray-800 mb-2">发布状态</label>
<button
type="button"
class="inline-flex items-center gap-3 group"
@click="form.published = !form.published"
>
<span
class="relative w-11 h-6 rounded-full transition-colors duration-300"
:class="form.published ? 'bg-black' : 'bg-gray-300'"
>
<span
class="absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform duration-300"
:class="form.published ? 'translate-x-5' : ''"
></span>
</span>
<p class="block text-sm font-semibold text-gray-800 mb-1.5">发布状态</p>
<div class="flex items-center gap-3">
<AdminToggle v-model="form.published" />
<span class="text-sm" :class="form.published ? 'text-green-700 font-semibold' : 'text-gray-500'">
{{ form.published ? '已发布(前台可见)' : '草稿(前台隐藏)' }}
</span>
</button>
</div>
</div>
</div>
</section>
</AdminCard>
<!-- 标题与摘要 -->
<section class="rounded-2xl bg-white border border-gray-100 shadow-sm p-5 md:p-6">
<h3 class="text-sm font-bold text-gray-900 mb-4 flex items-center gap-2">
<Icon name="ph:text-aa" class="w-4 h-4 text-gray-400" /> 标题与摘要
</h3>
<AdminCard title="标题与摘要">
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5">
<div class="space-y-4">
<div>
<label class="block text-sm font-semibold text-gray-800 mb-2">
中文标题<span class="text-red-500">*</span>
</label>
<input
v-model="form.titleZh"
type="text"
class="w-full px-3 py-2.5 rounded-lg border border-gray-200 bg-white text-sm outline-none transition-all focus:border-black focus:ring-2 focus:ring-black/5"
/>
</div>
<div>
<label class="block text-sm font-semibold text-gray-800 mb-2">中文摘要</label>
<textarea
v-model="form.excerptZh"
rows="3"
class="w-full px-3 py-2.5 rounded-lg border border-gray-200 bg-white text-sm outline-none transition-all focus:border-black focus:ring-2 focus:ring-black/5 resize-y"
></textarea>
</div>
<AdminInput v-model="form.titleZh" label="中文标题" required />
<AdminTextarea v-model="form.excerptZh" label="中文摘要" :rows="3" />
</div>
<div class="space-y-4">
<div>
<label class="block text-sm font-semibold text-gray-800 mb-2">
English Title<span class="text-red-500">*</span>
</label>
<input
v-model="form.titleEn"
type="text"
class="w-full px-3 py-2.5 rounded-lg border border-gray-200 bg-white text-sm outline-none transition-all focus:border-black focus:ring-2 focus:ring-black/5"
/>
</div>
<div>
<label class="block text-sm font-semibold text-gray-800 mb-2">English Excerpt</label>
<textarea
v-model="form.excerptEn"
rows="3"
class="w-full px-3 py-2.5 rounded-lg border border-gray-200 bg-white text-sm outline-none transition-all focus:border-black focus:ring-2 focus:ring-black/5 resize-y"
></textarea>
</div>
<AdminInput v-model="form.titleEn" label="English Title" required />
<AdminTextarea v-model="form.excerptEn" label="English Excerpt" :rows="3" />
</div>
</div>
</section>
</AdminCard>
<!-- 正文内容 -->
<section class="rounded-2xl bg-white border border-gray-100 shadow-sm p-5 md:p-6">
<h3 class="text-sm font-bold text-gray-900 mb-5 flex items-center gap-2">
<Icon name="ph:article" class="w-4 h-4 text-gray-400" /> 正文内容(中英各一组)
</h3>
<AdminCard title="正文内容(中英各一组)">
<div class="space-y-6">
<AdminBlockEditor v-model="form.contentZh" label="中文正文" />
<AdminBlockEditor v-model="form.contentEn" label="English Content" />
</div>
</section>
</AdminCard>
<!-- 封面图 -->
<section class="rounded-2xl bg-white border border-gray-100 shadow-sm p-5 md:p-6">
<h3 class="text-sm font-bold text-gray-900 mb-4 flex items-center gap-2">
<Icon name="ph:image" class="w-4 h-4 text-gray-400" /> 封面图
</h3>
<AdminCard title="封面图">
<AdminImageUpload v-model="form.image" label="封面图" />
</section>
</AdminCard>
<!-- 提交 -->
<div class="flex items-center justify-end gap-3">
<p v-if="formError" class="mr-auto text-sm text-red-600">{{ formError }}</p>
<button
type="button"
@click="backToList"
class="px-5 py-2.5 rounded-lg border border-gray-200 bg-white text-sm font-semibold text-gray-700 hover:bg-gray-100 transition-colors"
>
取消
</button>
<button
type="button"
:disabled="saving"
@click="save"
class="px-6 py-2.5 rounded-lg bg-black text-white text-sm font-semibold hover:bg-gray-800 transition-colors disabled:opacity-60 inline-flex items-center gap-2"
>
<Icon v-if="saving" name="ph:circle-notch" class="w-4 h-4 animate-spin" />
<AdminButton variant="secondary" @click="backToList">取消</AdminButton>
<AdminButton :loading="saving" @click="save">
{{ saving ? '保存中…' : editingId != null ? '保存修改' : '创建动态' }}
</button>
</AdminButton>
</div>
</div>
</template>
<!-- 删除确认 -->
<AdminConfirmDialog
<AdminConfirm
:open="!!confirmDelete"
:loading="deleting"
title="删除动态"
danger
:message="`确定要删除「${confirmDelete?.titleZh}」吗?该动态下的所有评论将一并删除,此操作不可撤销。`"
confirm-text="删除"
@update:open="confirmDelete = null"
@confirm="doDelete"
@cancel="confirmDelete = null"
/>
</div>
</template>