|
@@ -5,7 +5,7 @@
|
|
|
:clearable="clearable"
|
|
|
remote
|
|
|
:multiple="multiple"
|
|
|
- :remote-method="remoteMethod"
|
|
|
+ :remote-method="searchPeople"
|
|
|
:loading="loading"
|
|
|
:size="size"
|
|
|
:placeholder="placeholder"
|
|
@@ -85,10 +85,9 @@ export default {
|
|
|
} else {
|
|
|
this.searchValue = newV
|
|
|
}
|
|
|
- console.log(this.searchValue)
|
|
|
const type = Object.prototype.toString.call(this.searchValue)
|
|
|
if (type.indexOf('Array') < 0) {
|
|
|
- this.remoteMethod(this.searchValue)
|
|
|
+ this.searchPeople(this.searchValue)
|
|
|
} else if (type.indexOf('Array') > 0 && this.searchValue.length > 0 && this.firstGetArr) {
|
|
|
this.initMore(this.searchValue)
|
|
|
this.firstGetArr = false
|
|
@@ -104,6 +103,10 @@ export default {
|
|
|
remoteMethod: _.debounce(function(query) {
|
|
|
query !== '' ? this.getMember(query) : this.options = []
|
|
|
}, 2000),
|
|
|
+ searchPeople(query) {
|
|
|
+ this.loading = true
|
|
|
+ this.remoteMethod(query)
|
|
|
+ },
|
|
|
initMore(arr) { // 当多人时候,对数组每一个人员进行搜索
|
|
|
if (this.multiple) {
|
|
|
// for (const item of arr) {
|
|
@@ -124,6 +127,7 @@ export default {
|
|
|
if (res.data === null) {
|
|
|
return
|
|
|
}
|
|
|
+ this.loading = false
|
|
|
const weakMap = new Map()
|
|
|
for (const item of res.data) {
|
|
|
if (!weakMap.has(item.idap)) {
|