• fastadmin自定义查询搜索


    js文件

       var table = $("#table");
                table.on('post-common-search.bs.table', function (event, table) {
                    var form = $("form", table.$commonsearch);
                    $("input[name='factory.name']", form).addClass("selectpage").data("source", "factories/index").data("primaryKey", "name").data("field", "name");
    $("input[name='admin.username']", form).addClass("selectpage").data("source", "auth/admin/index").data("primaryKey", "username").data("field", "username");//路径为控制器方法

    $("input[name='engineer.name']", form).addClass("selectpage").data("source", "engineers/index").data("primaryKey", "name").data("field", "name");
    Form.events.cxselect(form); Form.events.selectpage(form); });
    // 初始化表格
    table.bootstrapTable({
    url: $.fn.bootstrapTable.defaults.extend.index_url,
    pk: 'id',
    sortName: 'id',
    searchFormVisible: true,
    columns: [
    [
    {checkbox: true},
    {field: 'id', title: __('Id'), operate: false},
    {field: 'factory.name', title: __('Factory_id'), operate: 'LIKE %...%'},
    {field: 'address', title: __('Address'), operate: 'LIKE', searchList: function (column) {
    return Template('sourcetpl', {});
    },formatter:function (value,row,index) {
    return row.province.name+row.city.name+row.area.name+row.address;

    }},
    {field: 'engineer.name', title: __('Engineer_id'), operate: 'LIKE'},
    {field: 'chengben', title: __('Chengben'), operate: 'BETWEEN', operate: false},
    {field: 'price', title: __('Price'), operate: 'BETWEEN', operate: false},
    {field: 'description', title: __('Description'), operate: 'LIKE', operate: false},
    {field: 'pay_status', title: '付款状态', searchList: {"0":'未付款',"1":'已付款'}, formatter: Table.api.formatter.status},
    {field: 'status', title: __("Status"), searchList: {"0":'进行中',"1":'已完成',"2":'已取消'}, formatter: Table.api.formatter.status,},
    {field: 'score', title: __('Score'), operate: false,visible:false,},
    {field: 'admin.username', title: '操作人',operate: 'LIKE %...%'},

    {
    field: 'create_time',
    title: __('Create_time'),
    operate: 'RANGE',
    addclass: 'datetimerange',
    autocomplete: false,
    formatter: Table.api.formatter.datetime
    },
    {
    field: 'operate',
    title: __('Operate'),
    table: table,
    events: Table.api.events.operate,
    formatter: Table.api.formatter.operate,
    }
    ]
    ]
    });
     
  • 相关阅读:
    GKCTF2020
    PTA的Python练习题(二十三)
    Web刷题之旅(三)
    Web刷题之旅(二)
    Web刷题之旅(一)-攻防世界 站
    PTA的Python练习题(补)
    Ctfshow
    Ctfshow
    15、实操篇——Vi和Vim编译器
    13、14、实操篇——远程登录到Linux服务器和远程上传下载文件
  • 原文地址:https://www.cnblogs.com/niushuangmeng/p/14142521.html
Copyright © 2020-2023  润新知