| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- 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 ? '<span class="label label-danger">' + __("已支付") + '</span>': '<span class="label label-default">'+ __('未支付')+ '</span>';
- // },
- // type: function (value) {
- // return value==2 ? '<span class="label label-danger">' + __("已使用") + '</span>': '<span class="label label-default">'+ __('未使用')+ '</span>';
- // }
- // }
- }
- };
- return Controller;
- });
|