diff --git a/src/utils/request.js b/src/utils/request.js
index c3bea4e..5ba50c2 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -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 // 请求超时时间
})
// 异常拦截处理器
diff --git a/src/views/project/ProjectStepForm.vue b/src/views/project/ProjectStepForm.vue
index 71e0cf5..a4ffb11 100644
--- a/src/views/project/ProjectStepForm.vue
+++ b/src/views/project/ProjectStepForm.vue
@@ -5,20 +5,20 @@
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -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() {
diff --git a/src/views/project/form/ProjectCourseList.vue b/src/views/project/form/ProjectCourseList.vue
index e12d395..75f2db1 100644
--- a/src/views/project/form/ProjectCourseList.vue
+++ b/src/views/project/form/ProjectCourseList.vue
@@ -10,7 +10,7 @@
- {{ index + 1 }}
+ {{ index + 1 }}
@@ -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() {}, //生命周期 - 创建之前
diff --git a/src/views/project/form/ProjectForm.vue b/src/views/project/form/ProjectForm.vue
index 1af5ea5..e837528 100644
--- a/src/views/project/form/ProjectForm.vue
+++ b/src/views/project/form/ProjectForm.vue
@@ -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: {
diff --git a/src/views/project/form/ProjectPersonForm.vue b/src/views/project/form/ProjectPersonForm.vue
index c20aa9d..5a02790 100644
--- a/src/views/project/form/ProjectPersonForm.vue
+++ b/src/views/project/form/ProjectPersonForm.vue
@@ -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){
+
+ }
+ },
+
/**
* 获取到机构树,展开顶级下树节点,考虑到后期数据量变大,不建议全部展开
*/
diff --git a/src/views/project/form/ProjectTestPaperFormationStrategy.vue b/src/views/project/form/ProjectTestPaperFormationStrategy.vue
index bcb23c4..8fb748c 100644
--- a/src/views/project/form/ProjectTestPaperFormationStrategy.vue
+++ b/src/views/project/form/ProjectTestPaperFormationStrategy.vue
@@ -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() {},
diff --git a/src/views/project/form/ProjectUnitSelect.vue b/src/views/project/form/ProjectUnitSelect.vue
index 772f29c..6f73085 100644
--- a/src/views/project/form/ProjectUnitSelect.vue
+++ b/src/views/project/form/ProjectUnitSelect.vue
@@ -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)
},
diff --git a/src/views/project/form/Result.vue b/src/views/project/form/Result.vue
index 69b8c93..34b5420 100644
--- a/src/views/project/form/Result.vue
+++ b/src/views/project/form/Result.vue
@@ -19,12 +19,16 @@ export default {
type: String,
default: 'success',
},
+ projectForm: {
+ type: Object,
+ },
},
data() {
// 这里存放数据
return {
// status: 'success',
- // title: '项目保存',
+ // title: '项目保存',
+ form: this.projectForm,
description: '请返回列表中查看',
}
},
@@ -34,15 +38,15 @@ export default {
watch: {},
// 方法集合
methods: {
- toPrev(){
- // this.$emit('prevStep',this.selectedRowKeys)
- console.log('结果页返回修改')
- this.$emit('prevStep', { tab: 1 })
+ toPrev() {
+ // this.$emit('prevStep',this.selectedRowKeys)
+ console.log('结果页返回修改')
+ this.$emit('prevStep', this.form)
},
toProjectList() {
this.$router.push({
path: '/project/list',
- query: {projectPageNum: 1,},
+ query: { projectPageNum: 1 },
})
},
},