feat(requirement): 优化需求标题列的交互体验
feat(project): 新增执行阶段需求选项获取接口 feat(membership): 优化项目负责人选项加载逻辑 fix(task): 优化任务操作按钮的显示逻辑 feat(todo): 优化待办任务截止时间显示
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { type Component, computed, markRaw, onActivated, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import dayjs from 'dayjs';
|
||||
import type { RouteKey } from '@elegant-router/types';
|
||||
import { OBJECT_CONTEXT_QUERY_KEY } from '@/constants/object-context';
|
||||
import { RDMS_REQ_PRIORITY_DICT_CODE } from '@/constants/dict';
|
||||
@@ -251,6 +252,16 @@ const TASK_ACTION_ICONS: Partial<Record<Api.Project.ProjectTaskActionCode, Compo
|
||||
cancel: markRaw(IconMdiCloseCircleOutline)
|
||||
};
|
||||
|
||||
function normalizeTaskTodoDeadline(deadline: string | null) {
|
||||
if (!deadline) return null;
|
||||
|
||||
if (/^\d{4}-\d{2}-\d{2}$/.test(deadline)) {
|
||||
return dayjs(deadline).endOf('day').format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
|
||||
return deadline;
|
||||
}
|
||||
|
||||
function getTaskActionButtonType(code: Api.Project.ProjectTaskActionCode) {
|
||||
if (code === 'complete') return 'success' as const;
|
||||
if (code === 'cancel') return 'danger' as const;
|
||||
@@ -820,7 +831,7 @@ async function loadMyTaskItems() {
|
||||
category: 'task' as const,
|
||||
title: task.taskTitle,
|
||||
createdTime: task.createTime,
|
||||
deadline: task.plannedEndDate,
|
||||
deadline: normalizeTaskTodoDeadline(task.plannedEndDate),
|
||||
source: task.projectName,
|
||||
progressRate: task.progressRate,
|
||||
priority: mapTaskTodoPriority(task.priority),
|
||||
|
||||
Reference in New Issue
Block a user