mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
Compare commits
8 commits
cd65fa9d44
...
b8bcf76f75
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b8bcf76f75 | ||
![]() |
be58df4d45 | ||
![]() |
3404395cfa | ||
![]() |
c8a3ec52d7 | ||
![]() |
698586bd4d | ||
![]() |
c287dd080b | ||
![]() |
4744429550 | ||
![]() |
ef0e29a6fd |
20 changed files with 85 additions and 44 deletions
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "عدد أيام حفظ لقطة البيانات",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "عدد لقطات البيانات في اليوم",
|
||||
"fields": "حقول",
|
||||
"dynamicEmoji": "أيقونة ديناميكية",
|
||||
"dynamicIcon": "أيقونة ديناميكية",
|
||||
"dynamicIconDateEmptyInfo": "إذا كان التاريخ فارغًا، فسيظهر أيقونة التقويم التاريخ الحالي بشكل ديناميكي",
|
||||
"backlinkContainChildren": "جعل الروابط المرجعية تحتوي على كتل فرعية",
|
||||
"backlinkContainChildrenTip": "عند التمكين، سيتم تضمين الكتل الفرعية في حساب الروابط المرجعية",
|
||||
"entryNum": "عدد المدخلات",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "اكتملت عملية تحسين فهرس البيانات، تم تحرير [%s] من مساحة القرص",
|
||||
"272": "حقل غير مسمى"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "Daten-Snapshot-Aufbewahrungstage",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "Daten-Snapshots pro Tag",
|
||||
"fields": "Attribut",
|
||||
"dynamicEmoji": "Dynamisches Icon",
|
||||
"dynamicIcon": "Dynamisches Icon",
|
||||
"dynamicIconDateEmptyInfo": "Wenn das Datum leer ist, zeigt das Kalendersymbol dynamisch das heutige Datum an",
|
||||
"backlinkContainChildren": "Enthalten Rückverweise untergeordnete Blöcke",
|
||||
"backlinkContainChildrenTip": "Wenn aktiviert, werden untergeordnete Blöcke in die Berechnung der Rückverweise einbezogen",
|
||||
"entryNum": "Anzahl der Einträge",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "Datenindex-Optimierung abgeschlossen, [%s] Speicherplatz freigegeben",
|
||||
"272": "Unbenanntes Feld"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "Data snapshot retention days",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "Data snapshots per day",
|
||||
"fields": "Fields",
|
||||
"dynamicEmoji": "Dynamic icon",
|
||||
"dynamicIcon": "Dynamic icon",
|
||||
"dynamicIconDateEmptyInfo": "When date is empty, the calendar icon will show today's date dynamically",
|
||||
"backlinkContainChildren": "Do backlinks contain child blocks",
|
||||
"backlinkContainChildrenTip": "When enabled, child blocks will be included in the backlink calculation",
|
||||
"entryNum": "Number of entries",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "Data index optimization completed, [%s] disk space freed",
|
||||
"272": "Unnamed field"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "Días de retención de instantáneas de datos",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "Número de instantáneas de datos por día",
|
||||
"fields": "Atributo",
|
||||
"dynamicEmoji": "Icono dinámico",
|
||||
"dynamicIcon": "Icono dinámico",
|
||||
"dynamicIconDateEmptyInfo": "Si la fecha está vacía, el icono del calendario mostrará dinámicamente la fecha de hoy",
|
||||
"backlinkContainChildren": "¿Los enlaces inversos contienen bloques secundarios?",
|
||||
"backlinkContainChildrenTip": "Una vez habilitado, los bloques secundarios se incluirán en el cálculo de los enlaces inversos",
|
||||
"entryNum": "Número de entradas",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "Optimización del índice de datos completada, se liberaron [%s] de espacio en disco",
|
||||
"272": "Campo sin nombre"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "Jours de rétention des instantanés de données",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "Nombre d'instantanés de données par jour",
|
||||
"fields": "Attribut",
|
||||
"dynamicEmoji": "Icône dynamique",
|
||||
"dynamicIcon": "Icône dynamique",
|
||||
"dynamicIconDateEmptyInfo": "Si la date est vide, l'icône du calendrier affichera dynamiquement la date d'aujourd'hui",
|
||||
"backlinkContainChildren": "Les liens retour contiennent-ils des sous-blocs",
|
||||
"backlinkContainChildrenTip": "Une fois activé, les sous-blocs seront inclus dans le calcul des liens retour",
|
||||
"entryNum": "Nombre d'entrées",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "Optimisation de l'index des données terminée, [%s] d'espace disque libéré",
|
||||
"272": "Champ sans nom"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "ימי שמירת תמונות נתונים",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "מספר תמונות נתונים ביום",
|
||||
"fields": "מאפיין",
|
||||
"dynamicEmoji": "אייקון דינמי",
|
||||
"dynamicIcon": "אייקון דינמי",
|
||||
"dynamicIconDateEmptyInfo": "אם התאריך ריק, סמל הלוח השנה יציג באופן דינמי את התאריך של היום",
|
||||
"backlinkContainChildren": "האם קישורים חוזרים כוללים בלוקים משניים",
|
||||
"backlinkContainChildrenTip": "לאחר ההפעלה, בלוקים משניים ייכללו בחישוב הקישורים החוזרים",
|
||||
"entryNum": "מספר ערכים",
|
||||
|
@ -1632,7 +1633,7 @@
|
|||
"242": "מעט מקום נותר [%s], נדרש לפחות [%s] כדי לבצע פעולה זו",
|
||||
"243": "רק רשום את %d התגים הראשונים (כולל תתי תגים), אם יש צורך להתאים, אנא שנה את [הגדרות - עץ המסמכים - מספר מקסימלי לרשימה]",
|
||||
"244": "אינדוקס הנתונים לא הושלם לאחר השימוש האחרון. אנא הפעל את [עץ מסמכים - שכתוב אינדקס]. אנא צא מהתוכנית לחלוטין לפני כיבוי המחשב.",
|
||||
"245": "אינדוקס הנתונים לא הושלם לאחר השימוש האחרון. אנא זכור לבצע [עץ המסמכים - שחזור אינדקס]. אנא השתמש [צא מהאפליקציה] בפאנל הטורי הימני כדי לצאת על פי סדר",
|
||||
"245": "אינדוקס הנתונים לא הושלם לאחר השימוש האחרון. אנא זכור לבצע [עץ המסמכים - שחזור אינדקס]. אנא השתמש [צא מהאפליקציה] בפאנל הטורי הימני כדי לצאת על פי סדר",
|
||||
"246": "כותרת המסמך לא יכולה להכיל / והחלפה ב- _ ",
|
||||
"247": "הקובץ [%s] גדול יותר מהמגבלה המקסימלית [%s], והוזנח להעלות בענן",
|
||||
"248": "הכותרת היעד ממוקמת בבלוק המיכל ואינה יכולה לשמש כנקודת זרימה",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "אופטימיזציית אינדקס הנתונים הושלמה, שוחררו [%s] שטח דיסק",
|
||||
"272": "שדה ללא שם"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "Giorni di conservazione degli snapshot dei dati",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "Numero di snapshot dei dati al giorno",
|
||||
"fields": "Campi",
|
||||
"dynamicEmoji": "Emoji dinamica",
|
||||
"dynamicIcon": "Emoji dinamica",
|
||||
"dynamicIconDateEmptyInfo": "Se la data è vuota, l'icona del calendario mostrerà dinamicamente la data odierna",
|
||||
"backlinkContainChildren": "I backlink contengono blocchi figli",
|
||||
"backlinkContainChildrenTip": "Dopo l'attivazione, i blocchi figli saranno inclusi nel calcolo dei backlink",
|
||||
"entryNum": "Numero di voci",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "Ottimizzazione dell'indice dei dati completata, liberati [%s] di spazio su disco",
|
||||
"272": "Campo senza nome"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "データスナップショットの保持日数",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "データスナップショットの毎日の保持数",
|
||||
"fields": "属性",
|
||||
"dynamicEmoji": "動的アイコン",
|
||||
"dynamicIcon": "動的アイコン",
|
||||
"dynamicIconDateEmptyInfo": "日付が空の場合、カレンダーアイコンは現在の日付を動的に表示します",
|
||||
"backlinkContainChildren": "バックリンクに子ブロックを含めるかどうか",
|
||||
"backlinkContainChildrenTip": "有効にすると、子ブロックがバックリンク計算に含まれます",
|
||||
"entryNum": "エントリ数",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "データインデックスの最適化が完了しました。合計 [%s] のディスク容量が解放されました",
|
||||
"272": "未命名フィールド"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "Dni przechowywania migawek danych",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "Liczba migawek danych dziennie",
|
||||
"fields": "Atrybut",
|
||||
"dynamicEmoji": "Ikona dynamiczna",
|
||||
"dynamicIcon": "Ikona dynamiczna",
|
||||
"dynamicIconDateEmptyInfo": "Jeśli data jest pusta, ikona kalendarza będzie dynamicznie pokazywać dzisiejszą datę",
|
||||
"backlinkContainChildren": "Czy linki zwrotne zawierają bloki podrzędne",
|
||||
"backlinkContainChildrenTip": "Po włączeniu bloki podrzędne zostaną uwzględnione w obliczeniach linków zwrotnych",
|
||||
"entryNum": "Количество записей",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "Optymalizacja indeksu danych zakończona, zwolniono [%s] miejsca na dysku",
|
||||
"272": "Nienazwane pole"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "Dias de retenção de instantâneos de dados",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "Instantâneos de dados por dia",
|
||||
"fields": "Campos",
|
||||
"dynamicEmoji": "Ícone dinâmico",
|
||||
"dynamicIcon": "Ícone dinâmico",
|
||||
"dynamicIconDateEmptyInfo": "Se a data estiver vazia, o ícone do calendário exibirá dinamicamente a data atual",
|
||||
"backlinkContainChildren": "Os backlinks contêm blocos filhos",
|
||||
"backlinkContainChildrenTip": "Quando ativado, os blocos filhos serão incluídos no cálculo do backlink",
|
||||
"entryNum": "Número de entradas",
|
||||
|
@ -1353,7 +1354,7 @@
|
|||
"xy": "%d anos %s",
|
||||
"max": "há muito tempo %s"
|
||||
},
|
||||
"_taskAction": {
|
||||
"_taskAction": {
|
||||
"task.repo.checkout": "Executar checkout do snapshot",
|
||||
"task.database.index.full": "Executar reconstrução do índice",
|
||||
"task.database.index": "Executar índice do banco de dados",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "Otimização do índice de dados concluída, [%s] de espaço liberado",
|
||||
"272": "Campo sem nome"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "Срок хранения снимков данных",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "Количество снимков данных в день",
|
||||
"fields": "Атрибут",
|
||||
"dynamicEmoji": "Динамическая иконка",
|
||||
"dynamicIcon": "Динамическая иконка",
|
||||
"dynamicIconDateEmptyInfo": "Если дата пуста, иконка календаря будет динамически отображать сегодняшнюю дату",
|
||||
"backlinkContainChildren": "Включать ли дочерние блоки в обратные ссылки",
|
||||
"backlinkContainChildrenTip": "После включения дочерние блоки будут включены в расчет обратных ссылок",
|
||||
"entryNum": "Количество записей",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "Оптимизация индекса данных завершена, освобождено [%s] дискового пространства",
|
||||
"272": "Неименованное поле"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "數據快照保留天數",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "數據快照每天保留個數",
|
||||
"fields": "欄位",
|
||||
"dynamicEmoji": "動態圖標",
|
||||
"dynamicIcon": "動態圖標",
|
||||
"dynamicIconDateEmptyInfo": "若日期為空,日曆圖示將動態顯示當天日期",
|
||||
"backlinkContainChildren": "反向鏈接包含子塊",
|
||||
"backlinkContainChildrenTip": "啟用後子塊將被納入到反向鏈接計算中",
|
||||
"entryNum": "條目數",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "資料索引優化完畢,共釋放 [%s] 磁碟空間",
|
||||
"272": "未命名欄位"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,7 +53,8 @@
|
|||
"dataRepoAutoPurgeIndexRetentionDays": "数据快照保留天数",
|
||||
"dataRepoAutoPurgeRetentionIndexesDaily": "数据快照每天保留个数",
|
||||
"fields": "字段",
|
||||
"dynamicEmoji": "动态图标",
|
||||
"dynamicIcon": "动态图标",
|
||||
"dynamicIconDateEmptyInfo": "若日期为空,日历图标将动态显示当天日期",
|
||||
"backlinkContainChildren": "反向链接包含子块",
|
||||
"backlinkContainChildrenTip": "启用后子块将被纳入到反向链接计算中",
|
||||
"entryNum": "条目数",
|
||||
|
@ -1661,4 +1662,4 @@
|
|||
"271": "数据索引优化完毕,共释放 [%s] 磁盘空间",
|
||||
"272": "未命名字段"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -240,7 +240,7 @@ export const openEmojiPanel = (id: string, type: "doc" | "notebook" | "av", posi
|
|||
const dynamicCurrentObj: IObject = {
|
||||
color: "#d23f31",
|
||||
lang: "",
|
||||
date: "",
|
||||
date: dayjs().format("YYYY-MM-DD"),
|
||||
weekdayType: "1",
|
||||
type: "1",
|
||||
content: "SiYuan",
|
||||
|
@ -268,7 +268,7 @@ export const openEmojiPanel = (id: string, type: "doc" | "notebook" | "av", posi
|
|||
<div class="emojis__tabheader">
|
||||
<div data-type="tab-emoji" class="ariaLabel block__icon block__icon--show" aria-label="${window.siyuan.languages.emoji}"><svg><use xlink:href="#iconEmoji"></use></svg></div>
|
||||
<div class="fn__space"></div>
|
||||
<div data-type="tab-dynamic" class="ariaLabel block__icon block__icon--show" aria-label="${window.siyuan.languages.dynamicEmoji}"><svg><use xlink:href="#iconCalendar"></use></svg></div>
|
||||
<div data-type="tab-dynamic" class="ariaLabel block__icon block__icon--show" aria-label="${window.siyuan.languages.dynamicIcon}"><svg><use xlink:href="#iconCalendar"></use></svg></div>
|
||||
<div class="fn__flex-1"></div>
|
||||
<span class="block__icon block__icon--show fn__flex-center ariaLabel" data-action="remove" aria-label="${window.siyuan.languages.remove}"><svg><use xlink:href="#iconTrashcan"></use></svg></span>
|
||||
</div>
|
||||
|
@ -334,6 +334,8 @@ export const openEmojiPanel = (id: string, type: "doc" | "notebook" | "av", posi
|
|||
<span class="fn__flex-center ft__on-surface" style="width: 89px">${window.siyuan.languages.date}</span>
|
||||
<span class="fn__space--small"></span>
|
||||
<input type="date" max="9999-12-31" class="b3-text-field fn__flex-1" value="${dynamicCurrentObj.date}"/>
|
||||
<span class="fn__space--small"></span>
|
||||
<span class="ariaLabel block__icon block__icon--show" aria-label="${window.siyuan.languages.dynamicIconDateEmptyInfo}"><svg><use xlink:href="#iconInfo"></use></svg></span>
|
||||
<span class="fn__space"></span>
|
||||
</div>
|
||||
<div class="fn__hr"></div>
|
||||
|
|
|
@ -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>`;
|
||||
};
|
||||
|
|
|
@ -440,7 +440,7 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
|
|||
fetchPost("/api/av/setAttributeViewBlockAttr", {
|
||||
avID: item.parentElement.dataset.avId,
|
||||
keyID: item.parentElement.dataset.colId,
|
||||
rowID: item.parentElement.dataset.rowId,
|
||||
itemID: item.parentElement.dataset.rowId,
|
||||
value
|
||||
}, (setResponse) => {
|
||||
if (type === "number") {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -845,9 +845,15 @@ func setAttributeViewBlockAttr(c *gin.Context) {
|
|||
|
||||
avID := arg["avID"].(string)
|
||||
keyID := arg["keyID"].(string)
|
||||
rowID := arg["rowID"].(string)
|
||||
var itemID string
|
||||
if _, ok := arg["itemID"]; ok {
|
||||
itemID = arg["itemID"].(string)
|
||||
} else if _, ok := arg["rowID"]; ok {
|
||||
// TODO 划于 2026 年 6 月 30 日后删除 https://github.com/siyuan-note/siyuan/issues/15308#issuecomment-3077675356
|
||||
itemID = arg["rowID"].(string)
|
||||
}
|
||||
value := arg["value"].(interface{})
|
||||
updatedVal, err := model.UpdateAttributeViewCell(nil, avID, keyID, rowID, value)
|
||||
updatedVal, err := model.UpdateAttributeViewCell(nil, avID, keyID, itemID, value)
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
|
|
|
@ -4434,9 +4434,15 @@ func BatchUpdateAttributeViewCells(tx *Transaction, avID string, values []interf
|
|||
for _, value := range values {
|
||||
v := value.(map[string]interface{})
|
||||
keyID := v["keyID"].(string)
|
||||
rowID := v["rowID"].(string)
|
||||
var itemID string
|
||||
if _, ok := v["itemID"]; ok {
|
||||
itemID = v["itemID"].(string)
|
||||
} else if _, ok := v["rowID"]; ok {
|
||||
// TODO 划于 2026 年 6 月 30 日后删除 https://github.com/siyuan-note/siyuan/issues/15308#issuecomment-3077675356
|
||||
itemID = v["rowID"].(string)
|
||||
}
|
||||
valueData := v["value"]
|
||||
_, err = updateAttributeViewValue(tx, attrView, keyID, rowID, valueData)
|
||||
_, err = updateAttributeViewValue(tx, attrView, keyID, itemID, valueData)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -4444,26 +4450,26 @@ func BatchUpdateAttributeViewCells(tx *Transaction, avID string, values []interf
|
|||
return
|
||||
}
|
||||
|
||||
func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID string, valueData interface{}) (val *av.Value, err error) {
|
||||
func UpdateAttributeViewCell(tx *Transaction, avID, keyID, itemID string, valueData interface{}) (val *av.Value, err error) {
|
||||
attrView, err := av.ParseAttributeView(avID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
val, err = updateAttributeViewValue(tx, attrView, keyID, rowID, valueData)
|
||||
val, err = updateAttributeViewValue(tx, attrView, keyID, itemID, valueData)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID, blockID string, valueData interface{}) (val *av.Value, err error) {
|
||||
func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID, itemID string, valueData interface{}) (val *av.Value, err error) {
|
||||
avID := attrView.ID
|
||||
var blockVal *av.Value
|
||||
for _, kv := range attrView.KeyValues {
|
||||
if av.KeyTypeBlock == kv.Key.Type {
|
||||
for _, v := range kv.Values {
|
||||
if blockID == v.BlockID {
|
||||
if itemID == v.BlockID {
|
||||
blockVal = v
|
||||
break
|
||||
}
|
||||
|
@ -4485,7 +4491,7 @@ func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID
|
|||
}
|
||||
|
||||
for _, value := range keyValues.Values {
|
||||
if blockID == value.BlockID {
|
||||
if itemID == value.BlockID {
|
||||
val = value
|
||||
val.Type = keyValues.Key.Type
|
||||
break
|
||||
|
@ -4493,7 +4499,7 @@ func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID
|
|||
}
|
||||
|
||||
if nil == val {
|
||||
val = &av.Value{ID: ast.NewNodeID(), KeyID: keyID, BlockID: blockID, Type: keyValues.Key.Type, CreatedAt: now, UpdatedAt: now}
|
||||
val = &av.Value{ID: ast.NewNodeID(), KeyID: keyID, BlockID: itemID, Type: keyValues.Key.Type, CreatedAt: now, UpdatedAt: now}
|
||||
keyValues.Values = append(keyValues.Values, val)
|
||||
}
|
||||
break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue