整合文件
This commit is contained in:
parent
d4e1226cfa
commit
8fea094cd4
@ -501,12 +501,19 @@ const infoEditSettingHeaderImage = (showType, token) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 展示我负责的项目
|
* 展示我负责的项目
|
||||||
|
* @param data
|
||||||
* @param token
|
* @param token
|
||||||
* @param url
|
|
||||||
*/
|
*/
|
||||||
const projectGet =(token,url) => {
|
const projectGet =(data, token) => {
|
||||||
|
const tags = data.tags
|
||||||
|
const isFinish = data.isFinish
|
||||||
|
// const principalUser = data.principalId
|
||||||
|
const encodedTags = tags.map(tag => encodeURIComponent(tag));
|
||||||
|
const encodedIsFinish = isFinish.map(is => encodeURIComponent(is))
|
||||||
|
const queryTags = `tags=${encodedTags.join('&tags=')}`;
|
||||||
|
const queryIsFinish = `isFinish=${encodedIsFinish.join('&isFinish=')}`;
|
||||||
return axios({
|
return axios({
|
||||||
url:api+ "/project/get"+url,
|
url:api+ `/project/get/${queryTags}&${queryIsFinish}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
headers:{
|
headers:{
|
||||||
'Authorization':'Bearer '+token,
|
'Authorization':'Bearer '+token,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-card hoverable style="width: 30vw; margin: 30px;" :loading="false">
|
<a-card hoverable style="width: 28vw; margin: 30px;" :loading="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div style="display: flex; flex-direction: row">
|
<div style="display: flex; flex-direction: row">
|
||||||
<div style="display: flex; flex-direction: row; width: 18vw">
|
<div style="display: flex; flex-direction: row; width: 18vw">
|
||||||
@ -66,7 +66,15 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
import {ArrowRightOutlined, SmileTwoTone, CheckCircleTwoTone, ScheduleTwoTone, SyncOutlined, PlayCircleOutlined, InfoCircleOutlined} from "@ant-design/icons-vue";
|
import {
|
||||||
|
ArrowRightOutlined,
|
||||||
|
CheckCircleTwoTone,
|
||||||
|
InfoCircleOutlined,
|
||||||
|
PlayCircleOutlined,
|
||||||
|
ScheduleTwoTone,
|
||||||
|
SmileTwoTone,
|
||||||
|
SyncOutlined
|
||||||
|
} from "@ant-design/icons-vue";
|
||||||
import {h} from "vue";
|
import {h} from "vue";
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,49 +30,47 @@
|
|||||||
:options="checkboxOptions" />
|
:options="checkboxOptions" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row flex-wrap">
|
<div class="flex flex-wrap justify-start ">
|
||||||
<ProjectCard
|
<ProjectCard
|
||||||
class="!w-80"
|
class=""
|
||||||
v-for="proj in projList" v-bind="proj" @click="handleCardClick(proj.id)"></ProjectCard>
|
v-for="proj in projList" v-bind="proj" @click=" console.log('routePath',routePath)
|
||||||
<!-- <a-card hoverable-->
|
"></ProjectCard>
|
||||||
<!-- v-for="proj in projList"-->
|
|
||||||
<!-- class="w-80 mb-4"-->
|
|
||||||
<!-- @click="handleCardClick(proj.id)"-->
|
|
||||||
<!-- >-->
|
|
||||||
<!-- <template #cover>-->
|
|
||||||
<!-- <img alt="example" class="h-40" src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png" />-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- <a-card-meta :title="proj.name">-->
|
|
||||||
|
|
||||||
<!-- <template #description>-->
|
|
||||||
<!-- <div class="flex flex-row justify-between">-->
|
|
||||||
<!-- <div>-->
|
|
||||||
<!-- <p>周期: {{proj.cycle}}</p>-->
|
|
||||||
<!-- <p>工作量: {{proj.workload}}</p>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- <div>-->
|
|
||||||
<!-- <p>状态: {{proj.isFinish}}</p>-->
|
|
||||||
<!-- <p>负责人: {{proj.principalId}}</p>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </a-card-meta>-->
|
|
||||||
<!-- </a-card>-->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<a-tooltip title="添加" class="fixed bottom-0 right-0 m-16">
|
<a-float-button-group v-show="routePath === '/WorkLoad/I_Responsible'" trigger="hover" type="primary" :style="{ right: '94px' }">
|
||||||
<!-- 这里显示错位 只好用flex -->
|
<!-- 菜单-->
|
||||||
<a-button
|
|
||||||
size="large"
|
|
||||||
class="bg-sky-300 flex flex-row items-center justify-center"
|
|
||||||
shape="circle"
|
|
||||||
@click="addModalOpen = true"
|
|
||||||
>
|
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined class=""/>
|
<CommentOutlined />
|
||||||
</template>
|
</template>
|
||||||
</a-button>
|
<!-- 添加-->
|
||||||
<!-- <a-button @click="setupProj">999</a-button> -->
|
<a-float-button @click="addModalOpen = true">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
</a-float-button>
|
||||||
|
<!-- 删除-->
|
||||||
|
<a-float-button>
|
||||||
|
<template #icon>
|
||||||
|
<MinusOutlined />
|
||||||
|
</template>
|
||||||
|
</a-float-button>
|
||||||
|
</a-float-button-group>
|
||||||
|
<!-- <a-tooltip title="添加" class="fixed bottom-0 right-0 m-16">-->
|
||||||
|
<!-- <!– 这里显示错位 只好用flex –>-->
|
||||||
|
<!-- <div class="flex flex-row">-->
|
||||||
|
<!-- <a-button-->
|
||||||
|
<!-- size="large"-->
|
||||||
|
<!-- class="bg-sky-300 flex flex-row items-center justify-center mr-2"-->
|
||||||
|
<!-- shape="circle"-->
|
||||||
|
<!-- @click="addModalOpen = true"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <template #icon>-->
|
||||||
|
<!-- <PlusOutlined class=""/>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
|
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <!– <a-button @click="setupProj">999</a-button> –>-->
|
||||||
<a-modal v-model:open="addModalOpen" title="添加项目" @ok="handleOk">
|
<a-modal v-model:open="addModalOpen" title="添加项目" @ok="handleOk">
|
||||||
<a-form
|
<a-form
|
||||||
:label-col="labelCol"
|
:label-col="labelCol"
|
||||||
@ -126,18 +124,28 @@
|
|||||||
<a-button key="submit" class="bg-sky-600" type="primary" @click="handleAdd(1)">新增并发布</a-button>
|
<a-button key="submit" class="bg-sky-600" type="primary" @click="handleAdd(1)">新增并发布</a-button>
|
||||||
</template>
|
</template>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</a-tooltip>
|
|
||||||
|
<!-- </a-tooltip>-->
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {onMounted, ref, watchEffect} from 'vue';
|
import {onMounted, reactive, ref} from 'vue';
|
||||||
import {PlusOutlined} from '@ant-design/icons-vue';
|
import {CommentOutlined, MinusOutlined, PlusOutlined} from '@ant-design/icons-vue';
|
||||||
import {useRouter} from "vue-router";
|
import {useRoute, useRouter} from "vue-router";
|
||||||
|
|
||||||
import request from '@/js/request';
|
import request from '@/js/request';
|
||||||
import ProjectCard from "@/views/ProjectPage/MainMessage/ProjectCard.vue";
|
import ProjectCard from "@/views/ProjectPage/MainMessage/ProjectCard.vue";
|
||||||
import {message} from "ant-design-vue";
|
import {message, Modal} from "ant-design-vue";
|
||||||
|
|
||||||
const router=useRouter()
|
const router=useRouter()
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
const data = reactive({
|
||||||
|
tags: [],
|
||||||
|
isFinish: [0, 1, 2, -1],
|
||||||
|
})
|
||||||
|
|
||||||
|
//我负责的路径:/WorkLoad/I_Responsible
|
||||||
|
const routePath = route.path
|
||||||
|
|
||||||
// 完整的标签列表
|
// 完整的标签列表
|
||||||
const tagsData = ref([]);
|
const tagsData = ref([]);
|
||||||
@ -245,31 +253,7 @@ const handleCardClick=(id)=>{
|
|||||||
|
|
||||||
|
|
||||||
const setupProj=()=>{
|
const setupProj=()=>{
|
||||||
let tags=[] //taglist 全为string
|
|
||||||
selectTags.value.map((item,index)=>{
|
|
||||||
if(item){
|
|
||||||
tags.push(tagsData.value[index].name)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
console.log(tags);
|
|
||||||
// 如果全选
|
|
||||||
if(tagAll.value){
|
|
||||||
tags=tagsData.value.map((item,index)=>{
|
|
||||||
return item.name
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const encodedTags = tags.map(tag => encodeURIComponent(tag));
|
|
||||||
|
|
||||||
// 判断状态
|
|
||||||
let status=[]
|
|
||||||
projCheckbox.value.map((item,index)=>{
|
|
||||||
if(item){
|
|
||||||
status.push(index)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const encoedStatus=status.map(item=>encodeURIComponent(item))
|
|
||||||
|
|
||||||
const url = `?tags=${encodedTags}&status=${encoedStatus}`
|
|
||||||
request.projectGet(token,url).then(res=>{
|
request.projectGet(token,url).then(res=>{
|
||||||
console.log("res",res)
|
console.log("res",res)
|
||||||
projList.value=res.data.data
|
projList.value=res.data.data
|
||||||
@ -288,6 +272,15 @@ const setupProj=()=>{
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 删除弹窗
|
||||||
|
const error = () => {
|
||||||
|
Modal.error({
|
||||||
|
title: 'This is an error message',
|
||||||
|
content: 'some messages...some messages...',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 当组件挂载时 请求tag数据
|
// 当组件挂载时 请求tag数据
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
flush()
|
flush()
|
||||||
@ -300,6 +293,19 @@ function flush() {
|
|||||||
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') {
|
||||||
setupProj()
|
setupProj()
|
||||||
|
} 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++) {
|
||||||
|
if (projList.value[i].tags === undefined || projList.value[i].tags === '') {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
projList.value[i].tags = JSON.parse(projList.value[i].tags).tags
|
||||||
|
}
|
||||||
|
console.log("projects:",projList.value)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user