From 4f2c3b0b11941712624ee0776d7db83582af2e75 Mon Sep 17 00:00:00 2001 From: Yuanjianghong Date: Fri, 19 Nov 2021 14:46:30 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=BA=BA=E5=91=98=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/project/ProjectStepForm.vue | 10 +- src/views/project/form/ProjectPersonForm.vue | 195 +++++++++++++++++-- 2 files changed, 181 insertions(+), 24 deletions(-) diff --git a/src/views/project/ProjectStepForm.vue b/src/views/project/ProjectStepForm.vue index 4aea7ba..0fd5982 100644 --- a/src/views/project/ProjectStepForm.vue +++ b/src/views/project/ProjectStepForm.vue @@ -11,11 +11,11 @@
- - - - - + + + + +
diff --git a/src/views/project/form/ProjectPersonForm.vue b/src/views/project/form/ProjectPersonForm.vue index e67ef79..c7479cc 100644 --- a/src/views/project/form/ProjectPersonForm.vue +++ b/src/views/project/form/ProjectPersonForm.vue @@ -1,36 +1,119 @@ \ No newline at end of file From 0265c7103d5a91564b1d27ddf8bbfe7035a20c3e Mon Sep 17 00:00:00 2001 From: Yuanjianghong Date: Fri, 19 Nov 2021 17:00:51 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AEform=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/project/ProjectStepForm.vue | 37 +++++++++-- src/views/project/form/ProjectPersonForm.vue | 6 +- .../ProjectTestPaperFormationStrategy.vue | 62 +++++++++++++++++++ src/views/project/form/Result.vue | 55 ++++++++++++++++ 4 files changed, 151 insertions(+), 9 deletions(-) create mode 100644 src/views/project/form/ProjectTestPaperFormationStrategy.vue create mode 100644 src/views/project/form/Result.vue diff --git a/src/views/project/ProjectStepForm.vue b/src/views/project/ProjectStepForm.vue index 0fd5982..da3a124 100644 --- a/src/views/project/ProjectStepForm.vue +++ b/src/views/project/ProjectStepForm.vue @@ -8,14 +8,17 @@ - +
+ - + + +
@@ -25,6 +28,9 @@ import Step1 from './form/ProjectForm' import Step2 from './form/ProjectUnitSelect' import Step3 from './form/ProjectCourseList' import Step4 from './form/ProjectPersonForm' +import step5 from './form/ProjectTestPaperFormationStrategy' +import result from './form/Result' + export default { components: { @@ -32,7 +38,10 @@ export default { Step2, Step3, Step4, + step5, + result, }, + data() { return { title: '', @@ -50,6 +59,7 @@ export default { confirmLoading: false, type: '', form: {}, + result: true, } }, methods: { @@ -67,23 +77,40 @@ export default { 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) { console.log('进入下一步', childValue) if (this.currentTab < 5) { - this.form = childValue; + this.form = childValue this.currentTab += 1 } }, //上一步 prevStep(childValue) { - console.log('返回上一步',childValue) + console.log('返回上一步', childValue) if (this.currentTab > 0) { this.form = childValue this.currentTab -= 1 } }, + finish() { this.currentTab = 0 }, diff --git a/src/views/project/form/ProjectPersonForm.vue b/src/views/project/form/ProjectPersonForm.vue index c7479cc..c20aa9d 100644 --- a/src/views/project/form/ProjectPersonForm.vue +++ b/src/views/project/form/ProjectPersonForm.vue @@ -90,8 +90,6 @@ export default { defaultExpandedKeys: [], selectedRowKeys: [], selectedRows: [], - keyData: [], //不动的key列表 - rowsData: [], //不动的数据列表 orgTree: [], orgId: '', orgType: 1, @@ -120,11 +118,11 @@ export default { methods: { //下一步 toNext() { - this.$emit('nextStep') + this.$emit('nextStep',this.selectedRowKeys) }, //上一步 toPrev() { - this.$emit('prevStep') + this.$emit('prevStep',this.selectedRowKeys) }, /** 表格行选中后触发 */ diff --git a/src/views/project/form/ProjectTestPaperFormationStrategy.vue b/src/views/project/form/ProjectTestPaperFormationStrategy.vue new file mode 100644 index 0000000..bcb23c4 --- /dev/null +++ b/src/views/project/form/ProjectTestPaperFormationStrategy.vue @@ -0,0 +1,62 @@ + + + + \ No newline at end of file diff --git a/src/views/project/form/Result.vue b/src/views/project/form/Result.vue new file mode 100644 index 0000000..5b0ca0b --- /dev/null +++ b/src/views/project/form/Result.vue @@ -0,0 +1,55 @@ + + + + \ No newline at end of file From cceaa92f8f399675a437b159ba30e1c1f9b6e11a Mon Sep 17 00:00:00 2001 From: Yuanjianghong Date: Sat, 20 Nov 2021 14:14:59 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AEForm=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/project/ProjectList.vue | 2 +- src/views/project/ProjectStepForm.vue | 21 +++++++++------- src/views/project/form/Result.vue | 35 +++++++++++++++++++-------- 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/views/project/ProjectList.vue b/src/views/project/ProjectList.vue index ab956ad..842e280 100644 --- a/src/views/project/ProjectList.vue +++ b/src/views/project/ProjectList.vue @@ -74,7 +74,7 @@ export default { data() { return { // 查询参数 - queryParam: {}, + queryParam: this.$route.query.queryParam || {}, // 表头 columns: [ { title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } }, diff --git a/src/views/project/ProjectStepForm.vue b/src/views/project/ProjectStepForm.vue index da3a124..71e0cf5 100644 --- a/src/views/project/ProjectStepForm.vue +++ b/src/views/project/ProjectStepForm.vue @@ -11,13 +11,13 @@
- - - - - - - + + + + + + +
@@ -60,6 +60,7 @@ export default { type: '', form: {}, result: true, + status: '', } }, methods: { @@ -81,7 +82,8 @@ export default { executeSave(childValue) { console.log('保存项目', childValue) if (true) { - this.currentTab = 8 + this.status = 'success' + this.currentTab = 5 } }, @@ -89,7 +91,8 @@ export default { executeIssue(childValue) { console.log('保存并发布项目', childValue) if (true) { - this.currentTab = 8 + this.status = 'error' + this.currentTab = 5 this.result = false } }, diff --git a/src/views/project/form/Result.vue b/src/views/project/form/Result.vue index 5b0ca0b..69b8c93 100644 --- a/src/views/project/form/Result.vue +++ b/src/views/project/form/Result.vue @@ -1,6 +1,9 @@ @@ -12,17 +15,17 @@ export default { // import引入的组件需要注入到对象中才能使用 components: {}, props: { - projectSaveStatus: { - type: String, - default: 'success' - } + projectSaveStatus: { + type: String, + default: 'success', + }, }, data() { // 这里存放数据 return { - // status: 'success', - title: '成华大道', - description: '走成华大道到二仙桥', + // status: 'success', + // title: '项目保存', + description: '请返回列表中查看', } }, // 计算属性 类似于data概念 @@ -30,7 +33,19 @@ export default { // 监控data中的数据变化 watch: {}, // 方法集合 - methods: {}, + methods: { + toPrev(){ + // this.$emit('prevStep',this.selectedRowKeys) + console.log('结果页返回修改') + this.$emit('prevStep', { tab: 1 }) + }, + toProjectList() { + this.$router.push({ + path: '/project/list', + query: {projectPageNum: 1,}, + }) + }, + }, // 生命周期 - 创建完成(可以访问当前this实例) created() {}, // 生命周期 - 挂载完成(可以访问DOM元素) From 4cf34a5ccc2d94e78ae06db2527d46bcb463013e Mon Sep 17 00:00:00 2001 From: hbzgyjh Date: Sun, 21 Nov 2021 01:59:40 +0800 Subject: [PATCH 4/4] =?UTF-8?q?'=E9=A1=B9=E7=9B=AE=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=9B=B4=E6=96=B0'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 2 +- src/views/project/ProjectStepForm.vue | 37 +++++++++++------- src/views/project/form/ProjectCourseList.vue | 38 ++++++++++++++++--- src/views/project/form/ProjectForm.vue | 9 ++--- src/views/project/form/ProjectPersonForm.vue | 20 ++++++++-- .../ProjectTestPaperFormationStrategy.vue | 16 +++++--- src/views/project/form/ProjectUnitSelect.vue | 10 +++-- src/views/project/form/Result.vue | 16 +++++--- 8 files changed, 105 insertions(+), 43 deletions(-) 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 }}