SVN-Revision: r534
This commit is contained in:
tdx
2025-05-06 07:46:08 +00:00
parent c51e6790e1
commit 2f27091909
3 changed files with 52 additions and 38 deletions
+42 -37
View File
@@ -16,6 +16,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using DevExpress.XtraEditors; using DevExpress.XtraEditors;
using System.IO;
namespace Lskj.Control namespace Lskj.Control
{ {
@@ -28,11 +29,50 @@ namespace Lskj.Control
/// 文本控件 /// 文本控件
/// </summary> /// </summary>
public MemoEdit TextEdit { get { return txtEdit; } } public MemoEdit TextEdit { get { return txtEdit; } }
/// <summary>
/// 存储文件地址(用于保存上传)
/// </summary>
public string filepath;
public LabelRemarkEdit() public LabelRemarkEdit()
{ {
InitializeComponent(); InitializeComponent();
} }
public void BandAllowDrop()
{
txtEdit.AllowDrop = true;
txtEdit.DragEnter += OnDragEnter;
txtEdit.DragDrop += OnDragDrop;
}
/// <summary>
/// 拖拽完成触发
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnDragDrop(object sender, DragEventArgs e)
{
var file = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];
txtEdit.Text = Path.GetFileName(file);
this.filepath = file;
}
/// <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="System.Windows.Forms.DragEventArgs"/> instance containing the event data.</param>
protected void OnDragEnter(object sender, System.Windows.Forms.DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop) &&
((string[])e.Data.GetData(DataFormats.FileDrop)).Length == 1)
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
}
/// <summary> /// <summary>
/// <para>说明:设置控件显示文本</para> /// <para>说明:设置控件显示文本</para>
@@ -143,39 +183,4 @@ namespace Lskj.Control
/// <summary> /// <summary>
/// 只读文本颜色 /// 只读文本颜色
/// </summary> /// </summary>
/// <value>The color of the read only label.</value> ///
public override bool ReadOnly
{
get
{
return base.ReadOnly;
}
set
{
base.ReadOnly = value;
this.txtEdit.Properties.ReadOnly = value;
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
}
}
/// <summary>
/// 必填文本颜色
/// </summary>
/// <value>The color of the required label.</value>
public override bool Required
{
get
{
return base.Required;
}
set
{
base.Required = value;
if (value)
{
this.lblText.ForeColor = base.RequiredLabelForceColor;
}
}
}
}
}
@@ -268,6 +268,10 @@ namespace Lskj.Control.Model
/// </summary> /// </summary>
public bool HighlightContent { get; set; } public bool HighlightContent { get; set; }
/// <summary> /// <summary>
/// 是否为拖拽绑定控件
/// </summary>
public bool FileUploadControl { get; set; }
/// <summary>
///条件拼接 ///条件拼接
/// </summary> /// </summary>
public bool Montage { get; set; } public bool Montage { get; set; }
@@ -3819,6 +3819,7 @@ namespace Lskj.Control.Model
model.TreeCheckModel = item.Table.Columns.Contains("TreeCheckModel") ? item["TreeCheckModel"] + "" : ""; model.TreeCheckModel = item.Table.Columns.Contains("TreeCheckModel") ? item["TreeCheckModel"] + "" : "";
model.ControlTitleColor = item.Table.Columns.Contains("ControlTitleColor") ? item["ControlTitleColor"] + "" : ""; model.ControlTitleColor = item.Table.Columns.Contains("ControlTitleColor") ? item["ControlTitleColor"] + "" : "";
model.FileUploadControl = item.Table.Columns.Contains("FileUploadControl") ? "1".Equals(item["FileUploadControl"] + "") : false;
model.HighlightContent = item.Table.Columns.Contains("HighlightContent") ? "1".Equals(item["HighlightContent"] + "") : false; model.HighlightContent = item.Table.Columns.Contains("HighlightContent") ? "1".Equals(item["HighlightContent"] + "") : false;
model.Montage = item.Table.Columns.Contains("montage") ? "1".Equals(item["montage"] + "") : false; model.Montage = item.Table.Columns.Contains("montage") ? "1".Equals(item["montage"] + "") : false;
model.DisplayPermissions = item.Table.Columns.Contains("DisplayPermissions") ? item["DisplayPermissions"] + "" : ""; model.DisplayPermissions = item.Table.Columns.Contains("DisplayPermissions") ? item["DisplayPermissions"] + "" : "";
@@ -4084,6 +4085,10 @@ namespace Lskj.Control.Model
remarkEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged); remarkEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
if (!isLoadBorder) remarkEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; if (!isLoadBorder) remarkEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
baseControl = remarkEdit; baseControl = remarkEdit;
if (!model.FileUploadControl)
{
remarkEdit.BandAllowDrop();
}
break; break;
case ControlType.LabMemoEdit: case ControlType.LabMemoEdit:
// 备注框A // 备注框A