Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Oct 1, 2023
2 parents b709c84 + b2f5ab5 commit f965ef0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions kernel/av/av.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (value *Value) String() string {
}
return strings.Join(ret, " ")
case KeyTypeTemplate:
return value.Template.RenderedContent
return value.Template.content
default:
return ""
}
Expand Down Expand Up @@ -351,11 +351,11 @@ type ValueAsset struct {
}

type ValueTemplate struct {
RenderedContent string `json:"renderedContent"`
content string `json:"content"`
}

func (t *ValueTemplate) Render(blockID string, r func(blockID string) string) {
t.RenderedContent = r(blockID)
t.content = r(blockID)
}

// View 描述了视图的结构。
Expand Down
16 changes: 8 additions & 8 deletions kernel/av/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func (table *Table) calcColTemplate(col *TableColumn, colIndex int) {
case CalcOperatorCountValues:
countValues := 0
for _, row := range table.Rows {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Template && "" != row.Cells[colIndex].Value.Template.RenderedContent {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Template && "" != row.Cells[colIndex].Value.Template.content {
countValues++
}
}
Expand All @@ -532,9 +532,9 @@ func (table *Table) calcColTemplate(col *TableColumn, colIndex int) {
countUniqueValues := 0
uniqueValues := map[string]bool{}
for _, row := range table.Rows {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Template && "" != row.Cells[colIndex].Value.Template.RenderedContent {
if !uniqueValues[row.Cells[colIndex].Value.Template.RenderedContent] {
uniqueValues[row.Cells[colIndex].Value.Template.RenderedContent] = true
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Template && "" != row.Cells[colIndex].Value.Template.content {
if !uniqueValues[row.Cells[colIndex].Value.Template.content] {
uniqueValues[row.Cells[colIndex].Value.Template.content] = true
countUniqueValues++
}
}
Expand All @@ -543,23 +543,23 @@ func (table *Table) calcColTemplate(col *TableColumn, colIndex int) {
case CalcOperatorCountEmpty:
countEmpty := 0
for _, row := range table.Rows {
if nil == row.Cells[colIndex] || nil == row.Cells[colIndex].Value || nil == row.Cells[colIndex].Value.Template || "" == row.Cells[colIndex].Value.Template.RenderedContent {
if nil == row.Cells[colIndex] || nil == row.Cells[colIndex].Value || nil == row.Cells[colIndex].Value.Template || "" == row.Cells[colIndex].Value.Template.content {
countEmpty++
}
}
col.Calc.Result = &Value{Number: NewFormattedValueNumber(float64(countEmpty), NumberFormatNone)}
case CalcOperatorCountNotEmpty:
countNotEmpty := 0
for _, row := range table.Rows {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Template && "" != row.Cells[colIndex].Value.Template.RenderedContent {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Template && "" != row.Cells[colIndex].Value.Template.content {
countNotEmpty++
}
}
col.Calc.Result = &Value{Number: NewFormattedValueNumber(float64(countNotEmpty), NumberFormatNone)}
case CalcOperatorPercentEmpty:
countEmpty := 0
for _, row := range table.Rows {
if nil == row.Cells[colIndex] || nil == row.Cells[colIndex].Value || nil == row.Cells[colIndex].Value.Template || "" == row.Cells[colIndex].Value.Template.RenderedContent {
if nil == row.Cells[colIndex] || nil == row.Cells[colIndex].Value || nil == row.Cells[colIndex].Value.Template || "" == row.Cells[colIndex].Value.Template.content {
countEmpty++
}
}
Expand All @@ -569,7 +569,7 @@ func (table *Table) calcColTemplate(col *TableColumn, colIndex int) {
case CalcOperatorPercentNotEmpty:
countNotEmpty := 0
for _, row := range table.Rows {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Template && "" != row.Cells[colIndex].Value.Template.RenderedContent {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.Template && "" != row.Cells[colIndex].Value.Template.content {
countNotEmpty++
}
}
Expand Down

0 comments on commit f965ef0

Please sign in to comment.