feat(mes): 优化任务名称构建逻辑,支持数量动态更新

重构任务名称构建逻辑,使用独立方法生成任务名称,确保在创建和更新任务时数量信息正确显示。更新甘特图配置,允许在编辑状态下拖动和调整任务持续时间,提升用户交互体验。
pull/871/MERGE
YunaiV 2026-03-17 09:51:48 +08:00
parent 0a0cd5f165
commit 5418806b9f
3 changed files with 13 additions and 4 deletions

View File

@ -140,6 +140,7 @@
:route-id="currentRouteId" :route-id="currentRouteId"
:process-id="rp.processId" :process-id="rp.processId"
:item-id="formData.productId!" :item-id="formData.productId!"
:disabled="formType === 'detail'"
/> />
</el-card> </el-card>
<template #footer> <template #footer>

View File

@ -51,6 +51,7 @@ const initGantt = () => {
gantt.i18n.setLocale('cn') gantt.i18n.setLocale('cn')
// //
gantt.config.readonly = props.readonly
gantt.config.date_format = '%Y-%m-%d %H:%i:%s' gantt.config.date_format = '%Y-%m-%d %H:%i:%s'
gantt.config.duration_unit = 'hour' // 使 duration_step gantt.config.duration_unit = 'hour' // 使 duration_step
gantt.config.duration_step = 8 // 1 = 8 gantt.config.duration_step = 8 // 1 = 8
@ -64,8 +65,8 @@ const initGantt = () => {
gantt.config.show_progress = true // KTG gantt progress gantt.config.show_progress = true // KTG gantt progress
gantt.config.open_tree_initially = true // KTG open_tree_initially = true gantt.config.open_tree_initially = true // KTG open_tree_initially = true
gantt.config.auto_types = false // projectKTG auto_types = false gantt.config.auto_types = false // projectKTG auto_types = false
gantt.config.drag_move = false // gantt.config.drag_move = !props.readonly //
gantt.config.drag_resize = false // gantt.config.drag_resize = !props.readonly //
gantt.config.drag_progress = false // gantt.config.drag_progress = false //
// lightbox // lightbox
@ -144,8 +145,13 @@ const initGantt = () => {
if (!props.readonly) { if (!props.readonly) {
gantt.attachEvent('onAfterTaskUpdate', (id: string | number) => { gantt.attachEvent('onAfterTaskUpdate', (id: string | number) => {
const task = gantt.getTask(id) const task = gantt.getTask(id)
// task (project)
if (task.type !== gantt.config.types.task || !task.originalId) {
return
}
// task-update
emit('task-update', { emit('task-update', {
id: task.originalId || id, id: task.originalId,
startTime: task.start_date, startTime: task.start_date,
endTime: task.end_date, endTime: task.end_date,
duration: task.duration duration: task.duration

View File

@ -2,7 +2,9 @@
<template> <template>
<ContentWrap> <ContentWrap>
<div class="mb-10px flex items-center justify-between"> <div class="mb-10px flex items-center justify-between">
<span class="text-14px text-gray-500">双击任务条可编辑开始时间和时长修改后点击"批量保存"</span> <span class="text-14px text-gray-500">
可直接拖拽/拉伸任务条或双击编辑开始时间和时长修改后点击"批量保存"
</span>
<div> <div>
<el-badge :value="pendingCount" :hidden="pendingCount === 0" class="mr-10px"> <el-badge :value="pendingCount" :hidden="pendingCount === 0" class="mr-10px">
<el-button <el-button