|
|
@@ -17,6 +17,32 @@
|
|
|
工作日历
|
|
|
</el-button>
|
|
|
<slot name="toolbar"></slot>
|
|
|
+ <gantt-filter-bar
|
|
|
+ v-show="viewMode === 'gantt'"
|
|
|
+ class="gantt-filter-inline"
|
|
|
+ :query="ganttQuery"
|
|
|
+ :plan-code-label="
|
|
|
+ resourceLabelMode === 'order'
|
|
|
+ ? '\u751f\u4ea7\u8ba2\u5355\u53f7'
|
|
|
+ : '\u8ba1\u5212\u7f16\u53f7'
|
|
|
+ "
|
|
|
+ @update:query="ganttQuery = $event"
|
|
|
+ @apply="applyGanttFilters"
|
|
|
+ @reset="resetGanttFilters"
|
|
|
+ />
|
|
|
+ <gantt-filter-bar
|
|
|
+ v-show="viewMode === 'calendar'"
|
|
|
+ class="gantt-filter-inline"
|
|
|
+ :query="calendarQuery"
|
|
|
+ :plan-code-label="
|
|
|
+ resourceLabelMode === 'order'
|
|
|
+ ? '\u751f\u4ea7\u8ba2\u5355\u53f7'
|
|
|
+ : '\u8ba1\u5212\u7f16\u53f7'
|
|
|
+ "
|
|
|
+ @update:query="calendarQuery = $event"
|
|
|
+ @apply="applyCalendarFilters"
|
|
|
+ @reset="resetCalendarFilters"
|
|
|
+ />
|
|
|
</div>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
@@ -44,7 +70,9 @@
|
|
|
v-show="!isFullscreen"
|
|
|
:query="ganttQuery"
|
|
|
:plan-code-label="
|
|
|
- resourceLabelMode === 'order' ? '生产订单号' : '计划编号'
|
|
|
+ resourceLabelMode === 'order'
|
|
|
+ ? '\u751f\u4ea7\u8ba2\u5355\u53f7'
|
|
|
+ : '\u8ba1\u5212\u7f16\u53f7'
|
|
|
"
|
|
|
@update:query="ganttQuery = $event"
|
|
|
@apply="applyGanttFilters"
|
|
|
@@ -59,7 +87,9 @@
|
|
|
v-show="!isFullscreen"
|
|
|
:query="calendarQuery"
|
|
|
:plan-code-label="
|
|
|
- resourceLabelMode === 'order' ? '生产订单号' : '计划编号'
|
|
|
+ resourceLabelMode === 'order'
|
|
|
+ ? '\u751f\u4ea7\u8ba2\u5355\u53f7'
|
|
|
+ : '\u8ba1\u5212\u7f16\u53f7'
|
|
|
"
|
|
|
@update:query="calendarQuery = $event"
|
|
|
@apply="applyCalendarFilters"
|
|
|
@@ -413,7 +443,7 @@
|
|
|
this.getActiveResourceName(item) ||
|
|
|
item.teamName ||
|
|
|
planMeta.teamName ||
|
|
|
- '未分组',
|
|
|
+ '\u672a\u5206\u7ec4',
|
|
|
productionLineName:
|
|
|
item.productionLineName || planMeta.productionLineName || '',
|
|
|
factoryName: planMeta.factoryName || '',
|
|
|
@@ -427,7 +457,7 @@
|
|
|
barLabel:
|
|
|
[item.title, item.name || item.text || item.code]
|
|
|
.filter(Boolean)
|
|
|
- .join(':') || `任务${index + 1}`,
|
|
|
+ .join(' / ') || `\u4efb\u52a1${index + 1}`,
|
|
|
color: item.color || resolveTaskColor(item.type),
|
|
|
startDate,
|
|
|
endDate
|
|
|
@@ -533,7 +563,9 @@
|
|
|
} else {
|
|
|
result.push({
|
|
|
key,
|
|
|
- label: `${day.date.getFullYear()}年${day.date.getMonth() + 1}月`,
|
|
|
+ label: `${day.date.getFullYear()}\u5e74${
|
|
|
+ day.date.getMonth() + 1
|
|
|
+ }\u6708`,
|
|
|
span: 1
|
|
|
});
|
|
|
}
|
|
|
@@ -546,7 +578,7 @@
|
|
|
}
|
|
|
const rowMap = new Map();
|
|
|
this.calendarFilteredTasks.forEach((item) => {
|
|
|
- const groupKey = item.groupLabel || '未分组';
|
|
|
+ const groupKey = item.groupLabel || '\u672a\u5206\u7ec4';
|
|
|
if (!rowMap.has(groupKey)) {
|
|
|
rowMap.set(groupKey, []);
|
|
|
}
|
|
|
@@ -671,16 +703,16 @@
|
|
|
item.resourceName ||
|
|
|
item.name ||
|
|
|
item.teamName ||
|
|
|
- '未分组'
|
|
|
+ '\u672a\u5206\u7ec4'
|
|
|
);
|
|
|
}
|
|
|
- return item.name || item.teamName || '未分组';
|
|
|
+ return item.name || item.teamName || '\u672a\u5206\u7ec4';
|
|
|
},
|
|
|
getCalendarPersonGroupName(item) {
|
|
|
if (this.resourceLabelMode === 'order') {
|
|
|
- return this.getTaskPersonName(item) || '未分组';
|
|
|
+ return this.getTaskPersonName(item) || '\u672a\u5206\u7ec4';
|
|
|
}
|
|
|
- return this.getTaskPersonName(item) || '未分组';
|
|
|
+ return this.getTaskPersonName(item) || '\u672a\u5206\u7ec4';
|
|
|
},
|
|
|
getCalendarProductionLineName(item, resourceList = []) {
|
|
|
if (this.resourceLabelMode === 'order') {
|
|
|
@@ -755,7 +787,7 @@
|
|
|
item.leaderUserName ||
|
|
|
'';
|
|
|
return String(name || '')
|
|
|
- .replace(/^人员[::]/, '')
|
|
|
+ .replace(/^\u4eba\u5458[:\uff1a]/, '')
|
|
|
.trim();
|
|
|
},
|
|
|
getActiveResourceName(item) {
|
|
|
@@ -1183,7 +1215,7 @@
|
|
|
css: daysStyle
|
|
|
}
|
|
|
];
|
|
|
- //这里在时间轴表格内的cell上添加class
|
|
|
+ // 这里在时间轴表格内的cell上添加class
|
|
|
gantt.templates.timeline_cell_class = function (item, date) {
|
|
|
if (date.getDay() == 0 || date.getDay() == 6) {
|
|
|
return 'weekend';
|
|
|
@@ -1201,10 +1233,10 @@
|
|
|
return ['task-222', task.customClass].filter(Boolean).join(' ');
|
|
|
};
|
|
|
|
|
|
- gantt.config.scale_height = 64;
|
|
|
- gantt.config.task_height = 26;
|
|
|
- gantt.config.row_height = 34;
|
|
|
- gantt.config.min_column_width = 42;
|
|
|
+ gantt.config.scale_height = 50;
|
|
|
+ gantt.config.task_height = 22;
|
|
|
+ gantt.config.row_height = 27;
|
|
|
+ gantt.config.min_column_width = 40;
|
|
|
gantt.config.show_task_cells = false;
|
|
|
gantt.plugins({
|
|
|
marker: true
|
|
|
@@ -1232,24 +1264,28 @@
|
|
|
if (box) {
|
|
|
box.parentNode.removeChild(box);
|
|
|
}
|
|
|
- let classList = e.target.className.split(' ');
|
|
|
+ let classList = String(e?.target?.className || '').split(' ');
|
|
|
// 这里自定义了展开/收起树形的点击事件
|
|
|
if (classList.includes('gantt_open')) {
|
|
|
- gantt.open(id); // 展开
|
|
|
+ gantt.open(id); // 灞曞紑
|
|
|
return true;
|
|
|
}
|
|
|
if (classList.includes('gantt_close')) {
|
|
|
- gantt.close(id); // 收起
|
|
|
+ gantt.close(id); // 鏀惰捣
|
|
|
return true;
|
|
|
}
|
|
|
// 这里是其他的点击事件
|
|
|
let task = _this.ganttData.find((item) => {
|
|
|
return item.id == id;
|
|
|
});
|
|
|
+ if (!task) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
if (task.taskType === 'stage') {
|
|
|
// toDo()
|
|
|
return true;
|
|
|
}
|
|
|
+ return true;
|
|
|
});
|
|
|
gantt.i18n.setLocale('cn');
|
|
|
|
|
|
@@ -1402,17 +1438,25 @@
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.project-gantt {
|
|
|
+ position: relative;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- min-height: 280px;
|
|
|
- gap: 10px;
|
|
|
- padding: 10px;
|
|
|
+ min-height: 260px;
|
|
|
+ gap: 6px;
|
|
|
+ padding: 6px;
|
|
|
box-sizing: border-box;
|
|
|
- border: 1px solid #edf2f7;
|
|
|
- border-radius: 8px;
|
|
|
- background: #f7f9fc;
|
|
|
+ border: 1px solid #d8e3ef;
|
|
|
+ border-radius: 10px;
|
|
|
+ background: linear-gradient(
|
|
|
+ 135deg,
|
|
|
+ rgba(31, 140, 235, 0.06) 0%,
|
|
|
+ transparent 32%
|
|
|
+ ),
|
|
|
+ linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
|
|
|
+ box-shadow: 0 10px 26px rgba(26, 39, 55, 0.08);
|
|
|
+ overflow: hidden;
|
|
|
|
|
|
&.is-fullscreen {
|
|
|
position: fixed;
|
|
|
@@ -1423,33 +1467,62 @@
|
|
|
width: 100vw;
|
|
|
height: 100vh;
|
|
|
z-index: 9999;
|
|
|
- background: #f6f8fb;
|
|
|
- padding: 16px;
|
|
|
+ background: #eef4fa;
|
|
|
+ padding: 10px;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
}
|
|
|
+ .project-gantt::before {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ left: 0;
|
|
|
+ height: 2px;
|
|
|
+ background: linear-gradient(90deg, #2489e8 0%, #14b8a6 60%, #7aa7ff 100%);
|
|
|
+ content: '';
|
|
|
+ pointer-events: none;
|
|
|
+ }
|
|
|
.view-switch {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
- gap: 8px;
|
|
|
- min-height: 46px;
|
|
|
- padding: 7px 10px;
|
|
|
+ gap: 6px;
|
|
|
+ min-height: 34px;
|
|
|
+ padding: 3px 6px;
|
|
|
box-sizing: border-box;
|
|
|
- border: 1px solid #e7edf5;
|
|
|
- border-radius: 7px;
|
|
|
- background: #fff;
|
|
|
- box-shadow: 0 2px 8px rgba(31, 45, 61, 0.04);
|
|
|
+ border: 1px solid #dfe9f4;
|
|
|
+ border-radius: 8px;
|
|
|
+ background: rgba(255, 255, 255, 0.94);
|
|
|
+ box-shadow: 0 3px 12px rgba(31, 45, 61, 0.05);
|
|
|
}
|
|
|
.view-switch-left {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- gap: 10px;
|
|
|
+ gap: 6px;
|
|
|
+ flex: 1 1 auto;
|
|
|
min-width: 0;
|
|
|
- flex-wrap: wrap;
|
|
|
+ overflow-x: auto;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ padding-bottom: 1px;
|
|
|
+ }
|
|
|
+ .view-switch-left::-webkit-scrollbar {
|
|
|
+ height: 4px;
|
|
|
+ }
|
|
|
+ .view-switch-left::-webkit-scrollbar-thumb {
|
|
|
+ border-radius: 999px;
|
|
|
+ background: #c9d4e2;
|
|
|
+ }
|
|
|
+ .view-switch-left ::v-deep .el-date-editor--daterange.el-input__inner {
|
|
|
+ width: 330px;
|
|
|
+ flex: 0 0 auto;
|
|
|
+ }
|
|
|
+ .gantt-view ::v-deep > .calendar-toolbar,
|
|
|
+ .calendar-view ::v-deep > .calendar-toolbar {
|
|
|
+ display: none;
|
|
|
}
|
|
|
.view-switch ::v-deep .el-button {
|
|
|
- border-radius: 4px;
|
|
|
+ flex: 0 0 auto;
|
|
|
+ border-radius: 7px;
|
|
|
font-weight: 600;
|
|
|
transition: all 0.18s ease;
|
|
|
}
|
|
|
@@ -1460,8 +1533,8 @@
|
|
|
}
|
|
|
.view-switch ::v-deep .el-button--primary {
|
|
|
border-color: #1f8ceb;
|
|
|
- background: #1f8ceb;
|
|
|
- box-shadow: 0 3px 8px rgba(31, 140, 235, 0.22);
|
|
|
+ background: linear-gradient(180deg, #2a9af0 0%, #1684df 100%);
|
|
|
+ box-shadow: 0 3px 8px rgba(31, 140, 235, 0.2);
|
|
|
}
|
|
|
.calendar-view {
|
|
|
flex: 1;
|
|
|
@@ -1469,7 +1542,7 @@
|
|
|
min-height: 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- gap: 12px;
|
|
|
+ gap: 6px;
|
|
|
}
|
|
|
.gantt-view {
|
|
|
flex: 1;
|
|
|
@@ -1477,14 +1550,14 @@
|
|
|
min-height: 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- gap: 12px;
|
|
|
+ gap: 6px;
|
|
|
}
|
|
|
.project-gantt__body {
|
|
|
flex: 1;
|
|
|
min-height: 0;
|
|
|
display: flex;
|
|
|
align-items: stretch;
|
|
|
- gap: 10px;
|
|
|
+ gap: 6px;
|
|
|
}
|
|
|
.gantt-box {
|
|
|
flex: 1;
|
|
|
@@ -1492,10 +1565,10 @@
|
|
|
width: calc(100%);
|
|
|
height: calc(100%);
|
|
|
background: #fff;
|
|
|
- border: 1px solid #e6edf5;
|
|
|
- border-radius: 8px;
|
|
|
+ border: 1px solid #d8e3ef;
|
|
|
+ border-radius: 9px;
|
|
|
overflow: hidden;
|
|
|
- box-shadow: 0 4px 14px rgba(31, 45, 61, 0.06);
|
|
|
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.74);
|
|
|
}
|
|
|
.gantt-hover-tooltip {
|
|
|
position: fixed;
|
|
|
@@ -1528,7 +1601,7 @@
|
|
|
|
|
|
:deep(.gantt_ver_scroll),
|
|
|
:deep(.gantt_hor_scroll) {
|
|
|
- background: #f4f7fb;
|
|
|
+ background: #eef4fa;
|
|
|
}
|
|
|
|
|
|
:deep(.gantt_ver_scroll::-webkit-scrollbar),
|
|
|
@@ -1543,7 +1616,7 @@
|
|
|
:deep(.gantt_data_area::-webkit-scrollbar-thumb) {
|
|
|
border: 2px solid #f8fafc;
|
|
|
border-radius: 999px;
|
|
|
- background: #c9d1dc;
|
|
|
+ background: #bcc8d6;
|
|
|
}
|
|
|
|
|
|
:deep(.gantt_ver_scroll::-webkit-scrollbar-thumb:hover),
|
|
|
@@ -1553,34 +1626,34 @@
|
|
|
}
|
|
|
|
|
|
:deep(.gantt_task_scale) {
|
|
|
- border-bottom: 1px solid #dde7f0;
|
|
|
+ border-bottom: 1px solid #d9e4ef;
|
|
|
|
|
|
.gantt_scale_line > .gantt_scale_cell {
|
|
|
- color: #3f4a56;
|
|
|
+ color: #344054;
|
|
|
font-size: 11px;
|
|
|
- border-right: 1px solid #e6edf5;
|
|
|
+ border-right: 1px solid #e7edf5;
|
|
|
background: #fbfdff;
|
|
|
|
|
|
&.today {
|
|
|
- background: #e5f2ff;
|
|
|
- color: #1683d8 !important;
|
|
|
- box-shadow: inset 0 -2px 0 #1f8ceb;
|
|
|
+ background: #e8f4ff;
|
|
|
+ color: #0f75bd !important;
|
|
|
+ box-shadow: inset 0 -2px 0 #14b8a6;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
:deep(.gantt_scale_line) {
|
|
|
- border-bottom: 1px solid #dde7f0;
|
|
|
+ border-bottom: 1px solid #d9e4ef;
|
|
|
}
|
|
|
:deep(.gantt_scale_line:first-child .gantt_scale_cell) {
|
|
|
- height: 30px;
|
|
|
- line-height: 30px;
|
|
|
- font-size: 15px;
|
|
|
+ height: 24px;
|
|
|
+ line-height: 24px;
|
|
|
+ font-size: 14px;
|
|
|
font-weight: 600;
|
|
|
- color: #2f3b4a;
|
|
|
- background: linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%);
|
|
|
+ color: #253244;
|
|
|
+ background: linear-gradient(180deg, #f9fcff 0%, #eef5fb 100%);
|
|
|
}
|
|
|
:deep(.gantt_scale_line:last-child .gantt_scale_cell) {
|
|
|
- height: 38px;
|
|
|
+ height: 26px;
|
|
|
padding: 0;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
@@ -1594,14 +1667,14 @@
|
|
|
text-align: center;
|
|
|
}
|
|
|
:deep(.gantt-day-scale__date) {
|
|
|
- font-size: 12px;
|
|
|
- line-height: 16px;
|
|
|
+ font-size: 11px;
|
|
|
+ line-height: 13px;
|
|
|
color: #606266;
|
|
|
}
|
|
|
:deep(.gantt-day-scale__week) {
|
|
|
- margin-top: 2px;
|
|
|
- font-size: 14px;
|
|
|
- line-height: 18px;
|
|
|
+ margin-top: 0;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 14px;
|
|
|
font-weight: 500;
|
|
|
color: #303133;
|
|
|
}
|
|
|
@@ -1656,28 +1729,31 @@
|
|
|
}
|
|
|
:deep(.gantt_task_bg .gantt_task_row),
|
|
|
:deep(.gantt_task_row) {
|
|
|
- border-bottom: 1px solid #f1f5f9;
|
|
|
+ border-bottom: 1px solid #edf2f7;
|
|
|
}
|
|
|
:deep(.gantt_task_bg .gantt_task_row:nth-child(odd)) {
|
|
|
- background: #fcfdff;
|
|
|
+ background: #fbfdff;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.gantt_task_bg .gantt_task_row:nth-child(even)) {
|
|
|
+ background: #ffffff;
|
|
|
}
|
|
|
:deep(.gantt_task_bg .gantt_task_row:hover) {
|
|
|
- background: #f7fbff;
|
|
|
+ background: #f5fbff;
|
|
|
}
|
|
|
:deep(.task-222) {
|
|
|
- height: 28px !important;
|
|
|
- line-height: 28px !important;
|
|
|
+ height: 22px !important;
|
|
|
+ line-height: 22px !important;
|
|
|
border: none !important;
|
|
|
- border-radius: 5px !important;
|
|
|
- box-shadow: 0 2px 5px rgba(15, 23, 42, 0.14) !important;
|
|
|
- filter: saturate(0.88) brightness(0.99);
|
|
|
+ border-radius: 7px !important;
|
|
|
+ box-shadow: 0 3px 8px rgba(15, 23, 42, 0.16) !important;
|
|
|
+ filter: saturate(0.92) brightness(1);
|
|
|
overflow: hidden;
|
|
|
transition: box-shadow 0.18s ease, filter 0.18s ease;
|
|
|
- backdrop-filter: saturate(1.05);
|
|
|
}
|
|
|
:deep(.task-222:hover) {
|
|
|
- filter: saturate(0.94) brightness(1);
|
|
|
- box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18) !important;
|
|
|
+ filter: saturate(1) brightness(1.02);
|
|
|
+ box-shadow: 0 5px 14px rgba(15, 23, 42, 0.2) !important;
|
|
|
}
|
|
|
:deep(.gantt_task_line.task-parent-red),
|
|
|
:deep(.gantt_task_line.task-parent-red .gantt_task_progress) {
|
|
|
@@ -1685,18 +1761,18 @@
|
|
|
}
|
|
|
:deep(.gantt_task_line.task-parent-blue),
|
|
|
:deep(.gantt_task_line.task-parent-blue .gantt_task_progress) {
|
|
|
- background: #18a0ea !important;
|
|
|
+ background: linear-gradient(90deg, #1688dc 0%, #26a9ee 100%) !important;
|
|
|
}
|
|
|
:deep(.gantt_task_line.task-child-plan) {
|
|
|
border: none !important;
|
|
|
}
|
|
|
:deep(.gantt_task_line.task-station-green),
|
|
|
:deep(.gantt_task_line.task-station-green .gantt_task_progress) {
|
|
|
- background: #62ddd4 !important;
|
|
|
+ background: linear-gradient(90deg, #24a865 0%, #53c988 100%) !important;
|
|
|
}
|
|
|
:deep(.gantt_task_line.task-node-purple),
|
|
|
:deep(.gantt_task_line.task-node-purple .gantt_task_progress) {
|
|
|
- background: #b985ff !important;
|
|
|
+ background: linear-gradient(90deg, #8d62e5 0%, #b985ff 100%) !important;
|
|
|
}
|
|
|
:deep(.gantt_split_parent) {
|
|
|
opacity: 1;
|
|
|
@@ -1714,7 +1790,7 @@
|
|
|
color: #fff;
|
|
|
font-size: 12px;
|
|
|
font-weight: 600;
|
|
|
- line-height: 28px;
|
|
|
+ line-height: 22px;
|
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|
|
|
text-align: center;
|