add task retry & task finish function
This commit is contained in:
parent
9515161666
commit
54a974611a
|
@ -81,6 +81,22 @@ export function addTask(data) {
|
|||
})
|
||||
}
|
||||
|
||||
export function endTask(data) {
|
||||
return request({
|
||||
url: '/ota/overJob',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function retryTask(data) {
|
||||
return request({
|
||||
url: '/ota/reTryJob',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getTaskList(data) {
|
||||
return request({
|
||||
url: '/ota/getAll',
|
||||
|
|
|
@ -204,11 +204,11 @@
|
|||
>{{ item.statusDesc }}</el-tag>
|
||||
</p>
|
||||
<p>
|
||||
<el-tooltip content="置为成功">
|
||||
<i class="el-icon-success success" />
|
||||
<el-tooltip content="任务重试">
|
||||
<i class="el-icon-refresh-right success" @click="retryTask(item)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="置为失败">
|
||||
<i class="el-icon-error error" />
|
||||
<el-tooltip content="强制结束">
|
||||
<i class="el-icon-close error" @click="endTask(item.id)" />
|
||||
</el-tooltip>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -280,6 +280,8 @@ import {
|
|||
getByName,
|
||||
getTaskList,
|
||||
addTask,
|
||||
endTask,
|
||||
retryTask,
|
||||
getClient
|
||||
} from '@/api/terminal/ota.js'
|
||||
|
||||
|
@ -518,6 +520,34 @@ export default {
|
|||
})
|
||||
this.taskListVisible = true
|
||||
},
|
||||
retryTask(task) {
|
||||
const data = {
|
||||
fileName: task.fileName,
|
||||
deviceId: task.deviceId,
|
||||
createTime: task.createTime,
|
||||
fileVersion: task.fileVersion,
|
||||
updateType: task.updateType,
|
||||
id: task.id
|
||||
}
|
||||
this.$confirm('确认重试任务?', '提示', { type: 'warning' }).then(() => {
|
||||
retryTask(data).then(res => {
|
||||
if (res.code === '200000') {
|
||||
this.$message.success('任务重试发起成功')
|
||||
this.refresh(false)
|
||||
}
|
||||
})
|
||||
}).catch(err => {})
|
||||
},
|
||||
endTask(id) {
|
||||
this.$confirm('确认强制结束任务?', '提示', { type: 'warning' }).then(() => {
|
||||
endTask({ id }).then(res => {
|
||||
if (res.code === '200000') {
|
||||
this.$message.success('任务强制结束成功')
|
||||
this.refresh()
|
||||
}
|
||||
})
|
||||
}).catch(err => {})
|
||||
},
|
||||
refresh(needMsg = true) {
|
||||
getTaskList({ fileName: this.currentFileName }).then((res) => {
|
||||
if (needMsg) {
|
||||
|
@ -769,7 +799,7 @@ export default {
|
|||
display: grid;
|
||||
justify-content: space-around;
|
||||
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
||||
grid-template-rows: repeat(auto-fill, 260px);
|
||||
grid-template-rows: repeat(auto-fill, 290px);
|
||||
grid-gap: 0 20px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
|
Loading…
Reference in New Issue