| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <link href="../css/mui.min.css" rel="stylesheet" />
- <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
- <link rel="stylesheet" type="text/css" href="../css/common.css" />
- <style type="text/css">
- .mui-content>.mui-table-view:first-child {
- margin-top: 0;
- }
- /*详情*/
-
- .equipTitle {
- color: #21b2e7;
- font-size: 14px;
- }
-
- .mui-table-view-cell p {
- color: #333;
- font-size: 16px;
- margin-top: 4px;
- }
- /*input*/
-
- .mui-table-view-cell input {
- line-height: 30px;
- width: 100%;
- height: inherit;
- margin-bottom: 0;
- padding: 0;
- -webkit-user-select: text;
- border: none;
- border-radius: none;
- outline: 0;
- background-color: #fff;
- -webkit-appearance: none;
- }
-
- input::-webkit-input-placeholder {
- color: #BEBEBE;
- }
-
- input::-moz-placeholder {
- /* Mozilla Firefox 19+ */
- color: #BEBEBE;
- }
-
- input:-moz-placeholder {
- /* Mozilla Firefox 4 to 18 */
- color: #BEBEBE;
- }
-
- input:-ms-input-placeholder {
- /* Internet Explorer 10-11 */
- color: #BEBEBE;
- }
-
- .addAddress {
- position: absolute;
- right: 12px;
- top: 29px;
- }
- .mui-table-view-cell textarea {
- border: none;
- padding: 0;
- }
- .nullData {
- top: 45px;
- }
- </style>
- </head>
- <body>
- <header class="mui-bar mui-bar-nav">
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
- <h1 class="mui-title">添加用户组</h1>
- <a id="submit" class="mui-icon fa fa-cloud-upload mui-pull-right"></a>
- </header>
- <div class="mui-content">
- <form action="post" id="addUserForm">
- <ul class="mui-table-view" id="user">
- <li class="mui-table-view-cell">
- <span class="equipTitle">角色名称</span>
- <p><input type="text" name="addName" placeholder="请输入角色名称" id="username" value="" /></p>
- </li>
- <li class="mui-table-view-cell">
- <span class="equipTitle">描述</span>
- <p>
- <textarea name="addDescribe" id="remark" rows="" placeholder="请输入描述" cols=""></textarea>
- </p>
- </li>
- </ul>
- </form>
- </div>
- <script src="../js/jquery-2.1.0.js"></script>
- <script src="../js/mui.min.js"></script>
- <script type="text/javascript">
- mui.init({
- beforeback: function(){
- //获得列表界面的webview
- var list = plus.webview.currentWebview().opener();
- //目标页面
- // var list = plus.webview.getWebviewById('systemmanage_user_datial');
- //触发列表界面的自定义事件(refresh),从而进行数据刷新
- mui.fire(list, 'refresh');
- //返回true,继续页面关闭逻辑
- return true;
- }
-
- });
-
- $('#submit').on('tap', function() {
- var username = $('#username').val();
- var remark = $('#remark').val();
-
- if(!username || !remark) {
- mui.toast('请将信息填写完整!');
- return false;
- }
-
- mui.ajax('http://192.168.1.11:8000/systemmanage_role/', {
- data: $('#addUserForm').serialize(),
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- beforeSend: function() {
- plus.nativeUI.showWaiting('请求中...');
- },
- complete: function() {
- plus.nativeUI.closeWaiting();
- },
- success: function(data) {
- if(data == 0) {
- mui.alert("用户组添加成功,点击确定关闭", "用户组添加", "确定", function() {
- mui.back();
- });
- } else if(data == 1) {
- mui.toast("该角色已存在!!!");
- }
- },
- error: function(xhr, type, errorThrown) {
- mui.toast('请检查当前网络');
- }
- });
- })
- </script>
- </body>
- </html>
|