Commit e2caa08f authored by tr's avatar tr

1、工具平台:添加任务看板查看

parent 4917643f
......@@ -230,6 +230,12 @@
<Compile Include="UI\wSysChecker.Designer.cs">
<DependentUpon>wSysChecker.cs</DependentUpon>
</Compile>
<Compile Include="UI\wTaskBoard.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\wTaskBoard.Designer.cs">
<DependentUpon>wTaskBoard.cs</DependentUpon>
</Compile>
<Compile Include="UI\wXmlGenerator.cs">
<SubType>Form</SubType>
</Compile>
......@@ -325,6 +331,9 @@
<EmbeddedResource Include="UI\wSysChecker.resx">
<DependentUpon>wSysChecker.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wTaskBoard.resx">
<DependentUpon>wTaskBoard.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wXmlGenerator.resx">
<DependentUpon>wXmlGenerator.cs</DependentUpon>
</EmbeddedResource>
......
namespace Tools.UI
{
partial class wTaskBoard
{
/// <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.dataGridView1 = new System.Windows.Forms.DataGridView();
this.panel1 = new System.Windows.Forms.Panel();
this.btnRefresh = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.cbTaskState = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.cbInChargeUser = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.cbProjectName = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// dataGridView1
//
this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Window;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.Location = new System.Drawing.Point(0, 50);
this.dataGridView1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(933, 688);
this.dataGridView1.TabIndex = 0;
//
// panel1
//
this.panel1.Controls.Add(this.btnRefresh);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.cbTaskState);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.cbInChargeUser);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.cbProjectName);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(933, 50);
this.panel1.TabIndex = 1;
//
// btnRefresh
//
this.btnRefresh.Location = new System.Drawing.Point(665, 13);
this.btnRefresh.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(117, 26);
this.btnRefresh.TabIndex = 6;
this.btnRefresh.Text = "刷新数据";
this.btnRefresh.UseVisualStyleBackColor = true;
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(448, 17);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 17);
this.label3.TabIndex = 5;
this.label3.Text = "状态:";
//
// cbTaskState
//
this.cbTaskState.FormattingEnabled = true;
this.cbTaskState.Location = new System.Drawing.Point(498, 14);
this.cbTaskState.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.cbTaskState.Name = "cbTaskState";
this.cbTaskState.Size = new System.Drawing.Size(140, 25);
this.cbTaskState.TabIndex = 4;
this.cbTaskState.SelectedIndexChanged += new System.EventHandler(this.cb_SelectedIndexChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(224, 17);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 17);
this.label2.TabIndex = 3;
this.label2.Text = "负责人:";
//
// cbInChargeUser
//
this.cbInChargeUser.FormattingEnabled = true;
this.cbInChargeUser.Location = new System.Drawing.Point(286, 13);
this.cbInChargeUser.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.cbInChargeUser.Name = "cbInChargeUser";
this.cbInChargeUser.Size = new System.Drawing.Size(140, 25);
this.cbInChargeUser.TabIndex = 2;
this.cbInChargeUser.SelectedIndexChanged += new System.EventHandler(this.cb_SelectedIndexChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(14, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(44, 17);
this.label1.TabIndex = 1;
this.label1.Text = "项目:";
//
// cbProjectName
//
this.cbProjectName.FormattingEnabled = true;
this.cbProjectName.Location = new System.Drawing.Point(64, 13);
this.cbProjectName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.cbProjectName.Name = "cbProjectName";
this.cbProjectName.Size = new System.Drawing.Size(140, 25);
this.cbProjectName.TabIndex = 0;
this.cbProjectName.SelectedIndexChanged += new System.EventHandler(this.cb_SelectedIndexChanged);
//
// wTaskBoard
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(933, 738);
this.Controls.Add(this.dataGridView1);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "wTaskBoard";
this.Text = "wTaskBoard";
this.Load += new System.EventHandler(this.wTaskBoard_Load);
this.Shown += new System.EventHandler(this.wTaskBoard_Shown);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox cbTaskState;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox cbInChargeUser;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cbProjectName;
private System.Windows.Forms.Button btnRefresh;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//
using Tools.MyCommon;
using Tools.MyData;
namespace Tools.UI
{
public partial class wTaskBoard : wBasic
{
DBHelper _db = null;
DataTable _dt = null;
string ProjectName => this.cbProjectName.Text;
string InChargeUser => this.cbInChargeUser.Text;
string TaskState => this.cbTaskState.Text;
string ColorColumn = "";
string TaskColumn = "";
public wTaskBoard()
{
InitializeComponent();
}
private void wTaskBoard_Load(object sender, EventArgs e)
{
//初始化数据访问对象
var link = $@"Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=FTT_Work;Data Source=jhdsoft.gicp.net,3204";
this._db = new DBHelper(link);
//初始化界面
this.dataGridView1.AllowUserToAddRows = false;
//初始化数据
this.Initialize();
}
private void wTaskBoard_Shown(object sender, EventArgs e)
{
this.SetGridForeColor();
}
/// <summary>
/// 数据初始化
/// </summary>
private void Initialize()
{
//初始化数据
var sql = $@"EXEC dbo.SP_RPT_KFDJDB_20191031 @PageSize = 1000,@PageIndex = 1, @Flag = 1, @WorkTeamID = 1";
this._dt = this._db.GetDataTable(sql, "TaskDetail", false);
//列名处理
foreach (DataColumn dc in this._dt.Columns)
{
var colName = dc.ColumnName;
if (colName.Contains("Color"))
{
this.ColorColumn = colName;
continue;
}
if (colName.Contains("Task"))
{
this.TaskColumn = colName;
continue;
}
dc.ColumnName = colName.Split('_')[0];
}
//初始化下拉项
this.SetComboItems(this.cbProjectName, "项目名称");
this.SetComboItems(this.cbInChargeUser, "负责人");
this.SetComboItems(this.cbTaskState, "状态");
//绑定数据源
this._dt.DefaultView.Sort = "[项目交期] DESC";
this.dataGridView1.DataSource = this._dt.DefaultView;
}
/// <summary>
/// 初始化下拉项
/// </summary>
/// <param name="colName"></param>
/// <returns></returns>
private void SetComboItems(ComboBox cmb, string colName)
{
cmb.Items.Clear();
var items = this._dt.DefaultView.Cast<DataRowView>().Select(r => r[colName].ToString()).Distinct().ToArray();
cmb.Items.AddRange(items);
}
/// <summary>
/// 设置表格前景色
/// </summary>
private void SetGridForeColor()
{
if (string.IsNullOrEmpty(this.ColorColumn))
return;
foreach (DataGridViewRow uRow in this.dataGridView1.Rows)
{
var drv = this._dt.DefaultView[uRow.Index];
var htmlColor = drv[this.ColorColumn].ToString();
var result = Color.Black;
if (htmlColor.Equals("#F0F0F0"))
{
result = Color.SlateGray;
}
else if (htmlColor.Equals("#FFFF00"))
{
result = Color.Orange;
}
else
{
result = ColorTranslator.FromHtml(drv[this.ColorColumn].ToString());
}
uRow.DefaultCellStyle.ForeColor = result;
}
}
//下拉改变事件:查询
private void cb_SelectedIndexChanged(object sender, EventArgs e)
{
this._dt.DefaultView.RowFilter = $"[项目名称] like '%{this.ProjectName}%' and [负责人] like '%{this.InChargeUser}%' and 状态 like '%{this.TaskState}%'";
}
//按钮事件:刷新数据
private void btnRefresh_Click(object sender, EventArgs e)
{
this.Initialize();
//初始化前景色
this.SetGridForeColor();
}
}
}
<?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>
\ No newline at end of file
......@@ -38,6 +38,7 @@ namespace Tools
this.CreateModule(typeof(UI.wEmptyTable), "清空表", "tr:输入主表、自动清空关联表的工具"),
this.CreateModule(typeof(UI.wDbLinkMngr), "数据库链接管理", "tr:现有数据库链接的管理和查看"),
this.CreateModule(typeof(UI.wExcelExportSetting), "Excel导出设置", "tr:Excel导出配置图形化版本"),
this.CreateModule(typeof(UI.wTaskBoard), "任务看板", "tr:任务看板的简易化工具,免除翻页困扰"),
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment