mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
c287dd080b
commit
698586bd4d
3 changed files with 17 additions and 3 deletions
|
@ -415,10 +415,14 @@ export const genHintItemHTML = (item: IBlock) => {
|
|||
if (attrHTML) {
|
||||
attrHTML = `<div class="fn__flex b3-list-item__meta b3-list-item__showall">${attrHTML}</div>`;
|
||||
}
|
||||
|
||||
return `${attrHTML}<div class="b3-list-item__first">
|
||||
let countHTML = '';
|
||||
if (item.refCount) {
|
||||
countHTML = `<span class="popover__block counter b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.ref}">${item.refCount}</span>`;
|
||||
}
|
||||
// data-node-id 用于获取引用面板
|
||||
return `${attrHTML}<div class="b3-list-item__first" data-node-id="${item.id}">
|
||||
${iconHTML}
|
||||
<span class="b3-list-item__text">${item.content}</span>
|
||||
<span class="b3-list-item__text">${item.content}</span>${countHTML}
|
||||
</div>
|
||||
<div class="b3-list-item__meta b3-list-item__showall">${item.hPath}</div>`;
|
||||
};
|
||||
|
|
|
@ -1324,6 +1324,7 @@ const onSearch = (data: IBlock[], edit: Protyle, element: Element, config: Confi
|
|||
let newData;
|
||||
data.forEach((item) => {
|
||||
const title = getNotebookName(item.box) + getDisplayName(item.hPath, false);
|
||||
let countHTML = '';
|
||||
if (item.children) {
|
||||
resultHTML += `<div class="b3-list-item">
|
||||
<span class="b3-list-item__toggle b3-list-item__toggle--hl">
|
||||
|
@ -1341,12 +1342,16 @@ ${unicode2Emoji(getNotebookIcon(item.box) || window.siyuan.storage[Constants.LOC
|
|||
newData = childItem;
|
||||
}
|
||||
}
|
||||
if (childItem.refCount) {
|
||||
countHTML = `<span class="popover__block counter b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.ref}">${childItem.refCount}</span>`;
|
||||
}
|
||||
resultHTML += `<div style="padding-left: 36px" data-type="search-item" class="b3-list-item" data-node-id="${childItem.id}" data-root-id="${childItem.rootID}">
|
||||
<svg class="b3-list-item__graphic popover__block" data-id="${childItem.id}"><use xlink:href="#${getIconByType(childItem.type)}"></use></svg>
|
||||
${unicode2Emoji(childItem.ial.icon, "b3-list-item__graphic", true)}
|
||||
<span class="b3-list-item__text">${childItem.content}</span>
|
||||
${getAttr(childItem)}
|
||||
${childItem.tag ? `<span class="b3-list-item__meta b3-list-item__meta--ellipsis">${childItem.tag.replace(/#/g, "")}</span>` : ""}
|
||||
${countHTML}
|
||||
</div>`;
|
||||
});
|
||||
resultHTML += "</div>";
|
||||
|
@ -1359,6 +1364,9 @@ ${childItem.tag ? `<span class="b3-list-item__meta b3-list-item__meta--ellipsis"
|
|||
newData = item;
|
||||
}
|
||||
}
|
||||
if (item.refCount) {
|
||||
countHTML = `<span class="popover__block counter b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.ref}">${item.refCount}</span>`;
|
||||
}
|
||||
resultHTML += `<div data-type="search-item" class="b3-list-item" data-node-id="${item.id}" data-root-id="${item.rootID}">
|
||||
<svg class="b3-list-item__graphic popover__block" data-id="${item.id}"><use xlink:href="#${getIconByType(item.type)}"></use></svg>
|
||||
${unicode2Emoji(item.ial.icon, "b3-list-item__graphic", true)}
|
||||
|
@ -1366,6 +1374,7 @@ ${unicode2Emoji(item.ial.icon, "b3-list-item__graphic", true)}
|
|||
${getAttr(item)}
|
||||
${item.tag ? `<span class="b3-list-item__meta b3-list-item__meta--ellipsis">${item.tag.replace(/#/g, "")}</span>` : ""}
|
||||
<span class="b3-list-item__meta b3-list-item__meta--ellipsis ariaLabel" aria-label="${escapeAriaLabel(title)}">${escapeGreat(title)}</span>
|
||||
${countHTML}
|
||||
</div>`;
|
||||
}
|
||||
});
|
||||
|
|
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
@ -772,6 +772,7 @@ interface IBlock {
|
|||
children?: IBlock[]
|
||||
length?: number
|
||||
ial: IObject
|
||||
refCount?: number
|
||||
}
|
||||
|
||||
interface IRiffCard {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue