feat(admin): 添加用户管理相关文件

添加用户管理视图、API和状态管理文件
This commit is contained in:
张翔
2026-03-28 14:37:29 +08:00
commit 08ea5fbe98
1643 changed files with 255646 additions and 0 deletions
@@ -0,0 +1,181 @@
<template>
<Card class="search-result-card">
<view class="card-header">
<Typography variant="h4" weight="semibold" class="date">{{ formatDate(result.date) }}</Typography>
<Typography variant="body" class="weekday">{{ result.weekday }}</Typography>
</view>
<view class="card-body">
<Typography variant="caption" class="lunar-date">{{ result.lunarDate }}</Typography>
<view v-if="result.matchedItems.suitable.length > 0" class="matched-items">
<Typography variant="caption" class="label suitable-label">宜</Typography>
<Typography variant="body" class="items suitable-items">{{ result.matchedItems.suitable.join('、') }}</Typography>
</view>
<view v-if="result.matchedItems.unsuitable.length > 0" class="matched-items">
<Typography variant="caption" class="label unsuitable-label">忌</Typography>
<Typography variant="body" class="items unsuitable-items">{{ result.matchedItems.unsuitable.join('、') }}</Typography>
</view>
<Typography variant="caption" class="match-count">匹配度: {{ result.matchCount }}</Typography>
</view>
</Card>
</template>
<script setup lang="ts">
import type { SearchResult } from '../../types/search'
import Card from '../Card/Card.vue'
import Typography from '../Typography/Typography.vue'
interface Props {
result: SearchResult
}
defineProps<Props>()
const formatDate = (dateStr: string) => {
const date = new Date(dateStr)
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}年${month}月${day}日`
}
</script>
<style scoped lang="scss">
.search-result-card {
margin-bottom: 16px;
transition: all 0.3s ease;
&:active {
transform: scale(0.98);
}
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
padding-bottom: 12px;
border-bottom: 1px solid rgba(230, 225, 220, 255);
}
.date {
color: rgba(44, 24, 16, 255);
font-size: 16px;
line-height: 24px;
font-weight: 600;
}
.weekday {
color: rgba(113, 113, 122, 255);
font-size: 14px;
line-height: 20px;
}
.card-body {
display: flex;
flex-direction: column;
gap: 8px;
}
.lunar-date {
color: rgba(113, 113, 122, 255);
font-size: 13px;
line-height: 18px;
margin-bottom: 4px;
}
.matched-items {
display: flex;
flex-direction: column;
gap: 4px;
padding: 8px;
background-color: rgba(244, 244, 245, 255);
border-radius: 8px;
}
.label {
font-size: 12px;
line-height: 16px;
font-weight: 600;
margin-bottom: 4px;
}
.suitable-label {
color: rgba(0, 130, 54, 1);
}
.unsuitable-label {
color: rgba(196, 30, 58, 255);
}
.items {
font-size: 14px;
line-height: 20px;
font-weight: 400;
}
.suitable-items {
color: rgba(1, 102, 48, 1);
}
.unsuitable-items {
color: rgba(196, 30, 58, 255);
}
.match-count {
color: rgba(113, 113, 122, 255);
font-size: 12px;
line-height: 16px;
text-align: right;
margin-top: 4px;
}
@media screen and (max-width: 375px) {
.card-header {
margin-bottom: 10px;
padding-bottom: 10px;
}
.date {
font-size: 15px;
line-height: 22px;
}
.weekday {
font-size: 13px;
line-height: 18px;
}
.card-body {
gap: 6px;
}
.lunar-date {
font-size: 12px;
line-height: 16px;
}
.matched-items {
padding: 6px;
}
.label {
font-size: 11px;
line-height: 15px;
}
.items {
font-size: 13px;
line-height: 18px;
}
.match-count {
font-size: 11px;
line-height: 15px;
}
}
</style>