From de39c93f7437f64303fd6df75c6776d85b60e384 Mon Sep 17 00:00:00 2001 From: gaoluyang <gaoluyang@rengu.cc> Date: 星期四, 11 七月 2024 09:29:41 +0800 Subject: [PATCH] 科学计数法逻辑修改 --- static/js/worker.js | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/static/js/worker.js b/static/js/worker.js index 146cb61..312648a 100644 --- a/static/js/worker.js +++ b/static/js/worker.js @@ -83,7 +83,7 @@ if (m.includes('=')) { let str = handleFraction(m.split('=')[1]) if(typeof res == 'string'&&typeof str == 'string'){ - if(item.v.f&&typeof(item.v.f)=='string'&&item.v.f.includes('&"/"&')){ + if(res.includes('/')){ return handleMoreParam(res,m.split('=')[1],'=') }else{ return res.trim() == str.trim() @@ -92,63 +92,64 @@ return eval(res) == eval(str) } } else if (m.includes('鈮�')) { - if(item.v.f&&typeof(item.v.f)=='string'&&item.v.f.includes('&"/"&')){ + if(typeof res =='string'&&res.includes('/')){ return handleMoreParam(res,m.split('鈮�')[1],'鈮�') }else{ let str = handleFraction(m.split('鈮�')[1]) return eval(res) >= eval(str) } }else if (m.includes('鈮�')) { - if(item.v.f&&typeof(item.v.f)=='string'&&item.v.f.includes('&"/"&')){ + if(typeof res =='string'&&res.includes('/')){ return handleMoreParam(res,m.split('鈮�')[1],'鈮�') }else{ let str = handleFraction(m.split('鈮�')[1]) return eval(res) <= eval(str) } }else if (m.includes('<')) { - if(item.v.f&&typeof(item.v.f)=='string'&&item.v.f.includes('&"/"&')){ + if(typeof res =='string'&&res.includes('/')){ return handleMoreParam(res,m.split('<')[1],'<') }else{ let str = handleFraction(m.split('<')[1]) return eval(res) < eval(str) } }else if (m.includes('>')) { - if(item.v.f&&typeof(item.v.f)=='string'&&item.v.f.includes('&"/"&')){ + if(typeof res =='string'&&res.includes('/')){ return handleMoreParam(res,m.split('>')[1],'>') }else{ let str = handleFraction(m.split('>')[1]) return eval(res) > eval(str) } }else if (m.includes('~')) { - if(item.v.f&&typeof(item.v.f)=='string'&&item.v.f.includes('&"/"&')){ + if(typeof res =='string'&&res.includes('/')){ return handleMoreParam(res,m,'~') }else{ let k = m.split('~') return eval(res) >= eval(handleFraction((k[0]))) && eval(res) <= eval(handleFraction(k[1])) } }else if(m.includes('-')){ - if(res.includes('/')){ + if(typeof res =='string'&&res.includes('/')){ return handleMoreParam(res,m,'-') }else{ let k = m.split('-') + console.log(k,eval(res),eval(res) >= eval(handleFraction(k[0])) && eval(res) <= eval(handleFraction(k[1]))) return eval(res) >= eval(handleFraction(k[0])) && eval(res) <= eval(handleFraction(k[1])) } }else if(m.includes('卤')){ - if(item.v.f&&typeof(item.v.f)=='string'&&item.v.f.includes('&"/"&')){ + if(typeof res =='string'&&res.includes('/')){ return handleMoreParam(res,m,'卤') }else{ let k = m.split('卤') return eval(res) >= eval((handleFraction(k[0]) - handleFraction(k[1]))) && eval(res) <= eval((handleFraction(k[0]) + handleFraction(k[1]))) } }else if(m.includes('锛�')){ - if(item.v.f&&typeof(item.v.f)=='string'&&item.v.f.includes('&"/"&')){ + if(typeof res =='string'&&res.includes('/')){ return handleMoreParam(res,m.split('锛�')[1],'>') }else{ let str = handleFraction(m.split('锛�')[1]) return eval(res) > eval(str) } }else if(m.includes('锛�')){ - if(item.v.f&&typeof(item.v.f)=='string'&&item.v.f.includes('&"/"&')){ + if(typeof res =='string'&&res.includes('/')){ return handleMoreParam(res,m.split('锛�')[1],'<') }else{ let str = handleFraction(m.split('锛�')[1]) -- Gitblit v1.9.3