feat:save
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import EditArticle2 from "@/pages/pc/components/article/EditArticle2.vue";
|
||||
import BaseIcon from "@/components/BaseIcon.vue";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="h-screen">
|
||||
<BaseIcon
|
||||
title="返回"
|
||||
@click="$router.back"
|
||||
icon="formkit:left"/>
|
||||
<EditArticle2 class="vue"></EditArticle2>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,13 +4,7 @@ import {Article, DefaultArticle, Sentence, TranslateEngine} from "@/types.ts";
|
||||
import BaseButton from "@/components/BaseButton.vue";
|
||||
import EditAbleText from "@/pages/pc/components/EditAbleText.vue";
|
||||
import {Icon} from "@iconify/vue";
|
||||
import {
|
||||
getNetworkTranslate,
|
||||
getSentenceAllText,
|
||||
getSentenceAllTranslateText,
|
||||
renewSectionTexts,
|
||||
renewSectionTranslates
|
||||
} from "@/hooks/translate.ts";
|
||||
import {getNetworkTranslate, getSentenceAllText, getSentenceAllTranslateText} from "@/hooks/translate.ts";
|
||||
import {genArticleSectionData, splitCNArticle2, splitEnArticle2, usePlaySentenceAudio} from "@/hooks/article.ts";
|
||||
import {cloneDeep, last} from "lodash-es";
|
||||
import {watch} from "vue";
|
||||
@@ -52,7 +46,6 @@ watch(() => props.article, val => {
|
||||
progress = 0
|
||||
failCount = 0
|
||||
apply()
|
||||
console.log('ar', editArticle)
|
||||
}, {immediate: true})
|
||||
|
||||
watch(() => editArticle.text, (s) => {
|
||||
@@ -542,6 +535,7 @@ function setStartTime(val: Sentence, i: number, j: number) {
|
||||
.content {
|
||||
color: var(--color-article);
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
gap: var(--space);
|
||||
|
||||
@@ -7,7 +7,6 @@ import {useBaseStore} from "@/stores/base.ts";
|
||||
|
||||
import List from "@/pages/pc/components/list/List.vue";
|
||||
import Dialog from "@/pages/pc/components/dialog/Dialog.vue";
|
||||
import EditArticle from "@/pages/pc/components/article/EditArticle.vue";
|
||||
import {emitter, EventKey} from "@/utils/eventBus.ts";
|
||||
import {useDisableEventListener, useWindowClick} from "@/hooks/event.ts";
|
||||
import {MessageBox} from "@/utils/MessageBox.tsx";
|
||||
@@ -15,6 +14,7 @@ import {useRuntimeStore} from "@/stores/runtime.ts";
|
||||
import {nanoid} from "nanoid";
|
||||
import {syncMyDictList} from "@/hooks/dict.ts";
|
||||
import MiniDialog from "@/pages/pc/components/dialog/MiniDialog.vue";
|
||||
import EditArticle2 from "@/pages/pc/components/article/EditArticle2.vue";
|
||||
|
||||
const emit = defineEmits<{
|
||||
importData: [val: Event]
|
||||
@@ -193,7 +193,7 @@ useWindowClick(() => showExport = false)
|
||||
<BaseButton size="small" @click="add">新增</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
<EditArticle
|
||||
<EditArticle2
|
||||
ref="editArticleRef"
|
||||
type="batch"
|
||||
@save="saveArticle"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
import {Article, DefaultArticle} from "@/types.ts";
|
||||
import {cloneDeep} from "lodash-es";
|
||||
import Dialog from "@/pages/pc/components/dialog/Dialog.vue";
|
||||
import EditArticle from "@/pages/pc/components/article/EditArticle.vue";
|
||||
import {useDisableEventListener} from "@/hooks/event.ts";
|
||||
import EditArticle2 from "@/pages/pc/components/article/EditArticle2.vue";
|
||||
|
||||
interface IProps {
|
||||
article?: Article
|
||||
@@ -32,7 +32,7 @@ useDisableEventListener(() => props.modelValue)
|
||||
:full-screen="true"
|
||||
>
|
||||
<div class="wrapper">
|
||||
<EditArticle
|
||||
<EditArticle2
|
||||
:article="article"
|
||||
@save="val => emit('save',val)"
|
||||
/>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import {splitEnArticle} from "@/hooks/article.ts";
|
||||
import {splitEnArticle2} from "@/hooks/article.ts";
|
||||
|
||||
function test() {
|
||||
let {newText, sections} = splitEnArticle(
|
||||
splitEnArticle2(
|
||||
`While it is yet to be seen what direction the second Trump administration will take globally in its China policy, VOA traveled to the main island of Mahe in Seychelles to look at how China and the U.S. have impacted the country, and how each is fairing in that competition for influence there.
|
||||
`)
|
||||
}
|
||||
|
||||
function test2() {
|
||||
let {newText, sections} = splitEnArticle(
|
||||
splitEnArticle2(
|
||||
`
|
||||
Last week I went to the theatre. I had a very good seat. The play was very interesting. I did not enjoy it. A young man and a young woman were sitting behind me. They were talking loudly. I got very angry. I could not hear the actors. I turned round. I looked at the man and the woman angrily. They did not pay any attention. In the end, I could not bear it. I turned round again. I cant hear a word! I said angrily.
|
||||
Its none of your business, the young man said rudely. This is a private conversation!
|
||||
|
||||
@@ -1,21 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import TypingArticle from "./TypingArticle.vue";
|
||||
import {
|
||||
Article,
|
||||
ArticleItem,
|
||||
ArticleWord,
|
||||
DefaultArticle,
|
||||
DisplayStatistics, Sentence,
|
||||
ShortcutKey,
|
||||
TranslateType,
|
||||
Word
|
||||
} from "@/types.ts";
|
||||
import {Article, ArticleItem, ArticleWord, DefaultArticle, DisplayStatistics, ShortcutKey, Word} from "@/types.ts";
|
||||
import {cloneDeep} from "lodash-es";
|
||||
import TypingWord from "@/pages/pc/components/TypingWord.vue";
|
||||
import Panel from "../../components/Panel.vue";
|
||||
import {onMounted, onUnmounted} from "vue";
|
||||
import {renewSectionTexts, renewSectionTranslates} from "@/hooks/translate.ts";
|
||||
import {MessageBox} from "@/utils/MessageBox.tsx";
|
||||
import {useBaseStore} from "@/stores/base.ts";
|
||||
import EditSingleArticleModal from "@/pages/pc/components/article/EditSingleArticleModal.vue";
|
||||
import {usePracticeStore} from "@/stores/practice.ts";
|
||||
@@ -31,8 +20,7 @@ import ArticleList from "@/pages/pc/components/list/ArticleList.vue";
|
||||
import {useOnKeyboardEventListener} from "@/hooks/event.ts";
|
||||
import VolumeSetting from "@/pages/pc/components/toolbar/VolumeSetting.vue";
|
||||
import TranslateSetting from "@/pages/pc/components/toolbar/TranslateSetting.vue";
|
||||
import {usePlayWordAudio} from "@/hooks/sound.ts";
|
||||
import {usePlaySentenceAudio} from "@/hooks/article.ts";
|
||||
import {genArticleSectionData, usePlaySentenceAudio} from "@/hooks/article.ts";
|
||||
|
||||
const store = useBaseStore()
|
||||
const statisticsStore = usePracticeStore()
|
||||
@@ -105,11 +93,8 @@ function getCurrentPractice() {
|
||||
if (tempArticle.sections.length) {
|
||||
setArticle(tempArticle)
|
||||
} else {
|
||||
renewSectionTexts(tempArticle)
|
||||
if (tempArticle.textTranslate.trim()) {
|
||||
renewSectionTranslates(tempArticle, tempArticle.textTranslate)
|
||||
setArticle(tempArticle)
|
||||
}
|
||||
genArticleSectionData(tempArticle)
|
||||
setArticle(tempArticle)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user