From 021e89f0d91d4e4387bf9fb8168a7576c59769c4 Mon Sep 17 00:00:00 2001 From: liuwf Date: Fri, 25 Oct 2024 09:57:08 +0800 Subject: [PATCH] =?UTF-8?q?change-=E4=BC=98=E5=8C=96=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=EF=BC=8C=E7=A6=81=E6=AD=A2=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=8F=8A=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PrintBarCode/MainForm.Designer.cs | 7 ++++--- PrintBarCode/MainForm.cs | 13 +++++++++++++ PrintBarCode/MessageClient.cs | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/PrintBarCode/MainForm.Designer.cs b/PrintBarCode/MainForm.Designer.cs index 7ca658a..b34c1e3 100644 --- a/PrintBarCode/MainForm.Designer.cs +++ b/PrintBarCode/MainForm.Designer.cs @@ -46,15 +46,16 @@ // // logList // + logList.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; logList.BackColor = SystemColors.InactiveCaption; logList.Font = new Font("Microsoft YaHei UI", 14.25F, FontStyle.Bold, GraphicsUnit.Point); logList.ForeColor = Color.ForestGreen; logList.FormattingEnabled = true; logList.HorizontalScrollbar = true; logList.ItemHeight = 26; - logList.Location = new Point(12, 123); + logList.Location = new Point(0, 157); logList.Name = "logList"; - logList.Size = new Size(1439, 654); + logList.Size = new Size(1454, 654); logList.TabIndex = 1; // // label2 @@ -74,12 +75,12 @@ AutoScaleMode = AutoScaleMode.Font; BackColor = SystemColors.ActiveCaption; ClientSize = new Size(1454, 811); - ControlBox = false; Controls.Add(label2); Controls.Add(logList); Controls.Add(label1); FormBorderStyle = FormBorderStyle.FixedDialog; Name = "MainForm"; + SizeGripStyle = SizeGripStyle.Hide; StartPosition = FormStartPosition.CenterScreen; Text = "打印条码服务"; ResumeLayout(false); diff --git a/PrintBarCode/MainForm.cs b/PrintBarCode/MainForm.cs index 3513f28..8daccda 100644 --- a/PrintBarCode/MainForm.cs +++ b/PrintBarCode/MainForm.cs @@ -43,5 +43,18 @@ namespace PrintBarCode } } + + protected override void OnFormClosing(FormClosingEventArgs e) + { + // ȡرղ + e.Cancel = true; + // ״̬ΪС + this.WindowState = FormWindowState.Minimized; + + } + + + + } } \ No newline at end of file diff --git a/PrintBarCode/MessageClient.cs b/PrintBarCode/MessageClient.cs index 64f4df7..cec3d07 100644 --- a/PrintBarCode/MessageClient.cs +++ b/PrintBarCode/MessageClient.cs @@ -88,8 +88,8 @@ namespace PrintBarCode try { string channelWork = $"print_{debugConfig.IP}"; - // string jsonString = _redisHandler.ConsumeMessageFromWorker(channelWork); - string jsonString = "{\"template\":\"product\",\"printContent\":\"[{\\\"saleOrderCode\\\":\\\"\\\",\\\"materialName\\\":\\\"多功能自动剥线钳\\\",\\\"qrcode\\\":\\\"20241019112921CP001\\\",\\\"materialSpec\\\":\\\"\\\",\\\"qty\\\":\\\"1\\\",\\\"materialCode\\\":\\\"MES.MC.A00861\\\",\\\"barcode\\\":\\\"20241019112921CP001\\\",\\\"productPlanCode\\\":\\\"20241019111402JL012\\\"}]\"}"; + string jsonString = _redisHandler.ConsumeMessageFromWorker(channelWork); + // string jsonString = "{\"template\":\"product\",\"printContent\":\"[{\\\"saleOrderCode\\\":\\\"\\\",\\\"materialName\\\":\\\"多功能自动剥线钳\\\",\\\"qrcode\\\":\\\"20241019112921CP001\\\",\\\"materialSpec\\\":\\\"\\\",\\\"qty\\\":\\\"1\\\",\\\"materialCode\\\":\\\"MES.MC.A00861\\\",\\\"barcode\\\":\\\"20241019112921CP001\\\",\\\"productPlanCode\\\":\\\"20241019111402JL012\\\"}]\"}"; if (!string.IsNullOrEmpty(jsonString)) { var result = JsonParser.ParseJson(jsonString);