From ea6c8a39ecfe7b4bfe7c756d8f931f4e5cec6f15 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 17 Dec 2023 00:02:47 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=95=B0=E6=8D=AE=E5=BA=93=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E6=A1=86=E8=BF=87=E6=BB=A4=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/render/av/cell.ts | 14 ++++++++++++++ app/src/protyle/render/av/filter.ts | 3 +++ 2 files changed, 17 insertions(+) diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 21bdf3ff9..d90280145 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -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") { diff --git a/app/src/protyle/render/av/filter.ts b/app/src/protyle/render/av/filter.ts index f317dbf09..d76011203 100644 --- a/app/src/protyle/render/av/filter.ts +++ b/app/src/protyle/render/av/filter.ts @@ -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"; }