设备管理-配置编辑 除了输出地址、输入地址外,其他的变为输入框,限制输入最大字符数为4,且每位必须是16进制数

This commit is contained in:
fan 2020-01-07 09:27:49 +08:00
parent 2d78605468
commit 9944bdef33

View File

@ -127,11 +127,14 @@ export default {
} }
}); });
let flag = false; let flag = false;
for (var i = 0; i < value.length; i++) { if (value && value.length) {
const ascallCode = value.charCodeAt(i); for (var i = 0; i < value.length; i++) {
if (ascallCode > 70 || ascallCode < 48 || (ascallCode > 57 && ascallCode < 65)) { const ascallCode = value.charCodeAt(i);
flag = true; if (ascallCode > 70 || ascallCode < 48 || (ascallCode > 57 && ascallCode < 65)) {
flag = true;
}
} }
} }
if (!value) { if (!value) {
callback(new Error(rule.messageEmpty)); callback(new Error(rule.messageEmpty));