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