|
|
|
|
@ -51,7 +51,7 @@ class CommonExport implements FromCollection, WithStyles, WithColumnWidths, With
|
|
|
|
|
const HISTORY_COURSES_SUB_COLUMNS = [
|
|
|
|
|
'hc_course_type' => '课程体系',
|
|
|
|
|
'hc_course_name' => '课程名称',
|
|
|
|
|
'hc_signs_pass' => '培养人数未去重',
|
|
|
|
|
'hc_signs_pass' => '培养人次未去重',
|
|
|
|
|
'hc_signs_pass_unique' => '培养人数去重',
|
|
|
|
|
'hc_course_signs_pass' => '课程培养人数',
|
|
|
|
|
];
|
|
|
|
|
@ -292,7 +292,7 @@ class CommonExport implements FromCollection, WithStyles, WithColumnWidths, With
|
|
|
|
|
$endCol = $this->getColumnLetter($index + count(self::USERS_SUB_COLUMNS) - 1);
|
|
|
|
|
$sheet->mergeCells("{$startCol}1:{$endCol}1");
|
|
|
|
|
$sheet->setCellValue("{$startCol}1", $label);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 确保第二行表头正确设置所有子列(包括缺失的列)
|
|
|
|
|
$subIndex = 0;
|
|
|
|
|
foreach (self::USERS_SUB_COLUMNS as $subField => $subLabel) {
|
|
|
|
|
@ -301,7 +301,7 @@ class CommonExport implements FromCollection, WithStyles, WithColumnWidths, With
|
|
|
|
|
$sheet->setCellValue("{$col}2", $subLabel);
|
|
|
|
|
$subIndex++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$index += count(self::USERS_SUB_COLUMNS);
|
|
|
|
|
} elseif (str_contains($field, 'project_users')) {
|
|
|
|
|
// 项目经理信息列:合并第一行的多个单元格
|
|
|
|
|
@ -309,7 +309,7 @@ class CommonExport implements FromCollection, WithStyles, WithColumnWidths, With
|
|
|
|
|
$endCol = $this->getColumnLetter($index + count(self::PROJECT_USERS_SUB_COLUMNS) - 1);
|
|
|
|
|
$sheet->mergeCells("{$startCol}1:{$endCol}1");
|
|
|
|
|
$sheet->setCellValue("{$startCol}1", $label);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 确保第二行表头正确设置所有子列
|
|
|
|
|
$subIndex = 0;
|
|
|
|
|
foreach (self::PROJECT_USERS_SUB_COLUMNS as $subField => $subLabel) {
|
|
|
|
|
@ -317,7 +317,7 @@ class CommonExport implements FromCollection, WithStyles, WithColumnWidths, With
|
|
|
|
|
$sheet->setCellValue("{$col}2", $subLabel);
|
|
|
|
|
$subIndex++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$index += count(self::PROJECT_USERS_SUB_COLUMNS);
|
|
|
|
|
} elseif (str_contains($field, 'history_courses')) {
|
|
|
|
|
// 历史课程信息列:合并第一行的多个单元格
|
|
|
|
|
@ -325,7 +325,7 @@ class CommonExport implements FromCollection, WithStyles, WithColumnWidths, With
|
|
|
|
|
$endCol = $this->getColumnLetter($index + count(self::HISTORY_COURSES_SUB_COLUMNS) - 1);
|
|
|
|
|
$sheet->mergeCells("{$startCol}1:{$endCol}1");
|
|
|
|
|
$sheet->setCellValue("{$startCol}1", $label);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 确保第二行表头正确设置所有子列
|
|
|
|
|
$subIndex = 0;
|
|
|
|
|
foreach (self::HISTORY_COURSES_SUB_COLUMNS as $subField => $subLabel) {
|
|
|
|
|
@ -333,7 +333,7 @@ class CommonExport implements FromCollection, WithStyles, WithColumnWidths, With
|
|
|
|
|
$sheet->setCellValue("{$col}2", $subLabel);
|
|
|
|
|
$subIndex++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$index += count(self::HISTORY_COURSES_SUB_COLUMNS);
|
|
|
|
|
} else {
|
|
|
|
|
// 其他列:合并第一行和第二行
|
|
|
|
|
|