## 2025-04-24 星期四更新

### SuperDesign    V3.0.2504.2401
#### 项目功能->更新日志
- *.[新增]支持将更新日志直接更新到FTP上。
#### 网页抓取工具
- *.[修复]修复API编辑器在某些情况下因为时间戳识别错误导致报错的BUG。
This commit is contained in:
zilinsoft committed 2025-04-24 16:27:01 +08:00
1 parent 7d0c050763
commit 30afab3ce9
14 files changed
+217 -29

No files matched your search

@@ -39,10 +39,14 @@ namespace 开发辅助工具.Tools
{
dt =RyDate.JSTimeToDateTime(time);
}
else
else if (row.ParamValue.Length==10)
{
dt = time.ToDateTime();
}
else
{
return row.ParamValue;
}
if (dt == DateTime.MinValue || dt<=new DateTime(2000,1,1) || dt >= new DateTime(2100, 1, 1)) { return row.ParamValue; }
if (dt == dt.Date) {return dt.ToString("yyyy-MM-dd"); }
return dt.ToString("yyyy-MM-dd HH:mm:ss");
+14 -4
View File
@@ -92,6 +92,7 @@
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.设为正式版本ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.生成Html日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.生成Html日志并上传到服务器ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.BtnPublishLogs = new ryControls.ButtonEx();
this.timer1 = new System.Windows.Forms.Timer(this.components);
((System.ComponentModel.ISupportInitialize)(this.table1)).BeginInit();
@@ -873,25 +874,33 @@
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.设为正式版本ToolStripMenuItem,
this.生成Html日志ToolStripMenuItem});
this.生成Html日志ToolStripMenuItem,
this.生成Html日志并上传到服务器ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(152, 48);
this.contextMenuStrip1.Size = new System.Drawing.Size(236, 70);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
//
// 设为正式版本ToolStripMenuItem
//
this.设为正式版本ToolStripMenuItem.Name = "设为正式版本ToolStripMenuItem";
this.设为正式版本ToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.设为正式版本ToolStripMenuItem.Size = new System.Drawing.Size(235, 22);
this.设为正式版本ToolStripMenuItem.Text = "设为正式版本";
this.设为正式版本ToolStripMenuItem.Click += new System.EventHandler(this.设为正式版本ToolStripMenuItem_Click);
//
// 生成Html日志ToolStripMenuItem
//
this.生成Html日志ToolStripMenuItem.Name = "生成Html日志ToolStripMenuItem";
this.生成Html日志ToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.生成Html日志ToolStripMenuItem.Size = new System.Drawing.Size(235, 22);
this.生成Html日志ToolStripMenuItem.Text = "生成Html日志";
this.生成Html日志ToolStripMenuItem.Click += new System.EventHandler(this.生成Html日志ToolStripMenuItem_Click);
//
// 生成Html日志并上传到服务器ToolStripMenuItem
//
this.生成Html日志并上传到服务器ToolStripMenuItem.Name = "生成Html日志并上传到服务器ToolStripMenuItem";
this.生成Html日志并上传到服务器ToolStripMenuItem.Size = new System.Drawing.Size(235, 22);
this.生成Html日志并上传到服务器ToolStripMenuItem.Text = "生成Html日志并上传到服务器";
this.生成Html日志并上传到服务器ToolStripMenuItem.Click += new System.EventHandler(this.生成Html日志并上传到服务器ToolStripMenuItem_Click);
//
// BtnPublishLogs
//
this.BtnPublishLogs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -1019,5 +1028,6 @@
private System.Windows.Forms.Timer timer1;
private ryControls.ButtonEx BtnFtpFiles;
private ryControls.ButtonEx BtnPackFileList;
private System.Windows.Forms.ToolStripMenuItem 生成Html日志并上传到服务器ToolStripMenuItem;
}
}
+68 -15
View File
@@ -1814,9 +1814,8 @@ namespace 开发辅助工具.Tools
public List<string> FixInfo { get; set; } = new List<string>();
public List<string> OtherInfo { get; set; } = new List<string>();
}
private void 生成Html日志ToolStripMenuItem_Click(object sender, EventArgs e)
private string GetHtmlLogs()
{
if (LvUpdateLogList.SelectedObjects.Count==0) { return; }
ryCommon.Ini ini = new Ini(GetBFFolderPath() + "\\查看项目.ryp");
var list = LvUpdateLogList.SelectedObjects;
List<UpLogItem> list2 = new List<UpLogItem>();
@@ -1827,11 +1826,11 @@ namespace 开发辅助工具.Tools
}
list2.Sort((x, y) => x.CompareTo(y));
var Main_Project = ini.ReadIni("project", "MainProject", "");
Dictionary<string,Dictionary<string,UpContentInfo>> dict_up = new Dictionary<string, Dictionary<string, UpContentInfo>>();
Dictionary<string, Dictionary<string, UpContentInfo>> dict_up = new Dictionary<string, Dictionary<string, UpContentInfo>>();
Dictionary<string, string> dict_eng_to_chs = new Dictionary<string, string>();
for (int i = 0; i < list2.Count; i++)
{
var item =list2[i];
var item = list2[i];
try
{
JArray jarr = JArray.Parse(item.LogJson);
@@ -1844,14 +1843,14 @@ namespace 开发辅助工具.Tools
continue;
}
var ProjectChsName = item_json.GetJsonValue("ProjectChsName", "");
if (ProjectChsName.Length> 0)
if (ProjectChsName.Length > 0)
{
if (!dict_eng_to_chs.ContainsKey(eng_name))
{ dict_eng_to_chs[eng_name] = ProjectChsName; }
}
if(!dict_up.ContainsKey(eng_name))
if (!dict_up.ContainsKey(eng_name))
{
dict_up[eng_name] =new Dictionary<string, UpContentInfo>();
dict_up[eng_name] = new Dictionary<string, UpContentInfo>();
}
var ValueTime = item_json.GetJsonValue("LogTime", "");
var JSON_ValueTime = ValueTime.Length == 0 ? new JArray() : JArray.Parse(ValueTime);
@@ -1869,7 +1868,7 @@ namespace 开发辅助工具.Tools
var log_item = logs[m];
if (log_item.StartsWith("- *."))
{
log_item=log_item.Substring(2);
log_item = log_item.Substring(2);
}
if (log_item.IndexOf("[开发]") >= 0) { continue; }
if (log_item.StartsWith("#### "))
@@ -1878,11 +1877,11 @@ namespace 开发辅助工具.Tools
}
#region 更新日志
var group = "主功能";
if(dict_group.ContainsKey(log_item))
if (dict_group.ContainsKey(log_item))
{
group = dict_group[log_item];
}
UpContentInfo up_content=null;
UpContentInfo up_content = null;
if (!up_content_all.ContainsKey(group))
{
up_content = new UpContentInfo();
@@ -1912,18 +1911,18 @@ namespace 开发辅助工具.Tools
else
{
up_content.OtherInfo.Add(log_item);
}
}
#endregion
}
}
}
catch(Exception ex)
catch (Exception ex)
{ }
}
string log_text = "";
if (dict_up.ContainsKey(Main_Project))
{
log_text += "<h4>" + System.Web.HttpUtility.HtmlEncode(dict_eng_to_chs.ContainsKey(Main_Project)? dict_eng_to_chs[Main_Project]:Main_Project) + "</h4>";
log_text += "<h2>" + System.Web.HttpUtility.HtmlEncode(dict_eng_to_chs.ContainsKey(Main_Project) ? dict_eng_to_chs[Main_Project] : Main_Project) + "</h2>";
var main_info_all = dict_up[Main_Project];
foreach (var item in main_info_all)
{
@@ -1957,7 +1956,7 @@ namespace 开发辅助工具.Tools
foreach (var item in dict_up)
{
if (item.Key == Main_Project) { continue; }
log_text += "\r\n<h4>" + System.Web.HttpUtility.HtmlEncode(dict_eng_to_chs.ContainsKey(item.Key) ? dict_eng_to_chs[item.Key] : item.Key) + "</h4>";
log_text += "\r\n<h2>" + System.Web.HttpUtility.HtmlEncode(dict_eng_to_chs.ContainsKey(item.Key) ? dict_eng_to_chs[item.Key] : item.Key) + "</h2>";
var main_info_all = item.Value;
foreach (var item2 in main_info_all)
{
@@ -1988,7 +1987,12 @@ namespace 开发辅助工具.Tools
}
}
}
RyFiles.CopyToClip(log_text.Trim());
return log_text.Trim();
}
private void 生成Html日志ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (LvUpdateLogList.SelectedObjects.Count==0) { return; }
RyFiles.CopyToClip(GetHtmlLogs());
MessageBox.Show("已复制到剪切板。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
bool ProcUse = false;
@@ -2046,6 +2050,55 @@ namespace 开发辅助工具.Tools
frm.Dispose();
}
}
private void 生成Html日志并上传到服务器ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (LvUpdateLogList.SelectedObjects.Count == 0) { return; }
var html = GetHtmlLogs();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
var ds = db.ReadData("select * from Settings where name='Setting'");
if (ds.HaveData())
{
var row = ds.GetRow(0);
ryCommon.Storage mStor = new ryCommon.Storage(row["value"].ToString());
mStor.SelectNodeBySet();
var bf_folder = GetBFFolderPath();
if (bf_folder != "")
{
ryCommon.Ini ini = new ryCommon.Ini(bf_folder + "\\查看项目.ryp");
var eng_name = ini.ReadIni("project", "engname");
var proglang = ini.ReadIni("project", "proglang");
var confuse = ini.ReadIni("project", "confuse", 1);
var upload_name = ini.ReadIni("project", "UploadLogName");
if (upload_name.Trim().Length == 0) { upload_name = eng_name; }
var ftpid = mStor.GetAttrValue("ftpid", 0);
var ftp_remote_dir = mStor.GetAttrValue("ftp_remote_dir");
if (ftpid > 0)
{
this.Invoke(new Action(() =>
{
RyFiles.WriteAllText(Application.StartupPath + "\\temp_"+ upload_name + ".html", html);
SuperDesign.Manager.FTP.FrmUploadUpdateZipToFtp frm = new SuperDesign.Manager.FTP.FrmUploadUpdateZipToFtp();
frm.UpdateLogMode = true;
frm.UpdateHtml = html;
frm.LocalPath = Application.StartupPath + "\\temp_" + upload_name + ".html";
frm.EngName = upload_name;
frm.FTPId = ftpid;
frm.RemoteDir = ftp_remote_dir.TrimEnd('/')+ "/WebUpdateLogs/";
if (frm.ShowDialog() == DialogResult.OK)
{
//ShowState("上传完成...");
}
frm.Dispose();
RyFiles.DeleteFile(Application.StartupPath + "\\temp_"+ upload_name + ".html");
}));
}
}
}
}
}
}
class UpLogItem
{
@@ -126,9 +126,6 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>285, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>285, 17</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>392, 17</value>
</metadata>