$(function () { }); /* 参数解释: title 标题 url 请求的url id 需要操作的数据id w 弹出层宽度(缺省调默认值) h 弹出层高度(缺省调默认值) */ /*管理员-增加*/ function slides_add(title, url, w, h) { layer_show(title, pagePath + url, w, h); } /*管理员-编辑*/ function slides_edit(title, url, w, h) { layer_show(title, pagePath + url, w, h); } /*管理员-详情*/ function slides_info(title, url, w, h) { layer_show(title, pagePath + url, w, h); } /*管理员-批量删除*/ function slides_del(a) { var id = $(a).parents('tr').children('td').eq(0).children('input').attr('id') layer.confirm('确认要删除吗?', function (index) { $.ajax({ url: pagePath + "/super/stree/delete", type: "put", data: {'ids': id}, dataType: "json", success: function (result) { if (result.success) { smileMessage(result.message) setTime(); } else { errorMessage(result.message); } }, error: function () { errorMessage('系统错误!'); } }); }); } /*管理员-删除*/ function slides_delete(obj, url) { layer.confirm('确认要删除吗?', function (index) { //此处请求后台程序,下方是成功后的前台处理…… $.ajax({ type: "DELETE", dataType: "json", url: pagePath + url, data: { "timestamp": new Date().getTime() }, success: function (result) { if (result.success) { smileMessage(result.message) setTime(); } else { errorMessage(result.message); } }, error: function () { errorMessage('系统错误!'); } }); }); } /** * 禁用|启用 * @param ids */ function slides_status(urls, isLock, obj) { var msg = "确认要启用吗"; if (!isLock) { msg = "确认要禁用吗?"; } layer.confirm(msg, function (index) { //此处请求后台程序,下方是成功后的前台处理…… $.ajax({ type: "Post", dataType: "json", url: pagePath + urls, data: { "isLock": isLock }, success: function (result) { if (result.success) { smileMessage(result.message); setTime(); } else { errorMessage(result.message); } }, error: function () { errorMessage('系统错误!'); } }); }); }