v1.4.2 - bugfix 更新子Task后无限创建的问题
This commit is contained in:
@@ -142,6 +142,7 @@ const formData = reactive<Task>({
|
|||||||
timerStartTime: undefined, // 计时器开始时间
|
timerStartTime: undefined, // 计时器开始时间
|
||||||
timerEndTime: undefined, // 计时器结束时间
|
timerEndTime: undefined, // 计时器结束时间
|
||||||
timerElapsedTime: 0, // 计时器已用时间
|
timerElapsedTime: 0, // 计时器已用时间
|
||||||
|
children: undefined, // 子任务列表
|
||||||
})
|
})
|
||||||
|
|
||||||
// 任务列表数据
|
// 任务列表数据
|
||||||
@@ -392,6 +393,7 @@ const resetForm = () => {
|
|||||||
timerStartTime: undefined,
|
timerStartTime: undefined,
|
||||||
timerEndTime: undefined,
|
timerEndTime: undefined,
|
||||||
timerElapsedTime: 0,
|
timerElapsedTime: 0,
|
||||||
|
children: undefined,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 清除错误信息
|
// 清除错误信息
|
||||||
|
|||||||
@@ -729,8 +729,6 @@ const getCachedTimelineData = (): unknown => {
|
|||||||
// 获取虚拟滚动优化后的时间轴数据
|
// 获取虚拟滚动优化后的时间轴数据
|
||||||
const optimizedTimelineData = computed(() => {
|
const optimizedTimelineData = computed(() => {
|
||||||
const cachedData = getCachedTimelineData() as any
|
const cachedData = getCachedTimelineData() as any
|
||||||
// TODO 测试后删除
|
|
||||||
console.log('optimizedTimelineData - cachedData: ', cachedData)
|
|
||||||
// 只在小时视图中应用虚拟滚动
|
// 只在小时视图中应用虚拟滚动
|
||||||
if (currentTimeScale.value === TimelineScale.HOUR && Array.isArray(cachedData)) {
|
if (currentTimeScale.value === TimelineScale.HOUR && Array.isArray(cachedData)) {
|
||||||
const { startHour, endHour } = visibleHourRange.value
|
const { startHour, endHour } = visibleHourRange.value
|
||||||
@@ -776,8 +774,6 @@ const optimizedTimelineData = computed(() => {
|
|||||||
// 计算完整时间线的总宽度(用于虚拟滚动容器)
|
// 计算完整时间线的总宽度(用于虚拟滚动容器)
|
||||||
const totalTimelineWidth = computed(() => {
|
const totalTimelineWidth = computed(() => {
|
||||||
const cachedData = getCachedTimelineData() as any
|
const cachedData = getCachedTimelineData() as any
|
||||||
// TODO 测试后删除
|
|
||||||
console.log('totalTimelineWidth - cachedData: ', cachedData)
|
|
||||||
if (currentTimeScale.value === TimelineScale.HOUR) {
|
if (currentTimeScale.value === TimelineScale.HOUR) {
|
||||||
if (Array.isArray(cachedData)) {
|
if (Array.isArray(cachedData)) {
|
||||||
// 计算总小时数
|
// 计算总小时数
|
||||||
@@ -800,8 +796,6 @@ const totalTimelineWidth = computed(() => {
|
|||||||
const totalWeeks = cachedData.reduce((total, month: { weeks?: unknown[] }) => {
|
const totalWeeks = cachedData.reduce((total, month: { weeks?: unknown[] }) => {
|
||||||
return total + (month.weeks?.length || 0)
|
return total + (month.weeks?.length || 0)
|
||||||
}, 0)
|
}, 0)
|
||||||
// TODO 测试后删除
|
|
||||||
console.log('total weeks: ', totalWeeks)
|
|
||||||
return totalWeeks * 60
|
return totalWeeks * 60
|
||||||
} else if (currentTimeScale.value === TimelineScale.MONTH) {
|
} else if (currentTimeScale.value === TimelineScale.MONTH) {
|
||||||
return cachedData.length * 60
|
return cachedData.length * 60
|
||||||
|
|||||||
Reference in New Issue
Block a user