From 5a4ad30aed8871832885526fcb0eaf049540384d Mon Sep 17 00:00:00 2001
From: lx <ex_lixiang17@cosl.com.cn>
Date: 星期二, 05 八月 2025 10:51:32 +0800
Subject: [PATCH] report high light
---
ErrorAnalysis.Service/WordReportHelper.cs | 9 +++-
ErrorAnalysis.UI/ErrorAnalysis.UI.csproj | 68 ++++++++++++++++++----------------
2 files changed, 43 insertions(+), 34 deletions(-)
diff --git a/ErrorAnalysis.Service/WordReportHelper.cs b/ErrorAnalysis.Service/WordReportHelper.cs
index cfa78bb..3196d78 100644
--- a/ErrorAnalysis.Service/WordReportHelper.cs
+++ b/ErrorAnalysis.Service/WordReportHelper.cs
@@ -4,6 +4,7 @@
using SkiaSharp;
using static System.Net.Mime.MediaTypeNames;
using ErrorAnalysis.Service.Model;
+using System.Drawing;
namespace ErrorAnalysis.Service
{
@@ -85,13 +86,17 @@
var cellText = cell.GetText().Replace(ControlChar.Cell, "").Replace(ControlChar.ParagraphBreak, "");
if (cellText.StartsWith("$"))
{
- var property = properties.FirstOrDefault(p => p.Name == cellText.Trim().Replace("$", ""));
+ var name = cellText.Trim().Replace("$", "");
+ var property = properties.FirstOrDefault(p => p.Name == name);
if (property != null)
{
var valStr = property.GetValue(model).ToString();
+ var run = new Run(doc, valStr);
+ if (name == "Pass" || name == "Speed" || name == "Duration")
+ run.Font.Color = Color.Red; run.Font.Bold = true;
cell.FirstParagraph.RemoveAllChildren();
- cell.FirstParagraph.AppendChild(new Run(doc, valStr));
+ cell.FirstParagraph.AppendChild(run);
cell.FirstParagraph.ParagraphFormat.Alignment = ParagraphAlignment.Right;
}
}
diff --git a/ErrorAnalysis.UI/ErrorAnalysis.UI.csproj b/ErrorAnalysis.UI/ErrorAnalysis.UI.csproj
index 9cc6595..3cee911 100644
--- a/ErrorAnalysis.UI/ErrorAnalysis.UI.csproj
+++ b/ErrorAnalysis.UI/ErrorAnalysis.UI.csproj
@@ -1,40 +1,44 @@
锘�<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <OutputType>WinExe</OutputType>
+ <TargetFramework>net8.0-windows</TargetFramework>
+ <Nullable>enable</Nullable>
+ <UseWindowsForms>true</UseWindowsForms>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <ApplicationIcon>Image\logo.ico</ApplicationIcon>
+ <Company>COSL</Company>
+ <Authors>Casing Research Insitute</Authors>
+ <Product>JobPlanner</Product>
+ <Copyright>COSL</Copyright>
+ <Version>1.0.1</Version>
+ </PropertyGroup>
- <PropertyGroup>
- <OutputType>WinExe</OutputType>
- <TargetFramework>net8.0-windows</TargetFramework>
- <Nullable>enable</Nullable>
- <UseWindowsForms>true</UseWindowsForms>
- <ImplicitUsings>enable</ImplicitUsings>
- <ApplicationIcon>Image\logo.ico</ApplicationIcon>
- </PropertyGroup>
+ <ItemGroup>
+ <Content Include="Image\logo.ico" />
+ </ItemGroup>
- <ItemGroup>
- <Content Include="Image\logo.ico" />
- </ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="OxyPlot.WindowsForms" Version="2.2.0" />
+ </ItemGroup>
- <ItemGroup>
- <PackageReference Include="OxyPlot.WindowsForms" Version="2.2.0" />
- </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ErrorAnalysis.Repository\ErrorAnalysis.Repository.csproj" />
+ <ProjectReference Include="..\ErrorAnalysis.Service\ErrorAnalysis.Service.csproj" />
+ </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\ErrorAnalysis.Repository\ErrorAnalysis.Repository.csproj" />
- <ProjectReference Include="..\ErrorAnalysis.Service\ErrorAnalysis.Service.csproj" />
- </ItemGroup>
+ <ItemGroup>
+ <Compile Update="Properties\Resources.Designer.cs">
+ <DesignTime>True</DesignTime>
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ </ItemGroup>
- <ItemGroup>
- <Compile Update="Properties\Resources.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>Resources.resx</DependentUpon>
- </Compile>
- </ItemGroup>
-
- <ItemGroup>
- <EmbeddedResource Update="Properties\Resources.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- </EmbeddedResource>
- </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Update="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ </ItemGroup>
</Project>
\ No newline at end of file
--
Gitblit v1.9.3