bbead40b by wang

init

1 parent 382b91d7
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
2 2
3 <body> 3 <body>
4 <div class="panel panel-default"> 4 <div class="panel panel-default">
5 <form action=""> 5 <form action="system/role/update" id="edit">
6 <input type="hidden" value="<?=$id?>" name="id"> 6 <input type="hidden" value="<?=$id?>" name="id">
7 </form>
8 <div class="panel-body"> 7 <div class="panel-body">
9 <div class="row cl"> 8 <div class="row cl">
10 <!--<div class="form-group col-sm-3 col-md-2"> 9 <!--<div class="form-group col-sm-3 col-md-2">
...@@ -37,7 +36,7 @@ ...@@ -37,7 +36,7 @@
37 <button class="btn btn-warning btn-block" onclick="layer_close()">取消</button> 36 <button class="btn btn-warning btn-block" onclick="layer_close()">取消</button>
38 </div> 37 </div>
39 </div> 38 </div>
40 39 </form>
41 <?php $this->load->view('common/footer'); ?> 40 <?php $this->load->view('common/footer'); ?>
42 41
43 <script> 42 <script>
...@@ -83,9 +82,43 @@ ...@@ -83,9 +82,43 @@
83 }); 82 });
84 83
85 console.log(menuIds); 84 console.log(menuIds);
86 85 var targetUrl = $("#edit").attr("action");
86 var data = $("#edit").serializeJson();
87 var newData = {
88 nameZh:data['nameZh'],
89 id:data['id'],
90 menuIds:menuIds
91 };
92 $.ajax({
93 type: 'post',
94 url: apiBaseUrl + targetUrl,
95 cache: false,
96 data: JSON.stringify(newData),
97 dataType: 'json',
98 contentType: "application/json; charset=UTF-8",
99 success: function (data) {
100 // console.log(data);
101 if (data.msg) {
102 layer.alert(data.msg);
103 } else if (data.code != 0) {
104 layer.alert('操作失败');
105 } else {
106 layer.msg('操作成功');
107 }
108 if (data.code) {
109 setTimeout(function () {
110 window.parent.reload();
111 layer_close();
112 }, 500);
113 }
114 },
115 error: function () {
116 layer.alert("操作失败")
117 }
118 })
87 // layer_close(); 119 // layer_close();
88 } 120 }
121
89 </script> 122 </script>
90 </body> 123 </body>
91 <html> 124 <html>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!