Commit d139b455 by wangzhihui

fixed

1 parent 1979b544
......@@ -570,9 +570,11 @@ export default {
// 获取当前类型的所有区间
const currentType = item.assessmentType
console.log(currentType, "currentType")
const sameTypeItems = config.itemList.filter(
(i) => i.assessmentType === currentType
)
console.log(sameTypeItems, "sameTypeItems")
// 检查是否有重叠区间
const currentItemRange = [min, max]
......@@ -587,6 +589,7 @@ export default {
if (isNaN(otherMin) || isNaN(otherMax)) continue
const otherRange = [otherMin, otherMax]
console.log(otherRange, "otherRange")
if (this.isOverlapping(currentItemRange, otherRange)) {
callback(new Error("区间与其他配置重叠,请调整"))
......@@ -599,7 +602,8 @@ export default {
isOverlapping(range1, range2) {
const [min1, max1] = range1
const [min2, max2] = range2
return Math.max(min1, min2) <= Math.min(max1, max2)
console.log(range1, range2, Math.max(min1, min2), Math.min(max1, max2))
return Math.max(min1, min2) < Math.min(max1, max2)
},
// 范围校验器
validateRange(rule, value, callback) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!