获取项目信息1

This commit is contained in:
妖姐 2024-03-11 22:46:51 +08:00
parent f5431ad85e
commit a661825091
3 changed files with 80 additions and 225 deletions

View File

@ -77,6 +77,7 @@
<a aria-current="page" class="block py-2 px-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-500 md:p-0" href="/" onclick="changeColor('home')">
首页
</a>
</li>
<li>
<a class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0" href="/Project" onclick="changeColor('projects')">
@ -182,6 +183,10 @@ function exitLogin(){
onMounted(() => {
requests.userGetProfile(token).then((res)=>{
console.log(res)
// if(token ===null){
// router.push('/')
// }
// else{
if (res.data.code === 200) {
//
isLoggedIn.value = true; //
@ -193,18 +198,17 @@ onMounted(() => {
console.log('这是老师');
//
role.value =true
} else {
console.log('这不是老师');
//
role.value= false
}
}else {
//
message.error("用户过期,请重新登录!")
router.push("/login")
// message.error("")
// router.push("/login")
}
// }
})
})

View File

@ -508,7 +508,7 @@ const projectGet =(token) => {
return axios({
url:api+ "/project/get",
method: "get",
header:{
headers:{
'Authorization':'Bearer '+token,
'Timestamp': getCurrentTimestamp()
}

View File

@ -1,53 +1,24 @@
<template>
<div class="w-full min-h-screen mt-2">
<div class="container mx-auto w-3/4">
<nav class="bg-white border-gray-200">
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
<div id="navbar-default" class="w-full md:block md:w-auto">
<ul class="font-medium flex flex-col p-4 md:p-0 mt-4 border border-gray-100 rounded-lg bg-gray-50 md:flex-row md:space-x-8 rtl:space-x-reverse md:mt-0 md:border-0 md:bg-white">
<li>
<a aria-current="page" class="block py-2 px-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0" href="#">全部</a>
</li>
<li>
<a class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0" href="#">Web</a>
</li>
<li>
<a class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0" href="#">Ai</a>
</li>
<li>
<a class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0" href="#">App</a>
</li>
<li>
<a class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0" href="#">大数据</a>
</li>
<div class="relative h-full bg-gray-50 flex">
<div class="mt-12">
<nav class="ml-16 flex space-x-72">
<ul class="flex space-x-24">
<li class="hover:text-blue-500">全部</li>
<li class="hover:text-blue-500">Web</li>
<li class="hover:text-blue-500">Ai</li>
<li class="hover:text-blue-500">App</li>
</ul>
</div>
<div class="text-gray-800 flex space-x-5">
<!-- <label>-->
<!-- <input type="checkbox" class="border border-gray-300 rounded"/>-->
<!-- 未开始-->
<!-- </label>-->
<!-- <label>-->
<!-- <input type="checkbox"/>-->
<!-- 进行中-->
<!-- </label>-->
<!-- <label>-->
<!-- <input type="checkbox"/>-->
<!-- 已完成-->
<!-- </label>-->
<ul class="flex space-x-12 ">
<a-checkbox>未开始</a-checkbox>
<a-checkbox>进行中</a-checkbox>
<a-checkbox>已完成</a-checkbox>
</div>
</div>
</ul>
</nav>
<div class="w-full h-full mt-2">
<div class="flex flex-col mx-auto space-y-8">
<div class="flex space-x-12">
<div class="flex-1 relative transition-transform transform-gpu hover:scale-105 border-gray-400 shadow-lg h-80 w-1/4 bg-cover bg-center bg-[url('@/assert/images/img21.jpg')]" @mouseleave="LearnMore1=false" @mouseover="LearnMore1=true">
<div class="flex items-center">
<div :class="{'bg-white':LearnMore1}" class="flex absolute bottom-0 min-h-[30%] w-full">
<h5 v-if="LearnMore1" class="ml-8 mt-6 text-2xl font-bold tracking-tight text-gray-900">项目标题</h5>
<div class="flex space-x-9 ml-16 mt-12">
<template v-for="(project, index) in projects" :key="index">
<a-card class="transition-transform transform-gpu hover:scale-105 relative w-[300px] 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">{{ project.name }}</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">
@ -56,162 +27,40 @@
</button>
</div>
</div>
</a-card>
</template>
</div>
</div>
<div class="flex-1 relative transition-transform transform-gpu hover:scale-105 border-gray-400 shadow-lg h-80 w-1/4 bg-cover bg-center bg-[url('@/assert/images/img22.jpg')]" @mouseleave="LearnMore2=false" @mouseover="LearnMore2=true">
<div class="flex items-center">
<div :class="{'bg-white':LearnMore2}" class="flex absolute bottom-0 min-h-[30%] w-full">
<h5 v-if="LearnMore2" class="ml-8 mt-6 text-2xl font-bold tracking-tight text-gray-900">项目标题</h5>
<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>
</div>
</div>
<div class="flex-1 relative transition-transform transform-gpu hover:scale-105 border-gray-400 shadow-lg h-80 w-1/4 bg-cover bg-center bg-[url('@/assert/images/img23.jpg')]" @mouseleave="LearnMore3=false" @mouseover="LearnMore3=true">
<div class="flex items-center">
<div :class="{'bg-white':LearnMore3}" class="flex absolute bottom-0 min-h-[30%] w-full">
<h5 v-if="LearnMore3" class="ml-8 mt-6 text-2xl font-bold tracking-tight text-gray-900">项目标题</h5>
<div class="ml-auto mr-10">
<button v-if="LearnMore3" 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>
</div>
</div>
</div>
<div class="flex space-x-12">
<div class="flex-1 relative transition-transform transform-gpu hover:scale-105 border-gray-400 shadow-lg h-80 w-1/4 bg-cover bg-center bg-[url('@/assert/images/img24.jpg')]" @mouseleave="LearnMore4=false" @mouseover="LearnMore4=true">
<div class="flex items-center">
<div :class="{'bg-white':LearnMore4}" class="flex absolute bottom-0 min-h-[30%] w-full">
<h5 v-if="LearnMore4" class="ml-8 mt-6 text-2xl font-bold tracking-tight text-gray-900">项目标题</h5>
<div class="ml-auto mr-10">
<button v-if="LearnMore4" 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>
</div>
</div>
<div class="flex-1 relative transition-transform transform-gpu hover:scale-105 border-gray-400 shadow-lg h-80 w-1/4 bg-cover bg-center bg-[url('@/assert/images/img25.jpg')]" @mouseleave="LearnMore5=false" @mouseover="LearnMore5=true">
<div class="flex items-center">
<div :class="{'bg-white':LearnMore5}" class="flex absolute bottom-0 min-h-[30%] w-full">
<h5 v-if="LearnMore5" class="ml-8 mt-6 text-2xl font-bold tracking-tight text-gray-900">项目标题</h5>
<div class="ml-auto mr-10">
<button v-if="LearnMore5" 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>
</div>
</div>
<div class="flex-1 relative transition-transform transform-gpu hover:scale-105 border-gray-400 shadow-lg h-80 w-1/4 bg-cover bg-center bg-[url('@/assert/images/img26.jpg')]" @mouseleave="LearnMore6=false" @mouseover="LearnMore6=true">
<div class="flex items-center">
<div :class="{'bg-white':LearnMore6}" class="flex absolute bottom-0 min-h-[30%] w-full">
<h5 v-if="LearnMore6" class="ml-8 mt-6 text-2xl font-bold tracking-tight text-gray-900">项目标题</h5>
<div class="ml-auto mr-10">
<button v-if="LearnMore6" 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>
</div>
</div>
</div>
</div>
</div>
<nav aria-label="Page navigation example" class="mt-10">
<ul class="flex items-center -space-x-px h-10 text-base">
<li>
<a class="flex items-center justify-center px-4 h-10 ms-0 leading-tight text-gray-500 bg-white border border-e-0 border-gray-300 rounded-s-lg hover:bg-gray-100 hover:text-gray-700" href="#">
<span class="sr-only">Previous</span>
<svg aria-hidden="true" class="w-3 h-3 rtl:rotate-180" fill="none" viewBox="0 0 6 10" xmlns="http://www.w3.org/2000/svg">
<path d="M5 1 1 5l4 4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
</svg>
</a>
</li>
<li>
<a aria-current="page" class="flex items-center justify-center px-4 h-10 leading-tight text-blue-600 bg-blue-50 border border-gray-300 hover:bg-gray-100 hover:text-gray-700" href="#">
1
</a>
</li>
<li>
<a class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700" href="#">
2
</a>
</li>
<li>
<a class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-blue-300 hover:bg-blue-100 hover:text-blue-700" href="#">
3
</a>
</li>
<li>
<a class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700" href="#">
4
</a>
</li>
<li>
<a class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700" href="#">
5
</a>
</li>
<li>
<a class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700" href="#">
<span class="sr-only">Next</span>
<svg aria-hidden="true" class="w-3 h-3 rtl:rotate-180" fill="none" viewBox="0 0 6 10" xmlns="http://www.w3.org/2000/svg">
<path d="m1 9 4-4-4-4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
</svg>
</a>
</li>
</ul>
</nav>
<!-- <a-pagination-->
<!-- v-model:current="current1"-->
<!-- v-model:pageSize="pageSize"-->
<!-- show-size-changer-->
<!-- :total="500"-->
<!-- @showSizeChange="onShowSizeChange"-->
<!-- />-->
</div>
</div>
</template>
<script setup>
import {onMounted, ref} from "vue";
import {onMounted, ref, watch} from "vue";
import request from "@/js/request.js";
const LearnMore1 = ref(false)
const LearnMore2 = ref(false)
const LearnMore3 = ref(false)
const LearnMore4 = ref(false)
const LearnMore5 = ref(false)
const LearnMore6 = ref(false)
// export default {
// data() {
// return {
// LearnMore1:false,
// LearnMore2:false,
// LearnMore3:false,
// LearnMore4:false,
// LearnMore5:false,
// LearnMore6:false,
// };
// },
// };
// const Project = reactive({
// data:[],
// })
const token = window.localStorage.getItem('token')
const projects = ref([]);
const pageSize = ref(20);
const current1 = ref(3);
const onShowSizeChange = (current, pageSize) => {
console.log(current, pageSize);
};
watch(pageSize, () => {
console.log('pageSize', pageSize.value);
});
watch(current1, () => {
console.log('current', current1.value);
});
onMounted(() =>{
getAllProject()
})
@ -219,6 +68,8 @@ function getAllProject(){
request.projectGet(token).then((res)=>{
console.log(res)
// Project.data= res.data.data.data
projects.value = res.data.data;
})
}
</script>