lilei %!s(int64=2) %!d(string=hai) anos
pai
achega
b2f5dbf36c
Modificáronse 1 ficheiros con 8 adicións e 4 borrados
  1. 8 4
      src/views/common/dingDepartUser.js

+ 8 - 4
src/views/common/dingDepartUser.js

@@ -56,10 +56,14 @@ const DingDepartUser = {
       )
     },
     handleChange(value) {
-      console.log(value);
-      this.defaultVal = value;
-      this.$emit('change', value, this.id);
-      this.$emit('input', value);
+      console.log(this.defaultVal,value);
+      const last = value[value.length-1]
+      const has = this.defaultVal.find(item => item.value == last.value)
+      if(!has || this.defaultVal.length > value.length){
+        this.defaultVal = value;
+        this.$emit('change', value, this.id);
+        this.$emit('input', value);
+      }
     },
     // 格式化数据
     formatData(data){