'项目表单更新'
This commit is contained in:
parent
cceaa92f8f
commit
4cf34a5ccc
|
@ -20,7 +20,7 @@ const toast = (msg, description) => {
|
||||||
const request = axios.create({
|
const request = axios.create({
|
||||||
// API 请求的默认前缀
|
// API 请求的默认前缀
|
||||||
baseURL: process.env.VUE_APP_API_BASE_URL,
|
baseURL: process.env.VUE_APP_API_BASE_URL,
|
||||||
timeout: 6000 // 请求超时时间
|
timeout: 60000 // 请求超时时间
|
||||||
})
|
})
|
||||||
|
|
||||||
// 异常拦截处理器
|
// 异常拦截处理器
|
||||||
|
|
|
@ -5,20 +5,20 @@
|
||||||
<a-step title="基本信息" />
|
<a-step title="基本信息" />
|
||||||
<a-step title="选择单位" />
|
<a-step title="选择单位" />
|
||||||
<!-- v-if="['2', '3', '4'].includes(form.trainWay)" -->
|
<!-- v-if="['2', '3', '4'].includes(form.trainWay)" -->
|
||||||
<a-step title="选择课程" />
|
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="选择课程" />
|
||||||
<a-step title="选择人员" />
|
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="选择人员" />
|
||||||
<a-step title="组卷策略" />
|
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="组卷策略" />
|
||||||
<a-step :title="this.result ? '完成' : '失败'" />
|
<a-step :title="this.result ? '完成' : '失败'" />
|
||||||
</a-steps>
|
</a-steps>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<keep-alive exclude="result">
|
<!-- <keep-alive exclude="result"> -->
|
||||||
<step1 v-if="currentTab === 0" :projectForm="form" @nextStep="nextStep" />
|
<step1 v-if="currentTab === 0" :projectForm="form" @nextStep="nextStep" />
|
||||||
<step2 v-if="currentTab === 1" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
<step2 v-if="currentTab === 1" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
||||||
<step3 v-if="currentTab === 2" :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" />
|
<step4 v-if="currentTab === 3" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
||||||
<step5 v-if="currentTab === 4" :projectForm="form" @prevStep="prevStep" @executeSave="executeSave" @executeIssue="executeIssue" />
|
<step5 v-if="currentTab === 4" :projectForm="form" @prevStep="prevStep" @executeSave="executeSave" @executeIssue="executeIssue" />
|
||||||
<result v-if="currentTab === 5" :projectForm="form" @nextStep="nextStep" :projectSaveStatus="status"/>
|
<result v-if="currentTab === 5" :projectForm="form" @prevStep="prevStep" :projectSaveStatus="status" />
|
||||||
</keep-alive>
|
<!-- </keep-alive> -->
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
@ -31,7 +31,6 @@ import Step4 from './form/ProjectPersonForm'
|
||||||
import step5 from './form/ProjectTestPaperFormationStrategy'
|
import step5 from './form/ProjectTestPaperFormationStrategy'
|
||||||
import result from './form/Result'
|
import result from './form/Result'
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Step1,
|
Step1,
|
||||||
|
@ -41,7 +40,13 @@ export default {
|
||||||
step5,
|
step5,
|
||||||
result,
|
result,
|
||||||
},
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)
|
||||||
|
created() {
|
||||||
|
console.log('分步表单创建完成')
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
console.log('分步表单销毁了。。。。。')
|
||||||
|
}, //生命周期 - 销毁完成
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
|
@ -58,7 +63,9 @@ export default {
|
||||||
visible: false,
|
visible: false,
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
type: '',
|
type: '',
|
||||||
form: {},
|
form: {
|
||||||
|
trainWay: '1',
|
||||||
|
},
|
||||||
result: true,
|
result: true,
|
||||||
status: '',
|
status: '',
|
||||||
}
|
}
|
||||||
|
@ -104,6 +111,7 @@ export default {
|
||||||
this.form = childValue
|
this.form = childValue
|
||||||
this.currentTab += 1
|
this.currentTab += 1
|
||||||
}
|
}
|
||||||
|
console.log('ProjectStepForm表单数据', this.form)
|
||||||
},
|
},
|
||||||
//上一步
|
//上一步
|
||||||
prevStep(childValue) {
|
prevStep(childValue) {
|
||||||
|
@ -112,6 +120,7 @@ export default {
|
||||||
this.form = childValue
|
this.form = childValue
|
||||||
this.currentTab -= 1
|
this.currentTab -= 1
|
||||||
}
|
}
|
||||||
|
console.log('ProjectStepForm表单数据', this.form)
|
||||||
},
|
},
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
|
|
|
@ -60,11 +60,15 @@ export default {
|
||||||
STable,
|
STable,
|
||||||
ProjectCourseSelect,
|
ProjectCourseSelect,
|
||||||
},
|
},
|
||||||
props: {},
|
props: {
|
||||||
|
projectForm: {
|
||||||
|
type: Object,
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
//这里存放数据
|
//这里存放数据
|
||||||
return {
|
return {
|
||||||
form: {},
|
form: this.projectForm,
|
||||||
labelCol: {},
|
labelCol: {},
|
||||||
wrapperCol: {},
|
wrapperCol: {},
|
||||||
vertical: 'vertical',
|
vertical: 'vertical',
|
||||||
|
@ -93,6 +97,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
/** 新建的没有项目id,传当前的所选的课程id */
|
/** 新建的没有项目id,传当前的所选的课程id */
|
||||||
return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => {
|
return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||||
|
|
||||||
return res.data
|
return res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -105,14 +110,37 @@ export default {
|
||||||
watch: {},
|
watch: {},
|
||||||
//方法集合
|
//方法集合
|
||||||
methods: {
|
methods: {
|
||||||
|
//下一步
|
||||||
toNext() {
|
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)
|
console.log('ProjectCourseSelect-toNext', this.form)
|
||||||
this.$emit('nextStep')
|
this.$emit('nextStep',this.form)
|
||||||
},
|
},
|
||||||
|
//上一步
|
||||||
toPrep() {
|
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)
|
console.log('toPrep', this.form)
|
||||||
this.$emit('prevStep', 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() {
|
getProjectCourseList() {
|
||||||
// if (this.$route.query.projectId) {
|
// if (this.$route.query.projectId) {
|
||||||
|
@ -138,7 +166,7 @@ export default {
|
||||||
|
|
||||||
//生命周期 - 创建完成(可以访问当前this实例)
|
//生命周期 - 创建完成(可以访问当前this实例)
|
||||||
created() {
|
created() {
|
||||||
// this.getProjectCourseList()
|
this.initIds()
|
||||||
},
|
},
|
||||||
mounted() {}, //生命周期 - 挂载完成(可以访问DOM元素)
|
mounted() {}, //生命周期 - 挂载完成(可以访问DOM元素)
|
||||||
beforeCreate() {}, //生命周期 - 创建之前
|
beforeCreate() {}, //生命周期 - 创建之前
|
||||||
|
|
|
@ -126,10 +126,9 @@ import { classList } from '@/api/project/class'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
// form: {
|
projectForm: {
|
||||||
// type: Object,
|
type: Object,
|
||||||
// default: () => ({}),
|
},
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -140,7 +139,7 @@ export default {
|
||||||
visible: false,
|
visible: false,
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
trainClass: [],
|
trainClass: [],
|
||||||
form: {},
|
form: this.projectForm,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
|
@ -78,10 +78,15 @@ export default {
|
||||||
orgList,
|
orgList,
|
||||||
STable,
|
STable,
|
||||||
},
|
},
|
||||||
props: {},
|
props: {
|
||||||
|
projectForm: {
|
||||||
|
type: Object,
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
// 这里存放数据
|
// 这里存放数据
|
||||||
return {
|
return {
|
||||||
|
form: this.projectForm,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParam: { orgType: 1 },
|
queryParam: { orgType: 1 },
|
||||||
replaceFields: { children: 'children', title: 'name', key: 'id', value: 'id' },
|
replaceFields: { children: 'children', title: 'name', key: 'id', value: 'id' },
|
||||||
|
@ -118,11 +123,13 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
//下一步
|
//下一步
|
||||||
toNext() {
|
toNext() {
|
||||||
this.$emit('nextStep',this.selectedRowKeys)
|
this.form.personIds = this.selectedRowKeys
|
||||||
|
this.$emit('nextStep',this.form)
|
||||||
},
|
},
|
||||||
//上一步
|
//上一步
|
||||||
toPrev() {
|
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
|
this.autoExpandParent = false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//编辑时初始化人员列表初始化
|
||||||
|
initPersonList(){
|
||||||
|
if(this.form.personIds){
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取到机构树,展开顶级下树节点,考虑到后期数据量变大,不建议全部展开
|
* 获取到机构树,展开顶级下树节点,考虑到后期数据量变大,不建议全部展开
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,10 +20,16 @@
|
||||||
export default {
|
export default {
|
||||||
// import引入的组件需要注入到对象中才能使用
|
// import引入的组件需要注入到对象中才能使用
|
||||||
components: {},
|
components: {},
|
||||||
props: {},
|
props: {
|
||||||
|
projectForm: {
|
||||||
|
type: Object,
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
// 这里存放数据
|
// 这里存放数据
|
||||||
return {}
|
return {
|
||||||
|
form: this.projectForm,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 计算属性 类似于data概念
|
// 计算属性 类似于data概念
|
||||||
computed: {},
|
computed: {},
|
||||||
|
@ -32,11 +38,11 @@ export default {
|
||||||
// 方法集合
|
// 方法集合
|
||||||
methods: {
|
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实例)
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
||||||
created() {},
|
created() {},
|
||||||
|
|
|
@ -107,13 +107,13 @@ function handleTreeData(data, targetKeys = []) {
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
form:{
|
projectForm: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: ()=>({}),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
form: this.projectForm,
|
||||||
targetKeys: [],
|
targetKeys: [],
|
||||||
dataSource: transferDataSource,
|
dataSource: transferDataSource,
|
||||||
|
|
||||||
|
@ -137,6 +137,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toNext() {
|
toNext() {
|
||||||
|
this.form.unitIds = this.targetKeys
|
||||||
console.log('toNext', this.form)
|
console.log('toNext', this.form)
|
||||||
this.$emit('nextStep', this.form)
|
this.$emit('nextStep', this.form)
|
||||||
// const {
|
// const {
|
||||||
|
@ -150,6 +151,7 @@ export default {
|
||||||
// })
|
// })
|
||||||
},
|
},
|
||||||
toPrep() {
|
toPrep() {
|
||||||
|
this.form.unitIds = this.targetKeys
|
||||||
console.log('toPrep', this.form)
|
console.log('toPrep', this.form)
|
||||||
this.$emit('prevStep', this.form)
|
this.$emit('prevStep', this.form)
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,12 +19,16 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'success',
|
default: 'success',
|
||||||
},
|
},
|
||||||
|
projectForm: {
|
||||||
|
type: Object,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
// 这里存放数据
|
// 这里存放数据
|
||||||
return {
|
return {
|
||||||
// status: 'success',
|
// status: 'success',
|
||||||
// title: '项目保存',
|
// title: '项目保存',
|
||||||
|
form: this.projectForm,
|
||||||
description: '请返回列表中查看',
|
description: '请返回列表中查看',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -37,12 +41,12 @@ export default {
|
||||||
toPrev() {
|
toPrev() {
|
||||||
// this.$emit('prevStep',this.selectedRowKeys)
|
// this.$emit('prevStep',this.selectedRowKeys)
|
||||||
console.log('结果页返回修改')
|
console.log('结果页返回修改')
|
||||||
this.$emit('prevStep', { tab: 1 })
|
this.$emit('prevStep', this.form)
|
||||||
},
|
},
|
||||||
toProjectList() {
|
toProjectList() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/project/list',
|
path: '/project/list',
|
||||||
query: {projectPageNum: 1,},
|
query: { projectPageNum: 1 },
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue