新增业务打印绑定功能,整合打印模板与业务数据的映射配置,优化打印数据生成逻辑。新增免密接口,支持桌面端打印模板的查询与列表展示,提升用户体验和系统的实时数据同步能力。同时,重构相关控制器以增强系统的可维护性和扩展性。

This commit is contained in:
geht
2026-05-14 10:43:51 +08:00
parent 642cecb04d
commit 8bcc34aee0
649 changed files with 18804 additions and 70 deletions

View File

@@ -0,0 +1,65 @@
<Window x:Class="YY.Admin.Views.Print.PrintBizTemplateBindDetailWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
Title="业务打印绑定详情"
Width="760" Height="580"
WindowStartupLocation="CenterOwner"
ResizeMode="CanResize">
<DockPanel Margin="16">
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 12 0 0">
<TextBlock x:Name="TxtMeta" Foreground="#666" VerticalAlignment="Center" Margin="0 0 16 0"/>
<Button Content="关闭" Width="88" Height="32" IsCancel="True" IsDefault="True" Click="OnCloseClick"/>
</StackPanel>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<hc:Row Margin="0 0 0 8">
<hc:Col Span="12">
<hc:TextBox x:Name="TxtId" hc:InfoElement.Title="主键" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.TitleWidth="80"
IsReadOnly="True"/>
</hc:Col>
</hc:Row>
<hc:Row Margin="0 0 0 8">
<hc:Col Layout="{hc:ColLayout Xs=12, Md=6}">
<hc:TextBox x:Name="TxtBizCode" hc:InfoElement.Title="业务编码" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.TitleWidth="80"
IsReadOnly="True"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Md=6}">
<hc:TextBox x:Name="TxtBizName" hc:InfoElement.Title="业务名称" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.TitleWidth="80"
IsReadOnly="True"/>
</hc:Col>
</hc:Row>
<hc:Row Margin="0 0 0 8">
<hc:Col Layout="{hc:ColLayout Xs=12, Md=6}">
<hc:TextBox x:Name="TxtTemplateId" hc:InfoElement.Title="模板Id" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.TitleWidth="80"
IsReadOnly="True"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Md=6}">
<hc:TextBox x:Name="TxtTemplateCode" hc:InfoElement.Title="模板编码" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.TitleWidth="80"
IsReadOnly="True"/>
</hc:Col>
</hc:Row>
<hc:Row Margin="0 0 0 12">
<hc:Col Span="12">
<hc:TextBox x:Name="TxtRemark" hc:InfoElement.Title="备注" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.TitleWidth="80"
IsReadOnly="True"/>
</hc:Col>
</hc:Row>
<GroupBox Header="字段映射 JSON">
<TextBox x:Name="TxtMappingJson"
MinHeight="260"
AcceptsReturn="True"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"
FontFamily="Consolas"
FontSize="12"
IsReadOnly="True"
BorderThickness="0"/>
</GroupBox>
</StackPanel>
</ScrollViewer>
</DockPanel>
</Window>

View File

@@ -0,0 +1,46 @@
using System.Text.Json;
using System.Windows;
using YY.Admin.Core.Entity;
namespace YY.Admin.Views.Print;
public partial class PrintBizTemplateBindDetailWindow
{
public PrintBizTemplateBindDetailWindow(PrintBizTemplateBind model)
{
InitializeComponent();
TxtId.Text = model.Id ?? "";
TxtBizCode.Text = model.BizCode ?? "";
TxtBizName.Text = model.BizName ?? "";
TxtTemplateId.Text = model.TemplateId ?? "";
TxtTemplateCode.Text = model.TemplateCode ?? "";
TxtRemark.Text = model.Remark ?? "";
var raw = model.FieldMappingJson ?? "";
if (!string.IsNullOrWhiteSpace(raw))
{
try
{
using var doc = JsonDocument.Parse(raw);
TxtMappingJson.Text = JsonSerializer.Serialize(doc, new JsonSerializerOptions { WriteIndented = true });
}
catch
{
TxtMappingJson.Text = raw;
}
}
else
{
TxtMappingJson.Text = "[]";
}
var ct = model.CreateTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? "-";
var ut = model.UpdateTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? "-";
TxtMeta.Text = $"创建:{ct} 更新:{ut} 创建人:{model.CreateBy ?? "-"} 更新人:{model.UpdateBy ?? "-"}";
}
private void OnCloseClick(object sender, RoutedEventArgs e)
{
Close();
}
}

