diff --git a/README.md b/README.md
index bd82bbf9..88b06eb7 100644
--- a/README.md
+++ b/README.md
@@ -5,4 +5,5 @@ bug
打完一段的一最后一行的时候,没有自动换行,需要按下空格才能换段
打完了没检测到
-所有的图标hover时,有放大效果
\ No newline at end of file
+所有的图标hover时,有放大效果
+各种声音可以单独调节音量大小
\ No newline at end of file
diff --git a/report.html b/report.html
deleted file mode 100644
index e985dbd0..00000000
--- a/report.html
+++ /dev/null
@@ -1,4838 +0,0 @@
-
-
-
-
-
-
-
- Rollup Visualizer
-
-
-
-
-
-
-
-
-
diff --git a/src/components/Practice/AddArticle.vue b/src/components/Practice/AddArticle.vue
index ab9b0210..3bd92249 100644
--- a/src/components/Practice/AddArticle.vue
+++ b/src/components/Practice/AddArticle.vue
@@ -4,18 +4,15 @@ import {onMounted, reactive, watch} from "vue";
import {Article, Sentence, TranslateEngine} from "@/types.ts";
import BaseButton from "@/components/BaseButton.vue";
import {
- getSentenceAllTranslateText,
- updateLocalSentenceTranslate,
getNetworkTranslate,
- getSentenceAllText
+ getSentenceAllText,
+ getSentenceAllTranslateText,
+ updateLocalSentenceTranslate
} from "@/hooks/translate.ts";
import * as copy from "copy-to-clipboard";
-import {CnKeyboardMap, getSplitTranslateText, splitArticle, splitCNArticle} from "@/hooks/article.ts";
-import {Action,} from "element-plus";
-import useSleep from "@/hooks/useSleep.ts";
+import {getSplitTranslateText, splitArticle} from "@/hooks/article.ts";
import EditAbleText from "@/components/EditAbleText.vue";
import {Icon} from "@iconify/vue";
-import Backgorund from "@/components/Backgorund.vue";
let article1 = `How does the older investor differ in his approach to investment from the younger investor?
There is no shortage of tipsters around offering 'get-rich-quick' opportunities. But if you are a serious private investor, leave the Las Vegas mentality to those with money to fritter. The serious investor needs a proper 'portfolio' -- a well-planned selection of investments, with a definite structure and a clear aim. But exactly how does a newcomer to the stock market go about achieving that?
@@ -375,7 +372,7 @@ watch(() => article.translateType, () => {
display: flex;
align-items: center;
justify-content: flex-end;
- gap: $space / 2;
+ gap: calc($space / 2);
}
.el-progress {
diff --git a/src/components/Practice/Practice.vue b/src/components/Practice/Practice.vue
index 68c2176a..2c271efa 100644
--- a/src/components/Practice/Practice.vue
+++ b/src/components/Practice/Practice.vue
@@ -1144,7 +1144,6 @@ onMounted(() => {
})
-
diff --git a/src/components/Practice/Statistics.vue b/src/components/Practice/Statistics.vue
index c561ac5d..17c062a3 100644
--- a/src/components/Practice/Statistics.vue
+++ b/src/components/Practice/Statistics.vue
@@ -22,7 +22,15 @@ const practiceStore = usePracticeStore()
onMounted(() => {
emitter.on(EventKey.openStatModal, () => {
statModalIsOpen = true
- currentStat = store.saveStatistics()
+ let now = Date.now()
+ currentStat = {
+ startDate: practiceStore.startDate,
+ endDate: now,
+ spend: now - practiceStore.startDate,
+ total: -1,
+ correctRate: -1,
+ wrongWordNumber: -1,
+ }
})
})
@@ -65,7 +73,7 @@ function next() {
:percentage="0"
/>
@@ -88,7 +96,7 @@ function next() {
-
+
diff --git a/src/components/Practice/TypeArticle.vue b/src/components/Practice/TypeArticle.vue
index ecec8dcf..ff44658d 100644
--- a/src/components/Practice/TypeArticle.vue
+++ b/src/components/Practice/TypeArticle.vue
@@ -4,10 +4,10 @@ import {$ref} from "vue/macros";
import {Article, ArticleWord, ShortKeyMap, Word} from "@/types";
import {useBaseStore} from "@/stores/base";
import {usePracticeStore} from "@/components/Practice/usePracticeStore.ts";
-import {useEventListener} from "@/hooks/useEvent.ts";
import TypeWord from "@/components/Practice/TypeWord.vue";
import {useSettingStore} from "@/stores/setting.ts";
import {usePlayBeep, usePlayCorrect, usePlayKeyboardAudio, usePlayWordAudio} from "@/hooks/sound.ts";
+import {useEventListener} from "@/hooks/event.ts";
let article1 = `How does the older investor differ in his approach to investment from the younger investor?
There is no shortage of tipsters around offering 'get-rich-quick' opportunities. But if you are a serious private investor, leave the Las Vegas mentality to those with money to fritter. The serious investor needs a proper 'portfolio' -- a well-planned selection of investments, with a definite structure and a clear aim. But exactly how does a newcomer to the stock market go about achieving that?
diff --git a/src/components/Practice/TypeWord.vue b/src/components/Practice/TypeWord.vue
index ae44e34d..4937eb0f 100644
--- a/src/components/Practice/TypeWord.vue
+++ b/src/components/Practice/TypeWord.vue
@@ -7,9 +7,9 @@ import BaseButton from "@/components/BaseButton.vue";
import {emitter, EventKey} from "@/utils/eventBus.ts"
import {cloneDeep} from "lodash-es"
import {usePracticeStore} from "@/components/Practice/usePracticeStore.ts"
-import {useEventListener} from "@/hooks/useEvent.ts";
import {useSettingStore} from "@/stores/setting.ts";
import {usePlayBeep, usePlayCorrect, usePlayKeyboardAudio, usePlayWordAudio} from "@/hooks/sound.ts";
+import {useEventListener} from "@/hooks/event.ts";
interface IProps {
words: Word[],
@@ -93,8 +93,16 @@ function next() {
data.wrongWords = []
} else {
console.log('这章节完了')
- practiceStore.wrongWords = cloneDeep(data.originWrongWords)
- emitter.emit(EventKey.openStatModal)
+
+ let now = Date.now()
+ emitter.emit(EventKey.openStatModal, {
+ startDate: practiceStore.startDate,
+ endDate: now,
+ spend: now - practiceStore.startDate,
+ total: props.words.length,
+ correctRate: -1,
+ wrongWordNumber: data.originWrongWords.length,
+ })
}
} else {
data.index++
diff --git a/src/hooks/event.ts b/src/hooks/event.ts
index 7fb88f5b..a756c3c1 100644
--- a/src/hooks/event.ts
+++ b/src/hooks/event.ts
@@ -2,11 +2,27 @@ import {onMounted, onUnmounted} from "vue";
import {emitter, EventKey} from "@/utils/eventBus.ts";
export function useWindowClick(cb: () => void) {
- onMounted(() => {
- emitter.on(EventKey.closeOther, cb)
- window.addEventListener('click', cb)
- })
- onUnmounted(() => {
- window.removeEventListener('click', cb)
- })
+ onMounted(() => {
+ emitter.on(EventKey.closeOther, cb)
+ window.addEventListener('click', cb)
+ })
+ onUnmounted(() => {
+ window.removeEventListener('click', cb)
+ })
+}
+
+export function useEventListener(type: string, listener: EventListenerOrEventListenerObject) {
+ onMounted(() => window.addEventListener(type, listener))
+ onUnmounted(() => window.removeEventListener(type, listener))
+}
+
+export function useEsc(can: boolean) {
+ onMounted(() => {
+ window.addEventListener('keyup', (e: KeyboardEvent) => {
+ if (e.key === 'Escape' && can) {
+ close()
+ }
+ })
+ })
+ return []
}
\ No newline at end of file
diff --git a/src/hooks/useEsc.ts b/src/hooks/useEsc.ts
deleted file mode 100644
index e57fe46c..00000000
--- a/src/hooks/useEsc.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import {onMounted} from "vue"
-
-export function useEsc(can: boolean) {
- onMounted(() => {
- window.addEventListener('keyup', (e: KeyboardEvent) => {
- if (e.key === 'Escape' && can) {
- close()
- }
- })
- })
- return []
-}
\ No newline at end of file
diff --git a/src/hooks/useEvent.ts b/src/hooks/useEvent.ts
deleted file mode 100644
index ee267bd6..00000000
--- a/src/hooks/useEvent.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-// event.js
-import {onMounted, onUnmounted} from 'vue'
-
-export function useEventListener(type: string, listener: EventListenerOrEventListenerObject) {
- onMounted(() => window.addEventListener(type, listener))
- onUnmounted(() => window.removeEventListener(type, listener))
-}
\ No newline at end of file
diff --git a/src/stores/base.ts b/src/stores/base.ts
index c0fac09b..36d499a5 100644
--- a/src/stores/base.ts
+++ b/src/stores/base.ts
@@ -74,7 +74,7 @@ export const useBaseStore = defineStore('base', {
startDate: -1,
endDate: -1,
spend: -1,
- wordNumber: -1,
+ total: -1,
correctRate: -1,
wrongWordNumber: -1,
}
diff --git a/src/types.ts b/src/types.ts
index 9ac527b3..cbe3c72c 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -146,7 +146,7 @@ export interface Statistics {
startDate: number,//开始日期
endDate: number//结束日期
spend: number,//花费时间
- wordNumber: number//单词数量
+ total: number//单词数量
correctRate: number//正确率
wrongWordNumber: number//错误数
}
@@ -155,7 +155,7 @@ export const DefaultStatistics: Statistics = {
startDate: Date.now(),
endDate: -1,
spend: -1,
- wordNumber: -1,
+ total: -1,
correctRate: -1,
wrongWordNumber: -1,
}
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
index 78286987..5eb5c4af 100644
--- a/src/vite-env.d.ts
+++ b/src/vite-env.d.ts
@@ -9,14 +9,19 @@ import {ElMessageBox} from "element-plus";
declare module '*.mp3' {
- const src: string;
- export default src;
+ const src: string;
+ export default src;
+}
+
+declare module '*.wav' {
+ const src: string;
+ export default src;
}
declare module "*.vue" {
- import type {DefineComponent} from 'vue'
- const component: DefineComponent<{}, {}, any>
- export default component
+ import type {DefineComponent} from 'vue'
+ const component: DefineComponent<{}, {}, any>
+ export default component
}
// declare module '*.vue' {
diff --git a/tsconfig.json b/tsconfig.json
index 87d6876a..8fb4113b 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -35,7 +35,9 @@
//For TS to resolve aliases, they should be added in tsconfig.json under compilerOptions.paths:
// https://betterprogramming.pub/the-right-usage-of-aliases-in-webpack-typescript-4418327f47fa
"paths": {
- "@/*": ["*"]
+ "@/*": [
+ "*"
+ ]
}
},
"include": [
@@ -43,7 +45,8 @@
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.vue",
- "auto-imports.d.ts"
+ "auto-imports.d.ts",
+ "src/vite-env.d.ts"
],
"references": [
{