add 7z
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
"file-saver": "^2.0.5",
|
||||
"git-last-commit": "^1.0.1",
|
||||
"hover.css": "^2.3.2",
|
||||
"libarchive-wasm": "^1.1.0",
|
||||
"localforage": "^1.10.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"mitt": "^3.0.1",
|
||||
|
||||
7
pnpm-lock.yaml
generated
7
pnpm-lock.yaml
generated
@@ -32,6 +32,9 @@ dependencies:
|
||||
hover.css:
|
||||
specifier: ^2.3.2
|
||||
version: 2.3.2
|
||||
libarchive-wasm:
|
||||
specifier: ^1.1.0
|
||||
version: 1.1.0
|
||||
localforage:
|
||||
specifier: ^1.10.0
|
||||
version: 1.10.0
|
||||
@@ -3273,6 +3276,10 @@ packages:
|
||||
flush-write-stream: 1.1.1
|
||||
dev: true
|
||||
|
||||
/libarchive-wasm@1.1.0:
|
||||
resolution: {integrity: sha512-b1R4KK5Goybf2+kiVoM1NZnZ/3h7BxBvSCPF4scroJmIVqfD00hSFRNFt9oUcJcKjMu1vnWRnizXc2efpVY8yQ==}
|
||||
dev: false
|
||||
|
||||
/lie@3.1.1:
|
||||
resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==}
|
||||
dependencies:
|
||||
|
||||
BIN
public/dicts/en/word/common/BEC_2.min.7z
Normal file
BIN
public/dicts/en/word/common/BEC_2.min.7z
Normal file
Binary file not shown.
BIN
public/libarchive.wasm
Normal file
BIN
public/libarchive.wasm
Normal file
Binary file not shown.
@@ -6,7 +6,7 @@ const internationalExam: DictResource[] = [
|
||||
id: 'BEC_2',
|
||||
name: '商务英语词汇',
|
||||
description: '商务英语词汇',
|
||||
url: 'BEC_2.json',
|
||||
url: 'BEC_2.min.7z',
|
||||
length: 2753,
|
||||
category: '国际考试',
|
||||
tags: ['所有', 'BEC'],
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import {useBaseStore} from "@/stores/base.ts"
|
||||
import {onMounted, watch} from "vue"
|
||||
import {onMounted} from "vue"
|
||||
import {DefaultDict, Dict, DictResource, DictType, Sort, Word} from "@/types.ts"
|
||||
import {chunk, cloneDeep, reverse, shuffle} from "lodash-es";
|
||||
import {$computed, $ref} from "vue/macros";
|
||||
import BaseButton from "@/components/BaseButton.vue";
|
||||
import {Icon} from '@iconify/vue';
|
||||
import {ActivityCalendar} from "vue-activity-calendar";
|
||||
import "vue-activity-calendar/style.css";
|
||||
import WordListDialog from "@/components/dialog/WordListDialog.vue";
|
||||
import {isArticle} from "@/hooks/article.ts";
|
||||
@@ -24,6 +23,7 @@ import {useRouter} from "vue-router";
|
||||
import ArticleList from "@/components/list/ArticleList.vue";
|
||||
import BaseList from "@/components/list/BaseList.vue";
|
||||
import {MessageBox} from "@/utils/MessageBox.tsx";
|
||||
import {ArchiveReader, libarchiveWasm} from 'libarchive-wasm';
|
||||
|
||||
const store = useBaseStore()
|
||||
const settingStore = useSettingStore()
|
||||
@@ -70,6 +70,27 @@ async function selectDict(val: { dict: DictResource | Dict, index: number }) {
|
||||
if (runtimeStore.editDict.type === DictType.word) {
|
||||
if (!runtimeStore.editDict.originWords.length) {
|
||||
let r = await fetch(url)
|
||||
console.log('r', r)
|
||||
// r.arrayBuffer()
|
||||
|
||||
console.time()
|
||||
const data = await r.arrayBuffer();
|
||||
const mod = await libarchiveWasm();
|
||||
const reader = new ArchiveReader(mod, new Int8Array(data));
|
||||
for (const entry of reader.entries()) {
|
||||
const result = {
|
||||
pathname: entry.getPathname(),
|
||||
size: entry.getSize(),
|
||||
};
|
||||
if (result.pathname.endsWith('.json')) {
|
||||
result.data = new TextDecoder().decode(entry.readData());
|
||||
}
|
||||
console.timeEnd()
|
||||
console.log(result);
|
||||
}
|
||||
reader.free();
|
||||
|
||||
return
|
||||
let v = await r.json()
|
||||
v.map(s => {
|
||||
s.id = nanoid(6)
|
||||
|
||||
Reference in New Issue
Block a user