排产看板工序名字展示调整

dev-scheduling
zhangdi 24 hours ago
parent f71a7ce90c
commit 90c689b30d
  1. 51
      src/views/productionSchedulingPlan/schedulingDashboard/container.vue

@ -304,7 +304,8 @@
:key="taskIndex"
class="task-bar"
:class="{
'task-bar-narrow': getWidthPercent(task.planStartTime, task.planEndTime) < 2.1,
'task-bar-narrow':
getWidthPercent(task.planStartTime, task.planEndTime) < 2.1,
}"
:style="{
left: `${getPositionPercent(task.planStartTime)}%`,
@ -323,12 +324,13 @@
@mouseenter="showTooltip($event, task, order.woCode)"
@mouseleave="hideTooltip()"
>
<div class="task-label" v-if="getWidthPercent(task.planStartTime, task.planEndTime) >= 1.5">
<span
class="task-label-txt task-label-txt-inside"
>{{ task.processName }}</span
<div
class="task-label"
v-if="getWidthPercent(task.planStartTime, task.planEndTime) >= 1.5"
>
<span class="task-label-txt task-label-txt-inside">{{
task.processName
}}</span>
</div>
<!-- 为窄任务添加带偏移的文本显示 task.processName-->
@ -337,9 +339,13 @@
v-else
class="task-overlay-text"
:style="{
width:`${getWidthPercent(task.planStartTime, task.planEndTime)}%`,
width: `${getWidthPercent(task.planStartTime, task.planEndTime)}%`,
top: `${getNarrowTaskOffsetByLayer(layerIndex)}px`,
left: `${getNarrowTaskOffsetByLayerLeft(task.processName,getWidthPercent(task.planStartTime, task.planEndTime),layerIndex)}px`,
left: `${getNarrowTaskOffsetByLayerLeft(
task.processName,
getWidthPercent(task.planStartTime, task.planEndTime),
layerIndex
)}px`,
}"
>
{{ task.processName }}
@ -450,7 +456,7 @@ export default {
name: 'GanttChart',
data() {
return {
valuerrr:'铜合金化学镀镍',//
valuerrr: '铜合金化学镀镍', //
loading: false,
formLabelAlign: {
startTime: null, //
@ -775,17 +781,28 @@ export default {
return offset;
},
//
getNarrowTaskOffsetByLayerLeft(processName,width,layerIndex) {
getNarrowTaskOffsetByLayerLeft(processName, widthPercent, layerIndex) {
//
const offset = null;
if (processName.length >= 6) {
return -15;
const textWidth = processName.length * 2;
const timeLine = this.$refs.timelineContainer.clientWidth;
const taskBarWidth = (timeLine * widthPercent) / 100;
if (textWidth > taskBarWidth) {
console.log('大于宽度的', textWidth, taskBarWidth,processName);
if (processName <= 4) {
return -7; //
} else {
return -textWidth*1.5; //
}
} else {
// console.log('', textWidth, taskBarWidth,processName);
if (processName <= 4) {
return -7; //
} else {
return -textWidth; //
}
if (processName.length >= 5) {
return -17;
}
return -7
// return -7; //
},
handleParamsChange() {
//

Loading…
Cancel
Save