diff --git a/SGGL/FineUIPro.Web/PZHGL/GJSX/GJSXFind.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/GJSX/GJSXFind.aspx.cs index 5ebbdec8..51b87fa7 100644 --- a/SGGL/FineUIPro.Web/PZHGL/GJSX/GJSXFind.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/GJSX/GJSXFind.aspx.cs @@ -535,22 +535,31 @@ namespace FineUIPro.Web.PZHGL.GJSX cell.CellStyle = cellStyle; cell.SetCellValue(tb.Rows[j]["GJSXTypeName"].ToString()); cell = row.CreateCell(6); - var stateCellStyle = cellStyle; - //if (state == "0") - //{ - // stateCellStyle.FillForegroundColor = IndexedColors.Green.Index; - // //stateCellStyle.FillBackgroundColor = IndexedColors.Green.Index; - //} - //else if (state == "2" || state == "3") - //{ - // //stateCellStyle.FillForegroundColor = IndexedColors.Blue.Index; - // stateCellStyle.FillBackgroundColor = IndexedColors.Blue.Index; - //} - //else if (state == "4") - //{ - // //stateCellStyle.FillForegroundColor = IndexedColors.Red.Index; - // stateCellStyle.FillBackgroundColor = IndexedColors.Red.Index; - //} + + NPOI.SS.UserModel.ICellStyle stateCellStyle = workbook.CreateCellStyle(); + stateCellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; + stateCellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; + stateCellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + stateCellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + stateCellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + stateCellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + stateCellStyle.WrapText = true; + stateCellStyle.SetFont(font); + if (state == "0") + { + stateCellStyle.FillForegroundColor = IndexedColors.Green.Index; + stateCellStyle.FillPattern = FillPattern.SolidForeground; // 填充方式 + } + else if (state == "2" || state == "3") + { + stateCellStyle.FillForegroundColor = IndexedColors.SkyBlue.Index; + stateCellStyle.FillPattern = FillPattern.SolidForeground; // 填充方式 + } + else if (state == "4") + { + stateCellStyle.FillForegroundColor = IndexedColors.Red.Index; + stateCellStyle.FillPattern = FillPattern.SolidForeground; // 填充方式 + } cell.CellStyle = stateCellStyle; cell.SetCellValue(tb.Rows[j]["StateStr"].ToString()); cell = row.CreateCell(7);