style:排产甘特图样式优化

pull/1/head
黄伟杰 1 month ago
parent b71877f08e
commit b188f09241

@ -16,11 +16,11 @@
<div <div
v-for="(plan, index) in activePreviewDevice?.plans ?? []" v-for="(plan, index) in activePreviewDevice?.plans ?? []"
:key="`${activePreviewDevice?.deviceId}-${plan.taskDetailId}-${index}`" :key="`${activePreviewDevice?.deviceId}-${plan.taskDetailId}-${index}`"
:class="['schedule-plan-item', { 'schedule-plan-item-active': isPlanInProgress(plan) }]" :class="['schedule-plan-item', { 'schedule-plan-item-active': plan.sourceType === 'CURRENT' }]"
> >
<div class="schedule-plan-item-head"> <div class="schedule-plan-item-head">
<span class="schedule-plan-item-title">{{ plan.productCode ?? '-' }} / {{ plan.productName ?? '-' }}</span> <span class="schedule-plan-item-title">{{ plan.productCode ?? '-' }} / {{ plan.productName ?? '-' }}</span>
<el-tag v-if="isPlanInProgress(plan)" type="success" size="small"></el-tag> <!-- <el-tag v-if="plan.sourceType === 'CURRENT'" type="success" size="small"></el-tag> -->
</div> </div>
<div>任务明细ID{{ plan.taskDetailId ?? '-' }}</div> <div>任务明细ID{{ plan.taskDetailId ?? '-' }}</div>
<div>计划数量{{ plan.planNumber ?? '-' }}</div> <div>计划数量{{ plan.planNumber ?? '-' }}</div>
@ -306,13 +306,7 @@ const getTaskByTooltipNode = (node: HTMLElement) => {
return undefined return undefined
} }
} }
const isPlanInProgress = (plan: any) => {
const start = dayjs(plan?.planStartTimeStr)
const end = dayjs(plan?.planEndTimeStr)
if (!start.isValid() || !end.isValid()) return false
const now = dayjs()
return (now.isAfter(start) || now.isSame(start)) && (now.isBefore(end) || now.isSame(end))
}
const initTaskTooltips = () => { const initTaskTooltips = () => {
const tooltipsExt = (gantt.ext as any)?.tooltips const tooltipsExt = (gantt.ext as any)?.tooltips
const tooltip = tooltipsExt?.tooltip const tooltip = tooltipsExt?.tooltip
@ -848,6 +842,7 @@ onBeforeUnmount(() => {
.schedule-plan-list { .schedule-plan-list {
overflow: auto; overflow: auto;
max-height: 55vh;
border: 1px solid var(--el-border-color); border: 1px solid var(--el-border-color);
border-radius: 4px; border-radius: 4px;
padding: 8px; padding: 8px;

Loading…
Cancel
Save