From d44c6039eac7d6e099117c729715571bcec392cf Mon Sep 17 00:00:00 2001 From: yml2213 Date: Sat, 15 Aug 2026 11:28:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=89=A9=E5=93=81=E8=A7=84=E5=88=99?= =?UTF-8?q?=E9=A1=B5=E5=B7=A6=E5=8F=B3=E5=B8=83=E5=B1=80=EF=BC=8C=E6=8E=A5?= =?UTF-8?q?=E5=8D=95=E5=B9=B3=E5=8F=B0=E7=BB=9F=E8=AE=A1=E6=9D=A1=E7=B2=BE?= =?UTF-8?q?=E7=AE=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 物品规则改为左右布局:左侧编辑/新建表单(加宽、一屏展示无滚动条),右侧可滚动规则列表 - 列表顶部新增搜索(规则标识/商品/SKU/店铺),点击行快速载入编辑,当前行高亮 - 接单平台顶部统计改为单行紧凑统计条,减少页面高度 --- .../pages/admin/AdminWorkerPlatformPage.tsx | 38 +- .../pages/admin/panels/ProductRulesPanel.tsx | 596 ++++++++++-------- apps/frontend/src/styles/main.css | 80 ++- 3 files changed, 414 insertions(+), 300 deletions(-) diff --git a/apps/frontend/src/pages/admin/AdminWorkerPlatformPage.tsx b/apps/frontend/src/pages/admin/AdminWorkerPlatformPage.tsx index c9eb8ce4..03a9b893 100644 --- a/apps/frontend/src/pages/admin/AdminWorkerPlatformPage.tsx +++ b/apps/frontend/src/pages/admin/AdminWorkerPlatformPage.tsx @@ -21,7 +21,6 @@ import { Modal, Select, Space, - Statistic, Switch, Table, Tabs, @@ -141,26 +140,23 @@ function SummaryCards() { }) const summary = summaryQuery.data?.data + const items = [ + { label: '待审核打手', value: summary?.pendingWorkerCount || 0 }, + { label: '待完善订单', value: summary?.pendingMaterialCount || 0 }, + { label: '大厅订单', value: summary?.openOrderCount || 0 }, + { label: '代练中', value: summary?.inProgressOrderCount || 0 }, + ] + return ( -
- - - - - - - - - - - - -
+ + + {items.map((item) => ( + + {item.label} + {item.value} + + ))} + + ) } diff --git a/apps/frontend/src/pages/admin/panels/ProductRulesPanel.tsx b/apps/frontend/src/pages/admin/panels/ProductRulesPanel.tsx index 670d0a23..3cd69c6b 100644 --- a/apps/frontend/src/pages/admin/panels/ProductRulesPanel.tsx +++ b/apps/frontend/src/pages/admin/panels/ProductRulesPanel.tsx @@ -201,6 +201,21 @@ export default function ProductRulesPanel() { } } + const [keyword, setKeyword] = useState('') + + const filteredRules = (rulesQuery.data?.data.items || []).filter((rule) => { + const keywordText = keyword.trim().toLowerCase() + if (!keywordText) return true + return [ + rule.ruleKey, + rule.productName, + rule.skuCode, + rule.provider, + rule.shopId, + rule.categoryName, + ].some((value) => String(value || '').toLowerCase().includes(keywordText)) + }) + function syncSharingRuleForm(next: { sharingTotalQuantity?: number sharingUnitReward?: number @@ -304,7 +319,7 @@ export default function ProductRulesPanel() { width: 104, fixed: 'right', render: (_, row) => ( - + event.stopPropagation()}> - ) : null - } - bordered={false} - > -
+ + {editingRule ? ( + + ) : null} + + + } + bordered={false} > -
- { - const key = String(value || '').trim() - if ( - !editingRule && - (rulesQuery.data?.data.items || []).some( - (rule) => rule.ruleKey === key, - ) - ) { - return Promise.reject(new Error('规则标识已存在,请更换')) - } - return Promise.resolve() + +
+ { + const key = String(value || '').trim() + if ( + !editingRule && + (rulesQuery.data?.data.items || []).some( + (rule) => rule.ruleKey === key, + ) + ) { + return Promise.reject(new Error('规则标识已存在,请更换')) + } + return Promise.resolve() + }, }, - }, - ]} - > - - - - - - - - - - - - - - - - - - - ({ - value: item.categoryId, - label: item.name, - }), - )} - /> - - - - + > + + + + + + + + + + + + + + + + + + + ({ + value: item.categoryId, + label: item.name, + }), + )} + /> + + + + + + {({ getFieldValue }) => + getFieldValue('pricingMode') === 'unit' ? ( + + + + ) : ( + + + + ) + } + + + + + + + + + + + + + + + + + + + + + + + + - - - - {!editingRule ? null : } - - - - } - loading={rulesQuery.isFetching} - onClick={() => rulesQuery.refetch()} - > - 刷新 - - } - bordered={false} - > - - rowKey="ruleId" - loading={rulesQuery.isLoading} - dataSource={rulesQuery.data?.data.items || []} - columns={columns} - pagination={false} - scroll={{ x: 1200 }} - /> - + onRow={(row) => ({ + onClick: () => editRule(row), + title: '点击快速编辑', + })} + /> + +
) } diff --git a/apps/frontend/src/styles/main.css b/apps/frontend/src/styles/main.css index d976edc1..026be470 100644 --- a/apps/frontend/src/styles/main.css +++ b/apps/frontend/src/styles/main.css @@ -1556,6 +1556,27 @@ select { gap: 5px; } +/* 接单平台顶部紧凑统计条 */ +.platform-summary-strip-card { + width: 100%; +} + +.platform-summary-strip-card .ant-card-body { + padding: 8px 16px !important; +} + +.platform-summary-strip-item { + font-size: 13px; + color: rgba(0, 0, 0, 0.65); + white-space: nowrap; +} + +.platform-summary-strip-item strong { + font-size: 16px; + margin-left: 6px; + color: rgba(0, 0, 0, 0.88); +} + .metric-card span, .metric-card small { color: #6b7280; @@ -2373,9 +2394,66 @@ select { width: 100%; } +/* 物品规则:左侧编辑表单 + 右侧可滚动列表 */ +.product-rules-layout { + display: flex; + gap: 16px; + align-items: flex-start; +} + +.product-rules-form-card { + width: 560px; + flex-shrink: 0; +} + +/* 左侧表单一屏展示,不出现滚动条 */ +.product-rules-form-card .ant-card-body { + overflow: visible; +} + +.product-rules-form-card .worker-rule-form .ant-form-item { + margin-bottom: 14px; +} + +.product-rules-form-card .worker-rule-form .ant-form-item-label { + padding-bottom: 2px; +} + +.product-rules-form-card .worker-rule-form .ant-input-textarea textarea { + min-height: 56px !important; +} + +.product-rules-list-card { + flex: 1; + min-width: 0; +} + +.product-rules-list-card .ant-card-body { + max-height: calc(100vh - 150px); + overflow-y: auto; +} + +.product-rules-list-card .ant-table-wrapper { + max-height: calc(100vh - 230px); +} + +.product-rule-row-active > td { + background: #e6f4ff !important; +} + +@media (max-width: 1024px) { + .product-rules-layout { + flex-direction: column; + } + + .product-rules-form-card { + width: 100%; + } +} + .worker-rule-grid { display: grid; - grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }