赖素文
authored
|
1
2
3
4
|
let action = null;
layui.config({
base: "/js/",
version: 1
|
HuXiYu
authored
|
5
|
}).use(['system',"vue"], function () {
|
赖素文
authored
|
6
7
8
9
10
11
12
13
14
15
16
|
var form = layui.form,
$ = layui.jquery,
element = layui.element,
table = layui.table,
system = layui.system,
sysU = new system.u(),
sendDataWhere = null,
sendDataDescWhere = null,
areaName = "configure",
controllerName = "BaseProject",
projectKeys = null,
|
HuXiYu
authored
|
17
18
|
projectName = "",
vueApp=null,
|
赖素文
authored
|
19
20
21
22
23
24
25
26
|
app = null;
action = {
}
app = {
data: {
|
HuXiYu
authored
|
27
|
|
赖素文
authored
|
28
29
|
},
methods: {
|
赖素文
authored
|
30
31
32
33
34
35
36
37
38
|
/**
* 初始化vue
*/
initVue: function () {
vueApp = new Vue({
el: '.vueApp',
data: {
head: {
projectName: 0
|
HuXiYu
authored
|
39
40
41
42
43
|
},
body: {
eqCount: 0,
eqOnline: 0,
eqStandBy: 0,
|
HuXiYu
authored
|
44
45
|
eqOffline: 0,
eqOnlineRate:0,
|
HuXiYu
authored
|
46
|
},
|
赖素文
authored
|
47
48
49
50
|
},
methods: {
},
|
HuXiYu
authored
|
51
|
ready: function () {
|
HuXiYu
authored
|
52
|
this.head.projectName = `${projectName}`;
|
赖素文
authored
|
53
|
}
|
赖素文
authored
|
54
55
56
|
});
},
/**
|
HuXiYu
authored
|
57
|
* vue 集合赋值 result.Result.eqCount
|
赖素文
authored
|
58
|
*/
|
HuXiYu
authored
|
59
|
initVueDataValue: function (result) {
|
HuXiYu
authored
|
60
61
|
var res = result.Result;
vueApp.body.eqCount = res.eqSumCount;
|
HuXiYu
authored
|
62
63
64
|
vueApp.body.eqOnline = res.eqOnLineCount;
vueApp.body.eqStandBy = res.eqStandByCount;
vueApp.body.eqOnlineRate = res.runningRate;
|
赖素文
authored
|
65
66
67
|
},
getUrlParam: function () {
|
赖素文
authored
|
68
69
|
projectKeys = localStorage.getItem("projectMapKeys");
projectName = localStorage.getItem("projectMapName");
|
赖素文
authored
|
70
|
},
|
HuXiYu
authored
|
71
72
73
74
75
76
77
78
79
80
81
82
83
|
getEquipmentDataList() {
var ajaxConfig = {
data: { pageRequest: null, entity: { flag: "projectMapList", keys: projectKeys } },
url: `/configure/BaseProject/LoadProjectOverview`,
success: function (result) {
if (sysU.successBefore(result)) return false;
app.methods.initVueDataValue(result);
}
};
sysU.ajax(ajaxConfig);
},
|
赖素文
authored
|
84
85
86
|
init: function () {
var tempElem = $(".sys-a-det");
tempElem.attr("href", tempElem.data("scr") + `?projectKeys=${projectKeys}`)
|
HuXiYu
authored
|
87
88
|
app.methods.getEquipmentDataList();
|
赖素文
authored
|
89
|
}
|
赖素文
authored
|
90
91
|
},
registerEvent: function () {
|
HuXiYu
authored
|
92
|
|
赖素文
authored
|
93
94
95
|
},
init: function () {
app.methods.getUrlParam();
|
赖素文
authored
|
96
|
app.methods.initVue();
|
赖素文
authored
|
97
|
app.methods.init();
|
赖素文
authored
|
98
99
100
101
|
}
};
app.init();
});
|