@extends('vip.layouts') @section('seo_title') 投注金额设置 @endsection @section('content') @push('dataTableJS') var active = { reload: function(){ //执行重载 table.reload('{{ $dataId }}', { page: { curr: 1 //重新从第 1 页开始 } ,where: { name:$('#name').val(), } }); } }; $('.lay-btn-diy').on('click', function(){ var type = $(this).data('type'); active[type] ? active[type].call(this) : ''; }); //重置表单 $('.reset').on('click',function(){ $('input').val(''); $('#name').val(''); var type = $(this).data('type'); active[type] ? active[type].call(this) : ''; }); //刷新表单 $('.set').on('click',function(){ var type = $(this).data('type'); active[type] ? active[type].call(this) : ''; }); var menu = []; $.ajax({ type: 'get', url: '/admin/info/getgame', data: {}, dataType: 'json', async: false, success: function (json) { menu = json; } }); layui.tree({ elem: '#tree' //传入元素选择器 , click: function (item) { //点击节点回调 //layer.msg('当前节名称:' + item.id); // 加载中... var loadIndex = layer.load(2, {shade: true}); $('.addTo').attr('game',item.game_name); //这里以搜索为例 tableIns.reload({ where: { //设定异步数据接口的额外参数,任意设 game:item.game_name } ,page: { curr: 1 //重新从第 1 页开始 } }); // 关闭加载 layer.close(loadIndex); } , nodes: menu.data }); $(document).on('click','.addTo',function(){ var gameName=$(this).attr('game'); openWin('/admin/info/add?game='+gameName) }) @endpush