_ToolMenu.cshtml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. @using ShwasherSys.Models.Layout
  2. @using ShwasherSys.Views.Shared.New.SearchForm
  3. @model List<PermissionButtonViewModel>
  4. <div class="btn-toolbar row" id="tableTool" role="toolbar" aria-label="Toolbar with button groups" style="min-height: 40px;">
  5. @{
  6. SearchFormViewModal searchFrom = null;
  7. SearchFormViewModel searchFrom2 = null;
  8. try
  9. {
  10. searchFrom = ViewBag.SearchFrom;
  11. }
  12. catch
  13. {
  14. searchFrom2 = ViewBag.SearchFrom;
  15. }
  16. var toolWidth1 = 8;
  17. var toolWidth2 = 9;
  18. if (searchFrom == null && searchFrom2 == null)
  19. {
  20. toolWidth1 = 12;
  21. toolWidth2 = 12;
  22. }
  23. }
  24. <div class="col-sm-@toolWidth1 col-lg-@toolWidth2 pull-left" style="padding: 0">
  25. <div class="btn-group btn-group-sm" id="Tool1" role="group" aria-label="First group">
  26. @{
  27. if (Model != null)
  28. {
  29. foreach (var perm in Model)
  30. {
  31. if (perm.MenuType != 3 || (perm.Script != null && perm.Script.StartsWith("N")))
  32. {
  33. continue;
  34. }
  35. string btnClass = perm.Class, btnType = perm.Script, url = perm.Url;
  36. if (string.IsNullOrEmpty(btnClass))
  37. {
  38. btnClass = "btn btn-default ";
  39. }
  40. btnClass += " menu-btn ";
  41. if (string.IsNullOrEmpty(btnType))
  42. {
  43. btnType = "btn" + perm.FunctionNo;
  44. }
  45. if (string.IsNullOrEmpty(url))
  46. {
  47. url = "";
  48. }
  49. <button type="button" class="@btnClass" data-type="@btnType" data-url="@url">
  50. <i class="iconfont @perm.Icon"></i>
  51. @perm.DisplayName
  52. </button>
  53. }
  54. }
  55. }
  56. </div>
  57. <div class="row" id="tableToolExt">
  58. </div>
  59. </div>
  60. <div class="col-sm-4 col-lg-3 pull-right" style="padding: 0">
  61. @if (searchFrom != null)
  62. {
  63. @Html.Partial("_SearchForm", searchFrom)
  64. }
  65. else if (searchFrom2 != null)
  66. {
  67. @Html.Partial("New/SearchForm/_SearchForm", searchFrom2)
  68. }
  69. </div>
  70. </div>