100 lines
2.0 KiB
Vue
100 lines
2.0 KiB
Vue
<template>
|
|
<div class="action-card">
|
|
<div class="ac-head">
|
|
<div class="ac-main">
|
|
<div class="ac-title">{{ title }}</div>
|
|
<div class="ac-sub">{{ subText }}</div>
|
|
</div>
|
|
<StatusTag :text="statusText" :variant="statusVariant" />
|
|
</div>
|
|
<div class="ac-meta">
|
|
<span>{{ amountText }}</span>
|
|
<span>{{ timeText }}</span>
|
|
</div>
|
|
<div class="ac-actions">
|
|
<button type="button" class="btn btn-sm btn-primary" @click="$emit('secondary')">{{ secondaryText }}</button>
|
|
<button type="button" class="btn btn-sm btn-primary" @click="$emit('primary')">{{ primaryText }}</button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import StatusTag from './StatusTag.vue'
|
|
|
|
interface Props {
|
|
title: string
|
|
subText: string
|
|
statusText: string
|
|
statusVariant?: 'success' | 'warning' | 'danger' | 'info' | 'processing' | 'muted'
|
|
amountText: string
|
|
timeText: string
|
|
primaryText?: string
|
|
secondaryText?: string
|
|
}
|
|
|
|
withDefaults(defineProps<Props>(), {
|
|
statusVariant: 'info',
|
|
primaryText: '去处理',
|
|
secondaryText: '查看',
|
|
})
|
|
|
|
defineEmits<{
|
|
primary: []
|
|
secondary: []
|
|
}>()
|
|
</script>
|
|
|
|
<style scoped>
|
|
.action-card {
|
|
background: var(--surface);
|
|
border-radius: var(--radius);
|
|
box-shadow: var(--shadow);
|
|
border: 1px solid var(--border);
|
|
padding: 12px;
|
|
}
|
|
|
|
.ac-head {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
justify-content: space-between;
|
|
gap: 8px;
|
|
}
|
|
|
|
.ac-main {
|
|
min-width: 0;
|
|
flex: 1;
|
|
}
|
|
|
|
.ac-title {
|
|
font-size: 14px;
|
|
font-weight: 700;
|
|
color: var(--text);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.ac-sub {
|
|
margin-top: 2px;
|
|
font-size: 12px;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.ac-meta {
|
|
margin-top: 8px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
font-size: 12px;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.ac-actions {
|
|
margin-top: 10px;
|
|
padding-top: 10px;
|
|
border-top: 1px dashed var(--border);
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 8px;
|
|
}
|
|
</style>
|