-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlog.js
More file actions
147 lines (140 loc) · 3.92 KB
/
Copy pathlog.js
File metadata and controls
147 lines (140 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/**
* Created with JetBrains PhpStorm.
* User: dou
* Date: 8/7/13
* Time: 11:59 PM
* To change this template use File | Settings | File Templates.
*/
function log(){
var store = Ext.create('Ext.data.Store', {
fields : [{name : 'id'}, {name : 'time'}, {name : 'username'}, {name : 'usernm'}, {name : 'logs'}],
proxy : {
type : 'ajax',
url : 'logx_select.action',
actionMethods: {
read: 'POST'
},
reader : {
type : 'json',
root : 'list'
}
},
autoLoad : true
});
var query_form = Ext.create('Ext.form.Panel', {
border : false,
bodyStyle : 'padding:25px 5px 0',
width : 660,
fieldDefaults : {
labelAlign : 'right',
msgTarget : 'side'
},
defaults : {
border : false,
xtype : 'panel',
flex : 1,
layout : 'anchor'
},
layout : 'hbox',
items : [ {
flex : 6,
items : [ {
xtype : 'textfield',
fieldLabel : '操作员',
name : 'first'
}, {
xtype : 'textfield',
fieldLabel : '操作内容',
name : 'company'
} ]
}, {
flex : 6,
items : [ {
xtype : 'datefield',
fieldLabel : '开始时间',
name : 'last'
}, {
xtype : 'datefield',
fieldLabel : '结束时间',
name : 'email',
vtype : 'email'
} ]
}, {
bodyStyle : 'padding:3px 5px 0',
flex : 2,
layout : {
type : 'vbox',
align : 'stretch',
pack : 'start'
},
items : [ {
xtype : 'button',
iconCls : 'silk-search',
text : '查找'
}, {
xtype : 'button',
iconCls : 'silk-refresh',
text : '重置'
} ]
} ]
});
var log_query = Ext.create('Ext.Panel', { /* 查询面板 */
height : 100,
region : 'north',
items : [ query_form ]
});
/* ======================创建工具栏==================== */
var action_export = Ext.create('Ext.Action', {
text : '导出',
iconCls : 'silk-excel',
handler : function() {
Ext.example.msg('Click', 'You click on 导出');
}
});
var action_refresh = Ext.create('Ext.Action', {
text : '刷新',
iconCls : 'silk-refresh',
handler : function() {
Ext.example.msg('Click', 'You click on 刷新数据');
}
});
var toolbar = Ext.create('Ext.toolbar.Toolbar', {
items : [ action_export, '-', action_refresh ]
});
var log_grid = Ext.create('Ext.grid.Panel', {
region : 'center',
store : store,
columns : [ {
header : "编号",
width : 80,
dataIndex : 'id',
sortable : false
}, {
header : "时间",
width : 190,
dataIndex : 'time',
sortable : true
}, {
header : "操作员",
width : 80,
dataIndex : 'usernm',
sortable : true
}, {
flex: 1,
header : "操作内容",
width : 160,
dataIndex : 'logs',
sortable : true
}]
});
var panel = Ext.create('Ext.Panel', {
title : '系统操作日志',
itemId : 'log_panel',
layout : 'border',
closable : true,
items : [ log_query, log_grid],
dockedItems : toolbar
});
Ext.getCmp('tabs_panel').add(panel);
Ext.getCmp('tabs_panel').setActiveTab('log_panel');
}