This commit is contained in:
Daniel 2025-07-04 12:00:47 +08:00
parent d7f56c2bb6
commit 1ab9b5c518
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
24 changed files with 141 additions and 85 deletions

View file

@ -17,7 +17,7 @@
"showIcon": "عرض الأيقونة",
"showAllFieldsIcon": "عرض أيقونات الحقول",
"wrapAllFields": "التفاف الحقول تلقائيًا",
"gallery": "معرض",
"gallery": "بطاقة",
"newTag": "علامة جديدة",
"pleaseWait": "يرجى الانتظار...",
"reconnectPrompt": "بعد تبديل التطبيقات، سيستغرق الأمر بعض الوقت لاستعادة تشغيل نواة SiYuan. يرجى الانتظار بضع ثوانٍ أو النقر فوق الزر \"إعادة المحاولة\"",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "جدول",
"gallery": "معرض",
"gallery": "بطاقة",
"key": "المفتاح الرئيسي",
"select": "تحديد"
},

View file

@ -17,7 +17,7 @@
"showIcon": "Symbol anzeigen",
"showAllFieldsIcon": "Feldsymbole anzeigen",
"wrapAllFields": "Felder automatisch umbrechen",
"gallery": "Galerie",
"gallery": "Karte",
"newTag": "Neuer Tag",
"pleaseWait": "Bitte warten...",
"reconnectPrompt": "Nach dem Wechseln der Anwendungen dauert es einige Zeit, bis der Betrieb des SiYuan-Kernels wiederhergestellt ist. Bitte warten Sie einige Sekunden oder klicken Sie auf die Schaltfläche „Erneut versuchen“",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "Tabelle",
"gallery": "Galerie",
"gallery": "Karte",
"key": "Primärschlüssel",
"select": "Auswählen"
},

View file

@ -17,7 +17,7 @@
"showIcon": "Show icon",
"showAllFieldsIcon": "Show field icons",
"wrapAllFields": "Auto-wrap fields",
"gallery": "Gallery",
"gallery": "Card",
"newTag": "New tag",
"pleaseWait": "Please wait...",
"reconnectPrompt": "After switching applications, it will take some time to restore the SiYuan kernel operation. Please wait a few seconds or click the \"Retry\" button",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "Table",
"gallery": "Gallery",
"gallery": "Card",
"key": "Primary Key",
"select": "Select"
},

View file

@ -17,7 +17,7 @@
"showIcon": "Mostrar ícono",
"showAllFieldsIcon": "Mostrar íconos de campos",
"wrapAllFields": "Ajuste automático de campos",
"gallery": "Galería",
"gallery": "Tarjeta",
"newTag": "Nueva etiqueta",
"pleaseWait": "Por favor, espere...",
"reconnectPrompt": "Después de cambiar de aplicación, tomará algún tiempo restaurar el funcionamiento del núcleo de SiYuan. Espere unos segundos o haga clic en el botón \"Reintentar\"",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "Tabla",
"gallery": "Galería",
"gallery": "Tarjeta",
"key": "Clave principal",
"select": "Selección"
},

View file

@ -17,7 +17,7 @@
"showIcon": "Afficher l'icône",
"showAllFieldsIcon": "Afficher les icônes des champs",
"wrapAllFields": "Retour automatique des champs",
"gallery": "Galerie",
"gallery": "Carte",
"newTag": "Nouvelle étiquette",
"pleaseWait": "Veuillez patienter...",
"reconnectPrompt": "Après avoir changé d'application, il faudra un certain temps pour rétablir le fonctionnement du noyau SiYuan. Veuillez patienter quelques secondes ou cliquer sur le bouton « Réessayer »",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "Tableau",
"gallery": "Galerie",
"gallery": "Carte",
"key": "Clé primaire",
"select": "Sélectionner"
},

View file

