From bfbced1434833586988c36fe2670527bb5b2274d Mon Sep 17 00:00:00 2001 From: 346149741 <346149741@qq.com> Date: 星期二, 27 八月 2024 11:59:52 +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