_ToolMenuWithMs.cshtml 2.2 KB

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