更新指令
This commit is contained in:
@@ -1,11 +1,36 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<div id="app" @mousemove="moveEvent" @click="moveEvent">
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App'
|
||||
name: 'App',
|
||||
data() {
|
||||
return {
|
||||
timmer: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
moveEvent: function() {
|
||||
const path = ['/login']
|
||||
if (!path.includes(this.$route.path)) {
|
||||
clearTimeout(this.timmer)
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
init: function() {
|
||||
this.timmer = setTimeout(() => {
|
||||
sessionStorage.clear()
|
||||
this.logout()
|
||||
}, 1000 * 60 * 15) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456
|
||||
},
|
||||
logout() {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.reload()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -41,6 +41,14 @@ export function cancel(instruction_id) {
|
||||
})
|
||||
}
|
||||
|
||||
export function forceCancel(instruction_id) {
|
||||
return request({
|
||||
url: 'api/instruction/forceCancel/' + instruction_id,
|
||||
method: 'post',
|
||||
data: instruction_id
|
||||
})
|
||||
}
|
||||
|
||||
export function queryUnFinish() {
|
||||
return request({
|
||||
url: 'api/instruction/unfinish/',
|
||||
@@ -63,4 +71,4 @@ export function reload() {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, finish, cancel, queryUnFinish, queryByTaskId,reload }
|
||||
export default { add, edit, del, finish, cancel, forceCancel, queryUnFinish, queryByTaskId,reload }
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">强制取消</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
@@ -291,6 +292,14 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
forceCancel(index, row) {
|
||||
crudInstruction.forceCancel(row.instruction_id).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('取消成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
reload() {
|
||||
crudInstruction.reload().then(res => {
|
||||
this.crud.toQuery()
|
||||
@@ -314,6 +323,9 @@ export default {
|
||||
case 'b':// 取消
|
||||
this.cancel(command.index, command.row)
|
||||
break
|
||||
case 'c':// 取消
|
||||
this.forceCancel(command.index, command.row)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user