@ -17,7 +17,7 @@
"showIcon": "הצג סמל",
"showAllFieldsIcon": "הצג סמלי שדות",
"wrapAllFields": "עטיפת שדות אוטומטית",
"gallery": "גלריה",
"gallery": "כרטיס",
"newTag": "תג חדש",
"pleaseWait": "אנא המתן...",
"reconnectPrompt": "לאחר מעבר בין יישומים, יידרש זמן מה כדי לשחזר את פעולת ליבת SiYuan. אנא המתן מספר שניות או לחץ על כפתור \"נסה שוב\"",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "טבלה",
"gallery": "גלריה",
"gallery": "כרטיס",
"key": "מפתח ראשי",
"select": "בחר"
},

View file

@ -17,7 +17,7 @@
"showIcon": "Mostra icona",
"showAllFieldsIcon": "Mostra icone dei campi",
"wrapAllFields": "Avvolgi automaticamente i campi",
"gallery": "Galleria",
"gallery": "Scheda",
"newTag": "Nuova etichetta",
"pleaseWait": "Attendere prego...",
"reconnectPrompt": "Dopo aver cambiato applicazione, ci vorrà un po' di tempo per ripristinare il funzionamento del kernel SiYuan. Attendere qualche secondo o fare clic sul pulsante \"Riprova\"",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "Tabella",
"gallery": "Galleria",
"gallery": "Scheda",
"key": "Chiave primaria",
"select": "Seleziona"
},

View file

@ -17,7 +17,7 @@
"showIcon": "アイコンを表示",
"showAllFieldsIcon": "フィールドアイコンを表示",
"wrapAllFields": "フィールドを自動折り返し",
"gallery": "ギャラリー",
"gallery": "カード",
"newTag": "新しいタグ",
"pleaseWait": "しばらくお待ちください...",
"reconnectPrompt": "アプリを切り替えた後、思源カーネルの実行を再開するには少し時間がかかります。数秒待つか、「再試行」ボタンをクリックしてください",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "テーブル",
"gallery": "ギャラリー",
"gallery": "カード",
"key": "プライマリキー",
"select": "選択"
},

View file

@ -17,7 +17,7 @@
"showIcon": "Pokaż ikonę",
"showAllFieldsIcon": "Pokaż ikony pól",
"wrapAllFields": "Automatyczne zawijanie pól",
"gallery": "Galeria",
"gallery": "Karta",
"newTag": "Nowy tag",
"pleaseWait": "Proszę czekać...",
"reconnectPrompt": "Po przełączeniu aplikacji ponowne uruchomienie jądra SiYuan może zająć trochę czasu. Proszę poczekać kilka sekund lub kliknąć przycisk „Ponów próbę”",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "Tabela",
"gallery": "Galeria",
"gallery": "Karta",
"key": "Klucz główny",
"select": "Wybierz"
},

View file

@ -17,7 +17,7 @@
"showIcon": "Mostrar ícone",
"showAllFieldsIcon": "Mostrar ícones de campos",
"wrapAllFields": "Quebrar automaticamente os campos",
"gallery": "Galeria",
"gallery": "Cartão",
"newTag": "Nova tag",
"pleaseWait": "Por favor, aguarde...",
"reconnectPrompt": "Após alternar aplicativos, levará algum tempo para restaurar a operação do kernel SiYuan. Por favor, aguarde alguns segundos ou clique no botão \"Tentar novamente\"",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "Tabela",
"gallery": "Galeria",
"gallery": "Cartão",
"key": "Chave Primária",
"select": "Selecionar"
},

View file

@ -17,7 +17,7 @@
"showIcon": "Показать значок",
"showAllFieldsIcon": "Показать значки полей",
"wrapAllFields": "Автоматический перенос полей",
"gallery": "Галерея",
"gallery": "Карточка",
"newTag": "Новый тег",
"pleaseWait": "Пожалуйста, подождите...",
"reconnectPrompt": "После переключения приложений потребуется некоторое время, чтобы восстановить работу ядра SiYuan. Пожалуйста, подождите несколько секунд или нажмите кнопку «Повторить»",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "Таблица",
"gallery": "Галерея",
"gallery": "Карточка",
"key": "Первичный ключ",
"select": "Выбрать"
},

