甘特修改背景颜色和不可拖拽模块

This commit is contained in:
hy
2024-06-27 09:57:12 +08:00
parent 4f6b1d0342
commit 70ffbafac4
2 changed files with 31 additions and 4 deletions

View File

@@ -592,8 +592,23 @@ var GanttRow = Widget.extend({
});
pill.decorations = pillDecorations;
if (self.colorField) {
pill._color = self._getColor(pill[self.colorField]);
// let isDelay = false
// if(pill.state != 'processing' && pill.state != 'finished') { // 判断待加工
// isDelay = pill.order_deadline.isBefore(new Date())
// }
pill.exState = ''
if (self.colorField){
// console.log(self.colorField, self, pill, '颜色')
// pill._color = self._getColor(pill[self.colorField]);
// 设置pill背景颜色2 修改时间2024年6月25日17:09:43
let isDelay = false
if(pill.state != 'processing' && pill.state != 'finished') { // 判断待加工
isDelay = pill.order_deadline.isBefore(new Date())
}
if(isDelay) {
pill.disableDragdrop = true
}
pill._color = self._getColor2(isDelay ? 'delay' : pill.state);
}
if (self.progressField) {
@@ -613,6 +628,13 @@ var GanttRow = Widget.extend({
}
return 0;
},
_getColor2 (state) {
return {
'finished': 'ccc',
'delay': 9,
'processing': 13 // 绿色
}[state]
},
/**
* Get context to evaluate decoration
*
@@ -867,10 +889,11 @@ var GanttRow = Widget.extend({
if ($pill.hasClass('ui-draggable-dragging')) {
return;
}
var self = this;
var pill = _.findWhere(this.pills, { id: $pill.data('id') });
if(pill.state == 'finished'){ // 已完成状态不能拖拽
return;
}
// DRAGGABLE
if (this.options.canEdit && !pill.disableStartResize && !pill.disableStopResize && !this.isGroup) {

View File

@@ -754,3 +754,7 @@
left: -0.5 * $o-connector-creator-bullet-diameter;
}
}
.o_gantt_view .o_gantt_row_nogroup .o_gantt_pill.o_gantt_color_ccc {
background-color: #ccc;
}