SVN r800
SVN-Revision: r800
This commit is contained in:
@@ -43,6 +43,7 @@ namespace Lskj.Control.Model
|
||||
/// </summary>
|
||||
public event CommonToolApplyEventHandler ApplyBefore;
|
||||
public event CommonToolAfterDynamicLinkEventHandler DynamicLinkAfter;
|
||||
public event StoredProcedureAfterExecute ReturnStoredProcedureValue;
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CommonMenu"/> class.
|
||||
/// </summary>
|
||||
@@ -301,6 +302,10 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (ReturnStoredProcedureValue != null)
|
||||
{
|
||||
ReturnStoredProcedureValue(pMsg.Value+"");
|
||||
}
|
||||
MessageUtil.Show(ResourceKeys.OperSuccess);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -307,4 +307,8 @@ namespace Lskj.Control.Model
|
||||
/// </summary>
|
||||
public bool ConfigureColumnMode { get; set; }
|
||||
/// <summary>
|
||||
///条件控件回车执行搜索后清空
|
||||
///条件控件回车执行搜索后清空控件值
|
||||
/// </summary>
|
||||
public bool ScanAfterEmpty { get; set; }
|
||||
/// <summary>
|
||||
///是否为 导入返�
|
||||
@@ -54,6 +54,12 @@ namespace Lskj.Control
|
||||
/// <param name="e">The e.</param>
|
||||
public delegate void TreeGridDragGridCompleteEventHandler(object sender, TreeGridDragGridArgs e);
|
||||
/// <summary>
|
||||
/// 树表格拖拽表格节点完成后调用
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The e.</param>
|
||||
public delegate void TreeGridDragTreeGridCompleteEventHandler(object sender, TreeGridDragTreeGridArgs e);
|
||||
/// <summary>
|
||||
/// 多表格拖拽表格完成后调用
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
@@ -104,6 +110,12 @@ namespace Lskj.Control
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public delegate void BeforeHandleParamsEventHandler(object sender, HandleParamsArgs e);
|
||||
/// <summary>
|
||||
/// 右键执行存储过程执行成功后返回值
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public delegate void StoredProcedureAfterExecute(string text);
|
||||
|
||||
|
||||
#region 总事件委托
|
||||
@@ -214,6 +226,33 @@ namespace Lskj.Control
|
||||
public DataRow SelectGridRow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 树表格拖拽表格事件参数
|
||||
/// </summary>
|
||||
public class TreeGridDragTreeGridArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// 来源树表格
|
||||
/// </summary>
|
||||
public TreeList SourceTreeList;
|
||||
/// <summary>
|
||||
/// 目标树表格
|
||||
/// </summary>
|
||||
public TreeList TargetTreeList;
|
||||
/// <summary>
|
||||
/// 表格拖动选中行数据
|
||||
/// </summary>
|
||||
public DataRow[] GridViewSelectRows;
|
||||
/// <summary>
|
||||
/// 拖动目标选中行
|
||||
/// </summary>
|
||||
public DataRow SelectGridRow;
|
||||
/// <summary>
|
||||
/// 拖动目标树选中节点
|
||||
/// </summary>
|
||||
public TreeListNode SelectTreeNode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 多表格拖拽表格事件参数
|
||||
/// </summary>
|
||||
|
||||
@@ -359,7 +359,10 @@ namespace Lskj.Control.Model
|
||||
/// 字段操作权限
|
||||
/// </summary>
|
||||
public string PrivilegeOper;
|
||||
|
||||
/// <summary>
|
||||
/// 附加关联(附件模块关联主表树型)
|
||||
/// </summary>
|
||||
public bool AdditionalAssociations;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@@ -449,4 +452,4 @@ namespace Lskj.Control.Model
|
||||
int.TryParse(item["LabPicUrlHeight"] + "", out LabPicUrlHeight);
|
||||
}
|
||||
this.IsCustomGroupPrimary = item.Table.Columns.Contains("IsCustomGroupPrimary") ? "1".Equals(item["IsCustomGroupPrimary"] + "") : false;
|
||||
this.IsCustomGr
|
||||
this.IsCustomGroupField = item.Table.Columns.Contains("IsCustomGroupField")&&int.TryParse(item["IsCustomGroupField"] + "",out IsCustomGroupField) ? IsCustomGroupField : 0;
|
||||
@@ -2177,6 +2177,15 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
else
|
||||
{
|
||||
if (model != null && isDirectImport && (model.FieldType == ControlType.LabDate ||
|
||||
model.FieldType == ControlType.LabDateTime ||
|
||||
model.FieldType == ControlType.LabDateTimeShort ||
|
||||
model.FieldType == ControlType.LabTime ||
|
||||
model.FieldType == ControlType.LabShortTime)&& (cell == null || cell.CellType == CellType.Blank||string.IsNullOrWhiteSpace(cell+"")))
|
||||
{
|
||||
//日期框如果值是空,就直接跳过。赋空值("")会报错
|
||||
continue;
|
||||
}
|
||||
if (cell.CellType == CellType.Numeric)
|
||||
{
|
||||
|
||||
|
||||
@@ -1583,11 +1583,16 @@ namespace Lskj.Control.Model
|
||||
{
|
||||
SetControlValue(model, this.ParentKey);
|
||||
}
|
||||
else if (model.AdditionalAssociations && !string.IsNullOrWhiteSpace(this.ParentKey))
|
||||
{
|
||||
SetControlValue(model, this.ParentKey);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(model.DefaultValue))
|
||||
{
|
||||
string defaultValue = this.SystemModel != null ? ReplaceHelper.ReplaceRowParam(this.SystemModel.maintabFocusedRow, model.DefaultValue) : model.DefaultValue;
|
||||
SetControlValue(model, defaultValue);
|
||||
}
|
||||
|
||||
}
|
||||
//智能搜索框第一次加载时手动触发
|
||||
if (changeLabelAutoGridLooks.Count > 0)
|
||||
@@ -3976,6 +3981,7 @@ namespace Lskj.Control.Model
|
||||
model.ListBoxFontSize = item.Table.Columns.Contains("ListBoxFontSize") && !string.IsNullOrEmpty(item["ListBoxFontSize"] + "") ? Convert.ToInt32(item["ListBoxFontSize"] + "") : 0;
|
||||
model.PrivilegeView = item.Table.Columns.Contains("PrivilegeView") ? item["PrivilegeView"] + "" : "";
|
||||
model.PrivilegeOper = item.Table.Columns.Contains("PrivilegeOper") ? item["PrivilegeOper"] + "" : "";
|
||||
model.AdditionalAssociations = item.Table.Columns.Contains("AdditionalAssociations") && !string.IsNullOrWhiteSpace(item["AdditionalAssociations"] + "") ? "1".Equals(item["AdditionalAssociations"] + "") : false;
|
||||
//为了和工具里和bs里统一
|
||||
if (model.FieldType == 42)
|
||||
{
|
||||
@@ -5971,4 +5977,30 @@ namespace Lskj.Control.Model
|
||||
LabelDateEdit dateEdit = controlObj as LabelDateEdit;
|
||||
value = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.DateTime.ToString("yyyy-MM-dd");
|
||||
}
|
||||
else if
|
||||
else if (controlObj is LabelCheckEdit)
|
||||
{
|
||||
LabelCheckEdit checkEdit = controlObj as LabelCheckEdit;
|
||||
value = checkEdit.EditText;
|
||||
}
|
||||
else if (controlObj is LabelComboxEdit)
|
||||
{
|
||||
LabelComboxEdit autoEdit = controlObj as LabelComboxEdit;
|
||||
value = autoEdit.EditValue;
|
||||
}
|
||||
else if (controlObj is LabelTextEdit)
|
||||
{
|
||||
LabelTextEdit textIntEdit = controlObj as LabelTextEdit;
|
||||
if (textIntEdit != null) value = string.IsNullOrEmpty(textIntEdit.EditText) ? "0" : textIntEdit.EditText;
|
||||
}
|
||||
|
||||
defaultValue = defaultValue.Replace(item, value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
//树表格拖拽到树表格
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.XtraGrid;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
|
||||
using DevExpress.XtraTreeList;
|
||||
using DevExpress.XtraTreeList.Nodes;
|
||||
using Lskj.Data;
|
||||
using Lskj.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.Control.Model
|
||||
{
|
||||
public class TreeGridDragTree
|
||||
{
|
||||
/// <summary>
|
||||
/// 拖拽是否忽视节点
|
||||
/// </summary>
|
||||
public bool NeglectingNodes = false;
|
||||
/// <summary>
|
||||
/// 拖拽条件与目标树选中节点数据进行替换比较
|
||||
/// </summary>
|
||||
public string isDragCond;
|
||||
/// <summary>
|
||||
/// 是否允许拖拽
|
||||
/// </summary>
|
||||
public bool isAllowDrag = true;
|
||||
/// <summary>
|
||||
/// 拖动位置
|
||||
/// </summary>
|
||||
private GridHitInfo _hitInfo;
|
||||
|
||||
/// <summary>
|
||||
/// 拖拽时节点
|
||||
/// </summary>
|
||||
TreeListHitInfo downHitInfo = null;
|
||||
|
||||
/// <summary>
|
||||
/// 拖动数据源
|
||||
/// </summary>
|
||||
private TreeList _sourceTreeList;
|
||||
/// <summary>
|
||||
/// 拖动目标源
|
||||
/// </summary>
|
||||
private TreeList _targetTreeList;
|
||||
/// <summary>
|
||||
/// 是否正在拖拽
|
||||
/// </summary>
|
||||
private bool _draging = false;
|
||||
/// <summary>
|
||||
/// 是否正在拖拽
|
||||
/// </summary>
|
||||
public bool Draging { get { return _draging; } set { _draging = value; } }
|
||||
public bool CanDragParentNode = false;
|
||||
public bool isDropColorVisble = false;
|
||||
/// <summary>
|
||||
/// 表格数据拖动完成
|
||||
/// </summary>
|
||||
public event TreeGridDragTreeGridCompleteEventHandler OnDragComplete;
|
||||
|
||||
|
||||
public TreeGridDragTree(TreeList sourceTreeList, TreeList targetTreeList)
|
||||
{
|
||||
this._sourceTreeList = sourceTreeList;
|
||||
this._targetTreeList = targetTreeList;
|
||||
|
||||
|
||||
if (this._sourceTreeList == null || this._targetTreeList == null)
|
||||
return;
|
||||
|
||||
this._sourceTreeList.MouseDown += new MouseEventHandler(treeList_MouseDown);
|
||||
this._sourceTreeList.MouseMove += new MouseEventHandler(treeList_MouseMove);
|
||||
this._sourceTreeList.MouseUp += new MouseEventHandler(treeList_MouseUp);
|
||||
//this._sourceTreeList.HideSelection = false;
|
||||
this._sourceTreeList.AllowDrop = false;
|
||||
|
||||
this._targetTreeList.AllowDrop = true;
|
||||
this._targetTreeList.DragOver += new DragEventHandler(treeView_DragOver);
|
||||
this._targetTreeList.DragDrop += new DragEventHandler(treeView_DragDrop);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:获取选中行数据</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-10-18 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>DataRow[].</returns>
|
||||
public DataRow[] GetViewFocusedDataRows()
|
||||
{
|
||||
var selectNodes = this._sourceTreeList.Selection;
|
||||
DataRow[] dataRows = new DataRow[selectNodes.Count];
|
||||
|
||||
for (int i = 0; i < selectNodes.Count; i++)
|
||||
{
|
||||
TreeListNode treeNode = selectNodes[i];
|
||||
DataRowView dataRowView = this._sourceTreeList.GetDataRecordByNode(treeNode) as DataRowView;
|
||||
dataRows[i] = dataRowView != null ? dataRowView.Row : null;
|
||||
}
|
||||
return dataRows;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:源表格鼠标放开</para>
|
||||
/// <para>创建人:</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private void treeList_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
this._draging = false;
|
||||
}
|
||||
|
||||
/// <para>说明:源表格鼠标移动</para>
|
||||
/// <para>创建人:</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private void treeList_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
TreeList treelist = sender as TreeList;
|
||||
if (e.Button == MouseButtons.Left && downHitInfo != null)
|
||||
{
|
||||
if (_sourceTreeList.Selection.Count == 0)
|
||||
return;
|
||||
Size dragSize = SystemInformation.DragSize;
|
||||
Rectangle dragRect = new Rectangle(new Point(downHitInfo.MousePoint.X - dragSize.Width / 2,
|
||||
downHitInfo.MousePoint.Y - dragSize.Height / 2), dragSize);
|
||||
|
||||
if (!dragRect.Contains(new Point(e.X, e.Y)))
|
||||
{
|
||||
List<TreeListNode> node = new List<TreeListNode>();
|
||||
foreach (TreeListNode n in _sourceTreeList.Selection)
|
||||
{
|
||||
node.Add(n);
|
||||
}
|
||||
treelist.DoDragDrop(node, DragDropEffects.Move);
|
||||
downHitInfo = null;
|
||||
DevExpress.Utils.DXMouseEventArgs.GetMouseArgs(e).Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:源树表格鼠标按下</para>
|
||||
/// <para>创建人:</para>
|
||||
/// <para>创建日期:2023-3-20 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private void treeList_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
//this._sourceTreeList.AllowDrop = false;
|
||||
//this._targetGridView.GridControl.AllowDrop = true;
|
||||
|
||||
TreeList treelist = sender as TreeList;
|
||||
downHitInfo = null;
|
||||
_hitInfo = null;
|
||||
TreeListHitInfo hitInfo = treelist.CalcHitInfo(new Point(e.X, e.Y));
|
||||
|
||||
// if (Control.ModifierKeys != Keys.None) return;
|
||||
if (e.Button == MouseButtons.Left && hitInfo != null)
|
||||
{
|
||||
StaticControl.SourceDragGridView = null;
|
||||
this._draging = true;
|
||||
downHitInfo = hitInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-13 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="DragEventArgs"/> instance containing the event data.</param>
|
||||
protected void treeView_DragOver(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.KeyState == (int)Keys.LButton && this._draging)
|
||||
{
|
||||
TreeList treeListGrid = sender as TreeList;
|
||||
treeListGrid.Select();
|
||||
Point gcPoint = treeListGrid.PointToScreen((sender as TreeList).Location);
|
||||
Point pt = new Point(e.X - gcPoint.X, e.Y - gcPoint.Y);
|
||||
TreeListHitInfo _hitInfo = treeListGrid.CalcHitInfo(pt);
|
||||
|
||||
|
||||
if (NeglectingNodes)
|
||||
{
|
||||
e.Effect = DragDropEffects.Move;
|
||||
if (_hitInfo != null && _hitInfo.Node != null)
|
||||
{
|
||||
_hitInfo.Node.Expanded = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_hitInfo == null || treeListGrid.GetNodeIndex(_hitInfo.Node) < 0)
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
return;
|
||||
}
|
||||
DataRowView dataRowView = this._targetTreeList.GetDataRecordByNode(_hitInfo.Node) as DataRowView;
|
||||
DataRow Row = dataRowView != null ? dataRowView.Row : null;
|
||||
bool isLastNode = _hitInfo.Node.Nodes.Count == 0;
|
||||
if (!isLastNode)
|
||||
{
|
||||
_hitInfo.Node.Expanded = true; ;
|
||||
}
|
||||
//DataRow[] rowItems = this.GetViewFocusedDataRows();
|
||||
if (isLastNode || CanDragParentNode)
|
||||
{
|
||||
if (ReplaceHelper.ReplaceRowParamCond(Row, this.isDragCond) && isAllowDrag)
|
||||
{
|
||||
e.Effect = DragDropEffects.Move;
|
||||
treeListGrid.FocusedNode = _hitInfo.Node;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-13 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="DragEventArgs"/> instance containing the event data.</param>
|
||||
protected void treeView_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
if (this.OnDragComplete != null && this._draging)
|
||||
{
|
||||
this._draging = false;
|
||||
TreeList treeListGrid = sender as TreeList;
|
||||
Point gcPoint = treeListGrid.PointToScreen((sender as TreeList).Location);
|
||||
Point pt = new Point(e.X - gcPoint.X, e.Y - gcPoint.Y);
|
||||
TreeListHitInfo _hitInfo = treeListGrid.CalcHitInfo(pt);
|
||||
TreeListNode treeNode = _hitInfo.Node;
|
||||
if (!NeglectingNodes)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user