From c1faa8ac903911470dc387e68a35c0cce1f269eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A6=96=E5=A7=90?= <2981176548@qq.com>
Date: Thu, 21 Mar 2024 20:36:38 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8A=9F=E8=83=BD=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/router/index.js | 2 +-
src/views/ProjectPage/MainMessageCustom.vue | 6 ++-
src/views/WorkLoadPage/I_Responsible.vue | 51 +++++++++++++--------
3 files changed, 39 insertions(+), 20 deletions(-)
diff --git a/src/router/index.js b/src/router/index.js
index 43acdf8..9f0507f 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -130,7 +130,7 @@ const router = createRouter({
},
{
- path: '/ProjectMessage',
+ path: '/ProjectMessage/:id',
name: 'MainMessageCustom',
component: () => import('@/views/ProjectPage/MainMessageCustom.vue')
},
diff --git a/src/views/ProjectPage/MainMessageCustom.vue b/src/views/ProjectPage/MainMessageCustom.vue
index 46403ad..eff067e 100644
--- a/src/views/ProjectPage/MainMessageCustom.vue
+++ b/src/views/ProjectPage/MainMessageCustom.vue
@@ -15,9 +15,13 @@ import BasicProject from "@/views/ProjectPage/MainMessage/BasicProject.vue";
import BottomMessage from "@/views/ProjectPage/MainMessage/BottomMessage.vue";
import {onMounted, reactive, ref} from "vue";
import request from "@/js/request.js";
+import {useRoute} from "vue-router";
const projects = ref();
-const id = window.localStorage.getItem('id')
+const route = useRoute()
+const id = route.params.id
+
+// const id = window.localStorage.getItem('id')
const data = reactive({
id: id,
tags: [],
diff --git a/src/views/WorkLoadPage/I_Responsible.vue b/src/views/WorkLoadPage/I_Responsible.vue
index 223454b..1a3920f 100644
--- a/src/views/WorkLoadPage/I_Responsible.vue
+++ b/src/views/WorkLoadPage/I_Responsible.vue
@@ -31,12 +31,12 @@
+ v-for="proj in projList" v-bind="proj" @click="RouterPath(proj.id)">
-
+
@@ -71,7 +71,7 @@
-
+
@@ -123,7 +123,7 @@
v-model:value="addForm.isFinish"
style="width: 120px"
@focus="focus"
- @change="handleChange"
+
>
未开始
进行中
@@ -206,6 +206,7 @@ function DeleteProject ( record) {
// projList.value = projList.value.filter(item => item.key !== key);
}
function DeleteProjects(){
+ editModalOpen.value = false
console.log('全部删除成功')
}
// 复选
@@ -301,12 +302,7 @@ const handleClickAll=(checked)=>{
selectTags.value.forEach((item,index)=>{
selectTags.value[index]=false
})
- // 发送获取全部数据的请求
- // request.projectGet(token).then(res=>{
- //
- // console.log(res.data.data)
- // })
- flush()
+ selectedTags.value = []
}
}
@@ -349,17 +345,18 @@ const handleAdd=(publish)=>{
addForm.value.file='{}'
console.log("addForm",addForm.value)
request.projectAdd(token,addForm.value).then(res=>{
-
if (res.data.code === 200) {
//添加成功!
//新增成功
+ // addModalOpen.value = false
message.success("新增模块成功")
//清空数据
- addForm.description = ''
- addForm.name = ''
- addForm.cycle = ''
- addForm.status = ''
- addForm.isFinish = ''
+ addForm.value.description = '';
+ addForm.value.name = '';
+ addForm.value.cycle = '';
+ addForm.value.status = '';
+ addForm.value.isFinish = '';
+ addForm.value.workLoad ='';
//刷新页面
flush()
}
@@ -372,7 +369,7 @@ watch(() => selectedTags.value.length, async (newValue, oldValue) =>{
selectedTags.value.forEach((item,index)=>{
data.tags.push(item)
})
- console.log(selectedTags)
+ // console.log(selectedTags)
flush()
})
watch(() =>data.isFinish, async (newValue, oldValue) =>{
@@ -456,9 +453,27 @@ function flush() {
else if (routePath === '/WorkLoad/PersonalProject' ){
request.projectWorkGet(data,token).then((res)=>{
projList.value = res.data.data;
- console.log("成功了:",projList.value)
+ console.log("成功了:",projList.value[0].id)
+ for (let i = 0; i < projList.value.length; i++) {
+ if (projList.value[i].tags === undefined || projList.value[i].tags === '') {
+ continue
+ }
+ projList.value[i].tags = JSON.parse(projList.value[i].tags).tags
+ }
+ console.log('查询到的所有项目88888',projList.value)
})
}
}
+
+
+function RouterPath (id){
+
+ if(route.path ==="/Project"){
+ router.push('/ProjectMessage/'+id)
+ }else {
+ router.push('/WorkLoad/I_Responsible/ChildSystem/'+id)
+ }
+
+}
\ No newline at end of file