mixin.js
912 Bytes
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
module.exports = {
data(){
return {
workers: {
video_free: 0,
video_busy: 0
},
dev_unid: localStorage.getItem("dev_unid"),
taskstatus:{
running: 0,
total: 0
}
}
},
methods: {
getDevStatus() {
this.$api.device.getDevStatus(this.dev_unid).then(res => {
if (res.ecode != 500) {
this.workers = res.works;
} else {
this.$message({
type: "error",
message: res.enote
});
}
});
},
getSubTaskStatus() {
this.$api.device.getSubTaskStatus().then(res => {
if (res.ecode != 500) {
this.taskstatus = res;
} else {
this.$message({
type: "error",
message: res.enote
});
}
});
}
},
created() {
this.getSubTaskStatus();
this.getDevStatus();
}
}