Skip to content

Commit

Permalink
fix export with default searcher value
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliang-wt committed Feb 19, 2023
1 parent aa89193 commit f593176
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion demo/WalkingTec.Mvvm.Demo/Controllers/StudentController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using WalkingTec.Mvvm.Core;
Expand All @@ -17,6 +17,7 @@ public partial class StudentController : BaseController
public ActionResult Index()
{
var vm = Wtm.CreateVM<StudentListVM>();
vm.Searcher.Sex = GenderEnum.Male;
return PartialView(vm);
}

Expand Down
4 changes: 2 additions & 2 deletions demo/WalkingTec.Mvvm.Demo/Views/Student/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<wt:searchpanel vm="@Model" reset-btn="true">
<wt:row items-per-row="ItemsPerRowEnum.Three">
<wt:textbox field="Searcher.Password" />
<wt:combobox field="Searcher.Sex" empty-text="@Localizer["Sys.All"]" />
<wt:textbox field="Searcher.ZipCode" />
@*<wt:combobox field="Searcher.Sex" empty-text="@Localizer["Sys.All"]" />
*@<wt:textbox field="Searcher.ZipCode" />
<wt:datetime field="Searcher.Enroll" type="Year" />

</wt:row>
Expand Down
6 changes: 6 additions & 0 deletions src/WalkingTec.Mvvm.Mvc/framework_layui.js
Original file line number Diff line number Diff line change
Expand Up @@ -912,10 +912,16 @@ window.ff = {
},

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

Expand Down

0 comments on commit f593176

Please sign in to comment.