PhoneAnswer.cshtml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. @using WeApp
  2. @using WeApp.Configuration
  3. @using WeApp.Authorization
  4. @using WeApp.Views.Shared.Modals
  5. @using WeApp.Views.Shared.SearchForm
  6. @using WeApp.Views.Shared.Table
  7. @{
  8. ViewBag.Title = "电话问题答案维护";
  9. string activeMenu = PermissionNames.PagesBasicMgPhoneAnswerMg; //The menu item will be active for this page.
  10. ViewBag.ActiveMenu = activeMenu;
  11. var searchForm = new SearchFormViewModel(new List<SearchItem>()
  12. {
  13. new SearchItem("keywords","关键字"),
  14. },"search-form",false);
  15. var table = new TableViewModel(IwbConsts.ApiAppUrl + "PhoneAnswer/GetAll", activeMenu, searchForm)
  16. .SetFields(new List<FieldItem>()
  17. {
  18. new FieldItem("content", "内容"),
  19. new FieldItem("keywords", "关键字"),
  20. new FieldItem("type", "答案类型"),
  21. new FieldItem("questionNo", "培训营"),
  22. });
  23. var inputs = new List<Input>()
  24. {
  25. new InputHide("id"),
  26. new Input("content", "内容"),
  27. new Input("keywords", "关键字"),
  28. new InputNumber("type", "答案类型"),
  29. new Input("questionNo", "培训营").SetNotRequired(),
  30. };
  31. var modalBody = new ModalBodyViewModel(inputs);
  32. var modal = new ModalViewModel("答案",modalBody);
  33. }
  34. @section css{
  35. }
  36. @Html.Partial("Table/_Table", table)
  37. @section modal{
  38. <!--Modal Start-->
  39. @Html.Partial("Modals/_Modal", modal)
  40. <!--Modal End-->
  41. }
  42. @section scripts
  43. {
  44. <script type="text/javascript">
  45. var $table;
  46. $(function () {
  47. $table = LoadTable();
  48. var funs = window.iwbfuns || { none: function () { console.log("No type"); } };
  49. funs["btnCreate"] = function() { BtnCreate({ data: { id: "" } }); }
  50. funs["btnUpdate"] = function () { BtnUpdate({ disabled: "" }); };
  51. });
  52. </script>
  53. <!--格式化-->
  54. <script id="formatter-script" type="text/javascript">
  55. function TypeFormatter(v) {
  56. var name = $('#hid-type option[value="' + v + '"]').text();
  57. switch (v) {
  58. case 0:
  59. return '<span class="label label-danger">' + name +'</span>';
  60. default:
  61. return '<span class="label label-info">' + name +'</span>';
  62. }
  63. }
  64. </script>
  65. }
  66. <section style="display: none">
  67. <select id="hid-type">
  68. <option value=""></option>
  69. </select>
  70. @*@Html.DropDownList("hid-type", type)*@
  71. </section>