From e105f75dc0a2c180db9c9c0740fc01ae02391120 Mon Sep 17 00:00:00 2001 From: liujun Date: Fri, 19 Jan 2024 18:35:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=A5=E5=B9=B2bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 12 ++ .../train/synInfo/components/sendUtil.vue | 118 ++++++++++++++---- 2 files changed, 109 insertions(+), 21 deletions(-) diff --git a/src/main.js b/src/main.js index f9b2e9f..5e9c056 100644 --- a/src/main.js +++ b/src/main.js @@ -54,6 +54,18 @@ Vue.config.productionTip = false Vue.use(Element, { size: Cookies.get('size') || 'small' // set element-ui default size }) + +// 树数据结构去除空子级 +Vue.prototype.removeEmptyChildren = function(data) { + for (let i = 0; i < data.length; i++) { + if (data[i].nodes && data[i].nodes.length > 0) { + this.removeEmptyChildren(data[i].nodes) + } else { + delete data[i].nodes + } + } + return data +} /* eslint-disable no-new */ new Vue({ el: '#app', diff --git a/src/views/train/synInfo/components/sendUtil.vue b/src/views/train/synInfo/components/sendUtil.vue index c1aeff2..6e06834 100644 --- a/src/views/train/synInfo/components/sendUtil.vue +++ b/src/views/train/synInfo/components/sendUtil.vue @@ -5,18 +5,47 @@ :append-to-body="appendToBody" :before-close="beforeClose" title="推送" - width="500px" + width="1000px" destroy-on-close> - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +