获取项目信息1

This commit is contained in:
妖姐 2024-03-12 20:08:31 +08:00
parent ce17f62ab6
commit 925d56c48a
5 changed files with 161 additions and 38 deletions

View File

@ -194,7 +194,7 @@ onMounted(() => {
// avatar.value = res.data.data.avatar // avatar.value = res.data.data.avatar
avatar.value = 'https://img1.baidu.com/it/u=2005056479,139681251&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1710176400&t=4f32b862465c709f79c8fb80d3c0444b'; avatar.value = 'https://img1.baidu.com/it/u=2005056479,139681251&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1710176400&t=4f32b862465c709f79c8fb80d3c0444b';
console.log(username.value, avatar.value) console.log(username.value, avatar.value)
if (res.data.data.role === 'teacher') { if (res.data.data.role === '老师') {
console.log('这是老师'); console.log('这是老师');
// //
role.value =true role.value =true

View File

@ -500,8 +500,7 @@ const infoEditSettingHeaderImage = (showType, token) => {
} }
/** /**
* 展示全部项目 * 展示我负责的项目
* @param (listAll tags isFinish)
* @param token * @param token
*/ */
const projectGet =(token) => { const projectGet =(token) => {
@ -515,8 +514,23 @@ const projectGet =(token) => {
}) })
} }
/** /**
* 展示游客查看的项目
* @param data (tags isFinish)
*/
const projectGetCustom = (data) =>{
return axios({
url:api+ "/project/get/custom",
method: "get",
data: data,
headers:{
'Timestamp': getCurrentTimestamp()
}
})
}
/**
* 展示全部消息 * 展示全部消息
* *
*/ */
@ -566,6 +580,7 @@ export default {
projectGet, projectGet,
projectGetCustom,

View File

@ -136,6 +136,12 @@ const router = createRouter({
}, },
] ]
}, },
{
path:'/ProjectMessage',
name:'MainMessageCustom',
component:()=>import('@/views/ProjectPage/MainMessageCustom.vue')
},
] ]
}) })

View File

@ -0,0 +1,38 @@
<template>
<NavBar class="h-[10vh]"></NavBar>
<div class=" flex flex-row">
<div class="flex flex-col w-[20vw] h-[90vh] bg-blue-100 border border-[2px] border-gray-400 border-t-0 border-b-0 border-l-0">
<span>子系统名称</span>
<span>子系统周期</span>
<span>项目开发时间</span>
<span>项目完成时间</span>
<span>工作量</span>
<span>完成情况</span>
<span>需求文档</span>
<button>子系统文档</button>
</div>
<div class="w-[80vw] ml-[5vw]">
<a-card class="w-[22vw] h-[30vh] bg-gradient-to-b from-blue-500 to-blue-300">
<div class="w-[22vw] h-[20vh] flex flex-col">
<span class="">登录注册模块</span>
负责人
剩余8天
</div>
<div class="flex flex-row w-[22vw] h-[5vh]">
<p class="w-3 h-3 rounded-full bg-blue-500"></p>进行中
<div>
<span>2</span>
<span>/</span>
</div>
</div>
</a-card>
</div>
</div>
</template>
<script setup>
import NavBar from "@/components/HomeComponents/NavBar.vue";
</script>

View File

