88 lines
2.2 KiB
Vue
88 lines
2.2 KiB
Vue
<script setup lang="ts">
|
|
import { StatusTag } from '@/components'
|
|
import { formatBusinessType } from '@/utils/format'
|
|
import type { Project, ProjectStatus } from '@/types/business/project'
|
|
|
|
interface Props {
|
|
project: Project
|
|
}
|
|
|
|
defineProps<Props>()
|
|
|
|
const STATUS_VARIANTS: Record<ProjectStatus, 'primary' | 'success' | 'warning' | 'danger' | 'info'> = {
|
|
'待立项': 'info',
|
|
'进行中': 'primary',
|
|
'待验收': 'warning',
|
|
'待内部验收': 'warning',
|
|
'已完成': 'success',
|
|
'售后中': 'warning',
|
|
'已取消': 'info',
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div class="project-info-card">
|
|
<div class="project-info-card__head">
|
|
<StatusTag :label="project.status" :variant="STATUS_VARIANTS[project.status]" />
|
|
<h1 class="project-info-card__name">
|
|
{{ project.projectName }}
|
|
</h1>
|
|
</div>
|
|
<div class="project-info-card__meta">
|
|
<div class="project-info-card__meta-item">
|
|
<span class="project-info-card__label text-secondary">项目编号</span>
|
|
<span class="project-info-card__value">{{ project.projectNo }}</span>
|
|
</div>
|
|
<div class="project-info-card__meta-item">
|
|
<span class="project-info-card__label text-secondary">业务类型</span>
|
|
<span class="project-info-card__value">{{ formatBusinessType(project.businessType) }}</span>
|
|
</div>
|
|
<div class="project-info-card__meta-item">
|
|
<span class="project-info-card__label text-secondary">提交时间</span>
|
|
<span class="project-info-card__value">{{ project.submitTime }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style lang="less" scoped>
|
|
.project-info-card {
|
|
padding: @spacing-lg @spacing-xl;
|
|
border-radius: @radius-lg;
|
|
background: @white;
|
|
box-shadow: @shadow-base;
|
|
|
|
&__head {
|
|
.flex(row, flex-start, center);
|
|
gap: @spacing-base;
|
|
}
|
|
|
|
&__name {
|
|
font-size: @font-size-xxl;
|
|
font-weight: 600;
|
|
color: @heading-color;
|
|
}
|
|
|
|
&__meta {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, 1fr);
|
|
gap: @spacing-base;
|
|
margin-top: @spacing-base;
|
|
}
|
|
|
|
&__meta-item {
|
|
.flex(column, flex-start, stretch);
|
|
gap: @spacing-xs;
|
|
}
|
|
|
|
&__label {
|
|
font-size: @font-size-sm;
|
|
}
|
|
|
|
&__value {
|
|
font-size: @font-size-base;
|
|
color: @heading-color;
|
|
}
|
|
}
|
|
</style>
|