View File

@@ -0,0 +1,118 @@
<UserControl x:Class="YY.Admin.Views.Print.PrintBizTemplateBindListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d">
<Grid Style="{StaticResource BaseViewStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" CornerRadius="4" Margin="0 0 -10 0">
<hc:Row>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
<hc:TextBox Text="{Binding FilterBizCode, UpdateSourceTrigger=PropertyChanged}"
Margin="0 0 10 10"
hc:InfoElement.Title="业务编码"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.TitleWidth="65"
hc:InfoElement.Placeholder="菜单权限 id 或编码"
hc:InfoElement.ShowClearButton="True"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
<hc:TextBox Text="{Binding FilterBizName, UpdateSourceTrigger=PropertyChanged}"
Margin="0 0 10 10"
hc:InfoElement.Title="业务名称"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.TitleWidth="65"
hc:InfoElement.Placeholder="业务名称"
hc:InfoElement.ShowClearButton="True"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=8, Md=6, Lg=6, Xl=4}">
<hc:TextBox Text="{Binding FilterTemplateCode, UpdateSourceTrigger=PropertyChanged}"
Margin="0 0 10 10"
hc:InfoElement.Title="模板编码"
hc:InfoElement.TitlePlacement="Left"
hc:InfoElement.TitleWidth="65"
hc:InfoElement.Placeholder="打印模板编码"
hc:InfoElement.ShowClearButton="True"/>
</hc:Col>
</hc:Row>
</Border>
<Border Grid.Row="1" Margin="0,10">
<hc:UniformSpacingPanel Spacing="10" VerticalAlignment="Center">
<Button Style="{StaticResource ButtonPrimary}" Command="{Binding SearchCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="Search"/>
<TextBlock Text="搜索" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource ButtonDefault}" Command="{Binding ResetCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="Refresh"/>
<TextBlock Text="重置" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
</hc:UniformSpacingPanel>
</Border>
<DataGrid Grid.Row="2"
ItemsSource="{Binding Items}"
AutoGenerateColumns="False"
IsReadOnly="True"
CanUserAddRows="False"
SelectionMode="Extended"
SelectionUnit="FullRow"
RowHeaderWidth="55"
GridLinesVisibility="Horizontal"
HorizontalGridLinesBrush="#FFEDEDED"
VerticalGridLinesBrush="Transparent"
HeadersVisibility="All"
ColumnHeaderStyle="{StaticResource CusDataGridColumnHeaderStyle}"
Style="{StaticResource CusDataGridStyle}"
hc:DataGridAttach.ShowSelectAllButton="True"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto">
<DataGrid.RowHeaderTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
</DataTemplate>
</DataGrid.RowHeaderTemplate>
<DataGrid.Columns>
<DataGridTextColumn Header="业务编码" Binding="{Binding BizCode}" Width="140" CellStyle="{StaticResource CusDataGridCellStyle}"/>
<DataGridTextColumn Header="业务名称" Binding="{Binding BizName}" Width="*" MinWidth="120" CellStyle="{StaticResource CusDataGridCellStyle}"/>
<DataGridTextColumn Header="模板编码" Binding="{Binding TemplateCode}" Width="140" CellStyle="{StaticResource CusDataGridCellStyle}"/>
<DataGridTextColumn Header="备注" Binding="{Binding Remark}" Width="160" CellStyle="{StaticResource CusDataGridCellStyle}"/>
<DataGridTextColumn Header="创建时间" Binding="{Binding CreateTime, StringFormat=yyyy-MM-dd HH:mm}" Width="130" CellStyle="{StaticResource CusDataGridCellStyle}"/>
<DataGridTemplateColumn Header="操作" Width="88" CanUserSort="False" CanUserResize="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="详情"
Command="{Binding DataContext.DetailCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}"
CommandParameter="{Binding}"
Style="{StaticResource ButtonPrimary}"
Padding="0" Height="26" FontSize="12"
Margin="4,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
<TextBlock Text="{Binding StatusMessage}"
VerticalAlignment="Center"
Foreground="{DynamicResource SecondaryTextBrush}"/>
</StackPanel>
</Grid>
</UserControl>

View File

@@ -0,0 +1,9 @@
namespace YY.Admin.Views.Print;
public partial class PrintBizTemplateBindListView
{
public PrintBizTemplateBindListView()
{
InitializeComponent();
}
}