修复gantt图修改日视图后其他视图的pill左移的bug。优化字段默认宽度的逻辑
This commit is contained in:
@@ -44,11 +44,11 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
|
||||
},
|
||||
|
||||
setDefaultColumnWidths(column_num) {
|
||||
const bbb = this.state.columns[0].name
|
||||
// const bbb = this.state.columns[0].name
|
||||
const widths = this.state.columns.map((col) => this.calculateColumnWidth(col));
|
||||
const sumOfRelativeWidths = (widths
|
||||
.filter(({ type }) => type === "relative")
|
||||
.reduce((sum, { value }) => sum + value, 0));
|
||||
// const sumOfRelativeWidths = (widths
|
||||
// .filter(({ type }) => type === "relative")
|
||||
// .reduce((sum, { value }) => sum + value, 0));
|
||||
|
||||
// 获取数组的最后一项
|
||||
const lastItem = widths[widths.length - 1];
|
||||
@@ -60,10 +60,16 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
|
||||
widths.push(newItem);
|
||||
|
||||
// 判断销售的sequence
|
||||
if (this.state.columns[0].name === "sequence") {
|
||||
widths[1] = { type: "relative", value: 0.1 };
|
||||
// if (this.state.columns[0].name === "sequence") {
|
||||
// widths[1] = { type: "relative", value: 0.1 };
|
||||
// }
|
||||
|
||||
// 判断 this.state.columns 是否存在且长度大于零
|
||||
if (this.state.columns && this.state.columns.length > 0 && this.state.columns[0].name === "sequence") {
|
||||
widths[1] = { type: "relative", value: 0.1 };
|
||||
}
|
||||
|
||||
|
||||
// 1 because nth-child selectors are 1-indexed, 2 when the first column contains
|
||||
// the checkboxes to select records.
|
||||
const columnOffset = this.hasSelectors ? 2 : 1;
|
||||
|
||||
@@ -774,7 +774,14 @@ var GanttRow = Widget.extend({
|
||||
let index = 0;
|
||||
for (const date of this.viewInfo.slots) {
|
||||
const slotStart = date;
|
||||
const slotStop = date.clone().add(8, interval);
|
||||
// const slotStop = date.clone().add(8, interval);
|
||||
let slotStop;
|
||||
|
||||
if (interval === "hour") {
|
||||
slotStop = date.clone().add(8, "hour");
|
||||
} else {
|
||||
slotStop = date.clone().add(1, interval);
|
||||
}
|
||||
const isToday = date.isSame(new Date(), 'day') && this.state.scale !== 'day';
|
||||
|
||||
let slotStyle = '';
|
||||
|
||||
Reference in New Issue
Block a user