增加前端格式检查配置
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { Bell, Document, InfoFilled, QuestionFilled, Tickets, Warning } from '@element-plus/icons-vue'
|
||||
import {
|
||||
Bell,
|
||||
Document,
|
||||
InfoFilled,
|
||||
QuestionFilled,
|
||||
Tickets,
|
||||
Warning,
|
||||
} from '@element-plus/icons-vue'
|
||||
import { fetchAnnouncements, type Announcement } from '@/features/announcement'
|
||||
import { formatDateTime } from '@/utils/time'
|
||||
|
||||
@@ -114,7 +121,10 @@ function getCategoryLabel(category: string) {
|
||||
effect="plain"
|
||||
size="small"
|
||||
class="category-tag"
|
||||
:style="{ borderColor: getCategoryInfo(item.category)?.color || '#94a3b8', color: getCategoryInfo(item.category)?.color || '#94a3b8' }"
|
||||
:style="{
|
||||
borderColor: getCategoryInfo(item.category)?.color || '#94a3b8',
|
||||
color: getCategoryInfo(item.category)?.color || '#94a3b8',
|
||||
}"
|
||||
>
|
||||
<el-icon><component :is="getCategoryInfo(item.category)?.icon || Bell" /></el-icon>
|
||||
{{ getCategoryLabel(item.category) }}
|
||||
@@ -122,10 +132,14 @@ function getCategoryLabel(category: string) {
|
||||
<el-tag v-if="item.is_pinned" type="warning" effect="plain" size="small">置顶</el-tag>
|
||||
<el-tag v-if="item.is_important" type="danger" effect="plain" size="small">重要</el-tag>
|
||||
</div>
|
||||
<span class="announcement-date">{{ formatDateTime(item.published_at || item.created_at) }}</span>
|
||||
<span class="announcement-date">{{
|
||||
formatDateTime(item.published_at || item.created_at)
|
||||
}}</span>
|
||||
</div>
|
||||
<h3 class="announcement-title">{{ item.title }}</h3>
|
||||
<p class="announcement-preview">{{ item.content.substring(0, 120) }}{{ item.content.length > 120 ? '...' : '' }}</p>
|
||||
<p class="announcement-preview">
|
||||
{{ item.content.substring(0, 120) }}{{ item.content.length > 120 ? '...' : '' }}
|
||||
</p>
|
||||
<div class="announcement-footer">
|
||||
<span class="view-count">
|
||||
<el-icon><Tickets /></el-icon>
|
||||
@@ -159,9 +173,7 @@ function getCategoryLabel(category: string) {
|
||||
padding: 32px;
|
||||
border: 1px solid #e6eaf2;
|
||||
border-radius: 12px;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.06)),
|
||||
#ffffff;
|
||||
background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.06)), #ffffff;
|
||||
box-shadow: 0 14px 36px rgba(17, 24, 39, 0.06);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user