mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-17 20:48:06 +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,
|
type: colType,
|
||||||
[colType]: JSON.parse(cellElement.querySelector(".av__celltext").getAttribute("data-value"))
|
[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;
|
return cellValue;
|
||||||
}
|
}
|
||||||
|
|
@ -113,6 +120,13 @@ export const genCellValue = (colType: TAVCol, value: string | any) => {
|
||||||
isNotTime: true,
|
isNotTime: true,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
} else if (colType === "checkbox") {
|
||||||
|
cellValue = {
|
||||||
|
type: colType,
|
||||||
|
checkbox: {
|
||||||
|
checked: value ? true : false
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (colType === "mSelect" || colType === "select") {
|
if (colType === "mSelect" || colType === "select") {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@ export const getDefaultOperatorByType = (type: TAVCol) => {
|
||||||
if (["select", "number"].includes(type)) {
|
if (["select", "number"].includes(type)) {
|
||||||
return "=";
|
return "=";
|
||||||
}
|
}
|
||||||
|
if (["checkbox"].includes(type)) {
|
||||||
|
return "Is false";
|
||||||
|
}
|
||||||
if (["text", "mSelect", "url", "block", "email", "phone", "template"].includes(type)) {
|
if (["text", "mSelect", "url", "block", "email", "phone", "template"].includes(type)) {
|
||||||
return "Contains";
|
return "Contains";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue