diff --git a/components.d.ts b/components.d.ts index 720b0a2a..40b5622e 100644 --- a/components.d.ts +++ b/components.d.ts @@ -73,7 +73,6 @@ declare module 'vue' { IconFluentSearch24Regular: typeof import('~icons/fluent/search24-regular')['default'] IconFluentSettings20Regular: typeof import('~icons/fluent/settings20-regular')['default'] IconFluentShieldQuestion20Regular: typeof import('~icons/fluent/shield-question20-regular')['default'] - IconFluentSpeaker220Regular: typeof import('~icons/fluent/speaker220-regular')['default'] IconFluentSpeakerEdit20Regular: typeof import('~icons/fluent/speaker-edit20-regular')['default'] IconFluentSpeakerSettings20Regular: typeof import('~icons/fluent/speaker-settings20-regular')['default'] IconFluentStar12Regular: typeof import('~icons/fluent/star12-regular')['default'] diff --git a/package.json b/package.json index 4cada8f7..08150917 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ }, "dependencies": { "@imengyu/vue3-context-menu": "^1.5.1", + "@vueuse/core": "14.0.0-alpha.0", "axios": "^1.10.0", "compromise": "^14.14.4", "copy-to-clipboard": "^3.3.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58353e20..acaf46fb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: '@imengyu/vue3-context-menu': specifier: ^1.5.1 version: 1.5.2 + '@vueuse/core': + specifier: 14.0.0-alpha.0 + version: 14.0.0-alpha.0(vue@3.5.18(typescript@5.9.2)) axios: specifier: ^1.10.0 version: 1.11.0 @@ -161,7 +164,7 @@ importers: version: 29.0.0(@babel/parser@7.28.3)(vue@3.5.18(typescript@5.9.2)) unplugin-vue-macros: specifier: ^2.14.5 - version: 2.14.5(@vueuse/core@9.13.0(vue@3.5.18(typescript@5.9.2)))(esbuild@0.25.9)(rollup@4.46.2)(typescript@5.9.2)(vite@7.1.2(@types/node@24.3.0)(jiti@2.5.1)(sass@1.90.0))(vue-tsc@3.0.5(typescript@5.9.2))(vue@3.5.18(typescript@5.9.2)) + version: 2.14.5(@vueuse/core@14.0.0-alpha.0(vue@3.5.18(typescript@5.9.2)))(esbuild@0.25.9)(rollup@4.46.2)(typescript@5.9.2)(vite@7.1.2(@types/node@24.3.0)(jiti@2.5.1)(sass@1.90.0))(vue-tsc@3.0.5(typescript@5.9.2))(vue@3.5.18(typescript@5.9.2)) vite: specifier: ^7.0.3 version: 7.1.2(@types/node@24.3.0)(jiti@2.5.1)(sass@1.90.0) @@ -590,25 +593,21 @@ packages: resolution: {integrity: sha512-mMB1AvqzTH25rbUo1eRfvFzNqBopX6aRlDmO1fIVVzIWi6YJNKckxbkGaatez4hH/n86IR6aEdZFM3qBUjn3Tg==} cpu: [arm64] os: [linux] - libc: [glibc] '@oxc-resolver/binding-linux-arm64-musl@4.2.0': resolution: {integrity: sha512-9oPBU8Yb35z15/14LzALn/8rRwwrtfe19l25N1MRZVSONGiOwfzWNqDNjWiDdyW+EUt/hlylmFOItZmreL6iIw==} cpu: [arm64] os: [linux] - libc: [musl] '@oxc-resolver/binding-linux-x64-gnu@4.2.0': resolution: {integrity: sha512-8wU4fwHb0b45i0qMBJ24UYBEtaLyvYWUOqVVCn0SpQZ1mhWWC8dvD6+zIVAKRVex/cKdgzi3imXoKGIDqVEu9w==} cpu: [x64] os: [linux] - libc: [glibc] '@oxc-resolver/binding-linux-x64-musl@4.2.0': resolution: {integrity: sha512-5CS2wlGxzESPJCj4NlNGr73QCku75VpGtkwNp8qJF4hLELKAzkoqIB0eBbcvNPg8m2rB7YeXb1u+puGUKXDhNQ==} cpu: [x64] os: [linux] - libc: [musl] '@oxc-resolver/binding-wasm32-wasi@4.2.0': resolution: {integrity: sha512-VOLpvmVAQZjvj/7Et/gYzW6yBqL9VKjLWOGaFiQ7cvTpY9R9d/1mrNKEuP3beDHF2si2fM5f2pl9bL+N4tvwiA==} @@ -654,42 +653,36 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm-musl@2.5.1': resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==} engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] - libc: [musl] '@parcel/watcher-linux-arm64-glibc@2.5.1': resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.5.1': resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [musl] '@parcel/watcher-linux-x64-glibc@2.5.1': resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-x64-musl@2.5.1': resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [musl] '@parcel/watcher-win32-arm64@2.5.1': resolution: {integrity: sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==} @@ -759,67 +752,56 @@ packages: resolution: {integrity: sha512-EtP8aquZ0xQg0ETFcxUbU71MZlHaw9MChwrQzatiE8U/bvi5uv/oChExXC4mWhjiqK7azGJBqU0tt5H123SzVA==} cpu: [arm] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.46.2': resolution: {integrity: sha512-qO7F7U3u1nfxYRPM8HqFtLd+raev2K137dsV08q/LRKRLEc7RsiDWihUnrINdsWQxPR9jqZ8DIIZ1zJJAm5PjQ==} cpu: [arm] os: [linux] - libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.46.2': resolution: {integrity: sha512-3dRaqLfcOXYsfvw5xMrxAk9Lb1f395gkoBYzSFcc/scgRFptRXL9DOaDpMiehf9CO8ZDRJW2z45b6fpU5nwjng==} cpu: [arm64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.46.2': resolution: {integrity: sha512-fhHFTutA7SM+IrR6lIfiHskxmpmPTJUXpWIsBXpeEwNgZzZZSg/q4i6FU4J8qOGyJ0TR+wXBwx/L7Ho9z0+uDg==} cpu: [arm64] os: [linux] - libc: [musl] '@rollup/rollup-linux-loongarch64-gnu@4.46.2': resolution: {integrity: sha512-i7wfGFXu8x4+FRqPymzjD+Hyav8l95UIZ773j7J7zRYc3Xsxy2wIn4x+llpunexXe6laaO72iEjeeGyUFmjKeA==} cpu: [loong64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-ppc64-gnu@4.46.2': resolution: {integrity: sha512-B/l0dFcHVUnqcGZWKcWBSV2PF01YUt0Rvlurci5P+neqY/yMKchGU8ullZvIv5e8Y1C6wOn+U03mrDylP5q9Yw==} cpu: [ppc64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.46.2': resolution: {integrity: sha512-32k4ENb5ygtkMwPMucAb8MtV8olkPT03oiTxJbgkJa7lJ7dZMr0GCFJlyvy+K8iq7F/iuOr41ZdUHaOiqyR3iQ==} cpu: [riscv64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.46.2': resolution: {integrity: sha512-t5B2loThlFEauloaQkZg9gxV05BYeITLvLkWOkRXogP4qHXLkWSbSHKM9S6H1schf/0YGP/qNKtiISlxvfmmZw==} cpu: [riscv64] os: [linux] - libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.46.2': resolution: {integrity: sha512-YKjekwTEKgbB7n17gmODSmJVUIvj8CX7q5442/CK80L8nqOUbMtf8b01QkG3jOqyr1rotrAnW6B/qiHwfcuWQA==} cpu: [s390x] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.46.2': resolution: {integrity: sha512-Jj5a9RUoe5ra+MEyERkDKLwTXVu6s3aACP51nkfnK9wJTraCC8IMe3snOfALkrjTYd2G1ViE1hICj0fZ7ALBPA==} cpu: [x64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-musl@4.46.2': resolution: {integrity: sha512-7kX69DIrBeD7yNp4A5b81izs8BqoZkCIaxQaOpumcJ1S/kmqNFjPhDu1LHeVXv0SexfHQv5cqHsxLOjETuqDuA==} cpu: [x64] os: [linux] - libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.46.2': resolution: {integrity: sha512-wiJWMIpeaak/jsbaq2HMh/rzZxHVW1rU6coyeNNpMwk5isiPjSTx0a4YLSlYDwBH/WBvLz+EtsNqQScZTLJy3g==} @@ -869,8 +851,8 @@ packages: '@types/sax@1.2.7': resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} - '@types/web-bluetooth@0.0.16': - resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} + '@types/web-bluetooth@0.0.21': + resolution: {integrity: sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==} '@unocss/astro@66.4.2': resolution: {integrity: sha512-En3AKHwkiPxtZT95vkVrNiRYrB+DFVCikew6/dMMCWDWVKK0+5tEVUTzR1ak3+YnzAXl0NpWj8D4zHb0PxOs/A==} @@ -1226,14 +1208,18 @@ packages: '@vue/shared@3.5.18': resolution: {integrity: sha512-cZy8Dq+uuIXbxCZpuLd2GJdeSO/lIzIspC2WtkqIpje5QyFbvLaI5wZtdUjLHjGZrlVX6GilejatWwVYYRc8tA==} - '@vueuse/core@9.13.0': - resolution: {integrity: sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==} + '@vueuse/core@14.0.0-alpha.0': + resolution: {integrity: sha512-y2964MhoYalRdiBX+ilOOwh3EHsZyDhOb/hwZTkLlytcVrtX+Gbz+ffsAomaazJzZ7m/u+KI/5hLEdSHhjelgA==} + peerDependencies: + vue: ^3.5.0 - '@vueuse/metadata@9.13.0': - resolution: {integrity: sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==} + '@vueuse/metadata@14.0.0-alpha.0': + resolution: {integrity: sha512-FyQ7kAVMnccJwp0Wt2JuEjCNGl4lpOXKQEqzTbiqhKydQBK0urGaa+v12u8qJxf4XaaPNufLdoCQYQh8ya63JQ==} - '@vueuse/shared@9.13.0': - resolution: {integrity: sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==} + '@vueuse/shared@14.0.0-alpha.0': + resolution: {integrity: sha512-J8cmTJkB0hAwPBXRR5U3N9FJkhPBrhyYiQm21kZ3j/o8W69Pg6JlPSxLOJtkg+AwC/r5x7Gpq2Vglv84vHotwA==} + peerDependencies: + vue: ^3.5.0 acorn@8.15.0: resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} @@ -3688,17 +3674,6 @@ packages: vscode-uri@3.1.0: resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} - vue-demi@0.14.10: - resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} - engines: {node: '>=12'} - hasBin: true - peerDependencies: - '@vue/composition-api': ^1.0.0-rc.1 - vue: ^3.0.0-0 || ^2.6.0 - peerDependenciesMeta: - '@vue/composition-api': - optional: true - vue-flow-layout@0.2.0: resolution: {integrity: sha512-zKgsWWkXq0xrus7H4Mc+uFs1ESrmdTXlO0YNbR6wMdPaFvosL3fMB8N7uTV308UhGy9UvTrGhIY7mVz9eN+L0Q==} @@ -4460,8 +4435,7 @@ snapshots: dependencies: '@types/node': 24.3.0 - '@types/web-bluetooth@0.0.16': - optional: true + '@types/web-bluetooth@0.0.21': {} '@unocss/astro@66.4.2(vite@7.1.2(@types/node@24.3.0)(jiti@2.5.1)(sass@1.90.0))': dependencies: @@ -4702,13 +4676,13 @@ snapshots: unplugin: 1.16.1 vue: 3.5.18(typescript@5.9.2) - '@vue-macros/define-models@1.3.5(@vueuse/core@9.13.0(vue@3.5.18(typescript@5.9.2)))(vue@3.5.18(typescript@5.9.2))': + '@vue-macros/define-models@1.3.5(@vueuse/core@14.0.0-alpha.0(vue@3.5.18(typescript@5.9.2)))(vue@3.5.18(typescript@5.9.2))': dependencies: '@vue-macros/common': 1.16.1(vue@3.5.18(typescript@5.9.2)) ast-walker-scope: 0.6.2 unplugin: 1.16.1 optionalDependencies: - '@vueuse/core': 9.13.0(vue@3.5.18(typescript@5.9.2)) + '@vueuse/core': 14.0.0-alpha.0(vue@3.5.18(typescript@5.9.2)) transitivePeerDependencies: - vue @@ -5013,27 +4987,18 @@ snapshots: '@vue/shared@3.5.18': {} - '@vueuse/core@9.13.0(vue@3.5.18(typescript@5.9.2))': + '@vueuse/core@14.0.0-alpha.0(vue@3.5.18(typescript@5.9.2))': dependencies: - '@types/web-bluetooth': 0.0.16 - '@vueuse/metadata': 9.13.0 - '@vueuse/shared': 9.13.0(vue@3.5.18(typescript@5.9.2)) - vue-demi: 0.14.10(vue@3.5.18(typescript@5.9.2)) - transitivePeerDependencies: - - '@vue/composition-api' - - vue - optional: true + '@types/web-bluetooth': 0.0.21 + '@vueuse/metadata': 14.0.0-alpha.0 + '@vueuse/shared': 14.0.0-alpha.0(vue@3.5.18(typescript@5.9.2)) + vue: 3.5.18(typescript@5.9.2) - '@vueuse/metadata@9.13.0': - optional: true + '@vueuse/metadata@14.0.0-alpha.0': {} - '@vueuse/shared@9.13.0(vue@3.5.18(typescript@5.9.2))': + '@vueuse/shared@14.0.0-alpha.0(vue@3.5.18(typescript@5.9.2))': dependencies: - vue-demi: 0.14.10(vue@3.5.18(typescript@5.9.2)) - transitivePeerDependencies: - - '@vue/composition-api' - - vue - optional: true + vue: 3.5.18(typescript@5.9.2) acorn@8.15.0: {} @@ -7557,7 +7522,7 @@ snapshots: transitivePeerDependencies: - vue - unplugin-vue-macros@2.14.5(@vueuse/core@9.13.0(vue@3.5.18(typescript@5.9.2)))(esbuild@0.25.9)(rollup@4.46.2)(typescript@5.9.2)(vite@7.1.2(@types/node@24.3.0)(jiti@2.5.1)(sass@1.90.0))(vue-tsc@3.0.5(typescript@5.9.2))(vue@3.5.18(typescript@5.9.2)): + unplugin-vue-macros@2.14.5(@vueuse/core@14.0.0-alpha.0(vue@3.5.18(typescript@5.9.2)))(esbuild@0.25.9)(rollup@4.46.2)(typescript@5.9.2)(vite@7.1.2(@types/node@24.3.0)(jiti@2.5.1)(sass@1.90.0))(vue-tsc@3.0.5(typescript@5.9.2))(vue@3.5.18(typescript@5.9.2)): dependencies: '@vue-macros/better-define': 1.11.4(vue@3.5.18(typescript@5.9.2)) '@vue-macros/boolean-prop': 0.5.5(vue@3.5.18(typescript@5.9.2)) @@ -7565,7 +7530,7 @@ snapshots: '@vue-macros/common': 1.16.1(vue@3.5.18(typescript@5.9.2)) '@vue-macros/config': 0.6.1(vue@3.5.18(typescript@5.9.2)) '@vue-macros/define-emit': 0.5.4(vue@3.5.18(typescript@5.9.2)) - '@vue-macros/define-models': 1.3.5(@vueuse/core@9.13.0(vue@3.5.18(typescript@5.9.2)))(vue@3.5.18(typescript@5.9.2)) + '@vue-macros/define-models': 1.3.5(@vueuse/core@14.0.0-alpha.0(vue@3.5.18(typescript@5.9.2)))(vue@3.5.18(typescript@5.9.2)) '@vue-macros/define-prop': 0.6.5(vue@3.5.18(typescript@5.9.2)) '@vue-macros/define-props': 4.0.6(@vue-macros/reactivity-transform@1.1.6(vue@3.5.18(typescript@5.9.2)))(vue@3.5.18(typescript@5.9.2)) '@vue-macros/define-props-refs': 1.3.5(vue@3.5.18(typescript@5.9.2)) @@ -7731,11 +7696,6 @@ snapshots: vscode-uri@3.1.0: {} - vue-demi@0.14.10(vue@3.5.18(typescript@5.9.2)): - dependencies: - vue: 3.5.18(typescript@5.9.2) - optional: true - vue-flow-layout@0.2.0: {} vue-observe-visibility@2.0.0-alpha.1(vue@3.5.18(typescript@5.9.2)): diff --git a/public/list/book-list.json b/public/list/book-list.json new file mode 100644 index 00000000..3ee47c1a --- /dev/null +++ b/public/list/book-list.json @@ -0,0 +1,54 @@ +[ + { + "id": "article_nce1", + "name": "新概念英语1-课文", + "description": "", + "category": "文章学习", + "tags": [ + "新概念英语" + ], + "url": "NCE_1.json", + "length": 72, + "translateLanguage": "common", + "language": "en" + }, + { + "id": "article_nce2", + "name": "新概念英语2-课文", + "description": "新概念英语2-课文", + "category": "文章学习", + "tags": [ + "新概念英语" + ], + "url": "NCE_2.json", + "length": 96, + "translateLanguage": "common", + "language": "en" + }, + { + "id": "article_nce3", + "name": "新概念英语3-课文", + "description": "新概念英语3-课文", + "category": "文章学习", + "tags": [ + "新概念英语" + ], + "url": "NCE_3.json", + "length": 60, + "translateLanguage": "common", + "language": "en" + }, + { + "id": "article_nce4", + "name": "新概念英语4-课文", + "description": "新概念英语4-课文", + "category": "文章学习", + "tags": [ + "新概念英语" + ], + "url": "NCE_4.json", + "length": 48, + "translateLanguage": "common", + "language": "en" + } +] diff --git a/src/assets/dict-list.json b/public/list/dict-list.json similarity index 100% rename from src/assets/dict-list.json rename to public/list/dict-list.json diff --git a/src/assets/recommend-dict-list.json b/public/list/recommend-dict-list.json similarity index 100% rename from src/assets/recommend-dict-list.json rename to public/list/recommend-dict-list.json diff --git a/scripts/generate-sitemap.js b/scripts/generate-sitemap.js index aef1df1e..959da4cb 100644 --- a/scripts/generate-sitemap.js +++ b/scripts/generate-sitemap.js @@ -1,8 +1,8 @@ const {SitemapStream, streamToPromise} = require('sitemap') const {createWriteStream} = require('fs') const {resolve} = require('path') -const bookList = require('../src/assets/book-list.json') -const dictList = require('../src/assets/dict-list.json') +const bookList = require('../public/list/book-list.json') +const dictList = require('../public/list/dict-list.json') // 你的网站域名 const SITE_URL = 'https://2study.top' diff --git a/scripts/push-sitemap.js b/scripts/push-sitemap.js index 3972123b..580f9169 100644 --- a/scripts/push-sitemap.js +++ b/scripts/push-sitemap.js @@ -1,6 +1,6 @@ const fs = require("fs"); -const bookList = require('../src/assets/book-list.json') -const dictList = require('../src/assets/dict-list.json') +const bookList = require('../public/list/book-list.json') +const dictList = require('../public/list/dict-list.json') async function pushUrls() { // 配置区:改成你的 diff --git a/src/App.vue b/src/App.vue index 77cd256e..bf345b7a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,13 +4,13 @@ import { BaseState, useBaseStore } from "@/stores/base.ts"; import { useRuntimeStore } from "@/stores/runtime.ts"; import { useSettingStore } from "@/stores/setting.ts"; import useTheme from "@/hooks/theme.ts"; -import { APP_VERSION, LOCAL_FILE_KEY, SAVE_DICT_KEY, SAVE_SETTING_KEY } from "@/utils/const.ts"; import { shakeCommonDict } from "@/utils"; import { routes } from "@/router.ts"; import { get, set } from 'idb-keyval' import { useRoute } from "vue-router"; import { DictId } from "@/types/types.ts"; +import { APP_VERSION, LOCAL_FILE_KEY, SAVE_DICT_KEY, SAVE_SETTING_KEY } from "@/config/ENV.ts"; const store = useBaseStore() const runtimeStore = useRuntimeStore() diff --git a/src/apis/index.ts b/src/apis/index.ts new file mode 100644 index 00000000..0c625077 --- /dev/null +++ b/src/apis/index.ts @@ -0,0 +1,5 @@ +import http from "@/utils/http.ts"; + +export function officialList() { + return http('dict/officialList', null, null, 'get') +} \ No newline at end of file diff --git a/src/assets/book-list.json b/src/assets/book-list.json index 5b782081..3ee47c1a 100644 --- a/src/assets/book-list.json +++ b/src/assets/book-list.json @@ -1,56 +1,54 @@ [ - [ - { - "id": "article_nce1", - "name": "新概念英语1-课文", - "description": "", - "category": "文章学习", - "tags": [ - "新概念英语" - ], - "url": "NCE_1.json", - "length": 72, - "translateLanguage": "common", - "language": "en" - }, - { - "id": "article_nce2", - "name": "新概念英语2-课文", - "description": "新概念英语2-课文", - "category": "文章学习", - "tags": [ - "新概念英语" - ], - "url": "NCE_2.json", - "length": 96, - "translateLanguage": "common", - "language": "en" - }, - { - "id": "article_nce3", - "name": "新概念英语3-课文", - "description": "新概念英语3-课文", - "category": "文章学习", - "tags": [ - "新概念英语" - ], - "url": "NCE_3.json", - "length": 60, - "translateLanguage": "common", - "language": "en" - }, - { - "id": "article_nce4", - "name": "新概念英语4-课文", - "description": "新概念英语4-课文", - "category": "文章学习", - "tags": [ - "新概念英语" - ], - "url": "NCE_4.json", - "length": 48, - "translateLanguage": "common", - "language": "en" - } - ] + { + "id": "article_nce1", + "name": "新概念英语1-课文", + "description": "", + "category": "文章学习", + "tags": [ + "新概念英语" + ], + "url": "NCE_1.json", + "length": 72, + "translateLanguage": "common", + "language": "en" + }, + { + "id": "article_nce2", + "name": "新概念英语2-课文", + "description": "新概念英语2-课文", + "category": "文章学习", + "tags": [ + "新概念英语" + ], + "url": "NCE_2.json", + "length": 96, + "translateLanguage": "common", + "language": "en" + }, + { + "id": "article_nce3", + "name": "新概念英语3-课文", + "description": "新概念英语3-课文", + "category": "文章学习", + "tags": [ + "新概念英语" + ], + "url": "NCE_3.json", + "length": 60, + "translateLanguage": "common", + "language": "en" + }, + { + "id": "article_nce4", + "name": "新概念英语4-课文", + "description": "新概念英语4-课文", + "category": "文章学习", + "tags": [ + "新概念英语" + ], + "url": "NCE_4.json", + "length": 48, + "translateLanguage": "common", + "language": "en" + } ] diff --git a/src/config/ENV.ts b/src/config/ENV.ts index f955394e..e6e928e3 100644 --- a/src/config/ENV.ts +++ b/src/config/ENV.ts @@ -2,13 +2,58 @@ export const GITHUB = 'https://github.com/zyronon/TypeWords' export const ProjectName = 'Type Words' export const Host = '2study.top' export const Origin = `https://${Host}` +export const APP_NAME = 'Type Words' const common = { word_dict_list_version: 1 } const map = { dev: { - api: 'http://localhost/index.php', + api: 'http://localhost/', } } export const env = Object.assign(map['dev'], common) + +export const DICT_LIST = { + WORD: { + ALL: '/list/dict-list.json', + RECOMMENDED: '/list/recommend-dict-list.json', + }, + ARTICLE: { + ALL: '/list/book-list.json', + RECOMMENDED: '/list/book-list.json', + } +} + +export const SoundFileOptions = [ + {value: '机械键盘', label: '机械键盘'}, + {value: '机械键盘1', label: '机械键盘1'}, + {value: '机械键盘2', label: '机械键盘2'}, + {value: '老式机械键盘', label: '老式机械键盘'}, + {value: '笔记本键盘', label: '笔记本键盘'}, +] +export const APP_VERSION = { + key: 'type-words-app-version', + version: 1 +} +export const SAVE_DICT_KEY = { + key: 'typing-word-dict', + version: 4 +} +export const SAVE_SETTING_KEY = { + key: 'typing-word-setting', + version: 15 +} +export const EXPORT_DATA_KEY = { + key: 'typing-word-export', + version: 4 +} +export const LOCAL_FILE_KEY = 'typing-word-files' +export const PracticeSaveWordKey = { + key: 'PracticeSaveWord', + version: 1 +} +export const PracticeSaveArticleKey = { + key: 'PracticeSaveArticle', + version: 1 +} \ No newline at end of file diff --git a/src/directives/loading.tsx b/src/directives/loading.tsx index b2488bc4..170554aa 100644 --- a/src/directives/loading.tsx +++ b/src/directives/loading.tsx @@ -1,5 +1,6 @@ // src/directives/loading.js import {createApp, h} from 'vue' +//@ts-ignore import IconEosIconsLoading from '~icons/eos-icons/loading' // 创建一个 Loading 组件 diff --git a/src/hooks/sound.ts b/src/hooks/sound.ts index a2900dcb..07173048 100644 --- a/src/hooks/sound.ts +++ b/src/hooks/sound.ts @@ -1,7 +1,8 @@ import {onMounted, watchEffect} from "vue" import {useSettingStore} from "@/stores/setting.ts"; import {PronunciationApi} from "@/types/types.ts"; -import {SoundFileOptions} from "@/utils/const.ts"; + +import { SoundFileOptions } from "@/config/ENV.ts"; export function useSound(audioSrcList?: string[], audioFileLength?: number) { let audioList: HTMLAudioElement[] = $ref([]) diff --git a/src/pages/article/ArticlesPage.vue b/src/pages/article/ArticlesPage.vue index bafcb8dc..1b65e33d 100644 --- a/src/pages/article/ArticlesPage.vue +++ b/src/pages/article/ArticlesPage.vue @@ -14,11 +14,11 @@ import PopConfirm from "@/components/PopConfirm.vue"; import { watch } from "vue"; import { getDefaultDict } from "@/types/func.ts"; import DeleteIcon from "@/components/icon/DeleteIcon.vue"; -import recommendBookList from "@/assets/book-list.json"; import dayjs from "dayjs"; import isBetween from "dayjs/plugin/isBetween"; -import { PracticeSaveArticleKey } from "@/utils/const.ts"; import isoWeek from 'dayjs/plugin/isoWeek' +import { useFetch } from "@vueuse/core"; +import { DICT_LIST, PracticeSaveArticleKey } from "@/config/ENV.ts"; dayjs.extend(isoWeek) dayjs.extend(isBetween); @@ -152,6 +152,9 @@ const weekList = $computed(() => { }); return list }) + +const {data: recommendBookList, isFetching} = useFetch(DICT_LIST.ARTICLE.RECOMMENDED).json() +