Files
fast/public/assets/js/backend/zy/game/game_match.js
2025-05-01 11:42:05 +08:00

72 lines
3.8 KiB
JavaScript

define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'zy/game/game_match/index' + location.search,
add_url: 'zy/game/game_match/add',
edit_url: 'zy/game/game_match/edit',
del_url: 'zy/game/game_match/del',
multi_url: 'zy/game/game_match/multi',
import_url: 'zy/game/game_match/import',
table: 'zy_game_match',
}
});
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: 'stadium.name', title: __('Stadium.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'club.name', title: __('Club.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'activity.name', title: __('Activity.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'game.name', title: __('Game.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
// {field: 'gym_id', title: __('Gym_id')},
// {field: 'club_id', title: __('Club_id')},
// {field: 'act_id', title: __('Act_id')},
// {field: 'game_id', title: __('Game_id')},
{field: 'level', title: __('Level')},
{field: 'turn', title: __('Turn')},
{field: 'round1', title: __('Round1'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'round2', title: __('Round2'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'round3', title: __('Round3'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'scoreA', title: __('ScoreA')},
{field: 'scoreB', title: __('ScoreB')},
{field: 'winner', title: __('Winner'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{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;
});