From 6c8f9b82f123415b9f3e33d1d016dfd6f82e487f Mon Sep 17 00:00:00 2001
From: shinnosuke <tantao@1hoper.com>
Date: 星期四, 06 八月 2026 21:43:37 +0800
Subject: [PATCH] fix(admin): 政策管理改用启用禁用操作 (bug #24048)

---
 talent-card-admin/src/views/TalentArticleManagementView.vue |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/talent-card-admin/src/views/TalentArticleManagementView.vue b/talent-card-admin/src/views/TalentArticleManagementView.vue
index a92ca3d..5c0882b 100644
--- a/talent-card-admin/src/views/TalentArticleManagementView.vue
+++ b/talent-card-admin/src/views/TalentArticleManagementView.vue
@@ -39,10 +39,11 @@
 function editArticle(row: NewsArticle | PolicyArticle) { router.push(isPolicy.value ? `/talent-policy-categories/${row.id}` : `/talent-news-categories/${row.id}`) }
 async function toggleStatus(row: NewsArticle | PolicyArticle) {
   const next = Number(row.status) === 1 ? 2 : 1
-  await ElMessageBox.confirm(next === 1 ? '确认发布该政策吗?' : '确认下架该政策吗?', '操作确认', { type: 'warning' })
+  const action = isPolicy.value ? (next === 1 ? '启用' : '禁用') : (next === 1 ? '发布' : '下架')
+  await ElMessageBox.confirm(`确认${action}该${isPolicy.value ? '政策' : '资讯'}吗?`, '操作确认', { type: 'warning' })
   if (isPolicy.value) await updateAdminPolicyStatus(row.id, next)
   else await updateAdminNewsStatus(row.id, next)
-  ElMessage.success(next === 1 ? (isPolicy.value ? '政策已发布' : '资讯已发布') : (isPolicy.value ? '政策已下架' : '资讯已下架'))
+  ElMessage.success(isPolicy.value ? `政策已${action}` : (next === 1 ? '资讯已发布' : '资讯已下架'))
   await load()
 }
 onMounted(() => void load())
@@ -68,7 +69,7 @@
         <el-table-column label="发布时间" width="170" align="center"><template #default="{ row }">{{ formatTime(row.publishTime) }}</template></el-table-column>
         <el-table-column prop="viewCount" label="观看数" width="100" align="center" />
         <el-table-column label="状态" width="100" align="center"><template #default="{ row }">{{ statusText(row.status) }}</template></el-table-column>
-        <el-table-column label="操作" width="180" align="center"><template #default="{ row }"><el-button link type="primary" @click="toggleStatus(row)">{{ Number(row.status) === 1 ? '下架' : '发布' }}</el-button><el-button link type="primary" @click="editArticle(row)">编辑</el-button></template></el-table-column>
+        <el-table-column label="操作" width="180" align="center"><template #default="{ row }"><el-button link type="primary" @click="toggleStatus(row)">{{ isPolicy ? (Number(row.status) === 1 ? '禁用' : '启用') : (Number(row.status) === 1 ? '下架' : '发布') }}</el-button><el-button link type="primary" @click="editArticle(row)">编辑</el-button></template></el-table-column>
       </el-table>
       <div class="article-management-pagination"><el-pagination v-model:current-page="pagination.page" v-model:page-size="pagination.size" layout="total, prev, pager, next" :total="pagination.total" @current-change="load" /></div>
     </section>

--
Gitblit v1.7.1