优化新增点单智能推荐
This commit is contained in:
@@ -154,7 +154,7 @@ export function filterNumberInput(value, isIntegerOnly = false) {
|
||||
let filtered = value.replace(/[^\d.]/g, "");
|
||||
|
||||
// 整数模式处理
|
||||
if (isIntegerOnly) {
|
||||
if (isIntegerOnly !== false) {
|
||||
// 移除所有小数点
|
||||
filtered = filtered.replace(/\./g, "");
|
||||
|
||||
@@ -167,8 +167,8 @@ export function filterNumberInput(value, isIntegerOnly = false) {
|
||||
}
|
||||
|
||||
// 最小值限制
|
||||
if (filtered === "0" || parseInt(filtered, 10) < 1) {
|
||||
return "1";
|
||||
if (filtered === isIntegerOnly || parseInt(filtered, 10) < isIntegerOnly) {
|
||||
return isIntegerOnly;
|
||||
}
|
||||
|
||||
return filtered;
|
||||
|
||||
Reference in New Issue
Block a user