boardList.js
3.21 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
layui.config({
base: "/js/",
version: 4444
}).use(["system", "vue"], function () {
var form = layui.form,
$ = layui.jquery,
table = layui.table,
element = layui.element,
system = layui.system,
sysU = new system.u(),
areaName = "Board",
tableName = "Board",
vueApp = null;
var app = {
data: {
tableIns: null,
},
methods: {
initVue: function () {
vueApp = new Vue({
el: '.boardApp',
data: {
contentList: []
},
methods: {
//设置线体是否工作日
setLineWork: (item) => {
var ajaxConfig = {
data: item,
url: `/${areaName}/${tableName}/SetCalendarLineList`,
success: function (result) {
setTimeout(() => { app.methods.setFromHide(result); });
app.methods.factoryCalendarViewDesc(vueApp.nowdate);
}
};
sysU.ajax(ajaxConfig);
},
setLineWorkAll: (selectAll) => {
vueApp.noProductiontime.forEach(x => {
x.Weekday = vueApp.selectAll;
});
var ajaxConfig = {
data: {
datetime: vueApp.nowdate,
lineCode: vueApp.noProductiontime.GetArrValue("lineCode"),
Weekday: vueApp.selectAll
},
url: `/${areaName}/${tableName}/SetCalendarLineList`,
success: function (result) {
app.methods.setFromHide(result);
}
};
sysU.ajax(ajaxConfig);
}
}
});
},
//获取数据
getBoardList: function () {
var ajaxConfig = {
url: `/${areaName}/${tableName}/Load`,
success: function (result) {
if (sysU.successBefore(result)) return;
setTimeout(() => {
vueApp.contentList = result.Count == 0 ? [] : result.Result;
});
}
};
sysU.ajax(ajaxConfig);
},
initForm: () => {
},
},
registerEvent: function () {
//自定义按钮执行公共方法
system.query();
system.queryExtend();
},
init: function () {
app.methods.initVue();
app.methods.initForm();
app.methods.getBoardList();
}
};
app.init();
});