generator.js
2.89 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
let action = null;
layui.config({
base: "/js/",
version: 1
}).use(['system', 'table'], function () {
var form = layui.form,
$ = layui.jquery,
element = layui.element,
table = layui.table,
system = layui.system,
sysU = new system.u(),
sendData = null,
areaName = "Planned",
controllerName = "Generator",
app = null,
completState = 90;
action = {
queryOptions: function () {
var options = {
resetFrom: "form[lay-filter=listForm]",
fromId: "listForm",
urlExport: `/${areaName}/${controllerName}/Export`,
urlQuery: `/${areaName}/${controllerName}/Load`,
mainTable: app.data.tableIns
}
return options;
},
openCodeView: function (obj) {
var entityName = obj.data.TableCode;
layer.open({
type: 2,
title: `【${entityName}】生成代码`,
shadeClose: true,
maxmin: true, //开启最大化最小化按钮
area: ['890px', '550px'],
content: `CodePreview?entityName=${entityName}`,
resizing: function (layero) {
console.log(layero);
}
});
},
//所有动作成功之后
actionSuccess: (falg) => {
sysU.refreshTable(app, sysU, null, falg);
}
}
app = {
data: {
cols: [[
{ type: 'numbers', title: '序号' },
{ field: "TableCode", width: '42%', title: "表名称" },
{ field: "TableName", width: '43%', title: "说明(备注)" },
{ fixed: 'right', title: '操作', width: 125, minWidth: 125, toolbar: '#option', event: "openCodeView" }
]],
tableIns: null,
tableElem: "mainList",
//下拉框配置
selectOption: {
//返回的数据 用于后续操作
selectData: {
}
}
},
methods: {
initTable: function () {
let options = {
elem: "#" + app.data.tableElem,
url: `/${areaName}/${controllerName}/Load`,
cols: sysU.columnRecord(app.data.tableElem, app.data.cols),
toolbar: '#toolbarTable',
}
app.data.tableIns = sysU.initTable(options);
},
initSelectTable: function () {
},
initFrom() {
sysU.initSelect(app.data.selectOption);
}
},
registerEvent: function () {
},
init: function () {
app.methods.initTable();
app.methods.initFrom();
app.registerEvent();
}
};
app.init();
});