From 7eecee7b01244c85226d3676691807abf76eb8cf Mon Sep 17 00:00:00 2001 From: zyronon Date: Mon, 13 Nov 2023 18:53:36 +0800 Subject: [PATCH] save --- components.d.ts | 3 +- src/App.vue | 2 +- src/assets/img/flags/leetcode.png | Bin 0 -> 982 bytes src/assets/img/flags/my.png | Bin 0 -> 1090 bytes src/components/Modal/DictModal.vue | 379 +++++++++---------- src/components/Modal/DictModal2.vue | 550 ++++++++++++++++++++++++++++ src/components/list/DictItem.vue | 91 +++++ src/components/list/DictList.vue | 67 +--- src/stores/base.ts | 4 + src/types.ts | 2 + 10 files changed, 849 insertions(+), 249 deletions(-) create mode 100644 src/assets/img/flags/leetcode.png create mode 100644 src/assets/img/flags/my.png create mode 100644 src/components/Modal/DictModal2.vue create mode 100644 src/components/list/DictItem.vue diff --git a/components.d.ts b/components.d.ts index 7f65064e..8ef991b5 100644 --- a/components.d.ts +++ b/components.d.ts @@ -20,8 +20,10 @@ declare module 'vue' { Close: typeof import('./src/components/icon/Close.vue')['default'] CommonWordList: typeof import('./src/components/list/CommonWordList.vue')['default'] DictGroup: typeof import('./src/components/Toolbar/DictGroup.vue')['default'] + DictItem: typeof import('./src/components/list/DictItem.vue')['default'] DictList: typeof import('./src/components/list/DictList.vue')['default'] DictModal: typeof import('./src/components/Modal/DictModal.vue')['default'] + DictModal2: typeof import('./src/components/Modal/DictModal2.vue')['default'] EditAbleText: typeof import('./src/components/EditAbleText.vue')['default'] EditArticle: typeof import('./src/components/Article/EditArticle.vue')['default'] EditBatchArticleModal: typeof import('./src/components/Article/EditBatchArticleModal.vue')['default'] @@ -71,7 +73,6 @@ declare module 'vue' { VolumeSetting: typeof import('./src/components/Toolbar/VolumeSetting.vue')['default'] WordItem: typeof import('./src/components/list/WordItem.vue')['default'] WordList: typeof import('./src/components/list/WordList.vue')['default'] - WordList2: typeof import('./src/components/list/WordList2.vue')['default'] WordListModal: typeof import('./src/components/Modal/WordListModal.vue')['default'] } export interface ComponentCustomProperties { diff --git a/src/App.vue b/src/App.vue index a2a0150a..0a32c900 100644 --- a/src/App.vue +++ b/src/App.vue @@ -53,7 +53,7 @@ onMounted(() => { init() }) -useStartKeyboardEventListener() +// useStartKeyboardEventListener() diff --git a/src/assets/img/flags/leetcode.png b/src/assets/img/flags/leetcode.png new file mode 100644 index 0000000000000000000000000000000000000000..60985225e9311640137606e9afa3e03b1736dbd2 GIT binary patch literal 982 zcmV;{11bE8P)Px&kV!;AR9Hu~mTgE=Q5eVnYtwC(&RQu3kzw;CD|*w4sL-r53PC|dX=Yf1q=A_w zIg)ZpMuLL*k|_8xSeTj_1cF8ugpve)Ny}DLWLR5Sip`f9cQW&Icei_Ho{#rD&-448 zbDwkW6<92mS^S65-`|h+_6LZIi$_RE2=9u5{~=IVScv@m>sF{jp+HYhFQif_FNsA9 z+`L(Yyu3UDW-z>ipP%2-3ltX@L!-$hKpKq(xw#r%a3;v*9Vjg=K~7E%0a7YcQB_sN z8}70|Sy>sfvo8{$h=@qEwzfhn7B8(pWn~32GcyTDXm9}T)!cypjuTXH>K&-Az5}&d zO+fs8BzRi5!}?4l4~ECqRJgC*&0BBkF>N?L;>ci)#-Gsq89Tg#(PU({_upD z^NK8jyI&Zm1gAh#QxlZRlf2*ygMK}|Mo28*u7Y$^BAq~YcQ=k6Jwgq)CD(`Uxa8 zz(7__qtOVH@f!^bGMP7IG8x1Y$$TD5AT)Fn3~k zS0LUHMK8c)&`L}j2k_$&`Oo0FKM&&d2VE23l4x$M#IbntD>*UHjPVz@2@nHj1RM>g z{{!|U*7?fNU9EzA>s(`+-*@8on}^hJCV`iLJ&D1Z@JSa%590f1(*c2`aC-B zHz4=)0mN*ayDk46l7MKe*!#B$ogG~&0jAj0mzS6rY{lfqXY;iMLN|z31wj%V@37(Q z$xsW}ip-jSVrIe!Sf(NJ-T*8UIa{pVd6xxTqS;CM0~na0Q1MOB+W-In07*qoM6N<$ Eg18^Q{r~^~ literal 0 HcmV?d00001 diff --git a/src/assets/img/flags/my.png b/src/assets/img/flags/my.png new file mode 100644 index 0000000000000000000000000000000000000000..0da9f1d364400fd870cf0369f8b88a685f6397cc GIT binary patch literal 1090 zcmV-I1ikx-P)Px&{7FPXR9Hvtmu+ZURT#(r&$%}VZIXeEp>x{@aR@4GOc|XD;`{W=L~R^(B8;uM z%|JJ8lBJtqhA8GHT?e8~x)%mhtWCEM?vsOIaUh#38;Z(?g5t}BDWWcoYwo@0k$cn3 ztW9!L6BvT$WA1bQ|KE9@bDncTxW+MUj);_Nw2b#uBf$eZd6{8Y-#g*Nk493S4_g9oPC(JR zR8A@His+tXBf*iF`4khz0hFdYl|?Tksj`1+PIE1RJu4SCbCu?!LRqj$CkLq3$i>ZH z0W1XJsFqUKwY&*!0lW1|DJIKx<>(F%-=+&<)^}KcBJ7Tkcua zBDwA6Niezy*dNx_&GRvEi!D4I-A;@*>^PyAH+78evEP&b01WTsCBm?NbOM@qc(@tP z{(dPGeLw)t-N29=1Nq$tuL8)$F5e7NzX9;AfO2oIP7X}F2Cs_;i#}=pZ@7`c&js>> zhvt-EZ_Mm5A$^gw*P(0onCk9-OoFV!Z literal 0 HcmV?d00001 diff --git a/src/components/Modal/DictModal.vue b/src/components/Modal/DictModal.vue index 8ff51f1d..1419f6a1 100644 --- a/src/components/Modal/DictModal.vue +++ b/src/components/Modal/DictModal.vue @@ -18,6 +18,8 @@ import {isArticle} from "@/hooks/article.ts"; import {useRuntimeStore} from "@/stores/runtime.ts"; import {useSettingStore} from "@/stores/setting.ts"; import {emitter, EventKey} from "@/utils/eventBus.ts"; +import Slide from "@/components/Slide.vue"; +import DictList from "@/components/list/DictList.vue"; const baseStore = useBaseStore() const settingStore = useSettingStore() @@ -104,9 +106,19 @@ const groupByTranslateLanguage = $computed(() => { if (currentLanguage === 'article') { let articleList = dictionaryResources.filter(v => v.type === 'article') data = groupBy(articleList, 'translateLanguage') + } else if (currentLanguage === 'my') { + data = { + common: [ + baseStore.collect, + baseStore.simple, + baseStore.wrong + ].concat(baseStore.myDicts.filter(v => [DictType.customWord, DictType.customArticle].includes(v.type))) + .concat([{name: '',} as any]) + } } else { data = groupBy(groupByLanguage[currentLanguage], 'translateLanguage') } + console.log('groupByTranslateLanguage', data) translateLanguageList = Object.keys(data) currentTranslateLanguage = translateLanguageList[0] return data @@ -120,7 +132,7 @@ const groupedByCategoryAndTag = $computed(() => { for (const [key, value] of Object.entries(groupByCategory)) { data.push([key, groupByDictTags(value)]) } - // console.log('data', data) + console.log('groupedByCategoryAndTag', data) return data }) @@ -158,30 +170,32 @@ function changeSort(v) { @@ -359,20 +373,15 @@ $radius: 16rem; $time: 0.3s; $header-height: 60rem; -.slide { +#DictDialog { + position: fixed; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + background: var(--color-second-bg); + z-index: 99999; width: 1000rem; height: 75vh; - - .slide-list { - width: 200%; - height: 100%; - display: flex; - transition: all .5s; - } - - .step1 { - transform: translate3d(-50%, 0, 0); - } } .dict-page { diff --git a/src/components/Modal/DictModal2.vue b/src/components/Modal/DictModal2.vue new file mode 100644 index 00000000..8ff51f1d --- /dev/null +++ b/src/components/Modal/DictModal2.vue @@ -0,0 +1,550 @@ + + + + + + diff --git a/src/components/list/DictItem.vue b/src/components/list/DictItem.vue new file mode 100644 index 00000000..221a6878 --- /dev/null +++ b/src/components/list/DictItem.vue @@ -0,0 +1,91 @@ + + + + + \ No newline at end of file diff --git a/src/components/list/DictList.vue b/src/components/list/DictList.vue index 9873a9b1..85f1015b 100644 --- a/src/components/list/DictList.vue +++ b/src/components/list/DictList.vue @@ -1,6 +1,7 @@