Commit 563e385a authored by 段廷瑞's avatar 段廷瑞

1、Excel导出配置:增加卡片配置

parent 05b572a2
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
<add key="LoginInfo" value="wwF/xpBzWek=" /> <add key="LoginInfo" value="wwF/xpBzWek=" />
<add key="LoginVerify" value="v86f5Q3Xa7U=" /> <add key="LoginVerify" value="v86f5Q3Xa7U=" />
<add key="UpdateTime" value="2021-12-09 09:48:49.755" /> <add key="UpdateTime" value="2021-12-09 09:48:49.755" />
<add key="ExceptFiles" value="" />
<add key="ContainFiles" value="" />
<add key="PatchTimeFrame_Dll" value="48" />
<add key="PatchTimeFrame_Sql" value="720" />
<add key="PatchTimeFrame_Xml" value="720" />
<add key="Exclude_PDB" value="1" />
</appSettings> </appSettings>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
......
...@@ -3,4 +3,14 @@ ...@@ -3,4 +3,14 @@
3、右侧通过右键菜单増行和删行 3、右侧通过右键菜单増行和删行
4、右侧-上表:前缀自动生成,只需填写模板名称 4、右侧-上表:前缀自动生成,只需填写模板名称
5、右侧-下表:模板通过单击选择,表名必填 5、右侧-下表:模板通过单击选择,表名必填
6、通过右上角“保存设置”按钮,保存所有配置 6、通过右上角“保存设置”按钮,保存所有配置
\ No newline at end of file
【卡片配置特别说明】
*卡片式某个Sheet页内的一个矩形区域,所以为了定位模板,我们需要以下属性:
所属模板:用于定位所属模板
Sheet序号:用于定位具体是模板内的Sheet位置(从0开始),模板+Sheet应该是唯一的
起始行:用于定位卡片的起始行位置,即卡片的第一行。(从0开始,即实际行号减1)
起始列:用于定位卡片的起始列位置,及卡片的第一列。(从0开始)
行跨度:卡片占用的总行数,至少1行
列跨度:卡片占用的总列数,至少1列
每行卡片数量:即每行并列摆放几个卡片,至少1个
\ No newline at end of file
...@@ -120,4 +120,16 @@ ...@@ -120,4 +120,16 @@
<UserId>sa</UserId> <UserId>sa</UserId>
<Pwd>sa</Pwd> <Pwd>sa</Pwd>
</links> </links>
<links>
<Link>192.168.1.204</Link>
<DbName>FTT_GeErRui</DbName>
<UserId>sa</UserId>
<Pwd>sa</Pwd>
</links>
<links>
<Link>192.168.1.202</Link>
<DbName>FTT_CJ211123</DbName>
<UserId>sa</UserId>
<Pwd>sa</Pwd>
</links>
</DocumentElement> </DocumentElement>
\ No newline at end of file
...@@ -23,11 +23,14 @@ namespace Tools.UI.Popups ...@@ -23,11 +23,14 @@ namespace Tools.UI.Popups
/// </summary> /// </summary>
public List<string> CheckedItems => this.checkedListBox1.CheckedItems.Cast<string>().ToList(); public List<string> CheckedItems => this.checkedListBox1.CheckedItems.Cast<string>().ToList();
public wSelectTemplates(IEnumerable<string> items) public wSelectTemplates(IEnumerable<string> items, bool isMultiSelect = true)
{ {
InitializeComponent(); InitializeComponent();
//状态初始化 //状态初始化
this.DialogResult = DialogResult.None; this.DialogResult = DialogResult.None;
//界面初始化
this.btnShotAll.Enabled = isMultiSelect;
this.btnShotAdded.Enabled = isMultiSelect;
//初始化数据源 //初始化数据源
this.checkedListBox1.Items.AddRange(items.ToArray()); this.checkedListBox1.Items.AddRange(items.ToArray());
} }
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.myTreeView1 = new Tools.MyCommon.controls.MyTreeView(); this.myTreeView1 = new Tools.MyCommon.controls.MyTreeView();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
...@@ -49,6 +50,13 @@ ...@@ -49,6 +50,13 @@
this.tslTables = new System.Windows.Forms.ToolStripLabel(); this.tslTables = new System.Windows.Forms.ToolStripLabel();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.dgvTemplates = new System.Windows.Forms.DataGridView(); this.dgvTemplates = new System.Windows.Forms.DataGridView();
this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column14 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.Column15 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.toolStrip2 = new System.Windows.Forms.ToolStrip(); this.toolStrip2 = new System.Windows.Forms.ToolStrip();
this.tslTemplates = new System.Windows.Forms.ToolStripLabel(); this.tslTemplates = new System.Windows.Forms.ToolStripLabel();
this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStrip1 = new System.Windows.Forms.ToolStrip();
...@@ -58,13 +66,17 @@ ...@@ -58,13 +66,17 @@
this.tslDbLink = new System.Windows.Forms.ToolStripLabel(); this.tslDbLink = new System.Windows.Forms.ToolStripLabel();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.tsbHelp = new System.Windows.Forms.ToolStripButton(); this.tsbHelp = new System.Windows.Forms.ToolStripButton();
this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.toolStrip4 = new System.Windows.Forms.ToolStrip();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.tslCardInfo = new System.Windows.Forms.ToolStripLabel();
this.Column14 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.dgvCardInfo = new System.Windows.Forms.DataGridView();
this.Column15 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.cbTemplateName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column13 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
...@@ -76,6 +88,8 @@ ...@@ -76,6 +88,8 @@
((System.ComponentModel.ISupportInitialize)(this.dgvTemplates)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvTemplates)).BeginInit();
this.toolStrip2.SuspendLayout(); this.toolStrip2.SuspendLayout();
this.toolStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout();
this.toolStrip4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvCardInfo)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// splitContainer1 // splitContainer1
...@@ -91,12 +105,14 @@ ...@@ -91,12 +105,14 @@
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
this.splitContainer1.Panel2.Controls.Add(this.dgvCardInfo);
this.splitContainer1.Panel2.Controls.Add(this.toolStrip4);
this.splitContainer1.Panel2.Controls.Add(this.dgvTables); this.splitContainer1.Panel2.Controls.Add(this.dgvTables);
this.splitContainer1.Panel2.Controls.Add(this.toolStrip3); this.splitContainer1.Panel2.Controls.Add(this.toolStrip3);
this.splitContainer1.Panel2.Controls.Add(this.panel2); this.splitContainer1.Panel2.Controls.Add(this.panel2);
this.splitContainer1.Panel2.Controls.Add(this.toolStrip2); this.splitContainer1.Panel2.Controls.Add(this.toolStrip2);
this.splitContainer1.Size = new System.Drawing.Size(791, 486); this.splitContainer1.Size = new System.Drawing.Size(881, 518);
this.splitContainer1.SplitterDistance = 226; this.splitContainer1.SplitterDistance = 251;
this.splitContainer1.TabIndex = 0; this.splitContainer1.TabIndex = 0;
// //
// myTreeView1 // myTreeView1
...@@ -104,7 +120,7 @@ ...@@ -104,7 +120,7 @@
this.myTreeView1.Dock = System.Windows.Forms.DockStyle.Fill; this.myTreeView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.myTreeView1.Location = new System.Drawing.Point(0, 23); this.myTreeView1.Location = new System.Drawing.Point(0, 23);
this.myTreeView1.Name = "myTreeView1"; this.myTreeView1.Name = "myTreeView1";
this.myTreeView1.Size = new System.Drawing.Size(226, 463); this.myTreeView1.Size = new System.Drawing.Size(251, 495);
this.myTreeView1.TabIndex = 2; this.myTreeView1.TabIndex = 2;
// //
// label1 // label1
...@@ -114,7 +130,7 @@ ...@@ -114,7 +130,7 @@
this.label1.Font = new System.Drawing.Font("微软雅黑 Light", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Font = new System.Drawing.Font("微软雅黑 Light", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(0, 0); this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(226, 23); this.label1.Size = new System.Drawing.Size(251, 23);
this.label1.TabIndex = 1; this.label1.TabIndex = 1;
this.label1.Text = "*请先选择一个模块"; this.label1.Text = "*请先选择一个模块";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
...@@ -133,11 +149,11 @@ ...@@ -133,11 +149,11 @@
this.Column5, this.Column5,
this.Column9}); this.Column9});
this.dgvTables.ContextMenuStrip = this.contextMenuStrip1; this.dgvTables.ContextMenuStrip = this.contextMenuStrip1;
this.dgvTables.Dock = System.Windows.Forms.DockStyle.Fill; this.dgvTables.Dock = System.Windows.Forms.DockStyle.Top;
this.dgvTables.Location = new System.Drawing.Point(0, 217); this.dgvTables.Location = new System.Drawing.Point(0, 217);
this.dgvTables.Name = "dgvTables"; this.dgvTables.Name = "dgvTables";
this.dgvTables.RowTemplate.Height = 23; this.dgvTables.RowTemplate.Height = 23;
this.dgvTables.Size = new System.Drawing.Size(561, 269); this.dgvTables.Size = new System.Drawing.Size(626, 176);
this.dgvTables.TabIndex = 0; this.dgvTables.TabIndex = 0;
// //
// Column10 // Column10
...@@ -194,9 +210,9 @@ ...@@ -194,9 +210,9 @@
// Column9 // Column9
// //
this.Column9.DataPropertyName = "SelectSQL"; this.Column9.DataPropertyName = "SelectSQL";
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.Column9.DefaultCellStyle = dataGridViewCellStyle1; this.Column9.DefaultCellStyle = dataGridViewCellStyle5;
this.Column9.HeaderText = "SQL脚本"; this.Column9.HeaderText = "SQL脚本";
this.Column9.Name = "Column9"; this.Column9.Name = "Column9";
this.Column9.Width = 200; this.Column9.Width = 200;
...@@ -230,7 +246,7 @@ ...@@ -230,7 +246,7 @@
this.tslTables}); this.tslTables});
this.toolStrip3.Location = new System.Drawing.Point(0, 192); this.toolStrip3.Location = new System.Drawing.Point(0, 192);
this.toolStrip3.Name = "toolStrip3"; this.toolStrip3.Name = "toolStrip3";
this.toolStrip3.Size = new System.Drawing.Size(561, 25); this.toolStrip3.Size = new System.Drawing.Size(626, 25);
this.toolStrip3.TabIndex = 4; this.toolStrip3.TabIndex = 4;
this.toolStrip3.Text = "toolStrip3"; this.toolStrip3.Text = "toolStrip3";
// //
...@@ -246,7 +262,7 @@ ...@@ -246,7 +262,7 @@
this.panel2.Dock = System.Windows.Forms.DockStyle.Top; this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 25); this.panel2.Location = new System.Drawing.Point(0, 25);
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(561, 167); this.panel2.Size = new System.Drawing.Size(626, 167);
this.panel2.TabIndex = 3; this.panel2.TabIndex = 3;
// //
// dgvTemplates // dgvTemplates
...@@ -266,16 +282,62 @@ ...@@ -266,16 +282,62 @@
this.dgvTemplates.Location = new System.Drawing.Point(0, 0); this.dgvTemplates.Location = new System.Drawing.Point(0, 0);
this.dgvTemplates.Name = "dgvTemplates"; this.dgvTemplates.Name = "dgvTemplates";
this.dgvTemplates.RowTemplate.Height = 23; this.dgvTemplates.RowTemplate.Height = 23;
this.dgvTemplates.Size = new System.Drawing.Size(561, 167); this.dgvTemplates.Size = new System.Drawing.Size(626, 167);
this.dgvTemplates.TabIndex = 5; this.dgvTemplates.TabIndex = 5;
// //
// Column11
//
this.Column11.DataPropertyName = "Prefix";
this.Column11.HeaderText = "前缀";
this.Column11.Name = "Column11";
this.Column11.ReadOnly = true;
this.Column11.Width = 150;
//
// Column7
//
this.Column7.DataPropertyName = "TpName";
this.Column7.HeaderText = "模板名称";
this.Column7.Name = "Column7";
this.Column7.Width = 150;
//
// Column14
//
this.Column14.DataPropertyName = "IsStop";
this.Column14.HeaderText = "停用";
this.Column14.Name = "Column14";
//
// Column15
//
this.Column15.DataPropertyName = "IsDetailAutoRowHeight";
this.Column15.HeaderText = "明细自动行高";
this.Column15.Name = "Column15";
//
// Column8
//
this.Column8.DataPropertyName = "GrpTableName";
this.Column8.HeaderText = "分组表名";
this.Column8.Name = "Column8";
//
// Column12
//
this.Column12.DataPropertyName = "GrpColumnName";
this.Column12.HeaderText = "分组列名";
this.Column12.Name = "Column12";
//
// Column13
//
this.Column13.DataPropertyName = "ExportNameSOL";
this.Column13.HeaderText = "导出名称SQL";
this.Column13.Name = "Column13";
this.Column13.Width = 200;
//
// toolStrip2 // toolStrip2
// //
this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tslTemplates}); this.tslTemplates});
this.toolStrip2.Location = new System.Drawing.Point(0, 0); this.toolStrip2.Location = new System.Drawing.Point(0, 0);
this.toolStrip2.Name = "toolStrip2"; this.toolStrip2.Name = "toolStrip2";
this.toolStrip2.Size = new System.Drawing.Size(561, 25); this.toolStrip2.Size = new System.Drawing.Size(626, 25);
this.toolStrip2.TabIndex = 2; this.toolStrip2.TabIndex = 2;
this.toolStrip2.Text = "toolStrip2"; this.toolStrip2.Text = "toolStrip2";
// //
...@@ -296,7 +358,7 @@ ...@@ -296,7 +358,7 @@
this.tsbHelp}); this.tsbHelp});
this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(791, 25); this.toolStrip1.Size = new System.Drawing.Size(881, 25);
this.toolStrip1.TabIndex = 3; this.toolStrip1.TabIndex = 3;
this.toolStrip1.Text = "toolStrip1"; this.toolStrip1.Text = "toolStrip1";
// //
...@@ -345,57 +407,110 @@ ...@@ -345,57 +407,110 @@
this.tsbHelp.Text = "使用说明"; this.tsbHelp.Text = "使用说明";
this.tsbHelp.Click += new System.EventHandler(this.tsbHelp_Click); this.tsbHelp.Click += new System.EventHandler(this.tsbHelp_Click);
// //
// Column11 // toolStrip4
// //
this.Column11.DataPropertyName = "Prefix"; this.toolStrip4.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Column11.HeaderText = "前缀"; this.tslCardInfo});
this.Column11.Name = "Column11"; this.toolStrip4.Location = new System.Drawing.Point(0, 393);
this.Column11.ReadOnly = true; this.toolStrip4.Name = "toolStrip4";
this.Column11.Width = 150; this.toolStrip4.Size = new System.Drawing.Size(626, 25);
// this.toolStrip4.TabIndex = 5;
// Column7 this.toolStrip4.Text = "toolStrip4";
// //
this.Column7.DataPropertyName = "TpName"; // tslCardInfo
this.Column7.HeaderText = "模板名称"; //
this.Column7.Name = "Column7"; this.tslCardInfo.Name = "tslCardInfo";
this.Column7.Width = 150; this.tslCardInfo.Size = new System.Drawing.Size(80, 22);
// this.tslCardInfo.Text = "卡片模板配置";
// Column14 //
// // dgvCardInfo
this.Column14.DataPropertyName = "IsStop"; //
this.Column14.HeaderText = "停用"; this.dgvCardInfo.BackgroundColor = System.Drawing.SystemColors.Window;
this.Column14.Name = "Column14"; this.dgvCardInfo.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
// this.dgvCardInfo.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
// Column15 this.cbTemplateName,
// this.dataGridViewTextBoxColumn2,
this.Column15.DataPropertyName = "IsDetailAutoRowHeight"; this.dataGridViewCheckBoxColumn1,
this.Column15.HeaderText = "明细自动行高"; this.dataGridViewCheckBoxColumn2,
this.Column15.Name = "Column15"; this.dataGridViewTextBoxColumn3,
// this.dataGridViewTextBoxColumn4,
// Column8 this.dataGridViewTextBoxColumn5,
// this.dataGridViewTextBoxColumn6});
this.Column8.DataPropertyName = "GrpTableName"; this.dgvCardInfo.ContextMenuStrip = this.contextMenuStrip1;
this.Column8.HeaderText = "分组表名"; this.dgvCardInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.Column8.Name = "Column8"; this.dgvCardInfo.Location = new System.Drawing.Point(0, 418);
// this.dgvCardInfo.Name = "dgvCardInfo";
// Column12 this.dgvCardInfo.RowTemplate.Height = 23;
// this.dgvCardInfo.Size = new System.Drawing.Size(626, 100);
this.Column12.DataPropertyName = "GrpColumnName"; this.dgvCardInfo.TabIndex = 7;
this.Column12.HeaderText = "分组列名"; //
this.Column12.Name = "Column12"; // cbTemplateName
// //
// Column13 this.cbTemplateName.DataPropertyName = "TemplateName";
// this.cbTemplateName.HeaderText = "绑定模板";
this.Column13.DataPropertyName = "ExportNameSOL"; this.cbTemplateName.Name = "cbTemplateName";
this.Column13.HeaderText = "导出名称SQL"; this.cbTemplateName.ReadOnly = true;
this.Column13.Name = "Column13"; this.cbTemplateName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.Column13.Width = 200; this.cbTemplateName.Width = 150;
//
// dataGridViewTextBoxColumn2
//
this.dataGridViewTextBoxColumn2.DataPropertyName = "SheetIndex";
this.dataGridViewTextBoxColumn2.HeaderText = "Sheet序号";
this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
//
// dataGridViewCheckBoxColumn1
//
this.dataGridViewCheckBoxColumn1.DataPropertyName = "PerLineCount";
this.dataGridViewCheckBoxColumn1.HeaderText = "每行卡片数量";
this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1";
this.dataGridViewCheckBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True;
//
// dataGridViewCheckBoxColumn2
//
this.dataGridViewCheckBoxColumn2.DataPropertyName = "IsStop";
this.dataGridViewCheckBoxColumn2.HeaderText = "是否停用";
this.dataGridViewCheckBoxColumn2.Name = "dataGridViewCheckBoxColumn2";
this.dataGridViewCheckBoxColumn2.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridViewCheckBoxColumn2.Width = 60;
//
// dataGridViewTextBoxColumn3
//
this.dataGridViewTextBoxColumn3.DataPropertyName = "RowStart";
this.dataGridViewTextBoxColumn3.HeaderText = "起始行";
this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
this.dataGridViewTextBoxColumn3.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridViewTextBoxColumn3.Width = 80;
//
// dataGridViewTextBoxColumn4
//
this.dataGridViewTextBoxColumn4.DataPropertyName = "ColumnStart";
this.dataGridViewTextBoxColumn4.HeaderText = "起始列";
this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
this.dataGridViewTextBoxColumn4.Width = 80;
//
// dataGridViewTextBoxColumn5
//
this.dataGridViewTextBoxColumn5.DataPropertyName = "RowSpan";
this.dataGridViewTextBoxColumn5.HeaderText = "行跨度";
this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
this.dataGridViewTextBoxColumn5.Width = 80;
//
// dataGridViewTextBoxColumn6
//
this.dataGridViewTextBoxColumn6.DataPropertyName = "ColumnSpan";
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle4;
this.dataGridViewTextBoxColumn6.HeaderText = "列跨度";
this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
this.dataGridViewTextBoxColumn6.Width = 80;
// //
// wExcelExportSetting // wExcelExportSetting
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(791, 511); this.ClientSize = new System.Drawing.Size(881, 543);
this.Controls.Add(this.splitContainer1); this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.toolStrip1); this.Controls.Add(this.toolStrip1);
this.Name = "wExcelExportSetting"; this.Name = "wExcelExportSetting";
...@@ -415,6 +530,9 @@ ...@@ -415,6 +530,9 @@
this.toolStrip2.PerformLayout(); this.toolStrip2.PerformLayout();
this.toolStrip1.ResumeLayout(false); this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout(); this.toolStrip1.PerformLayout();
this.toolStrip4.ResumeLayout(false);
this.toolStrip4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvCardInfo)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
...@@ -457,5 +575,16 @@ ...@@ -457,5 +575,16 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column8; private System.Windows.Forms.DataGridViewTextBoxColumn Column8;
private System.Windows.Forms.DataGridViewTextBoxColumn Column12; private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
private System.Windows.Forms.DataGridViewTextBoxColumn Column13; private System.Windows.Forms.DataGridViewTextBoxColumn Column13;
private System.Windows.Forms.ToolStrip toolStrip4;
private System.Windows.Forms.ToolStripLabel tslCardInfo;
private System.Windows.Forms.DataGridView dgvCardInfo;
private System.Windows.Forms.DataGridViewTextBoxColumn cbTemplateName;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewCheckBoxColumn1;
private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn2;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
} }
} }
\ No newline at end of file
...@@ -58,6 +58,24 @@ namespace Tools.UI ...@@ -58,6 +58,24 @@ namespace Tools.UI
SelectSQL VARCHAR(MAX) NULL SelectSQL VARCHAR(MAX) NULL
) )
END
IF NOT EXISTS(SELECT 1 FROM sys.tables WHERE name = 'ModuleTemplateCardInfo')
BEGIN
CREATE TABLE ModuleTemplateCardInfo
(
ID INT IDENTITY(1,1) PRIMARY KEY
, ModuleID INT NULL
, TemplateName VARCHAR(50)
, SheetIndex INT NULL
, PerLineCount INT NULL
, RowStart INT NULL
, ColumnStart INT NULL
, RowSpan INT NULL
, ColumnSpan INT NULL
, Remark VARCHAR(MAX) NULL
, IsStop BIT NULL
)
END"; END";
this._db.ExecNonSql(sql); this._db.ExecNonSql(sql);
...@@ -66,6 +84,7 @@ namespace Tools.UI ...@@ -66,6 +84,7 @@ namespace Tools.UI
this.ModuleTableList = new List<TQuery>() { this.ModuleTableList = new List<TQuery>() {
new TQuery("ModuleTemplate"), new TQuery("ModuleTemplate"),
new TQuery("ModuleTemplateTable"), new TQuery("ModuleTemplateTable"),
new TQuery("ModuleTemplateCardInfo"),
}; };
this._ds = this._db.GetData(this.ModuleTableList, true); this._ds = this._db.GetData(this.ModuleTableList, true);
} }
...@@ -78,9 +97,13 @@ namespace Tools.UI ...@@ -78,9 +97,13 @@ namespace Tools.UI
this.dgvTemplates.AutoGenerateColumns = false; this.dgvTemplates.AutoGenerateColumns = false;
this.dgvTables.AllowUserToAddRows = false; this.dgvTables.AllowUserToAddRows = false;
this.dgvTables.AutoGenerateColumns = false; this.dgvTables.AutoGenerateColumns = false;
this.dgvCardInfo.AllowUserToAddRows = false;
this.dgvCardInfo.AutoGenerateColumns = false;
this.dgvTemplates.DataSource = this._ds.Tables["ModuleTemplate"].DefaultView; this.dgvTemplates.DataSource = this._ds.Tables["ModuleTemplate"].DefaultView;
this.dgvTables.DataSource = this._ds.Tables["ModuleTemplateTable"].DefaultView; this.dgvTables.DataSource = this._ds.Tables["ModuleTemplateTable"].DefaultView;
this.dgvCardInfo.DataSource = this._ds.Tables["ModuleTemplateCardInfo"].DefaultView;
this.dgvTables.CellClick += DgvTables_CellClick; this.dgvTables.CellClick += DgvTables_CellClick;
this.dgvCardInfo.CellClick += DgvCardInfo_CellClick;
//初始化树结构 //初始化树结构
var sql = $"SELECT * FROM dbo.SysBusinessModel"; var sql = $"SELECT * FROM dbo.SysBusinessModel";
this.myTreeView1.DataSource = this._db.GetDataTable(sql, "SysModels"); this.myTreeView1.DataSource = this._db.GetDataTable(sql, "SysModels");
...@@ -102,15 +125,19 @@ namespace Tools.UI ...@@ -102,15 +125,19 @@ namespace Tools.UI
var id = Convert.ToInt32(drNow["ID"]); var id = Convert.ToInt32(drNow["ID"]);
this._ds.Tables["ModuleTemplate"].DefaultView.RowFilter = $"ModuleID={id}"; this._ds.Tables["ModuleTemplate"].DefaultView.RowFilter = $"ModuleID={id}";
this._ds.Tables["ModuleTemplateTable"].DefaultView.RowFilter = $"ModuleID={id}"; this._ds.Tables["ModuleTemplateTable"].DefaultView.RowFilter = $"ModuleID={id}";
this._ds.Tables["ModuleTemplateCardInfo"].DefaultView.RowFilter = $"ModuleID={id}";
//仅当叶子节点(即模块节点)操作时表格有效 //仅当叶子节点(即模块节点)操作时表格有效
bool isEnabled = e.Node.Nodes.Count == 0; bool isEnabled = e.Node.Nodes.Count == 0;
this.dgvTemplates.Enabled = isEnabled; this.dgvTemplates.Enabled = isEnabled;
this.dgvTables.Enabled = isEnabled; this.dgvTables.Enabled = isEnabled;
this.dgvCardInfo.Enabled = isEnabled;
this.tslTemplates.ForeColor = isEnabled ? Color.Black : Color.Gray; this.tslTemplates.ForeColor = isEnabled ? Color.Black : Color.Gray;
this.tslTables.ForeColor = isEnabled ? Color.Black : Color.Gray; this.tslTables.ForeColor = isEnabled ? Color.Black : Color.Gray;
this.tslCardInfo.ForeColor = isEnabled ? Color.Black : Color.Gray;
var tag = isEnabled ? "" : "(已禁用)"; var tag = isEnabled ? "" : "(已禁用)";
this.tslTemplates.Text = $"模板维护{tag}"; this.tslTemplates.Text = $"模板维护{tag}";
this.tslTables.Text = $"数据源绑定{tag}"; this.tslTables.Text = $"数据源绑定{tag}";
this.tslCardInfo.Text = $"卡片模板配置{tag}";
} }
//单元格单击:选择模板 //单元格单击:选择模板
private void DgvTables_CellClick(object sender, DataGridViewCellEventArgs e) private void DgvTables_CellClick(object sender, DataGridViewCellEventArgs e)
...@@ -145,14 +172,39 @@ namespace Tools.UI ...@@ -145,14 +172,39 @@ namespace Tools.UI
} }
} }
} }
//单元格点击:选择模板
private void DgvCardInfo_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0 || e.ColumnIndex < 0)
return;
if (this.dgvTables.Columns[e.ColumnIndex].DataPropertyName.Equals("TpNames"))
{
var items = this._ds.Tables["ModuleTemplate"].DefaultView.Cast<DataRowView>().Select(r => r["TpName"].ToString());
wSelectTemplates frm = new wSelectTemplates(items);
if (frm.ShowDialog() == DialogResult.OK)
{
var drNow = this._ds.Tables["ModuleTemplateCardInfo"].DefaultView[e.RowIndex];
var result = "";
if (frm.CheckedItems.Count > 0)
{
result = frm.CheckedItems[0];
}
drNow["TemplateName"] = result;
drNow.EndEdit();
}
}
}
//上下文菜单 //上下文菜单
DataTable dtFocused = null; DataTable dtFocused = null;
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{ {
var name = (sender as ContextMenuStrip).SourceControl.Name; dtFocused = null;
var tableName = name.Equals(dgvTemplates.Name) ? "ModuleTemplate" : "ModuleTemplateTable"; var ctrl = (sender as ContextMenuStrip).SourceControl;
dtFocused = this._ds.Tables[tableName]; if (ctrl is DataGridView)
{
dtFocused = ((ctrl as DataGridView).DataSource as DataView).Table;
}
} }
private void tsmiAddRow_Click(object sender, EventArgs e) private void tsmiAddRow_Click(object sender, EventArgs e)
{ {
...@@ -172,10 +224,17 @@ namespace Tools.UI ...@@ -172,10 +224,17 @@ namespace Tools.UI
//清除所有对该模板的引用 //清除所有对该模板的引用
if (isTemplate) if (isTemplate)
{ {
string mName = $"[{drDel["TpName"].ToString()}]"; string tpName = drDel["TpName"].ToString();
//清除数据绑定
foreach (DataRowView drv in this._ds.Tables["ModuleTemplateTable"].DefaultView)
{
drv["TpNames"] = drv["TpNames"].ToString().Replace($"[{tpName}]", "");
drv.EndEdit();
}
//清除卡片设置
foreach (DataRowView drv in this._ds.Tables["ModuleTemplateTable"].DefaultView) foreach (DataRowView drv in this._ds.Tables["ModuleTemplateTable"].DefaultView)
{ {
drv["TpNames"] = drv["TpNames"].ToString().Replace(mName, ""); drv["TemplateName"] = drv["TemplateName"].ToString().Replace(tpName, "");
drv.EndEdit(); drv.EndEdit();
} }
} }
......
...@@ -117,6 +117,36 @@ ...@@ -117,6 +117,36 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="cbTemplateName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewCheckBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewCheckBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>347, 17</value>
</metadata>
<metadata name="toolStrip4.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>622, 17</value>
</metadata>
<metadata name="Column10.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column10.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
...@@ -141,12 +171,12 @@ ...@@ -141,12 +171,12 @@
<metadata name="Column9.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column9.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>347, 17</value>
</metadata>
<metadata name="toolStrip3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolStrip3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>237, 17</value> <value>237, 17</value>
</metadata> </metadata>
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<metadata name="Column11.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column11.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
...@@ -168,9 +198,6 @@ ...@@ -168,9 +198,6 @@
<metadata name="Column13.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column13.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>512, 17</value> <value>512, 17</value>
</metadata> </metadata>
......
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