SVN r338
SVN-Revision: r338
This commit is contained in:
Generated
+42
@@ -0,0 +1,42 @@
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
partial class FrmPicture
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.pictureEdit = new DevExpress.XtraEditors.PictureEdit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureEdit.Properties)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pictureEdit
|
||||
//
|
||||
this.pictureEdit.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.pictureEdit.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pictureEdit.Location = new System.Drawing.Point(0, 0);
|
||||
this.pictureEdit.Name = "pictureEdit";
|
||||
this.pictureEdit.Properties
|
||||
Binary file not shown.
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -52,6 +52,7 @@ using Spire.Barcode;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections;
|
||||
using Newtonsoft.Json;
|
||||
using System.Net;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
@@ -402,7 +403,10 @@ namespace Lskj.Control
|
||||
{
|
||||
this.gridView.CustomRowFilter += GridView_CustomRowFilter;
|
||||
}
|
||||
#region LabPicUrl控件实现事件
|
||||
this.gridView.CustomUnboundColumnData += OnGridViewCustomUnboundColumnData;
|
||||
this.gridView.DoubleClick += OnShowImageDoubleClick; ;
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -795,8 +799,8 @@ namespace Lskj.Control
|
||||
case ControlType.LabPic:
|
||||
InitPicEdit(column);
|
||||
break;
|
||||
case ControlType.LabPicNew:
|
||||
InitPicEditNew(column);
|
||||
case ControlType.LabPicUrl:
|
||||
InitPicEditUrl(column, model);
|
||||
break;
|
||||
case ControlType.LabSelectReturnId:
|
||||
case ControlType.LabSelectReturnText:
|
||||
@@ -4240,9 +4244,24 @@ namespace Lskj.Control
|
||||
picEdit.CustomHeight = 16;
|
||||
gridColumn.ColumnEdit = picEdit;
|
||||
}
|
||||
public void InitPicEditNew(GridColumn gridColumn)
|
||||
/// <summary>
|
||||
/// <para>说明:表格图片</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-08-02 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void InitPicEditUrl(GridColumn gridColumn, GridColumnModel model)
|
||||
{
|
||||
gridColumn.AppearanceCell.Options.UseTextOptions = true;
|
||||
gridColumn.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
|
||||
gridColumn.OptionsColumn.AllowEdit = false;
|
||||
gridColumn.FieldName = $"{model.FieldName}{Guid.NewGuid()}";
|
||||
RepositoryItemPictureEdit pictureEdit = new RepositoryItemPictureEdit();
|
||||
pictureEdit.ShowMenu = false;
|
||||
pictureEdit.NullText = " ";
|
||||
pictureEdit.SizeMode = PictureSizeMode.Zoom;
|
||||
gridControl.RepositoryItems.Add(pictureEdit);
|
||||
gridColumn.UnboundType = UnboundColumnType.Object;
|
||||
@@ -7439,7 +7458,109 @@ namespace Lskj.Control
|
||||
/// <param name="e"></param>
|
||||
private void OnGridViewCustomUnboundColumnData(object sender, CustomColumnDataEventArgs e)
|
||||
{
|
||||
|
||||
if (e.Column.Tag != null && e.Column.Tag is GridColumnModel columnModel)
|
||||
{
|
||||
if (columnModel.FieldType == ControlType.LabPicUrl && e.IsGetData)
|
||||
{
|
||||
string imageUrl = e.Row != null && e.Row is DataRowView dataRowView && dataRowView.Row.Table.Columns.Contains(columnModel.FieldName) ? dataRowView.Row[columnModel.FieldName] + "" : "";
|
||||
if (!string.IsNullOrEmpty(imageUrl))
|
||||
{
|
||||
if (!imageUrl.StartsWith("http"))
|
||||
{
|
||||
string oaUrl = SystemInfo.Instance.OAUrl.EndsWith("/") ? SystemInfo.Instance.OAUrl : $"{SystemInfo.Instance.OAUrl}/";
|
||||
imageUrl = $"{oaUrl}{imageUrl}";
|
||||
}
|
||||
if (columnModel.LabPicUrlImages == null)
|
||||
{
|
||||
columnModel.LabPicUrlImages = new Hashtable();
|
||||
}
|
||||
// 检查缓存中是否已存在该图片
|
||||
if (!columnModel.LabPicUrlImages.ContainsKey(imageUrl))
|
||||
{
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
using (WebClient webClient = new WebClient())
|
||||
{
|
||||
byte[] bytes = webClient.DownloadData(imageUrl);
|
||||
using (MemoryStream memoryStream = new MemoryStream(bytes))
|
||||
{
|
||||
Bitmap bitmap = new Bitmap(memoryStream);
|
||||
int height = 18;
|
||||
int newWidth = (int)((decimal)height / (decimal)bitmap.Height * (decimal)bitmap.Width);
|
||||
Bitmap zoomBitmap = new Bitmap(bitmap, new Size(newWidth, height));
|
||||
columnModel.LabPicUrlImages[imageUrl] = new KeyValuePair<Image, Image>(bitmap, zoomBitmap);
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
gridView.BeginUpdate();
|
||||
e.Value = zoomBitmap;
|
||||
gridView.EndUpdate();
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
gridView.BeginUpdate();
|
||||
e.Value = ((KeyValuePair<Image, Image>)columnModel.LabPicUrlImages[imageUrl]).Value;
|
||||
gridView.EndUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 点击单元格显示图片控件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnShowImageDoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
GridView gridView = sender as GridView;
|
||||
Point point = gridView.GridControl.PointToClient(MousePosition);
|
||||
GridHitInfo gridHitInfo = gridView.CalcHitInfo(point);
|
||||
if (gridHitInfo == null || !gridHitInfo.InRowCell || gridHitInfo.Column == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
GridColumn gridColumn = gridHitInfo.Column;
|
||||
if (gridColumn.Tag == null || !(gridColumn.Tag is GridColumnModel columnModel))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (columnModel.FieldType == ControlType.LabPicUrl)
|
||||
{
|
||||
DataRow dataRow = gridView.GetDataRow(gridHitInfo.RowHandle);
|
||||
string imageUrl = dataRow.Table.Columns.Contains(columnModel.FieldName) ? dataRow[columnModel.FieldName] + "" : "";
|
||||
if (string.IsNullOrEmpty(imageUrl))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!imageUrl.StartsWith("http"))
|
||||
{
|
||||
string oaUrl = SystemInfo.Instance.OAUrl.EndsWith("/") ? SystemInfo.Instance.OAUrl : $"{SystemInfo.Instance.OAUrl}/";
|
||||
imageUrl = $"{oaUrl}{imageUrl}";
|
||||
}
|
||||
if (columnModel.LabPicUrlImages.ContainsKey(imageUrl))
|
||||
{
|
||||
using (FrmPicture frmPicture = new FrmPicture())
|
||||
{
|
||||
Image image = ((KeyValuePair<Image, Image>)columnModel.LabPicUrlImages[imageUrl]).Key;
|
||||
frmPicture.Text = "预览";
|
||||
frmPicture.Picture = image;
|
||||
frmPicture.WindowState = FormWindowState.Maximized;
|
||||
frmPicture.StartPosition = FormStartPosition.CenterScreen;
|
||||
frmPicture.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 当前表格的拖拽方法
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
partial class LabApiButtonEdit
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.plLeft = new System.Windows.Forms.Panel();
|
||||
this.lblText = new System.Windows.Forms.Label();
|
||||
this.plRight = new System.Windows.Forms.Panel();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.btnMore = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.txtEdit = new DevExpress.XtraEditors.TextEdit();
|
||||
this.plLeft.SuspendLayout();
|
||||
this.plRight.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.txtEdit.Properties)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// plLeft
|
||||
//
|
||||
this.plLeft.BackColor = System.Drawing.Color.Transparent;
|
||||
this.plLeft.Controls.Add(this.lblText);
|
||||
this.plLeft.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.plLeft.Location = new System.Drawing.Point(0, 0);
|
||||
this.plLeft.Name = "plLeft";
|
||||
this.plLeft.Size = new System.Drawing.Size(42, 21);
|
||||
this.plLeft.TabIndex = 3;
|
||||
//
|
||||
// lblText
|
||||
//
|
||||
this.lblText.AutoSize = true;
|
||||
this.lblText.Location = new System.Drawing.Point(5, 4);
|
||||
this.lblText.Name = "lblText";
|
||||
this.lblText.Size = new System.Drawing.Size(29, 12);
|
||||
this.lblText.TabIndex = 1;
|
||||
this.lblText.Text = "名称";
|
||||
//
|
||||
// plRight
|
||||
//
|
||||
this.plRight.BackColor = System.Drawing.Color.Transparent;
|
||||
this.plRight.Controls.Add(this.txtEdit);
|
||||
this.plRight.Controls.Add(this.panel1);
|
||||
this.plRight.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.plRight.Location = new System.Drawing.Point(42, 0);
|
||||
this.plRight.Name = "plRight";
|
||||
this.plRight.Size = new System.Drawing.Size(122, 21);
|
||||
this.plRight.TabIndex = 4;
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.btnMore);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panel1.Location = new System.Drawing.Point(96, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(26, 21);
|
||||
this.panel1.TabIndex = 6;
|
||||
//
|
||||
// btnMore
|
||||
//
|
||||
this.btnMore.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnMore.Appearance.Options.UseFont = true;
|
||||
this.btnMore.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.btnMore.Image = global::Lskj.Control.Properties.Resources.refresh;
|
||||
this.btnMore.Location = new System.Drawing.Point(0, 0);
|
||||
this.btnMore.Name = "btnMore";
|
||||
this.btnMore.Size = new System.Drawing.Size(26, 21);
|
||||
this.btnMore.TabIndex = 2;
|
||||
//
|
||||
// txtEdit
|
||||
//
|
||||
this.txtEdit.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtEdit.Location = new System.Drawing.Point(0, 0);
|
||||
this.txtEdit.Name = "txtEdit";
|
||||
this.txtEdit.Size = new System.Drawing.Size(96, 20);
|
||||
this.txtEdit.TabIndex = 7;
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
using DevExpress.XtraEditors;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
public partial class LabApiButtonEdit : BaseUserControl
|
||||
{
|
||||
public LabApiButtonEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
txtEdit.ReadOnly = true;
|
||||
btnMore.Click += OnBtnMoreClick;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取数据
|
||||
/// </summary>
|
||||
public event EventHandler OnRefreshDataCallBack;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtEdit;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lblText.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lblText.Text = value;
|
||||
if (FontSize > 0)
|
||||
{
|
||||
this.plLeft.Dock = DockStyle.Left;
|
||||
this.plLeft.AutoSize = false;
|
||||
this.lblText.AutoSize = false;
|
||||
this.lblText.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblText.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtEdit.Properties.AutoHeight = false;
|
||||
this.plLeft.Width = value.Length * GetCharWidth();
|
||||
GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
this.plLeft.AutoSize = true;
|
||||
this.plLeft.Width = this.lblText.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
public override float FontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.FontSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.FontSize = value;
|
||||
if (value > 0)
|
||||
{
|
||||
this.lblText.Font = new Font(this.lblText.Font.FontFamily, value);
|
||||
this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
public override string NullText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Properties.NullValuePrompt;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.TextEdit.Properties.NullValuePrompt = value;
|
||||
}
|
||||
base.NullText = value;
|
||||
}
|
||||
}
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>�
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -411,7 +411,11 @@ namespace Lskj.Control.Model
|
||||
/// <summary>
|
||||
/// 图片,url图片展示
|
||||
/// </summary>
|
||||
public const int LabPicNew = 162;
|
||||
public const int LabPicUrl = 162;
|
||||
/// <summary>
|
||||
/// 称重控件
|
||||
/// </summary>
|
||||
public const int LabApiBtuton = 163;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -506,4 +510,8 @@ namespace Lskj.Control.Model
|
||||
fieldType == LabDateTime ||
|
||||
fieldType == LabDateTimeShort ||
|
||||
fieldType == LabTime ||
|
||||
fieldType == LabS
|
||||
fieldType == LabShortTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -272,6 +272,20 @@ namespace Lskj.Control.Model
|
||||
if (this._mainGridEx != null) this._gridControl = _mainGridEx.GridControl;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置GridLeft</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-05-21 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="mainGridEx">The main grid ex.</param>
|
||||
public void SetGridLeft(GridControlEx gridLeft)
|
||||
{
|
||||
this._gridLeft = gridLeft;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:创建添加修改界面控件</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-09-01 </para>
|
||||
@@ -4292,6 +4306,13 @@ namespace Lskj.Control.Model
|
||||
labelWeigh.ButtonClick += new EventHandler(OnLabelWeighButtonClick);
|
||||
baseControl = labelWeigh;
|
||||
break;
|
||||
case ControlType.LabApiBtuton:
|
||||
LabApiButtonEdit labApiButtonEdit = new LabApiButtonEdit();
|
||||
labApiButtonEdit.Tag = model;
|
||||
//labApiButtonEdit.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
|
||||
labApiButtonEdit.OnRefreshDataCallBack += new EventHandler(OnLabApiDataCallBack);
|
||||
baseControl = labApiButtonEdit;
|
||||
break;
|
||||
case ControlType.LabText:
|
||||
case ControlType.LabTextInt:
|
||||
default:
|
||||
@@ -5509,6 +5530,7 @@ namespace Lskj.Control.Model
|
||||
labelWeigh.EditText = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string AfterLabelWeighButtonClick(ControlModel controlModel, DataRow dataRow)
|
||||
{
|
||||
string value = "";
|
||||
@@ -5523,8 +5545,20 @@ namespace Lskj.Control.Model
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 接口控件按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnLabApiDataCallBack(object sender, EventArgs e)
|
||||
{
|
||||
LabApiButtonEdit labApiButtonEdit = (LabApiButtonEdit)sender;
|
||||
ControlModel controlModel = labApiButtonEdit.Tag as ControlModel;
|
||||
DataRow dataRow = this.GetAllControlValueRow();
|
||||
string sourceSql = ReplaceHelper.ReplaceRowParam(dataRow, controlModel.SourceSql);
|
||||
DataRow selectRow = BaseImpl.GetDataRowResult(sourceSql);
|
||||
this.SetAllControlValue(selectRow);
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断是否是exec开头(可以处理sql前方有注释和空格的情况)
|
||||
/// </summary>
|
||||
@@ -5614,30 +5648,4 @@ 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 (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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if
|
||||
Reference in New Issue
Block a user