| | |
| | | } |
| | | }) |
| | | } else { |
| | | console.log(333333) |
| | | item.v.v = 0 |
| | | list.forEach(a => { |
| | | if (a[0].r == item.r) { |
| | |
| | | * @returns 返回布尔值,如果res中每一项都满足与str的比较条件,则返回true,否则返回false |
| | | */ |
| | | function handleMoreParam(res,str,comp){ |
| | | let arr = res.split('/') |
| | | let arr0 = arr.every(item=>{ |
| | | switch (comp){ |
| | | case '>': |
| | | return item > handleFraction(str) |
| | | case '<': |
| | | return item < handleFraction(str) |
| | | case '=': |
| | | return item == handleFraction(str) |
| | | case '≥': |
| | | return item >= handleFraction(str) |
| | | case '≤': |
| | | return item <= handleFraction(str) |
| | | case '±': |
| | | let k = str.split('±') |
| | | return item >= eval((handleFraction(k[0]) - handleFraction(k[1]))) && item <= eval((handleFraction(k[0]) + handleFraction(k[1]))) |
| | | case '~': |
| | | let j = str.split('~') |
| | | return item >= eval(handleFraction((j[0]))) && item <= eval(handleFraction(j[1])) |
| | | case '-': |
| | | let o = str.split('-') |
| | | return item >= eval(handleFraction(o[0])) && item <= eval(handleFraction(o[1])) |
| | | let arr = res.split('/') |
| | | let arr0 = arr.every(item=>{ |
| | | switch (comp){ |
| | | case '>': |
| | | return item > handleFraction(str) |
| | | case '<': |
| | | return item < handleFraction(str) |
| | | case '=': |
| | | return item == handleFraction(str) |
| | | case '≥': |
| | | return item >= handleFraction(str) |
| | | case '≤': |
| | | return item <= handleFraction(str) |
| | | case '±': |
| | | let k = str.split('±') |
| | | return item >= eval((handleFraction(k[0]) - handleFraction(k[1]))) && item <= eval((handleFraction(k[0]) + handleFraction(k[1]))) |
| | | case '~': |
| | | let j = str.split('~') |
| | | return item >= eval(handleFraction((j[0]))) && item <= eval(handleFraction(j[1])) |
| | | case '-': |
| | | let o = str.split('-') |
| | | return item >= eval(handleFraction(o[0])) && item <= eval(handleFraction(o[1])) |
| | | } |
| | | }) |
| | | if(arr0){ |
| | | return true |
| | | }else{ |
| | | return false |
| | | } |
| | | }) |
| | | if(arr0){ |
| | | return true |
| | | }else{ |
| | | return false |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取参数 |
| | |
| | | } |
| | | if(str.includes('&"/"&')){ |
| | | return str.replaceAll('&"/"&', '/').replaceAll('//','') |
| | | }else if(str.includes('/')){ |
| | | return str |
| | | }else{ |
| | | }else { |
| | | return eval(str) |
| | | } |
| | | } catch (error) { |