_Search.cshtml 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. @model VberAdmin.Web.Models.Search.VmSearch
  2. @if (Model != null)
  3. {
  4. <!--begin::Search-->
  5. <form id="@Model.Id" class="d-flex align-items-center justify-content-between me-2 w-100 d-none d-md-flex">
  6. <div class="d-flex align-items-center position-relative my-1">
  7. <!--Svg Icon | path: icons/duotone/General/Search.svg-->
  8. <span class="svg-icon svg-icon-1 position-absolute ms-6">
  9. <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">
  10. <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  11. <rect x="0" y="0" width="24" height="24"></rect>
  12. <path d="M14.2928932,16.7071068 C13.9023689,16.3165825 13.9023689,15.6834175 14.2928932,15.2928932 C14.6834175,14.9023689 15.3165825,14.9023689 15.7071068,15.2928932 L19.7071068,19.2928932 C20.0976311,19.6834175 20.0976311,20.3165825 19.7071068,20.7071068 C19.3165825,21.0976311 18.6834175,21.0976311 18.2928932,20.7071068 L14.2928932,16.7071068 Z" fill="#000000" fill-rule="nonzero" opacity="0.3"></path>
  13. <path d="M11,16 C13.7614237,16 16,13.7614237 16,11 C16,8.23857625 13.7614237,6 11,6 C8.23857625,6 6,8.23857625 6,11 C6,13.7614237 8.23857625,16 11,16 Z M11,18 C7.13400675,18 4,14.8659932 4,11 C4,7.13400675 7.13400675,4 11,4 C14.8659932,4 18,7.13400675 18,11 C18,14.8659932 14.8659932,18 11,18 Z" fill="#000000" fill-rule="nonzero"></path>
  14. </g>
  15. </svg>
  16. </span>
  17. <input type="text" data-search-keyWord="global" data-search-filed="@Model.Field" data-search-filed-type="@((int)Model.FieldType)" data-search-exp-type="@((int)Model.ExpType)" data-kt-table-filter="search" class="form-control form-control-solid form-control-sm w-250px ps-15" placeholder="输入关键字"/>
  18. </div>
  19. <div class="d-flex justify-content-end">
  20. <a href="#" class="btn btn-sm btn-flex btn-light-primary fw-bolder" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end" data-kt-menu-flip="top-end">
  21. <!--Svg Icon | path: icons/duotone/Text/Filter.svg-->
  22. <span class="svg-icon svg-icon-5 svg-icon-gray-500 me-1">
  23. <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">
  24. <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  25. <rect x="0" y="0" width="24" height="24"></rect>
  26. <path d="M5,4 L19,4 C19.2761424,4 19.5,4.22385763 19.5,4.5 C19.5,4.60818511 19.4649111,4.71345191 19.4,4.8 L14,12 L14,20.190983 C14,20.4671254 13.7761424,20.690983 13.5,20.690983 C13.4223775,20.690983 13.3458209,20.6729105 13.2763932,20.6381966 L10,19 L10,12 L4.6,4.8 C4.43431458,4.5790861 4.4790861,4.26568542 4.7,4.1 C4.78654809,4.03508894 4.89181489,4 5,4 Z" fill="#000000"></path>
  27. </g>
  28. </svg>
  29. </span>
  30. 高级查询
  31. </a>
  32. <div class="menu menu-sub menu-sub-dropdown w-250px w-md-300px " data-kt-menu="true" id="menu_@Model.Id" data-popper-placement="bottom-end">
  33. <div class="px-5 py-3">
  34. <div class="fs-5 text-dark fw-bolder">高级查询</div>
  35. </div>
  36. <div class="separator border-gray-200"></div>
  37. @if (Model.Items != null && Model.Items.Any())
  38. {
  39. <div class="px-5 py-3">
  40. <div class="scroll mh-475px">
  41. @foreach (var item in Model.Items)
  42. {
  43. @await Html.PartialAsync("Input/_SearchInput", item)
  44. }
  45. </div>
  46. <!--begin::Actions data-kt-menu-dismiss="true"-->
  47. <div class="d-flex justify-content-end">
  48. <button type="reset" class="btn btn-sm btn-light btn-active-light-primary me-2">重置</button>
  49. <button type="button" class="btn btn-sm btn-primary" data-vb-tool-menu-type="btnSearch" data-search-submit="true" >查询</button>
  50. </div>
  51. <!--end::Actions-->
  52. </div>
  53. }
  54. </div>
  55. </div>
  56. </form>
  57. <script>
  58. $(function () {
  59. $('#@(Model.Id)').find('.form-control,.form-select').on('keydown.search',
  60. function (event) {
  61. let e = event || window.event;
  62. if (e && e.keyCode == 13) {
  63. let $btn = $("#@(Model.Id)").find('button[data-vb-tool-menu-type="btnSearch"]');
  64. if ($btn && $btn.length) {
  65. $btn.trigger("click");
  66. }
  67. }
  68. });
  69. });
  70. </script>
  71. <!--end::Search-->
  72. }