QualityIssueLabel.cshtml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. @using ShwasherSys
  2. @using ShwasherSys.Authorization.Permissions
  3. @using ShwasherSys.Models.Layout
  4. @using ShwasherSys.Views.Shared.New.Modals
  5. @using ShwasherSys.Views.Shared.New.Table
  6. @{
  7. ViewBag.Title = "质量问题标签维护";
  8. string activeMenu = PermissionNames.PagesBasicInfoQualityIssueLabel; //The menu item will be active for this page.
  9. ViewBag.ActiveMenu = activeMenu;
  10. var searchForm = new SearchFormViewModal(new List<SearchItem>()
  11. {
  12. new SearchItem("name","标签名称"),
  13. },"search-form",false);
  14. var table = new TableViewModel( "/api/services/app/QualityIssueLabel/GetAll", activeMenu, searchForm)
  15. .SetFields(new List<FieldItem>()
  16. {
  17. new FieldItem("name", "标签名称"),
  18. new FieldItem("description", "标签描述"),
  19. });
  20. }
  21. @section css{
  22. }
  23. @Html.Partial("New/Table/_Table", table)
  24. @section modal{
  25. <!--Main Modal-->
  26. @{
  27. var modal = new ModalViewModel("标签", new ModalBodyViewModel(new List<Input>()
  28. {
  29. new InputHide("id"),
  30. new Input("name", "标签名称"),
  31. new InputTextarea("description", "标签描述").SetNotRequired(),
  32. }));
  33. }
  34. @Html.Partial("New/Modals/_Modal", modal)
  35. }
  36. @section scripts
  37. {
  38. <script type="text/javascript">
  39. var $table;
  40. $(function () {
  41. $table = LoadTable();
  42. var funs = window.funs || { none: function () { console.log("No type"); } };
  43. funs["btnCreate"] = function() { BtnCreate({ data: { id: "" } }); }
  44. funs["btnUpdate"] = function () { BtnUpdate({ disabled: "" }); };
  45. });
  46. </script>
  47. <!--格式化-->
  48. <script id="formatter-script" type="text/javascript">
  49. function TypeFormatter(v) {
  50. var name = $('#hid-type option[value="' + v + '"]').text();
  51. switch (v) {
  52. case 0:
  53. return '<span class="label label-danger">' + name +'</span>';
  54. default:
  55. return '<span class="label label-info">' + name +'</span>';
  56. }
  57. }
  58. </script>
  59. }
  60. <section style="display: none">
  61. <select id="hid-type">
  62. <option value=""></option>
  63. </select>
  64. @*@Html.DropDownList("hid-type", type)*@
  65. </section>