123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- define(function (require) {
- return function (context) {
- var $grid, $form;
- function enterQueryGrid1(e) {
- if (e.keyCode === 13) {
- var tmp = $(this).val();
- $form.formSet({queryProperties: tmp});
- queryGrid1();
- }
- }
- //刷新
- function queryGrid1() {
- $grid.jqGrid("clearGridData");
- var obj = $form.formGet();
- $grid.reload({
- url: api('/sys/sysLogin/query'),
- mtype: 'POST',
- queryParams: obj
- });
- }
- // 搜索按钮 页面第一行
- var queryToolbarTitle = '登录日志';
- var queryToolbar = {
- xtype: 'toolbar', title: queryToolbarTitle, items: [
- {
- text: '查询', iconCls: 'fa fa-search', onClick: function () {
- queryGrid1();
- }
- }, {
- text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
- $form.formClear();
- queryGrid1();
- }
- }, {
- text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
- App.closeMe(this);
- }
- }
- ]
- };
- // 搜索条件 页面第二行
- var queryFormPrompt = '姓名/登录账号';
- var queryForm = {
- onRender: function () {
- $form = $(this);
- },
- xtype: 'form',
- items: [[
- {
- xtype: 'textbox',
- label: '检索条件',
- name: 'queryProperties',
- prompt: queryFormPrompt,
- labelWidth: 'auto',
- events: {keydown: enterQueryGrid1},
- },
- {
- xtype: 'yvselect', label: '账号类型', name: 'accType', labelWidth: 'auto', width: 200, value: '',
- data: $.yvan.sysDict('accType').combowithAll(),
- onChange: function () {
- queryGrid1();
- }
- },
- {
- xtype: 'yvselect', label: '程序类型', name: 'appType', labelWidth: 'auto', width: 200, value: '',
- data: $.yvan.sysDict('appType').combowithAll(),
- onChange: function () {
- queryGrid1();
- }
- },
- ]]
- };
- return {
- center: {
- border: false,
- items: {
- onRender: function () {
- $grid = $(this);
- queryGrid1(); //初始化数据
- },
- xtype: 'grid',
- idField: "logId",
- toolbar: {
- xtype: 'div',
- items: [
- queryToolbar,
- queryForm,
- ]
- },
- columns: [[
- {title: '登录流水', field: 'logId', hidden: true},
- {title: '姓名', field: 'name'},
- {title: '登录账号', field: 'accId', hidden: true},
- {title: '登录账号', field: 'account'},
- {title: '账号类型', field: 'accType', align: 'center', formatter: $.fn.fmatter.accType},
- {title: '登录令牌', field: 'tid'},
- {title: '程序Id', field: 'appId', hidden: true},
- {title: '程序名称', field: 'appName'},
- {title: '程序类型', field: 'appType', hidden: true},
- {title: '程序版本Id', field: 'verId', hidden: true},
- {title: '程序版本', field: 'verCode'},
- {title: '终端IP', field: 'termId', hidden: true},
- {title: '终端号', field: 'termCode'},
- {title: '登录时间', field: 'timeCreate', formatter: 'ts'}
- ]]
- }
- }
- };
- };
- })
- ;
|