获取个人项目信息

This commit is contained in:
妖姐 2024-03-14 23:50:09 +08:00
parent cd1819385b
commit 3b4b566f8f
3 changed files with 73 additions and 42 deletions

View File

@ -37,17 +37,17 @@
</template>
<div class="flex flex-col space-y-4 mb-4 ">
<span class="lg:hover:text-blue-700" @click="JumpMessage" ><MailOutlined class="mr-1.5"/>消息</span>
<span class="lg:hover:text-blue-700" @click="JumpDailyPaper"><BellOutlined class="mr-1.5"/>日报</span>
<span class="lg:hover:text-blue-700 cursor-pointer" @click="JumpMessage" ><MailOutlined class="mr-1.5"/>消息</span>
<span class="lg:hover:text-blue-700 cursor-pointer" @click="JumpDailyPaper"><BellOutlined class="mr-1.5"/>日报</span>
</div>
<div class="flex flex-col space-y-4">
<hr class="mb-2">
<span class="lg:hover:text-blue-700" @click="JumpPersonalProject"><UserOutlined class="mr-1.5"/>我的项目</span>
<span class="lg:hover:text-blue-700" @click="JumpMyManage"><ToolOutlined class="mr-1.5"/>我管理的</span>
<span v-if="user.role === true" class=" lg:hover:text-blue-700" @click="JumpMyResponsible" ><UserOutlined class="mr-1.5" />我负责的</span>
<span class="lg:hover:text-blue-700 cursor-pointer" @click="JumpPersonalProject"><UserOutlined class="mr-1.5"/>我的项目</span>
<span class="lg:hover:text-blue-700 cursor-pointer" @click="JumpMyManage"><ToolOutlined class="mr-1.5"/>我管理的</span>
<span v-if="user.role === true" class=" lg:hover:text-blue-700 cursor-pointer" @click="JumpMyResponsible" ><UserOutlined class="mr-1.5" />我负责的</span>
<hr>
<span class=" lg:hover:text-blue-700" @click="JumpPersonalInformation"><MessageOutlined class="mr-1.5" />个人信息管理</span>
<span class=" lg:hover:text-blue-700 cursor-pointer" @click="JumpPersonalInformation"><MessageOutlined class="mr-1.5" />个人信息管理</span>
<!-- <div v-if="role === true" class="flex flex-col space-y-4">-->
<!-- <hr>-->
@ -55,7 +55,7 @@
<!-- </div>-->
</div>
<span @click="exitLogin" class="bg-gray-50 lg:hover:text-blue-400 text-lg bottom-2 fixed right-2">退出登录</span>
<span @click="exitLogin" class="bg-gray-50 lg:hover:text-blue-400 text-lg bottom-2 fixed right-2 cursor-pointer">退出登录</span>
</a-drawer>
</div>

View File

@ -129,7 +129,7 @@
</a>
</li>
<li>
<a class="text-gray-900 custom-link" href="/WorkLoad/I_Responsible">
<a class="text-gray-900 custom-link" href="/WorkLoad/I_Responsible" v-if="user.role===true">
<div class="flex">
<svg aria-hidden="true" class="w-5 h-5 text-gray-800 dark:text-white" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M20 6H10m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4m16 6h-2m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4m16 6H10m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4" stroke="currentColor" stroke-linecap="round" stroke-width="2"/>
@ -158,10 +158,10 @@
}
</style>
<script setup>
import colors from "tailwindcss/colors.js";
import {ref} from "vue";
import {onMounted, reactive, ref} from "vue";
import requests from "@/js/request.js";
const isDropdownOpen = ref(false)
const isDropdownOpen = ref(false)
const textColor = ref('black')
// function colors() {
// return colors
@ -173,4 +173,26 @@ const textColor = ref('black')
// //
// textColor.value = 'blue';
// }
//
const user = reactive({
role:false,
})
const token = window.localStorage.getItem('token')
onMounted(() => {
requests.userGetProfile(token).then((res)=>{
console.log(res)
if (res.data.code === 200) {
if (res.data.data.role === '老师') {
//
user.role =true
} else {
console.log('这不是老师');
//
user.role= false
}
}else {
}
})
})
</script>

View File

