Index.cshtml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. @using Bowin.Web.Controls.Mvc;
  2. @using EMISOnline.Web.Controls;
  3. @using Bowin.Common;
  4. @{
  5. Layout = "~/Views/Shared/_FrameLayout.cshtml";
  6. List<string> lurl = new List<string>();
  7. lurl.Add("Content/");
  8. lurl.Add("Doc/");
  9. lurl.Add("Scripts/");
  10. lurl.Add("Login/");
  11. lurl.Add("UploadFile/");
  12. lurl.Add("Account/ChangePassword");
  13. FormsAuthenticationHelper fahelper = new FormsAuthenticationHelper();
  14. var cookieName = EMISOnline.Utility.Const.LOCAL_SETTING_LOGIN_COOKIENAME;
  15. fahelper.AuthenticateRequest(HttpContext.Current, cookieName, lurl);
  16. }
  17. @section scripts{
  18. <script type="text/javascript">
  19. $(function () {
  20. //$(".easyui-tree").tree('collapseAll');
  21. //$.System.addTab('首页', '@Url.Content("~/Home/Main")', 'Main', false);
  22. initMenu();
  23. });
  24. function initMenu() {
  25. $(".index_left_menu").mouseover(function () {
  26. //隐藏子菜单
  27. $(".index_left_menu_child").hide();
  28. $(".index_left_menu").removeClass("index_left_menuover");
  29. $(this).addClass("index_left_menuover");
  30. var child = $("#mc_" + $(this).attr("id"));
  31. if (child.length > 0) {
  32. child.css("top", $(this).offset().top);
  33. child.show();
  34. }
  35. });
  36. $(".index_left_menu").mouseout(function () {
  37. //$(this).removeClass("index_left_menuover");
  38. //var child = $("#mc_" + $(this).attr("id"));
  39. //if (child.length > 0) child.hide();
  40. });
  41. $(".index_left_menu").click(function () {
  42. $(".index_left_menu").removeClass("index_left_menuclick");
  43. $(this).addClass("index_left_menuclick");
  44. });
  45. $("div .index_left_menu_child").mouseout(function () {
  46. //$(this).hide();
  47. //$(".index_left_menu").removeClass("index_left_menuover");
  48. });
  49. $(".index_left_menu").each(function (i, e) {
  50. var cdiv = $(this).find(".index_left_menu_child");
  51. $(this).attr("id", i);
  52. $(this).find("a").attr("cid", i);
  53. if (cdiv.length > 0) {
  54. cdiv.attr("id", "mc_" + i);
  55. cdiv.attr("cid", i);
  56. cdiv.css("top", $(this).offset().top);
  57. $("#center").append(cdiv);
  58. }
  59. });
  60. //加载首页
  61. if ($(".index_left_menu").length > 0) {
  62. $(".index_left_menu")[0].click();
  63. }
  64. }
  65. function onMenu(url,e) {
  66. $(".index_left_menu_child").hide();
  67. $(".index_left_menu").removeClass("index_left_menuover");
  68. $(".index_left_menu").removeClass("index_left_menuclick");
  69. if (e) {
  70. var cid = $(e).attr("cid");
  71. var div = $("#" + cid);
  72. div.addClass("index_left_menuclick");
  73. }
  74. if (url.length > 0) {
  75. $("#centerIframe").attr("src", url);
  76. }
  77. return false;
  78. }
  79. function changePassword() {
  80. $.System.addTab('修改密码', '@Url.Content("~/Account/ChangePassword")', 'ChangePassword', false);
  81. }
  82. </script>
  83. }
  84. <div id="index_left" class="index_left_bg" data-options="region:'west',title:'',split:false,tools:'#tab-tools'"
  85. style="width: 150px;background-image:url(@Url.Content("~/Content/images/homeLeftbg" + (((EMISOnline.Utility.FormValidate.CustomPrincipal)Context.User).IsStudent?"":"Mgr") + ".jpg"));">
  86. <!--Logo-->
  87. <div class="index_left_top">
  88. <img src = "@Url.Content("~/Content/images/homeLogo.png")" />
  89. </div>
  90. <!--菜单排版示例
  91. <div class="index_left_menu" style=" display:none;">
  92. <a href="#">选课</a>
  93. <div class="index_left_menu_child">
  94. <ul>
  95. <li><a href="javascript:void();" onclick="onMenu(this,'http://www.baidu.com');">菜单1</a></li>
  96. <li><a href="#">菜单2</a></li>
  97. <li><a href="#">菜单消息</a></li>
  98. </ul>
  99. </div>
  100. </div>-->
  101. @Html.MenuTree(new AccordionTreeOptions()
  102. {
  103. OnClick = "onMenu(this,'{MnuProgram}');",
  104. DataOptions = "fit: true"
  105. })
  106. <!--用户头像、名称-->
  107. <div class="index_left_header">
  108. <img src = "@Url.Content("~/Content/images/homeHeader.png")" />
  109. <br>
  110. @(((EMISOnline.Utility.FormValidate.CustomPrincipal)Context.User).Name +
  111. (((EMISOnline.Utility.FormValidate.CustomPrincipal)Context.User).IsStudent ? "(同学)" : "(老师)"))
  112. <p>
  113. <a href="@Url.Content("~/account/logoff")" style="color:Blue;text-decoration:underline;" >退出</a>
  114. </p>
  115. </div>
  116. </div>
  117. <div id="center" region="center" border="true" title="" class="index_center_bg">
  118. <iframe id="centerIframe" frameborder="0" scrolling="no" style="border:0;width:100%;height:99.6%;" src="">
  119. </iframe>
  120. </div>
  121. <div id="sysWindow">
  122. </div>