TestQuestionList.cshtml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. @using Bowin.Web.Controls.Mvc;
  2. @using EMISOnline.Entities;
  3. @using EMISOnline.Web.Controls;
  4. @{
  5. ViewBag.Title = "List";
  6. }
  7. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;overflow:auto;">
  8. @Html.Position()
  9. <div style="float: left; width: 19%; overflow: auto">
  10. @Html.Tree(new TreeOptions
  11. {
  12. ID = "ulTree",
  13. ItemSourceUrl = Url.Content("~/PaperSetting/ListQuesLibTree"),
  14. CssClass = "m_video_tree",
  15. }, null)
  16. </div>
  17. <div style="float: left; width: 80%">
  18. <div class="p_SearchTitle">
  19. <div style="float: left; margin-left: 10px; font-size: 12px; line-height: 30px;">
  20. 查询条件</div>
  21. </div>
  22. <form id="formQuery" method="post" action="@Url.Content("~/Students/Excel")">
  23. @Html.Hidden("libaryid")
  24. <div class="search_keyword">
  25. <div class="search_input">
  26. <ul>
  27. <li class="sn" style="padding-left: 5px;">试题类型:</li>
  28. <li class="sv">
  29. @Html.DropdownList(new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ItemSourceUrl = Url.Content("~/SubjectMgr/GetQuestionType?isEmpty=true"), TextField = "Name", ValueField = "base_question_type_id", ID = "QuestionType", Name = "QuestionType" }, new Dictionary<string, string> { { "data-condition", "dgList" } })
  30. </li>
  31. <li class="sn" style="padding-left: 5px;">采用频次:</li>
  32. <li class="sv">
  33. @Html.TextBox(new TextBoxOptions() { ID = "UsedCountFrom" }, new Dictionary<string, string> { { "style", "width:80px" } })
  34. @Html.TextBox(new TextBoxOptions() { ID = "UsedCountTo" }, new Dictionary<string, string> { { "style", "width:80px" } })
  35. </li>
  36. <li>
  37. @Html.Button(new ButtonOptions() { ID = "btnSearch", Text = "查 询" })
  38. @Html.Button(new ButtonOptions() { ID = "btnAdd", Text = "新增" })
  39. @Html.Button(new ButtonOptions() { ID = "btnDel", Text = "删除" })
  40. </li>
  41. </ul>
  42. <ul>
  43. <li class="sn" style="padding-left: 5px;">试题内容:</li>
  44. <li class="sv">
  45. @Html.TextBox("Content")
  46. </li>
  47. <li class="sn" style="padding-left: 5px;">难度系数:</li>
  48. <li class="sv">
  49. @Html.TextBox(new TextBoxOptions() { ID = "DifficultyFrom" }, new Dictionary<string, string> { { "style", "width:80px" } })
  50. @Html.TextBox(new TextBoxOptions() { ID = "DifficultyTo" }, new Dictionary<string, string> { { "style", "width:80px" } })
  51. </li>
  52. <li class="sn" style="padding-left: 5px;">试题状态:</li>
  53. <li class="sv">
  54. @Html.DropdownList(new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ItemSourceUrl = Url.Content("~/Campus/CampusDropdownListBanid"), ID = "IsValid", Name = "IsValid" }, new Dictionary<string, string> { { "data-condition", "dgList" } })
  55. </li>
  56. </ul>
  57. </div>
  58. </div>
  59. </form>
  60. <div class="search_list">
  61. @Html.DataGrid(new DataGridOptions
  62. {
  63. Columns = new List<DataGridColumn>()
  64. {
  65. new CheckBoxFieldColumn{ HeaderText="", FieldName="UserID"},
  66. new LinkButtonColumn { FieldName="content", HeaderText="题干内容", Align=AlignStyle.Center,Handle="view" , Width=400 },
  67. new BoundFieldColumn { FieldName="base_question_type_name", HeaderText="试题类型", Align=AlignStyle.Center },
  68. new BoundFieldColumn { FieldName="difficulty_degree", HeaderText="难度", Align=AlignStyle.Center},
  69. new BoundFieldColumn { FieldName="used_count", HeaderText="采用频次", Align=AlignStyle.Center },
  70. new BoundFieldColumn { FieldName="test_question_libary_name", HeaderText="题库", Align=AlignStyle.Center },
  71. new BoundFieldColumn { FieldName="isEnable", HeaderText="是否有效", Align=AlignStyle.Center },
  72. new BoundFieldColumn { FieldName="created_date", HeaderText="创建日期", Align=AlignStyle.Center, Formatter= Formatter.OnlyYearMonthDay },
  73. new LinkButtonColumn { HeaderText="操作", Align=AlignStyle.Center , Text="编辑", Handle="edit" },
  74. },
  75. IsCheckOnSelect = true,
  76. DataSourceUrl = Url.Content("~/SubjectMgr/List"),
  77. ID = "dgList",
  78. IsPagination = true,
  79. IsShowRowNumbers = true,
  80. IsSingleSelect = false,
  81. IsVerticalExpand = true,
  82. IsAutoHeight = false,
  83. })
  84. </div>
  85. </div>
  86. </div>
  87. @section scripts{
  88. <script type="text/javascript">
  89. $(function () {
  90. $('#btnAdd').click(function () {
  91. var node = $('#ulTree').tree('getSelected');
  92. if (node == null) {
  93. alertMsg("请选择题库!");
  94. return false;
  95. }
  96. var libaryid = node == null ? "" : node.id;
  97. window.location.href = "@Url.Content("~/SubjectMgr/TestQuestionAdd")?libaryid=" + libaryid;
  98. })
  99. $("#btnSearch").click(function () {
  100. var node = $('#ulTree').tree('getSelected');
  101. var libaryid = node == null ? "" : node.id;
  102. $('#libaryid').val(libaryid);
  103. var queryForm = $("#formQuery").getFormData();
  104. $("#dgList").cmsXDataTable("load", queryForm);
  105. });
  106. })
  107. function edit(index, row) {
  108. var node = $('#ulTree').tree('getSelected');
  109. var libaryid = node == null ? "" : node.id;
  110. window.location.href = "@Url.Content("~/SubjectMgr/TestQuestionAdd")?test_question_id=" + row.test_question_Id + "&ac=edit&libaryid=" + libaryid;
  111. }
  112. function view(index, row) {
  113. window.location.href = "@Url.Content("~/SubjectMgr/TestQuestionAdd")?test_question_id=" + row.test_question_Id;
  114. }
  115. </script>
  116. }