158 lines
3.3 KiB
Vue
158 lines
3.3 KiB
Vue
<script setup lang="ts">
|
||
import { StatusTag } from '@/components'
|
||
import type { Qualification, QualificationStatus } from '@/types/business/profile'
|
||
|
||
interface Props {
|
||
qualification: Qualification
|
||
}
|
||
|
||
defineProps<Props>()
|
||
|
||
const emit = defineEmits<{
|
||
edit: [qualification: Qualification]
|
||
delete: [qualification: Qualification]
|
||
reupload: [qualification: Qualification]
|
||
}>()
|
||
|
||
const STATUS_VARIANTS: Record<QualificationStatus, 'success' | 'warning' | 'danger'> = {
|
||
已认证: 'success',
|
||
审核中: 'warning',
|
||
未通过: 'danger',
|
||
}
|
||
</script>
|
||
|
||
<template>
|
||
<article class="qual-card">
|
||
<div class="qual-card__head">
|
||
<h3 class="qual-card__name">
|
||
{{ qualification.certName }}
|
||
</h3>
|
||
<StatusTag
|
||
:label="qualification.status"
|
||
:variant="STATUS_VARIANTS[qualification.status]"
|
||
/>
|
||
</div>
|
||
|
||
<ul class="qual-card__meta">
|
||
<li><span>资质类型:</span>{{ qualification.type }}</li>
|
||
<li><span>证书编号:</span>{{ qualification.certNo }}</li>
|
||
<li><span>发证单位:</span>{{ qualification.issuer }}</li>
|
||
<li><span>有效期:</span>{{ qualification.validFrom }} 至 {{ qualification.validTo }}</li>
|
||
</ul>
|
||
|
||
<div class="qual-card__actions">
|
||
<button class="qual-card__btn" @click="emit('edit', qualification)">
|
||
编辑
|
||
</button>
|
||
<button class="qual-card__btn qual-card__btn--danger" @click="emit('delete', qualification)">
|
||
删除
|
||
</button>
|
||
<button
|
||
v-if="qualification.status === '未通过'"
|
||
class="qual-card__btn qual-card__btn--warning"
|
||
@click="emit('reupload', qualification)"
|
||
>
|
||
重新上传
|
||
</button>
|
||
</div>
|
||
</article>
|
||
</template>
|
||
|
||
<style lang="less" scoped>
|
||
.qual-card {
|
||
.flex(column, flex-start);
|
||
gap: @spacing-sm;
|
||
padding: @spacing-base;
|
||
border: 1px solid @profile-card-border;
|
||
border-radius: @radius-base;
|
||
background: @white;
|
||
|
||
&__head {
|
||
.flex(row, space-between, flex-start);
|
||
gap: @spacing-sm;
|
||
}
|
||
|
||
&__name {
|
||
font-size: 11px;
|
||
font-weight: 600;
|
||
color: @heading-color;
|
||
.multi-ellipsis(2);
|
||
}
|
||
|
||
&__meta {
|
||
.flex(column, flex-start);
|
||
gap: @spacing-xs;
|
||
list-style: none;
|
||
font-size: 11px;
|
||
color: @heading-color;
|
||
|
||
li {
|
||
.ellipsis();
|
||
font-weight: 600;
|
||
}
|
||
|
||
span {
|
||
color: @text-color-secondary;
|
||
font-weight: 400;
|
||
}
|
||
}
|
||
|
||
&__actions {
|
||
.flex(row, center);
|
||
gap: @spacing-sm;
|
||
margin-top: auto;
|
||
padding-top: @spacing-sm;
|
||
border-top: 1px solid @profile-card-border;
|
||
width: 100%;
|
||
}
|
||
|
||
&__btn {
|
||
height: 24px;
|
||
padding: 0 10px;
|
||
border: 1px solid @profile-line;
|
||
border-radius: @profile-radius;
|
||
background: @white;
|
||
color: @text-color;
|
||
font-size: 11px;
|
||
font-weight: 500;
|
||
transition: all 0.2s;
|
||
|
||
&:hover {
|
||
border-color: @primary-strong;
|
||
color: @primary-strong;
|
||
opacity: 1;
|
||
}
|
||
|
||
&--danger {
|
||
color: @text-color;
|
||
}
|
||
|
||
&--warning {
|
||
color: @text-color;
|
||
}
|
||
}
|
||
}
|
||
|
||
.qual-card .status-tag {
|
||
padding: 0;
|
||
background: transparent;
|
||
font-size: 12px;
|
||
font-weight: 700;
|
||
|
||
&--success {
|
||
background: transparent;
|
||
color: @heading-color;
|
||
}
|
||
|
||
&--warning {
|
||
background: transparent;
|
||
color: @heading-color;
|
||
}
|
||
|
||
&--danger {
|
||
background: transparent;
|
||
color: @danger-color;
|
||
}
|
||
}
|
||
</style>
|