fix(我的事项、产品/项目、工作台我的待办): 修复已知的一些问题。

This commit is contained in:
dk
2026-06-30 11:55:43 +08:00
parent 4f357a35a9
commit a650f6e96d
11 changed files with 373 additions and 109 deletions

View File

@@ -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(() => {
<template #header>
<div class="flex items-center justify-between gap-12px">
<div class="flex items-center gap-10px">
<p>个人事项</p>
<p>我的事项</p>
<ElTag effect="plain">{{ mobilePagination.total || data.length }}</ElTag>
</div>
<TableHeaderOperation v-model:columns="columnChecks" :loading="loading" @refresh="reloadTable">