e7f041e5 by yangjianbin

init

1 parent b43c4392
<?php $this->load->view('common/header'); ?>
<body>
<div class="page-container">
<div class="page-container">
<div>
<button class="btn btn-primary radius" onclick="layer_show('添加', '<?=site_url('/config/add')?>')">添加</button>
<button class="btn btn-primary radius" onclick="layer_show('添加', '<?= site_url('/config/add') ?>')">添加</button>
</div>
<div class="body mt-20">
......@@ -26,10 +26,10 @@
</tbody>
</table>
</div>
</div>
<?php $this->load->view('common/footer'); ?>
</div>
<?php $this->load->view('common/footer'); ?>
<script>
<script>
var table = $('#table').dataTable({
aaSorting: [[1, "desc"]],
serverSide: true,
......@@ -44,7 +44,7 @@
var ret = {}, json = jQuery.parseJSON(json);
ret.data = json.data || [];
var draw = getUrlParam('draw');
if(draw) {
if (draw) {
ret.draw = draw;
}
ret.recordsTotal = 0;
......@@ -68,7 +68,7 @@
<button class="btn radius size-M">请选择 <i class="Hui-iconfont">&#xe6d5;</i></button>\
<ul class="dropDown-menu menu radius box-shadow">\
<li><a href="javascript:;" onclick="layer_show(\'编辑\', \'/index.php/config/edit/' + data + '\')">编辑</a></li>\
<li><a href="javascript:;del('+data+')">删除</a></li>\
<li><a href="javascript:;del(' + data + ')">删除</a></li>\
</ul></span>';
}
},
......@@ -86,10 +86,10 @@
function del(id) {
layer.confirm('确认删除', {
btn: ['确认','取消'],
btn: ['确认', '取消'],
title: '删除产品',
icon: 3
}, function(){
}, function () {
$.ajax({
type: 'delete',
url: apiBaseUrl + 'config/product/' + id,
......@@ -104,10 +104,12 @@
} else {
layer.msg('删除成功');
}
if(!data.code) {
window.parent.reload();
setTimeout(function () {
if (!data.code) {
window.reload();
layer_close();
}
}, 500);
},
error: function () {
layer.alert("请求失败")
......@@ -116,9 +118,10 @@
});
}
function reload() {
table.fnDraw();
}
</script>
</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!