From 32ffee0c934c398801874494ac8a05e8163bfec1 Mon Sep 17 00:00:00 2001 From: Mouriya Date: Thu, 19 Sep 2024 21:17:30 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=8F=E3=83=83=E3=82=B7=E3=83=A5=E8=A8=88?= =?UTF-8?q?=E7=AE=97=E9=96=A2=E6=95=B0=E3=81=AB=E3=83=95=E3=82=A3=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=83=89=E5=BC=95=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?,=20k-tune'=E3=81=A7=E3=82=B3=E3=83=B3=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=82=AE=E3=83=A5=E3=83=AC=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=92=E5=A4=89=E6=9B=B4=E3=81=99=E3=82=8B=E3=81=A8=E3=80=81?= =?UTF-8?q?=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E3=82=82=E7=84=A1?= =?UTF-8?q?=E5=8A=B9=E3=81=AB=E3=81=AA=E3=82=8A=E3=81=BE=E3=81=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/actions/cascading-dropdown-selectors.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugin/kintone-addins/src/actions/cascading-dropdown-selectors.ts b/plugin/kintone-addins/src/actions/cascading-dropdown-selectors.ts index 9e01dae..e671ac2 100644 --- a/plugin/kintone-addins/src/actions/cascading-dropdown-selectors.ts +++ b/plugin/kintone-addins/src/actions/cascading-dropdown-selectors.ts @@ -45,7 +45,7 @@ interface IField { label: string; } -// ドロップダウンメニューの���書タイプ、ドロップダウンオプションの検索を高速化するために使用 +// ドロップダウンメニューの辞書タイプ、ドロップダウンオプションの検索を高速化するために使用 // キーの形式は: ドロップダウンメニューの階層_value // 例: 2番目の階層で結果aを選択した場合、1_aを使用して、値aの次の階層(3番目の階層)のオプションを取得できます type DropdownDictionary = Record; @@ -67,8 +67,8 @@ namespace DropDownConfig { }); // ドロップダウンメニューの辞書を一度構築するコストが高いため、レコードのハッシュ値を計算してキャッシュキーとして使用 - // kintoneのデータが変更されていない場合、辞書を再構築���る必要はありません - const hash = await calculateHash(records); + // kintoneのデータが変更されていない場合、辞書を再構築する必要はありません。 + const hash = await calculateHash(records, fields); const storageKey = `dropdown_dictionary::${props.dropDownApp.id}_${hash}`; // ローカルストレージから辞書を取得しようとし、存在しない場合は再構築 @@ -88,8 +88,11 @@ namespace DropDownConfig { }; // Web Crypto APIを使用してハッシュ値を計算 - const calculateHash = async (records: KTRecord[]): Promise => { - const str = JSON.stringify(records); + const calculateHash = async ( + records: KTRecord[], + fields: string[] + ): Promise => { + const str = JSON.stringify(records) + JSON.stringify(fields); const encoder = new TextEncoder(); const data = encoder.encode(str); const hashBuffer = await crypto.subtle.digest("SHA-1", data); // SHA-1を使用、パフォーマンスが良く、セキュリティは不要 @@ -193,9 +196,6 @@ export class CascadingDropDownAction implements IAction { this.actionProps = actionNode.actionProps; this.props = actionNode.ActionValue as ICascadingDropDownProps; - console.log(this.actionProps); - console.log(this.props); - const result: IActionResult = { canNext: true, result: "" }; try {