-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp2.js
84 lines (84 loc) · 1.9 KB
/
app2.js
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
Ext.require("Ext.MessageBox");
Ext.application({
name: "PersonnelAttendanceSystem",
launch: function() {
var dockedItems = [{
xtype: 'toolbar',
dock: 'top',
items: [{
text: '退出',
ui: 'back',
handler: function() {}
}, {
xtype: 'spacer'
}, {
text: '注册',
ui: 'action',
handler: function() {}
}]
}];
var mainPanel = Ext.create('Ext.Container', {
fullscreen: true,
layout: 'vbox',
items: [{
dockedItems: dockedItems
}, {
xtype: 'spacer'
}, {
xtype: 'panel',
style: 'text-align:center;font-size: 24pt;',
html: '人事考勤系统',
id: 'form',
flex: 2
}, {
xtype: 'panel',
flex: 4,
items: [{
xtype: 'fieldset',
items: [{
xtype: 'emailfield',
labelAlign: 'left',
name: 'username',
id: 'username',
label: '用户名:',
placeHolder: '输入用户名'
}, {
xtype: 'passwordfield',
labelAlign: 'left',
name: 'password',
id: 'password',
label: '密码:',
placeHolder: '输入密码'
}]
}]
}, {
layout: 'hbox',
items: [{
xtype: 'button',
name: 'login',
id: 'login',
text: '登录',
style: 'margin-left:10px;',
ui: 'action',
width: 150,
handler: function() {
var usernameProxy = Ext.getCmp('username').getValue();
var passwordProxy = Ext.getCmp('password').getValue();
if (usernameProxy == '') {
Ext.Msg.alert("错误信息", "用户名不能为空.");
} else if (passwordProxy == '') {
Ext.Msg.alert("错误信息", "密码不能为空.");
}
}
}, {
xtype: 'panel',
style: 'margin-left:10px;padding-top:10px;',
html: "<a href='#'>忘记密码?</a>"
}]
}, {
xtype: 'spacer'
}]
});
Ext.Viewport.add(mainPanel);
}
});