feat: 完成前端业务闭环与后端联调

This commit is contained in:
2026-08-24 23:37:56 +08:00
parent c59e36f933
commit 9ad572907b
175 changed files with 10711 additions and 1740 deletions
+9
View File
@@ -39,6 +39,15 @@ export const normalizeOptionalSafeInteger = (value, field) => {
return numericValue
}
export const normalizeOptionalCurrencyNumber = (value, label) => {
if (value === undefined || value === null || value === '') return undefined
const amountText = String(value)
if (!/^(?:0|[1-9]\d{0,9})(?:\.\d{1,2})?$/.test(amountText)) {
throw new TypeError(`${label}必须在 0 至 9999999999.99 之间且最多保留两位小数`)
}
return Number(amountText)
}
export const normalizeResourcePathId = (value, label) => {
if (typeof value === 'string' && /^[1-9]\d*$/.test(value)) return value
if (typeof value === 'number' && Number.isSafeInteger(value) && value > 0) return String(value)