Commit 7669e091 刘韬

修正模版标签不能添加超过一行的问题

1 个父辈 05682e0f
...@@ -230,7 +230,8 @@ namespace BLL ...@@ -230,7 +230,8 @@ namespace BLL
BATCH = TryGetDictValue(keyv, "BATCH"), BATCH = TryGetDictValue(keyv, "BATCH"),
MPN = TryGetDictValue(keyv, "MPN"), MPN = TryGetDictValue(keyv, "MPN"),
SiteCode = TryGetDictValue(keyv, "SiteCode"), SiteCode = TryGetDictValue(keyv, "SiteCode"),
TraceCode = "ADMIN", VEN = TryGetDictValue(keyv, "VEN"),
TraceCode = TryGetDictValue(keyv, "Trace"),
}; };
if (string.IsNullOrWhiteSpace(initPPID_Request_DPS.ToLoc)) if (string.IsNullOrWhiteSpace(initPPID_Request_DPS.ToLoc))
...@@ -301,6 +302,7 @@ namespace BLL ...@@ -301,6 +302,7 @@ namespace BLL
public string LotNo { get; set; } public string LotNo { get; set; }
public string DCODE { get; set; } public string DCODE { get; set; }
public string TraceCode { get; set; } public string TraceCode { get; set; }
public string VEN { get; set; }
} }
public class APIResponse public class APIResponse
......
...@@ -61,7 +61,7 @@ namespace SmartScan ...@@ -61,7 +61,7 @@ namespace SmartScan
this.BtnOK.BorderWidth = 2; this.BtnOK.BorderWidth = 2;
this.BtnOK.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this.BtnOK.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnOK.HoldPress = false; this.BtnOK.HoldPress = false;
this.BtnOK.Location = new System.Drawing.Point(508, 673); this.BtnOK.Location = new System.Drawing.Point(508, 656);
this.BtnOK.Name = "BtnOK"; this.BtnOK.Name = "BtnOK";
this.BtnOK.Padding = new System.Windows.Forms.Padding(3); this.BtnOK.Padding = new System.Windows.Forms.Padding(3);
this.BtnOK.Size = new System.Drawing.Size(120, 40); this.BtnOK.Size = new System.Drawing.Size(120, 40);
...@@ -77,7 +77,7 @@ namespace SmartScan ...@@ -77,7 +77,7 @@ namespace SmartScan
this.BtnCancel.BorderWidth = 2; this.BtnCancel.BorderWidth = 2;
this.BtnCancel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this.BtnCancel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.BtnCancel.HoldPress = false; this.BtnCancel.HoldPress = false;
this.BtnCancel.Location = new System.Drawing.Point(634, 673); this.BtnCancel.Location = new System.Drawing.Point(634, 656);
this.BtnCancel.Name = "BtnCancel"; this.BtnCancel.Name = "BtnCancel";
this.BtnCancel.Padding = new System.Windows.Forms.Padding(3); this.BtnCancel.Padding = new System.Windows.Forms.Padding(3);
this.BtnCancel.Size = new System.Drawing.Size(120, 40); this.BtnCancel.Size = new System.Drawing.Size(120, 40);
...@@ -103,17 +103,16 @@ namespace SmartScan ...@@ -103,17 +103,16 @@ namespace SmartScan
// //
// PnlTemp // PnlTemp
// //
this.PnlTemp.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.PnlTemp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.PnlTemp.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); this.PnlTemp.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.PnlTemp.BorderStyle = Asa.FaceControl.ControlShape.Rectangle; this.PnlTemp.BorderStyle = Asa.FaceControl.ControlShape.Rectangle;
this.PnlTemp.BorderWidth = 2; this.PnlTemp.BorderWidth = 2;
this.PnlTemp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230))))); this.PnlTemp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.PnlTemp.Location = new System.Drawing.Point(11, 172); this.PnlTemp.Location = new System.Drawing.Point(11, 184);
this.PnlTemp.Name = "PnlTemp"; this.PnlTemp.Name = "PnlTemp";
this.PnlTemp.Padding = new System.Windows.Forms.Padding(3); this.PnlTemp.Padding = new System.Windows.Forms.Padding(3);
this.PnlTemp.Size = new System.Drawing.Size(743, 495); this.PnlTemp.Size = new System.Drawing.Size(743, 466);
this.PnlTemp.TabIndex = 28; this.PnlTemp.TabIndex = 28;
this.PnlTemp.Text = "facePanel1"; this.PnlTemp.Text = "facePanel1";
this.PnlTemp.TitleFont = new System.Drawing.Font("宋体", 12F); this.PnlTemp.TitleFont = new System.Drawing.Font("宋体", 12F);
...@@ -125,30 +124,30 @@ namespace SmartScan ...@@ -125,30 +124,30 @@ namespace SmartScan
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.flowLayoutPanel1.Location = new System.Drawing.Point(11, 121); this.flowLayoutPanel1.Location = new System.Drawing.Point(11, 121);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(743, 45); this.flowLayoutPanel1.Size = new System.Drawing.Size(743, 63);
this.flowLayoutPanel1.TabIndex = 29; this.flowLayoutPanel1.TabIndex = 29;
// //
// FrmCodeExtract // FrmCodeExtract
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(765, 724); this.ClientSize = new System.Drawing.Size(765, 707);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.PnlTemp); this.Controls.Add(this.PnlTemp);
this.Controls.Add(this.BtnAddMatch); this.Controls.Add(this.BtnAddMatch);
this.Controls.Add(this.BtnCancel); this.Controls.Add(this.BtnCancel);
this.Controls.Add(this.BtnOK); this.Controls.Add(this.BtnOK);
this.Controls.Add(this.LblCode); this.Controls.Add(this.LblCode);
this.Controls.Add(this.flowLayoutPanel1);
this.Icon = global::SmartScan.Properties.Resources.NEO_64; this.Icon = global::SmartScan.Properties.Resources.NEO_64;
this.Name = "FrmCodeExtract"; this.Name = "FrmCodeExtract";
this.Text = "FrmCodeExtract"; this.Text = "FrmCodeExtract";
this.Load += new System.EventHandler(this.FrmCodeExtract_Load); this.Load += new System.EventHandler(this.FrmCodeExtract_Load);
this.Controls.SetChildIndex(this.flowLayoutPanel1, 0);
this.Controls.SetChildIndex(this.LblCode, 0); this.Controls.SetChildIndex(this.LblCode, 0);
this.Controls.SetChildIndex(this.BtnOK, 0); this.Controls.SetChildIndex(this.BtnOK, 0);
this.Controls.SetChildIndex(this.BtnCancel, 0); this.Controls.SetChildIndex(this.BtnCancel, 0);
this.Controls.SetChildIndex(this.BtnAddMatch, 0); this.Controls.SetChildIndex(this.BtnAddMatch, 0);
this.Controls.SetChildIndex(this.PnlTemp, 0); this.Controls.SetChildIndex(this.PnlTemp, 0);
this.Controls.SetChildIndex(this.flowLayoutPanel1, 0);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
......
...@@ -19,10 +19,11 @@ namespace SmartScan ...@@ -19,10 +19,11 @@ namespace SmartScan
private readonly string codeType; private readonly string codeType;
private readonly Dictionary<FaceButton, UsrCodeExtractList> matchButton = new(); private readonly Dictionary<FaceButton, UsrCodeExtractList> matchButton = new();
int windowHeight = 0;
public FrmCodeExtract(string codeText, int codeID,string codeType, List<MaterialCodeMatch> match) public FrmCodeExtract(string codeText, int codeID,string codeType, List<MaterialCodeMatch> match)
{ {
InitializeComponent(); InitializeComponent();
windowHeight = this.Height;
codeText = codeText.Replace("\r", ""); codeText = codeText.Replace("\r", "");
this.codeText = codeText.Replace("\n", ""); this.codeText = codeText.Replace("\n", "");
this.codeID = codeID; this.codeID = codeID;
...@@ -42,10 +43,11 @@ namespace SmartScan ...@@ -42,10 +43,11 @@ namespace SmartScan
private void AddMatch(MaterialCodeMatch match) private void AddMatch(MaterialCodeMatch match)
{ {
FaceButton btn = new() { Text = string.Format("[{0}]", match.Keyword), Margin = new Padding(0, 0, 6, 0), Width = 100, Height = flowLayoutPanel1.Height }; FaceButton btn = new() { Text = string.Format("[{0}]", match.Keyword), Margin = new Padding(0, 0, 6, 6), Width = 100, Height = 50 };
btn.Click += Btn_Click; btn.Click += Btn_Click;
flowLayoutPanel1.Controls.Add(btn); flowLayoutPanel1.Controls.Add(btn);
UsrCodeExtractList list = new(codeText,codeType, codeText.Length, match); UsrCodeExtractList list = new(codeText,codeType, codeText.Length, match);
list.DelClick += List_DelClick; list.DelClick += List_DelClick;
list.KeyChanged += List_KeyChanged; list.KeyChanged += List_KeyChanged;
...@@ -59,8 +61,30 @@ namespace SmartScan ...@@ -59,8 +61,30 @@ namespace SmartScan
pnl.Anchor = PnlTemp.Anchor; pnl.Anchor = PnlTemp.Anchor;
pnl.Visible = false; pnl.Visible = false;
Controls.Add(pnl); Controls.Add(pnl);
clacWindowHeight();
} }
void clacWindowHeight() {
if (flowLayoutPanel1.Controls.Count > 14)
{
matchButton.Values.ToList().ForEach((x)=> {x.GetPanel().Top = 184 + 56 * 2; });
flowLayoutPanel1.Height = 56 * 3;
this.Height = windowHeight + 56 * 2 - 4;
}
else if (flowLayoutPanel1.Controls.Count > 7)
{
matchButton.Values.ToList().ForEach((x) => { x.GetPanel().Top = 184 + 56 * 1; });
flowLayoutPanel1.Height = 56 * 2 - 4;
this.Height = windowHeight + 56;
}
else
{
matchButton.Values.ToList().ForEach((x) => { x.GetPanel().Top = 184; });
flowLayoutPanel1.Height = 56 - 4;
this.Height = windowHeight;
}
}
private void List_KeyChanged(object sender, string key) private void List_KeyChanged(object sender, string key)
{ {
UsrCodeExtractList ctl = sender as UsrCodeExtractList; UsrCodeExtractList ctl = sender as UsrCodeExtractList;
...@@ -84,7 +108,11 @@ namespace SmartScan ...@@ -84,7 +108,11 @@ namespace SmartScan
break; break;
} }
if (matchButton.Count > 0) if (matchButton.Count > 0)
matchButton.ElementAt(0).Value.GetPanel().Visible = true; {
matchButton.Last().Key.HoldPress = true;
matchButton.Last().Value.GetPanel().Visible = true;
}
clacWindowHeight();
} }
private void BtnAddMatch_Click(object sender, EventArgs e) private void BtnAddMatch_Click(object sender, EventArgs e)
...@@ -150,6 +178,7 @@ namespace SmartScan ...@@ -150,6 +178,7 @@ namespace SmartScan
private void FrmCodeExtract_Load(object sender, EventArgs e) private void FrmCodeExtract_Load(object sender, EventArgs e)
{ {
LblCode.Text = codeText; LblCode.Text = codeText;
} }
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!