fix(projects): 针对技术负债去优化代码
This commit is contained in:
@@ -684,10 +684,11 @@ async function confirmDeleteExecution(payload: { name: string; confirmText: stri
|
||||
confirmText: payload.confirmText,
|
||||
reason: payload.reason
|
||||
});
|
||||
if (error) return;
|
||||
window.$message?.success('删除成功');
|
||||
// 成功=正常删除;失败=多为打开弹层后对象被并发改状态/删除,错误文案由全局 onError 弹 Toast。
|
||||
// 两种情况都关弹层 + 刷新:失败也要让用户离开已失效的弹层、看到最新数据。
|
||||
deleteDialogVisible.value = false;
|
||||
selectedExecution.value = null;
|
||||
if (!error) window.$message?.success('删除成功');
|
||||
// 删执行 → 执行集合 -1,视角 chip + 任务 scope/cross counts 都要刷
|
||||
await Promise.all([
|
||||
reloadExecutionData(1),
|
||||
|
||||
@@ -6,6 +6,7 @@ import BusinessFormSection from '@/components/custom/business-form-section.vue';
|
||||
import BusinessRichTextEditor from '@/components/custom/business-rich-text-editor.vue';
|
||||
import BusinessUserSelect from '@/components/custom/business-user-select.vue';
|
||||
import DictSelect from '@/components/custom/dict-select.vue';
|
||||
import { SHOW_TASK_PARENT_FIELD } from '../shared';
|
||||
|
||||
defineOptions({ name: 'ProjectExecutionTaskInfoReadonly' });
|
||||
|
||||
@@ -53,7 +54,7 @@ const parentTaskOptions = computed(() => {
|
||||
<ElFormItem label="任务类型">
|
||||
<DictSelect :model-value="taskType" :dict-code="RDMS_TASK_ITEM_TYPE_DICT_CODE" disabled placeholder="--" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="父任务">
|
||||
<ElFormItem v-if="SHOW_TASK_PARENT_FIELD" label="父任务">
|
||||
<ElSelect :model-value="parentTaskId" disabled clearable filterable class="w-full" placeholder="无">
|
||||
<ElOption v-for="item in parentTaskOptions" :key="item.id" :label="item.taskTitle" :value="item.id" />
|
||||
</ElSelect>
|
||||
|
||||
@@ -10,6 +10,8 @@ import BusinessFormSection from '@/components/custom/business-form-section.vue';
|
||||
import BusinessRichTextEditor from '@/components/custom/business-rich-text-editor.vue';
|
||||
import BusinessUserSelect from '@/components/custom/business-user-select.vue';
|
||||
import DictSelect from '@/components/custom/dict-select.vue';
|
||||
import { SHOW_TASK_PARENT_FIELD } from '../shared';
|
||||
|
||||
defineOptions({ name: 'ProjectExecutionTaskOperateDialog' });
|
||||
|
||||
type OperateMode = 'create' | 'edit';
|
||||
@@ -342,7 +344,7 @@ defineExpose({
|
||||
/>
|
||||
</ElFormItem>
|
||||
|
||||
<ElFormItem label="父任务">
|
||||
<ElFormItem v-if="SHOW_TASK_PARENT_FIELD" label="父任务">
|
||||
<ElSelect v-model="model.parentTaskId" clearable filterable class="w-full" placeholder="请选择父任务">
|
||||
<ElOption
|
||||
v-for="item in selectableParentTasks"
|
||||
|
||||
@@ -4,7 +4,13 @@ import type { PaginationProps } from 'element-plus';
|
||||
import { RDMS_REQ_PRIORITY_DICT_CODE } from '@/constants/dict';
|
||||
import { useAuthStore } from '@/store/modules/auth';
|
||||
import DictTag from '@/components/custom/dict-tag.vue';
|
||||
import { formatDate, formatDateRange, getTaskStatusName, getTaskStatusTagType } from '../shared';
|
||||
import {
|
||||
SHOW_TASK_PARENT_FIELD,
|
||||
formatDate,
|
||||
formatDateRange,
|
||||
getTaskStatusName,
|
||||
getTaskStatusTagType
|
||||
} from '../shared';
|
||||
import { useTaskActions } from '../composables/use-task-actions';
|
||||
|
||||
defineOptions({ name: 'ProjectExecutionTaskTableView' });
|
||||
@@ -141,7 +147,12 @@ function handleSizeChange(pageSize: number) {
|
||||
<ElTableColumn v-if="!crossExecutionMode" label="负责人" min-width="120" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.ownerNickname || row.ownerId || '--' }}</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn v-if="!crossExecutionMode" label="父任务" min-width="140" show-overflow-tooltip>
|
||||
<ElTableColumn
|
||||
v-if="!crossExecutionMode && SHOW_TASK_PARENT_FIELD"
|
||||
label="父任务"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ getParentTaskLabel(row.parentTaskId) }}</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="进度" width="160">
|
||||
|
||||
@@ -696,10 +696,11 @@ async function confirmDeleteTask(payload: { name: string; confirmText: string; r
|
||||
confirmText: payload.confirmText,
|
||||
reason: payload.reason
|
||||
});
|
||||
if (error) return;
|
||||
window.$message?.success('删除成功');
|
||||
// 成功=正常删除;失败=多为打开弹层后对象被并发改状态/删除,错误文案由全局 onError 弹 Toast。
|
||||
// 两种情况都关弹层 + 刷新列表:失败也要让用户离开已失效的弹层、看到最新数据。
|
||||
deleteTaskDialogVisible.value = false;
|
||||
deleteTaskTarget.value = null;
|
||||
if (!error) window.$message?.success('删除成功');
|
||||
await Promise.all([refreshTableData(), loadTaskStatusBoard()]);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,13 @@ type ExecutionStatusCode = Api.Project.ProjectExecutionStatusCode;
|
||||
type TaskStatusCode = Api.Project.ProjectTaskStatusCode;
|
||||
type ExecutionAssigneeActionType = Api.Project.ExecutionAssigneeActionType;
|
||||
|
||||
/**
|
||||
* 是否在任务界面展示「父任务」相关露出(表格列 / 新建编辑下拉 / 详情只读字段)。
|
||||
* 当前业务经执行分层后极少有子任务需求,暂统一隐藏,使任务呈扁平的一级任务列表;
|
||||
* 底层父子数据与级联完成逻辑保留不动,将来恢复子任务功能改回 true 即可。
|
||||
*/
|
||||
export const SHOW_TASK_PARENT_FIELD = false;
|
||||
|
||||
export const executionAssigneeActionNameMap: Record<ExecutionAssigneeActionType, string> = {
|
||||
join: '加入',
|
||||
inactive: '失效',
|
||||
|
||||
Reference in New Issue
Block a user