123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
-
- Table.api.init({
- extend: {
- index_url: 'ghuser/index' + location.search,
- add_url: 'ghuser/add',
- multi_url: 'ghuser/multi',
- import_url: 'ghuser/import',
- table: 'user',
- }
- });
- var table = $("#table");
-
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- commonSearch: true,
- searchFormVisible: false,
- showToggle: false,
- showColumns: false,
- search:false,
- showExport:false,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'gh_id', title: __('Gh_id')},
- {field: 'gonghui.name', title: __('Gonghui.name'), operate: 'LIKE'},
- {field: 'intro_uid', title: __('Intro_uid')},
- {field: 'username', title: __('Username'), operate: 'LIKE'},
- {field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
- {field: 'introcode', title: __('Introcode'), operate: 'LIKE'},
- {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
- {field: 'avatar', title: __('Avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
- {field: 'real_status', title: __('Real_status'), searchList: {"-1":__('Real_status -1'),"0":__('Real_status 0'),"1":__('Real_status 1'),"2":__('Real_status 2')}, formatter: Table.api.formatter.status},
- {field: 'gender', title: __('Gender'), searchList: {"1":__('Gender 1'),"0":__('Gender 0')}, formatter: Table.api.formatter.normal},
- {field: 'idcard_status', title: __('Idcard_status'), searchList: {"-1":__('Idcard_status -1'),"0":__('Idcard_status 0'),"1":__('Idcard_status 1'),"2":__('Idcard_status 2')}, formatter: Table.api.formatter.status},
- {field: 'jointime', title: __('Jointime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"0":__('Status 0'),"-1":__('Status -1')}, formatter: Table.api.formatter.status},
- {field: 'cityname', title: __('Cityname'), operate: 'LIKE'},
- {field: 'open_match_video', title: __('Open_match_video'), searchList: {"1":__('Open_match_video 1'),"0":__('Open_match_video 0')}, formatter: Table.api.formatter.normal},
- {field: 'open_match_audio', title: __('Open_match_audio'), searchList: {"1":__('Open_match_audio 1'),"0":__('Open_match_audio 0')}, formatter: Table.api.formatter.normal},
- {field: 'open_match_typing', title: __('Open_match_typing'), searchList: {"1":__('Open_match_typing 1'),"0":__('Open_match_typing 0')}, formatter: Table.api.formatter.normal},
- {field: 'free_video', title: __('Free_video'), searchList: {"1":__('Free_video 1'),"0":__('Free_video 0')}, formatter: Table.api.formatter.normal},
- {field: 'free_audio', title: __('Free_audio'), searchList: {"1":__('Free_audio 1'),"0":__('Free_audio 0')}, formatter: Table.api.formatter.normal},
- {field: 'free_typing', title: __('Free_typing'), searchList: {"1":__('Free_typing 1'),"0":__('Free_typing 0')}, formatter: Table.api.formatter.normal},
- {field: 'register_from', title: __('Register_from'), operate: 'LIKE'},
- {field: 'wechat_account', title: __('Wechat_account'), operate: 'LIKE'},
- {field: 'secretvideo_status', title: __('Secretvideo_status'), searchList: {"-1":__('Secretvideo_status -1'),"0":__('Secretvideo_status 0'),"1":__('Secretvideo_status 1'),"2":__('Secretvideo_status 2')}, formatter: Table.api.formatter.status},
- {field: 'profit', title: '累计收益', operate: false},
- {field: 'operate', title: __('Operate'), table: table,
- buttons:[
- {
- name:'moneylog',
- text:'收益日志',
- title:'收益日志',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-dialog',
- url:function(row){
- return "moneylog/index?user_id="+ row.id +"&log_type=21,22,23,52,54,56";
- },
- target:'_self',
-
- }
- ],
- 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;
- });
|