From 29f9f8894c2103d13dcca36cea7e61d4161715e1 Mon Sep 17 00:00:00 2001 From: simply-none Date: Wed, 17 Jan 2024 15:24:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=201.0.0alpha=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 5 +++++ src/views/todayVocabulary.vue | 24 ++---------------------- src/views/wordMainPage.vue | 4 ++-- src/views/wordsIframe.vue | 28 ++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 src/views/wordsIframe.vue diff --git a/src/router/index.js b/src/router/index.js index cfc3773..8862326 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -6,6 +6,11 @@ export const routes = [ name: 'lookTodayVoca', component: () => import('../views/todayVocabularyList.vue') }, + { + path: '/words-iframe', + name: 'wordsIframe', + component: () => import('../views/wordsIframe.vue') + }, { path: '/', name: 'wordMainPage', diff --git a/src/views/todayVocabulary.vue b/src/views/todayVocabulary.vue index b157eab..eb7ad9e 100644 --- a/src/views/todayVocabulary.vue +++ b/src/views/todayVocabulary.vue @@ -64,8 +64,6 @@ import TablePage from "../components/tablePage.vue"; import { ref, reactive, onMounted, watch, toRaw } from "vue"; import { - TableV2SortOrder, - TableV2FixedDir, ElButton, ElIcon, } from "element-plus"; @@ -81,12 +79,6 @@ import moment from "moment"; import { funDownloadByJson } from "../utils/generateFile"; import { delBFromA, filterBFromA } from "../utils/common"; -const sortState = ref({ - n: TableV2SortOrder.ASC, - date: TableV2SortOrder.ASC, - count: TableV2SortOrder.ASC, -}); - let todayDate = ref(moment().format("YYYY-MM-DD")); let useBook = useBookStore(); @@ -158,18 +150,6 @@ function getPageData(data, current, newSize) { return data.slice(start, start + tablePageSize.value); } -function onSort({ key, order }) { - sortState.value[key] = order; - historyVocalist.value.sort((a, b) => { - if (a[key] > b[key]) { - return 1; - } - return -1; - }); - historyVocalist.value = - order === "asc" ? historyVocalist.value : historyVocalist.value.reverse(); -} - async function delWrod(data, index) { historyTable .where("id") @@ -243,7 +223,7 @@ async function getVocaList() { } todayTable.toArray().then((d) => { vocalist.value = d; - vocalistPage.value = d; + vocalistPage.value = getPageData(vocalist.value, 1) }); } @@ -257,7 +237,7 @@ async function getHistoryVocaList() { } historyTable.toArray().then((d) => { historyVocalist.value = d; - historyVocalistPage.value = d; + historyVocalistPage.value = getPageData(historyVocalist.value, 1) }); } diff --git a/src/views/wordMainPage.vue b/src/views/wordMainPage.vue index 25e8b1c..1c47c68 100644 --- a/src/views/wordMainPage.vue +++ b/src/views/wordMainPage.vue @@ -59,14 +59,14 @@ import { onUnmounted, toRaw, } from "vue"; +import { ElNotification, ElMessage, ElLoading } from "element-plus"; +import { Setting, RefreshLeft } from "@element-plus/icons-vue"; import { useVoca } from "../hooks/useVoca"; import SettingCom from "./Setting.vue"; import WordCom from "./word.vue"; import ConciseWord from "./conciseWord.vue"; -import { ElNotification, ElMessage, ElLoading } from "element-plus"; -import { Setting, RefreshLeft } from "@element-plus/icons-vue"; import { useBookStore } from "../stores/books"; import { storeToRefs } from "pinia"; diff --git a/src/views/wordsIframe.vue b/src/views/wordsIframe.vue new file mode 100644 index 0000000..4af59af --- /dev/null +++ b/src/views/wordsIframe.vue @@ -0,0 +1,28 @@ + + + + +