View file

@ -17,7 +17,7 @@
"showIcon": "顯示圖標",
"showAllFieldsIcon": "顯示字段圖標",
"wrapAllFields": "字段自動換行",
"gallery": "圖庫",
"gallery": "卡片",
"newTag": "新建標籤",
"pleaseWait": "請稍等片刻...",
"reconnectPrompt": "切換應用後再次進入需要一些時間恢復思源內核運行,請稍等幾秒或者點擊“重試”按鈕",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "表格",
"gallery": "圖庫",
"gallery": "卡片",
"key": "主鍵",
"select": "單選"
},

View file

@ -17,7 +17,7 @@
"showIcon": "显示图标",
"showAllFieldsIcon": "显示字段图标",
"wrapAllFields": "字段自动换行",
"gallery": "画廊",
"gallery": "卡片",
"newTag": "新建标签",
"pleaseWait": "请稍等片刻...",
"reconnectPrompt": "切换应用后再次进入需要一些时间恢复思源内核运行,请稍等几秒或者点击“重试”按钮",
@ -1353,7 +1353,7 @@
},
"_attrView": {
"table": "表格",
"gallery": "画廊",
"gallery": "卡片",
"key": "主键",
"select": "单选"
},

View file

@ -1,5 +1,5 @@
{
"spec": 1,
"spec": 3,
"id": "20240208172742-57vwxqw",
"name": "Books",
"keyValues": [
@ -254,12 +254,13 @@
"name": "Table",
"hideAttrViewName": false,
"desc": "",
"pageSize": 50,
"type": "table",
"table": {
"spec": 0,
"id": "20240208172742-mhhmma3",
"filters": [],
"sorts": [],
"showIcon": true,
"wrapField": false,
"pageSize": 50,
"columns": [
{
@ -296,43 +297,51 @@
"20240208173041-9utmfv2",
"20240208173054-6k25xnw"
]
}
},
"itemIds": [
"20240208172930-3n32s4x",
"20240208173041-9utmfv2",
"20240208173054-6k25xnw"
]
},
{
"id": "20250615171046-3ucugf9",
"icon": "",
"name": "Gallery",
"name": "Card",
"hideAttrViewName": false,
"desc": "",
"pageSize": 50,
"type": "gallery",
"gallery": {
"spec": 0,
"id": "20250615171047-4emh3qi",
"filters": [],
"sorts": [],
"showIcon": true,
"wrapField": false,
"pageSize": 50,
"coverFrom": 2,
"coverFromAssetKeyID": "20250615171115-3g32dmi",
"cardAspectRatio": 3,
"cardSize": 0,
"fitImage": false,
"showIcon": true,
"wrapField": false,
"fields": [
{
"id": "20240208172742-dwysfvj",
"wrap": false,
"hidden": false
},
{
"id": "20240208172937-fxi3h2s",
"wrap": false,
"hidden": false
},
{
"id": "20240208173226-6666dv2",
"wrap": false,
"hidden": false
},
{
"id": "20250615171115-3g32dmi",
"wrap": false,
"hidden": true
}
],
@ -341,7 +350,12 @@
"20240208173041-9utmfv2",
"20240208173054-6k25xnw"
]
}
},
"itemIds": [
"20240208172930-3n32s4x",
"20240208173041-9utmfv2",
"20240208173054-6k25xnw"
]
}
]
}

View file

