feat: 性能优化与功能增强
- 优化TestPackageData的InitTreeMenu方法,减少数据库查询次数 - InstallList页面新增数据汇总统计功能 - 修复SetSubReviewEdit2编辑时编号重复误报的bug
This commit is contained in:
@@ -74,6 +74,18 @@
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
<f:Panel ID="SummaryPanel" runat="server" ShowBorder="true" ShowHeader="false"
|
||||
Layout="HBox" BodyPadding="5px" CssStyle="background-color:#f5f5f5;" Height="40px">
|
||||
<Items>
|
||||
<f:Label ID="lblSummary1" runat="server" Text="预制组件数量:0" CssClass="summary-label"
|
||||
Margin="0,0,20,0" />
|
||||
<f:Label ID="lblSummary2" runat="server" Text="预制散件数量:0" CssClass="summary-label"
|
||||
Margin="0,0,20,0"
|
||||
|
||||
/>
|
||||
<f:ToolbarFill ID="ToolbarFill3" runat="server" />
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="组件信息" ForceFit="false"
|
||||
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true"
|
||||
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="Id"
|
||||
|
||||
@@ -220,6 +220,61 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
var table = view_HJGL_InstallDatas;
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
||||
// 更新汇总信息
|
||||
UpdateSummary();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新汇总信息
|
||||
/// </summary>
|
||||
private void UpdateSummary()
|
||||
{
|
||||
try
|
||||
{
|
||||
var baseQuery = from x in Funs.DB.View_HJGL_InstallData select x;
|
||||
|
||||
// 应用与数据绑定相同的筛选条件
|
||||
if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)
|
||||
{
|
||||
baseQuery = baseQuery.Where(x => x.UnitWorkId == tvControlItem.SelectedNode.NodeID);
|
||||
}
|
||||
else if (tvControlItem.SelectedNode.CommandName == "流水段")
|
||||
{
|
||||
baseQuery = baseQuery.Where(x => x.UnitWorkId == tvControlItem.SelectedNode.ParentNode.NodeID && x.FlowingSection == tvControlItem.SelectedNode.Text);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(txtPipelineCode2.Text))
|
||||
{
|
||||
baseQuery = baseQuery.Where(x => x.PipelineCode.Contains(txtPipelineCode2.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtPipelineComponentCode.Text))
|
||||
{
|
||||
baseQuery = baseQuery.Where(x => x.Code.Contains(txtPipelineComponentCode.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(drpTypeStr.SelectedValue))
|
||||
{
|
||||
baseQuery = baseQuery.Where(x => x.TypeStr.Contains(drpTypeStr.SelectedValue));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtPipelineCode.Text))
|
||||
{
|
||||
baseQuery = baseQuery.Where(x => x.PipelineCode.Contains(txtPipelineCode.Text.Trim()));
|
||||
}
|
||||
|
||||
// 计算汇总数据
|
||||
var componentCount = baseQuery.Count(x => x.TypeStr == "预制组件");
|
||||
var partCount = baseQuery.Count(x => x.TypeStr == "预制散件");
|
||||
|
||||
// 更新汇总标签
|
||||
lblSummary1.Text = $"预制组件数量:{componentCount}";
|
||||
lblSummary2.Text = $"预制散件数量:{partCount}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 出现异常时显示默认值
|
||||
lblSummary1.Text = "预制组件数量:0";
|
||||
lblSummary2.Text = "预制散件数量:0";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -167,6 +167,42 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// SummaryPanel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel SummaryPanel;
|
||||
|
||||
/// <summary>
|
||||
/// lblSummary1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lblSummary1;
|
||||
|
||||
/// <summary>
|
||||
/// lblSummary2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lblSummary2;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill3;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user