Skip to content

Commit 0c317b1

Browse files
committed
v1.4.0 - new features
1 parent 8114778 commit 0c317b1

27 files changed

+159
-5459
lines changed

CONTRIBUTORS-EN.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ Example:
3434
- **Main Contributions**: added language support for task tooltip
3535
- **Participation Period**: 2025-08
3636

37+
<img src="https://foruda.gitee.com/avatar/1676904209687527903/139467_qiuchengw_1578919251.jpg!avatar200" alt="" width="32" style="vertical-align:middle;margin-right:8px;" />[秋成](https://gitee.com/qiuchengw)
38+
- **Contribution Type**: Code
39+
- **Main Contributions**: Configurable TaskList; TaskContent slot; Collapse/expand all; Time-based sorting; Component optimizations
40+
- **Participation Period**: 2025-09
41+
3742
## 📊 Contribution Statistics
3843

3944
### Code Contributions

CONTRIBUTORS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
- **主要贡献**: 任务Tooltip语言增强
3434
- **参与时间**: 2025-08
3535

36+
<img src="https://foruda.gitee.com/avatar/1676904209687527903/139467_qiuchengw_1578919251.jpg!avatar200" alt="" width="32" style="vertical-align:middle;margin-right:8px;" />[秋成](https://gitee.com/qiuchengw)
37+
- **贡献类型**: 代码开发
38+
- **主要贡献**: TaskList可配置;TaskContent插槽;全部收起/展开;按照时间排序;优化组件
39+
- **参与时间**: 2025-09
40+
3641

3742
## 📊 贡献统计
3843

demo/App.vue

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ const toolbarConfig = {
3939
showTheme: true,
4040
showFullscreen: true,
4141
showTimeScale: true, // 控制日|周|月时间刻度按钮组的可见性
42-
timeScaleDimensions: ['day', 'week', 'month', 'quarter', 'year'], // 设置时间刻度按钮的展示维度,包含所有时间维度
42+
timeScaleDimensions: ['hour', 'day', 'week', 'month', 'quarter', 'year'], // 设置时间刻度按钮的展示维度,包含所有时间维度
4343
defaultTimeScale: 'week',
4444
showExpandCollapse: true, // 显示全部展开/折叠按钮
4545
}
4646
4747
// TaskList列配置
4848
const availableColumns = ref<TaskListColumnConfig[]>([
49-
// { key: 'predecessor', label: '前置任务', visible: true },
50-
// { key: 'assignee', label: '负责人', visible: true },
49+
{ key: 'predecessor', label: '前置任务', visible: true },
50+
{ key: 'assignee', label: '负责人', visible: true },
5151
{ key: 'startDate', label: '开始日期', visible: true },
52-
// { key: 'endDate', label: '结束日期', visible: true },
53-
// { key: 'estimatedHours', label: '预估工时', visible: true },
54-
// { key: 'actualHours', label: '实际工时', visible: true },
55-
// { key: 'progress', label: '进度', visible: true },
52+
{ key: 'endDate', label: '结束日期', visible: true },
53+
{ key: 'estimatedHours', label: '预估工时', visible: true },
54+
{ key: 'actualHours', label: '实际工时', visible: true },
55+
{ key: 'progress', label: '进度', visible: true },
5656
])
5757
5858
// TaskList宽度配置
@@ -172,14 +172,14 @@ const handleMilestoneDelete = async (milestoneId: number) => {
172172
window.dispatchEvent(
173173
new CustomEvent('milestone-deleted', {
174174
detail: { milestoneId },
175-
})
175+
}),
176176
)
177177
178178
// 触发强制更新事件,确保Timeline重新渲染
179179
window.dispatchEvent(
180180
new CustomEvent('milestone-data-changed', {
181181
detail: { milestones: milestones.value },
182-
})
182+
}),
183183
)
184184
}
185185
@@ -273,7 +273,7 @@ const handleTaskUpdate = (updatedTask: Task) => {
273273
showMessage(
274274
formatTranslation('newParentTaskNotFound', { parentId: taskToAdd.parentId }),
275275
'warning',
276-
{ closable: true }
276+
{ closable: true },
277277
)
278278
tasks.value.push(taskToAdd)
279279
}
@@ -321,7 +321,7 @@ const handleTaskAdd = (newTask: Task) => {
321321
const maxId = Math.max(
322322
...tasks.value.map(t => t.id || 0),
323323
...milestones.value.map(m => m.id || 0),
324-
0
324+
0,
325325
)
326326
newTask.id = maxId + 1
327327
}
@@ -416,7 +416,7 @@ const handleStoryDeleteWithChildren = (storyToDelete: Task) => {
416416
'success',
417417
{
418418
closable: false,
419-
}
419+
},
420420
)
421421
return true
422422
}
@@ -478,7 +478,7 @@ const handleStoryDeleteOnly = (storyToDelete: Task) => {
478478
'success',
479479
{
480480
closable: false,
481-
}
481+
},
482482
)
483483
return true
484484
}
@@ -552,7 +552,7 @@ function handleTaskbarDragOrResizeEnd(newTask) {
552552
`开始: ${oldTask.startDate} → ${newTask.startDate}\n` +
553553
`结束: ${oldTask.endDate} → ${newTask.endDate}`,
554554
'info',
555-
{ closable: true }
555+
{ closable: true },
556556
)
557557
}
558558
function handleMilestoneDragEnd(newMilestone) {
@@ -562,7 +562,7 @@ function handleMilestoneDragEnd(newMilestone) {
562562
`里程碑【${newMilestone.name}】\n` +
563563
`开始: ${oldMilestone.endDate} → ${newMilestone.startDate}`,
564564
'info',
565-
{ closable: true }
565+
{ closable: true },
566566
)
567567
}
568568
@@ -629,7 +629,7 @@ function onTimerStarted(task: Task) {
629629
showMessage(
630630
`Demo 任务【${task.name}】\n开始计时:${new Date(task.timerStartTime).toLocaleString()}\n计时说明:${task.timerStartDesc ? task.timerStartDesc : ''}`,
631631
'info',
632-
{ closable: true }
632+
{ closable: true },
633633
)
634634
}
635635
function onTimerStopped(task: Task) {
@@ -645,7 +645,7 @@ function onTimerStopped(task: Task) {
645645
}
646646
647647
function taskDebug(item: any) {
648-
console.log('Task Debug:', item)
648+
//console.log('Task Debug:', item)
649649
}
650650
</script>
651651

@@ -694,7 +694,7 @@ function taskDebug(item: any) {
694694
>
695695
<path d="M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z" fill="currentColor" />
696696
</svg>
697-
TaskList 配置
697+
{{ t.taskListConfig.title }}
698698
</h3>
699699
<button class="collapse-button" :class="{ collapsed: isConfigPanelCollapsed }">
700700
<svg
@@ -742,11 +742,11 @@ function taskDebug(item: any) {
742742
fill="none"
743743
/>
744744
</svg>
745-
宽度设置
745+
{{ t.taskListConfig.width.title }}
746746
</h4>
747747
<div class="width-controls">
748748
<div class="width-control">
749-
<label class="width-label">默认宽度:</label>
749+
<label class="width-label">{{ t.taskListConfig.width.defaultWidth }}:</label>
750750
<input
751751
v-model.number="taskListWidth.defaultWidth"
752752
type="number"
@@ -758,7 +758,7 @@ function taskDebug(item: any) {
758758
<span class="width-unit">px</span>
759759
</div>
760760
<div class="width-control">
761-
<label class="width-label">最小宽度:</label>
761+
<label class="width-label">{{ t.taskListConfig.width.minWidth }}:</label>
762762
<input
763763
v-model.number="taskListWidth.minWidth"
764764
type="number"
@@ -770,7 +770,7 @@ function taskDebug(item: any) {
770770
<span class="width-unit">px</span>
771771
</div>
772772
<div class="width-control">
773-
<label class="width-label">最大宽度:</label>
773+
<label class="width-label">{{ t.taskListConfig.width.maxWidth }}:</label>
774774
<input
775775
v-model.number="taskListWidth.maxWidth"
776776
type="number"
@@ -795,7 +795,7 @@ function taskDebug(item: any) {
795795
>
796796
<path d="M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z" fill="currentColor" />
797797
</svg>
798-
列显示
798+
{{ t.taskListConfig.columns.title }}
799799
</h4>
800800
<div class="column-controls">
801801
<label v-for="column in availableColumns" :key="column.key" class="column-control">
@@ -804,7 +804,7 @@ function taskDebug(item: any) {
804804
:checked="column.visible"
805805
@change="toggleColumn(column.key, $event)"
806806
/>
807-
<span class="column-label">{{ column.label }}</span>
807+
<span class="column-label">{{ (t as any)[column.key] || column.label }}</span>
808808
</label>
809809
</div>
810810
</div>
@@ -850,7 +850,12 @@ function taskDebug(item: any) {
850850
@task-updated="e => showMessage(`Demo 任务[${e.task.name}] 已更新`, 'info')"
851851
>
852852
<template #custom-task-content="item">
853-
<HtmlContent :item="taskDebug(item)" :task="item.task" :type="item.type" />
853+
<HtmlContent
854+
:item="taskDebug(item)"
855+
:task="item.task"
856+
:type="item.type"
857+
:style="item.dynamicStyles"
858+
/>
854859
</template>
855860
</GanttChart>
856861
</div>
@@ -1022,7 +1027,7 @@ function taskDebug(item: any) {
10221027
}
10231028
10241029
.width-label {
1025-
flex: 0 0 80px;
1030+
flex: 0 0 100px;
10261031
font-size: 13px;
10271032
color: var(--text-secondary);
10281033
}

demo/HtmlContent.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
import type { Task } from '../src/models/Task'
33
44
interface Props {
5-
task: Task,
6-
type: string, // 'task-row' | 'task-bar'
5+
task: Task
6+
type: string // 'task-row' | 'task-bar'
77
}
8-
const props = withDefaults(defineProps<Props>(), {
9-
})
8+
const props = withDefaults(defineProps<Props>(), {})
109
// console.error('props', props)
1110
</script>
1211

1312
<template>
1413
<div class="html-content-card">
15-
<div v-if="type==='task-row'" class="task-row" v-html="task.name" />
16-
<div v-else-if="type==='task-bar'" class="task-bar" v-html="task.name" />
14+
<div v-if="props.type === 'task-row'" class="task-row" v-html="props.task.name" />
15+
<div v-else-if="props.type === 'task-bar'" class="task-bar" v-html="props.task.name" />
1716
</div>
1817
</template>
1918

@@ -31,7 +30,6 @@ const props = withDefaults(defineProps<Props>(), {
3130
3231
.task-bar {
3332
flex: 1;
34-
padding: 0 4px;
3533
overflow: hidden;
3634
text-overflow: ellipsis;
3735
white-space: nowrap;

demo/VersionHistoryDrawer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ onMounted(async () => {
4646
</div>
4747
<div class="version-timeline-content version-card">
4848
<ul class="version-notes">
49-
<li v-for="(note, nidx) in item.notes" :key="nidx">{{ note }}</li>
49+
<li v-for="(note, nidx) in item.notes" :key="nidx" v-html="note"></li>
5050
</ul>
5151
</div>
5252
</div>

demo/version-history.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,31 @@
190190
"SonarQube代码质量检查问题修改",
191191
"SonarQube code quality inspection issue modification"
192192
]
193+
},
194+
{
195+
"version": "1.4.0",
196+
"date": "2025-10-11",
197+
"notes": [
198+
"Timeline Scale客制化",
199+
"Timeline Scale Customization",
200+
"TaskList可配置",
201+
"TaskList Configurable",
202+
"TaskRow/TaskBar内容支持HTML插槽",
203+
"TaskRow/TaskBar content supports HTML slots",
204+
"TaskRow/TaskBar支持自定义样式",
205+
"TaskRow/TaskBar supports custom styles",
206+
"增加全部展开/收起按钮",
207+
"按照时间排序TaskList",
208+
"Sort TaskList by time",
209+
"增加周视图的1号旗帜元素",
210+
"Add 1st flag element for weekly view",
211+
"Add Expand/Collapse All Button",
212+
"SonarQube代码质量检查问题修改",
213+
"SonarQube code quality inspection issue modification",
214+
"修复缺陷",
215+
"Bugfix",
216+
"<span style=\"font-weight: bold; color: #f00;\">特别感谢贡献者 @qiuchengw</span>",
217+
"<span style=\"font-weight: bold; color: #f00;\">Special thanks to contributor @qiuchengw</span>"
218+
]
193219
}
194220
]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jordium-gantt-vue3",
3-
"version": "1.3.2",
3+
"version": "1.4.0",
44
"type": "module",
55
"main": "dist/jordium-gantt-vue3.cjs.js",
66
"module": "dist/jordium-gantt-vue3.es.js",

0 commit comments

Comments
 (0)