🐛 数据库勾选框过滤 bug

This commit is contained in:
Vanessa 2023-12-17 00:02:47 +08:00
parent bc5cc47f2b
commit ea6c8a39ec
2 changed files with 17 additions and 0 deletions

View file

@ -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") {

View file

@ -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";
} }