diff --git a/app/src/assets/scss/component/_card.scss b/app/src/assets/scss/component/_card.scss index 1e4587c78..94b3e25d1 100644 --- a/app/src/assets/scss/component/_card.scss +++ b/app/src/assets/scss/component/_card.scss @@ -34,8 +34,8 @@ } &__img { - width: 96px; - height: 96px; + width: 100px; + height: 100px; display: flex; justify-content: center; align-items: center; diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts index b90f74263..57e12f7bc 100644 --- a/app/src/types/index.d.ts +++ b/app/src/types/index.d.ts @@ -632,6 +632,9 @@ declare interface IFile { hMtime: string; hCtime: string; hSize: string; + dueFlashcardCount?: string; + newFlashcardCount?: string; + flashcardCount?: string; id: string; count: number; subFileCount: number; diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.ts index 031443b76..53be41999 100644 --- a/app/src/util/pathName.ts +++ b/app/src/util/pathName.ts @@ -8,7 +8,7 @@ import {unicode2Emoji} from "../emoji"; import {Constants} from "../constants"; import {showMessage} from "../dialog/message"; -export const getIdZoomInByPath = () => { +export const getIdZoomInByPath = () => { const searchParams = new URLSearchParams(window.location.search); const PWAURL = searchParams.get("url"); let id = ""; @@ -128,7 +128,8 @@ export const moveToPath = (fromPaths: string[], toNotebook: string, toPath: stri }); }; -export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void, paths?: string[], range?: Range, title?: string, flashcard = false) => { +export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void, + paths?: string[], range?: Range, title?: string, flashcard = false) => { const exitDialog = window.siyuan.dialogs.find((item) => { if (item.element.querySelector("#foldList")) { item.destroy(); @@ -161,6 +162,8 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void, } } }); + // 文档树上引用数悬浮层不被遮挡 + dialog.element.style.zIndex = "200"; if (paths && paths.length > 0) { fetchPost("/api/filetree/getHPathsByPaths", {paths}, (response) => { dialog.element.querySelector(".b3-dialog__header .ft__smaller").innerHTML = escapeHtml(response.data.join(" ")); @@ -204,10 +207,25 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void, flashcard, }, (data) => { let fileHTML = ""; - data.data.forEach((item: { boxIcon: string, box: string, hPath: string, path: string }) => { + data.data.forEach((item: { + boxIcon: string, + box: string, + hPath: string, + path: string, + newFlashcardCount: string, + dueFlashcardCount: string, + flashcardCount: string + }) => { + let countHTML = ""; + if (flashcard) { + countHTML = `${item.newFlashcardCount} +${item.dueFlashcardCount} +${item.flashcardCount}`; + } fileHTML += `
  • ${unicode2Emoji(item.boxIcon || Constants.SIYUAN_IMAGE_NOTE, false, "b3-list-item__graphic", true)} ${escapeHtml(item.hPath)} + ${countHTML}
  • `; }); searchListElement.innerHTML = fileHTML; @@ -435,7 +453,7 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void, }); }; -const getLeaf = (liElement: HTMLElement, flashcard:boolean) => { +const getLeaf = (liElement: HTMLElement, flashcard: boolean) => { const toggleElement = liElement.querySelector(".b3-list-item__arrow"); if (toggleElement.classList.contains("b3-list-item__arrow--open")) { toggleElement.classList.remove("b3-list-item__arrow--open"); @@ -463,7 +481,11 @@ const getLeaf = (liElement: HTMLElement, flashcard:boolean) => { let fileHTML = ""; response.data.files.forEach((item: IFile) => { let countHTML = ""; - if (item.count && item.count > 0) { + if (flashcard) { + countHTML = `${item.newFlashcardCount} +${item.dueFlashcardCount} +${item.flashcardCount}`; + } else if (item.count && item.count > 0) { countHTML = `${item.count}`; } fileHTML += `