@ -1,5 +1,5 @@
{
"spec": 1,
"spec": 3,
"id": "20240208155918-uylgwbj",
"name": "书籍",
"keyValues": [
@ -254,12 +254,13 @@
"name": "表格",
"hideAttrViewName": false,
"desc": "",
"pageSize": 50,
"type": "table",
"table": {
"spec": 0,
"id": "20240208155918-j5lys77",
"filters": [],
"sorts": [],
"showIcon": true,
"wrapField": false,
"pageSize": 50,
"columns": [
{
@ -296,43 +297,51 @@
"20240208155931-cr0e00b",
"20240208161625-9lg8l80"
]
}
},
"itemIds": [
"20240208160855-iv1fsnu",
"20240208155931-cr0e00b",
"20240208161625-9lg8l80"
]
},
{
"id": "20250615173530-5yn6s87",
"icon": "",
"name": "画廊",
"name": "卡片",
"hideAttrViewName": false,
"desc": "",
"pageSize": 50,
"type": "gallery",
"gallery": {
"spec": 0,
"id": "20250615173532-wtdqm1z",
"filters": [],
"sorts": [],
"showIcon": true,
"wrapField": false,
"pageSize": 50,
"coverFrom": 2,
"coverFromAssetKeyID": "20250615173428-ju0itho",
"cardAspectRatio": 3,
"cardSize": 0,
"fitImage": false,
"showIcon": true,
"wrapField": false,
"fields": [
{
"id": "20240208155918-gex3vhc",
"wrap": false,
"hidden": false
},
{
"id": "20240208160021-bpcl3hm",
"wrap": false,
"hidden": false
},
{
"id": "20240208160313-c1j9gn3",
"wrap": false,
"hidden": false
},
{
"id": "20250615173428-ju0itho",
"wrap": false,
"hidden": true
}
],
@ -341,7 +350,12 @@
"20240208155931-cr0e00b",
"20240208161625-9lg8l80"
]
}
},
"itemIds": [
"20240208160855-iv1fsnu",
"20240208155931-cr0e00b",
"20240208161625-9lg8l80"
]
}
]
}

View file

@ -1,5 +1,5 @@
{
"spec": 1,
"spec": 3,
"id": "20240208171724-zfkzgwi",
"name": "書籍",
"keyValues": [
@ -254,12 +254,13 @@
"name": "表格",
"hideAttrViewName": false,
"desc": "",
"pageSize": 50,
"type": "table",
"table": {
"spec": 0,
"id": "20240208171724-dpfg89v",
"filters": [],
"sorts": [],
"showIcon": true,
"wrapField": false,
"pageSize": 50,
"columns": [
{
@ -296,43 +297,51 @@
"20240208171759-zc76r72",
"20240208171807-wbmr1ps"
]
}
},
"itemIds": [
"20240208171751-wmphpet",
"20240208171759-zc76r72",
"20240208171807-wbmr1ps"
]
},
{
"id": "20250615173733-4es9lsl",
"icon": "",
"name": "畫廊",
"name": "卡片",
"hideAttrViewName": false,
"desc": "",
"pageSize": 50,
"type": "gallery",
"gallery": {
"spec": 0,
"id": "20250615173734-3131lvi",
"filters": [],
"sorts": [],
"showIcon": true,
"wrapField": false,
"pageSize": 50,
"coverFrom": 2,
"coverFromAssetKeyID": "20250615173651-a3u5o6l",
"cardAspectRatio": 3,
"cardSize": 0,
"fitImage": false,
"showIcon": true,
"wrapField": false,
"fields": [
{
"id": "20240208171724-j0vptez",
"wrap": false,
"hidden": false
},
{
"id": "20240208171815-ntngplo",
"wrap": false,
"hidden": false
},
{
"id": "20240208171913-wcpom5u",
"wrap": false,
"hidden": false
},
{
"id": "20250615173651-a3u5o6l",
"wrap": false,
"hidden": true
}
],
@ -341,7 +350,12 @@
"20240208171759-zc76r72",
"20240208171807-wbmr1ps"
]
}
},
"itemIds": [
"20240208171751-wmphpet",
"20240208171759-zc76r72",
"20240208171807-wbmr1ps"
]
}
]
}

View file

