systemmanage_usergroup_add.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link href="../css/mui.min.css" rel="stylesheet" />
  8. <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
  9. <link rel="stylesheet" type="text/css" href="../css/common.css" />
  10. <style type="text/css">
  11. .mui-content>.mui-table-view:first-child {
  12. margin-top: 0;
  13. }
  14. /*详情*/
  15. .equipTitle {
  16. color: #21b2e7;
  17. font-size: 14px;
  18. }
  19. .mui-table-view-cell p {
  20. color: #333;
  21. font-size: 16px;
  22. margin-top: 4px;
  23. }
  24. /*input*/
  25. .mui-table-view-cell input {
  26. line-height: 30px;
  27. width: 100%;
  28. height: inherit;
  29. margin-bottom: 0;
  30. padding: 0;
  31. -webkit-user-select: text;
  32. border: none;
  33. border-radius: none;
  34. outline: 0;
  35. background-color: #fff;
  36. -webkit-appearance: none;
  37. }
  38. input::-webkit-input-placeholder {
  39. color: #BEBEBE;
  40. }
  41. input::-moz-placeholder {
  42. /* Mozilla Firefox 19+ */
  43. color: #BEBEBE;
  44. }
  45. input:-moz-placeholder {
  46. /* Mozilla Firefox 4 to 18 */
  47. color: #BEBEBE;
  48. }
  49. input:-ms-input-placeholder {
  50. /* Internet Explorer 10-11 */
  51. color: #BEBEBE;
  52. }
  53. .addAddress {
  54. position: absolute;
  55. right: 12px;
  56. top: 29px;
  57. }
  58. .mui-table-view-cell textarea {
  59. border: none;
  60. padding: 0;
  61. }
  62. .nullData {
  63. top: 45px;
  64. }
  65. </style>
  66. </head>
  67. <body>
  68. <header class="mui-bar mui-bar-nav">
  69. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  70. <h1 class="mui-title">添加用户组</h1>
  71. <a id="submit" class="mui-icon fa fa-cloud-upload mui-pull-right"></a>
  72. </header>
  73. <div class="mui-content">
  74. <form action="post" id="addUserForm">
  75. <ul class="mui-table-view" id="user">
  76. <li class="mui-table-view-cell">
  77. <span class="equipTitle">角色名称</span>
  78. <p><input type="text" name="addName" placeholder="请输入角色名称" id="username" value="" /></p>
  79. </li>
  80. <li class="mui-table-view-cell">
  81. <span class="equipTitle">描述</span>
  82. <p>
  83. <textarea name="addDescribe" id="remark" rows="" placeholder="请输入描述" cols=""></textarea>
  84. </p>
  85. </li>
  86. </ul>
  87. </form>
  88. </div>
  89. <script src="../js/jquery-2.1.0.js"></script>
  90. <script src="../js/mui.min.js"></script>
  91. <script type="text/javascript">
  92. mui.init({
  93. beforeback: function(){
  94. //获得列表界面的webview
  95. var list = plus.webview.currentWebview().opener();
  96. //目标页面
  97. // var list = plus.webview.getWebviewById('systemmanage_user_datial');
  98. //触发列表界面的自定义事件(refresh),从而进行数据刷新
  99. mui.fire(list, 'refresh');
  100. //返回true,继续页面关闭逻辑
  101. return true;
  102. }
  103. });
  104. $('#submit').on('tap', function() {
  105. var username = $('#username').val();
  106. var remark = $('#remark').val();
  107. if(!username || !remark) {
  108. mui.toast('请将信息填写完整!');
  109. return false;
  110. }
  111. mui.ajax('http://120.27.222.26/systemmanage_role/', {
  112. data: $('#addUserForm').serialize(),
  113. dataType: 'json', //服务器返回json格式数据
  114. type: 'post', //HTTP请求类型
  115. timeout: 10000, //超时时间设置为10秒;
  116. beforeSend: function() {
  117. plus.nativeUI.showWaiting('请求中...');
  118. },
  119. complete: function() {
  120. plus.nativeUI.closeWaiting();
  121. },
  122. success: function(data) {
  123. if(data == 0) {
  124. mui.alert("用户组添加成功,点击确定关闭", "用户组添加", "确定", function() {
  125. mui.back();
  126. });
  127. } else if(data == 1) {
  128. mui.toast("该角色已存在!!!");
  129. }
  130. },
  131. error: function(xhr, type, errorThrown) {
  132. mui.toast('请检查当前网络');
  133. }
  134. });
  135. })
  136. </script>
  137. </body>
  138. </html>