1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-13 23:20:12 +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({ export function getLookupList({
tableName, tableName,
query, query,
valuesList,
pageToken, pageToken,
pageSize pageSize
}) { }) {
return Instance.call(this).requestListLookupFromReference({ return Instance.call(this).requestListLookupFromReference({
tableName, tableName,
query, query,
valuesList,
pageToken, pageToken,
pageSize pageSize
}) })

View File

@ -12,8 +12,6 @@
:allow-create="metadata.isSelectCreated" :allow-create="metadata.isSelectCreated"
:collapse-tags="!isSelectMultiple" :collapse-tags="!isSelectMultiple"
:disabled="isDisabled" :disabled="isDisabled"
remote
:remote-method="getRemoteList"
@change="preHandleChange" @change="preHandleChange"
@visible-change="getDataLookupList" @visible-change="getDataLookupList"
@clear="clearLookup" @clear="clearLookup"
@ -291,6 +289,7 @@ export default {
directQuery: this.metadata.reference.directQuery, directQuery: this.metadata.reference.directQuery,
value: this.value value: this.value
}) })
// set empty list and empty option // set empty list and empty option
this.changeBlankOption() this.changeBlankOption()
const list = [] const list = []
@ -300,26 +299,7 @@ export default {
// set empty value // set empty value
this.value = this.blankOption.key 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> </script>

View File

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