@ -1,5 +1,5 @@
{
"spec": 1,
"spec": 3,
"id": "20240530133134-c2251lc",
"name": "書名",
"keyValues": [
@ -254,12 +254,13 @@
"name": "テーブル",
"hideAttrViewName": false,
"desc": "",
"pageSize": 50,
"type": "table",
"table": {
"spec": 0,
"id": "20240530101000-mhhmma3",
"filters": [],
"sorts": [],
"showIcon": true,
"wrapField": false,
"pageSize": 50,
"columns": [
{
@ -296,43 +297,51 @@
"20240530101000-9utmfv2",
"20240530101000-6k25xnw"
]
}
},
"itemIds": [
"20240530101000-3n32s4x",
"20240530101000-9utmfv2",
"20240530101000-6k25xnw"
]
},
{
"id": "20250615173942-0xk5p5h",
"icon": "",
"name": "ギャラリー",
"name": "カード",
"hideAttrViewName": false,
"desc": "",
"pageSize": 50,
"type": "gallery",
"gallery": {
"spec": 0,
"id": "20250615173947-oj97e6l",
"filters": [],
"sorts": [],
"showIcon": true,
"wrapField": false,
"pageSize": 50,
"coverFrom": 2,
"coverFromAssetKeyID": "20250615173851-vmlovdh",
"cardAspectRatio": 3,
"cardSize": 0,
"fitImage": false,
"showIcon": true,
"wrapField": false,
"fields": [
{
"id": "20240530101000-dwysfvj",
"wrap": false,
"hidden": false
},
{
"id": "20240530101000-fxi3h2s",
"wrap": false,
"hidden": false
},
{
"id": "20240530101000-6666dv2",
"wrap": false,
"hidden": false
},
{
"id": "20250615173851-vmlovdh",
"wrap": false,
"hidden": true
}
],
@ -341,7 +350,12 @@
"20240530101000-9utmfv2",
"20240530101000-6k25xnw"
]
}
},
"itemIds": [
"20240530101000-3n32s4x",
"20240530101000-9utmfv2",
"20240530101000-6k25xnw"
]
}
]
}

View file

