Merge pull request '更新统计bug' (#277) from aq982 into v2
Reviewed-on: https://code.adminnet.top/Admin.NET/Admin.NET.Pro/pulls/277
This commit is contained in:
commit
2c607ae49b
@ -268,6 +268,7 @@ const state = reactive({
|
||||
showAdvanceQueryUI: false,
|
||||
queryParams: {
|
||||
searchKey: undefined,
|
||||
GroupBy: [] as any,
|
||||
@if(Model.QueryWhetherList.Count > 0) {
|
||||
@foreach (var column in Model.QueryWhetherList) {
|
||||
@:@(@column.LowerPropertyName): undefined,
|
||||
@ -350,7 +351,7 @@ const checkTableColumnVisible = (tableColumnName: any) => {
|
||||
if (@column.Statistical == "Y"){
|
||||
@: if (column.field === '@(@column.LowerPropertyName)') {
|
||||
@: // 计算表格内总和
|
||||
@: return `${data.reduce((sum, row) => sum + (row.@(@column.LowerPropertyName) || 0), 0)}/总数:${totalSum.@(@column.LowerPropertyName)}`
|
||||
@: return `${data.reduce((sum, row) => sum + (row.@(@column.LowerPropertyName) || 0), 0)}/总数:${totalSum?.@(@column.LowerPropertyName)||0}`
|
||||
@: }
|
||||
}
|
||||
}
|
||||
@ -377,6 +378,9 @@ const checkTableColumnVisible = (tableColumnName: any) => {
|
||||
return checkTableColumnVisible(`@Model.LowerClassName:${column.field}`);
|
||||
},
|
||||
},
|
||||
@if(@Model.TableField.Any(x=>x.Statistical == "Y")||@Model.TableField.Any(x=>x.IsGroupBy == "Y")){
|
||||
@:showFooter: true, // ✅ 正确控制表尾显示
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@ -398,6 +402,12 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
// 查询操作
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
state.queryParams.GroupBy = [];
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.IsGroupBy == "Y"){
|
||||
@:state.queryParams.GroupBy.push('@(@column.PropertyName)');
|
||||
}
|
||||
}
|
||||
@if(@Model.TableField.Any(x=>x.Statistical == "Y")){
|
||||
@if (@Model.IsApiService) {
|
||||
@:state.totalSum =getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)GetTotalSumPost(params).data.result;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user