layui.use([ 'laypage', 'layer', 'table', 'element','form','upload'], function(){ var laypage = layui.laypage //分页 ,$ = layui.jquery ,layer = layui.layer //弹层 ,table = layui.table //表格 ,form = layui.form var $ = layui.$, active = { mobile: function(){ //获取选中数据 layer.msg('数据提交中,请稍候',{icon: 16,time:false,shade:0.8}); //数据提交提示 $.post('/cache/staticcacheclear',{'type':1},function (data) { layer.msg(data.msg); }) return false; }, pc:function(){ //获取选中数据 layer.msg('数据提交中,请稍候',{icon: 16,time:false,shade:0.8}); //数据提交提示 $.post('/cache/staticcacheclear',{'type':2},function (data) { layer.msg(data.msg); }) return false; }, backend:function(){ //获取选中数据 layer.msg('数据提交中,请稍候',{icon: 16,time:false,shade:0.8}); //数据提交提示 $.post('/cache/staticcacheclear',{'type':3},function (data) { layer.msg(data.msg); }) return false; }, }; $('.demoTable .layui-btn').on('click', function(){ var type = $(this).data('type'); active[type] ? active[type].call(this) : ''; }); });