From 5be87702c40802abfd8a7d15c6cb78c2221a1d48 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Thu, 2 Jul 2026 10:16:37 +0800 Subject: [PATCH] =?UTF-8?q?2026-07-02=20=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 18 +++++++++++++++--- src/views/modules/oss/ossComponents.vue | 16 ++++++++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/main.js b/src/main.js index 582e151..b3f7e28 100644 --- a/src/main.js +++ b/src/main.js @@ -66,8 +66,12 @@ new Vue({ components: { App }, mounted() { Vue.nextTick(() => { + const rootEl = this && this.$el + if (!rootEl || typeof rootEl.querySelectorAll !== 'function') { + return + } // 在这里调用自定义指令的绑定逻辑 - this.$el.querySelectorAll('[v-highlight-container]').forEach(el => { + rootEl.querySelectorAll('[v-highlight-container]').forEach(el => { highlightContainer.bind.call({ el, bind: {} }, el); }); }); @@ -90,9 +94,13 @@ document.addEventListener('keydown', function(event) { Vue.prototype.$clearHighLight = function () { + const rootEl = this && this.$el + if (!rootEl || typeof rootEl.querySelectorAll !== 'function') { + return + } // 查找所有带有 highlight 类的元素 - const highlightedElements = this.$el.querySelectorAll('.highlight'); + const highlightedElements = rootEl.querySelectorAll('.highlight'); // 移除 highlight 类 highlightedElements.forEach(el => { @@ -102,8 +110,12 @@ Vue.prototype.$clearHighLight = function () { Vue.prototype.$triggerInputEvent = function (inputRef) { + const inputRootEl = inputRef && inputRef.$el + if (!inputRootEl || typeof inputRootEl.querySelector !== 'function') { + return + } - const inputElement = inputRef.$el.querySelector('.el-input__inner'); + const inputElement = inputRootEl.querySelector('.el-input__inner'); if (inputElement) { inputElement.dispatchEvent(new Event('input')); } diff --git a/src/views/modules/oss/ossComponents.vue b/src/views/modules/oss/ossComponents.vue index b31195d..2479306 100644 --- a/src/views/modules/oss/ossComponents.vue +++ b/src/views/modules/oss/ossComponents.vue @@ -225,6 +225,9 @@ export default { return list .map(item => String(item || '').trim()) .filter(item => { + if (!item) { + return false + } if (cache.has(item)) { return false } @@ -318,11 +321,16 @@ export default { const queryList = this.resolveFilterQueryOrderRef3(selectedType) return queryList.length > 0 ? queryList[0] : selectedType } + const directOrderRef3 = String(this.orderRef3 || '').trim() + if (directOrderRef3) { + return directOrderRef3 + } const queryList = this.buildQueryOrderRef3List() - if ((!this.orderRef3 || !String(this.orderRef3).trim()) && queryList.length > 0) { + if (queryList.length > 0) { return queryList[0] } - return this.orderRef3 + // 保持向后兼容:旧模块未传 orderRef3 时允许按空字符串上传 + return '' }, handleUpload(){ this.$nextTick(()=>{ @@ -387,10 +395,10 @@ export default { formData.append('orderRef1', this.orderRef1); formData.append('orderRef2', this.ossForm.orderRef2); const uploadOrderRef3 = this.resolveUploadOrderRef3() - if (!uploadOrderRef3) { + if (this.showOrderRef3Filter && !uploadOrderRef3) { return } - formData.append('orderRef3', uploadOrderRef3); + formData.append('orderRef3', uploadOrderRef3 || ''); formData.append('fileRemark', this.ossForm.remark); if (this.requireFileNoRev){ formData.append('fileNo', this.ossForm.fileNo);