瀏覽代碼

Fix: 用户组件刷新问题

chris 2 年之前
父節點
當前提交
1f2ca9b2b3
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. 7 4
      src/views/modules/common/user-components.vue

+ 7 - 4
src/views/modules/common/user-components.vue

@@ -91,10 +91,13 @@ export default {
           }
           this.noMore = data.data.pageUsers.records.length >= 10
           data.data.pageUsers.records.forEach(item => {
-            this.options.push({
-              label: item.name + ' (' + item.orgName + ')',
-              value: item.userId
-            })
+            let i = this.options.findIndex(i => i.value === item.userId)
+            if (i === -1) {
+              this.options.push({
+                label: item.name + ' (' + item.orgName + ')',
+                value: item.userId
+              })
+            }
           })
         } else {
           this.options = []