|
@@ -74,7 +74,11 @@ export default {
|
|
|
if(endDate) {
|
|
|
let biaoto = item.label.split(' ')[0]
|
|
|
if(biaoto == value.end_date) {
|
|
|
- // return value.text
|
|
|
+ if(value.text.indexOf('/') != '-1') {
|
|
|
+ return value.text.split('/')[1]
|
|
|
+ } else {
|
|
|
+ return value.text
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -97,6 +101,8 @@ export default {
|
|
|
allDataList = this.getdiffdate(this.valueDate[0], this.valueDate[1])
|
|
|
this.combination(dataList, allDataList)
|
|
|
// 递归加颜色
|
|
|
+ console.log(this.tasks.data, '芜湖')
|
|
|
+
|
|
|
this.treeDataList = this.recursive(this.tasks.data);
|
|
|
|
|
|
// this.treeDataList = this.integrationTree(this.tasks.data)
|
|
@@ -143,8 +149,7 @@ export default {
|
|
|
}
|
|
|
if(data[i].end_date) {
|
|
|
let day = this.dayjs(data[i].end_date).diff(data[i].start_date, 'day') // 和并多少行
|
|
|
- let column = this.dayjs(data[i].end_date).diff(this.valueDateList[0], 'day') // 从多少列开始
|
|
|
- console.log(day)
|
|
|
+ let column = +this.dayjs(data[i].end_date).diff(this.valueDateList[0], 'day') + 1 // 从多少列开始
|
|
|
if(day >= 1) {
|
|
|
if(day >= 3) {
|
|
|
if(this.valueDateList[0] > data[i].start_date) {
|
|
@@ -161,6 +166,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if(data[i].end_date != data[i].start_date && data[i].end_date != this.valueDateList[0]) {
|
|
|
+ data[i].end_date = this.dayjs(this.valueDateList[0]).add('1','day').format('YYYY-MM-DD')
|
|
|
+ }
|
|
|
+
|
|
|
this.mergeList.push(obj)
|
|
|
if(data[i].id.indexOf(this.$t('chu-cha')) != '-1') {
|
|
|
data[i].color = '#E6A23C'
|
|
@@ -168,6 +177,17 @@ export default {
|
|
|
if(data[i].id.indexOf(this.$t('other.AskForLeave')) != '-1') {
|
|
|
data[i].color = '#F56C6C'
|
|
|
}
|
|
|
+ if(data[i].id.indexOf('任务') != '-1') {
|
|
|
+ if(data[i].level == 0) {
|
|
|
+ data[i].color = '#409EFF'
|
|
|
+ }
|
|
|
+ if(data[i].level == 1) {
|
|
|
+ data[i].color = '#F56C6C'
|
|
|
+ }
|
|
|
+ if(data[i].level == 2) {
|
|
|
+ data[i].color = '#E6A23C'
|
|
|
+ }
|
|
|
+ }
|
|
|
if (data[i].children) {
|
|
|
this.recursive(data[i].children);
|
|
|
}
|
|
@@ -267,28 +287,22 @@ export default {
|
|
|
return treeData;
|
|
|
},
|
|
|
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
- // if (rowIndex == 0) {
|
|
|
- // if (columnIndex == 2) {
|
|
|
- // return [1, 18];
|
|
|
- // } else if(columnIndex == 1){
|
|
|
- // return [0, 0];
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // if (rowIndex == +this.mergeList[rowIndex].ins -1) {
|
|
|
- // if (columnIndex == +this.mergeList[rowIndex].column + 1) {
|
|
|
- // return [1, +this.mergeList[rowIndex].numDay + 1];
|
|
|
- // } else if(columnIndex == 1){
|
|
|
- // return [0, 0];
|
|
|
- // }
|
|
|
- // }
|
|
|
+ if (rowIndex == +this.mergeList[rowIndex].ins -1) {
|
|
|
+ if(this.mergeList[rowIndex].numDay > 1) {
|
|
|
+ if (columnIndex == +this.mergeList[rowIndex].column + 1) {
|
|
|
+ return [1, +this.mergeList[rowIndex].numDay];
|
|
|
+ } else if(columnIndex == 1){
|
|
|
+ return [0, 0];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
// 设置每一个单元格的样式
|
|
|
TableCellStyle(row) {
|
|
|
if(row.row.color) {
|
|
|
let biaoto = row.column.label.split(' ')[0]
|
|
|
- // if(biaoto >= row.row.end_date || biaoto <= row.row.start_date) {
|
|
|
- if(biaoto >= row.row.start_date && biaoto <= row.row.end_date) {
|
|
|
+ // if(biaoto >= row.row.start_date && biaoto <= row.row.end_date) {
|
|
|
+ if(biaoto == row.row.end_date) {
|
|
|
if(row.row.color) {
|
|
|
return 'background-color: '+ row.row.color +' !important;color: #fff'
|
|
|
}
|