### 2024-12-20 星期五更新

------
#### SuperDesign    V3.0.2412.2001
- *.[新增]新增程序更新日志设置和自动发布功能。
- *.[修复]修复Post数据格式不正确时双击文本框会导致软件闪退的BUG。
This commit is contained in:
zilinsoft committed 2024-12-20 08:15:19 +08:00
1 parent 03bcb8c5fd
commit 993f1ca1a9
349 files changed
+81977 -13873

No files matched your search

+28 -6
View File
@@ -42,9 +42,11 @@
this.OlvDesc = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.设置时间戳ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.设置jsonToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.添加参数ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.删除参数ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.复制参数名ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.BtnCancel = new ryControls.ButtonEx();
this.BtnOK = new ryControls.ButtonEx();
this.BtnAddPost = new ryControls.ButtonEx();
@@ -160,9 +162,11 @@
this.LvPostData.UseCompatibleStateImageBehavior = false;
this.LvPostData.View = System.Windows.Forms.View.Details;
this.LvPostData.CellEditFinishing += new BrightIdeasSoftware.CellEditEventHandler(this.LvPostData_CellEditFinishing);
this.LvPostData.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.LvPostData_MouseDoubleClick);
//
// OlvParamName
//
this.OlvParamName.IsEditable = true;
this.OlvParamName.Text = "参数名";
this.OlvParamName.Width = 120;
//
@@ -188,38 +192,54 @@
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.设置时间戳ToolStripMenuItem,
this.设置jsonToolStripMenuItem,
this.toolStripMenuItem1,
this.添加参数ToolStripMenuItem,
this.删除参数ToolStripMenuItem});
this.删除参数ToolStripMenuItem,
this.复制参数名ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(137, 76);
this.contextMenuStrip1.Size = new System.Drawing.Size(149, 120);
//
// 设置时间戳ToolStripMenuItem
//
this.设置时间戳ToolStripMenuItem.Name = "设置时间戳ToolStripMenuItem";
this.设置时间戳ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
this.设置时间戳ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
this.设置时间戳ToolStripMenuItem.Text = "设置时间戳";
this.设置时间戳ToolStripMenuItem.Click += new System.EventHandler(this.设置时间戳ToolStripMenuItem_Click);
//
// 设置jsonToolStripMenuItem
//
this.设置jsonToolStripMenuItem.Name = "设置jsonToolStripMenuItem";
this.设置jsonToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
this.设置jsonToolStripMenuItem.Text = "设置json文本";
this.设置jsonToolStripMenuItem.Click += new System.EventHandler(this.设置jsonToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(133, 6);
this.toolStripMenuItem1.Size = new System.Drawing.Size(145, 6);
//
// 添加参数ToolStripMenuItem
//
this.添加参数ToolStripMenuItem.Name = "添加参数ToolStripMenuItem";
this.添加参数ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
this.添加参数ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
this.添加参数ToolStripMenuItem.Text = "添加参数";
this.添加参数ToolStripMenuItem.Click += new System.EventHandler(this.添加参数ToolStripMenuItem_Click);
//
// 删除参数ToolStripMenuItem
//
this.删除参数ToolStripMenuItem.Name = "删除参数ToolStripMenuItem";
this.删除参数ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
this.删除参数ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
this.删除参数ToolStripMenuItem.Text = "删除参数";
this.删除参数ToolStripMenuItem.Click += new System.EventHandler(this.删除参数ToolStripMenuItem_Click);
//
// 复制参数名ToolStripMenuItem
//
this.复制参数名ToolStripMenuItem.Name = "复制参数名ToolStripMenuItem";
this.复制参数名ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
this.复制参数名ToolStripMenuItem.Text = "复制参数名";
this.复制参数名ToolStripMenuItem.Click += new System.EventHandler(this.复制参数名ToolStripMenuItem_Click);
//
// BtnCancel
//
this.BtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@@ -386,5 +406,7 @@
private System.Windows.Forms.ToolStripMenuItem 设置时间戳ToolStripMenuItem;
private System.Windows.Forms.Label label5;
private ryControls.TextBoxEx2 TxtDesc;
private System.Windows.Forms.ToolStripMenuItem 设置jsonToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 复制参数名ToolStripMenuItem;
}
}
@@ -15,6 +15,8 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using 开发辅助工具.Manager;
using 开发辅助工具.Tools;
using SuperDesign.Manager;
using Newtonsoft.Json;
namespace 开发辅助工具.Tools
{
@@ -32,7 +34,15 @@ namespace 开发辅助工具.Tools
{
long time = row.ParamValue.ToInt64();
if (time <= 100000) { return row.ParamValue; }
var dt = time.ToDateTime();
var dt = DateTime.MinValue;
if (row.ParamValue.Length == 13)
{
dt =RyDate.JSTimeToDateTime(time);
}
else
{
dt = time.ToDateTime();
}
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");
@@ -153,52 +163,7 @@ namespace 开发辅助工具.Tools
}
else
{
switch(item.Key.ToLower())
{
case "starttime":
title = "开始时间";
break;
case "endtime":
title = "结束时间";
break;
case "page":
title = "页码";
break;
case "pagesize":
title = "每页数量";
break;
case "title":
title = "标题";
break;
case "name":
title = "名称";
break;
case "id":
title = "id编号";
break;
case "modelid":
title = "资源类型";
break;
case "packagename":
case "pkgname":
title = "包名";
break;
case "filename":
title = "文件名";
break;
case "url":
title = "网址";
break;
case "username":
title = "用户名";
break;
case "realname":
title = "真实姓名";
break;
case "cooperid":
title = "合作包id";
break;
}
title= APIManager.GetParamTitle(item.Key);
}
list.Add(new PostInfo() { ParamName = item.Key, ParamValue = item.Value,Title=title,Desc=desc });
}
@@ -270,7 +235,7 @@ namespace 开发辅助工具.Tools
}
else
{
post += item.ParamName + "=" +RyWeb.WebDecode.UrlEncode(item.ParamValue);
post += item.ParamName + "=" +RyWeb.WebDecode.UrlEncode(item.ParamValue,Encoding.UTF8);
}
if(dict_post.ContainsKey(item.ParamName))
{
@@ -318,6 +283,10 @@ namespace 开发辅助工具.Tools
{
row.Title = e.NewValue.ToString();
}
else if (e.Column == OlvParamName)
{
row.ParamName = e.NewValue.ToString();
}
else if (e.Column == OlvParamValue)
{
row.ParamValue = e.NewValue.ToString();
@@ -426,15 +395,85 @@ namespace 开发辅助工具.Tools
var text = item.ParamValue;
if (text.Length > 4 && text.IsInt())
{
frm.dateTimePickerEX1.Value = RyDate.UnixTimeToDateTime(text);
if (text.Length == 13)
{
frm.IsJsTime = true;
frm.dateTimePickerEX1.Value = RyDate.JSTimeToDateTime(text);
}
else
{
frm.dateTimePickerEX1.Value = RyDate.UnixTimeToDateTime(text);
}
}
if (frm.ShowDialog() == DialogResult.OK)
{
item.ParamValue= RyDate.DateTimeToUnixTime(frm.dateTimePickerEX1.Value).ToString();
{
if (frm.IsJsTime)
{
item.ParamValue = RyDate.DateTimeToJSTime(frm.dateTimePickerEX1.Value).ToString();
}
else
{
item.ParamValue = RyDate.DateTimeToUnixTime(frm.dateTimePickerEX1.Value).ToString();
}
LvPostData.RefreshObject(item);
}
frm.Dispose();
}
private void LvPostData_MouseDoubleClick(object sender, MouseEventArgs e)
{
设置jsonToolStripMenuItem.PerformClick();
}
private void 设置jsonToolStripMenuItem_Click(object sender, EventArgs e)
{
if (LvPostData.SelectedObject == null) { return; }
var item = (PostInfo)LvPostData.SelectedObject;
try
{
if (item.ParamValue.StartsWith("{") || item.ParamValue.StartsWith("["))
{
JObject jo2 = JObject.Parse(item.ParamValue);
开发辅助工具.Controls.FrmText frm = new Controls.FrmText
{
Icon = Icon
};
frm.highlightEditor1.Visible = true;
frm.richTextBox1.Visible = false;
try
{
frm.highlightEditor1.SetHightlightText(Manager.Json.ConvertJsonString(item.ParamValue), "json");
}
catch
{
frm.highlightEditor1.SetHightlightText(item.ParamValue, "txt");
}
if (frm.ShowDialog() == DialogResult.OK)
{
try
{
JObject jo = (JObject)JsonConvert.DeserializeObject(frm.highlightEditor1.Text);
var aa = Newtonsoft.Json.JsonConvert.SerializeObject(jo, new Newtonsoft.Json.JsonSerializerSettings() { StringEscapeHandling = Newtonsoft.Json.StringEscapeHandling.EscapeNonAscii });
item.ParamValue = aa;
LvPostData.RefreshObject(item);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "出错", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
catch { }
}
private void 复制参数名ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (LvPostData.SelectedObject == null) { return; }
var row = (PostInfo)LvPostData.SelectedObject;
RyFiles.CopyToClip(row.ParamName);
}
}
public class PostInfo
{
@@ -28,15 +28,19 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAddPostParam));
this.LvPostData = new BrightIdeasSoftware.ObjectListView();
this.OlvParamName = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvTitle = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvParamValue = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvDesc = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.删除该参数ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.BtnCancel = new ryControls.ButtonEx();
this.BtnOK = new ryControls.ButtonEx();
((System.ComponentModel.ISupportInitialize)(this.LvPostData)).BeginInit();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// LvPostData
@@ -55,6 +59,7 @@
this.OlvTitle,
this.OlvParamValue,
this.OlvDesc});
this.LvPostData.ContextMenuStrip = this.contextMenuStrip1;
this.LvPostData.Cursor = System.Windows.Forms.Cursors.Default;
this.LvPostData.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.LvPostData.FullRowSelect = true;
@@ -76,7 +81,7 @@
// OlvParamName
//
this.OlvParamName.Text = "参数名";
this.OlvParamName.Width = 100;
this.OlvParamName.Width = 120;
//
// OlvTitle
//
@@ -96,6 +101,20 @@
this.OlvDesc.Text = "备注";
this.OlvDesc.Width = 200;
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.删除该参数ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 48);
//
// 删除该参数ToolStripMenuItem
//
this.删除该参数ToolStripMenuItem.Name = "删除该参数ToolStripMenuItem";
this.删除该参数ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.删除该参数ToolStripMenuItem.Text = "删除该参数";
this.删除该参数ToolStripMenuItem.Click += new System.EventHandler(this.删除该参数ToolStripMenuItem_Click);
//
// BtnCancel
//
this.BtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@@ -133,6 +152,7 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "添加参数";
((System.ComponentModel.ISupportInitialize)(this.LvPostData)).EndInit();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -145,5 +165,7 @@
private ryControls.ButtonEx BtnOK;
public BrightIdeasSoftware.ObjectListView LvPostData;
private BrightIdeasSoftware.OLVColumn OlvParamValue;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem 删除该参数ToolStripMenuItem;
}
}
@@ -131,5 +131,44 @@ namespace 开发辅助工具.Tools.API
BtnOK.PerformClick();
}
}
private void 删除该参数ToolStripMenuItem_Click(object sender, EventArgs e)
{
var row = (PostInfo)LvPostData.SelectedObject;
if (row == null) { return; }
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
RyQuickSQL mySQL = new RyQuickSQL("api");
mySQL.AddField("Url", Url);
DataSet ds = db.ReadData("select * from api where Url=@Url", mySQL);
var json_post = "";
if (ds.HaveData())
{
json_post = ds.GetFirstRowData()["Postdata"].ToString();
}
JObject jo;
if (json_post.Length == 0) { jo = new JObject(); }
else { jo = JObject.Parse(json_post); }
if (jo.ContainsKey("list"))
{
JArray jarr = JArray.Parse(jo["list"].ToString());
for (int i = 0; i < jarr.Count; i++)
{
var item = jarr[i];
var param_name = item["paramname"].ToString("");
if(param_name==row.ParamName)
{
jarr.Remove(item);
break;
}
}
jo["list"] = jarr;
}
mySQL.AddField("Postdata", jo.ToString());
db.ExecuteNonQuery(mySQL.GetUpdateSQL() + " where Url=@Url", mySQL);
}
db.Free();
}
}
}
@@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>15, 21</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>