项目form表单更新

This commit is contained in:
Yuanjianghong 2021-11-19 17:00:51 +08:00
parent 4f2c3b0b11
commit 0265c7103d
4 changed files with 151 additions and 9 deletions

View File

@ -8,14 +8,17 @@
<a-step title="选择课程" /> <a-step title="选择课程" />
<a-step title="选择人员" /> <a-step title="选择人员" />
<a-step title="组卷策略" /> <a-step title="组卷策略" />
<a-step title="完成" /> <a-step :title="this.result ? '完成' : '失败'" />
</a-steps> </a-steps>
<div class="content"> <div class="content">
<keep-alive>
<step1 v-if="currentTab === 0" @nextStep="nextStep" /> <step1 v-if="currentTab === 0" @nextStep="nextStep" />
<step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep" /> <step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep" />
<step3 v-if="currentTab === 2" @nextStep="nextStep" @prevStep="prevStep" /> <step3 v-if="currentTab === 2" @nextStep="nextStep" @prevStep="prevStep" />
<step4 v-if="currentTab === 3" @nextStep="nextStep" @prevStep="prevStep" /> <step4 v-if="currentTab === 3" @nextStep="nextStep" @prevStep="prevStep" />
<step5 v-if="currentTab === 4" @prevStep="prevStep" @finish="finish" /> <step5 v-if="currentTab === 4" @prevStep="prevStep" @executeSave="executeSave" @executeIssue="executeIssue" />
<result v-if="currentTab === 8" @nextStep="nextStep" />
</keep-alive>
</div> </div>
</a-card> </a-card>
</template> </template>
@ -25,6 +28,9 @@ import Step1 from './form/ProjectForm'
import Step2 from './form/ProjectUnitSelect' import Step2 from './form/ProjectUnitSelect'
import Step3 from './form/ProjectCourseList' import Step3 from './form/ProjectCourseList'
import Step4 from './form/ProjectPersonForm' import Step4 from './form/ProjectPersonForm'
import step5 from './form/ProjectTestPaperFormationStrategy'
import result from './form/Result'
export default { export default {
components: { components: {
@ -32,7 +38,10 @@ export default {
Step2, Step2,
Step3, Step3,
Step4, Step4,
step5,
result,
}, },
data() { data() {
return { return {
title: '', title: '',
@ -50,6 +59,7 @@ export default {
confirmLoading: false, confirmLoading: false,
type: '', type: '',
form: {}, form: {},
result: true,
} }
}, },
methods: { methods: {
@ -67,12 +77,28 @@ export default {
this.formLoading = false this.formLoading = false
}, },
// handler //
executeSave(childValue) {
console.log('保存项目', childValue)
if (true) {
this.currentTab = 8
}
},
//
executeIssue(childValue) {
console.log('保存并发布项目', childValue)
if (true) {
this.currentTab = 8
this.result = false
}
},
// //
nextStep(childValue) { nextStep(childValue) {
console.log('进入下一步', childValue) console.log('进入下一步', childValue)
if (this.currentTab < 5) { if (this.currentTab < 5) {
this.form = childValue; this.form = childValue
this.currentTab += 1 this.currentTab += 1
} }
}, },
@ -84,6 +110,7 @@ export default {
this.currentTab -= 1 this.currentTab -= 1
} }
}, },
finish() { finish() {
this.currentTab = 0 this.currentTab = 0
}, },

View File

@ -90,8 +90,6 @@ export default {
defaultExpandedKeys: [], defaultExpandedKeys: [],
selectedRowKeys: [], selectedRowKeys: [],
selectedRows: [], selectedRows: [],
keyData: [], //key
rowsData: [], //
orgTree: [], orgTree: [],
orgId: '', orgId: '',
orgType: 1, orgType: 1,
@ -120,11 +118,11 @@ export default {
methods: { methods: {
// //
toNext() { toNext() {
this.$emit('nextStep') this.$emit('nextStep',this.selectedRowKeys)
}, },
// //
toPrev() { toPrev() {
this.$emit('prevStep') this.$emit('prevStep',this.selectedRowKeys)
}, },
/** 表格行选中后触发 */ /** 表格行选中后触发 */

View File

@ -0,0 +1,62 @@
<template>
<div>
<a-card :bordered="false">
<p>hahahahhahahahahhahahah</p>
</a-card>
<a-card :bordered="false">
<p>ppppppsdapppsdapppp</p>
</a-card>
<a-button type="primary" @click="toSave"> </a-button>
<a-button type="primary" @click="toIssue"> </a-button>
<a-button type="primary" @click="toPrev">上一步</a-button>
</div>
</template>
<script>
// jsjsjson
// import from ''
export default {
// import使
components: {},
props: {},
data() {
//
return {}
},
// data
computed: {},
// data
watch: {},
//
methods: {
//
toSave() { this.$emit('executeSave') },
//
toIssue(){ this.$emit("executeIssue") },
//
toPrev() { this.$emit('prevStep') },
},
// - 访this
created() {},
// - 访DOM
mounted() {},
// -
beforeCreate() {},
// -
beforeMount() {},
// -
beforeUpdate() {},
// -
updated() {},
// -
beforeDestroy() {},
// -
destroyed() {},
// keep-alive
activated() {},
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,55 @@
<template>
<a-result :status="projectSaveStatus" :title="title" :sub-title="description">
<p>{{ this.description }}</p>
</a-result>
</template>
<script>
// jsjsjson
// import from ''
export default {
// import使
components: {},
props: {
projectSaveStatus: {
type: String,
default: 'success'
}
},
data() {
//
return {
// status: 'success',
title: '成华大道',
description: '走成华大道到二仙桥',
}
},
// data
computed: {},
// data
watch: {},
//
methods: {},
// - 访this
created() {},
// - 访DOM
mounted() {},
// -
beforeCreate() {},
// -
beforeMount() {},
// -
beforeUpdate() {},
// -
updated() {},
// -
beforeDestroy() {},
// -
destroyed() {},
// keep-alive
activated() {},
}
</script>
<style scoped>
</style>