From 07bd75849cd9625f8499135f17529df549b29e2c Mon Sep 17 00:00:00 2001 From: wuyx Date: Wed, 2 Nov 2022 10:50:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=8D=95=E5=B1=82?= =?UTF-8?q?=E5=AD=90=E9=A1=B9=E7=9B=AE=E5=88=9B=E5=BB=BA=E6=97=B6=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BB=8F=E7=90=86=E4=B8=BA=E5=A4=9A=E4=B8=AA=E9=80=89?= =?UTF-8?q?=E6=8B=A9=EF=BC=8C=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 5 +- src/views/projectcenter/ProjectAdd.vue | 121 ++++++++++++++++++---- src/views/projectcenter/ProjectManage.vue | 44 ++++++-- 3 files changed, 141 insertions(+), 29 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 49ade8be..f1afd2ed 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -37,11 +37,8 @@ import http from "./config"; // 接口-请求 -// 创建编辑单层项目 +// 创建编辑单层项目(type=3)/ 多层项目(type=1)/ 多层子项目(type=2) export const createProject = (obj) => http.post('/admin/project/edit', obj) -// 创建多层项目 -export const createStoreyProject = (obj) => http.post('/admin/project/edit', obj) - // 获取项目列表 export const getProjectList = (obj) => http.post('/admin/project/list', obj) \ No newline at end of file diff --git a/src/views/projectcenter/ProjectAdd.vue b/src/views/projectcenter/ProjectAdd.vue index 42af2981..f8c46024 100644 --- a/src/views/projectcenter/ProjectAdd.vue +++ b/src/views/projectcenter/ProjectAdd.vue @@ -81,12 +81,12 @@
项目经理
-
+
@@ -97,8 +97,13 @@
资源归属
-
- +
+
@@ -126,8 +131,13 @@
项目级别
-
- +
+
@@ -135,8 +145,13 @@
培训体系
-
- +
+
@@ -177,9 +192,14 @@
-
模板
+
模版
- +
@@ -340,13 +360,66 @@ export default { let manager = ""; let managerId = ""; const classificationChange1 = (key) => { - console.log(`selected ${key}`); - console.log(classifyList1.value[key - 1].label) - manager = String(classifyList1.value[key - 1].label) - managerId = String(key) + console.log(`selected ${key}`, classifyList1); + let mstr = ''; + let midstr = ''; + for (let i = 0; i < key.length; i++) { + if (key.length - 1 !== i) { + midstr += key[i] + ','; + mstr += classifyList1.value[i].label + ','; + } else { + midstr += key[i]; + mstr += classifyList1.value[i].label; + } + } + console.log(mstr, midstr) + manager = mstr; + managerId = midstr; }; // 资源归属 sourceBelongId 后续给接口 + const classifyList2 = ref([ + { value: 1, label: '项目一' }, + { value: 2, label: '项目二' }, + { value: 3, label: '项目三' }, + ]); + + const classificationChange2 = (key) => { + console.log(`selected ${key}`, classifyList2); + } + + // 项目级别 + const classifyList3 = ref([ + { value: 1, label: '集团级' }, + { value: 2, label: '组织级' }, + { value: 3, label: '现地级' }, + { value: 4, label: '部门级' }, + ]); + const classificationChange3 = (key) => { + console.log(`selected ${key}`, classifyList3); + } + + // 培训体系 + const classifyList4 = ref([ + { value: 1, label: '集团级' }, + { value: 2, label: '组织级' }, + { value: 3, label: '现地级' }, + { value: 4, label: '部门级' }, + ]); + const classificationChange4 = (key) => { + console.log(`selected ${key}`, classifyList4); + } + + // 模版 + const classifyList5 = ref([ + { value: 1, label: '模版一' }, + { value: 2, label: '模版二' }, + { value: 3, label: '模版三' }, + { value: 4, label: '模版四' }, + ]); + const classificationChange5 = (key) => { + console.log(`selected ${key}`, classifyList5); + } // 项目说明 const remark = ref(''); @@ -438,10 +511,14 @@ export default { api.createProject(obj).then(res => { console.log(res) if (res.status == 200 && res.data.code == 200) { - router.push({ - path: '/taskpage', - query: { id: res.data.data.projectId } - }); + message.destroy(); + message.success("创建成功") + setTimeout(() => { + router.push({ + path: '/taskpage', + query: { id: res.data.data.projectId } + }); + }, 1000); } else { message.destroy(); message.error("创建失败,请检查当前网络状态。") @@ -459,6 +536,10 @@ export default { classifyList, classificationChange, classificationChange1, + classificationChange2, + classificationChange3, + classificationChange4, + classificationChange5, fileList, fileList1, loading, @@ -469,6 +550,10 @@ export default { beforeUpload1, onRangeChange, classifyList1, + classifyList2, + classifyList3, + classifyList4, + classifyList5, remark, changeChecked, changeChecked1, diff --git a/src/views/projectcenter/ProjectManage.vue b/src/views/projectcenter/ProjectManage.vue index cca9c989..7e334aed 100644 --- a/src/views/projectcenter/ProjectManage.vue +++ b/src/views/projectcenter/ProjectManage.vue @@ -477,6 +477,7 @@