update bug1078优化

This commit is contained in:
2026-03-09 10:42:22 +08:00
parent 03c8435b7e
commit fc33e874c6

View File

@@ -63,6 +63,7 @@
v-model="editform.quotaValue"
type="number"
:min="0"
:max="999999"
@keydown="handleKeydown"
></el-input>
<el-select class="w80" v-model="editform.quotaUnit">
@@ -106,6 +107,15 @@ const handleKeydown = (e: KeyboardEvent) => {
if (e.key === '.' || e.key === '-' || e.key === 'e' || e.key === 'E') {
e.preventDefault();
}
// 获取当前输入值
const currentValue = editform.value.quotaValue;
const nextValue = currentValue + e.key;
// 如果输入会导致数值超过999999则阻止输入
if (nextValue && Number(nextValue) > 999999) {
e.preventDefault();
ElMessage.warning('输入值不能超过999999');
}
};
const baseTableRef = ref();