Skip to content

Commit

Permalink
fix layui export bug; fix blazor generator bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliang-wt committed Jul 14, 2024
1 parent 9939105 commit a0f1708
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BootstrapBlazor" Version="8.3.4" />
<PackageReference Include="BootstrapBlazor.Chart" Version="8.1.0" />
<PackageReference Include="BootstrapBlazor.SummerNote" Version="8.0.2" />
<PackageReference Include="BootstrapBlazor" Version="8.7.2" />
<PackageReference Include="BootstrapBlazor.Chart" Version="8.1.5" />
<PackageReference Include="BootstrapBlazor.SummerNote" Version="8.0.3" />
<PackageReference Include="Elsa.Designer.Components.Web" Version="2.14.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $columns$
}
@if (IsAccessable("/api/$modelname$/BatchDelete"))
{
<TableToolbarPopconfirmButton TItem="$modelname$_View" Color="Color.Primary"
<TableToolbarPopConfirmButton TItem="$modelname$_View" Color="Color.Primary"
Icon="fa fa-fw fa-trash" Text="@WtmBlazor.Localizer["Sys.BatchDelete"]"
OnConfirm="@OnBatchDeleteClick" Content="@WtmBlazor.Localizer["Sys.BatchDeleteConfirm"]" CloseButtonText="@WtmBlazor.Localizer["Sys.Close"]"
ConfirmButtonText="@WtmBlazor.Localizer["Sys.BatchDelete"]" ConfirmButtonColor="Color.Danger" />
Expand Down
67 changes: 37 additions & 30 deletions src/WalkingTec.Mvvm.Mvc/framework_layui.js
Original file line number Diff line number Diff line change
Expand Up @@ -961,42 +961,49 @@ window.ff = {
return data;
},

DownloadExcelOrPdf: function (url, formId, defaultcondition, ids) {
var formData = ff.GetSearchFormData(formId);
if (defaultcondition == null) {
defaultcondition = {};
}
var tempwhere = {};
$.extend(tempwhere, defaultcondition);
$.extend(tempwhere, formData);
for (let item in tempwhere) {
if (item.startsWith("Searcher.") == false) {
tempwhere["Searcher." + item] = tempwhere[item];
}
DownloadExcelOrPdf: function (url, formId, defaultcondition, ids) {
var formData = ff.GetSearchFormData(formId);
if (defaultcondition == null) {
defaultcondition = {};
}
var tempwhere = {};
for (let item in defaultcondition) {
if (formData["Searcher." + item]) {

}
else {
tempwhere[item] = defaultcondition[item]
}
}
$.extend(tempwhere, formData);
for (let item in tempwhere) {
if (item.startsWith("Searcher.") == false) {
tempwhere["Searcher." + item] = tempwhere[item];
}
}

var form = $('<form method="POST" action="' + url + '">');
for (var attr in tempwhere) {
if (tempwhere[attr] != null) {
if (Array.isArray(tempwhere[attr])) {
for (var i = 0; i < tempwhere[attr].length; i++) {
form.append($('<input type="hidden" name="' + attr + '[' + i + ']" value="' + tempwhere[attr][i] + '">'));
}
}
else {
form.append($('<input type="hidden" name="' + attr + '" value="' + tempwhere[attr] + '">'));
var form = $('<form method="POST" action="' + url + '">');
for (var attr in tempwhere) {
if (tempwhere[attr] != null) {
if (Array.isArray(tempwhere[attr])) {
for (var i = 0; i < tempwhere[attr].length; i++) {
form.append($('<input type="hidden" name="' + attr + '[' + i + ']" value="' + tempwhere[attr][i] + '">'));
}
}
}
if (ids !== undefined && ids !== null) {
for (var i = 0; i < ids.length; i++) {
form.append($('<input type="hidden" name="Ids" value="' + ids[i] + '">'));
else {
form.append($('<input type="hidden" name="' + attr + '" value="' + tempwhere[attr] + '">'));
}
}
$('body').append(form);
form.submit();
form.remove();
},
}
if (ids !== undefined && ids !== null) {
for (var i = 0; i < ids.length; i++) {
form.append($('<input type="hidden" name="Ids" value="' + ids[i] + '">'));
}
}
$('body').append(form);
form.submit();
form.remove();
},

Download: function (url, ids) {
var form = $('<form method="POST" action="' + url + '">');
Expand Down

0 comments on commit a0f1708

Please sign in to comment.