1 单词增加序号 2 单词增加直接随机模式
This commit is contained in:
@@ -152,7 +152,9 @@ function getShortcutKeyName(key: string): string {
|
||||
'ToggleDictation': '切换默写模式',
|
||||
'ToggleTheme': '切换主题',
|
||||
'ToggleConciseMode': '切换简洁模式',
|
||||
'TogglePanel': '切换面板'
|
||||
'TogglePanel': '切换面板',
|
||||
'RandomWrite': '随机默写',
|
||||
'NextRandomWrite': '继续随机默写'
|
||||
}
|
||||
|
||||
return shortcutKeyNameMap[key] || key
|
||||
|
||||
@@ -57,6 +57,8 @@ let data = $ref<PracticeData>({
|
||||
wrongWords: [],
|
||||
})
|
||||
|
||||
let isRandomWrite = false;
|
||||
|
||||
async function loadDict() {
|
||||
// console.log('load好了开始加载')
|
||||
let dict = getDefaultDict()
|
||||
@@ -229,7 +231,8 @@ function next(isTyping: boolean = true) {
|
||||
|
||||
//开始默写新词
|
||||
if (statStore.step === 0) {
|
||||
if (settingStore.wordPracticeMode === 1) {
|
||||
if (settingStore.wordPracticeMode === 1 || isRandomWrite) {
|
||||
isRandomWrite = false
|
||||
console.log('自由模式,全完学完了')
|
||||
showStatDialog = true
|
||||
localStorage.removeItem(PracticeSaveWordKey.key)
|
||||
@@ -380,9 +383,24 @@ function continueStudy() {
|
||||
initData(getCurrentStudyWord())
|
||||
}
|
||||
|
||||
function randomWrite() {
|
||||
console.log('随机默写')
|
||||
data.words = shuffle(data.words);
|
||||
data.index = 0
|
||||
settingStore.dictation = true
|
||||
isRandomWrite = true
|
||||
}
|
||||
function nextRandomWrite() {
|
||||
console.log('继续随机默写')
|
||||
initData(getCurrentStudyWord())
|
||||
randomWrite();
|
||||
showStatDialog = false
|
||||
}
|
||||
|
||||
useEvents([
|
||||
[EventKey.repeatStudy, repeat],
|
||||
[EventKey.continueStudy, continueStudy],
|
||||
[EventKey.randomWrite, nextRandomWrite],
|
||||
[EventKey.changeDict, () => {
|
||||
initData(getCurrentStudyWord())
|
||||
}],
|
||||
@@ -401,6 +419,8 @@ useEvents([
|
||||
[ShortcutKey.ToggleTheme, toggleTheme],
|
||||
[ShortcutKey.ToggleConciseMode, toggleConciseMode],
|
||||
[ShortcutKey.TogglePanel, togglePanel],
|
||||
[ShortcutKey.RandomWrite, randomWrite],
|
||||
[ShortcutKey.NextRandomWrite, nextRandomWrite],
|
||||
])
|
||||
|
||||
</script>
|
||||
@@ -453,6 +473,11 @@ useEvents([
|
||||
:title="`下一组(${settingStore.shortcutKeyMap[ShortcutKey.NextChapter]})`">
|
||||
<IconFluentArrowRight16Regular class="arrow" width="22"/>
|
||||
</BaseIcon>
|
||||
<BaseIcon
|
||||
@click="randomWrite"
|
||||
:title="`随机默写(${settingStore.shortcutKeyMap[ShortcutKey.RandomWrite]})`">
|
||||
<IconFluentArrowShuffle16Regular class="arrow" width="22"/>
|
||||
</BaseIcon>
|
||||
</div>
|
||||
</template>
|
||||
<div class="panel-page-item pl-4">
|
||||
|
||||
@@ -168,6 +168,11 @@ function options(emitType: string) {
|
||||
@click="options(EventKey.continueStudy)">
|
||||
{{ dictIsEnd ? '重新练习' : '再来一组' }}
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
:keyboard="settingStore.shortcutKeyMap[ShortcutKey.NextRandomWrite]"
|
||||
@click="options(EventKey.randomWrite)">
|
||||
继续默写
|
||||
</BaseButton>
|
||||
<BaseButton @click="$router.back">
|
||||
返回主页
|
||||
</BaseButton>
|
||||
|
||||
Reference in New Issue
Block a user