@ -1,19 +1,22 @@
<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"> <nav class="ml-16 flex space-x-[30vw]">
<div class="inline-flex rounded-md shadow-sm" role="group"> <div class="inline-flex rounded-md " role="group">
<button <button
:class="buttonClass('DisableSelection')"
type="button" type="button"
@click="toggleSelectionDisabled" @click="toggleSelectionDisabled"
> class="w-[8vw] rounded-lg "
全部 :class="buttonClass('DisableSelection')"
</button> >
全部
</button>
<button <button
:class="buttonClass('web')" :class="buttonClass('web')"
type="button" type="button"
@click="toggleSelection('web')" @click="toggleSelection('web')"
class="w-[6vw] rounded-lg"
> >
Web Web
</button> </button>
@ -21,6 +24,7 @@
:class="buttonClass('Ai')" :class="buttonClass('Ai')"
type="button" type="button"
@click="toggleSelection('Ai')" @click="toggleSelection('Ai')"
class="w-[6vw] rounded-lg"
> >
Ai Ai
</button> </button>
@ -28,23 +32,68 @@
:class="buttonClass('App')" :class="buttonClass('App')"
type="button" type="button"
@click="toggleSelection('App')" @click="toggleSelection('App')"
class="w-[6vw] rounded-lg "
> >
App App
</button> </button>
<button
:class="buttonClass('大数据')"
type="button"
@click="toggleSelection('大数据')"
class="w-[6vw] rounded-lg "
>
大数据
</button>
</div> </div>
<ul class="flex space-x-12 "> <div class="flex space-x-12">
<a-checkbox>未开始</a-checkbox> <label class="inline-flex items-center space-x-2 hover:text-blue-600">
<a-checkbox>进行中</a-checkbox> <input
<a-checkbox>已完成</a-checkbox> type="checkbox"
</ul> class="form-checkbox h-5 w-5 text-red-400 rounded-lg focus:ring-white"
value="0"
v-model="selectedStatus"
/>
<span class="text-sm">未开始</span>
</label>
<label class="inline-flex items-center space-x-2 hover:text-blue-600">
<input
type="checkbox"
class="form-checkbox h-5 w-5 text-blue-400 rounded-lg focus:ring-white"
value="2"
v-model="selectedStatus"
/>
<span class="text-sm">进行中</span>
</label>
<label class="inline-flex items-center space-x-2 hover:text-blue-600">
<input
type="checkbox"
class="form-checkbox h-5 w-5 text-green-400 rounded-full focus:ring-white"
value="1"
v-model="selectedStatus"
/>
<span class="text-sm">已完成</span>
</label>
<label class="inline-flex items-center space-x-2 hover:text-blue-600">
<input
type="checkbox"
class="form-checkbox h-5 w-5 text-red-400 rounded-full focus:ring-white "
value="-1"
v-model="selectedStatus"
/>
<span class="text-sm ">暂停</span>
</label>
</div>
</nav> </nav>
<div class="flex space-x-9 ml-16 mt-12"> <div class="flex space-x-9 ml-16 mt-12 ">
<template v-for="(project, index) in projects" :key="index"> <template v-for="(project, index) in projects" :key="index" class="w-[80vw] ">
<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"> <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/img12.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">
<p class="ml-6 mt-4 text-lg font-bold tracking-tight text-gray-900">{{ project.name }}</p> <p class="ml-6 mt-4 text-lg font-bold tracking-tight text-gray-900">{{ project.name }}</p>
<div class="ml-auto mr-10"> <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"> <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" @click="MainMessage">
<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"> <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"/> <path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
</svg> </svg>
@ -65,15 +114,13 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import {onMounted, ref, watch} from "vue"; import {onMounted, reactive, ref, watch} from "vue";
import request from "@/js/request.js"; import request from "@/js/request.js";
import router from "@/router/index.js";
const LearnMore1 = ref(false) const LearnMore1 = ref(false)
const token = window.localStorage.getItem('token')
const projects = ref([]); const projects = ref([]);
const id =ref(1)
const pageSize = ref(20); const pageSize = ref(20);
const current1 = ref(3); const current1 = ref(3);
const onShowSizeChange = (current, pageSize) => { const onShowSizeChange = (current, pageSize) => {
@ -89,16 +136,14 @@ onMounted(() =>{
getAllProject() getAllProject()
}) })
function getAllProject(){ function getAllProject(){
request.projectGet(token).then((res)=>{ request.projectGetCustom(id).then((res)=>{
console.log(res) console.log(res)
// Project.data= res.data.data.data // Project.data= res.data.data.data
projects.value = res.data.data; projects.value = res.data.data;
console.log(projects.value)
}) })
} }
const selectedButtons = ref([]);
const selectionDisabled = ref(false);
// //
@ -115,7 +160,6 @@ const toggleSelection = (button) => {
if (selectionDisabled.value) { if (selectionDisabled.value) {
return; return;
} }
// //
const index = selectedButtons.value.indexOf(button); const index = selectedButtons.value.indexOf(button);
if (index > -1) { if (index > -1) {
@ -125,12 +169,32 @@ const toggleSelection = (button) => {
} }
}; };
//
const buttonClass = (button) => ({ const buttonClass = (button) => ({
'px-4 py-2 text-sm font-medium border focus:z-10 focus:ring-2': true, 'px-4 py-2 text-sm font-medium border focus:z-10 focus:ring-1': true,
'text-gray-900 bg-white border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:ring-blue-700 focus:text-blue-700 ': (!selectedButtons.value.includes(button) && !selectionDisabled.value) || (button === 'DisableSelection' && !selectionDisabled.value), 'text-gray-900 bg-white border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:ring-blue-100 focus:text-blue-700 outline-none ': (!selectedButtons.value.includes(button) && !selectionDisabled.value) || (button === 'DisableSelection' && !selectionDisabled.value),
'bg-green-400 text-white': selectedButtons.value.includes(button) || (button === 'DisableSelection' && selectionDisabled.value), // 'bg-blue-400 text-white': selectedButtons.value.includes(button) || (button === 'DisableSelection' && selectionDisabled.value), //
}); });
</script> //
function MainMessage(){
router.push("/ProjectMessage")
}
//
const filteredProjects = ref([]);
//
const selectedButtons = ref(['web','ai','大数据']);
const selectionDisabled = ref('');
const selectedStatus = reactive([-1,0,1,2]); //
const clickedButton= ref(null)
//
watch(() => selectedButtons.value, (clickedButton) => {
if (selectedButtons.value === 1){
}
});
</script>gj