Elements-SY

modify

......@@ -111,17 +111,17 @@ export default {
}
}
},
// Ursa校验
// Ursa校验 使用JavaScript写一个匹配字母的表达式
validateUrsa(ursaMark, ursa) {
// 分隔字符串并且转数组&去除数组空字符串
let ursaList = ursa.split(";").filter((str) => str !== "");
// 是否有重复的
let repeat = new Set(ursaList).size !== ursaList.length;
// 校验开头以字母开头下划线结尾的/^[a-zA-Z]*;$/ 和 校验开头以字母开头的/^[a-zA-Z]*;$/
// 校验开头以字母开头下划线结尾的/^[a-zA-Z]*_$/ 和 校验开头以字母开头的/^[a-zA-Z]*$/
let inUrsa = ursaList.every((item) =>
ursaMark
? /^[a-zA-Z][0-9]*_$/.test(item)
: /^[a-zA-Z][0-9]*$/.test(item)
? /^[A-Z][0-9]*_$/.test(item)
: /^[A-Z][0-9]*$/.test(item)
);
const ursaInfo = {
ursaMark: ursaMark, // Boolean ursa包含/不包含
......