|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<div v-loading="loading"> |
|
|
|
|
<el-form label-width="80px" :model="formLabelAlign"> |
|
|
|
|
<el-row> |
|
|
|
|
<!-- 新增查询条件 --> |
|
|
|
|
@ -119,9 +119,6 @@ |
|
|
|
|
<!-- 头部标题和图例 --> |
|
|
|
|
<div class="gantt-header"> |
|
|
|
|
<div class="status-legend"> |
|
|
|
|
<!-- <div class="legend-item"> |
|
|
|
|
<el-button type="primary" size="medium" @click="exportXls">导出</el-button> |
|
|
|
|
</div> --> |
|
|
|
|
<div class="legend-item"> |
|
|
|
|
<el-checkbox |
|
|
|
|
v-model="legendStatus.pending" |
|
|
|
|
@ -138,7 +135,6 @@ |
|
|
|
|
:style="{ '--checkbox-color': '#28a745' }" |
|
|
|
|
@change="handleLegendChange('processing')" |
|
|
|
|
> |
|
|
|
|
<!-- <span class="legend-text" style="color: #007bff">进行中</span> --> |
|
|
|
|
<span class="legend-text" style="color: #28a745">进行中</span> |
|
|
|
|
</el-checkbox> |
|
|
|
|
</div> |
|
|
|
|
@ -341,6 +337,7 @@ |
|
|
|
|
class="task-overlay-text" |
|
|
|
|
:style="{ |
|
|
|
|
top: `${getNarrowTaskOffsetByLayer(layerIndex)}px`, |
|
|
|
|
left: `${getNarrowTaskOffsetByLayerLeft(task.processName)}px`, |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
{{ task.processName }} |
|
|
|
|
@ -451,6 +448,7 @@ export default { |
|
|
|
|
name: 'GanttChart', |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
loading:false, |
|
|
|
|
formLabelAlign: { |
|
|
|
|
startTime: null, //时间 |
|
|
|
|
teamName: '', //班组 |
|
|
|
|
@ -774,6 +772,12 @@ export default { |
|
|
|
|
const offset = layerIndex % 2 === 0 ? -20 : 15; // -20px 在上方,5px 在下方 |
|
|
|
|
return offset; |
|
|
|
|
}, |
|
|
|
|
// 根据层索引确定窄任务文本的垂直偏移 |
|
|
|
|
getNarrowTaskOffsetByLayerLeft(processName) { |
|
|
|
|
// 偶数层在上方显示(负值),奇数层在下方显示(正值) |
|
|
|
|
const offset = processName.length >= 5 ? -30 : -7; |
|
|
|
|
return offset; |
|
|
|
|
}, |
|
|
|
|
handleParamsChange() { |
|
|
|
|
// 参数变化时的处理逻辑 |
|
|
|
|
this.formLabelAlign.teamId = this.tsId; |
|
|
|
|
@ -983,7 +987,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 数据获取 |
|
|
|
|
getData() { |
|
|
|
|
async getData (params) { |
|
|
|
|
if (this.formLabelAlign.timeRange.length > 0) { |
|
|
|
|
this.formLabelAlign.startTime = this.formLabelAlign.timeRange[0]; |
|
|
|
|
this.formLabelAlign.endTime = this.formLabelAlign.timeRange[1]; |
|
|
|
|
@ -991,7 +995,8 @@ export default { |
|
|
|
|
if (this.formLabelAlign.planStatusList.length <= 0) { |
|
|
|
|
this.formLabelAlign.planStatusList = null; |
|
|
|
|
} |
|
|
|
|
getData(this.formLabelAlign).then(res => { |
|
|
|
|
this.loading = true |
|
|
|
|
await getData(this.formLabelAlign).then(res => { |
|
|
|
|
this.processData(res.data.data); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
@ -1043,8 +1048,9 @@ export default { |
|
|
|
|
this.allOrders = orders; |
|
|
|
|
this.totalOrders = orders.length; |
|
|
|
|
this.taskData = tasks; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.updateCurrentPageOrders(); |
|
|
|
|
this.loading = false |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 任务状态计算 |
|
|
|
|
@ -1087,7 +1093,6 @@ export default { |
|
|
|
|
this.$message.warning('请选择时间范围'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 将时间范围设置到请求参数中 |
|
|
|
|
this.formLabelAlign.startTime = this.formLabelAlign.timeRange[0]; |
|
|
|
|
this.formLabelAlign.endTime = this.formLabelAlign.timeRange[1]; |
|
|
|
|
@ -1735,7 +1740,7 @@ export default { |
|
|
|
|
height: 100%; |
|
|
|
|
text-align: center; |
|
|
|
|
display: inline-block; |
|
|
|
|
transform: scale(0.8); |
|
|
|
|
transform: scale(0.7); |
|
|
|
|
} |
|
|
|
|
.task-label-txt { |
|
|
|
|
position: absolute; |
|
|
|
|
@ -1767,7 +1772,7 @@ export default { |
|
|
|
|
min-width: max-content; |
|
|
|
|
pointer-events: none; |
|
|
|
|
display: inline-block; |
|
|
|
|
transform: scale(0.8); |
|
|
|
|
transform: scale(0.7); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* 提示框样式 */ |
|
|
|
|
|