现场优化6
This commit is contained in:
@@ -239,6 +239,24 @@ namespace ExportModule.ViewModels
|
||||
var dataRange = ws.Range(row, 1, row, headers.Length);
|
||||
dataRange.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
dataRange.Style.Border.InsideBorder = XLBorderStyleValues.Thin;
|
||||
|
||||
// 根据 Result 设置行背景色(与 UI DataGrid 配色一致)
|
||||
// Result: "0"=运行中, "1"=通过, "2"=失败
|
||||
if (e.Result is "运行中" or "成功" or "失败")
|
||||
{
|
||||
XLColor rowColor = e.Result switch
|
||||
{
|
||||
"运行中" => XLColor.FromArgb(0xB3, 0xD9, 0xFF), // 运行中 - 浅蓝
|
||||
"成功" => XLColor.FromArgb(0xB2, 0xFF, 0xB2), // 通过 - 浅绿
|
||||
"失败" => XLColor.FromArgb(0xFF, 0xB2, 0xB2), // 失败 - 浅红
|
||||
_ => XLColor.White
|
||||
};
|
||||
dataRange.Style.Fill.BackgroundColor = rowColor;
|
||||
}
|
||||
|
||||
// 异常流程步骤额外标记(字体加粗 + 橙色字体)
|
||||
if (e.IsErrorStep)
|
||||
dataRange.Style.Font.FontColor = XLColor.DarkOrange;
|
||||
}
|
||||
|
||||
ws.Columns().AdjustToContents();
|
||||
|
||||
Reference in New Issue
Block a user