From b54d247ffc912c4af1c96fe05bc6ca1630a77be0 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期四, 03 四月 2025 23:58:51 +0800 Subject: [PATCH] 1 --- DevApp/Gs.DevApp/UserControl/Toast.Designer.cs | 62 ++++++++++---------- DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs | 40 ++++++++----- DevApp/Gs.DevApp/DevFrm/Work/Frm_Repair.Designer.cs | 12 ++- DevApp/Gs.DevApp/UserControl/UcDictionary.cs | 17 +++-- 4 files changed, 74 insertions(+), 57 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Repair.Designer.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Repair.Designer.cs index 8346cb0..da56094 100644 --- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Repair.Designer.cs +++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Repair.Designer.cs @@ -67,9 +67,9 @@ this.splitMx1 = new DevExpress.XtraEditors.SplitContainerControl(); this.splitTop1 = new DevExpress.XtraEditors.SplitContainerControl(); this.layoutMx1 = new DevExpress.XtraLayout.LayoutControl(); - this.txt_badReson = new UcDictionary(); - this.txt_remark = new UcDictionary(); - this.txt_repairMethd = new UcDictionary(); + this.txt_badReson = new Gs.DevApp.UserControl.UcDictionary(); + this.txt_remark = new Gs.DevApp.UserControl.UcDictionary(); + this.txt_repairMethd = new Gs.DevApp.UserControl.UcDictionary(); this.lbGuid = new System.Windows.Forms.Label(); this.txt_gdbh = new DevExpress.XtraEditors.TextEdit(); this.txt_gx = new DevExpress.XtraEditors.TextEdit(); @@ -544,15 +544,17 @@ this.txt_badReson.Size = new System.Drawing.Size(410, 54); this.txt_badReson.TabIndex = 26; this.txt_badReson.TextTxt = ""; + this.txt_badReson.WhereTxt = "s_type=\'鐜板満缁翠慨涓嶈壇鍘熷洜\'"; // // txt_remark // - this.txt_remark.BtnTxt = "涓嶈壇鐜板儚"; + this.txt_remark.BtnTxt = "涓嶈壇鐜拌薄"; this.txt_remark.Location = new System.Drawing.Point(12, 96); this.txt_remark.Name = "txt_remark"; this.txt_remark.Size = new System.Drawing.Size(410, 54); this.txt_remark.TabIndex = 25; this.txt_remark.TextTxt = ""; + this.txt_remark.WhereTxt = "s_type=\'鐜板満缁翠慨涓嶈壇鐜拌薄\'"; // // txt_repairMethd // @@ -562,7 +564,7 @@ this.txt_repairMethd.Size = new System.Drawing.Size(411, 112); this.txt_repairMethd.TabIndex = 24; this.txt_repairMethd.TextTxt = ""; - + this.txt_repairMethd.WhereTxt = "s_type=\'鐜板満缁翠慨涓嶈壇瀵圭瓥\'"; // // lbGuid // diff --git a/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs b/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs index 4e550af..b654e33 100644 --- a/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs +++ b/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs @@ -32,16 +32,16 @@ DevExpress.XtraLayout.RowDefinition rowDefinition1 = new DevExpress.XtraLayout.RowDefinition(); DevExpress.XtraLayout.RowDefinition rowDefinition2 = new DevExpress.XtraLayout.RowDefinition(); this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); + this.panel1 = new System.Windows.Forms.Panel(); this.testo = new DevExpress.XtraEditors.LabelControl(); this.Root = new DevExpress.XtraLayout.LayoutControlGroup(); - this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); - this.panel1 = new System.Windows.Forms.Panel(); this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); + this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit(); this.layoutControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit(); this.SuspendLayout(); // // layoutControl1 @@ -53,9 +53,18 @@ this.layoutControl1.Name = "layoutControl1"; this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(1108, 126, 812, 500); this.layoutControl1.Root = this.Root; - this.layoutControl1.Size = new System.Drawing.Size(644, 705); + this.layoutControl1.Size = new System.Drawing.Size(567, 590); this.layoutControl1.TabIndex = 9; this.layoutControl1.Text = "layoutControl1"; + // + // panel1 + // + this.panel1.BackgroundImage = global::Gs.DevApp.Properties.Resources.ok123; + this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.panel1.Location = new System.Drawing.Point(12, 12); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(543, 517); + this.panel1.TabIndex = 8; // // testo // @@ -68,9 +77,9 @@ this.testo.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; this.testo.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; this.testo.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical; - this.testo.Location = new System.Drawing.Point(12, 648); + this.testo.Location = new System.Drawing.Point(12, 533); this.testo.Name = "testo"; - this.testo.Size = new System.Drawing.Size(620, 45); + this.testo.Size = new System.Drawing.Size(543, 45); this.testo.StyleController = this.layoutControl1; this.testo.TabIndex = 7; this.testo.Text = "labelControl1"; @@ -95,38 +104,29 @@ this.Root.OptionsTableLayoutGroup.RowDefinitions.AddRange(new DevExpress.XtraLayout.RowDefinition[] { rowDefinition1, rowDefinition2}); - this.Root.Size = new System.Drawing.Size(644, 705); + this.Root.Size = new System.Drawing.Size(567, 590); this.Root.TextVisible = false; - // - // layoutControlItem1 - // - this.layoutControlItem1.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center; - this.layoutControlItem1.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; - this.layoutControlItem1.Control = this.testo; - this.layoutControlItem1.Location = new System.Drawing.Point(0, 636); - this.layoutControlItem1.Name = "layoutControlItem1"; - this.layoutControlItem1.OptionsTableLayoutItem.RowIndex = 1; - this.layoutControlItem1.Size = new System.Drawing.Size(624, 49); - this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); - this.layoutControlItem1.TextVisible = false; - // - // panel1 - // - this.panel1.BackgroundImage = global::Gs.DevApp.Properties.Resources.ok123; - this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.panel1.Location = new System.Drawing.Point(12, 12); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(620, 632); - this.panel1.TabIndex = 8; // // layoutControlItem2 // this.layoutControlItem2.Control = this.panel1; this.layoutControlItem2.Location = new System.Drawing.Point(0, 0); this.layoutControlItem2.Name = "layoutControlItem2"; - this.layoutControlItem2.Size = new System.Drawing.Size(624, 636); + this.layoutControlItem2.Size = new System.Drawing.Size(547, 521); this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem2.TextVisible = false; + // + // layoutControlItem1 + // + this.layoutControlItem1.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center; + this.layoutControlItem1.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; + this.layoutControlItem1.Control = this.testo; + this.layoutControlItem1.Location = new System.Drawing.Point(0, 521); + this.layoutControlItem1.Name = "layoutControlItem1"; + this.layoutControlItem1.OptionsTableLayoutItem.RowIndex = 1; + this.layoutControlItem1.Size = new System.Drawing.Size(547, 49); + this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); + this.layoutControlItem1.TextVisible = false; // // Toast // @@ -134,7 +134,7 @@ this.Appearance.Options.UseBackColor = true; this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(644, 705); + this.ClientSize = new System.Drawing.Size(567, 590); this.ControlBox = false; this.Controls.Add(this.layoutControl1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; @@ -148,8 +148,8 @@ ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit(); this.layoutControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit(); this.ResumeLayout(false); } diff --git a/DevApp/Gs.DevApp/UserControl/UcDictionary.cs b/DevApp/Gs.DevApp/UserControl/UcDictionary.cs index 8503b12..425fe1e 100644 --- a/DevApp/Gs.DevApp/UserControl/UcDictionary.cs +++ b/DevApp/Gs.DevApp/UserControl/UcDictionary.cs @@ -19,10 +19,8 @@ InitializeComponent(); } - - /// <summary> - /// 鎬昏褰曟暟 + /// 鎸夐挳鏂囧瓧 /// </summary> public string BtnTxt { @@ -33,9 +31,8 @@ } } - /// <summary> - /// 鎬昏褰曟暟 + /// 鏂囨湰妗嗘枃瀛� /// </summary> public string TextTxt { @@ -46,9 +43,17 @@ } } + /// <summary> + /// 鏌ヨ鏉′欢 + /// </summary> + public string WhereTxt + { + get; + set; + } private void simpleButton1_Click(object sender, EventArgs e) { - UcDictionarySelect frm = new UcDictionarySelect(this.BtnTxt, ""); + UcDictionarySelect frm = new UcDictionarySelect(this.BtnTxt, this.WhereTxt); frm.UpdateParent += (ss, ee) => { System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); diff --git a/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs b/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs index 9b53c8c..9e3a574 100644 --- a/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs +++ b/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs @@ -6,7 +6,6 @@ using System; using System.Collections.Generic; using System.Data; -using System.Text; using System.Windows.Forms; @@ -14,31 +13,31 @@ { public partial class UcDictionarySelect : DevExpress.XtraEditors.XtraForm { - private List<string> lstCheckedKeyID = new List<string>();//閫夋嫨灞�ID闆嗗悎 + private List<dynamic> lstCheckedKeyID = new List<dynamic>();//閫夋嫨闆嗗悎 string strTitle = ""; string strWhere = ""; public UcDictionarySelect(string _strTitle, string _strWhere) { InitializeComponent(); - tlMenu.CustomDrawNodeCheckBox += TreeList1_CustomDrawNodeCheckBox; - getTree(); - tlMenu.OptionsBehavior.Editable = true; - tlMenu.OptionsSelection.EnableAppearanceFocusedCell = false; - tlMenu.OptionsSelection.MultiSelect = true; - tlMenu.OptionsSelection.MultiSelectMode = TreeListMultiSelectMode.CellSelect; this.strTitle = _strTitle; this.strWhere = _strWhere; this.Text = _strTitle; + getTree(); + tlMenu.CustomDrawNodeCheckBox += TreeList1_CustomDrawNodeCheckBox; + // tlMenu.OptionsBehavior.Editable = true; + tlMenu.OptionsSelection.EnableAppearanceFocusedCell = false; + // tlMenu.OptionsSelection.MultiSelect = true; + // tlMenu.OptionsSelection.MultiSelectMode = TreeListMultiSelectMode.CellSelect; btnIn.Click += (s, e) => { findOrigin(tlMenu); var list = new List<dynamic>(); - foreach (string key in lstCheckedKeyID) + foreach (dynamic key in lstCheckedKeyID) { list.Add(new { - // dicCode = "001", - dicTxt = key + dicCode = key.dicCode, + dicTxt = key.dicTxt }); }; UpdateParent?.Invoke(this, new UpdateParentEventArgs { DynamicList = list }); @@ -84,7 +83,8 @@ /// </summary> private void getTree() { - var pgq = new PageQueryModel(1, 999999, "a.defect_name"); + string _where = " and 1=1 and "+this.strWhere; + var pgq = new PageQueryModel(1, 999999, "a.defect_name","asc","", _where); var json = JsonConvert.SerializeObject(pgq); try { @@ -125,20 +125,30 @@ if (drv != null) { string KeyFieldName = (string)drv["defectName"]; - lstCheckedKeyID.Add(KeyFieldName); + string dicCode = (string)drv["defectCode"]; + lstCheckedKeyID.Add(new + { + dicCode = dicCode, + dicTxt = KeyFieldName + }); } } return;//閫掑綊缁堟 } foreach (TreeListNode node in parentNode.Nodes) { - if (node.CheckState == CheckState.Checked) + if (node.CheckState == CheckState.Checked && parentNode.Nodes.Count == 0) { DataRowView drv = tlMenu.GetDataRecordByNode(node) as DataRowView;//鍏抽敭浠g爜锛屽氨鏄笉鐭ラ亾鏄繖鏍疯幏鍙栨暟鎹�岀籂缁撲簡寰堜箙(楝肩煡閬撳彲浠ヨ浆鎹负DataRowView鍟�) if (drv != null) { string KeyFieldName = (string)drv["defectName"]; - lstCheckedKeyID.Add(KeyFieldName); + string dicCode = (string)drv["defectCode"]; + lstCheckedKeyID.Add(new + { + dicCode = dicCode, + dicTxt = KeyFieldName + }); } } GetCheckedKeyID(node); -- Gitblit v1.9.3