bootstrap Table 传参写法


//$('#mytab').bootstrapTable('destroy');//这是销毁表格的代码
//根据窗口调整表格高度
/* $(window).resize(function() {
 $('#mytab').bootstrapTable('resetView', {
 height: tableHeight()})});*/
try {
    $.ajaxSetup({headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}});
} catch (e) {
    location.href = '/';
}
var $mytab = $('#mytab');
var tag = false;
var atcArray = new Array();
var columnTitle = [{
    title: "全选",
    field: "select",
    checkbox: true,
    width: 10,//宽度
    //align: "center",//水平
    //valign: "middle"//垂直
}];
for (var i in table_config.table_title) {
    if (table_config.table_title[i].type == 'text') {
        columnTitle.push({
            field: table_config.table_title[i].key,//键名
            title: table_config.table_title[i].value,//标题
            width: 200,//宽度
            height: 200,//宽度
            sortable: true,//是否可排序
            order: "desc",//默认排序方式
            filterControl: "input",
        })
    }
    if (table_config.table_title[i].type == 'image') {
        columnTitle.push({
            field: table_config.table_title[i].key,
            title: table_config.table_title[i].value,
            align: 'center',
            formatter: function (value, row, index) {
                if (value != null)
                    return '+ value + ' \'); "  src="/common/displayImg/' + value + '" width=60 class="img-rounded" >';
            }
        })
    }

}
var updateData = [];
columnTitle.push({
    formatter: function (value, row, index) {
        updateData[row.id] = (row);
        var content = '';
        if (table_config.method.edit != 'false') {
            content += '+ row.id + ')">' +
                '' +
                '';
        }
        if (table_config.method.delete != 'false') {
            content += '+ row.id + ')">' +
                '' +
                '';
        }
        return [
            content
        ].join('');
    },
    title: '操作'
});
$('#mytab').bootstrapTable({
    url: table_config.method.list,//数据源
    dataField: "data",//服务端返回数据键值 就是说记录放的键值是rows,分页时使用总记录数的键值为total
    //height: tableHeight(),//高度调整
    search: true,//是否搜索
    pagination: true,//是否分页
    pageSize: 10,//单页记录数
    pageList: [10, 30, 50, 100],//分页步进值
    sidePagination: "server",//服务端分页
    contentType: "application/x-www-form-urlencoded",//请求数据内容格式 默认是 application/json 自己根据格式自行服务端处理
    //contentType: "application/json",//请求数据内容格式 默认是 application/json 自己根据格式自行服务端处理
    dataType: "json",//期待返回数据类型
    method: "post",//请求方式
    searchAlign: "right",//查询框对齐方式
    queryParamsType: "limit",//查询参数组织方式
    /* queryParams: function getParams(params) {
     //params obj
     params.other = "otherInfo";
     //alert('params.limit='+params.limit+' params.offset='+params.offset);
     return params;
     },*/
    onLoadSuccess: function queryParams(params) {
        var fun = "successHD";  // 函数的名称
        var isFunction = false;
        try {
            //这里的代码需要用try一下,因为当showFace为定义时会抛出异常
            isFunction = typeof (eval('successHD')) == "function";
        } catch (e) {
        }
        if (isFunction) {
            successHD(params.data);
        } else {
            console.log('函数不存在!');
        }

    },
    queryParams: function queryParams(params) {
        var params = {
            limit: params.limit, // 页面大小
            offset: params.offset, // 页码
            sort: params.sort, // 页序
            order: params.order, // 排序
            /*search: params.search,*//*     search: params.search,*/
            //pageindex : this.pageNumber,
            //pageSize : this.pageSize
            search: $('.search input').val() //获取搜索框内容
        };
        return params;
    },

    searchOnEnterKey: false,//回车搜索
    showRefresh: true,//刷新按钮
    showColumns: false,//列选择按钮
    buttonsAlign: "right",//按钮对齐方式
    exportDataType: "basic", //basic', 'all', 'selected'.
    toolbar: "#toolbar",//指定工具栏
    toolbarAlign: "left",//工具栏对齐方式
    sortable: true,                     //是否启用排序
    sortOrder: "desc",                   //排序方式
    showExport: true,     //是否显示导出
    exportTypes: ['excel'],
    //exportTypes:[ 'csv', 'txt', 'sql', 'doc', 'excel', 'xlsx', 'pdf'],  //导出文件类型
    //exportDataType: 'basic',              //basic', 'all', 'selected'.
    locale: "zh-CN",//中文支持
    detailView: false, //是否显示详情折叠,父子表
    striped: true,//设置为 true 会有隔行变色效果
    showToggle: true,//是否显示 切换试图(table/card)按钮
    showPaginationSwitch: true,//是否显示 数据条数选择框
    clickToSelect: false,//单击选中行
    uniqueId: "id", //每一行的唯一标识,一般为主键列
    cache: false, // 不缓存
    /*   fixedColumns: true,//冻结列
        fixedNumber: [2,3],//冻结哪几列*/
    filterControl: true,//列过滤
    filtershowclear: "true",//显示清空列过滤按钮
    rowStyle: function (row, index) {
        //这里有5个取值代表5中颜色
        var classes = ['active', 'success', 'info', 'warning', 'danger'];
        var strclass = "";
        if (row.status_color == 10||row.status_color==0) {
            strclass = classes[0];
        } else if (row.status_color == 20||row.status_color==1) {
            strclass = classes[1];
        }else if (row.status_color == 30) {
            strclass = classes[2];
        }else if (row.status_color == 40) {
            strclass = classes[3];
        }else if (row.status_color == 50) {
            strclass = classes[4];
        } else {
            return {};
        }
        return {classes: strclass}
    },
    //minimumCountColumns:1,//当列数小于此值时,将隐藏内容列下拉框。
    columns: columnTitle,
    /*     [
       /!* {
             title: "全选",
             field: "select",
             checkbox: true,
             width: 10,//宽度
             //align: "center",//水平
             //valign: "middle"//垂直
         }*,/
            /!*   {
                  field: "MB001",//键名
                  title: "品号",//标题
                  width: 200,//宽度
                  sortable: true,//是否可排序
                  order: "asc",//默认排序方式
                  filterControl: "input",
              },
              {
                  field: "MB002",
                  title: "品名",
                  sortable: true,//是否可排序
                  titleTooltip: "this is name",
                  filterControl: "select",
                  //width: 5000,//宽度

                  //editable:true,
                  editable: {
                      mode: "inline",//编辑框的模式:支持popup和inline两种模式,默认是popup
                      type: 'text',
                      title: '品名',
                      validate: function (v) {
                          if (!v) return '品名不能为空';
                      }
                  }
              },*!/

       /!*  {
             field: 'thumb_img',
             title: '主图',
             align: 'center',
             formatter: function (value, row, index) {
                 return '';
             }
         },*!/
 //操作列启用

 //列设置到此为止
 ],*/
//父子表回调函数
    onExpandRow: function (index, row, $detail) {
        initSubTable(index, row, $detail);
    }
    ,
//行单击
    onClickRow: function (row, $element) {
        //$element是当前tr的jquery对象
        /* $element.css("background-color", "yellow");*/
    }
    ,//单击row事件
//行内编辑保存事件
    onEditableSave: function (field, row, oldValue, $el) {
        //$("#mytab").bootstrapTable("resetView");//这一句是网上看到的,防止保存后格式可能会错乱的问题。
        $.ajax({
            type: "post",
            url: table_config.method.edit,
            data: row,
            dataType: 'JSON',
            success: function (data, status) {
                if (status == "success") {
                    alert('提交数据成功');
                }
            },
            error: function () {
                alert('编辑失败');
            },
            complete: function () {

            }
        });
    }
    ,
})
;
//表加载至此

