mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Support hiding database table view title https://github.com/siyuan-note/siyuan/issues/10478
This commit is contained in:
parent
950a148336
commit
bbf41e4769
4 changed files with 40 additions and 33 deletions
|
|
@ -306,10 +306,11 @@ func renderSnapshotAttributeView(c *gin.Context) {
|
||||||
var views []map[string]interface{}
|
var views []map[string]interface{}
|
||||||
for _, v := range attrView.Views {
|
for _, v := range attrView.Views {
|
||||||
view := map[string]interface{}{
|
view := map[string]interface{}{
|
||||||
"id": v.ID,
|
"id": v.ID,
|
||||||
"icon": v.Icon,
|
"icon": v.Icon,
|
||||||
"name": v.Name,
|
"name": v.Name,
|
||||||
"type": v.LayoutType,
|
"hideAttrViewName": v.HideAttrViewName,
|
||||||
|
"type": v.LayoutType,
|
||||||
}
|
}
|
||||||
|
|
||||||
views = append(views, view)
|
views = append(views, view)
|
||||||
|
|
@ -347,10 +348,11 @@ func renderHistoryAttributeView(c *gin.Context) {
|
||||||
var views []map[string]interface{}
|
var views []map[string]interface{}
|
||||||
for _, v := range attrView.Views {
|
for _, v := range attrView.Views {
|
||||||
view := map[string]interface{}{
|
view := map[string]interface{}{
|
||||||
"id": v.ID,
|
"id": v.ID,
|
||||||
"icon": v.Icon,
|
"icon": v.Icon,
|
||||||
"name": v.Name,
|
"name": v.Name,
|
||||||
"type": v.LayoutType,
|
"hideAttrViewName": v.HideAttrViewName,
|
||||||
|
"type": v.LayoutType,
|
||||||
}
|
}
|
||||||
|
|
||||||
views = append(views, view)
|
views = append(views, view)
|
||||||
|
|
@ -404,10 +406,11 @@ func renderAttributeView(c *gin.Context) {
|
||||||
var views []map[string]interface{}
|
var views []map[string]interface{}
|
||||||
for _, v := range attrView.Views {
|
for _, v := range attrView.Views {
|
||||||
view := map[string]interface{}{
|
view := map[string]interface{}{
|
||||||
"id": v.ID,
|
"id": v.ID,
|
||||||
"icon": v.Icon,
|
"icon": v.Icon,
|
||||||
"name": v.Name,
|
"name": v.Name,
|
||||||
"type": v.LayoutType,
|
"hideAttrViewName": v.HideAttrViewName,
|
||||||
|
"type": v.LayoutType,
|
||||||
}
|
}
|
||||||
|
|
||||||
views = append(views, view)
|
views = append(views, view)
|
||||||
|
|
|
||||||
|
|
@ -815,15 +815,16 @@ func (value *Value) compareOperator(filter *ViewFilter) bool {
|
||||||
|
|
||||||
// Table 描述了表格实例的结构。
|
// Table 描述了表格实例的结构。
|
||||||
type Table struct {
|
type Table struct {
|
||||||
ID string `json:"id"` // 表格布局 ID
|
ID string `json:"id"` // 表格布局 ID
|
||||||
Icon string `json:"icon"` // 表格图标
|
Icon string `json:"icon"` // 表格图标
|
||||||
Name string `json:"name"` // 表格名称
|
Name string `json:"name"` // 表格名称
|
||||||
Filters []*ViewFilter `json:"filters"` // 过滤规则
|
HideAttrViewName bool `json:"hideAttrViewName"` // 是否隐藏属性视图名称
|
||||||
Sorts []*ViewSort `json:"sorts"` // 排序规则
|
Filters []*ViewFilter `json:"filters"` // 过滤规则
|
||||||
Columns []*TableColumn `json:"columns"` // 表格列
|
Sorts []*ViewSort `json:"sorts"` // 排序规则
|
||||||
Rows []*TableRow `json:"rows"` // 表格行
|
Columns []*TableColumn `json:"columns"` // 表格列
|
||||||
RowCount int `json:"rowCount"` // 表格总行数
|
Rows []*TableRow `json:"rows"` // 表格行
|
||||||
PageSize int `json:"pageSize"` // 每页行数
|
RowCount int `json:"rowCount"` // 表格总行数
|
||||||
|
PageSize int `json:"pageSize"` // 每页行数
|
||||||
}
|
}
|
||||||
|
|
||||||
type TableColumn struct {
|
type TableColumn struct {
|
||||||
|
|
|
||||||
|
|
@ -729,13 +729,14 @@ func renderTemplateCol(ial map[string]string, tplContent string, rowValues []*av
|
||||||
|
|
||||||
func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *av.Table, err error) {
|
func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *av.Table, err error) {
|
||||||
ret = &av.Table{
|
ret = &av.Table{
|
||||||
ID: view.ID,
|
ID: view.ID,
|
||||||
Icon: view.Icon,
|
Icon: view.Icon,
|
||||||
Name: view.Name,
|
Name: view.Name,
|
||||||
Columns: []*av.TableColumn{},
|
HideAttrViewName: view.HideAttrViewName,
|
||||||
Rows: []*av.TableRow{},
|
Columns: []*av.TableColumn{},
|
||||||
Filters: view.Table.Filters,
|
Rows: []*av.TableRow{},
|
||||||
Sorts: view.Table.Sorts,
|
Filters: view.Table.Filters,
|
||||||
|
Sorts: view.Table.Sorts,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组装列
|
// 组装列
|
||||||
|
|
@ -1332,6 +1333,7 @@ func (tx *Transaction) doDuplicateAttrViewView(operation *Operation) (ret *TxErr
|
||||||
view.Icon = masterView.Icon
|
view.Icon = masterView.Icon
|
||||||
view.Name = attrView.GetDuplicateViewName(masterView.Name)
|
view.Name = attrView.GetDuplicateViewName(masterView.Name)
|
||||||
view.LayoutType = masterView.LayoutType
|
view.LayoutType = masterView.LayoutType
|
||||||
|
view.HideAttrViewName = masterView.HideAttrViewName
|
||||||
|
|
||||||
for _, col := range masterView.Table.Columns {
|
for _, col := range masterView.Table.Columns {
|
||||||
view.Table.Columns = append(view.Table.Columns, &av.ViewTableColumn{
|
view.Table.Columns = append(view.Table.Columns, &av.ViewTableColumn{
|
||||||
|
|
|
||||||
|
|
@ -651,11 +651,12 @@ func getAttributeViewContent(avID string) (content string) {
|
||||||
|
|
||||||
func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *av.Table, err error) {
|
func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *av.Table, err error) {
|
||||||
ret = &av.Table{
|
ret = &av.Table{
|
||||||
ID: view.ID,
|
ID: view.ID,
|
||||||
Icon: view.Icon,
|
Icon: view.Icon,
|
||||||
Name: view.Name,
|
Name: view.Name,
|
||||||
Columns: []*av.TableColumn{},
|
HideAttrViewName: view.HideAttrViewName,
|
||||||
Rows: []*av.TableRow{},
|
Columns: []*av.TableColumn{},
|
||||||
|
Rows: []*av.TableRow{},
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组装列
|
// 组装列
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue