Merge remote-tracking branch 'origin/dev' into dev

pull/104/head
李强 2023-08-21 11:08:50 +08:00
commit 83c702298a
3 changed files with 53 additions and 48 deletions

View File

@ -351,11 +351,16 @@ class CustomDjangoFilterBackend(DjangoFilterBackend):
queries = []
for search_term_key in filterset.data.keys():
orm_lookup = self.find_filter_lookups(orm_lookups, search_term_key)
# print(search_term_key, orm_lookup)
if not orm_lookup:
if not orm_lookup or filterset.data.get(search_term_key) == '':
continue
query = Q(**{orm_lookup: filterset.data[search_term_key]})
queries.append(query)
filterset_data_len = len(filterset.data.getlist(search_term_key))
if filterset_data_len == 1:
query = Q(**{orm_lookup: filterset.data[search_term_key]})
queries.append(query)
elif filterset_data_len == 2:
orm_lookup += '__range'
query = Q(**{orm_lookup: filterset.data.getlist(search_term_key)})
queries.append(query)
if len(queries) > 0:
conditions.append(reduce(operator.and_, queries))
queryset = queryset.filter(reduce(operator.and_, conditions))

View File

@ -170,26 +170,26 @@ export default {
}
},
watch: {
value: {
handler (value, oldVal) {
// inputv-modelvalue
// watchvaluechange
// changevalueform-data-change
this.$emit('change', value)
this.$emit('input', value)
// currentValue
if (Array.isArray(value) && value.length === 0) {
this.currentValue = null
this.multipleSelection = null
} else {
if (value && this.dispatch) {
this.dispatch('ElFormItem', 'el.form.blur')
}
}
},
deep: true,
immediate: true
},
// value: {
// handler (value, oldVal) {
// // inputv-modelvalue
// // watchvaluechange
// // changevalueform-data-change
// this.$emit('change', value)
// this.$emit('input', value)
// // currentValue
// if (Array.isArray(value) && value.length === 0) {
// this.currentValue = null
// this.multipleSelection = null
// } else {
// if (value && this.dispatch) {
// this.dispatch('ElFormItem', 'el.form.blur')
// }
// }
// },
// deep: true,
// immediate: true
// },
multipleSelection: {
handler (newValue, oldVal) {
const { tableConfig } = this._elProps
@ -202,26 +202,26 @@ export default {
},
deep: true,
immediate: true
},
currentValue (newValue, oldVal) {
const { tableConfig } = this._elProps
const { value } = this.dict
if (newValue) {
if (!tableConfig.multiple) {
if (newValue[0]) {
this.$emit('input', newValue[0][value])
this.$emit('change', newValue[0][value])
}
} else {
console.log(newValue)
const result = newValue.map((item) => {
return item[value]
})
this.$emit('input', result)
this.$emit('change', result)
}
}
}
// currentValue (newValue, oldVal) {
// const { tableConfig } = this._elProps
// const { value } = this.dict
// if (newValue) {
// if (!tableConfig.multiple) {
// if (newValue[0]) {
// this.$emit('input', newValue[0][value])
// this.$emit('change', newValue[0][value])
// }
// } else {
// console.log(newValue)
// const result = newValue.map((item) => {
// return item[value]
// })
// this.$emit('input', result)
// this.$emit('change', result)
// }
// }
// }
},
mounted () {
// currentValue

View File

@ -440,11 +440,11 @@ export default {
this.selected.length === 0
? sizeInMap + 'px'
: Math.max(
tags
? tags.clientHeight + (tags.clientHeight > sizeInMap ? 6 : 0)
: 0,
sizeInMap
) + 'px'
tags
? tags.clientHeight + (tags.clientHeight > sizeInMap ? 6 : 0)
: 0,
sizeInMap
) + 'px'
input.style.height = height
if (this.visible && this.emptyText !== false) {
this.broadcast('ElSelectDropdown', 'updatePopper')