//父子表回调执行函数,注意一下下面每个参数设置不要弄错:
function initSubTable(index, row, $detail) {
    var parentid = row.MB001;
    var cur_table = $detail.html('
'
).find('table'); $(cur_table).bootstrapTable({ url: './data/coptdserver.php', //search: true,//是否搜索 //pagination: true,//是否分页 //pageSize: 1,//单页记录数 //pageList: [5,10, 20, 30, 50],//分页步进值 method: 'post', contentType: "application/x-www-form-urlencoded", dataType: "json", //数据类型 queryParams: {strParentID: parentid}, ajaxOptions: {strParentID: parentid}, clickToSelect: true, //detailView: true,//父子表 uniqueId: "MC001", pageSize: 10, pageList: [10, 25], columns: [{ checkbox: true }, { field: 'MC001', title: 'SubId' }, { field: 'MC002', title: 'Grade', editable: true, }, { field: 'MC003', title: 'Name' }], //无线循环取子表,直到子表里面没有记录 /* onExpandRow:function (index,row,$Subdetail) { initSubTable(index,row,$Subdetail); } */ }); } //注意,这里做了一个递归,即子表里面还可以展开孙表,我们也可以不需要,去掉就可以了。 // 设置bootbox中文 bootbox.setLocale('zh_CN'); var titleTip = '提示'; // 验证输入的品号是否有字母 function verifyAge(MB001) { var reg = /^[a-zA-Z]*$/; if (!reg.test(MB001)) { return false; } return true; } // 验证字段是否为空 function verifyNameAndAddress(name, address) { if (name != '' && address != '') { return true; } return false; } function nullAlert() { bootbox.alert({ title: titleTip, message: '所有项均为必填!' }); } // 点击查询按钮,符合查询条件方可跳转查询,此处只是做了这个效果,实际数据并未加载。 $('#queryBtn').click(function () { var MB001 = $('#MB001').val(); if (verifyAge(MB001)) { // 刷新并跳转到第一页 $testTable.bootstrapTable('selectPage', 1); } else { bootbox.alert({ title: titleTip, message: '品号输入有误!' }); } }); $('#withdraw').click(function () { // 刷新并跳转到第一页 $('.search input').val('今日待打款'); $mytab.bootstrapTable('selectPage', 1); }); $('#withdraw_finish').change(function () { // 刷新并跳转到第一页 $('.search input').val($('#withdraw_finish').val()); $mytab.bootstrapTable('selectPage', 1); }); $('#order_finish').change(function () { // 刷新并跳转到第一页 $('.search input').val($('#order_finish').val()); $mytab.bootstrapTable('selectPage', 1); }); $('#allWithdraw').click(function () { // 刷新并跳转到第一页 $('.search input').val(''); $mytab.bootstrapTable('selectPage', 1); }); // 点击重置按钮,清空查询条件并跳转回第一页 $('#resetBtn').click(function () { $('.search input').val(''); $mytab.bootstrapTable('selectPage', 1); }); // 用于修改服务器资源 function exchangeData(path, data) { if (atcArray.length != 0) { console.log(atcArray.join('|')); data.attachment = atcArray.join('|'); } $.ajax({ url: path, type: 'post', data: data, success: function (res) { bootbox.alert({ title: titleTip, message: res.message }); // 在每次提交操作后返回首页 $mytab.bootstrapTable('selectPage', 1); }, error: function (res) { if (res.responseJSON.message == 'The given data was invalid.') { res.responseJSON.message = '参数填写不完整
'
for (var i in res.responseJSON.errors) { res.responseJSON.message += res.responseJSON.errors[i][0] + '
'
} } bootbox.alert({ title: titleTip, message: res.responseJSON.message }); // 在每次提交操作后返回首页 $mytab.bootstrapTable('selectPage', 1); } }); } // 新增 $('#addBtn').click(function () { $('#addNameText').val(''); $('#addAgeText').val(''); $('#addAddressText').val(''); $('#addModal').modal('show'); }); $('#saveAdd').click(function () { $('#addModal').modal('hide'); bootbox.confirm({ title: titleTip, message: '确认增加?', callback: function (flag) { if (flag) { var data = $('#add_form').serializeArray(); exchangeData(table_config.method.add, data); } } }); }); // 修改 $('#btn_edit').click(function () { if (($mytab.bootstrapTable('getSelections')).length == 1) { for (var i in ($mytab.bootstrapTable('getSelections'))[0]) { $('#edit_' + i).val(($mytab.bootstrapTable('getSelections'))[0][i]); } var fun = "edit"; // 函数的名称 $('#modifyModal').modal('show'); var isFunction = false; try { //这里的代码需要用try一下,因为当showFace为定义时会抛出异常 isFunction = typeof (eval('edit')) == "function"; } catch (e) { } if (isFunction) { edit(updateData[id]); } else { console.log('函数不存在!'); } } else { alert("请选中一行并且只能选中一行!") } ; }); //用于行编辑功能弹出模态窗,只做出效果。 var mid; function modifyPer(id) { for (var i in updateData[id]) { $('#edit_' + i).val(updateData[id][i]); } var fun = "edit"; // 函数的名称 $('#modifyModal').modal('show'); var isFunction = false; try { //这里的代码需要用try一下,因为当showFace为定义时会抛出异常 isFunction = typeof (eval('edit')) == "function"; } catch (e) { } if (isFunction) { edit(updateData[id]); } else { console.log('函数不存在!'); } } $('#saveModify').click(function () { $('#modifyModal').modal('hide'); bootbox.confirm({ title: titleTip, message: '确认修改?', callback: function (flag) { if (flag) { var data = $('#edit_form').serializeArray(); exchangeData(table_config.method.edit, data); } } }); }); //用于行编辑功能弹出删除模态窗,只做出效果,若要使用可以自行加入删除语句。 function delPer(id) { console.log(id); bootbox.confirm({ title: titleTip, message: '确认删除?', callback: function (flag) { if (flag) { exchangeData(table_config.method.delete, {'id': id}); } } }); }; //高度 function tableHeight() { return $(window).height() - 80; }; /** * 列的格式化函数 在数据从服务端返回装载前进行处理 * @param {[type]} value [description] * @param {[type]} row [description] * @param {[type]} index [description] * @return {[type]} [description] */ //列格式 function infoFormatter(value, row, index) { return "id:" + row.MB001 + " name:" + row.MB002 + " age:" + row.MB003; } //operateOpinionFormatter函数是判断超过的字数的,当字数超过5就会用...代替,formatTableUnit这个函数是设置悬浮的。 //方法也是从网上找的,记得要与上面对应的列参数对应使用. //当字数超过5,悬浮 function operateOpinionFormatter(value, row, index) { if (value.length > 5) { return "" + value.substring(0, 5) + "..." + ""; } else { return "" + value.substring(0, value.length) + ""; } } //过长字段悬浮 function formatTableUnit(value, row, index) { // var front_color = 'red'; // var bg_color = 'white'; return { css: { // "color":'red', // "background-color": bg_color, "overflow": 'hidden', "text-overflow": 'ellipsis', "white-space": 'nowrap' } }; } // 删除 //1 点击工具栏删除按钮 erpdel = function () { var ids = getIdSelections(); var idsy = ids.toString(); /* var idsw = "('" + idsy.replace(/,/, "','") + "')";*/ //var idsz="('"+idsw+"')"; //alert(idsz); var jsonData = {"id": idsy}; if (ids.length == 0) { //alert("请选择数据"); bootbox.alert({ buttons: { ok: { label: '我知道了!', className: 'btn-myStyle' } }, message: '请选择数据行', callback: function () { //alert('关闭了alert'); }, title: "提示", }); return; } if (confirm("确定要删除 id= " + idsy + "吗?此操作不可恢复!")) { $mytab.bootstrapTable('remove', { field: 'id', values: ids }); $.ajax({ type: "post", url: table_config.method.delete, data: jsonData,//要传递的数据 //data:{ //json:JSON.stringify(ids) //}, dataType: 'json', success: function (msg) { // var msg = eval(msg); if (msg.status_code == '200') { //$(".alert").alert("删除 id= "+msg.id+"成功"); alert("删除成功"); // 刷新table // oTable.fnReloadAjax(); //1.9之前 oTable.ajax.reload(); //1.10之后 // oTable.draw(); } else { alert("删除失败"); } }, error: function (error) { console.log(error); } }); } }; function updateStatus(type) { var ids = getIdSelections(); var idsy = ids.toString(); /* var idsw = "('" + idsy.replace(/,/, "','") + "')";*/ //var idsz="('"+idsw+"')"; //alert(idsz); var jsonData = {"id": idsy, 'type': type}; if (ids.length == 0) { //alert("请选择数据"); bootbox.alert({ buttons: { ok: { label: '我知道了!', className: 'btn-myStyle' } }, message: '请选择数据行', callback: function () { //alert('关闭了alert'); }, title: "提示", }); return; } if (confirm("确定要修改 id= " + idsy + "吗?此操作不可恢复!")) { $.ajax({ type: "post", url: table_config.method.edit, data: jsonData,//要传递的数据 //data:{ //json:JSON.stringify(ids) //}, dataType: 'json', success: function (msg) { // var msg = eval(msg); if (msg.status_code == '200') { //$(".alert").alert("删除 id= "+msg.id+"成功"); alert("修改成功"); // 刷新table // oTable.fnReloadAjax(); //1.9之前 $mytab.bootstrapTable('selectPage', 1); // oTable.draw(); } else { alert("修改失败"); } }, error: function (error) { console.log(error); } }); } } //$.trim(row.MB001) //"'"+row.MB001+"'"; //获取选取值 function getIdSelections() { return $.map($mytab.bootstrapTable('getSelections'), function (row) { return row.id; }); }; //这段代码为调整表格大小,单独放在这里: var $div = $('.div-table'), $table = $('#mytab'), $button = $('#button'), $button2 = $('#button2'); $(function () { $button.click(function () { $div.width($div.width() + 50); $table.bootstrapTable('resetView'); }); $button2.click(function () { $div.width($div.width() - 50); $table.bootstrapTable('resetView'); }); });
<!-- CSS-->
<link rel="stylesheet" href="/AdminLTE/bower_components/bootstrap-table-demo/css/childstyle.css" type="text/css"
      media="screen"/>
<link rel="stylesheet" href="/AdminLTE/bower_components/bootstrap-table-demo/css/childmenu.css" type="text/css"
      media="screen">
<link rel="stylesheet" href="/AdminLTE/bower_components/bootstrap-table-demo/css/bootstrap.min.css"/>
<link rel="stylesheet" href="/AdminLTE/bower_components/bootstrap-table-demo/css/bootstrap-table.css"/>
<link rel="stylesheet" href="/AdminLTE/bower_components/bootstrap-table-demo/css/bootstrap-table-fixed-columns.css"/>


<!--jquery和box和bootstrap-->
<script type="text/javascript" src="https://cdn.bootcss.com/bootbox.js/4.4.0/bootbox.min.js"></script>
<script type="text/javascript" src="/AdminLTE/bower_components/bootstrap-table-demo/js/bootstrap-table.js"></script>
<script type="text/javascript"
        src="/AdminLTE/bower_components/bootstrap-table-demo/js/bootstrap-table-zh-CN.js"></script>


<!-- 导出,试了好久才弄好,我测试了edge,IE,火狐、谷歌和猎豹都是可以的,中文乱码和PDF乱码问题也能过了测试,记得在下面启用导出功能参数-->
<script src="/AdminLTE/bower_components/bootstrap-table-demo/js/bootstrap-table-export.js"></script>
{{--<script type="text/javascript" src="/AdminLTE/bower_components/bootstrap-table-demo/js/pdfmake.min.js"></script>--}}
{{--    <script type="text/javascript" src="/AdminLTE/bower_components/bootstrap-table-demo/js/vfs_fonts.js"></script>--}}
<script type="text/javascript" src="/AdminLTE/bower_components/bootstrap-table-demo/js/FileSaver.min.js"></script>
<script type="text/javascript" src="/AdminLTE/bower_components/bootstrap-table-demo/js/jspdf.min.js"></script>
<script type="text/javascript"
        src="/AdminLTE/bower_components/bootstrap-table-demo/js/jspdf.plugin.autotable.js"></script>
<script type="text/javascript" src="/AdminLTE/bower_components/bootstrap-table-demo/js/tableExport.js"></script>
<script type="text/javascript" src="/AdminLTE/bower_components/bootstrap-table-demo/js/jquery.base64.js"></script>

<!-- 冻结列,记得启用下面的两个冻结列的参数,貌似启用父子表后,对冻结列会有一定的影响,这个JS是网上那位大神修改过的,解决了冻结列后空白的BUG-->
<script src="/AdminLTE/bower_components/bootstrap-table-demo/js/bootstrap-table-fixed-columns.js"></script>

<!-- 编辑,行内编辑我用不着,但这些功能是蛮实用的,记住要在列参数中启用编辑功能-->
<!-- <link href="/AdminLTE/bower_components/bootstrap-table-demo/css/bootstrap-editable.css" rel="stylesheet">
 <script src="/AdminLTE/bower_components/bootstrap-table-demo/js/bootstrap-editable.js"></script>
 <script src="/AdminLTE/bower_components/bootstrap-table-demo/js/bootstrap-table-editable.js"></script>
 <link href="/AdminLTE/bower_components/bootstrap-table-demo/css/select2.css" rel="stylesheet">
 <link href="/AdminLTE/bower_components/bootstrap-table-demo/css/select2-bootstrap.css" rel="stylesheet">
 <script src="/AdminLTE/bower_components/bootstrap-table-demo/js/select2.js"></script>
 <script src="/AdminLTE/bower_components/bootstrap-table-demo/js/select2.min.js"></script> -->

<!-- 行重新排序,取消这个备注就可启用-->
<!-- <script src="/AdminLTE/bower_components/bootstrap-table-demo/js/bootstrap-table-reorder-rows.js"></script>
 <script src="/AdminLTE/bower_components/bootstrap-table-demo/js/jquery.tablednd.js"></script>-->

<!-- 列重新排序:在有父子表的时候不好用,但我还是搬过来,没有启用父子表时正常的,取消这个备注就可以启用-->
<!--<script src="/AdminLTE/bower_components/bootstrap-table-demo/js/bootstrap-table-reorder-columns.js"></script>-->
<!--<link rel="stylesheet" href="/AdminLTE/bower_components/bootstrap-table-demo/css/examples.css">-->
<!--<link rel="stylesheet" href="/AdminLTE/bower_components/bootstrap-table-demo/css/dragtable.css">
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="/AdminLTE/bower_components/bootstrap-table-demo/js/dragtable.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="/AdminLTE/bower_components/bootstrap-table-demo/js/ga.js"></script>-->

<!-- 列过滤,对我作用不大,所以此功能未启用,我用SQL模糊查询实现,要用的话,须启用下面表和列的参数,此JS要注意版本,有的版本无法显示数据或input框-->
<!--<script src="/AdminLTE/bower_components/bootstrap-table-demo/js/bootstrap-table-filter-control.js"></script>-->

<!-- 列采用select2过滤,按官方的例子做测试即可,这里只引入js-->
<!--<script src="/AdminLTE/bower_components/bootstrap-table-demo/js/bootstrap-table-select2-filter.js"></script>-->


<div class="panel panel-default">
    <div class="panel-body">
        <div class="container-fluid">
            <div id="moon"></div>

            <div>
                <div class="col-*-12">
                    <!--工具栏-->

                    <div id="toolbar" class="btn-group pull-right" style="margin-right: 20px;">
                        <div class="form-inline">


                            @if(isset($tool))
                                @if(isset($tool['gold1']))
                                    <div class="form-group">
                                        <label for="select_status">人员状态 :</label>
                                        <select class=" form-control input-sm" name="select_status" id="select_status">
                                            <option value="0">正常</option>
                                            <option value="1">封号</option>
                                            <option value="2">永久</option>
                                        </select>
                                    </div>

                                    <div class="form-group">
                                        <label for="select_empno">账号 :</label>
                                        <input id="select_empno" class="form-control input-sm">
                                    </div>
                                    <div class="form-group">
                                        <label for="select_empno">手机 :</label>
                                        <input id="select_empno" class="form-control input-sm">
                                    </div>
                                    <div class="form-group">
                                        <label for="select_empno">推荐人 :</label>
                                        <input id="select_empno" class="form-control input-sm">
                                    </div>
                                    <div class="form-group">
                                        <select class=" form-control input-sm" name="select_status" id="select_status">
                                            <option value=""></option>
                                            <option value="0">注册时间</option>
                                            <option value="1">最后时间</option>
                                            <option value="2">确认时间</option>
                                        </select>
                                        <input id="select_empno" class="form-control input-sm">
                                        <input id="select_empno" class="form-control input-sm">
                                    </div>
                                    {{--
                                                                    <div class="form-group"><label for="MB001">时间 :</label>
                                                                        <input id="MB001" class="form-control input-sm"></div>
                                                                    <div class="form-group"><label for="MB002">到:</label>
                                                                        <input id="MB002" class="form-control input-sm"></div>--}}
                                    <button id="queryBtn" type="button" class="btn btn-default">
                                        <span class="glyphicon glyphicon-search" aria-hidden="true"></span>查询
                                    </button>
                                @endif
                                @if(isset($tool['sure']))
                                    <button id="btn_delete" type="button" class="btn btn-default"
                                            onClick="updateStatus(1);">
                                        <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>确认进场
                                    </button>
                                @endif

                                @if(isset($tool['start']))
                                    <button id="btn_delete" type="button" class="btn btn-default"
                                            onClick="updateStatus(2);">
                                        <span class="glyphicon glyphicon-play-circle" aria-hidden="true"></span>开始返还
                                    </button>
                                @endif

                                @if(isset($tool['finish']))
                                    <button id="btn_delete" type="button" class="btn btn-default"
                                            onClick="updateStatus(3);">
                                        <span class="glyphicon glyphicon-record" aria-hidden="true"></span>标记完成
                                    </button>
                                @endif
                                @if(isset($tool['edit']))
                                    <button id="btn_edit" type="button" class="btn btn-default">
                                        <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改
                                    </button>
                                @endif
                                @if(isset($tool['delete']))
                                    <button id="btn_delete" type="button" class="btn btn-default" onClick="erpdel();">
                                        <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
                                    </button>
                                @endif


                            <!--   <button id="addBtn" type="button" class="btn btn-default" data-toggle="modal" data-target="#addModal">
                                          <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增</button>-->
                                @if(isset($tool['add']))
                                    <button id="addBtn" type="button" class="btn btn-default">
                                        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
                                    </button>
                                @endif

                                @if(isset($tool['gold']))
                                    <button id="gold" type="button" class="btn btn-default">
                                        <span class="glyphicon glyphicon-usd" aria-hidden="true"></span>金币赠送
                                    </button>
                                @endif
                                @if(isset($tool['allWithdraw']))
                                    <button id="allWithdraw" type="button" class="btn btn-default">
                                        <span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>查询所有
                                    </button>
                                @endif
                                @if(isset($tool['withdraw']))
                                    <button id="withdraw" type="button" class="btn btn-default">
                                        <span class="glyphicon glyphicon-zoom-out" aria-hidden="true"></span>今日待打款
                                    </button>
                                    <select id="withdraw_finish" class="form-control " name="status">
                                        <option value="">选择状态</option>
                                        <option value="0">进行中</option>
                                        <option value="1">已完成</option>
                                    </select>
                                        <button id="all" type="button" class="btn btn-default">
                                            总数
                                        </button>
                                        <button id="current" type="button" class="btn btn-default">
                                            本页
                                        </button>
                                @endif
                                @if(isset($tool['orderFinish']))
                                    <select id="order_finish" class="form-control " name="status">
                                        <option value="">选择状态</option>
                                        <option value="0">待付款</option>
                                        <option value="10">已付款</option>
                                        <option value="20">待确认</option>
                                        <option value="30">分红中</option>
                                        <option value="40">已完成</option>
                                    </select>
                                    <button id="all" type="button" class="btn btn-default">
                                        总数
                                    </button>
                                    <button id="current" type="button" class="btn btn-default">
                                        本页
                                    </button>
                                @endif


                                @if(isset($tool['login']))
                                    <button id="login" type="button" class="btn btn-default">
                                        <span class="glyphicon glyphicon-new-window" aria-hidden="true"></span>登录
                                    </button>
                                @endif
                            @endif
                            {{--  <button id="button" type="button" class="btn btn-default">
                                  <span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Large</button>
                              <button id="button2" type="button" class="btn btn-default">
                                  <span class="glyphicon glyphicon-zoom-out" aria-hidden="true"></span>Small</button>--}}
                        </div>
                    </div>
                    <!--定义表格样式style-->
                    <div class="div-table">
                        <table id="mytab" style="word-break: keep-all;white-space:nowrap;"
                               data-mobile-responsive="true"
                               data-reorderable-columns="true" data-use-row-attr-func="true"
                               data-reorderable-rows="true"></table>
                    </div>
                    @if(isset($modal))
                        @include('panels.tableModal.'.$modal)
                    @endif
                </div>
            </div>
        </div><!-- container-fluid -->
    </div>
</div>
<script>
    var table_config = {!! $table !!};
</script>
<script src="/js/tablePanel.js"></script>
    'admin_page_parent' => '系统模块',
    'admin_page_index' => '管理员',
    'admin_page_title' => [
        ['type' => 'text', 'key' => 'id', 'value' => 'ID'],
        ['type' => 'text', 'key' => 'empno', 'value' => '用户名'],
        ['type' => 'text', 'key' => 'empname', 'value' => '真实姓名'],
        ['type' => 'text', 'key' => 'department', 'value' => '所在部门'],
        ['type' => 'text', 'key' => 'mobile', 'value' => '手机号码'],
        ['type' => 'text', 'key' => 'is_super', 'value' => '用户类别'],
        ['type' => 'text', 'key' => 'status', 'value' => '用户状态'],
    ],

你可能感兴趣的:(前端)