修改价格套餐样式结构

This commit is contained in:
wuweihua
2026-09-14 11:53:11 +08:00
parent 4cc20386d9
commit e2f75afb27
16 changed files with 2348 additions and 1330 deletions
@@ -0,0 +1,123 @@
<template>
<div class="set-header">
<div class="hd-main">
<div class="hd-line">
<h2 class="hd-name">{{ set.priceSetName || '套餐详情' }}</h2>
<span v-if="set.priceSetCode" class="hd-code">{{ set.priceSetCode }}</span>
</div>
<div class="hd-line hd-meta">
<el-tag :type="statusTagType" size="small" effect="dark">{{ statusText }}</el-tag>
<el-tag :type="isFixedType(set.setType) ? 'warning' : 'primary'" size="small" effect="plain">
{{ setTypeLabel(set.setType) }}
</el-tag>
<span class="hd-range">
<el-icon class="hd-icon"><Calendar /></el-icon>
{{ dateRange }}
</span>
</div>
</div>
<div class="hd-actions">
<el-button @click="emit('back')">返回列表</el-button>
<template v-if="editableStatus">
<el-button type="primary" @click="emit('edit')" v-hasPermi="['price:set:edit']">继续配置</el-button>
<el-button type="primary" plain @click="emit('submit')" v-hasPermi="['price:set:audit']">提交审核</el-button>
</template>
<template v-else-if="set.status === 'A'">
<el-button type="success" @click="emit('approve')" v-hasPermi="['price:set:audit']">审批生效</el-button>
<el-button type="warning" plain @click="emit('reject')" v-hasPermi="['price:set:audit']">驳回</el-button>
</template>
<el-button
v-else-if="set.status === 'E' && !set.expired"
type="danger"
plain
@click="emit('disable')"
v-hasPermi="['price:set:audit']"
>停用</el-button>
<el-button v-else-if="set.status === 'S'" type="primary" plain @click="emit('copy')" v-hasPermi="['price:set:add']">复用新建</el-button>
</div>
</div>
</template>
<script setup name="SetDetailHeader">
/**
* 套餐详情 · 页头
* 只负责展示套餐标识 / 状态与派发操作事件,接口调用与确认框由页面处理。
*/
import { SET_STATUS, formatDateRange, isFixedType, setStatusLabel, setStatusTagType, setTypeLabel } from '../../utils/priceSet'
const props = defineProps({
/** 套餐详情对象 */
set: {
type: Object,
required: true
}
})
const emit = defineEmits(['back', 'edit', 'submit', 'approve', 'reject', 'disable', 'copy'])
const statusText = computed(() => setStatusLabel(props.set))
const statusTagType = computed(() => setStatusTagType(props.set))
const dateRange = computed(() => formatDateRange(props.set.effectiveDate, props.set.expireDate))
const editableStatus = computed(() => [SET_STATUS.DRAFT, SET_STATUS.REJECT].includes(props.set.status))
</script>
<style scoped>
.set-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16px;
flex-wrap: wrap;
padding: 16px 20px;
margin-bottom: 16px;
background: #fff;
border: 1px solid #ebeef5;
border-left: 3px solid #1890ff;
border-radius: 8px;
}
.hd-main {
min-width: 0;
}
.hd-line {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.hd-name {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #303133;
line-height: 1.4;
}
.hd-code {
font-family: Consolas, Monaco, monospace;
font-size: 12px;
color: #606266;
background: #f4f4f5;
border: 1px solid #e9e9eb;
border-radius: 4px;
padding: 1px 8px;
}
.hd-meta {
margin-top: 10px;
}
.hd-range {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 13px;
color: #909399;
}
.hd-icon {
font-size: 14px;
}
.hd-actions {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
</style>