From 9f296e337b3dcf89b47b084cadb6d5ac5ba58d8b Mon Sep 17 00:00:00 2001 From: johnathan <952508490@qq.com> Date: Wed, 4 Jun 2025 17:22:47 +0800 Subject: [PATCH] Update --- src/components/ControlStrip.vue | 70 +++++++++ src/components/DetailDescription.vue | 8 +- src/components/ResultTable.vue | 71 ++-------- src/components/ReviewCard.vue | 2 +- src/components/ReviewList.vue | 120 ---------------- src/components/ReviewPreview.vue | 205 +++++++++++++++++++++++++++ src/logic/page-worker/index.ts | 16 +-- src/options/App.vue | 8 +- src/sidepanel/App.vue | 8 +- vite.config.mts | 12 +- 10 files changed, 319 insertions(+), 201 deletions(-) create mode 100644 src/components/ControlStrip.vue delete mode 100644 src/components/ReviewList.vue create mode 100644 src/components/ReviewPreview.vue diff --git a/src/components/ControlStrip.vue b/src/components/ControlStrip.vue new file mode 100644 index 0000000..dc23823 --- /dev/null +++ b/src/components/ControlStrip.vue @@ -0,0 +1,70 @@ + + + + + + + + + + + + 清空 + + + 确认清空所有数据吗? + + + + + + 导入 + + + + + + 导出 + + + + + + + + 过滤 + + + + + + + diff --git a/src/components/DetailDescription.vue b/src/components/DetailDescription.vue index ca1bd70..32aec08 100644 --- a/src/components/DetailDescription.vue +++ b/src/components/DetailDescription.vue @@ -1,21 +1,21 @@ - - - - - - - - - - - - - - - - - - - - - - - {{ view.total }}条评论 - - - - - - diff --git a/src/components/ReviewPreview.vue b/src/components/ReviewPreview.vue new file mode 100644 index 0000000..08de0d1 --- /dev/null +++ b/src/components/ReviewPreview.vue @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 还没有数据哦 + + + + + + + + 共{{ view.total }}条评论 + + + + + + diff --git a/src/logic/page-worker/index.ts b/src/logic/page-worker/index.ts index 14a6f88..f32aa4a 100644 --- a/src/logic/page-worker/index.ts +++ b/src/logic/page-worker/index.ts @@ -156,20 +156,20 @@ class AmazonPageWorkerImpl implements AmazonPageWorker { let rawRankingText: string | null = await injector.getRankText(); if (rawRankingText) { const info: Pick = {}; - let statement = /#[0-9,]+\sin\s\S[\s\w',\.&\(\)]+/.exec(rawRankingText)?.[0]; + let statement = /#[0-9,]+\sin\s\S[\s\w',\.&\(\)\-]+/.exec(rawRankingText)?.[0]; if (statement) { - const name = /(?<=in\s).+(?=\s\(See)/.exec(statement)?.[0] || null; - const rank = Number(/(?<=#)[0-9,]+/.exec(statement)?.[0].replaceAll(',', '')) || null; - if (name && rank) { + const name = /(?<=in\s).+/.exec(statement)?.[0].replace(/\s\(See\sTop.+\)/, ''); + const rank = Number(/(?<=#)[0-9,]+/.exec(statement)?.[0].replaceAll(',', '')); + if (name && !Number.isNaN(rank)) { info['category1'] = { name, rank }; } rawRankingText = rawRankingText.replace(statement, ''); } - statement = /#[0-9,]+\sin\s\S[\s\w',\.&\(\)]+/.exec(rawRankingText)?.[0]; + statement = /#[0-9,]+\sin\s\S[\s\w',\.&\(\)\-]+/.exec(rawRankingText)?.[0]; if (statement) { - const name = /(?<=in\s).+/.exec(statement)?.[0].replace(/[\s]+$/, '') || null; - const rank = Number(/(?<=#)[0-9,]+/.exec(statement)?.[0].replaceAll(',', '')) || null; - if (name && rank) { + const name = /(?<=in\s).+/.exec(statement)?.[0].replace(/[\s]+$/, ''); + const rank = Number(/(?<=#)[0-9,]+/.exec(statement)?.[0].replaceAll(',', '')); + if (name && !Number.isNaN(rank)) { info['category2'] = { name, rank }; } } diff --git a/src/options/App.vue b/src/options/App.vue index 2ed90bd..596bea8 100644 --- a/src/options/App.vue +++ b/src/options/App.vue @@ -15,12 +15,12 @@ const theme: GlobalThemeOverrides = { - + - + - + - + diff --git a/src/sidepanel/App.vue b/src/sidepanel/App.vue index 6ee92be..b170906 100644 --- a/src/sidepanel/App.vue +++ b/src/sidepanel/App.vue @@ -15,12 +15,12 @@ const theme: GlobalThemeOverrides = { - + - + - + - + diff --git a/vite.config.mts b/vite.config.mts index 5188299..e9f4a1e 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -100,7 +100,17 @@ export default defineConfig(({ command }) => ({ sidepanel: r('src/sidepanel/index.html'), options: r('src/options/index.html'), }, - output: {}, + + output: { + manualChunks(id) { + if (id.includes('node_modules')) { + if (id.includes('naive-ui')) return 'vendor-naive-ui'; + else if (id.includes('vue')) return 'vendor-vue'; + return 'vendor'; + } + return null; + }, + }, }, }, test: {