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);