SVN r1180

SVN-Revision: r1180
This commit is contained in:
cyf
2026-05-20 07:49:34 +00:00
parent 8f863e2d2c
commit 344729076c
3 changed files with 156 additions and 37 deletions
+87 -28
View File
@@ -865,6 +865,10 @@ namespace Lskj.Control.Model
{
return BaseImpl.GetDefaultValue(item["defaultValue"] + "", ParentKey, OtherParams);
}));
Task<string> LookupSqlTask = cachesDic.AddTask(item, "LookupSql", new Task<string>(() =>
{
return BaseImpl.SpecialReplacement(item["lookupSql"] + "", OtherParams);
}));
Task<ControlModel> controlModelTask = cachesDic.AddTask(item, "ControlModel", new Task<ControlModel>(() =>
{
ControlModel controlModel = GetControlModel(item);//获取控件对象
@@ -1590,6 +1594,8 @@ namespace Lskj.Control.Model
break;
case ControlType.LabCheckAutoSeacherValue:
case ControlType.LabCheckAutoSeacherText:
case ControlType.LabAutoCompleteCheckParamValue:
case ControlType.LabAutoCompleteCheckParamText:
// 带复选框自动搜索框
LabelCheckAutoTextEdit checkAutoTextEdit = ctr as LabelCheckAutoTextEdit;
checkAutoTextEdit.AutoTextEdit.SetDataSource(table);
@@ -1616,8 +1622,8 @@ namespace Lskj.Control.Model
LabelCheckText labelCheckText = ctr as LabelCheckText;
break;
case ControlType.LabBillSource:
//LabelBillSourceComboxEdit billSourceComboxEdit = ctr as LabelBillSourceComboxEdit;
//billSourceComboxEdit.SetDataSource(table);
LabelBillSourceComboxEdit billSourceComboxEdit = ctr as LabelBillSourceComboxEdit;
billSourceComboxEdit.SetDataSource(table);
break;
default:
break;
@@ -1696,7 +1702,7 @@ namespace Lskj.Control.Model
/// </summary>
/// <param name="rowItem">The row item.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
public void CopyControlValue(bool refreshSearchSource = false)
public void CopyControlValue(bool Association = true,bool refreshSearchSource = false)
{
try
{
@@ -1762,13 +1768,16 @@ namespace Lskj.Control.Model
}
}
foreach (ControlModel model in this.ControlModels)
if (Association)
{
BaseUserControl control = FindControl(model);
// 树结构节点不清空数据
if (control != null && model.FieldType != ControlType.LabTreeType)
foreach (ControlModel model in this.ControlModels)
{
this.SetUnionAncCalcControl(control);
BaseUserControl control = FindControl(model);
// 树结构节点不清空数据
if (control != null && model.FieldType != ControlType.LabTreeType)
{
this.SetUnionAncCalcControl(control);
}
}
}
}
@@ -2123,6 +2132,8 @@ namespace Lskj.Control.Model
break;
case ControlType.LabCheckAutoSeacherValue:
case ControlType.LabCheckAutoSeacherText:
case ControlType.LabAutoCompleteCheckParamValue:
case ControlType.LabAutoCompleteCheckParamText:
// 带复选框自动搜索框
LabelCheckAutoTextEdit checkAutoTextEdit = ctr as LabelCheckAutoTextEdit;
if (checkAutoTextEdit.CheckEdit.Checked)
@@ -2926,6 +2937,7 @@ namespace Lskj.Control.Model
"ID".Equals(model.FieldName, StringComparison.CurrentCultureIgnoreCase) ||
model.FieldType == ControlType.LabPic ||
model.FieldType == ControlType.LabPicEx || !tableColumns.Columns.Contains(model.FieldName) ||
model.FieldType == ControlType.LabPrompt ||
Autogrowcolumn.ToLower() == model.FieldName.ToLower())
continue;
string fieldValue = this.GetControlValue(model);
@@ -2968,6 +2980,7 @@ namespace Lskj.Control.Model
"ID".Equals(model.FieldName, StringComparison.CurrentCultureIgnoreCase) ||
model.FieldType == ControlType.LabPic ||
model.FieldType == ControlType.LabPicEx || !tableColumns.Columns.Contains(model.FieldName) ||
model.FieldType == ControlType.LabPrompt ||
Autogrowcolumn.ToLower() == model.FieldName.ToLower())
continue;
BaseUserControl userControl = this.FindControl(model);
@@ -3584,6 +3597,10 @@ namespace Lskj.Control.Model
if (baseControl is LabelImageEdit)
{
LabelImageEdit imageEdit = baseControl as LabelImageEdit;
if (imageEdit.TextEdit.Image != null)
{
imageEdit.TextEdit.Image.Dispose();
}
imageEdit.LoadImage(controlValue + "");
}
else if (baseControl is LabelPictureEdit)
@@ -4044,7 +4061,14 @@ namespace Lskj.Control.Model
model.Sign = item.Table.Columns.Contains("TM_tagID") && !string.IsNullOrEmpty(item["TM_tagID"] + "") ? Convert.ToInt32(item["TM_tagID"] + "") : 0;
model.TextMember = item["lookupResult"] + "";
model.ValueMember = item["lookupKeyField"] + "";
model.SourceSql = item["lookupSql"] + "";
if (!dataCaches.GetValue(item, "LookupSql", out string lookupSql))
{
lookupSql = BaseImpl.SpecialReplacement(item["lookupSql"] + "", OtherParams);
}
//model.SourceSql = item["lookupSql"] + "";
model.SourceSql = lookupSql;
model.NullText = item.Table.Columns.Contains("InputHintText") ? item["InputHintText"] + "" : string.Empty;
model.TabOrder = item.Table.Columns.Contains("TabOrder") && !string.IsNullOrEmpty(item["TabOrder"] + "") ? Convert.ToInt32(item["TabOrder"] + "") : 0;
model.CalcExpr = item.Table.Columns.Contains("CalcExpr") ? item["CalcExpr"] + "" : string.Empty;
@@ -4486,6 +4510,8 @@ namespace Lskj.Control.Model
break;
case ControlType.LabCheckAutoSeacherValue:
case ControlType.LabCheckAutoSeacherText:
case ControlType.LabAutoCompleteCheckParamValue:
case ControlType.LabAutoCompleteCheckParamText:
// 带复选框自动搜索框
LabelCheckAutoTextEdit checkAutoTextEdit = new LabelCheckAutoTextEdit();
checkAutoTextEdit.clickAfterEmpty = model.clickAfterEmpty;
@@ -4493,6 +4519,7 @@ namespace Lskj.Control.Model
checkAutoTextEdit.AutoTextEdit.ValueField = model.ValueMember;
checkAutoTextEdit.AutoTextEdit.TextField = model.TextMember;
//checkAutoTextEdit.AutoTextEdit.SetDataSource(dataSource);
if (ControlType.LabAutoCompleteCheckParamValue == model.FieldType || ControlType.LabAutoCompleteCheckParamText == model.FieldType) checkAutoTextEdit.TextEdit.ControlObj = this;
checkAutoTextEdit.TextEdit.SourceSQL = model.SourceSql;
checkAutoTextEdit.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
@@ -4694,26 +4721,30 @@ namespace Lskj.Control.Model
baseControl = labApiButtonEdit;
break;
case ControlType.LabBillSource:
//LabelBillSourceComboxEdit billSourceComboxEdit = new LabelBillSourceComboxEdit();
LabelBillSourceComboxEdit billSourceComboxEdit = new LabelBillSourceComboxEdit();
//billSourceComboxEdit.Button.Visible = true;
//billSourceComboxEdit.OpenDocumentSource += new EventHandler(OpenDocumentSource);
billSourceComboxEdit.Button.Visible = true;
billSourceComboxEdit.OpenDocumentSource += new EventHandler(OpenDocumentSource);
//billSourceComboxEdit.clickAfterEmpty = model.clickAfterEmpty;
//billSourceComboxEdit.ValueMember =model.ValueMember;
//billSourceComboxEdit.ValueField = model.ValueMember;
//billSourceComboxEdit.TextField = model.TextMember;
//billSourceComboxEdit.FormKey = model.FieldName + "_" + model.FormKey;
////billSourceComboxEdit.SetDataSource(dataSource);
//billSourceComboxEdit.TextEdit.SourceSQL = model.SourceSql;
//billSourceComboxEdit.TextEdit.SpeciesValue = ParentKey;
//billSourceComboxEdit.TextEdit.ControlObj = this;
//billSourceComboxEdit.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
////billSourceComboxEdit.TextEdit.TextChanged += new EventHandler(GetAutoSearcher_HandleSQL);
////billSourceComboxEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
//billSourceComboxEdit.TextEdit.HiddenValueChange += new EventHandler(OnTextEditTextChanged);
//if (!isLoadBorder) billSourceComboxEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
//baseControl = billSourceComboxEdit;
billSourceComboxEdit.clickAfterEmpty = model.clickAfterEmpty;
billSourceComboxEdit.ValueMember = model.ValueMember;
billSourceComboxEdit.ValueField = model.ValueMember;
billSourceComboxEdit.TextField = model.TextMember;
billSourceComboxEdit.FormKey = model.FieldName + "_" + model.FormKey;
//billSourceComboxEdit.SetDataSource(dataSource);
billSourceComboxEdit.TextEdit.SourceSQL = model.SourceSql;
billSourceComboxEdit.TextEdit.SpeciesValue = ParentKey;
billSourceComboxEdit.TextEdit.ControlObj = this;
billSourceComboxEdit.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
//billSourceComboxEdit.TextEdit.TextChanged += new EventHandler(GetAutoSearcher_HandleSQL);
//billSourceComboxEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
billSourceComboxEdit.TextEdit.HiddenValueChange += new EventHandler(OnTextEditTextChanged);
if (!isLoadBorder) billSourceComboxEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
baseControl = billSourceComboxEdit;
break;
case ControlType.LabPrompt:
LabelPrompt labelPrompt = new LabelPrompt();
baseControl = labelPrompt;
break;
case ControlType.LabText:
case ControlType.LabTextInt:
@@ -4723,6 +4754,7 @@ namespace Lskj.Control.Model
LabelTextEdit textEdit = new LabelTextEdit();
if (model.FieldType == ControlType.LabTextInt)
{
textEdit.TextEdit.Tag = model;
textEdit.TextEdit.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.OnIntKeyPress);
textEdit.TextEdit.EditValueChanging += new DevExpress.XtraEditors.Controls.ChangingEventHandler(this.OnIntEditValueChanging);
}
@@ -4814,7 +4846,16 @@ namespace Lskj.Control.Model
private void OnIntEditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
{
string newText = e.NewValue as string;
if (sender is TextEdit)
{
TextEdit textEdit = sender as TextEdit;
if (textEdit.Tag is ControlModel)
{
//没有浏览权限默认显示****
ControlModel model = textEdit.Tag as ControlModel;
if (model.Visible && newText.Equals("****")) return;
}
}
// 第一个输入负号不会取消,出现了千位分隔符不会取消更改,末尾为百分号不会取消
if (!newText.Equals("-") && !string.IsNullOrEmpty(newText) && !Regex.IsMatch(newText, @"^(?:-(?:[0-9]+(?:,[0-9]{3})*(?:\.[0-9]*)?)|[0-9]+(?:,[0-9]{3})*(?:\.[0-9]*)?)(?:%)?$"))
@@ -5480,6 +5521,24 @@ namespace Lskj.Control.Model
}
}
if (SpecialLeftTable != null)
{
GridView gridview = SpecialLeftTable.GridControl.DefaultView as GridView;
DataRow rowItem = gridview.GetFocusedDataRow();
if (rowItem != null)
{
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
}
if (SpecialLeftTable is TreeGridControlEx)
{
rowItem = SpecialLeftTable.GetViewFocusedDataRow();
if (rowItem != null)
{
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
}
}
}
return ReplaceHelper.ReplaceWhereCond(sqlValue) + WhereCond;
}
/// <summary>