modify.vue
1.8 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
<template>
<div class="app-container">
<div class="table center">
<div class="box">
<el-steps :active="active" finish-status="success" align-center>
<el-step title="考级基本信息" />
<el-step title="添加考生" />
</el-steps>
</div>
</div>
<div class="table">
<exam-info v-show="active==0" ref="examInfoRef" @next="next" />
<exam-person v-show="active==1" ref="examPersonRef" @prev="prev" />
</div>
</div>
</template>
<script setup>
import { onMounted, ref } from 'vue'
import ExamInfo from './components/examInfo'
import ExamPerson from './components/examPerson'
import { useRoute, useRouter } from 'vue-router'
import { getCurrentInstance } from '@vue/runtime-core'
const route = useRoute()
const router = useRouter()
const { proxy } = getCurrentInstance()
const active = ref(-1)
onMounted(() => {
const examId = route.params.examId
const step = route.query.step
if (!examId || examId == '0') {
active.value = 0
} else {
active.value = step == '2' ? 1 : 0
if (active.value == 0) {
proxy.$refs['examInfoRef'].init(examId)
} else {
proxy.$refs['examPersonRef'].init(examId)
}
}
})
function next(examId) {
active.value++
router.push({
path: `/level/apply/modify/${examId}`,
query: { step: active.value + 1 }
})
proxy.$refs['examPersonRef'].init(examId)
}
function prev(examId) {
active.value--
router.push({
query: { step: active.value + 1 }
})
proxy.$refs['examInfoRef'].init(examId)
}
</script>
<style lang="scss" scoped>
:deep(.el-step__title.is-process){color: var(--el-color-primary)}
:deep(.el-step__head.is-process){color: var(--el-color-primary);border-color: var(--el-color-primary)}
.box{
width: 1000px;
}
.center{
display: flex;
justify-content: center;
}
</style>