@ -189,7 +189,7 @@ type View struct {
PageSize int `json:"pageSize"` // 每页条目数
LayoutType LayoutType `json:"type"` // 当前布局类型
Table *LayoutTable `json:"table,omitempty"` // 表格布局
Gallery *LayoutGallery `json:"gallery,omitempty"` // 画廊布局
Gallery *LayoutGallery `json:"gallery,omitempty"` // 卡片布局
ItemIDs []string `json:"itemIds,omitempty"` // 项目 ID 列表,用于维护所有项目
Groups []*View `json:"groups,omitempty"` // 分组视图列表
@ -206,7 +206,7 @@ type LayoutType string
const (
LayoutTypeTable LayoutType = "table" // 属性视图类型 - 表格
LayoutTypeGallery LayoutType = "gallery" // 属性视图类型 - 画廊
LayoutTypeGallery LayoutType = "gallery" // 属性视图类型 - 卡片
)
const (

View file

@ -111,7 +111,7 @@ func (baseInstanceField *BaseInstanceField) GetID() string {
}
// Collection 描述了一个集合的接口。
// 集合可以是表格、画廊等,包含多个项目。
// 集合可以是表格、卡片等,包含多个项目。
type Collection interface {
// GetItems 返回集合中的所有项目。
@ -138,7 +138,7 @@ type Field interface {
}
// Item 描述了一个项目的接口。
// 项目可以是表格行、画廊卡片等。
// 项目可以是表格行、卡片等。
type Item interface {
// GetBlockValue 返回主键的值。

View file

@ -20,7 +20,7 @@ import (
"github.com/88250/lute/ast"
)
// LayoutGallery 描述了画廊布局的结构。
// LayoutGallery 描述了卡片布局的结构。
type LayoutGallery struct {
*BaseLayout
@ -30,7 +30,7 @@ type LayoutGallery struct {
CardSize CardSize `json:"cardSize"` // 卡片大小0小卡片1中卡片2大卡片
FitImage bool `json:"fitImage"` // 是否适应封面图片大小
CardFields []*ViewGalleryCardField `json:"fields"` // 画廊卡片字段
CardFields []*ViewGalleryCardField `json:"fields"` // 卡片字段
// TODO CardIDs 字段已经废弃,计划于 2026 年 6 月 30 日后删除 https://github.com/siyuan-note/siyuan/issues/15194
//Deprecated
@ -70,7 +70,7 @@ const (
CardSizeLarge // 大卡片
)
// CoverFrom 描述了画廊中的卡片封面来源的枚举类型。
// CoverFrom 描述了卡片封面来源的枚举类型。
type CoverFrom int
const (
@ -80,12 +80,12 @@ const (
CoverFromContentBlock // 内容块
)
// ViewGalleryCardField 描述了画廊卡片字段的结构。
// ViewGalleryCardField 描述了卡片字段的结构。
type ViewGalleryCardField struct {
*BaseField
}
// Gallery 描述了画廊实例的结构。
// Gallery 描述了卡片视图实例的结构。
type Gallery struct {
*BaseInstance
@ -94,12 +94,12 @@ type Gallery struct {
CardAspectRatio CardAspectRatio `json:"cardAspectRatio"` // 卡片宽高比
CardSize CardSize `json:"cardSize"` // 卡片大小
FitImage bool `json:"fitImage"` // 是否适应封面图片大小
Fields []*GalleryField `json:"fields"` // 画廊字段
Cards []*GalleryCard `json:"cards"` // 画廊卡片
CardCount int `json:"cardCount"` // 画廊总卡片数
Fields []*GalleryField `json:"fields"` // 卡片字段
Cards []*GalleryCard `json:"cards"` // 卡片
CardCount int `json:"cardCount"` // 总卡片数
}
// GalleryCard 描述了画廊实例卡片的结构。
// GalleryCard 描述了卡片实例的结构。
type GalleryCard struct {
ID string `json:"id"` // 卡片 ID
Values []*GalleryFieldValue `json:"values"` // 卡片字段值
@ -108,12 +108,12 @@ type GalleryCard struct {
CoverContent string `json:"coverContent"` // 卡片封面文本内容
}
// GalleryField 描述了画廊实例卡片字段的结构。
// GalleryField 描述了卡片实例字段的结构。
type GalleryField struct {
*BaseInstanceField
}
// GalleryFieldValue 描述了画廊实例字段值的结构。
// GalleryFieldValue 描述了卡片字段实例值的结构。
type GalleryFieldValue struct {
*BaseValue
}

View file

@ -17,5 +17,5 @@
package av
func (gallery *Gallery) Calc() {
// 画廊视图不支持计算
// 卡片视图不支持计算
}

View file

@ -50,7 +50,7 @@ type ViewTableColumn struct {
Calc *ColumnCalc `json:"calc,omitempty"` // 计算
}
// Table 描述了表格实例的结构。
// Table 描述了表格视图实例的结构。
type Table struct {
*BaseInstance

View file

@ -3234,7 +3234,7 @@ func AddAttributeViewKey(avID, keyID, keyName, keyType, keyIcon, previousKeyID s
if nil != view.Table {
if "" == previousKeyID {
if av.LayoutTypeGallery == currentView.LayoutType {
// 如果当前视图是画廊视图则添加到最后
// 如果当前视图是卡片视图则添加到最后
view.Table.Columns = append(view.Table.Columns, &av.ViewTableColumn{BaseField: &av.BaseField{ID: key.ID}})
} else {
view.Table.Columns = append([]*av.ViewTableColumn{{BaseField: &av.BaseField{ID: key.ID}}}, view.Table.Columns...)

View file

@ -48,7 +48,7 @@ func checkAttrView(attrView *av.AttributeView, view *av.View) {
// 视图类型不匹配时需要订正
for i, v := range attrView.Views {
if av.LayoutTypeGallery == v.LayoutType && nil == v.Gallery {
// 切换为画廊视图时可能没有初始化画廊实例 https://github.com/siyuan-note/siyuan/issues/15122
// 切换为卡片视图时可能没有初始化卡片实例 https://github.com/siyuan-note/siyuan/issues/15122
if nil != v.Table {
v.LayoutType = av.LayoutTypeTable
changed = true