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()}>
}
@@ -335,294 +350,319 @@ export default function ProductRulesPanel() {
return (
- 取消编辑
- ) : null
- }
- bordered={false}
- >
-
+ }
+ 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()
+
{({ getFieldValue }) =>
- getFieldValue('pricingMode') === 'unit' ? (
-
-
-
- ) : (
-
-
-
- )
+ getFieldValue('sharingEnabled') ? (
+
+
+
+ syncSharingRuleForm({
+ sharingTotalQuantity: Number(value) || 0,
+ })
+ }
+ />
+
+
+
+ syncSharingRuleForm({
+ sharingUnitReward: Number(value) || 0,
+ })
+ }
+ />
+
+
+
+ syncSharingRuleForm({
+ sharingTotalAmount: Number(value) || 0,
+ })
+ }
+ />
+
+
+ ) : null
}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
- {({ getFieldValue }) =>
- getFieldValue('sharingEnabled') ? (
-
-
-
- syncSharingRuleForm({
- sharingTotalQuantity: Number(value) || 0,
- })
- }
- />
-
-
-
- syncSharingRuleForm({
- sharingUnitReward: Number(value) || 0,
- })
- }
- />
-
-
-
- syncSharingRuleForm({
- sharingTotalAmount: Number(value) || 0,
- })
- }
- />
-
-
- ) : null
+
+
+
+ setKeyword(event.target.value)}
+ />
+ }
+ loading={rulesQuery.isFetching}
+ onClick={() => rulesQuery.refetch()}
+ >
+ 刷新
+
+
+ }
+ bordered={false}
+ >
+
+ rowKey="ruleId"
+ loading={rulesQuery.isLoading}
+ dataSource={filteredRules}
+ columns={columns}
+ pagination={false}
+ scroll={{ x: 1000, y: 'calc(100vh - 300px)' }}
+ rowClassName={(row) =>
+ editingRule?.ruleId === row.ruleId ? 'product-rule-row-active' : ''
}
-
-
-
-
-
-
-
-
-
-
-
-
- {!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;
}