mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-26 03:18:48 +01:00
🐛 数据库勾选框过滤 bug
This commit is contained in:
parent
bc5cc47f2b
commit
ea6c8a39ec
2 changed files with 17 additions and 0 deletions
|
|
@ -61,6 +61,13 @@ const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement) => {
|
|||
type: colType,
|
||||
[colType]: JSON.parse(cellElement.querySelector(".av__celltext").getAttribute("data-value"))
|
||||
};
|
||||
} else if (colType === "checkbox") {
|
||||
cellValue = {
|
||||
type: colType,
|
||||
checkbox: {
|
||||
checked: cellElement.querySelector("use").getAttribute("xlink:href") === "#iconCheck" ? true : false
|
||||
}
|
||||
};
|
||||
}
|
||||
return cellValue;
|
||||
}
|
||||
|
|
@ -113,6 +120,13 @@ export const genCellValue = (colType: TAVCol, value: string | any) => {
|
|||
isNotTime: true,
|
||||
}
|
||||
};
|
||||
} else if (colType === "checkbox") {
|
||||
cellValue = {
|
||||
type: colType,
|
||||
checkbox: {
|
||||
checked: value ? true : false
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
if (colType === "mSelect" || colType === "select") {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ export const getDefaultOperatorByType = (type: TAVCol) => {
|
|||
if (["select", "number"].includes(type)) {
|
||||
return "=";
|
||||
}
|
||||
if (["checkbox"].includes(type)) {
|
||||
return "Is false";
|
||||
}
|
||||
if (["text", "mSelect", "url", "block", "email", "phone", "template"].includes(type)) {
|
||||
return "Contains";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue