agent.js
990 字节
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
/**
* staff page
*/
function onAddAction() {
location.href = CONTEXT_PATH+"/agent/edit"
}
$("#searchInput").keydown(function(event) {
if (event.which == 13) {
onSearchAction();
}
});
function onSearchAction() {
var searchKey = $("#searchInput").val();
search(searchKey, 1);
}
// 页面切换
function onGoToPage() {
var page = $("#inputPage").val();
try {
page = parseInt(page);
} catch (e) {
}
var searchKey = $("#searchInput").val();
search(searchKey, page);
}
function search(key, page) {
var params = "page=" + page + "&pageNum=10";
if (!isEmpty(key)) {
params += "&key=" + key;
}
location.href = CONTEXT_PATH+"/agent/list?" + params;
}
function onModifyAction(id) {
location.href = CONTEXT_PATH+"/agent/edit?id="+id;
}
function onDeleteAction(staffId) {
$('#deleteId').val(staffId);
$('#delModal').modal('show');
}
function onDeleteFromModal() {
$('#delModal').modal('hide');
location.href=CONTEXT_PATH+"/agent/delete?id="+$("#deleteId").val();
}