'项目表单更新'
This commit is contained in:
parent
cceaa92f8f
commit
4cf34a5ccc
|
@ -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 // 请求超时时间
|
||||
})
|
||||
|
||||
// 异常拦截处理器
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {}, //生命周期 - 创建之前
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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){
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取到机构树,展开顶级下树节点,考虑到后期数据量变大,不建议全部展开
|
||||
*/
|
||||
|
|
|
@ -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() {},
|
||||
|
|
|
@ -107,13 +107,13 @@ function handleTreeData(data, targetKeys = []) {
|
|||
|
||||
export default {
|
||||
props: {
|
||||
form:{
|
||||
projectForm: {
|
||||
type: Object,
|
||||
default: ()=>({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: this.projectForm,
|
||||
targetKeys: [],
|
||||
dataSource: transferDataSource,
|
||||
|
||||
|
@ -137,6 +137,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
toNext() {
|
||||
this.form.unitIds = this.targetKeys
|
||||
console.log('toNext', this.form)
|
||||
this.$emit('nextStep', this.form)
|
||||
// const {
|
||||
|
@ -150,6 +151,7 @@ export default {
|
|||
// })
|
||||
},
|
||||
toPrep() {
|
||||
this.form.unitIds = this.targetKeys
|
||||
console.log('toPrep', this.form)
|
||||
this.$emit('prevStep', this.form)
|
||||
},
|
||||
|
|
|
@ -19,12 +19,16 @@ export default {
|
|||
type: String,
|
||||
default: 'success',
|
||||
},
|
||||
projectForm: {
|
||||
type: Object,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
// 这里存放数据
|
||||
return {
|
||||
// status: 'success',
|
||||
// title: '项目保存',
|
||||
form: this.projectForm,
|
||||
description: '请返回列表中查看',
|
||||
}
|
||||
},
|
||||
|
@ -37,12 +41,12 @@ export default {
|
|||
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 },
|
||||
})
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue