不適切なフィルター条件を修正
This commit is contained in:
@@ -121,7 +121,7 @@ namespace DropDownConfig {
|
|||||||
value: fieldData.value,
|
value: fieldData.value,
|
||||||
index: fieldCodeToIndexMap.get(fieldCode),
|
index: fieldCodeToIndexMap.get(fieldCode),
|
||||||
}))
|
}))
|
||||||
.filter((item) => item.index !== undefined || item.index !== null)
|
.filter((item) => item.index !== undefined)
|
||||||
.sort((a, b) => a.index! - b.index!)
|
.sort((a, b) => a.index! - b.index!)
|
||||||
)
|
)
|
||||||
.forEach((recordArray) => {
|
.forEach((recordArray) => {
|
||||||
@@ -168,7 +168,7 @@ namespace DropDownConfig {
|
|||||||
|
|
||||||
// 指定された階層と値のドロップダウンメニューオプションを取得
|
// 指定された階層と値のドロップダウンメニューオプションを取得
|
||||||
export const getOptions = (level: number, value: string): string[] => {
|
export const getOptions = (level: number, value: string): string[] => {
|
||||||
const key = level === 0 ? "0_TOP" : buildKey(level -1 , value);
|
const key = level === 0 ? "0_TOP" : buildKey(level - 1, value);
|
||||||
return dictionary[key] || [];
|
return dictionary[key] || [];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -217,9 +217,11 @@ export class CascadingDropDownAction implements IAction {
|
|||||||
|
|
||||||
// ページの状態を処理
|
// ページの状態を処理
|
||||||
async #handlePageState(appId: string) {
|
async #handlePageState(appId: string) {
|
||||||
|
|
||||||
// kintoneのパスのパラメータは奇妙に#を使用しているため、ここで標準的な記号に置き換えて、後でURLツールを使用してrequestパラメータを検索しやすくします
|
// kintoneのパスのパラメータは奇妙に#を使用しているため、ここで標準的な記号に置き換えて、後でURLツールを使用してrequestパラメータを検索しやすくします
|
||||||
const currentState = getPageState(window.location.href.replace('#','?'), appId);
|
const currentState = getPageState(
|
||||||
|
window.location.href.replace("#", "?"),
|
||||||
|
appId
|
||||||
|
);
|
||||||
|
|
||||||
switch (currentState.type) {
|
switch (currentState.type) {
|
||||||
case "app":
|
case "app":
|
||||||
@@ -266,7 +268,7 @@ new CascadingDropDownAction();
|
|||||||
namespace DropdownContainer {
|
namespace DropdownContainer {
|
||||||
let fieldList: IFieldList[];
|
let fieldList: IFieldList[];
|
||||||
let columMapValueArray: IFieldList[];
|
let columMapValueArray: IFieldList[];
|
||||||
let columMapArray: [number, IFieldList][];
|
let columMapArray: [number, IFieldList][];
|
||||||
const columnMap: Map<number, IFieldList> = new Map();
|
const columnMap: Map<number, IFieldList> = new Map();
|
||||||
const selects: Map<string, HTMLElement> = new Map();
|
const selects: Map<string, HTMLElement> = new Map();
|
||||||
let state: Record<string, string> = {};
|
let state: Record<string, string> = {};
|
||||||
@@ -371,7 +373,9 @@ namespace DropdownContainer {
|
|||||||
): void => {
|
): void => {
|
||||||
let select;
|
let select;
|
||||||
if (!initSelect) {
|
if (!initSelect) {
|
||||||
select = selects.get(fieldCode)?.querySelector<HTMLSelectElement>("select");
|
select = selects
|
||||||
|
.get(fieldCode)
|
||||||
|
?.querySelector<HTMLSelectElement>("select");
|
||||||
if (!select) {
|
if (!select) {
|
||||||
console.error(
|
console.error(
|
||||||
`フィールド ${fieldCode} のドロップダウンメニュー要素が見つかりません`
|
`フィールド ${fieldCode} のドロップダウンメニュー要素が見つかりません`
|
||||||
|
|||||||
Reference in New Issue
Block a user