From a650f6e96d3ea6568e30bf94b1059e6f1a2bfc75 Mon Sep 17 00:00:00 2001 From: dk <1260500659@qq.com> Date: Tue, 30 Jun 2026 11:55:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=88=91=E7=9A=84=E4=BA=8B=E9=A1=B9?= =?UTF-8?q?=E3=80=81=E4=BA=A7=E5=93=81/=E9=A1=B9=E7=9B=AE=E3=80=81?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=E6=88=91=E7=9A=84=E5=BE=85=E5=8A=9E?= =?UTF-8?q?):=20=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/personal-center/my-item/index.vue | 86 +++++---- .../personal-item-bind-execution-dialog.vue | 181 ++++++++++++++---- .../modules/personal-item-detail-dialog.vue | 2 +- .../modules/personal-item-operate-dialog.vue | 6 +- src/views/project/list/index.vue | 4 +- .../execution/composables/use-task-actions.ts | 4 +- src/views/project/project/execution/index.vue | 8 +- .../composables/use-workbench-colors.ts | 2 +- src/views/workbench/homepage.ts | 12 +- .../workbench/modules/workbench-team-load.vue | 2 +- .../modules/workbench-todo-panel.vue | 175 +++++++++++++++-- 11 files changed, 373 insertions(+), 109 deletions(-) diff --git a/src/views/personal-center/my-item/index.vue b/src/views/personal-center/my-item/index.vue index 74736d4..73a7295 100644 --- a/src/views/personal-center/my-item/index.vue +++ b/src/views/personal-center/my-item/index.vue @@ -255,9 +255,9 @@ function openView(row: Api.PersonalItem.PersonalItem) { function buildRowActions(row: Api.PersonalItem.PersonalItem): PersonalItemRowAction[] { currentStatusItem.value = row; + const isCompleted = row.statusCode === 'completed'; const rawLifecycleActions = [...(row.availableActions ?? [])]; const pauseAction = rawLifecycleActions.find(action => action.actionCode === 'pause') ?? null; - const cancelAction = rawLifecycleActions.find(action => action.actionCode === 'cancel') ?? null; const completeAction = rawLifecycleActions.find(action => action.actionCode === 'complete') ?? null; const lifecycleActions = rawLifecycleActions @@ -292,26 +292,30 @@ function buildRowActions(row: Api.PersonalItem.PersonalItem): PersonalItemRowAct openOperateDialog(); } }, - { - key: 'delete', - tooltip: '删除', - icon: markRaw(IconMdiDeleteOutline), - type: 'danger', - onClick: async () => handleDelete(row) - }, - { - key: 'status-pause', - tooltip: pauseAction?.actionName ?? '暂停', - icon: markRaw(IconMdiPause), - type: 'warning', - disabled: !pauseAction, - onClick: async () => - handleStatusAction(row, { - actionCode: pauseAction?.actionCode ?? 'pause', - actionName: pauseAction?.actionName ?? '暂停', - needReason: pauseAction?.needReason ?? false - }) - }, + ...(!isCompleted + ? ([ + { + key: 'delete', + tooltip: '删除', + icon: markRaw(IconMdiDeleteOutline), + type: 'danger', + onClick: async () => handleDelete(row) + }, + { + key: 'status-pause', + tooltip: pauseAction?.actionName ?? '暂停', + icon: markRaw(IconMdiPause), + type: 'warning', + disabled: !pauseAction, + onClick: async () => + handleStatusAction(row, { + actionCode: pauseAction?.actionCode ?? 'pause', + actionName: pauseAction?.actionName ?? '暂停', + needReason: pauseAction?.needReason ?? false + }) + } + ] satisfies PersonalItemRowAction[]) + : []), // { // key: 'status-cancel', // tooltip: cancelAction?.actionName ?? '取消', @@ -326,19 +330,23 @@ function buildRowActions(row: Api.PersonalItem.PersonalItem): PersonalItemRowAct // }) // }, ...lifecycleActions, - { - key: 'status-complete', - tooltip: completeAction?.actionName ?? '完成', - icon: markRaw(IconMdiCheckCircleOutline), - type: 'success', - disabled: !completeAction, - onClick: async () => - handleStatusAction(row, { - actionCode: completeAction?.actionCode ?? 'complete', - actionName: completeAction?.actionName ?? '完成', - needReason: completeAction?.needReason ?? false - }) - } + ...(!isCompleted + ? ([ + { + key: 'status-complete', + tooltip: completeAction?.actionName ?? '完成', + icon: markRaw(IconMdiCheckCircleOutline), + type: 'success', + disabled: !completeAction, + onClick: async () => + handleStatusAction(row, { + actionCode: completeAction?.actionCode ?? 'complete', + actionName: completeAction?.actionName ?? '完成', + needReason: completeAction?.needReason ?? false + }) + } + ] satisfies PersonalItemRowAction[]) + : []) ]; } @@ -452,7 +460,7 @@ async function handleStatusActionSubmit(reason: string | null) { async function handleDelete(row: Api.PersonalItem.PersonalItem) { try { - await ElMessageBox.confirm(`确定删除个人事项“${row.taskTitle}”吗?`, '删除确认', { + await ElMessageBox.confirm(`确定删除我的事项“${row.taskTitle}”吗?`, '删除确认', { type: 'warning', confirmButtonText: '确定', cancelButtonText: '取消' @@ -473,12 +481,12 @@ async function handleDelete(row: Api.PersonalItem.PersonalItem) { async function handleBatchDelete() { if (!checkedRowIds.value.length) { - window.$message?.warning('请先选择个人事项'); + window.$message?.warning('请先选择我的事项'); return; } try { - await ElMessageBox.confirm(`确定删除选中的 ${selectedCount.value} 条个人事项吗?`, '删除确认', { + await ElMessageBox.confirm(`确定删除选中的 ${selectedCount.value} 条我的事项吗?`, '删除确认', { type: 'warning', confirmButtonText: '确定', cancelButtonText: '取消' @@ -500,7 +508,7 @@ async function handleBatchDelete() { function handleOpenBindExecution() { if (!checkedRowIds.value.length) { - window.$message?.warning('请先选择个人事项'); + window.$message?.warning('请先选择我的事项'); return; } @@ -541,7 +549,7 @@ onActivated(() => {