From 4bebcf7fcbdb1a07a02f26b550e6f387f32e5247 Mon Sep 17 00:00:00 2001 From: hjhan Date: Wed, 29 Jul 2026 16:32:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(bundle):=20bundle.js=20=E7=BA=B3=E5=85=A5?= =?UTF-8?q?=20ENTER=20=E4=BA=8B=E4=BB=B6=E6=94=B9=E5=8A=A8=E5=B9=B6?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=20ZWNBSP=EF=BC=9BMyJs.js=20=E5=89=A5?= =?UTF-8?q?=E7=A6=BB=20BOM=20[EQD-6838]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpWeb/wwwroot/Scripts/MyJs.js | 2 +- YLErpWeb/wwwroot/Statics/bundles/bundle.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/YLErpWeb/wwwroot/Scripts/MyJs.js b/YLErpWeb/wwwroot/Scripts/MyJs.js index 67d1ee4c..a8d98099 100644 --- a/YLErpWeb/wwwroot/Scripts/MyJs.js +++ b/YLErpWeb/wwwroot/Scripts/MyJs.js @@ -1,4 +1,4 @@ -$(function () { +$(function () { try { $.datepicker._gotoToday = function (id) { $(id).datepicker('setDate', new Date()).datepicker('hide').blur(); diff --git a/YLErpWeb/wwwroot/Statics/bundles/bundle.js b/YLErpWeb/wwwroot/Statics/bundles/bundle.js index 06ac26d4..cae56fdf 100644 --- a/YLErpWeb/wwwroot/Statics/bundles/bundle.js +++ b/YLErpWeb/wwwroot/Statics/bundles/bundle.js @@ -14389,6 +14389,7 @@ $.fn.selectpicker.Constructor.DEFAULTS = Object.assign($.fn.selectpicker.Constru if (!event) return false; _chnInput = -1; + this._enterFired = false; // 每次按键先清 Enter 标记;仅在回车分支重新置位,避免误触发 let charCode = event.which || event.keyCode; @@ -14422,6 +14423,7 @@ $.fn.selectpicker.Constructor.DEFAULTS = Object.assign($.fn.selectpicker.Constru return _options.precision > 0 && !event.shiftKey && checkDotInput.call(this); case 13: //enter case 108: //enter + this._enterFired = true; // 标记回车触发,供 __change 区分"回车"与"失焦" $(this).blur(); return true; case 67: //ctrl+c @@ -14526,7 +14528,9 @@ $.fn.selectpicker.Constructor.DEFAULTS = Object.assign($.fn.selectpicker.Constru else if (_options.append === '‱') f /= 10000; } - _options.onchange && _options.onchange(f, this.value); + let isEnter = !!this._enterFired; + this._enterFired = false; + _options.onchange && _options.onchange(f, this.value, isEnter); } //功能禁用 @@ -14600,9 +14604,10 @@ $.fn.selectpicker.Constructor.DEFAULTS = Object.assign($.fn.selectpicker.Constru this.inputctrl.setValue(this.value) }, methods: { - onchange(value, text) { + onchange(value, text, isEnter) { this.init = false; this.$emit('input', this.ret_type === 1 ? text : value); + if (isEnter) this.$emit('enter', this.ret_type === 1 ? text : value); } }, watch: {