修改路由跳一个界面
This commit is contained in:
parent
56ce86f2bf
commit
f483f2c10f
@ -15,7 +15,7 @@ const router = createRouter({
|
|||||||
{
|
{
|
||||||
path: '/Project',
|
path: '/Project',
|
||||||
name: 'Project',
|
name: 'Project',
|
||||||
component: () => import('@/views/ProjectPage/ProjectList.vue')
|
component: () => import('@/views/WorkLoadPage/I_Responsible.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/WorkLoad',
|
path: '/WorkLoad',
|
||||||
@ -34,7 +34,7 @@ const router = createRouter({
|
|||||||
//个人项目
|
//个人项目
|
||||||
path: '/WorkLoad/PersonalProject',
|
path: '/WorkLoad/PersonalProject',
|
||||||
name: 'WorkLoadPersonalProject',
|
name: 'WorkLoadPersonalProject',
|
||||||
component: () => import('@/views/WorkLoadPage/PersonalProject.vue'),
|
component: () => import('@/views/WorkLoadPage/I_Responsible.vue'),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -67,7 +67,7 @@ const router = createRouter({
|
|||||||
//我管理的项目
|
//我管理的项目
|
||||||
path: '/WorkLoad/I_Manage',
|
path: '/WorkLoad/I_Manage',
|
||||||
name: 'WordLoadI_Manage',
|
name: 'WordLoadI_Manage',
|
||||||
component: () => import('@/views/WorkLoadPage/I_Manage.vue'),
|
component: () => import('@/views/WorkLoadPage/I_Responsible.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
//我负责的项目
|
//我负责的项目
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<a-breadcrumb>
|
<a-breadcrumb>
|
||||||
<a-breadcrumb-item>我负责的</a-breadcrumb-item>
|
<!-- <a-breadcrumb-item>{{route.path}}</a-breadcrumb-item>-->
|
||||||
<!-- <a-breadcrumb-item><a href="">Application Center</a></a-breadcrumb-item>
|
<!-- <!– <a-breadcrumb-item><a href="">Application Center</a></a-breadcrumb-item>-->
|
||||||
<a-breadcrumb-item><a href="">Application List</a></a-breadcrumb-item>
|
<a-breadcrumb-item ><a href="">{{route.path}}</a></a-breadcrumb-item>
|
||||||
<a-breadcrumb-item>An Application</a-breadcrumb-item> -->
|
<!-- <a-breadcrumb-item>An Application</a-breadcrumb-item> –>-->
|
||||||
</a-breadcrumb>
|
</a-breadcrumb>
|
||||||
<div class="flex flex-row justify-between">
|
<div class="flex flex-row justify-between">
|
||||||
<div>
|
<div>
|
||||||
@ -41,13 +41,13 @@
|
|||||||
<EditOutlined />
|
<EditOutlined />
|
||||||
</template>
|
</template>
|
||||||
<!-- 添加-->
|
<!-- 添加-->
|
||||||
<a-float-button @click="addModalOpen = true">
|
<a-float-button @click="addModalOpen = true" title="增加">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</template>
|
</template>
|
||||||
</a-float-button>
|
</a-float-button>
|
||||||
<!-- 删除-->
|
<!-- 删除-->
|
||||||
<a-float-button @click="editModalOpen = true">
|
<a-float-button @click="editModalOpen = true" title="编辑">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<MinusOutlined />
|
<MinusOutlined />
|
||||||
</template>
|
</template>
|
||||||
@ -87,12 +87,11 @@
|
|||||||
<template v-else-if="column.dataIndex === 'operation'">
|
<template v-else-if="column.dataIndex === 'operation'">
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="Sure to delete?"
|
title="Sure to delete?"
|
||||||
@confirm="DeleteProject(record.key)"
|
@confirm="DeleteProject(record)"
|
||||||
class="text-red-500"
|
class="text-red-500"
|
||||||
okType="danger"
|
okType="danger"
|
||||||
cancelText="Cancel"
|
cancelText="Cancel"
|
||||||
ok-text="Delete"
|
ok-text="Delete"
|
||||||
|
|
||||||
>
|
>
|
||||||
<a>删除</a>
|
<a>删除</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
@ -106,21 +105,19 @@
|
|||||||
<!--新增项目-->
|
<!--新增项目-->
|
||||||
<a-modal v-model:open="addModalOpen" title="添加项目" @ok="">
|
<a-modal v-model:open="addModalOpen" title="添加项目" @ok="">
|
||||||
<a-form
|
<a-form
|
||||||
:label-col="labelCol"
|
|
||||||
:wrapper-col="wrapperCol"
|
|
||||||
layout="horizontal"
|
layout="horizontal"
|
||||||
style="max-width: 600px"
|
style="max-width: 600px"
|
||||||
>
|
>
|
||||||
<a-form-item label="项目名称">
|
<a-form-item label="项目名称">
|
||||||
<a-input v-model:value="addForm.name"/>
|
<a-input v-model:value="addForm.name" class="border-gray-200 rounded-lg w-[26vw]" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="周期" >
|
<a-form-item label="项目周期" >
|
||||||
<a-input v-model:value="addForm.cycle"/>
|
<a-input v-model:value="addForm.cycle" class="border-gray-200 rounded-lg w-[26vw]"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="工作量">
|
<a-form-item label="工作量">
|
||||||
<a-input v-model:value="addForm.workLoad"/>
|
<a-input v-model:value="addForm.workLoad" class="border-gray-200 rounded-lg ml-3 w-[26vw]"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="状态">
|
<a-form-item label="项目状态">
|
||||||
<a-select
|
<a-select
|
||||||
ref="select"
|
ref="select"
|
||||||
v-model:value="addForm.isFinish"
|
v-model:value="addForm.isFinish"
|
||||||
@ -135,7 +132,7 @@
|
|||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="项目描述">
|
<a-form-item label="项目描述">
|
||||||
<a-textarea v-model:value="addForm.description" placeholder="Basic usage" :rows="4" />
|
<a-textarea class=" w-[26vw]" v-model:value="addForm.description" placeholder="Basic usage" :rows="4" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="上传文档">
|
<a-form-item label="上传文档">
|
||||||
<a-upload
|
<a-upload
|
||||||
@ -187,7 +184,7 @@ const columns = [
|
|||||||
// // // 翻页
|
// // // 翻页
|
||||||
const pagination = computed(() => ({
|
const pagination = computed(() => ({
|
||||||
total: projList.value[0].length,
|
total: projList.value[0].length,
|
||||||
pageSize: 2,
|
pageSize: 5,
|
||||||
}));
|
}));
|
||||||
const editableData = reactive({});
|
const editableData = reactive({});
|
||||||
|
|
||||||
@ -197,11 +194,14 @@ const Id = reactive({
|
|||||||
// 删除项目
|
// 删除项目
|
||||||
function DeleteProject ( record) {
|
function DeleteProject ( record) {
|
||||||
console.log('单独删除成功9999999999999999999999999')
|
console.log('单独删除成功9999999999999999999999999')
|
||||||
Id.id = record.key
|
Id.id = record.id
|
||||||
console.log(Id.id)
|
console.log(Id.id)
|
||||||
request.projectDelete(Id,token).then((res) => {
|
request.projectDelete(Id.id,token).then((res) => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
message.success("删除成功")
|
message.success("删除成功")
|
||||||
|
flush()
|
||||||
|
// window.location.reload();
|
||||||
|
|
||||||
})
|
})
|
||||||
// projList.value = projList.value.filter(item => item.key !== key);
|
// projList.value = projList.value.filter(item => item.key !== key);
|
||||||
}
|
}
|
||||||
@ -229,6 +229,9 @@ const router=useRouter()
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
|
id:'',
|
||||||
|
is:1,
|
||||||
|
// id:null,
|
||||||
tags: [],
|
tags: [],
|
||||||
isFinish: [0, 1, 2, -1],
|
isFinish: [0, 1, 2, -1],
|
||||||
})
|
})
|
||||||
@ -299,9 +302,11 @@ const handleClickAll=(checked)=>{
|
|||||||
selectTags.value[index]=false
|
selectTags.value[index]=false
|
||||||
})
|
})
|
||||||
// 发送获取全部数据的请求
|
// 发送获取全部数据的请求
|
||||||
request.projectGet(token).then(res=>{
|
// request.projectGet(token).then(res=>{
|
||||||
console.log(res.data.data)
|
//
|
||||||
})
|
// console.log(res.data.data)
|
||||||
|
// })
|
||||||
|
flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -378,7 +383,7 @@ watch(() =>data.isFinish, async (newValue, oldValue) =>{
|
|||||||
const setupProj=()=>{
|
const setupProj=()=>{
|
||||||
|
|
||||||
request.projectGet(data, token).then(res=>{
|
request.projectGet(data, token).then(res=>{
|
||||||
console.log("res",res)
|
// console.log("res",res)
|
||||||
projList.value=res.data.data
|
projList.value=res.data.data
|
||||||
for (let i = 0; i < projList.value.length; i++) {
|
for (let i = 0; i < projList.value.length; i++) {
|
||||||
if (projList.value[i].tags === undefined || projList.value[i].tags === '') {
|
if (projList.value[i].tags === undefined || projList.value[i].tags === '') {
|
||||||
@ -413,12 +418,13 @@ flush()
|
|||||||
function flush() {
|
function flush() {
|
||||||
// 设置标签
|
// 设置标签
|
||||||
request.getTagsProjectList(token).then(res=>{
|
request.getTagsProjectList(token).then(res=>{
|
||||||
console.log(res.data.data)
|
// console.log(res.data.data)
|
||||||
tagsData.value=res.data.data
|
tagsData.value=res.data.data
|
||||||
})
|
})
|
||||||
if (routePath === '/WorkLoad/I_Responsible') {
|
if (routePath === '/WorkLoad/I_Responsible') {
|
||||||
setupProj()
|
setupProj()
|
||||||
} else if (routePath === '/WorkLoad/I_Manage'){
|
} else if (routePath === '/WorkLoad/I_Manage')
|
||||||
|
{
|
||||||
request.projectWorkGet(data, token).then((res) => {
|
request.projectWorkGet(data, token).then((res) => {
|
||||||
projList.value = res.data.data;
|
projList.value = res.data.data;
|
||||||
for (let i = 0; i < projList.value.length; i++) {
|
for (let i = 0; i < projList.value.length; i++) {
|
||||||
@ -429,6 +435,30 @@ function flush() {
|
|||||||
}
|
}
|
||||||
console.log("projects:",projList.value)
|
console.log("projects:",projList.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}else if ( routePath === '/Project')
|
||||||
|
{
|
||||||
|
// console.log(6666666666666666666)
|
||||||
|
request.projectGetCustom(data).then((res)=>{
|
||||||
|
projList.value = res.data.data;
|
||||||
|
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)
|
||||||
|
|
||||||
|
})
|
||||||
|
// loading.value = true;
|
||||||
|
// console.log('zmhuisss',loading.value)
|
||||||
|
}
|
||||||
|
else if (routePath === '/WorkLoad/PersonalProject' ){
|
||||||
|
request.projectWorkGet(data,token).then((res)=>{
|
||||||
|
projList.value = res.data.data;
|
||||||
|
console.log("成功了:",projList.value)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user