feat(shopro): 添加俱乐部、球馆的访客记录功能
- 在 Club 控制器中添加访客记录逻辑 - 在 Gym 控制器中添加访客记录逻辑 - 在 Sys 控制器中添加获取访客记录的功能
This commit is contained in:
59
public/assets/js/backend/zy/link/visitor.js
Normal file
59
public/assets/js/backend/zy/link/visitor.js
Normal file
@@ -0,0 +1,59 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'zy/link/visitor/index' + location.search,
|
||||
add_url: 'zy/link/visitor/add',
|
||||
edit_url: 'zy/link/visitor/edit',
|
||||
del_url: 'zy/link/visitor/del',
|
||||
multi_url: 'zy/link/visitor/multi',
|
||||
import_url: 'zy/link/visitor/import',
|
||||
table: 'zy_visitor',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'type', title: __('Type')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'nickname', title: __('Nickname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'gender', title: __('Gender')},
|
||||
{field: 'times', title: __('Times')},
|
||||
{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: '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;
|
||||
});
|
||||
Reference in New Issue
Block a user