State.cshtml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. @using VberAdmin.Web.Models.Table
  2. @using Microsoft.AspNetCore.Mvc.Rendering
  3. @using VberAdmin.Web.Models.Input
  4. @using VberAdmin.Web.Models.Modals
  5. @using VberAdmin.Web.Models.Search
  6. @using VberZero
  7. @{
  8. ViewBag.Title = L("StateTitle");
  9. string activeMenu = PermissionNames.VberSystemMgStateMg; //The menu item will be active for this page.
  10. ViewBag.ActiveMenu = activeMenu;
  11. var table = new VmTable(VzConsts.ApiAppUrl + "State/GetAll", activeMenu, new VmSearch(new List<VmSearchItem>()
  12. {
  13. //new SearchItem("dd", L("stateName")).SetSearchIcon("q_u","ddd"),
  14. //new SearchItem("ff", L("stateName")).SetSelectItem("<option value=\"\">000</option><option value=\"S10001\">111</option><option value=\"S10002\">222</option>").SetSearchIcon("q_u","fff"),
  15. //new SearchItem("name1", L("stateName"),FieldType.D),
  16. new VmSearchItem("name", L("stateName")),
  17. new VmSearchItem("codeKey", L("codeKey"))
  18. })).AddItems(new List<VmTableItem>()
  19. {
  20. new VmTableItem("name", L("stateName")),
  21. new VmTableItem("codeKey",L("codeKey")),
  22. new VmTableItem("codeValue", L("codeValue")),
  23. new VmTableItem("displayValue",L("displayValue")),
  24. });
  25. var modalBody = new VmModalBody()
  26. .AddInputs(new List<VmInputBase>()
  27. {
  28. new VmInputHidden("id"),
  29. })
  30. .AddInput(new VmInput("displayValue", L("displayValue")))
  31. .AddGroup(new List<VmInputBase>()
  32. {
  33. new VmInput("name", L("stateName")).WithDisabled(),
  34. new VmInput("codeKey", L("codeKey")).WithDisabled(),
  35. new VmInput("codeValue", L("codeValue")).WithDisabled(),
  36. }, 3);
  37. var modal = new VmModal().WithHeaderAndFooter(L("state"), "").WithBody(modalBody);
  38. }
  39. @await Html.PartialAsync("_Table", table)
  40. @await Html.PartialAsync("_Modal", modal)
  41. @section scripts
  42. {
  43. @*<script src="~/Content/Plugins/PrintPreView/print-preview.js"></script>*@
  44. <script type="text/javascript">
  45. $(function () {
  46. LoadTable();
  47. });
  48. //$('#print').printPreview({
  49. // printBody: ".table-box",
  50. // cssUrl: '../../Content/Plugins/bootstrap-3.3.7/css/bootstrap.css,../../Content/Css/Site.css'
  51. //});
  52. </script>
  53. <script id="formatter" type="text/javascript">
  54. </script>
  55. }