整合文件

This commit is contained in:
妖姐 2024-03-20 18:23:02 +08:00
parent d4e1226cfa
commit 8fea094cd4
3 changed files with 105 additions and 84 deletions

View File

@ -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,

View File

@ -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";

View File

@ -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 <template #icon>
size="large" <CommentOutlined />
class="bg-sky-300 flex flex-row items-center justify-center" </template>
shape="circle" <!-- 添加-->
@click="addModalOpen = true" <a-float-button @click="addModalOpen = true">
> <template #icon>
<template #icon> <PlusOutlined />
<PlusOutlined class=""/> </template>
</template> </a-float-button>
</a-button> <!-- 删除-->
<!-- <a-button @click="setupProj">999</a-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">-->
<!-- &lt;!&ndash; 这里显示错位 只好用flex &ndash;&gt;-->
<!-- <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>-->
<!-- &lt;!&ndash; <a-button @click="setupProj">999</a-button> &ndash;&gt;-->
<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"
@ -85,10 +83,10 @@
</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"/>
</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"/>
</a-form-item> </a-form-item>
<a-form-item label="状态"> <a-form-item label="状态">
<a-select <a-select
ref="select" ref="select"
@ -116,28 +114,38 @@
</a-upload> </a-upload>
</a-form-item> </a-form-item>
</a-form> </a-form>
<template #footer> <template #footer>
<a-button key="back" @click="addModalOpen=false">取消</a-button> <a-button key="back" @click="addModalOpen=false">取消</a-button>
<a-button key="submit" type="primary" <a-button key="submit" type="primary"
class="bg-sky-600" class="bg-sky-600"
@click="handleAdd(0)">新增</a-button> @click="handleAdd(0)">新增</a-button>
<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()
@ -295,11 +288,24 @@ 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
}) })
setupProj() if (routePath === '/WorkLoad/I_Responsible') {
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>