修复个人项目bug

This commit is contained in:
yannqing 2024-03-14 16:40:13 +08:00
parent 20205c2581
commit bb8566dd07

View File

@ -1,19 +1,28 @@
<template> <template>
<div class="relative h-full bg-gray-50 flex"> <div class="relative h-full bg-gray-50 flex">
<div class="mt-12"> <div class="mt-12">
<nav class="ml-16 flex space-x-72"> <div class="flex flex-row justify-between">
<ul class="flex space-x-24"> <div>
<li class="hover:text-blue-500">全部</li> <!-- 第一个是 全部 所以独立出来 -->
<li class="hover:text-blue-500">Web</li> <a-checkable-tag
<li class="hover:text-blue-500">Ai</li> v-model:checked="tagAll"
<li class="hover:text-blue-500">App</li> @change="checked => handleClickAll(checked)"
</ul> >
<ul class="flex space-x-12"> 全部
<a-checkbox>未开始</a-checkbox> </a-checkable-tag>
<a-checkbox>进行中</a-checkbox> <a-checkable-tag
<a-checkbox>已完成</a-checkbox> v-for="(tag, index) in tagsData"
</ul> :key="tag.id"
</nav> v-model:checked="selectTags[index]"
@change="checked => handleChange(tag, checked)"
>
{{ tag.name }}
</a-checkable-tag>
</div>
<div>
<a-checkbox-group v-model:value="projStatus" :options="['进行中','已完成']" />
</div>
</div>
<div class="flex space-x-9 ml-16 mt-12"> <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"> <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"> <div class="flex absolute left-0 bottom-0 min-h-[30%] w-full bg-white">
@ -53,23 +62,78 @@
</a-card> </a-card>
</div> </div>
</div> </div>
<a-card class="mt-12 rounded-2xl absolute right-20 w-96 h-[750px] border-gray-200"> <!-- <a-card class="mt-12 rounded-2xl absolute right-20 w-96 h-[750px] border-gray-200">-->
<div class=" flex flex-col space-y-52"> <!-- <div class=" flex flex-col space-y-52">-->
<p class="text-xl font-bold">项目消息</p> <!-- <p class="text-xl font-bold">项目消息</p>-->
<p class="text-xl font-bold">项目推荐</p> <!-- <p class="text-xl font-bold">项目推荐</p>-->
</div> <!-- </div>-->
</a-card> <!-- </a-card>-->
</div> </div>
</template> </template>
<script> <script setup>
export default {
data() { import {onMounted, ref} from "vue";
return { import request from '@/js/request.js'
LearnMore1:false,
LearnMore2:false, const LearnMore1 = ref(false)
LearnMore3:false const LearnMore2 = ref(false)
}; const LearnMore3 = ref(false)
},
const token = window.localStorage.getItem('token')
const projStatus = ref();
const tagAll=ref(true)
const tagsData = ref([]);
const selectTags = ref([false, false, false, false]);
onMounted(
()=>{
//
request.getTagsProjectList(token).then(res=>{
console.log(res.data.data)
tagsData.value=res.data.data
})
//
request.projectGet(token).then(res=>{
console.log(res)
})
}
)
//
const handleClickAll=(checked)=>{
if(checked){
selectTags.value.forEach((item,index)=>{
selectTags.value[index]=false
})
//
request.projectGet(token).then(res=>{
console.log(res.data.data)
})
}
}
//
const handleChange = (tag, checked) => {
if(checked){
tagAll.value=false
}
else{
let flag=true
selectTags.value.forEach((item,index)=>{
if(item){
flag=false
}
})
if(flag){
tagAll.value=true
}
}
}; };
</script> </script>