index.vue
1.26 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
<template>
<div class="flow-open-page">
<FlowBox v-if="initialized" ref="flowBox" @close="onClose" />
</div>
</template>
<script>
import FlowBox from '../components/FlowBox'
export default {
name: 'WorkFlowFlowOpen',
components: { FlowBox },
data() {
return {
initialized: false
}
},
mounted() {
const q = this.$route.query || {}
if (!q.id) {
this.$message.error('缺少流程参数,无法打开详情')
this.$router.back()
return
}
this.initialized = true
this.$nextTick(() => {
const formType = q.formType !== undefined && q.formType !== '' ? Number(q.formType) : 1
const status = q.status !== undefined && q.status !== '' ? Number(q.status) : 2
this.$refs.flowBox.init({
id: q.id,
enCode: q.flowCode || '',
flowId: q.flowId || '',
formType: Number.isNaN(formType) ? 1 : formType,
opType: 0,
status: Number.isNaN(status) ? 2 : status,
taskNodeId: q.taskNodeId || undefined
})
})
},
methods: {
onClose() {
if (window.history.length > 1) {
this.$router.back()
} else {
this.$router.replace('/dashboard')
}
}
}
}
</script>
<style scoped>
.flow-open-page {
min-height: 100%;
}
</style>