fix(accounting): use single quotes in CSS selector to avoid JSON escaping issues

This commit is contained in:
yumoqing 2026-07-17 15:48:44 +08:00
parent 3cbde03d6e
commit 277e0a7aec

View File

@ -70,7 +70,7 @@
"wid": "self",
"event": "click",
"actiontype": "script",
"script": "var sd=document.querySelector('[name=\"start_date\"]'),ed=document.querySelector('[name=\"end_date\"]');if(!sd||!ed||!sd.value||!ed.value){bricks.show_error({title:'提示',message:'请先选择日期范围'});return;}var u='{{download_url}}?start_date='+encodeURIComponent(sd.value)+'&end_date='+encodeURIComponent(ed.value);fetch(u,{credentials:'include'}).then(function(r){return r.json()}).then(function(d){if(d.status!=='ok'){bricks.show_error({title:'下载失败',message:d.data.message});return;}var b=atob(d.data.content),n=b.length,arr=new Uint8Array(n);for(var i=0;i<n;i++)arr[i]=b.charCodeAt(i);var blob=new Blob([arr],{type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});var a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download=d.data.filename;a.click()}).catch(function(e){bricks.show_error({title:'下载失败',message:e.toString()})}"
"script": "var sd=document.querySelector(\"[name='start_date']\"),ed=document.querySelector(\"[name='end_date']\");if(!sd||!ed||!sd.value||!ed.value){bricks.show_error({title:'提示',message:'请先选择日期范围'});return;}var u='{{download_url}}?start_date='+encodeURIComponent(sd.value)+'&end_date='+encodeURIComponent(ed.value);fetch(u,{credentials:'include'}).then(function(r){return r.json()}).then(function(d){if(d.status!=='ok'){bricks.show_error({title:'下载失败',message:d.data.message});return;}var b=atob(d.data.content),n=b.length,arr=new Uint8Array(n);for(var i=0;i<n;i++)arr[i]=b.charCodeAt(i);var blob=new Blob([arr],{type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});var a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download=d.data.filename;a.click()}).catch(function(e){bricks.show_error({title:'下载失败',message:e.toString()})}"
}
]
}