1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00

Revert "Set value to filter lookups list (#343)" (#443)

This reverts commit 6258abb6e1518d7d2c79478a430a3dd66aae48c4.
This commit is contained in:
Yamel Senih 2020-04-09 02:10:43 -04:00 committed by GitHub
parent 6258abb6e1
commit b5441183fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 33 deletions

View File

@ -158,14 +158,12 @@ export function getLookup({
export function getLookupList({
tableName,
query,
valuesList,
pageToken,
pageSize
}) {
return Instance.call(this).requestListLookupFromReference({
tableName,
query,
valuesList,
pageToken,
pageSize
})

View File

@ -12,8 +12,6 @@
:allow-create="metadata.isSelectCreated"
:collapse-tags="!isSelectMultiple"
:disabled="isDisabled"
remote
:remote-method="getRemoteList"
@change="preHandleChange"
@visible-change="getDataLookupList"
@clear="clearLookup"
@ -291,6 +289,7 @@ export default {
directQuery: this.metadata.reference.directQuery,
value: this.value
})
// set empty list and empty option
this.changeBlankOption()
const list = []
@ -300,26 +299,7 @@ export default {
// set empty value
this.value = this.blankOption.key
}
},
getRemoteList(value) {
if (!isNaN(value)) {
value = parseInt(value, 10)
}
if (!this.isLoading && String(value.length > 2)) {
setTimeout(() => {
this.isLoading = true
this.$store.dispatch('getLookupListFromServer', {
parentUuid: this.metadata.parentUuid,
containerUuid: this.metadata.containerUuid,
tableName: this.metadata.reference.tableName,
query: this.metadata.reference.query,
valueToFilter: value
})
.then(response => {
this.isLoading = false
})
}, 250)
}
}
}
</script>

View File

@ -92,8 +92,7 @@ const lookup = {
parentUuid,
containerUuid,
tableName,
query,
valueToFilter
query
}) {
if (isEmptyValue(query)) {
return
@ -107,15 +106,9 @@ const lookup = {
isBooleanToString: true
}).value
}
const valuesList = []
if (!isEmptyValue(valueToFilter)) {
valuesList.push(valueToFilter)
}
return getLookupList({
tableName,
query: parsedQuery,
valuesList
query: parsedQuery
})
.then(lookupListResponse => {
const list = []