流程审核不通过,在我的待办中直接跳转
This commit is contained in:
@@ -51,7 +51,7 @@ import { ref, onMounted, provide, reactive } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import {useRoute, useRouter} from 'vue-router'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { addRunTest, update, cancel } from '@/api/supervision-boot/lineRunTest'
|
||||
@@ -190,8 +190,6 @@ const tableStore = new TableStore({
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
monitorIds = []
|
||||
monitorIds.push(row.id)
|
||||
monitorIds = []
|
||||
monitorIds.push(row.id)
|
||||
const start = new Date()
|
||||
@@ -403,6 +401,46 @@ const runTestSubmit = (type: number) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
watch(() => route.query.t, async (newValue, oldValue) => {
|
||||
let nowTime = Date.now()
|
||||
let routeTime = route.query.t as number || 1
|
||||
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms,则不执行
|
||||
if (route.fullPath.includes('/testRun')) {
|
||||
let id = (route.query.id as string) || 'null'
|
||||
if(id != 'null'){
|
||||
monitorIds = []
|
||||
monitorIds.push(id)
|
||||
const start = new Date()
|
||||
start.setDate(start.getDate() + 1)
|
||||
start.setHours(0, 0, 0)
|
||||
const end = new Date()
|
||||
end.setDate(end.getDate() + 3)
|
||||
end.setHours(23, 59, 59)
|
||||
const startString = formatDate(start, 'YYYY-MM-DD') // 转换为 YYYY-MM-DD 格式
|
||||
const endString = formatDate(end, 'YYYY-MM-DD')
|
||||
const data = {
|
||||
startTime: startString,
|
||||
endTime: endString,
|
||||
lineIds: monitorIds,
|
||||
operateType: 1,
|
||||
id
|
||||
}
|
||||
update(data).then((res: any) => {
|
||||
if (res.code === 'A0000') {
|
||||
ElMessage({
|
||||
message: '发起试运行成功',
|
||||
type: 'success'
|
||||
})
|
||||
tableStore.index()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}, {deep: true, immediate: true})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user