Browse Source

人才标注:删除列表项

Xiao_123 1 week ago
parent
commit
c27ed99288
1 changed files with 18 additions and 1 deletions
  1. 18 1
      src/views/menduner/system/talentMap/maintenance/labeling/index.vue

+ 18 - 1
src/views/menduner/system/talentMap/maintenance/labeling/index.vue

@@ -60,7 +60,8 @@
       <el-table-column label="操作" align="center">
         <template #default="scope">
           <el-button link type="primary" @click="openForm(scope.row)">标注</el-button>
-          <el-button v-if="scope.row.status === 'active'" link type="danger" @click="handleAction(scope.row.id, 'inactive')">禁用</el-button>
+          <el-button link type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
+          <el-button v-if="scope.row.status === 'active'" link type="warning" @click="handleAction(scope.row.id, 'inactive')">禁用</el-button>
           <el-button v-if="scope.row.status === 'inactive'" link type="success" @click="handleAction(scope.row.id, 'active')">启用</el-button>
         </template>
       </el-table-column>
@@ -85,6 +86,7 @@ const queryParams = reactive({
 const queryFormRef = ref() // 搜索的表单
 
 const message = useMessage() // 消息弹窗
+const { t } = useI18n() // 国际化
 
 /** 查询列表 */
 const getList = async () => {
@@ -116,6 +118,21 @@ const resetQuery = () => {
   // handleQuery()
 }
 
+/** 删除按钮操作 */
+const handleDelete = async (id) => {
+  try {
+    // 删除的二次确认
+    await message.delConfirm()
+    // 发起删除
+    await talentLabelingApi.deleteBusinessCard(id)
+    message.success(t('common.delSuccess'))
+    // 刷新列表
+    setTimeout(async () => {
+      await getList()
+    }, 0)
+  } catch {}
+}
+
 /** 禁用、启用按钮操作 */
 const handleAction = async (id: number, status: string) => {
   try {