feat: less规范化

This commit is contained in:
ZhuRui
2026-07-28 10:54:36 +08:00
parent cffe8de6b0
commit 743549600a
45 changed files with 1953 additions and 2011 deletions
@@ -1,133 +1,130 @@
.form {
:global {
.ant-form-item {
margin-bottom: 16px;
}
.ant-form-item-explain-error {
font-size: 12px;
.bannerFormModalMain {
.form {
:global {
.ant-form-item {
margin-bottom: 16px;
}
.ant-form-item-explain-error {
font-size: 12px;
}
}
}
}
/* ===== 上传 ===== */
.uploader {
position: relative;
}
.uploadCard {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 140px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
background-color: #fafafa;
cursor: pointer;
transition: border-color 0.2s;
gap: 4px;
&:hover {
border-color: #1677ff;
.uploader {
position: relative;
}
}
.uploadCardError {
border-color: #ff4d4f;
}
.uploadCard {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 140px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
background-color: #fafafa;
cursor: pointer;
transition: border-color 0.2s;
gap: 4px;
.uploadIcon {
font-size: 32px;
color: #999;
font-weight: 300;
line-height: 1;
}
.uploadHint {
color: #666;
font-size: 14px;
}
.uploadTip {
color: #999;
font-size: 12px;
text-align: center;
line-height: 1.6;
}
/* ===== 预览 ===== */
.previewWrapper {
position: relative;
width: 100%;
height: 140px;
border: 1px solid #d9d9d9;
border-radius: 6px;
overflow: hidden;
background-color: #f5f5f5;
:global {
.ant-spin-nested-loading,
.ant-spin-container {
width: 100%;
height: 100%;
&:hover {
border-color: #1677ff;
}
}
}
.previewImg {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.uploadCardError {
border-color: #ff4d4f;
}
.uploadAgainBtn {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
color: #fff;
text-align: center;
padding: 4px 0;
cursor: pointer;
font-size: 12px;
user-select: none;
transition: background 0.2s;
.uploadIcon {
font-size: 32px;
color: #999;
font-weight: 300;
line-height: 1;
}
&:hover {
background: rgba(0, 0, 0, 0.65);
.uploadHint {
color: #666;
font-size: 14px;
}
.uploadTip {
color: #999;
font-size: 12px;
text-align: center;
line-height: 1.6;
}
.previewWrapper {
position: relative;
width: 100%;
height: 140px;
border: 1px solid #d9d9d9;
border-radius: 6px;
overflow: hidden;
background-color: #f5f5f5;
:global {
.ant-spin-nested-loading,
.ant-spin-container {
width: 100%;
height: 100%;
}
}
}
.previewImg {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.uploadAgainBtn {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
color: #fff;
text-align: center;
padding: 4px 0;
cursor: pointer;
font-size: 12px;
user-select: none;
transition: background 0.2s;
&:hover {
background: rgba(0, 0, 0, 0.65);
}
}
.tip {
padding: 8px 12px;
margin-bottom: 16px;
background-color: #f0f5ff;
border: 1px solid #d6e4ff;
border-radius: 4px;
color: #1677ff;
font-size: 13px;
}
.timeRow {
display: flex;
gap: 16px;
.timeItem {
flex: 1;
}
}
.footer {
display: flex;
justify-content: flex-end;
gap: 8px;
padding-top: 16px;
border-top: 1px solid #f0f0f0;
margin-top: 8px;
}
}
/* ===== 提示 ===== */
.tip {
padding: 8px 12px;
margin-bottom: 16px;
background-color: #f0f5ff;
border: 1px solid #d6e4ff;
border-radius: 4px;
color: #1677ff;
font-size: 13px;
}
/* ===== 时间行(双列)===== */
.timeRow {
display: flex;
gap: 16px;
.timeItem {
flex: 1;
}
}
/* ===== 底部按钮 ===== */
.footer {
display: flex;
justify-content: flex-end;
gap: 8px;
padding-top: 16px;
border-top: 1px solid #f0f0f0;
margin-top: 8px;
}
@@ -266,6 +266,7 @@ export default defineComponent({
destroyOnClose
footer={null}
centered
wrapClassName={styles.bannerFormModalMain}
>
<Form ref={formRef} layout="vertical" model={formData} class={styles.form} requiredMark>
{/* ===== Banner 标题 ===== */}
+15 -8
View File
@@ -1,14 +1,21 @@
.tableBody {
.eventBannerMain {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
:global {
.ant-spin-nested-loading,
.ant-spin-container,
.ant-table,
.ant-table-container {
height: 100%;
.tableBody {
flex: 1;
min-height: 0;
overflow: hidden;
:global {
.ant-spin-nested-loading,
.ant-spin-container,
.ant-table,
.ant-table-container {
height: 100%;
}
}
}
}
+35 -33
View File
@@ -15,7 +15,7 @@ import { useBannerModel, BANNER_STATUS_OPTIONS } from './model/useBannerModel';
import { useContainerSize } from '@/hooks';
import BannerFormModal from './components/BannerFormModal';
import styles from './index.module.less';
import pageStyles from '@/components/page/pageLayout.module.less';
import pageStyles from '@/assets/styles/pageLayout.module.less';
/**
* bodyCell 渲染函数
@@ -231,39 +231,41 @@ export default defineComponent({
{/* ===== 表格区 ===== */}
<div class={pageStyles.table}>
<div ref={containerRef} class={styles.tableBody}>
<Table
columns={tableColumns}
dataSource={dataSource.value}
loading={loading.value}
scroll={{ x: 'max-content', y: height.value }}
pagination={false}
>
{{
bodyCell: (args: any) =>
renderBodyCell({
...args,
renderJumpType,
renderStatus,
onEdit: handleEdit,
onToggleStatus: confirmToggleStatus,
onDelete: confirmDelete,
}),
}}
</Table>
</div>
<div class={styles.eventBannerMain}>
<div ref={containerRef} class={styles.tableBody}>
<Table
columns={tableColumns}
dataSource={dataSource.value}
loading={loading.value}
scroll={{ x: 'max-content', y: height.value }}
pagination={false}
>
{{
bodyCell: (args: any) =>
renderBodyCell({
...args,
renderJumpType,
renderStatus,
onEdit: handleEdit,
onToggleStatus: confirmToggleStatus,
onDelete: confirmDelete,
}),
}}
</Table>
</div>
{/* 独立分页,右下方 */}
<div class={pageStyles.pagination}>
<Pagination
current={pagination.value.current}
pageSize={pagination.value.pageSize}
total={pagination.value.total}
showSizeChanger
showTotal={(total: number) => `${total}`}
onChange={handlePageChange}
onShowSizeChange={handlePageChange}
/>
{/* 独立分页,右下方 */}
<div class={pageStyles.pagination}>
<Pagination
current={pagination.value.current}
pageSize={pagination.value.pageSize}
total={pagination.value.total}
showSizeChanger
showTotal={(total: number) => `${total}`}
onChange={handlePageChange}
onShowSizeChange={handlePageChange}
/>
</div>
</div>
</div>
@@ -1,59 +1,61 @@
.section {
margin-bottom: 24px;
}
.eventAuditModalMain {
.section {
margin-bottom: 24px;
.section:last-child {
margin-bottom: 0;
}
&:last-child {
margin-bottom: 0;
}
}
.sectionTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
padding-left: 8px;
border-left: 3px solid #1677ff;
}
.sectionTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
padding-left: 8px;
border-left: 3px solid #1677ff;
}
.desc :global(.ant-descriptions-item-label) {
width: 110px;
color: rgba(0, 0, 0, 0.65);
}
.desc {
:global(.ant-descriptions-item-label) {
width: 110px;
color: rgba(0, 0, 0, 0.65);
}
}
// ── 审核操作区域 ──
.auditSection {
margin-top: 24px;
}
.auditSection {
margin-top: 24px;
}
.auditHeader {
display: flex;
align-items: center;
margin-bottom: 16px;
}
.auditHeader {
display: flex;
align-items: center;
margin-bottom: 16px;
}
.auditTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
padding-left: 8px;
border-left: 3px solid #1677ff;
}
.auditTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
padding-left: 8px;
border-left: 3px solid #1677ff;
}
.auditForm {
// 横线分隔标题与表单
border-top: 1px solid #f0f0f0;
padding-top: 16px;
}
.auditForm {
border-top: 1px solid #f0f0f0;
padding-top: 16px;
}
.auditField {
margin-bottom: 16px;
.auditField {
margin-bottom: 16px;
:global(.ant-form-item-label) {
font-weight: 500;
color: rgba(0, 0, 0, 0.65);
&:last-child {
margin-bottom: 0;
}
:global(.ant-form-item-label) {
font-weight: 500;
color: rgba(0, 0, 0, 0.65);
}
}
}
.auditField:last-child {
margin-bottom: 0;
}
@@ -80,6 +80,7 @@ export default defineComponent({
cancelText="取消"
centered
destroyOnClose
wrapClassName={styles.eventAuditModalMain}
>
{/* ===== 基础信息 ===== */}
<div class={styles.section}>
@@ -1,67 +1,68 @@
.section {
margin-bottom: 24px;
}
.eventDetailModalMain {
.section {
margin-bottom: 24px;
.section:last-child {
margin-bottom: 0;
}
&:last-child {
margin-bottom: 0;
}
}
.sectionTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
padding-left: 8px;
border-left: 3px solid #1677ff;
}
.sectionTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
padding-left: 8px;
border-left: 3px solid #1677ff;
}
.textBlock {
font-size: 13px;
line-height: 1.8;
color: rgba(0, 0, 0, 0.65);
white-space: pre-wrap;
background: #fafafa;
padding: 12px 16px;
border-radius: 4px;
border: 1px solid #f0f0f0;
}
.textBlock {
font-size: 13px;
line-height: 1.8;
color: rgba(0, 0, 0, 0.65);
white-space: pre-wrap;
background: #fafafa;
padding: 12px 16px;
border-radius: 4px;
border: 1px solid #f0f0f0;
}
// Descriptions 列宽稍微压缩一些,避免单标签被挤
.desc :global(.ant-descriptions-item-label) {
width: 110px;
color: rgba(0, 0, 0, 0.65);
}
.desc {
:global(.ant-descriptions-item-label) {
width: 110px;
color: rgba(0, 0, 0, 0.65);
}
}
// 组别信息下的子表格
.group {
margin-bottom: 16px;
}
.group {
margin-bottom: 16px;
.group:last-child {
margin-bottom: 0;
}
&:last-child {
margin-bottom: 0;
}
}
.groupTitle {
font-size: 13px;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 8px;
font-weight: 500;
}
.groupTitle {
font-size: 13px;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 8px;
font-weight: 500;
}
.paginationRow {
display: flex;
justify-content: flex-end;
margin-top: 8px;
}
.paginationRow {
display: flex;
justify-content: flex-end;
margin-top: 8px;
}
// 分组信息列表
.divisionList {
display: flex;
flex-direction: column;
gap: 6px;
}
.divisionList {
display: flex;
flex-direction: column;
gap: 6px;
}
.divisionItem {
font-size: 13px;
color: rgba(0, 0, 0, 0.65);
.divisionItem {
font-size: 13px;
color: rgba(0, 0, 0, 0.65);
}
}
@@ -110,6 +110,7 @@ export default defineComponent({
footer={null}
centered
destroyOnClose
wrapClassName={styles.eventDetailModalMain}
>
{/* ===== 基础信息 ===== */}
<div class={styles.section}>
@@ -1,51 +1,53 @@
.section {
margin-bottom: 20px;
}
.eventRegulationModalMain {
.section {
margin-bottom: 20px;
.section:last-child {
margin-bottom: 0;
}
&:last-child {
margin-bottom: 0;
}
}
.sectionTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 10px;
padding-left: 8px;
border-left: 3px solid #1677ff;
}
.sectionTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 10px;
padding-left: 8px;
border-left: 3px solid #1677ff;
}
.textBlock {
font-size: 13px;
line-height: 1.5;
color: rgba(0, 0, 0, 0.65);
white-space: pre-wrap;
background: #fafafa;
padding: 12px 16px;
border-radius: 4px;
border: 1px solid #f0f0f0;
}
.textBlock {
font-size: 13px;
line-height: 1.5;
color: rgba(0, 0, 0, 0.65);
white-space: pre-wrap;
background: #fafafa;
padding: 12px 16px;
border-radius: 4px;
border: 1px solid #f0f0f0;
}
.imageGrid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12px;
}
.imageGrid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12px;
}
.imageCell {
width: 100%;
aspect-ratio: 3 / 2;
background: #f5f5f5;
border-radius: 4px;
overflow: hidden;
border: 1px solid #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
}
.imageCell {
width: 100%;
aspect-ratio: 3 / 2;
background: #f5f5f5;
border-radius: 4px;
overflow: hidden;
border: 1px solid #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
.imageCell :global(.ant-image) {
width: 100%;
height: 100%;
object-fit: cover;
:global(.ant-image) {
width: 100%;
height: 100%;
object-fit: cover;
}
}
}
@@ -40,6 +40,7 @@ export default defineComponent({
footer={null}
centered
destroyOnClose
wrapClassName={styles.eventRegulationModalMain}
>
{/* 规程文字 */}
<div class={styles.section}>
+15 -12
View File
@@ -1,18 +1,21 @@
/**
* 表格 body 容器:占满 flex 剩余空间,并确保 antd 嵌套 div 逐层传递 height: 100%
* 使得 Table scroll.y = 'calc(100% - 55px)' 中的 100% 能正确解析。
*/
.tableBody {
.eventListMain {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
:global {
.ant-spin-nested-loading,
.ant-spin-container,
.ant-table,
.ant-table-container {
height: 100%;
.tableBody {
flex: 1;
min-height: 0;
overflow: hidden;
:global {
.ant-spin-nested-loading,
.ant-spin-container,
.ant-table,
.ant-table-container {
height: 100%;
}
}
}
}
+33 -31
View File
@@ -26,7 +26,7 @@ import EventRegulationModal from './components/EventRegulationModal';
import EventDetailModal from './components/EventDetailModal';
import EventAuditModal from './components/EventAuditModal';
import styles from './index.module.less';
import pageStyles from '@/components/page/pageLayout.module.less';
import pageStyles from '@/assets/styles/pageLayout.module.less';
const { RangePicker } = DatePicker;
@@ -309,37 +309,39 @@ export default defineComponent({
{/* ===== 表格区 ===== */}
<div class={pageStyles.table}>
<div ref={containerRef} class={styles.tableBody}>
<Table
columns={tableColumns}
dataSource={dataSource.value}
loading={loading.value}
scroll={{ x: 'max-content', y: height.value }}
pagination={false}
>
{{
bodyCell: (args: any) =>
renderBodyCell({
...args,
onView: handleView,
onAudit: handleAudit,
onToggleShelf: handleToggleShelf,
}),
}}
</Table>
</div>
<div class={styles.eventListMain}>
<div ref={containerRef} class={styles.tableBody}>
<Table
columns={tableColumns}
dataSource={dataSource.value}
loading={loading.value}
scroll={{ x: 'max-content', y: height.value }}
pagination={false}
>
{{
bodyCell: (args: any) =>
renderBodyCell({
...args,
onView: handleView,
onAudit: handleAudit,
onToggleShelf: handleToggleShelf,
}),
}}
</Table>
</div>
{/* 独立分页,右下方 */}
<div class={pageStyles.pagination}>
<Pagination
current={pagination.value.current}
pageSize={pagination.value.pageSize}
total={pagination.value.total}
showSizeChanger
showTotal={(total: number) => `${total}`}
onChange={handlePageChange}
onShowSizeChange={handlePageChange}
/>
{/* 独立分页,右下方 */}
<div class={pageStyles.pagination}>
<Pagination
current={pagination.value.current}
pageSize={pagination.value.pageSize}
total={pagination.value.total}
showSizeChanger
showTotal={(total: number) => `${total}`}
onChange={handlePageChange}
onShowSizeChange={handlePageChange}
/>
</div>
</div>
</div>
@@ -1,194 +1,186 @@
// ===== 自定义标题栏 =====
.modalHeader {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 0 16px;
margin-bottom: 16px;
border-bottom: 1px solid #f0f0f0;
}
.orderDetailModalMain {
.modalHeader {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 0 16px;
margin-bottom: 16px;
border-bottom: 1px solid #f0f0f0;
}
.modalTitle {
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
.closeBtn {
width: 28px;
height: 28px;
border: none;
background: transparent;
font-size: 22px;
line-height: 1;
color: rgba(0, 0, 0, 0.45);
cursor: pointer;
border-radius: 4px;
transition: all 0.2s;
&:hover {
background: rgba(0, 0, 0, 0.04);
.modalTitle {
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
}
// ===== 内容区 =====
.modalBody {
padding-top: 0;
}
// ===== 订单信息 grid =====
.infoGrid {
display: grid;
grid-template-columns: repeat(3, 1fr);
row-gap: 12px;
column-gap: 24px;
font-size: 13px;
margin-bottom: 24px;
padding-bottom: 16px;
border-bottom: 1px solid #f0f0f0;
}
.infoItem {
display: flex;
align-items: baseline;
min-width: 0;
}
.infoLabel {
color: rgba(0, 0, 0, 0.65);
flex-shrink: 0;
}
// ===== 通用 section =====
.section {
margin-bottom: 24px;
}
.section:last-child {
margin-bottom: 0;
}
.sectionTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
padding-left: 8px;
border-left: 3px solid #1677ff;
}
// ===== 退款记录 =====
.refundHeader {
margin-bottom: 12px;
}
.refundSummary {
display: flex;
gap: 32px;
font-size: 13px;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
}
/** 固定高度 + 滚动 */
.refundList {
max-height: 320px;
overflow-y: auto;
padding-right: 4px;
// 自定义滚动条样式
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #d9d9d9;
border-radius: 3px;
}
&::-webkit-scrollbar-track {
.closeBtn {
width: 28px;
height: 28px;
border: none;
background: transparent;
font-size: 22px;
line-height: 1;
color: rgba(0, 0, 0, 0.45);
cursor: pointer;
border-radius: 4px;
transition: all 0.2s;
&:hover {
background: rgba(0, 0, 0, 0.04);
color: rgba(0, 0, 0, 0.85);
}
}
.modalBody {
padding-top: 0;
}
.infoGrid {
display: grid;
grid-template-columns: repeat(3, 1fr);
row-gap: 12px;
column-gap: 24px;
font-size: 13px;
margin-bottom: 24px;
padding-bottom: 16px;
border-bottom: 1px solid #f0f0f0;
}
.infoItem {
display: flex;
align-items: baseline;
min-width: 0;
}
.infoLabel {
color: rgba(0, 0, 0, 0.65);
flex-shrink: 0;
}
.section {
margin-bottom: 24px;
&:last-child {
margin-bottom: 0;
}
}
.sectionTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
padding-left: 8px;
border-left: 3px solid #1677ff;
}
.refundHeader {
margin-bottom: 12px;
}
.refundSummary {
display: flex;
gap: 32px;
font-size: 13px;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
}
.refundList {
max-height: 320px;
overflow-y: auto;
padding-right: 4px;
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #d9d9d9;
border-radius: 3px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
}
.refundCard {
padding: 14px 16px;
margin-bottom: 12px;
background: #fafafa;
border: 1px solid #f0f0f0;
border-radius: 6px;
&:last-child {
margin-bottom: 0;
}
}
.refundCardHeader {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
padding-bottom: 10px;
border-bottom: 1px dashed #e0e0e0;
}
.refundIndex {
font-size: 13px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
}
.refundCardBody {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 6px 24px;
font-size: 13px;
color: rgba(0, 0, 0, 0.65);
line-height: 1.8;
}
.refundCol {
min-width: 0;
}
.refundAmount {
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
}
.partialMark {
margin-left: 4px;
color: #fa8c16;
font-size: 12px;
}
.refundEmpty {
padding: 32px 0;
text-align: center;
font-size: 13px;
color: rgba(0, 0, 0, 0.45);
background: #fafafa;
border-radius: 6px;
border: 1px dashed #e0e0e0;
}
.refundPagination {
display: flex;
justify-content: flex-end;
margin-top: 12px;
}
.modalFooter {
display: flex;
justify-content: flex-end;
gap: 12px;
padding-top: 16px;
margin-top: 8px;
border-top: 1px solid #f0f0f0;
}
}
.refundCard {
padding: 14px 16px;
margin-bottom: 12px;
background: #fafafa;
border: 1px solid #f0f0f0;
border-radius: 6px;
}
.refundCard:last-child {
margin-bottom: 0;
}
.refundCardHeader {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
padding-bottom: 10px;
border-bottom: 1px dashed #e0e0e0;
}
.refundIndex {
font-size: 13px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
}
.refundCardBody {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 6px 24px;
font-size: 13px;
color: rgba(0, 0, 0, 0.65);
line-height: 1.8;
}
.refundCol {
min-width: 0;
}
.refundAmount {
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
}
.partialMark {
margin-left: 4px;
color: #fa8c16;
font-size: 12px;
}
.refundEmpty {
padding: 32px 0;
text-align: center;
font-size: 13px;
color: rgba(0, 0, 0, 0.45);
background: #fafafa;
border-radius: 6px;
border: 1px dashed #e0e0e0;
}
// 分页:右下角
.refundPagination {
display: flex;
justify-content: flex-end;
margin-top: 12px;
}
// ===== 底部按钮区 =====
.modalFooter {
display: flex;
justify-content: flex-end;
gap: 12px;
padding-top: 16px;
margin-top: 8px;
border-top: 1px solid #f0f0f0;
}
// ===== Modal 外层包裹:去除 antd 默认内边距,让自定义标题贴合 =====
.orderModalWrap {
:global(.ant-modal-body) {
padding-top: 16px;
@@ -128,142 +128,144 @@ export default defineComponent({
closable={false}
wrapClassName={styles.orderModalWrap}
>
{/* ===== 自定义标题栏 ===== */}
<div class={styles.modalHeader}>
<span class={styles.modalTitle}></span>
<button class={styles.closeBtn} onClick={props.onClose} aria-label="关闭">
×
</button>
</div>
<div class={styles.modalBody}>
{/* ===== 订单信息 ===== */}
<div class={styles.infoGrid}>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.eventName}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.orderId}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.orderTime}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.payTime}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.totalAmount?.toFixed(2)}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{(props.record?.discountAmount || 0).toFixed(2)}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.paidAmount?.toFixed(2)}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}>退</span>
<span>{props.record?.refundAmount?.toFixed(2)}</span>
</div>
<div class={styles.orderDetailModalMain}>
{/* ===== 自定义标题栏 ===== */}
<div class={styles.modalHeader}>
<span class={styles.modalTitle}></span>
<button class={styles.closeBtn} onClick={props.onClose} aria-label="关闭">
×
</button>
</div>
{/* ===== 选手信息 ===== */}
<div class={styles.section}>
<div class={styles.sectionTitle}></div>
<Table
columns={PLAYER_COLUMNS}
dataSource={props.record?.players || []}
size="small"
bordered
pagination={false}
scroll={{ x: 'max-content' }}
/>
</div>
{/* ===== 退款记录 ===== */}
<div class={styles.section}>
<div class={styles.refundHeader}>
<span class={styles.sectionTitle}>退</span>
<div class={styles.modalBody}>
{/* ===== 订单信息 ===== */}
<div class={styles.infoGrid}>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.eventName}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.orderId}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.orderTime}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.payTime}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.totalAmount?.toFixed(2)}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{(props.record?.discountAmount || 0).toFixed(2)}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}></span>
<span>{props.record?.paidAmount?.toFixed(2)}</span>
</div>
<div class={styles.infoItem}>
<span class={styles.infoLabel}>退</span>
<span>{props.record?.refundAmount?.toFixed(2)}</span>
</div>
</div>
{hasRefund.value ? (
<>
<div class={styles.refundSummary}>
<span>退{totalRefunded.value.toFixed(2)}</span>
<span>退{refundRecords.value.length}</span>
</div>
{/* 固定高度 + 内部滚动 */}
<div class={styles.refundList}>
{pagedRefunds.value.map((r, idx) => {
const statusInfo = REFUND_STATUS_MAP[r.status] || {
label: '-',
color: 'default',
};
const realIdx = (refundPage.value - 1) * refundPageSize.value + idx + 1;
return (
<div key={r.key} class={styles.refundCard}>
<div class={styles.refundCardHeader}>
<span class={styles.refundIndex}>{realIdx}退</span>
<Tag color={statusInfo.color}>{statusInfo.label}</Tag>
</div>
<div class={styles.refundCardBody}>
<div class={styles.refundCol}>
<div>
退
<span class={styles.refundAmount}>
¥{r.amount.toFixed(2)}
{r.isPartial && (
<span class={styles.partialMark}>退</span>
)}
</span>
{/* ===== 选手信息 ===== */}
<div class={styles.section}>
<div class={styles.sectionTitle}></div>
<Table
columns={PLAYER_COLUMNS}
dataSource={props.record?.players || []}
size="small"
bordered
pagination={false}
scroll={{ x: 'max-content' }}
/>
</div>
{/* ===== 退款记录 ===== */}
<div class={styles.section}>
<div class={styles.refundHeader}>
<span class={styles.sectionTitle}>退</span>
</div>
{hasRefund.value ? (
<>
<div class={styles.refundSummary}>
<span>退{totalRefunded.value.toFixed(2)}</span>
<span>退{refundRecords.value.length}</span>
</div>
{/* 固定高度 + 内部滚动 */}
<div class={styles.refundList}>
{pagedRefunds.value.map((r, idx) => {
const statusInfo = REFUND_STATUS_MAP[r.status] || {
label: '-',
color: 'default',
};
const realIdx = (refundPage.value - 1) * refundPageSize.value + idx + 1;
return (
<div key={r.key} class={styles.refundCard}>
<div class={styles.refundCardHeader}>
<span class={styles.refundIndex}>{realIdx}退</span>
<Tag color={statusInfo.color}>{statusInfo.label}</Tag>
</div>
<div class={styles.refundCardBody}>
<div class={styles.refundCol}>
<div>
退
<span class={styles.refundAmount}>
¥{r.amount.toFixed(2)}
{r.isPartial && (
<span class={styles.partialMark}>退</span>
)}
</span>
</div>
<div>{r.applyTime}</div>
<div>{r.completeTime || '-'}</div>
</div>
<div class={styles.refundCol}>
<div>退{r.method}</div>
<div>退{r.thirdPartyNo || '-'}</div>
</div>
<div>{r.applyTime}</div>
<div>{r.completeTime || '-'}</div>
</div>
<div class={styles.refundCol}>
<div>退{r.method}</div>
<div>退{r.thirdPartyNo || '-'}</div>
</div>
</div>
</div>
);
})}
</div>
<div class={styles.refundPagination}>
<Pagination
current={refundPage.value}
pageSize={refundPageSize.value}
total={refundRecords.value.length}
showSizeChanger={false}
size="small"
onChange={handleRefundPageChange}
/>
</div>
</>
);
})}
</div>
<div class={styles.refundPagination}>
<Pagination
current={refundPage.value}
pageSize={refundPageSize.value}
total={refundRecords.value.length}
showSizeChanger={false}
size="small"
onChange={handleRefundPageChange}
/>
</div>
</>
) : (
<div class={styles.refundEmpty}>退</div>
)}
</div>
</div>
{/* ===== 底部按钮 ===== */}
<div class={styles.modalFooter}>
<Button onClick={props.onClose}></Button>
{hasRefund.value ? (
<Button danger onClick={handleReRefund}>
退
</Button>
) : (
<div class={styles.refundEmpty}>退</div>
<Button type="primary" onClick={handleConfirm}>
</Button>
)}
</div>
</div>
{/* ===== 底部按钮 ===== */}
<div class={styles.modalFooter}>
<Button onClick={props.onClose}></Button>
{hasRefund.value ? (
<Button danger onClick={handleReRefund}>
退
</Button>
) : (
<Button type="primary" onClick={handleConfirm}>
</Button>
)}
</div>
</Modal>
);
},
+32 -29
View File
@@ -1,37 +1,40 @@
/**
* 表格 body 容器:占满 flex 剩余空间,并确保 antd 嵌套 div 逐层传递 height: 100%
* 使得 Table scroll.y = 'calc(100% - 55px)' 中的 100% 能正确解析。
*/
.tableBody {
.eventOrdersMain {
flex: 1;
min-height: 0;
overflow: hidden;
:global {
.ant-spin-nested-loading,
.ant-spin-container,
.ant-table,
.ant-table-container {
height: 100%;
}
}
}
.summaryBar {
flex-shrink: 0;
display: flex;
align-items: center;
gap: 20px;
padding: 12px 16px;
font-size: 14px;
color: #1a1a1a;
flex-direction: column;
.summaryItem {
font-weight: 500;
.summaryBar {
flex-shrink: 0;
display: flex;
align-items: center;
gap: 20px;
padding: 12px 16px;
font-size: 14px;
color: #1a1a1a;
.summaryLabel {
color: #666;
font-weight: 400;
.summaryItem {
font-weight: 500;
.summaryLabel {
color: #666;
font-weight: 400;
}
}
}
.tableBody {
flex: 1;
min-height: 0;
overflow: hidden;
:global {
.ant-spin-nested-loading,
.ant-spin-container,
.ant-table,
.ant-table-container {
height: 100%;
}
}
}
}
+47 -45
View File
@@ -15,7 +15,7 @@ import { useOrderModel, ORDER_STATUS_OPTIONS, REFUND_STATUS_OPTIONS } from './mo
import { useContainerSize, useState } from '@/hooks';
import OrderDetailModal from './components/OrderDetailModal';
import styles from './index.module.less';
import pageStyles from '@/components/page/pageLayout.module.less';
import pageStyles from '@/assets/styles/pageLayout.module.less';
const { RangePicker } = DatePicker;
@@ -203,52 +203,54 @@ export default defineComponent({
{/* ===== 表格区 ===== */}
<div class={pageStyles.table}>
{/* 金额汇总 */}
<div class={styles.summaryBar}>
<span class={styles.summaryItem}>
<span class={styles.summaryLabel}></span>
{summary.value.totalOrderAmount.toFixed(2)}
</span>
<span class={styles.summaryItem}>
<span class={styles.summaryLabel}></span>
{summary.value.totalPaidAmount.toFixed(2)}
</span>
<span class={styles.summaryItem}>
<span class={styles.summaryLabel}>退</span>
{summary.value.totalRefundAmount.toFixed(2)}
</span>
</div>
<div class={styles.eventOrdersMain}>
{/* 金额汇总 */}
<div class={styles.summaryBar}>
<span class={styles.summaryItem}>
<span class={styles.summaryLabel}></span>
{summary.value.totalOrderAmount.toFixed(2)}
</span>
<span class={styles.summaryItem}>
<span class={styles.summaryLabel}></span>
{summary.value.totalPaidAmount.toFixed(2)}
</span>
<span class={styles.summaryItem}>
<span class={styles.summaryLabel}>退</span>
{summary.value.totalRefundAmount.toFixed(2)}
</span>
</div>
<div ref={containerRef} class={styles.tableBody}>
<Table
columns={tableColumns}
dataSource={dataSource.value}
loading={loading.value}
scroll={{ x: 'max-content', y: height.value }}
pagination={false}
>
{{
bodyCell: (args: any) =>
renderBodyCell({
...args,
onView: handleView,
onReRefund: handleReRefund,
}),
}}
</Table>
</div>
<div ref={containerRef} class={styles.tableBody}>
<Table
columns={tableColumns}
dataSource={dataSource.value}
loading={loading.value}
scroll={{ x: 'max-content', y: height.value }}
pagination={false}
>
{{
bodyCell: (args: any) =>
renderBodyCell({
...args,
onView: handleView,
onReRefund: handleReRefund,
}),
}}
</Table>
</div>
{/* 独立分页,右下方 */}
<div class={pageStyles.pagination}>
<Pagination
current={pagination.value.current}
pageSize={pagination.value.pageSize}
total={pagination.value.total}
showSizeChanger
showTotal={(total: number) => `${total}`}
onChange={handlePageChange}
onShowSizeChange={handlePageChange}
/>
{/* 独立分页,右下方 */}
<div class={pageStyles.pagination}>
<Pagination
current={pagination.value.current}
pageSize={pagination.value.pageSize}
total={pagination.value.total}
showSizeChanger
showTotal={(total: number) => `${total}`}
onChange={handlePageChange}
onShowSizeChange={handlePageChange}
/>
</div>
</div>
</div>
+15 -12
View File
@@ -1,18 +1,21 @@
/**
* 表格 body 容器:占满 flex 剩余空间,并确保 antd 嵌套 div 逐层传递 height: 100%
* 使得 Table scroll.y = 'calc(100% - 55px)' 中的 100% 能正确解析。
*/
.tableBody {
.eventUsersMain {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
:global {
.ant-spin-nested-loading,
.ant-spin-container,
.ant-table,
.ant-table-container {
height: 100%;
.tableBody {
flex: 1;
min-height: 0;
overflow: hidden;
:global {
.ant-spin-nested-loading,
.ant-spin-container,
.ant-table,
.ant-table-container {
height: 100%;
}
}
}
}
+31 -29
View File
@@ -13,7 +13,7 @@ import {
import { useUserModel, USER_STATUS_OPTIONS } from './model/useUserModel';
import { useContainerSize } from '@/hooks';
import styles from './index.module.less';
import pageStyles from '@/components/page/pageLayout.module.less';
import pageStyles from '@/assets/styles/pageLayout.module.less';
/**
* bodyCell 渲染函数
@@ -145,35 +145,37 @@ export default defineComponent({
{/* ===== 表格区 ===== */}
<div class={pageStyles.table}>
<div ref={containerRef} class={styles.tableBody}>
<Table
columns={tableColumns}
dataSource={dataSource.value}
loading={loading.value}
scroll={{ x: 'max-content', y: height.value }}
pagination={false}
>
{{
bodyCell: (args: any) =>
renderBodyCell({
...args,
onToggleStatus: handleToggleStatus,
}),
}}
</Table>
</div>
<div class={styles.eventUsersMain}>
<div ref={containerRef} class={styles.tableBody}>
<Table
columns={tableColumns}
dataSource={dataSource.value}
loading={loading.value}
scroll={{ x: 'max-content', y: height.value }}
pagination={false}
>
{{
bodyCell: (args: any) =>
renderBodyCell({
...args,
onToggleStatus: handleToggleStatus,
}),
}}
</Table>
</div>
{/* 独立分页,右下方 */}
<div class={pageStyles.pagination}>
<Pagination
current={pagination.value.current}
pageSize={pagination.value.pageSize}
total={pagination.value.total}
showSizeChanger
showTotal={(total: number) => `${total}`}
onChange={handlePageChange}
onShowSizeChange={handlePageChange}
/>
{/* 独立分页,右下方 */}
<div class={pageStyles.pagination}>
<Pagination
current={pagination.value.current}
pageSize={pagination.value.pageSize}
total={pagination.value.total}
showSizeChanger
showTotal={(total: number) => `${total}`}
onChange={handlePageChange}
onShowSizeChange={handlePageChange}
/>
</div>
</div>
</div>
</div>