zhaojs
2023-06-26 2199208f63cc074a48c54c2713e55c61df171e95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
 
    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'user/browse/index' + location.search,
                    add_url: 'user/browse/add',
                    edit_url: 'user/browse/edit',
                    del_url: 'user/browse/del',
                    multi_url: 'user/browse/multi',
                    import_url: 'user/browse/import',
                    table: 'user_browse',
                }
            });
 
            var table = $("#table");
 
            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                fixedColumns: true,
                fixedRightNumber: 1,
                columns: [
                    [
                        {checkbox: true},
                        {field: 'id', title: __('Id')},
                        {field: 'user_id', title: __('User_id')},
                        {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
                        {field: 'goodsId', title: __('Goodsid'), operate: 'LIKE'},
                        {field: 'goods_sign', title: __('Goods_sign'), operate: 'LIKE'},
                        {field: 'sourceType', title: __('Sourcetype'), searchList: {"tb":__('Sourcetype tb'),"jd":__('Sourcetype jd'),"pdd":__('Sourcetype pdd'),"wph":__('Sourcetype wph'),"tm":__('Sourcetype tm'),'tmshop':'天猫超市'}, formatter: Table.api.formatter.normal},
                        {field: 'faction', title: __('Faction'), searchList: {"t":__('Faction t'),"j":__('Faction j'),"p":__('Faction p'),"w":__('Faction w')}, formatter: Table.api.formatter.normal},
                        {field: 'title', title: __('Title'), operate: 'LIKE'},
                        {field: 'mainPic', title: __('Mainpic'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
                        {field: 'originalPrice', title: __('Originalprice'), operate:'BETWEEN'},
                        {field: 'actualPrice', title: __('Actualprice'), operate:'BETWEEN'},
                        {field: 'shopName', title: __('Shopname'), operate: 'LIKE'},
                        {field: 'couponPrice', title: __('Couponprice'), operate:'BETWEEN'},
                        {field: 'monthSales', title: __('Monthsales')},
                        {field: 'browse_time', title: __('Browse_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}
                    ]
                ]
            });
 
            // 为表格绑定事件
            Table.api.bindevent(table);
        },
        
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});