|
|
|
@ -140,7 +140,7 @@ onMounted(load) |
|
|
|
<tbody> |
|
|
|
<tr v-for="article in articles" :key="article.id"> |
|
|
|
<td class="title-cell">{{ article.title }}</td> |
|
|
|
<td> |
|
|
|
<td class="status-cell"> |
|
|
|
<span |
|
|
|
class="status-badge" |
|
|
|
:class="{ |
|
|
|
@ -152,17 +152,32 @@ onMounted(load) |
|
|
|
{{ statusLabel(article.status) }} |
|
|
|
</span> |
|
|
|
</td> |
|
|
|
<td>{{ formatDate(article.publishedAt || article.createdAt) }}</td> |
|
|
|
<td> |
|
|
|
<td class="date-cell">{{ formatDate(article.publishedAt || article.createdAt) }}</td> |
|
|
|
<td class="actions-cell"> |
|
|
|
<div class="actions"> |
|
|
|
<button class="btn-link" @click="onEdit(article)">编辑</button> |
|
|
|
<button v-if="article.status === ArticleStatus.Draft" class="btn-link" @click="onPublish(article)"> |
|
|
|
发布 |
|
|
|
<button class="icon-btn" type="button" title="编辑" @click="onEdit(article)"> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
|
|
|
<path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" /> |
|
|
|
</svg> |
|
|
|
</button> |
|
|
|
<button v-if="article.status === ArticleStatus.Published" class="btn-link" @click="onArchive(article)"> |
|
|
|
归档 |
|
|
|
<button v-if="article.status === ArticleStatus.Draft" class="icon-btn" type="button" title="发布" @click="onPublish(article)"> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
|
|
|
<path d="M5 12l5 5L20 7" /> |
|
|
|
</svg> |
|
|
|
</button> |
|
|
|
<button v-if="article.status === ArticleStatus.Published" class="icon-btn" type="button" title="归档" @click="onArchive(article)"> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
|
|
|
<path d="M22 8L12 3 2 8v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8z" /> |
|
|
|
<path d="M2 8l10 5 10-5" /> |
|
|
|
</svg> |
|
|
|
</button> |
|
|
|
<button class="icon-btn icon-btn--danger" type="button" title="删除" @click="onDelete(article)"> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
|
|
|
<path d="M3 6h18" /> |
|
|
|
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /> |
|
|
|
<path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" /> |
|
|
|
</svg> |
|
|
|
</button> |
|
|
|
<button class="btn-link danger" @click="onDelete(article)">删除</button> |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
@ -207,6 +222,7 @@ onMounted(load) |
|
|
|
|
|
|
|
.article-table { |
|
|
|
width: 100%; |
|
|
|
table-layout: fixed; |
|
|
|
border-collapse: collapse; |
|
|
|
background: var(--ac-bg-card); |
|
|
|
border: 1px solid var(--ac-border); |
|
|
|
@ -227,6 +243,23 @@ onMounted(load) |
|
|
|
color: var(--ac-text-secondary); |
|
|
|
} |
|
|
|
|
|
|
|
.status-cell { |
|
|
|
width: 80px; |
|
|
|
min-width: 80px; |
|
|
|
white-space: nowrap; |
|
|
|
} |
|
|
|
|
|
|
|
.date-cell { |
|
|
|
width: 200px; |
|
|
|
white-space: nowrap; |
|
|
|
} |
|
|
|
|
|
|
|
.actions-cell { |
|
|
|
width: 160px; |
|
|
|
min-width: 160px; |
|
|
|
white-space: nowrap; |
|
|
|
} |
|
|
|
|
|
|
|
.title-cell { |
|
|
|
font-family: 'Noto Serif SC', 'SimSun', 'STSong', serif; |
|
|
|
font-weight: 600; |
|
|
|
@ -255,22 +288,36 @@ onMounted(load) |
|
|
|
|
|
|
|
.actions { |
|
|
|
display: flex; |
|
|
|
gap: 10px; |
|
|
|
align-items: center; |
|
|
|
gap: 8px; |
|
|
|
} |
|
|
|
|
|
|
|
.btn-link { |
|
|
|
.icon-btn { |
|
|
|
display: inline-flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
width: 28px; |
|
|
|
height: 28px; |
|
|
|
border: none; |
|
|
|
border-radius: var(--song-radius-s); |
|
|
|
background: none; |
|
|
|
color: var(--ac-primary-ink); |
|
|
|
cursor: pointer; |
|
|
|
font-size: 13px; |
|
|
|
padding: 0; |
|
|
|
transition: background var(--song-dur-1) var(--song-ease), color var(--song-dur-1) var(--song-ease); |
|
|
|
} |
|
|
|
|
|
|
|
.btn-link.danger { |
|
|
|
.icon-btn:hover { |
|
|
|
background: var(--ac-active); |
|
|
|
} |
|
|
|
|
|
|
|
.icon-btn--danger { |
|
|
|
color: var(--ac-danger-ink); |
|
|
|
} |
|
|
|
|
|
|
|
.icon-btn--danger:hover { |
|
|
|
background: var(--ac-danger-bg); |
|
|
|
} |
|
|
|
|
|
|
|
.error-text { |
|
|
|
color: var(--ac-danger); |
|
|
|
} |
|
|
|
|