|
|
|
|
@ -297,11 +297,11 @@ |
|
|
|
|
:key="taskIndex" |
|
|
|
|
class="task-bar" |
|
|
|
|
:class="{ |
|
|
|
|
'task-bar-narrow': getWidthPercent(task.startTime, task.endTime) < 6, |
|
|
|
|
'task-bar-narrow': getWidthPercent(task.planStartTime, task.planEndTime) < 6, |
|
|
|
|
}" |
|
|
|
|
:style="{ |
|
|
|
|
left: `${getPositionPercent(task.startTime)}%`, |
|
|
|
|
width: `${getWidthPercent(task.startTime, task.endTime)}%`, |
|
|
|
|
left: `${getPositionPercent(task.planStartTime)}%`, |
|
|
|
|
width: `${getWidthPercent(task.planStartTime, task.planEndTime)}%`, |
|
|
|
|
backgroundColor: getStatusColor(task), |
|
|
|
|
top: `${getLayerOffset( |
|
|
|
|
layerIndex, |
|
|
|
|
@ -318,7 +318,7 @@ |
|
|
|
|
> |
|
|
|
|
<div class="task-label"> |
|
|
|
|
<span |
|
|
|
|
v-if="getWidthPercent(task.startTime, task.endTime) >= 6" |
|
|
|
|
v-if="getWidthPercent(task.planStartTime, task.planStartTime) >= 6" |
|
|
|
|
class="task-label-txt task-label-txt-inside" |
|
|
|
|
:style="{ |
|
|
|
|
top: '50%', |
|
|
|
|
@ -328,7 +328,7 @@ |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
|
<div |
|
|
|
|
v-if="getWidthPercent(task.startTime, task.endTime) < 6" |
|
|
|
|
v-if="getWidthPercent(task.planStartTime, task.planStartTime) < 6" |
|
|
|
|
class="task-overlay-text" |
|
|
|
|
> |
|
|
|
|
{{ task.processName }} |
|
|
|
|
@ -466,7 +466,7 @@ export default { |
|
|
|
|
|
|
|
|
|
// 分页参数 |
|
|
|
|
currentPage: 1, |
|
|
|
|
pageSize: 6, |
|
|
|
|
pageSize: 10, |
|
|
|
|
|
|
|
|
|
// 提示框相关 |
|
|
|
|
tooltipVisible: false, |
|
|
|
|
@ -698,12 +698,12 @@ export default { |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.calcCurrentTimePosition(); |
|
|
|
|
// 添加滚动事件监听器 |
|
|
|
|
// if (this.$refs.timelineContainerTest) { |
|
|
|
|
// this.$refs.timelineContainerTest.addEventListener('scroll', this.handleRightScrollBound); |
|
|
|
|
// } |
|
|
|
|
// if (this.$refs.leftScrollContainer) { |
|
|
|
|
// this.$refs.leftScrollContainer.addEventListener('scroll', this.handleLeftScrollBound); |
|
|
|
|
// } |
|
|
|
|
if (this.$refs.timelineContainerTest) { |
|
|
|
|
this.$refs.timelineContainerTest.addEventListener('scroll', this.handleRightScrollBound); |
|
|
|
|
} |
|
|
|
|
if (this.$refs.leftScrollContainer) { |
|
|
|
|
this.$refs.leftScrollContainer.addEventListener('scroll', this.handleLeftScrollBound); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 定时更新当前时间线位置 |
|
|
|
|
@ -713,17 +713,17 @@ export default { |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
// 绑定方法,确保this指向正确 |
|
|
|
|
// this.handleRightScrollBound = this.handleRightScroll.bind(this); |
|
|
|
|
// this.handleLeftScrollBound = this.handleLeftScroll.bind(this); |
|
|
|
|
this.handleRightScrollBound = this.handleRightScroll.bind(this); |
|
|
|
|
this.handleLeftScrollBound = this.handleLeftScroll.bind(this); |
|
|
|
|
}, |
|
|
|
|
beforeDestroy() { |
|
|
|
|
// 移除事件监听器 |
|
|
|
|
// if (this.$refs.timelineContainerTest) { |
|
|
|
|
// this.$refs.timelineContainerTest.removeEventListener('scroll', this.handleRightScrollBound); |
|
|
|
|
// } |
|
|
|
|
// if (this.$refs.leftScrollContainer) { |
|
|
|
|
// this.$refs.leftScrollContainer.removeEventListener('scroll', this.handleLeftScrollBound); |
|
|
|
|
// } |
|
|
|
|
if (this.$refs.timelineContainerTest) { |
|
|
|
|
this.$refs.timelineContainerTest.removeEventListener('scroll', this.handleRightScrollBound); |
|
|
|
|
} |
|
|
|
|
if (this.$refs.leftScrollContainer) { |
|
|
|
|
this.$refs.leftScrollContainer.removeEventListener('scroll', this.handleLeftScrollBound); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 右侧滚动时同步左侧滚动 |
|
|
|
|
@ -1189,6 +1189,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// timeStr 格式是 "YYYY-MM-DD HH:mm" 如 "2025-12-25 18:35" |
|
|
|
|
console.log('timeStr',timeStr) |
|
|
|
|
const [datePart, timePart] = timeStr.split(' '); |
|
|
|
|
const [year, month, day] = datePart.split('-').map(Number); |
|
|
|
|
const [hours, minutes] = timePart.split(':').map(Number); |
|
|
|
|
|