subtask.vue
4.85 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
<div class="expande-table-row">
<span class="label labelindex">{{ subindex + 1 }}</span>
<span class="subtask-info taskstatus" v-html="formater(subTaskData)" @click="showinfo(subTaskData)"></span>
<span class="label">视频源文件</span>
<span class="subtask-info">{{ subTaskData.vchan_name }}</span>
<span class="label">任务ID</span>
<span class="subtask-info">{{ subTaskData.subtask_id }}</span>
<!-- <span class="label">设备地址</span>
<span class="subtask-info">{{ subTaskData.device_ip }}</span> -->
<!-- <span class="label">已用资源</span>
<span class="subtask-info">{{ subTaskData.video_busy }}</span>
<span class="label">设备容量</span>
<span class="subtask-info">{{ subTaskData.video_total }}</span> -->
<span class="label">任务信息</span>
<span class="subtask-info">{{ subTaskData.info }}</span>
<!-- <span class="label">分析设备</span>
<span class="subtask-info">
<el-select v-model="assign_id">
<el-option
v-for="(item, index) in freeList"
:key="index"
:value="item.device_id"
:label="item.in_ip"
v-if="
subTaskData.plate_type &&
item.license_info.platType === subTaskData.plate_type
"
>
{{ item.in_ip }} {{ item.license_info.platType }}
</el-option>
<el-option
v-for="(item, index) in freeList"
:key="index"
:value="item.device_id"
:label="item.in_ip"
v-if="!subTaskData.plate_type"
>
{{ item.in_ip }} {{ item.license_info.platType }}
</el-option>
</el-select>
</span> -->
<span class="label sub-btn" @click="subMove" hidden>确定</span>
</div>
</template>
<script>
export default {
data() {
return {
assign_id: ""
};
},
props: ["subTaskData", "freeList", "taskData", "subindex"],
methods: {
subMove() {
let taskID = this.taskData.task_id;
let subTaksID = this.subTaskData.subtask_id;
this.$api.task.getTaskParams(taskID, subTaksID).then(res => {
let obj = {};
obj.mtasks = res.mtasks;
obj.assign_to = {
id: this.assign_id,
flag: 0
};
this.subRoi(taskID, subTaksID, obj);
});
},
subRoi(taskid, subtaskid, postObj) {
this.$api.task
.editRoi(taskid, subtaskid, postObj, {
headers: {
authorization: localStorage.getItem("atoken")
}
})
.then(m => {
if (m.ecode == "200") {
this.$message({
message: "设置成功!",
type: "success"
});
}
});
},
formater(data) {
if (data.enableStatus == 2) {
return "<span class='runningbox statusbox'>工作中</span>";
} else if (data.enableStatus == 1) {
return "<span class='nomoralbox statusbox'>部署中</span>";
} else if (data.enableStatus == 3) {
return "<span class='pausebox statusbox'>暂停中</span>";
} else if (data.enableStatus == 4) {
return "<span class='pausebox statusbox'>已暂停</span>";
} else if (data.enableStatus == 5) {
return "<span class='deletebox statusbox'>删除中</span>";
} else if (data.enableStatus == 6) {
return "<span class='deletebox statusbox'>已删除</span>";
} else if (data.enableStatus == 7) {
return "<span class='pausebox statusbox'>启动中</span>";
} else if (data.enableStatus == 0) {
return "<span class='nomoralbox statusbox'>未部署</span>";
} else {
return "<span class='errorbox statusbox'>异常</span>";
}
},
showinfo(data) {
console.log("任务状态信息:", data.info);
}
},
created() {
// console.log(this.subTaskData);
},
watch: {},
mounted() {}
};
</script>
<style lang="scss" scoped>
.expande-table-row {
width: 79vw;
overflow: hidden;
span {
float: left;
border-bottom: 1px solid #ccc;
overflow: hidden;
}
span:last-child{
border-bottom: 1px solid #333;
}
.label {
width: 5vw;
text-align: center;
// border-left: 1px solid $border-color;
background: #f0f0f0;
height: 40px;
line-height: 40px;
}
.labelindex {
width: 4vw;
}
.taskstatus {
width: 8vw;
}
.subtask-info {
border-left: 1px solid #f0f0f0;
text-align: center;
overflow: hidden;
height: 40px;
line-height: 40px;
}
.subtask-info:nth-child(4) {
width: 10vw;
overflow: hidden;
}
.subtask-info:nth-child(6) {
width: 18vw;
}
.subtask-info:nth-child(8) {
width: 16vw;
border-right: 1px solid #f0f0f0;
}
.subtask-info:nth-child(10) {
width: 3vw;
}
.subtask-info:nth-child(12) {
width: 3vw;
}
.subtask-info:nth-child(14) {
width: 7vw;
}
.sub-btn {
cursor: pointer;
}
}
</style>