!9045 !9044 Merge branch 'dev' of <a href="https://gitee.com/jinan-pengyusen…

Merge pull request !9045 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-02-27 01:41:41 +00:00
committed by Gitee
@@ -103,8 +103,9 @@ class InheritMaintenanceEquipment(models.Model):
# 从第3行开始写入数据(第1-2行是表头)
row = 3
# 设置列宽(A列序号列设置为较窄)
# 设置列宽(A列序号列设置为较窄,C列型号列也设置较窄)
sheet.column_dimensions['A'].width = 6 # 序号列宽度
sheet.column_dimensions['C'].width = 12 # 型号列宽度
# 获取模板样式行(使用第3行作为参考)
template_row_idx = 3
@@ -138,7 +139,8 @@ class InheritMaintenanceEquipment(models.Model):
cell.font = copy(template_styles[col]['font'])
cell.fill = copy(template_styles[col]['fill'])
cell.border = copy(template_styles[col]['border'])
cell.alignment = copy(template_styles[col]['alignment'])
# 统一设置居中对齐
cell.alignment = Alignment(horizontal='center', vertical='center')
# A列:序号(从1开始)
sheet.cell(row=row, column=1, value=index)