From 0c17152fb5bf0333cd59dc56acaa75ad8e281284 Mon Sep 17 00:00:00 2001 From: userName <244140623@qq.com> Date: Thu, 22 Feb 2024 11:02:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/mts/planDetail/index.vue | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/ruoyi-ui-vue3/src/views/mts/planDetail/index.vue b/ruoyi-ui-vue3/src/views/mts/planDetail/index.vue index f7832ce..1e981ee 100644 --- a/ruoyi-ui-vue3/src/views/mts/planDetail/index.vue +++ b/ruoyi-ui-vue3/src/views/mts/planDetail/index.vue @@ -54,7 +54,7 @@ 物料清单 - 任务备注 + 新增 @@ -246,28 +246,35 @@ function getDays(start, end) { * 改变表格单元格颜色 */ function handleChangeCellStyle({ row, column, rowIndex, columnIndex }) { - // 获取两个日期之间的所有日期 - const planDates = row.record.map(v => v.recordDate) - let arr = planDates.filter(v => allDates.indexOf(v) > -1) + let cellStyle = {} - let cellStyle = {} //column.label == dayjs(row.planStartDate).format('YYYY-MM-DD') - if (arr.includes(column.label)) { - if (row.ganttColor) { - cellStyle.backgroundColor = row.ganttColor - } else { - cellStyle.backgroundColor = '#FFC000' + for (const item of row.record) { + if (item.recordDate == column.label) { + cellStyle.backgroundColor = item.ganttColor } - - if (rowIndex % 2 == 0) { - if (row.ganttColor) { - cellStyle.backgroundColor = row.ganttColor - } else { - cellStyle.backgroundColor = '#00B050' - } - } - } else { - cellStyle.backgroundColor = 'white' } + // 获取两个日期之间的所有日期 + //column.label == dayjs(row.planStartDate).format('YYYY-MM-DD') + // const planDates = row.record.map(v => v.recordDate) + + // let arr = planDates.filter(v => allDates.indexOf(v) > -1) + // if (arr.includes(column.label)) { + // if (row.ganttColor) { + // cellStyle.backgroundColor = row.ganttColor + // } else { + // cellStyle.backgroundColor = '#FFC000' + // } + + // if (rowIndex % 2 == 0) { + // if (row.ganttColor) { + // cellStyle.backgroundColor = row.ganttColor + // } else { + // cellStyle.backgroundColor = '#00B050' + // } + // } + // } else { + // cellStyle.backgroundColor = 'white' + // } return cellStyle }