Default.cshtml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. @using VberZero.Tools.StringModel
  2. @model VberAdmin.Web.Views.Shared.Components.TableToolBar.TableToolBarViewModel
  3. <div class="d-flex @(Model?.Search==null?"":"flex-stack") ">
  4. @if (Model != null)
  5. {
  6. if (Model.Search != null)
  7. {
  8. @await Html.PartialAsync("_Search",Model.Search)
  9. }
  10. <style>
  11. [data-kt-table-toolbar="ex-tool"]:empty{
  12. margin-right: 0!important;
  13. }
  14. [data-kt-table-toolbar="ex-tool"]{
  15. white-space: nowrap;
  16. }
  17. </style>
  18. <div class="d-flex justify-content-end me-3 flex-nowrap" data-kt-table-toolbar="ex-tool"></div>
  19. @if (Model.Menu is {Count:>0})
  20. {
  21. <!--begin::Toolbar-->
  22. <div class="d-flex justify-content-end flex-nowrap" data-kt-table-toolbar="base">
  23. <!--begin::Create-->
  24. <button type="button" class="btn btn-primary btn-sm" style="white-space: nowrap" data-kt-menu-trigger="hover" data-kt-menu-placement="bottom-end" data-kt-menu-flip="top-end">
  25. 操作
  26. <span class="svg-icon svg-icon-5">
  27. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
  28. <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  29. <polygon points="0 0 24 0 24 24 0 24"></polygon>
  30. <path d="M6.70710678,15.7071068 C6.31658249,16.0976311 5.68341751,16.0976311 5.29289322,15.7071068 C4.90236893,15.3165825 4.90236893,14.6834175 5.29289322,14.2928932 L11.2928932,8.29289322 C11.6714722,7.91431428 12.2810586,7.90106866 12.6757246,8.26284586 L18.6757246,13.7628459 C19.0828436,14.1360383 19.1103465,14.7686056 18.7371541,15.1757246 C18.3639617,15.5828436 17.7313944,15.6103465 17.3242754,15.2371541 L12.0300757,10.3841378 L6.70710678,15.7071068 Z" fill="#000000" fill-rule="nonzero" transform="translate(12.000003, 11.999999) rotate(-180.000000) translate(-12.000003, -11.999999)"></path>
  31. </g>
  32. </svg>
  33. </span>
  34. </button>
  35. <div class="menu menu-sub menu-sub-dropdown w-150px " data-kt-menu="true" id="menu_@DateTime.Now.Ticks" data-popper-placement="bottom-end">
  36. <div class="p-3 pb-1">
  37. @foreach (var menu in Model.Menu)
  38. {
  39. string btnType =menu.Script.Empty()?"btn" + menu.Name: menu.Script, url = menu.Url??"";
  40. <button type="button" class="btn btn-light-primary btn-sm w-100 mb-2" data-vb-tool-menu-type="@(btnType)" data-vb-tool-menu-url="@(url)">
  41. <i class="@(menu.Icon)"></i>
  42. @(menu.DisplayName)
  43. </button>
  44. }
  45. </div>
  46. </div>
  47. <!--end::Create-->
  48. </div>
  49. <!--end::Toolbar-->
  50. }
  51. @if (Model.SelectionMenu is {Count:>0})
  52. {
  53. <!--begin::Group actions-->
  54. <div class="d-flex flex-nowrap justify-content-end align-items-center d-none" data-kt-table-toolbar="selected">
  55. <div class="fw-bolder me-5 " style="white-space: nowrap">
  56. 选中 <span class="mx-1" data-kt-table-select="selected_count"></span> 条
  57. </div>
  58. <button type="button" class="btn btn-danger btn-sm" style="white-space: nowrap" title="选中后操作" data-kt-menu-trigger="hover" data-kt-menu-placement="bottom-end" data-kt-menu-flip="top-end">
  59. 操作
  60. <span class="svg-icon svg-icon-5 ms-2 ">
  61. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
  62. <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  63. <polygon points="0 0 24 0 24 24 0 24"></polygon>
  64. <path d="M6.70710678,15.7071068 C6.31658249,16.0976311 5.68341751,16.0976311 5.29289322,15.7071068 C4.90236893,15.3165825 4.90236893,14.6834175 5.29289322,14.2928932 L11.2928932,8.29289322 C11.6714722,7.91431428 12.2810586,7.90106866 12.6757246,8.26284586 L18.6757246,13.7628459 C19.0828436,14.1360383 19.1103465,14.7686056 18.7371541,15.1757246 C18.3639617,15.5828436 17.7313944,15.6103465 17.3242754,15.2371541 L12.0300757,10.3841378 L6.70710678,15.7071068 Z" fill="#000000" fill-rule="nonzero" transform="translate(12.000003, 11.999999) rotate(-180.000000) translate(-12.000003, -11.999999)"></path>
  65. </g>
  66. </svg>
  67. </span>
  68. </button>
  69. <div class="menu menu-sub menu-sub-dropdown w-150px " data-kt-menu="true" id="menu2_@DateTime.Now.Ticks" data-popper-placement="bottom-end">
  70. <div class="p-3 pb-1">
  71. @foreach (var menu in Model.SelectionMenu)
  72. {
  73. string btnType =menu.Script.Empty()?"btn" + menu.Name: menu.Script, url = menu.Url??"";
  74. <button type="button" class="btn btn-light-danger btn-sm w-100 mb-2" data-vb-tool-menu-type="@(btnType)" data-vb-tool-menu-url="@(url)">
  75. <i class="@(menu.Icon)"></i>
  76. @(menu.DisplayName)
  77. </button>
  78. }
  79. </div>
  80. </div>
  81. </div>
  82. <!--end::Group actions-->
  83. }
  84. }
  85. </div>