fix: changed→blur, 移除css:childrensize

This commit is contained in:
yumoqing 2026-06-29 16:11:27 +08:00
parent 0eba657ce4
commit 65bbe39477

View File

@ -60,7 +60,6 @@
"options": { "options": {
"width": "22%", "width": "22%",
"show_label": false, "show_label": false,
"css": "childrensize",
"submit_url": "{{entire_url('./save_discount.dspy')}}", "submit_url": "{{entire_url('./save_discount.dspy')}}",
"fields": [ "fields": [
{"name": "discountid", "uitype": "hide", "value": "{{params_kw.discountid}}"}, {"name": "discountid", "uitype": "hide", "value": "{{params_kw.discountid}}"},
@ -72,7 +71,7 @@
"binds": [ "binds": [
{ {
"wid": "self", "wid": "self",
"event": "changed", "event": "blur",
"actiontype": "script", "actiontype": "script",
"target": "self", "target": "self",
"script": "var form = this.target; var d = form.getValue(); var old = form._last_val; if (d.discount === old) return; form._last_val = d.discount; fetch(form.options.submit_url, {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify(d)}).then(function(r){ return r.json(); }).then(function(resp){ if (resp.widgettype === 'Error') bricks.show_error(resp.options); else console.log('discount saved'); }).catch(function(e){ console.error(e); });" "script": "var form = this.target; var d = form.getValue(); var old = form._last_val; if (d.discount === old) return; form._last_val = d.discount; fetch(form.options.submit_url, {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify(d)}).then(function(r){ return r.json(); }).then(function(resp){ if (resp.widgettype === 'Error') bricks.show_error(resp.options); else console.log('discount saved'); }).catch(function(e){ console.error(e); });"