subtask.vue
3.43 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
<template>
<div class="expande-table-row">
<span class="label">{{ subindex + 1 }}</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">
<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">确定</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"
});
}
});
}
},
created() {
console.log(this.subTaskData);
},
watch: {},
mounted() {
this.assign_id = this.subTaskData.assign_id
? this.subTaskData.assign_id
: "";
}
};
</script>
<style lang="scss" scoped>
.expande-table-row {
width: 79vw;
overflow: hidden;
span {
float: left;
border-bottom: 1px solid #ccc;
overflow: hidden;
}
.label {
width: 5vw;
text-align: center;
border-left: 1px solid $border-color;
background: #f0f0f0;
height: 40px;
line-height: 40px;
}
.subtask-info {
border-left: 1px solid #f0f0f0;
text-align: center;
overflow: hidden;
height: 40px;
line-height: 40px;
}
.subtask-info:nth-child(3) {
width: 7vw;
overflow: hidden;
}
.subtask-info:nth-child(5) {
width: 8vw;
}
.subtask-info:nth-child(7) {
width: 6vw;
}
.subtask-info:nth-child(9) {
width: 4vw;
}
.subtask-info:nth-child(11) {
width: 4vw;
}
.subtask-info:nth-child(13) {
width: 9vw;
}
.sub-btn {
cursor: pointer;
}
}
</style>