define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'platform/vplatform/index', add_url: 'platform/vplatform/add', edit_url: 'platform/vplatform/edit', del_url: 'platform/vplatform/del', multi_url: 'platform/vplatform/multi', table: 'platform', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', // sortName: 'user.id', columns: [ [ {checkbox: true}, {field: 'id', title: __('ID'), sortable: true}, // {field: 'videolist.name', title: __('短剧名称'), operate: false}, // {field: 'platform.name', title: __('平台名称'), operate: false}, {field: 'vid', title: __('短剧名称'), sortable: true}, {field: 'platform_id', title: __('平台名称'), sortable: true}, {field: 'max', title: __('收益上限'), sortable: true}, {field: 'min', title: __('收益下限'), sortable: true}, {field: 'createtime', title: __('创建时间'), formatter: Table.api.formatter.datetime}, {field: 'operate', title: __('操作'), 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]")); }, // formatter: { // paytype: function (value) { // return value==2 ? '' + __("已支付") + '': ''+ __('未支付')+ ''; // }, // type: function (value) { // return value==2 ? '' + __("已使用") + '': ''+ __('未使用')+ ''; // } // } } }; return Controller; });