feat: 新增质检模块功能并优化界面交互
refactor: 重构质检任务和历史记录页面布局 feat: 添加Greeting组件并集成到首页 feat: 实现质检项选择和详情展示功能 feat: 新增实验室和工段质检页面 style: 优化表格样式和交互体验
This commit is contained in:
74
klp-ui/src/views/components/Greeting.vue
Normal file
74
klp-ui/src/views/components/Greeting.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<div class="user-greeting-row">
|
||||
<img :src="avatar" class="user-avatar" alt="头像" />
|
||||
<div class="greeting-text">
|
||||
<div class="greeting-title">{{ greeting }},{{ name }}</div>
|
||||
<div class="greeting-desc">愿你天黑有灯,下雨有伞</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Greeting',
|
||||
data() {
|
||||
return {
|
||||
avatar: '',
|
||||
name: '',
|
||||
greeting: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.avatar = this.$store.getters.avatar
|
||||
this.name = this.$store.getters.name
|
||||
this.greeting = this.getGreeting()
|
||||
},
|
||||
methods: {
|
||||
getGreeting() {
|
||||
const hour = new Date().getHours()
|
||||
if (hour < 6) return '凌晨好'
|
||||
if (hour < 9) return '早上好'
|
||||
if (hour < 12) return '上午好'
|
||||
if (hour < 14) return '中午好'
|
||||
if (hour < 18) return '下午好'
|
||||
if (hour < 21) return '晚上好'
|
||||
return '夜深了'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.user-greeting-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.user-avatar {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
border: 2px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.greeting-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.greeting-title {
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.greeting-desc {
|
||||
font-size: 16px;
|
||||
color: #888;
|
||||
margin-top: 4px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user