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
$(function () {
$("#jqGrid").jqGrid({
url: 'sys/generator/list',
datatype: "json",
colModel: [
{label: '表名', name: 'tableName', width: 100, key: true},
{label: '表备注', name: 'tableComment', width: 100},
{label: '创建时间', name: 'createTime', width: 100}
],
viewrecords: true,
height: 385,
rowNum: 10,
rowList: [10, 30, 50, 100, 200],
rownumbers: true,
rownumWidth: 25,
autowidth: true,
multiselect: true,
pager: "#jqGridPager",
jsonReader: {
root: "page.list",
page: "page.currPage",
total: "page.totalPage",
records: "page.totalCount"
},
prmNames: {
page: "page",
rows: "limit",
order: "order"
},
gridComplete: function () {
//隐藏grid底部滚动条
$("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
}
});
});
var vm = new Vue({
el: '#rrapp',
data: {
q: {
tableName: null
}
},
methods: {
query: function () {
$("#jqGrid").jqGrid('setGridParam', {
postData: {'tableName': vm.q.tableName},
page: 1
}).trigger("reloadGrid");
},
generator: function () {
var tableNames = getSelectedRows();
if (tableNames == null) {
return;
}
location.href = "sys/generator/code?tables=" + tableNames.join();
}
}
});