Преглед на файлове

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 = []