PingAnYeXianSZCG_Web 前端代码

Add.html 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link href="../css/layer/need/layer.css" />
  8. <link rel="stylesheet" href="../css/init.css" />
  9. <title></title>
  10. <style>
  11. .BiaoTi{
  12. width: 100%;
  13. text-align:center;
  14. border-color:#ccc ;
  15. border:1px solid #ccc;
  16. }
  17. textarea{
  18. border-color:#ccc ;
  19. border:1px solid #ccc;
  20. height: 100px;
  21. }
  22. .Common {
  23. width: 100%;
  24. background: #fff;
  25. text-align: center;
  26. padding: 10px 15px;
  27. height: auto;
  28. overflow-y: auto;
  29. }
  30. .Common table th {
  31. padding: 5px 8px 5px 0;
  32. text-align: right;
  33. width: 20%;
  34. }
  35. .Common table {
  36. width: 100%;
  37. }
  38. .Common table td textarea {
  39. width: 100%;
  40. vertical-align: middle;
  41. resize: none;
  42. outline: none;
  43. }
  44. .Common table td {
  45. padding: 6px 0 5px 10px;
  46. text-align: left;
  47. color: #717171;
  48. line-height: 200%;
  49. }
  50. .btn_box {
  51. margin-top: 30px;
  52. }
  53. </style>
  54. </head>
  55. <body>
  56. <div class="Common">
  57. <table >
  58. <tr>
  59. <th>标题:</th>
  60. <td>
  61. <input class="BiaoTi" id="title" type="text" style="" />
  62. </td>
  63. </tr>
  64. <tr>
  65. <th >内容:</th>
  66. <td colspan="2">
  67. <textarea data-adaptheight id="content" name="" rows="" cols=""></textarea>
  68. </td>
  69. </tr>
  70. </table>
  71. <div class="btn_box">
  72. <button class="btns">保存</button>
  73. </div>
  74. </div>
  75. <script >
  76. $(document).ready(function(){
  77. $(".btns").click(function(){
  78. if(!$("#title").val()){
  79. layer.msg("输入标题");
  80. }
  81. else if(!$("#content").val()){
  82. layer.msg("输入内容");
  83. }
  84. Add()
  85. })
  86. })
  87. function Add(){
  88. $.post(huayi.config.callcenter_url + "Notice/AddNotice", {
  89. title:$("#title").val(),
  90. content:$("#content").val(),
  91. token: $.cookie("token"),
  92. }, function(result) {
  93. result = JSON.parse(result);
  94. if(result.state.toLowerCase() == "success") {
  95. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  96. parent.layer.close(index); //再执行关闭
  97. parent.initTable();
  98. parent.layer.msg("添加成功");
  99. }
  100. })
  101. }
  102. </script>
  103. </body>
  104. </html>