style(frontend): 格式化前端代码以通过pre-push检查

This commit is contained in:
yml2213
2026-09-12 17:47:37 +08:00
parent fea82bff36
commit 111f400bdb
7 changed files with 58 additions and 29 deletions
@@ -1,4 +1,10 @@
import { DeleteOutlined, PlayCircleOutlined, ReloadOutlined, SearchOutlined, SettingOutlined } from '@ant-design/icons'
import {
DeleteOutlined,
PlayCircleOutlined,
ReloadOutlined,
SearchOutlined,
SettingOutlined,
} from '@ant-design/icons'
import { useQuery, useQueryClient } from '@tanstack/react-query'
import {
App,
@@ -58,7 +64,6 @@ export default function ProductMatchPanel() {
const [savingRetention, setSavingRetention] = useState(false)
const [cleaningLogs, setCleaningLogs] = useState(false)
const shopsQuery = useQuery({
queryKey: ['admin-kuaishou-industry-shops', 'product-match'],
queryFn: fetchAdminKuaishouIndustryShops,
@@ -98,10 +103,10 @@ export default function ProductMatchPanel() {
useEffect(() => {
if (matchConfig) {
if (typeof matchConfig.maxMatchLogs === "number") {
if (typeof matchConfig.maxMatchLogs === 'number') {
setMaxLogs(matchConfig.maxMatchLogs)
}
if (typeof matchConfig.matchLogRetentionDays === "number") {
if (typeof matchConfig.matchLogRetentionDays === 'number') {
setRetentionDays(matchConfig.matchLogRetentionDays)
}
}
@@ -115,13 +120,13 @@ export default function ProductMatchPanel() {
maxMatchLogs: maxLogs,
matchLogRetentionDays: retentionDays,
})
message.success("匹配日志保留策略已保存并已执行清理")
message.success('匹配日志保留策略已保存并已执行清理')
await Promise.all([
queryClient.invalidateQueries({ queryKey: ["admin-worker-platform-product-match-config"] }),
queryClient.invalidateQueries({ queryKey: ["admin-worker-platform-product-match-logs"] }),
queryClient.invalidateQueries({ queryKey: ['admin-worker-platform-product-match-config'] }),
queryClient.invalidateQueries({ queryKey: ['admin-worker-platform-product-match-logs'] }),
])
} catch (error) {
message.error(error instanceof Error ? error.message : "保存配置失败")
message.error(error instanceof Error ? error.message : '保存配置失败')
} finally {
setSavingRetention(false)
}
@@ -139,10 +144,10 @@ export default function ProductMatchPanel() {
`成功清理 ${result.totalDeleted} 条历史匹配日志,剩余 ${result.remainingTotal} 条`,
)
await Promise.all([
queryClient.invalidateQueries({ queryKey: ["admin-worker-platform-product-match-logs"] }),
queryClient.invalidateQueries({ queryKey: ['admin-worker-platform-product-match-logs'] }),
])
} catch (error) {
message.error(error instanceof Error ? error.message : "清理日志失败")
message.error(error instanceof Error ? error.message : '清理日志失败')
} finally {
setCleaningLogs(false)
}
@@ -454,19 +459,19 @@ export default function ProductMatchPanel() {
</Space>
<div
style={{
display: "flex",
flexWrap: "wrap",
justifyContent: "space-between",
alignItems: "center",
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'space-between',
alignItems: 'center',
gap: 12,
background: "#fafafa",
padding: "8px 12px",
background: '#fafafa',
padding: '8px 12px',
borderRadius: 6,
border: "1px solid #f0f0f0",
border: '1px solid #f0f0f0',
}}
>
<Space wrap align="center" size={8}>
<SettingOutlined style={{ color: "#1677ff" }} />
<SettingOutlined style={{ color: '#1677ff' }} />
<Typography.Text strong style={{ fontSize: 13 }}>
日志保留策略:
</Typography.Text>
@@ -943,15 +943,26 @@ export default function WorkOrdersPanel() {
</Typography.Text>
</Space>
<Space size={4} align="center">
<Typography.Text type="secondary" style={{ fontSize: 12 }}>工单号:</Typography.Text>
<Typography.Text copyable={{ text: row.workOrderNo || getDisplayOrderNo(row) }} style={{ fontSize: 12, fontWeight: 500 }}>
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
工单号:
</Typography.Text>
<Typography.Text
copyable={{ text: row.workOrderNo || getDisplayOrderNo(row) }}
style={{ fontSize: 12, fontWeight: 500 }}
>
{row.workOrderNo || getDisplayOrderNo(row)}
</Typography.Text>
</Space>
{row.platformOrderId ? (
<Space size={4} align="center">
<Typography.Text type="secondary" style={{ fontSize: 12 }}>平台号:</Typography.Text>
<Typography.Text type="secondary" copyable={{ text: row.platformOrderId }} style={{ fontSize: 12 }}>
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
平台号:
</Typography.Text>
<Typography.Text
type="secondary"
copyable={{ text: row.platformOrderId }}
style={{ fontSize: 12 }}
>
{row.platformOrderId}
</Typography.Text>
</Space>