整合文件

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 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({
url:api+ "/project/get"+url,
url:api+ `/project/get/${queryTags}&${queryIsFinish}`,
method: "get",
headers:{
'Authorization':'Bearer '+token,

View File

@ -1,5 +1,5 @@
<template>
<a-card hoverable style="width: 30vw; margin: 30px;" :loading="false">
<a-card hoverable style="width: 28vw; margin: 30px;" :loading="false">
<template #title>
<div style="display: flex; flex-direction: row">
<div style="display: flex; flex-direction: row; width: 18vw">
@ -66,7 +66,15 @@
<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";

View File

@ -30,49 +30,47 @@
:options="checkboxOptions" />
</div>
</div>
<div class="flex flex-row flex-wrap">
<div class="flex flex-wrap justify-start ">
<ProjectCard
class="!w-80"
v-for="proj in projList" v-bind="proj" @click="handleCardClick(proj.id)"></ProjectCard>
<!-- <a-card hoverable-->
<!-- 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>-->
class=""
v-for="proj in projList" v-bind="proj" @click=" console.log('routePath',routePath)
"></ProjectCard>
</div>
<a-tooltip title="添加" class="fixed bottom-0 right-0 m-16">
<!-- 这里显示错位 只好用flex -->
<a-button
size="large"
class="bg-sky-300 flex flex-row items-center justify-center"
shape="circle"
@click="addModalOpen = true"
>
<template #icon>
<PlusOutlined class=""/>
</template>
</a-button>
<!-- <a-button @click="setupProj">999</a-button> -->
<a-float-button-group v-show="routePath === '/WorkLoad/I_Responsible'" trigger="hover" type="primary" :style="{ right: '94px' }">
<!-- 菜单-->
<template #icon>
<CommentOutlined />
</template>
<!-- 添加-->
<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">-->
<!-- &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-form
:label-col="labelCol"
@ -85,10 +83,10 @@
</a-form-item>
<a-form-item label="周期" >
<a-input v-model:value="addForm.cycle"/>
</a-form-item>
</a-form-item>
<a-form-item label="工作量">
<a-input v-model:value="addForm.workLoad"/>
</a-form-item>
</a-form-item>
<a-form-item label="状态">
<a-select
ref="select"
@ -116,28 +114,38 @@
</a-upload>
</a-form-item>
</a-form>
<template #footer>
<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"
@click="handleAdd(0)">新增</a-button>
<a-button key="submit" class="bg-sky-600" type="primary" @click="handleAdd(1)">新增并发布</a-button>
</template>
</a-modal>
</a-tooltip>
<!-- </a-tooltip>-->
</template>
<script setup>
import {onMounted, ref, watchEffect} from 'vue';
import {PlusOutlined} from '@ant-design/icons-vue';
import {useRouter} from "vue-router";
import {onMounted, reactive, ref} from 'vue';
import {CommentOutlined, MinusOutlined, PlusOutlined} from '@ant-design/icons-vue';
import {useRoute, useRouter} from "vue-router";
import request from '@/js/request';
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 route = useRoute()
const data = reactive({
tags: [],
isFinish: [0, 1, 2, -1],
})
///WorkLoad/I_Responsible
const routePath = route.path
//
const tagsData = ref([]);
@ -245,31 +253,7 @@ const handleCardClick=(id)=>{
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=>{
console.log("res",res)
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
onMounted(()=>{
flush()
@ -295,11 +288,24 @@ flush()
)
function flush() {
//
request.getTagsProjectList(token).then(res=>{
console.log(res.data.data)
tagsData.value=res.data.data
})
setupProj()
//
request.getTagsProjectList(token).then(res=>{
console.log(res.data.data)
tagsData.value=res.data.data
})
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>