From ca5df39656cd320dc90dea0f5b472afced8ab500 Mon Sep 17 00:00:00 2001
From: shinnosuke <tantao@1hoper.com>
Date: 星期四, 06 八月 2026 21:46:05 +0800
Subject: [PATCH] fix(admin): 资讯管理改用启用禁用操作 (bug #24036)

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

diff --git a/talent-card-admin/src/views/TalentArticleManagementView.vue b/talent-card-admin/src/views/TalentArticleManagementView.vue
index 12cdb10..4cc68a4 100644
--- a/talent-card-admin/src/views/TalentArticleManagementView.vue
+++ b/talent-card-admin/src/views/TalentArticleManagementView.vue
@@ -36,11 +36,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
-  const action = isPolicy.value ? (next === 1 ? '启用' : '禁用') : (next === 1 ? '发布' : '下架')
+  const action = 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(isPolicy.value ? `政策已${action}` : (next === 1 ? '资讯已发布' : '资讯已下架'))
+  ElMessage.success(`${isPolicy.value ? '政策' : '资讯'}已${action}`)
   await load()
 }
 onMounted(() => void load())
@@ -66,7 +66,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)">{{ 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-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>
       <div class="article-management-pagination"><el-pagination v-model:current-page="pagination.page" v-model:page-size="pagination.size" background layout="total, sizes, prev, pager, next" :page-sizes="[10, 20, 50]" :total="pagination.total" @change="load" /></div>
     </section>

--
Gitblit v1.7.1