|
|
|
|
@ -331,13 +331,15 @@ |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- 为窄任务添加带偏移的文本显示 --> |
|
|
|
|
<!-- 为窄任务添加带偏移的文本显示 task.processName--> |
|
|
|
|
|
|
|
|
|
<div |
|
|
|
|
v-else |
|
|
|
|
class="task-overlay-text" |
|
|
|
|
:style="{ |
|
|
|
|
width:`${getWidthPercent(task.planStartTime, task.planEndTime)}%`, |
|
|
|
|
top: `${getNarrowTaskOffsetByLayer(layerIndex)}px`, |
|
|
|
|
left: `${getNarrowTaskOffsetByLayerLeft(task.processName)}px`, |
|
|
|
|
left: `${getNarrowTaskOffsetByLayerLeft(task.processName,getWidthPercent(task.planStartTime, task.planEndTime),layerIndex)}px`, |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
{{ task.processName }} |
|
|
|
|
@ -773,15 +775,12 @@ export default { |
|
|
|
|
return offset; |
|
|
|
|
}, |
|
|
|
|
// 根据层索引确定窄任务文本的垂直偏移 |
|
|
|
|
getNarrowTaskOffsetByLayerLeft(processName) { |
|
|
|
|
getNarrowTaskOffsetByLayerLeft(processName,width,layerIndex) { |
|
|
|
|
// 偶数层在上方显示(负值),奇数层在下方显示(正值) |
|
|
|
|
// const offset = processName.length >= 5 ? -30 : -15; |
|
|
|
|
const offset = null; |
|
|
|
|
if (processName.length >= 7) { |
|
|
|
|
return -33; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (processName.length >= 6) { |
|
|
|
|
return -20; |
|
|
|
|
return -15; |
|
|
|
|
} |
|
|
|
|
if (processName.length >= 5) { |
|
|
|
|
return -17; |
|
|
|
|
@ -1742,7 +1741,7 @@ export default { |
|
|
|
|
padding: 2px 0px; |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
cursor: pointer; |
|
|
|
|
overflow: hidden; |
|
|
|
|
/* overflow: hidden; */ |
|
|
|
|
transition: all 0.2s; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
border: 1px solid rgba(255, 255, 255, 0.3); |
|
|
|
|
@ -1770,9 +1769,9 @@ export default { |
|
|
|
|
position: absolute; |
|
|
|
|
font-size: 9px; |
|
|
|
|
color: white; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
overflow: hidden; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
/* white-space: nowrap; */ |
|
|
|
|
/* overflow: hidden; */ |
|
|
|
|
/* text-overflow: ellipsis; */ |
|
|
|
|
max-width: 120%; |
|
|
|
|
text-align: center; |
|
|
|
|
/* 正确的居中方式 */ |
|
|
|
|
|