_Table.cshtml 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. @using VberZero.Tools.StringModel
  2. @model VberAdmin.Web.Models.Table.VmTable
  3. @if (Model != null)
  4. {
  5. if (Model.ActiveMenu != null)
  6. {
  7. <vc:breadcrumb active-menu="@Model.ActiveMenu"></vc:breadcrumb>
  8. }
  9. <!-- TABLE @(Model.TableId) START-->
  10. @if (Model is{HasBox:true})
  11. {
  12. @Html.Raw($"<div id=\"{Model.TableId}_box\" class=\"card table-box vb-bootstrap-table \"><div class=\"card-body fs-6 py-4 px-5 text-gray-700\">")
  13. if (Model.ActiveMenu != null || Model.Search != null)
  14. {
  15. <vc:table-tool-bar active-menu="@Model.ActiveMenu" search-view="@Model.Search"></vc:table-tool-bar>
  16. }
  17. }
  18. else
  19. {
  20. @Html.Raw($"<div id=\"{Model.TableId}_box\" class=\"table-box vb-data-table px-5\">")
  21. }
  22. @*data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  23. data-id-field="@(Model.RowId)" data-unique-id="@(Model.RowId)"
  24. @(Html.Raw(Model.DataMethod))
  25. data-pagination="@(Model.Page)"
  26. data-page-size="@(Model.PageArray[0])"
  27. data-page-number="1"data-page-list="[@(Model.PageList)]"
  28. data-pagination-detail-h-align="right"
  29. data-pagination-h-align="left"
  30. *@
  31. <table id="@(Model.TableId)" class="table @(Model.TableClass)"
  32. data-url="@(Model.Url)"
  33. data-server-side="true"
  34. data-row-id="@(Model.RowId)"
  35. data-method="@(Model.Method)"
  36. data-paging="@(Model.Page)"
  37. data-length-menu="[@(Model.PageList)]"
  38. data-page-select="@(Model.PageSelect)"
  39. data-multiple-select="@(Model.MultiplePageSelect)"
  40. data-check-box="@(Model.CheckBox)"
  41. data-click-to-select="@(Model.ClickSelect)"
  42. data-single-select="@(Model.SingleSelect)"
  43. data-processing="@(Model.Processing)"
  44. data-is-tree="@(Model.Tree)"
  45. @(Html.Raw(Model.Scroll))
  46. @(Html.Raw(Model.Other))>
  47. <thead class="@(Model.TheadClass)">
  48. <tr class="@(Model.TheadTrClass)">
  49. @if (Model.IsTree)
  50. {
  51. <th class="" data-tree="true" data-sortable="false"></th>
  52. }
  53. @if (Model.HasCheckBox)
  54. {
  55. <th class="w-10px pe-2" data-check-box="true" data-sortable="false">
  56. @if (!Model.IsSingleSelect)
  57. {
  58. //data-kt-check="true" data-kt-check-target="#@(Model.TableId) .form-check-input"
  59. <div class="form-check form-check-sm form-check-custom form-check-solid me-3">
  60. <input class="form-check-input" type="checkbox" value="1"/>
  61. </div>
  62. }
  63. </th>
  64. }
  65. @if (Model.Items != null && Model.Items.Any())
  66. {
  67. foreach (var item in Model.Items)
  68. {
  69. @*data-align="@(item.Align)"*@
  70. <th data-field="@(item.FiledName)" data-class-name="@(item.ClassName)" @(Html.Raw(item.Sort)) @(Html.Raw(item.Tip)) @(Html.Raw(item.FormatterStr)) @(Html.Raw(item.WidthStr))>@(item.DisplayName)</th>
  71. }
  72. }
  73. @if (Model.IsTree)
  74. {
  75. <th class="text-end min-w-100px" data-action="true" @Html.Raw(Model.Actions.Empty() ? "data-action-tree=\"true\"" : $"data-action-formatter=\"{Model.Actions}\"")>操作</th>
  76. }else if (Model.Actions.NotEmpty())
  77. {
  78. <th class="text-end min-w-100px pe-2" data-action="true" data-action-formatter="@Html.Raw(Model.Actions)">操作</th>
  79. }
  80. </tr>
  81. </thead>
  82. </table>
  83. @if (Model.HasBox)
  84. {
  85. @Html.Raw("</div>")
  86. }
  87. @Html.Raw("</div>")
  88. <!-- TABLE @(Model.TableId) END-->
  89. }