コンパイルの失敗を修正

This commit is contained in:
Mouriya
2024-09-13 15:17:16 +09:00
parent 9dd2ffd549
commit 20ca47c004

View File

@@ -121,8 +121,8 @@ namespace DropDownConfig {
value: fieldData.value,
index: fieldCodeToIndexMap.get(fieldCode),
}))
.filter((item) => item.index !== undefined)
.sort((a, b) => a.index - b.index)
.filter((item) => item.index !== undefined || item.index !== null)
.sort((a, b) => a.index! - b.index!)
)
.forEach((recordArray) => {
recordArray.forEach((item, i, array) => {
@@ -133,7 +133,7 @@ namespace DropDownConfig {
if (index === 0) {
tempDictionary["0_TOP"].add(v);
} else {
const previousItem = array[index - 1];
const previousItem = array[index! - 1];
const previousKey = `${previousItem.index}_${previousItem.value}`;
tempDictionary[previousKey] =
tempDictionary[previousKey] || new Set();
@@ -250,7 +250,7 @@ export class CascadingDropDownAction implements IAction {
DropdownContainer.addSaveBtnEvent(
pageType === "app"
? tableElement
: document.getElementById("appForm-gaia")
: document.getElementById("appForm-gaia")!
);
DropdownContainer.render(tableElement);
}
@@ -371,9 +371,7 @@ namespace DropdownContainer {
): void => {
let select;
if (!initSelect) {
select = selects
.get(fieldCode)
.querySelector<HTMLSelectElement>("select");
select = selects.get(fieldCode)?.querySelector<HTMLSelectElement>("select");
if (!select) {
console.error(
`フィールド ${fieldCode} のドロップダウンメニュー要素が見つかりません`
@@ -383,7 +381,7 @@ namespace DropdownContainer {
}
} else {
select = initSelect;
state[fieldCode] = value;
state[fieldCode] = value!;
}
const field = fieldList.find((f) => f.dropDown.code === fieldCode);
@@ -421,7 +419,7 @@ namespace DropdownContainer {
const fieldCode = field.dropDown.code;
updateOptions(fieldCode);
(
selects.get(fieldCode).previousElementSibling as HTMLInputElement
selects.get(fieldCode)?.previousElementSibling as HTMLInputElement
).value = "";
delete state[fieldCode];
});