fix:fetchNoIsbnBookData加autoOpen参数,避免选择时重复展开

This commit is contained in:
ShenQiLun 2026-07-02 16:10:09 +08:00
parent 034471733d
commit c3f96e378a

View File

@ -1900,7 +1900,9 @@ export default {
}, },
// //
async fetchNoIsbnBookData() { // @param {boolean} autoOpen /
async fetchNoIsbnBookData(autoOpen) {
if (autoOpen === undefined) autoOpen = true
var bookName = (this.noIsbnBookName || '').trim() var bookName = (this.noIsbnBookName || '').trim()
if (!bookName) return if (!bookName) return
this.noIsbnCategoryLoading = true this.noIsbnCategoryLoading = true
@ -1942,14 +1944,14 @@ export default {
// 20 // 20
if (pressList.length > 0) { if (pressList.length > 0) {
this.noIsbnPublisherOptions = pressList.slice(0, 20) this.noIsbnPublisherOptions = pressList.slice(0, 20)
this.noIsbnPublisherDropdownVisible = true if (autoOpen) this.noIsbnPublisherDropdownVisible = true
} else { } else {
this.noIsbnPublisherOptions = [] this.noIsbnPublisherOptions = []
} }
// 20 // 20
if (authorList.length > 0) { if (authorList.length > 0) {
this.noIsbnAuthorOptions = authorList.map(function(item) { return item.showName }).slice(0, 20) this.noIsbnAuthorOptions = authorList.map(function(item) { return item.showName }).slice(0, 20)
this.noIsbnAuthorDropdownVisible = true if (autoOpen) this.noIsbnAuthorDropdownVisible = true
} else { } else {
this.noIsbnAuthorOptions = [] this.noIsbnAuthorOptions = []
} }
@ -1973,7 +1975,7 @@ export default {
var item = this.noIsbnCategoryList[index] var item = this.noIsbnCategoryList[index]
this.noIsbnSelectedCategoryValue = item ? item.value : '' this.noIsbnSelectedCategoryValue = item ? item.value : ''
// //() + // //() +
this.fetchNoIsbnBookData() this.fetchNoIsbnBookData(false)
this.debouncedReSearch() this.debouncedReSearch()
}, },
@ -3499,7 +3501,7 @@ export default {
this.noIsbnAuthor = typeof item === 'string' ? item : (item.showName || '') this.noIsbnAuthor = typeof item === 'string' ? item : (item.showName || '')
this.noIsbnAuthorDropdownVisible = false this.noIsbnAuthorDropdownVisible = false
// //() + // //() +
this.fetchNoIsbnBookData() this.fetchNoIsbnBookData(false)
this.$nextTick(function() { this.$nextTick(function() {
this.noIsbnPublisherDropdownVisible = true this.noIsbnPublisherDropdownVisible = true
}.bind(this)) }.bind(this))
@ -3512,7 +3514,7 @@ export default {
this.noIsbnSelectedPublisherValue = typeof item === 'object' && item.value ? item.value : '' this.noIsbnSelectedPublisherValue = typeof item === 'object' && item.value ? item.value : ''
this.noIsbnPublisherDropdownVisible = false this.noIsbnPublisherDropdownVisible = false
// //() + // //() +
this.fetchNoIsbnBookData() this.fetchNoIsbnBookData(false)
this.$nextTick(function() { this.$nextTick(function() {
this.noIsbnAuthorDropdownVisible = true this.noIsbnAuthorDropdownVisible = true
}.bind(this)) }.bind(this))