fix: bug
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 2m9s

This commit is contained in:
sexygoat
2026-04-23 14:59:05 +08:00
parent a9467e8a0c
commit a5e76313cb
28 changed files with 1284 additions and 702 deletions

View File

@@ -3,9 +3,12 @@
<template #header>
<div class="card-header">
<span>套餐列表</span>
<div class="card-header-right">
<ElButton type="primary" @click="handleShowRecharge">套餐充值</ElButton>
</div>
</div>
</template>
<div class="package-table-wrapper">
<div v-loading="loading" class="package-table-wrapper">
<!-- 绑定设备提示 -->
<ElEmpty v-if="props.boundDeviceId" :image-size="100">
<template #description>
@@ -36,7 +39,7 @@
</ElTableColumn>
<ElTableColumn label="套餐价格" width="120">
<template #default="scope">
{{ formatAmount(scope.row.package_price || 0) }}
{{ formatAmount(scope.row.paid_amount || scope.row.package_price || 0) }}
</template>
</ElTableColumn>
<ElTableColumn prop="status_name" label="套餐状态" width="100">
@@ -104,6 +107,11 @@
{{ formatDateTime(scope.row.expires_at) }}
</template>
</ElTableColumn>
<ElTableColumn prop="created_at" label="创建时间" width="170" show-overflow-tooltip>
<template #default="scope">
{{ formatDateTime(scope.row.created_at) }}
</template>
</ElTableColumn>
</ElTable>
<ElPagination
v-model:current-page="pagination.page"
@@ -152,6 +160,7 @@
pageSize?: number
boundDeviceId?: number
boundDeviceNo?: string
loading?: boolean
}
const props = withDefaults(defineProps<Props>(), {
@@ -159,12 +168,14 @@
page: 1,
pageSize: 10,
boundDeviceId: undefined,
boundDeviceNo: ''
boundDeviceNo: '',
loading: false
})
// Emits
interface Emits {
(e: 'showDailyRecords', payload: { packageRow: PackageInfo }): void
(e: 'showRecharge'): void
(e: 'page-change', page: number): void
(e: 'size-change', size: number): void
(e: 'navigateToDevice', deviceNo: string): void
@@ -212,6 +223,10 @@
emit('showDailyRecords', { packageRow })
}
const handleShowRecharge = () => {
emit('showRecharge')
}
// 页码变化
const handlePageChange = (page: number) => {
emit('page-change', page)
@@ -229,6 +244,13 @@
width: 100%;
overflow: hidden; // 防止内容溢出
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.package-table-wrapper {
.table-scroll-container {
overflow-x: auto;