From e4a8926b5315a51b10e883cfd4634cd90c568418 Mon Sep 17 00:00:00 2001 From: 346149741 <346149741@qq.com> Date: 星期二, 03 九月 2024 14:01:53 +0800 Subject: [PATCH] 去掉字段 --- policy/policyApply/policyApply.vue | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/policy/policyApply/policyApply.vue b/policy/policyApply/policyApply.vue index 69b4c6d..7d8193d 100644 --- a/policy/policyApply/policyApply.vue +++ b/policy/policyApply/policyApply.vue @@ -341,8 +341,20 @@ this.$refs.perpage.open(this.list) }, selectValue(value) { - this.form.peers = value - + value.forEach(val => { + this.form.peers.push(val) + }); + this.form.peers = this.uniqueArrJson(this.form.peers,'peerId') + }, + uniqueArrJson(arr,key) { + var newobj = {},newArr = []; + for(var i=0;i<arr.length;i++){ + var item = arr[i]; + if(!newobj[item[key]]){ + newobj[item[key]] = newArr.push(item); + } + } + return newArr; } } } -- Gitblit v1.9.1