feat(database): 签到活动功能
This commit is contained in:
61
public/assets/js/backend/zy/sign/sign_set.js
Normal file
61
public/assets/js/backend/zy/sign/sign_set.js
Normal file
@@ -0,0 +1,61 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'zy/sign/sign_set/index' + location.search,
|
||||
add_url: 'zy/sign/sign_set/add',
|
||||
edit_url: 'zy/sign/sign_set/edit',
|
||||
del_url: 'zy/sign/sign_set/del',
|
||||
multi_url: 'zy/sign/sign_set/multi',
|
||||
import_url: 'zy/sign/sign_set/import',
|
||||
table: 'zy_sign_set',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'last', title: __('Last')},
|
||||
{field: 'chance1', title: __('Chance1')},
|
||||
{field: 'coupon1.name', title: __('Coupon.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
// {field: 'coupon1_id', title: __('Coupon1_id')},
|
||||
{field: 'chance2', title: __('Chance2')},
|
||||
{field: 'coupon2.name', title: __('Coupon.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
// {field: 'coupon2_id', title: __('Coupon2_id')},
|
||||
{field: 'status', title: __('Status')},
|
||||
{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: 'coupon.id', title: __('Coupon.id')},
|
||||
{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;
|
||||
});
|
||||
Reference in New Issue
Block a user