SVN r1180
SVN-Revision: r1180
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -1285,6 +1285,18 @@ namespace Lskj.Control
|
||||
{
|
||||
dragRowsIndex = gcMain.GridView.GetSelectedRows();
|
||||
|
||||
// 复选框多选时,只允许从已选中行发起拖拽。
|
||||
// 如果从未选中行拖拽,不移动已勾选行,避免拖拽对象和选中对象不一致。
|
||||
if (dragRowsIndex != null
|
||||
&& dragRowsIndex.Length > 1
|
||||
&& !dragRowsIndex.Contains(_hit.RowHandle))
|
||||
{
|
||||
m_dragHandle = -1;
|
||||
isSortDrag = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m_dragHandle = _hit.RowHandle;
|
||||
m_mouseDownLocation = e.Location;
|
||||
}
|
||||
@@ -1352,6 +1364,31 @@ namespace Lskj.Control
|
||||
int endIndex = -1;
|
||||
if (m_dragRowShadow != null)
|
||||
{
|
||||
|
||||
bool isMultiDrag = dragRowsIndex != null && dragRowsIndex.Length > 1;
|
||||
if (isMultiDrag)
|
||||
{
|
||||
bool hasOtherSort = gcMain.GridView.SortedColumns
|
||||
.Cast<DevExpress.XtraGrid.Columns.GridColumn>()
|
||||
.Any(x => !string.Equals(x.FieldName, DetailOrderField, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (hasOtherSort)
|
||||
{
|
||||
m_dragRowShadow.Close();
|
||||
m_dragRowShadow.Dispose();
|
||||
m_dragRowShadow = null;
|
||||
|
||||
isSortDrag = false;
|
||||
m_dragHandle = -1;
|
||||
|
||||
gcMain.GridView.Columns.ClearAllSort();
|
||||
MessageUtil.Show("多选时不能存在其它列排序,已清除排序,请重新拖拽排序。");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var _hit = gcMain.GridView.CalcHitInfo(e.Location);
|
||||
|
||||
this.EndDrag(_hit.RowHandle);
|
||||
|
||||
@@ -459,10 +459,26 @@ namespace Lskj.Control
|
||||
if (rightChildren.Count == 1)
|
||||
rightTab.ShowTabHeader = DevExpress.Utils.DefaultBoolean.False;
|
||||
|
||||
|
||||
GridControlEx leftControl = new GridControlEx();
|
||||
if (leftCtrl is GridControlEx left1)
|
||||
{
|
||||
leftControl = left1;
|
||||
}
|
||||
else if (leftCtrl is ModuleGridEx left2)
|
||||
{
|
||||
leftControl = left2.GridControlObj;
|
||||
}
|
||||
else if (page.Tag is GridControlEx left3)
|
||||
{
|
||||
leftControl = left3;
|
||||
}
|
||||
|
||||
|
||||
foreach (var child in rightChildren.OrderBy(c => c.Orderid))
|
||||
{
|
||||
XtraTabPage childPage = new XtraTabPage { Text = child.DetailName };
|
||||
System.Windows.Forms.Control childCtrl = CreateDetailControl(childPage, child, dataCaches);
|
||||
System.Windows.Forms.Control childCtrl = CreateDetailControl(childPage, child, dataCaches, true, leftControl);
|
||||
childPage.Controls.Add(childCtrl);
|
||||
rightTab.TabPages.Add(childPage);
|
||||
}
|
||||
@@ -1011,7 +1027,7 @@ namespace Lskj.Control
|
||||
/// <param name="dataCaches"></param>
|
||||
/// <param name="isGridmerge"></param>
|
||||
/// <returns></returns>
|
||||
private System.Windows.Forms.Control CreateDetailControl(System.Windows.Forms.Control parentControl, GridDetailModel model, Dictionary<object, Hashtable> dataCaches, bool isGridmerge = true)
|
||||
private System.Windows.Forms.Control CreateDetailControl(System.Windows.Forms.Control parentControl, GridDetailModel model, Dictionary<object, Hashtable> dataCaches, bool isGridmerge = true, GridControlEx leftGridControlEx =null)
|
||||
{
|
||||
|
||||
GridDetailModel[] isMeage = _gridDetail.Cast<GridDetailModel>().Where(x => x.DetailName.Equals(model.DetailName)).ToArray();
|
||||
@@ -1020,6 +1036,13 @@ namespace Lskj.Control
|
||||
object control = PageControlsDic.ContainsKey(model) ? PageControlsDic[model] : null;
|
||||
bool hasControl = control != null;
|
||||
|
||||
GridControlEx currentParentGridEx = this.ParentGridEx;
|
||||
if (leftGridControlEx != null)
|
||||
{
|
||||
currentParentGridEx = leftGridControlEx;
|
||||
}
|
||||
|
||||
|
||||
/* ───── 1. 图表 ───────────────────────────────────────── */
|
||||
if (model.IsChart)
|
||||
{
|
||||
@@ -1260,9 +1283,9 @@ namespace Lskj.Control
|
||||
if (model.LoadFilter) gridEx.GridView.OptionsView.ShowAutoFilterRow = true;
|
||||
|
||||
// 拖拽
|
||||
if (IsDragDetail && ParentGridEx != null && model.IsDrag)
|
||||
if (IsDragDetail && currentParentGridEx != null && model.IsDrag)
|
||||
{
|
||||
var dg = new GridDragGrid(gridEx.GridView, ParentGridEx.GridView);
|
||||
var dg = new GridDragGrid(gridEx.GridView, currentParentGridEx.GridView);
|
||||
dg.OnDragComplete += OnDragGridCompleted;
|
||||
}
|
||||
if (MrpParentGridEx != null && model.IsMrpDrag)
|
||||
@@ -1301,7 +1324,7 @@ namespace Lskj.Control
|
||||
this.DetaiName = model.DetailName;
|
||||
TabMultipledetails tabMultipledetails = hasControl && control is TabMultipledetails ? (TabMultipledetails)control : new TabMultipledetails();
|
||||
tabMultipledetails.Model = this.Model;
|
||||
tabMultipledetails.ParentGridEx = this.ParentGridEx;
|
||||
tabMultipledetails.ParentGridEx = currentParentGridEx;
|
||||
tabMultipledetails.ParentControlEx = this.ParentControlEx;
|
||||
tabMultipledetails.IsDragDetail = this.IsDragDetail;
|
||||
tabMultipledetails.Model = this.Model;
|
||||
@@ -1367,7 +1390,7 @@ namespace Lskj.Control
|
||||
|
||||
gridEx.GridControlObj.Tag = model;
|
||||
gridEx.ParentControlEx = ParentControlEx;
|
||||
gridEx.ParentGridEx = ParentGridEx;
|
||||
gridEx.ParentGridEx = currentParentGridEx;
|
||||
gridEx.ParentKeyField = string.IsNullOrEmpty(model.UnionParentField)
|
||||
? model.SystemModel.ParmaryKey
|
||||
: model.UnionParentField;
|
||||
@@ -1386,7 +1409,7 @@ namespace Lskj.Control
|
||||
{
|
||||
GridDragGrid.GridAddCheckBox(gridEx.GridControlObj.GridView);
|
||||
if (model.RecordDetailsCheckbox &&
|
||||
ParentGridEx?.GridView.OptionsSelection.MultiSelect == true)
|
||||
currentParentGridEx?.GridView.OptionsSelection.MultiSelect == true)
|
||||
{
|
||||
gridEx.TagName = model.DetailName;
|
||||
gridEx.GridControlObj.GridView.SelectionChanged += GridView_SelectionChanged;
|
||||
@@ -1395,10 +1418,10 @@ namespace Lskj.Control
|
||||
if (model.LoadFilter)
|
||||
gridEx.GridControlObj.GridView.OptionsView.ShowAutoFilterRow = true;
|
||||
|
||||
if (ParentGridEx != null && model.IsDrag)
|
||||
if (currentParentGridEx != null && model.IsDrag)
|
||||
{
|
||||
gridEx.GridControlObj.GridView.DoubleClick += OnDetailGridViewDoubleClick;
|
||||
var dg = new GridDragGrid(gridEx.GridControlObj.GridView, ParentGridEx.GridView);
|
||||
var dg = new GridDragGrid(gridEx.GridControlObj.GridView, currentParentGridEx.GridView);
|
||||
dg.OnDragComplete += OnDragGridCompleted;
|
||||
}
|
||||
if (MrpParentGridEx != null && model.IsMrpDrag)
|
||||
|
||||
Reference in New Issue
Block a user