bbead40b by wang

init

1 parent 382b91d7
......@@ -2,9 +2,8 @@
<body>
<div class="panel panel-default">
<form action="">
<form action="system/role/update" id="edit">
<input type="hidden" value="<?=$id?>" name="id">
</form>
<div class="panel-body">
<div class="row cl">
<!--<div class="form-group col-sm-3 col-md-2">
......@@ -37,7 +36,7 @@
<button class="btn btn-warning btn-block" onclick="layer_close()">取消</button>
</div>
</div>
</form>
<?php $this->load->view('common/footer'); ?>
<script>
......@@ -83,9 +82,43 @@
});
console.log(menuIds);
var targetUrl = $("#edit").attr("action");
var data = $("#edit").serializeJson();
var newData = {
nameZh:data['nameZh'],
id:data['id'],
menuIds:menuIds
};
$.ajax({
type: 'post',
url: apiBaseUrl + targetUrl,
cache: false,
data: JSON.stringify(newData),
dataType: 'json',
contentType: "application/json; charset=UTF-8",
success: function (data) {
// console.log(data);
if (data.msg) {
layer.alert(data.msg);
} else if (data.code != 0) {
layer.alert('操作失败');
} else {
layer.msg('操作成功');
}
if (data.code) {
setTimeout(function () {
window.parent.reload();
layer_close();
}, 500);
}
},
error: function () {
layer.alert("操作失败")
}
})
// layer_close();
}
</script>
</body>
<html>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!