mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 08:30:42 +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) {
|
if (attrHTML) {
|
||||||
attrHTML = `<div class="fn__flex b3-list-item__meta b3-list-item__showall">${attrHTML}</div>`;
|
attrHTML = `<div class="fn__flex b3-list-item__meta b3-list-item__showall">${attrHTML}</div>`;
|
||||||
}
|
}
|
||||||
|
let countHTML = '';
|
||||||
return `${attrHTML}<div class="b3-list-item__first">
|
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}
|
${iconHTML}
|
||||||
<span class="b3-list-item__text">${item.content}</span>
|
<span class="b3-list-item__text">${item.content}</span>${countHTML}
|
||||||
</div>
|
</div>
|
||||||
<div class="b3-list-item__meta b3-list-item__showall">${item.hPath}</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;
|
let newData;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
const title = getNotebookName(item.box) + getDisplayName(item.hPath, false);
|
const title = getNotebookName(item.box) + getDisplayName(item.hPath, false);
|
||||||
|
let countHTML = '';
|
||||||
if (item.children) {
|
if (item.children) {
|
||||||
resultHTML += `<div class="b3-list-item">
|
resultHTML += `<div class="b3-list-item">
|
||||||
<span class="b3-list-item__toggle b3-list-item__toggle--hl">
|
<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;
|
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}">
|
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>
|
<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)}
|
${unicode2Emoji(childItem.ial.icon, "b3-list-item__graphic", true)}
|
||||||
<span class="b3-list-item__text">${childItem.content}</span>
|
<span class="b3-list-item__text">${childItem.content}</span>
|
||||||
${getAttr(childItem)}
|
${getAttr(childItem)}
|
||||||
${childItem.tag ? `<span class="b3-list-item__meta b3-list-item__meta--ellipsis">${childItem.tag.replace(/#/g, "")}</span>` : ""}
|
${childItem.tag ? `<span class="b3-list-item__meta b3-list-item__meta--ellipsis">${childItem.tag.replace(/#/g, "")}</span>` : ""}
|
||||||
|
${countHTML}
|
||||||
</div>`;
|
</div>`;
|
||||||
});
|
});
|
||||||
resultHTML += "</div>";
|
resultHTML += "</div>";
|
||||||
|
@ -1359,6 +1364,9 @@ ${childItem.tag ? `<span class="b3-list-item__meta b3-list-item__meta--ellipsis"
|
||||||
newData = item;
|
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}">
|
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>
|
<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)}
|
${unicode2Emoji(item.ial.icon, "b3-list-item__graphic", true)}
|
||||||
|
@ -1366,6 +1374,7 @@ ${unicode2Emoji(item.ial.icon, "b3-list-item__graphic", true)}
|
||||||
${getAttr(item)}
|
${getAttr(item)}
|
||||||
${item.tag ? `<span class="b3-list-item__meta b3-list-item__meta--ellipsis">${item.tag.replace(/#/g, "")}</span>` : ""}
|
${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>
|
<span class="b3-list-item__meta b3-list-item__meta--ellipsis ariaLabel" aria-label="${escapeAriaLabel(title)}">${escapeGreat(title)}</span>
|
||||||
|
${countHTML}
|
||||||
</div>`;
|
</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[]
|
children?: IBlock[]
|
||||||
length?: number
|
length?: number
|
||||||
ial: IObject
|
ial: IObject
|
||||||
|
refCount?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IRiffCard {
|
interface IRiffCard {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue