From afd69c28c278e9617b249ad72244ad2bac2c2093 Mon Sep 17 00:00:00 2001 From: ShenQiLun <97694732@qq.com> Date: Thu, 2 Jul 2026 15:47:55 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"refactor:=E9=80=89=E6=8B=A9=E4=BD=9C?= =?UTF-8?q?=E8=80=85/=E5=87=BA=E7=89=88=E7=A4=BE/=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=97=B6=E5=85=A8=E9=87=8F=E5=88=B7=E6=96=B0=E4=B8=89=E8=80=85?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7ec1b9a50eafa7e27d2635f0d5ecf14043abc229. --- pages/upload/upload.vue | 45 +++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/pages/upload/upload.vue b/pages/upload/upload.vue index dd8ce6c..2bc5b7f 100644 --- a/pages/upload/upload.vue +++ b/pages/upload/upload.vue @@ -1965,8 +1965,7 @@ export default { this.noIsbnCategoryIndex = index var item = this.noIsbnCategoryList[index] this.noIsbnSelectedCategoryValue = item ? item.value : '' - // 选择分类后:重新获取作者/出版社/分类(全部)+重新搜索在售商品 - this.fetchNoIsbnBookData() + // 选择分类后:重新搜索在售商品 this.debouncedReSearch() }, @@ -3491,20 +3490,54 @@ export default { selectNoIsbnAuthor(item) { this.noIsbnAuthor = typeof item === 'string' ? item : (item.showName || '') this.noIsbnAuthorDropdownVisible = false - // 选择作者后:重新获取出版社/分类/作者(全部)+重新搜索在售商品 - this.fetchNoIsbnBookData() + // 选择作者后:重新获取出版社(带作者过滤)+ 重新搜索在售商品 + this.fetchNoIsbnPressesByAuthor(this.noIsbnAuthor) this.debouncedReSearch() }, + // 选择作者后重新获取出版社(按作者过滤) + async fetchNoIsbnPressesByAuthor(author) { + var bookName = (this.noIsbnBookName || '').trim() + if (!bookName || !author) return + try { + var pressList = await searchPresses(bookName, { + phpsessid: this.kongfzToken || '', + author: author + }) + if (pressList.length > 0) { + this.noIsbnPublisherOptions = pressList.slice(0, 20) + } + } catch (e) { + console.error('按作者获取出版社失败:', e) + } + }, + // 无ISBN - 选择出版社 selectNoIsbnPublisher(item) { this.noIsbnPublisher = typeof item === 'string' ? item : (item.showName || '') this.noIsbnPublisherDropdownVisible = false - // 选择出版社后:重新获取出版社/分类/作者(全部)+重新搜索在售商品 - this.fetchNoIsbnBookData() + // 选择出版社后:重新获取作者(按出版社过滤)+ 重新搜索在售商品 + this.fetchNoIsbnAuthorsByPublisher(this.noIsbnPublisher) this.debouncedReSearch() }, + // 选择出版社后重新获取作者(按出版社过滤) + async fetchNoIsbnAuthorsByPublisher(publisher) { + var bookName = (this.noIsbnBookName || '').trim() + if (!bookName || !publisher) return + try { + var authorList = await searchAuthors(bookName, { + phpsessid: this.kongfzToken || '', + publisher: publisher + }) + if (authorList.length > 0) { + this.noIsbnAuthorOptions = authorList.map(function(item) { return item.showName }).slice(0, 20) + } + } catch (e) { + console.error('按出版社获取作者失败:', e) + } + }, + // 无ISBN - 选择开本 selectNoIsbnFormat(item) { this.noIsbnFormat = item