### 2025-01-14 星期二更新

----
#### SuperDesign    V3.0.2501.1401
#### 项目功能
- *.[新增]生成列表Html日志支持分组显示。
- *.[新增]更新日志新增支持显示距离最近一次更新的用时。
- *.[改进]优化双击更新日志时的日志展示。
- *.[改进]右键插入更新日志时,支持识别分组并插入。
- *.[修复]修复更新日志如果包含####,生成的MD日志格式不正确的BUG。
#### 网页抓取工具
- *.[新增]新增提交时间显示。
This commit is contained in:
zilinsoft committed 2025-01-14 16:21:28 +08:00
1 parent 2b0b38dd14
commit 9d3c5a384f
13 files changed
+262 -71

No files matched your search

@@ -37,7 +37,7 @@ namespace SuperDesign.Tools.UpLog
int index = 0;
private void BtnCopyMD_Click(object sender, EventArgs e)
{
RyFiles.CopyToClip(MdLog);
RyFiles.CopyToClip(MdLog.Replace("\r\n\r\n","\r\n"));
var git_path= SuperDesign.Manager.APIManager.GetTortoiseGitProcPath();
if(git_path.Length>0 && BFFolderPath.Length>0)
{
@@ -10,7 +10,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Media;
using System.Xml.Linq;
using TheArtOfDev.HtmlRenderer.WinForms;
namespace SuperDesign.Tools
{
@@ -57,30 +59,82 @@ namespace SuperDesign.Tools
for (int l = 0; l < LogText_lines.Length; l++)
{
if (LogText_lines[l].Length == 0) { continue; }
if (LogText.Length > 0) { LogText += "\n"; }
if(dict.ContainsKey(LogText_lines[l]))
if (LogText.Length > 0) { LogText += "<br />"; }
var line = "";
var log_line_n1 = "";
var n1_color = "";
var log_line_n2 = LogText_lines[l];
if(log_line_n2.StartsWith("*.[新增]"))
{
LogText += LogText_lines[l] + "=>" + dict[LogText_lines[l]].ToDateTime().ToString("yyyy-MM-dd HH:mm");
log_line_n1 = "*.[新增]";
n1_color = "blue";
log_line_n2 = log_line_n2.Substring(log_line_n1.Length);
}
else
else if (log_line_n2.StartsWith("*.[改进]"))
{
LogText += LogText_lines[l];
log_line_n1 = "*.[改进]";
n1_color = "green";
log_line_n2 = log_line_n2.Substring(log_line_n1.Length);
}
else if (log_line_n2.StartsWith("*.[修复]"))
{
log_line_n1 = "*.[修复]";
n1_color = "red";
log_line_n2 = log_line_n2.Substring(log_line_n1.Length);
}
line = (log_line_n1.Length==0?"":("<b><span color='"+ n1_color + "'>"+log_line_n1+"</span></b>"))+ System.Web.HttpUtility.HtmlEncode(log_line_n2);
if (dict.ContainsKey(LogText_lines[l]))
{
var dt = dict[LogText_lines[l]].ToDateTime();
var dt_str= dt.ToString("yyyy-MM-dd HH:mm");
if(dt.Date==DateTime.Now.Date)
{ dt_str = "今天 "+ dt.ToString("HH:mm"); }
else if (dt.Date.AddDays(1) == DateTime.Now.Date)
{ dt_str = "昨天 " + dt.ToString("HH:mm"); }
else
{
var index = (int)DateTime.Now.DayOfWeek;
index = index == 0 ? 7 : index;
//当前周的范围
DateTime retStartDay = DateTime.Now.Date.AddDays(-(index - 1));
if(dt >= retStartDay && dt < retStartDay.AddDays(7))
{
dt_str = "本周 " + dt.ToString("dd HH:mm");
}
}
line += "<span color='red'>" + System.Web.HttpUtility.HtmlEncode("=>" + dt_str) + "</span>";
}
if(line.StartsWith("#### "))
{
line ="<b>"+ line + "</b>";
}
LogText += line;
}
RichTextBox2 rich = new RichTextBox2
HtmlPanel htmlPanel = new HtmlPanel
{
Parent = tab,
Font = new Font("微软雅黑", 21),
Dock = DockStyle.Fill,
Font = new Font("微软雅黑", 11),
ReadOnly=true,
BackColor=Color.White,
ScrollBars= RichTextBoxScrollBars.Both,
WordWrap=false,
Location = new Point(label.Left, label.Top + label.Height + 4),
Size = new Size(tab.ClientSize.Width, tab.ClientSize.Height - (label.Top + label.Height + 4)),
Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom,
Text= LogText
BaseStylesheet = "body { font:11pt Consolas }",
Text = "<body>" + LogText + "</body>"
};
//RichTextBox2 rich = new RichTextBox2
//{
// Parent = tab,
// Dock = DockStyle.Fill,
// Font = new Font("微软雅黑", 11),
// ReadOnly=true,
// BackColor=Color.White,
// ScrollBars= RichTextBoxScrollBars.Both,
// WordWrap=false,
// Location = new Point(label.Left, label.Top + label.Height + 4),
// Size = new Size(tab.ClientSize.Width, tab.ClientSize.Height - (label.Top + label.Height + 4)),
// Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom,
// Text= LogText
//};
tabControl1.TabPages.Add(tab);
}
}