'项目表单更新'

This commit is contained in:
hbzgyjh 2021-11-21 01:59:40 +08:00
parent cceaa92f8f
commit 4cf34a5ccc
8 changed files with 105 additions and 43 deletions

View File

@ -20,7 +20,7 @@ const toast = (msg, description) => {
const request = axios.create({
// API 请求的默认前缀
baseURL: process.env.VUE_APP_API_BASE_URL,
timeout: 6000 // 请求超时时间
timeout: 60000 // 请求超时时间
})
// 异常拦截处理器

View File

@ -5,20 +5,20 @@
<a-step title="基本信息" />
<a-step title="选择单位" />
<!-- v-if="['2', '3', '4'].includes(form.trainWay)" -->
<a-step title="选择课程" />
<a-step title="选择人员" />
<a-step title="组卷策略" />
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="选择课程" />
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="选择人员" />
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="组卷策略" />
<a-step :title="this.result ? '完成' : '失败'" />
</a-steps>
<div class="content">
<keep-alive exclude="result">
<!-- <keep-alive exclude="result"> -->
<step1 v-if="currentTab === 0" :projectForm="form" @nextStep="nextStep" />
<step2 v-if="currentTab === 1" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
<step3 v-if="currentTab === 2" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
<step4 v-if="currentTab === 3" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
<step5 v-if="currentTab === 4" :projectForm="form" @prevStep="prevStep" @executeSave="executeSave" @executeIssue="executeIssue" />
<result v-if="currentTab === 5" :projectForm="form" @nextStep="nextStep" :projectSaveStatus="status"/>
</keep-alive>
<result v-if="currentTab === 5" :projectForm="form" @prevStep="prevStep" :projectSaveStatus="status" />
<!-- </keep-alive> -->
</div>
</a-card>
</template>
@ -31,7 +31,6 @@ import Step4 from './form/ProjectPersonForm'
import step5 from './form/ProjectTestPaperFormationStrategy'
import result from './form/Result'
export default {
components: {
Step1,
@ -41,7 +40,13 @@ export default {
step5,
result,
},
// - 访this
created() {
console.log('分步表单创建完成')
},
destroyed() {
console.log('分步表单销毁了。。。。。')
}, // -
data() {
return {
title: '',
@ -58,7 +63,9 @@ export default {
visible: false,
confirmLoading: false,
type: '',
form: {},
form: {
trainWay: '1',
},
result: true,
status: '',
}
@ -104,6 +111,7 @@ export default {
this.form = childValue
this.currentTab += 1
}
console.log('ProjectStepForm表单数据', this.form)
},
//
prevStep(childValue) {
@ -112,6 +120,7 @@ export default {
this.form = childValue
this.currentTab -= 1
}
console.log('ProjectStepForm表单数据', this.form)
},
finish() {

View File

@ -60,11 +60,15 @@ export default {
STable,
ProjectCourseSelect,
},
props: {},
props: {
projectForm: {
type: Object,
},
},
data() {
//
return {
form: {},
form: this.projectForm,
labelCol: {},
wrapperCol: {},
vertical: 'vertical',
@ -93,6 +97,7 @@ export default {
} else {
/** 新建的没有项目id传当前的所选的课程id */
return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => {
return res.data
})
}
@ -105,14 +110,37 @@ export default {
watch: {},
//
methods: {
//
toNext() {
this.form.lessonIds = []
let ids = this.queryParam.ids.split(',')
ids.forEach((id, index, arr) => {
console.log('id-----------------------',id)
this.form.lessonIds.push({ ids: id, sort: index })
})
console.log('ProjectCourseSelect-toNext', this.form)
this.$emit('nextStep')
this.$emit('nextStep',this.form)
},
//
toPrep() {
this.form.lessonIds = []
let ids = this.queryParam.ids.split(',')
ids.forEach((id, index, arr) => {
this.form.lessonIds.push({ ids: id, sort: index })
})
console.log('toPrep', this.form)
this.$emit('prevStep', this.form)
},
//ids
initIds(){
let str = this.projectForm.lessonIds.join(',')
console.log('initIds',str)
if(str){
this.queryParam.ids = str
}
},
/**查询了列表数据 */
getProjectCourseList() {
// if (this.$route.query.projectId) {
@ -138,7 +166,7 @@ export default {
// - 访this
created() {
// this.getProjectCourseList()
this.initIds()
},
mounted() {}, // - 访DOM
beforeCreate() {}, // -

View File

@ -126,10 +126,9 @@ import { classList } from '@/api/project/class'
export default {
props: {
// form: {
// type: Object,
// default: () => ({}),
// },
projectForm: {
type: Object,
},
},
data() {
return {
@ -140,7 +139,7 @@ export default {
visible: false,
confirmLoading: false,
trainClass: [],
form: {},
form: this.projectForm,
}
},
components: {

View File

@ -78,10 +78,15 @@ export default {
orgList,
STable,
},
props: {},
props: {
projectForm: {
type: Object,
}
},
data() {
//
return {
form: this.projectForm,
//
queryParam: { orgType: 1 },
replaceFields: { children: 'children', title: 'name', key: 'id', value: 'id' },
@ -118,11 +123,13 @@ export default {
methods: {
//
toNext() {
this.$emit('nextStep',this.selectedRowKeys)
this.form.personIds = this.selectedRowKeys
this.$emit('nextStep',this.form)
},
//
toPrev() {
this.$emit('prevStep',this.selectedRowKeys)
this.form.personIds = this.selectedRowKeys
this.$emit('prevStep',this.form)
},
/** 表格行选中后触发 */
@ -176,6 +183,13 @@ export default {
this.autoExpandParent = false
},
//
initPersonList(){
if(this.form.personIds){
}
},
/**
* 获取到机构树展开顶级下树节点考虑到后期数据量变大不建议全部展开
*/

View File

@ -20,10 +20,16 @@
export default {
// import使
components: {},
props: {},
props: {
projectForm: {
type: Object,
}
},
data() {
//
return {}
return {
form: this.projectForm,
}
},
// data
computed: {},
@ -32,11 +38,11 @@ export default {
//
methods: {
//
toSave() { this.$emit('executeSave') },
toSave() { this.$emit('executeSave'), this.form },
//
toIssue(){ this.$emit("executeIssue") },
toIssue(){ this.$emit("executeIssue"), this.form },
//
toPrev() { this.$emit('prevStep') },
toPrev() { this.$emit('prevStep'), this.form },
},
// - 访this
created() {},

View File

@ -107,13 +107,13 @@ function handleTreeData(data, targetKeys = []) {
export default {
props: {
form:{
projectForm: {
type: Object,
default: ()=>({}),
},
},
data() {
return {
form: this.projectForm,
targetKeys: [],
dataSource: transferDataSource,
@ -127,7 +127,7 @@ export default {
},
}
},
created(){
created() {
console.log('第2个表单创建了')
},
computed: {
@ -137,8 +137,9 @@ export default {
},
methods: {
toNext() {
this.form.unitIds = this.targetKeys
console.log('toNext', this.form)
this.$emit('nextStep',this.form)
this.$emit('nextStep', this.form)
// const {
// form: { validateFields },
// } = this
@ -150,6 +151,7 @@ export default {
// })
},
toPrep() {
this.form.unitIds = this.targetKeys
console.log('toPrep', this.form)
this.$emit('prevStep', this.form)
},

View File

@ -19,12 +19,16 @@ export default {
type: String,
default: 'success',
},
projectForm: {
type: Object,
},
},
data() {
//
return {
// status: 'success',
// title: '',
form: this.projectForm,
description: '请返回列表中查看',
}
},
@ -34,15 +38,15 @@ export default {
watch: {},
//
methods: {
toPrev(){
toPrev() {
// this.$emit('prevStep',this.selectedRowKeys)
console.log('结果页返回修改')
this.$emit('prevStep', { tab: 1 })
this.$emit('prevStep', this.form)
},
toProjectList() {
this.$router.push({
path: '/project/list',
query: {projectPageNum: 1,},
query: { projectPageNum: 1 },
})
},
},