@ -24,30 +24,33 @@
</div>
</div>
<div class="flex space-x-9 ml-16 mt-12">
<a-card class="transition-transform transform-gpu hover:scale-105 relative w-[350px] h-64 rounded-none bg-cover bg-center bg-[url('@/assert/images/img25.jpg')]" @mouseleave="LearnMore1=false" @mouseover="LearnMore1=true">
<div class="flex absolute left-0 bottom-0 min-h-[30%] w-full bg-white">
<p class="ml-6 mt-4 text-lg font-bold tracking-tight text-gray-900">梁溪区纪委大数据管理平台项目</p>
<div class="ml-auto mr-10">
<button v-if="LearnMore1" class="mt-8 w-6 h-6 flex items-center justify-center bg-green-400 text-black rounded-full transition duration-300 ease-in-out transform hover:scale-105">
<svg aria-hidden="true" class="rtl:rotate-180 w-4 h-4 text-white" fill="none" viewBox="0 0 14 10" xmlns="http://www.w3.org/2000/svg">
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
</svg>
</button>
</div>
</div>
</a-card>
<a-card class="transition-transform transform-gpu hover:scale-105 relative w-[350px] h-64 rounded-none bg-cover bg-center bg-[url('@/assert/images/img26.jpg')]" @mouseleave="LearnMore2=false" @mouseover="LearnMore2=true">
<div class="flex absolute left-0 bottom-0 min-h-[30%] w-full bg-white">
<p class="ml-6 mt-4 text-lg font-bold tracking-tight text-gray-900">梁溪区纪委大数据管理平台项目</p>
<div class="ml-auto mr-10">
<button v-if="LearnMore2" class="mt-8 w-6 h-6 flex items-center justify-center bg-green-400 text-black rounded-full transition duration-300 ease-in-out transform hover:scale-105">
<svg aria-hidden="true" class="rtl:rotate-180 w-4 h-4 text-white" fill="none" viewBox="0 0 14 10" xmlns="http://www.w3.org/2000/svg">
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
</svg>
</button>
</div>
</div>
</a-card>
<template v-for="(project, index) in projects.value" :key="index">
<a-card class="transition-transform transform-gpu hover:scale-105 relative w-[24vw] h-60 mb-4 rounded-none bg-cover bg-center bg-[url('@/assert/images/img12.jpg')]" @mouseleave="showButton[index]=false" @mouseover="showButton[index]=true">
<div class="flex absolute left-0 bottom-0 min-h-[30%] w-full bg-white">
<p class="ml-6 mt-4 text-lg font-bold tracking-tight text-gray-900">{{ project.name }}</p>
<div class="ml-auto mr-10">
<button v-if="showButton[index]" class="mt-8 w-6 h-6 flex items-center justify-center bg-green-400 text-black rounded-full transition duration-300 ease-in-out transform hover:scale-105" @click="MainMessage(project)">
<svg aria-hidden="true" class="rtl:rotate-180 w-4 h-4 text-white" fill="none" viewBox="0 0 14 10" xmlns="http://www.w3.org/2000/svg">
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
</svg>
</button>
</div>
</div>
</a-card>
</template>
<!-- <a-card class="transition-transform transform-gpu hover:scale-105 relative w-[350px] h-64 rounded-none bg-cover bg-center bg-[url('@/assert/images/img26.jpg')]" @mouseleave="LearnMore2=false" @mouseover="LearnMore2=true">-->
<!-- <div class="flex absolute left-0 bottom-0 min-h-[30%] w-full bg-white">-->
<!-- <p class="ml-6 mt-4 text-lg font-bold tracking-tight text-gray-900">梁溪区纪委大数据管理平台项目</p>-->
<!-- <div class="ml-auto mr-10">-->
<!-- <button v-if="LearnMore2" class="mt-8 w-6 h-6 flex items-center justify-center bg-green-400 text-black rounded-full transition duration-300 ease-in-out transform hover:scale-105">-->
<!-- <svg aria-hidden="true" class="rtl:rotate-180 w-4 h-4 text-white" fill="none" viewBox="0 0 14 10" xmlns="http://www.w3.org/2000/svg">-->
<!-- <path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>-->
<!-- </svg>-->
<!-- </button>-->
<!-- </div>-->
<!-- </div>-->
<!-- </a-card>-->
<a-card class="transition-transform transform-gpu hover:scale-105 relative w-[350px] h-64 rounded-none bg-cover bg-center bg-[url('@/assert/images/img27.jpg')]" @mouseleave="LearnMore3=false" @mouseover="LearnMore3=true">
<div class="flex absolute left-0 bottom-0 min-h-[30%] w-full bg-white">
<p class="ml-6 mt-4 text-lg font-bold tracking-tight text-gray-900">梁溪区纪委大数据管理平台项目</p>
@ -73,7 +76,7 @@
<script setup>
import {onMounted, ref} from "vue";
import {onMounted, reactive, ref} from "vue";
import request from '@/js/request.js'
const LearnMore1 = ref(false)
@ -86,22 +89,28 @@ const projStatus = ref();
const tagAll=ref(true)
const tagsData = ref([]);
const selectTags = ref([false, false, false, false]);
const data =reactive({
is:1
})
const projects =ref([])
onMounted(
()=>{
//
request.getTagsProjectList(token).then(res=>{
console.log(res.data.data)
// console.log(res.data.data)
tagsData.value=res.data.data
})
//
request.projectGet(token).then(res=>{
console.log(res)
})
getMyselfProject()
}
)
function getMyselfProject(){
request.projectWorkGet(data.is,token).then((res)=>{
projects.value = res.data.data;
console.log("成功了:",projects.value)
})
}
//
const handleClickAll=(checked)=>{