初始
This commit is contained in:
50
src/components/Header.vue
Normal file
50
src/components/Header.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<div class="bg-transparant">
|
||||
<a-menu v-model:selectedKeys="current" mode="horizontal">
|
||||
<a-menu-item v-for="item in departmentList" :key="item.key">
|
||||
{{ item.name }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { watch } from "vue";
|
||||
import { useUserStore } from "@/store/user.ts";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
let userStore: any = useUserStore();
|
||||
const router = useRouter();
|
||||
|
||||
const current = ref<string[]>(["3"]);
|
||||
watch(
|
||||
current,
|
||||
(N, O) => {
|
||||
if (N == 5) {
|
||||
router.push({
|
||||
path: "/statistic",
|
||||
});
|
||||
}
|
||||
if (N != 5) {
|
||||
userStore.SetMenuInfo({ key: current.value });
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
let departmentList = [
|
||||
{ key: "3", name: "人工智能系" },
|
||||
|
||||
{ key: "1", name: "电子信息工程系" },
|
||||
{ key: "2", name: "通信工程系" },
|
||||
// { key: "4", name: "本科实验教学中心" },
|
||||
{ key: "5", name: "数据统计" },
|
||||
];
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ant-menu-light {
|
||||
background-color: transparent;
|
||||
}
|
||||
</style>
|
||||
41
src/components/HelloWorld.vue
Normal file
41
src/components/HelloWorld.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
|
||||
defineProps<{ msg: string }>()
|
||||
|
||||
const count = ref(0)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h1>{{ msg }}</h1>
|
||||
|
||||
<div class="card">
|
||||
<button type="button" @click="count++">count is {{ count }}</button>
|
||||
<p>
|
||||
Edit
|
||||
<code>components/HelloWorld.vue</code> to test HMR
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Check out
|
||||
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
|
||||
>create-vue</a
|
||||
>, the official Vue + Vite starter
|
||||
</p>
|
||||
<p>
|
||||
Learn more about IDE Support for Vue in the
|
||||
<a
|
||||
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
|
||||
target="_blank"
|
||||
>Vue Docs Scaling up Guide</a
|
||||
>.
|
||||
</p>
|
||||
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.read-the-docs {
|
||||
color: #888;
|
||||
}
|
||||
</style>
|
||||
39
src/components/TopHeader.vue
Normal file
39
src/components/TopHeader.vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div class="w-full flex justify-between py-[18px] px-[40px] bg-white">
|
||||
<div>
|
||||
<img
|
||||
src="../assets/web/statisTop.png"
|
||||
alt=""
|
||||
class="w-[167px] h-[60px]"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-if="userStore.userInfo && userStore.userInfo.data"
|
||||
class="h-[48px] flex py-[6px] px-[14px] bg-[#F6F8FA] rounded-[10px]"
|
||||
>
|
||||
<div class="avatar"></div>
|
||||
<div class="leading-[34px] ml-[10px]">
|
||||
{{ userStore.userInfo.data.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { watch } from "vue";
|
||||
import { useUserStore } from "@/store/user.ts";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
let userStore: any = useUserStore();
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.avatar {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
background: url("../assets/web/avatar.jpg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user