define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'user/collect/index' + location.search, add_url: 'user/collect/add', edit_url: 'user/collect/edit', del_url: 'user/collect/del', multi_url: 'user/collect/multi', import_url: 'user/collect/import', table: 'user_collect', } }); 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: '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'), operate: 'LIKE'}, {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: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); // 为表格绑定事件 Table.api.bindevent(table); }, add: function () { Controller.api.bindevent(); }, edit: function () { Controller.api.bindevent(); }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); } } }; return Controller; });