minor changes

This commit is contained in:
cesare 2025-03-06 18:09:50 +01:00
parent 371ba234db
commit 1253b5001e
1 changed files with 31 additions and 41 deletions

View File

@ -858,7 +858,9 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
if (document.querySelector('#Posizione_fr') != null && if (document.querySelector('#Posizione_fr') != null &&
document.querySelector('#Posizione_fr').value.trim() != '') { document.querySelector('#Posizione_fr').value.trim() != '') {
var posrestr = document.querySelector('#Posizione_fr').value var posrestr = document.querySelector('#Posizione_fr').value
var pospar=parserFiltroPosizione.parse(posrestr.trim()) var pospar = []
try {
pospar = parserFiltroPosizione.parse(posrestr.trim())
if (pospar[1] != null) { if (pospar[1] != null) {
andfilter = andfilter.replace('<=', '=') andfilter = andfilter.replace('<=', '=')
andfilter = andfilter.replace('clfr', 'clfr+' + (parseInt(pospar[1]) - 1)) andfilter = andfilter.replace('clfr', 'clfr+' + (parseInt(pospar[1]) - 1))
@ -866,31 +868,19 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
else { else {
var inter = pospar[0] var inter = pospar[0]
if (inter[0] != null) { if (inter[0] != null) {
andfilter=andfilter.replace('clfr', 'clfr+'+(parseInt(inter[0])-1)) andfilter = andfilter.replace('clfr', 'clfr+' + (parseInt(inter[0])))
} }
if (inter[1] != null) { if (inter[1] != null) {
var newarg=`{ andfilter = andfilter.replace('clto', 'clfr+' + (parseInt(inter[1])))
"type": "operation",
"operator": ">",
"args": [
{
"termType": "Variable",
"value": "clfr"
},
{
"termType": "Variable",
"value": "pos_"
}
]
}`
newarg=newarg.replace("clfr", "clfr+"+parseInt(inter[1]))
var tmpij=JSON.parse(andfilter)
tmpij.expression.args.push(JSON.parse(newarg))
andfilter=JSON.stringify(tmpij)
} }
} }
} }
catch (err) {
console.log(err)
}
}
parsedquery['where'].push(JSON.parse(andfilter)) parsedquery['where'].push(JSON.parse(andfilter))
} }