ファイル名の修正
This commit is contained in:
@@ -8,17 +8,17 @@ import {
|
||||
import { actionAddins } from ".";
|
||||
import { KintoneRestAPIClient } from "@kintone/rest-api-client";
|
||||
import { getPageState } from "../util/url";
|
||||
import "./muilt-dropdown.scss";
|
||||
import "./cascading-dropdown-selectors.scss";
|
||||
import { Record as KTRecord } from "@kintone/rest-api-client/lib/src/client/types";
|
||||
|
||||
// 多段ドロップダウンメニューのプロパティインターフェース
|
||||
interface IMuiltDropDownProps {
|
||||
interface ICascadingDropDownProps {
|
||||
displayName: string;
|
||||
multiDropDown: IMultiDropDown;
|
||||
cascadingDropDown: ICascadingDropDown;
|
||||
}
|
||||
|
||||
// 多段ドロップダウンメニューの設定インターフェース
|
||||
interface IMultiDropDown {
|
||||
interface ICascadingDropDown {
|
||||
sourceApp: IApp;
|
||||
dropDownApp: IApp;
|
||||
fieldList: IFieldList[];
|
||||
@@ -55,7 +55,7 @@ namespace DropDownConfig {
|
||||
let dictionary: DropdownDictionary;
|
||||
|
||||
// ドロップダウンメニューの設定を初期化、必要な時のみ初期化
|
||||
export const init = async (props: IMultiDropDown) => {
|
||||
export const init = async (props: ICascadingDropDown) => {
|
||||
try {
|
||||
const client = new KintoneRestAPIClient();
|
||||
const sourceAppId = props.sourceApp.id;
|
||||
@@ -173,15 +173,15 @@ namespace DropDownConfig {
|
||||
};
|
||||
}
|
||||
|
||||
export class MuiltDropDownAction implements IAction {
|
||||
export class CascadingDropDownAction implements IAction {
|
||||
name: string;
|
||||
actionProps: IActionProperty[];
|
||||
props: IMuiltDropDownProps;
|
||||
props: ICascadingDropDownProps;
|
||||
|
||||
constructor() {
|
||||
this.name = "TestDropDown";
|
||||
this.actionProps = [];
|
||||
this.props = {} as IMuiltDropDownProps;
|
||||
this.props = {} as ICascadingDropDownProps;
|
||||
this.register();
|
||||
}
|
||||
|
||||
@@ -191,20 +191,23 @@ export class MuiltDropDownAction implements IAction {
|
||||
context: IContext
|
||||
): Promise<IActionResult> {
|
||||
this.actionProps = actionNode.actionProps;
|
||||
this.props = actionNode.ActionValue as IMuiltDropDownProps;
|
||||
this.props = actionNode.ActionValue as ICascadingDropDownProps;
|
||||
|
||||
console.log(this.actionProps);
|
||||
console.log(this.props);
|
||||
|
||||
const result: IActionResult = { canNext: true, result: "" };
|
||||
|
||||
try {
|
||||
if (!this.props) return result;
|
||||
|
||||
const appId = this.props.multiDropDown.dropDownApp.id;
|
||||
const appId = this.props.cascadingDropDown.dropDownApp.id;
|
||||
await this.#handlePageState(appId);
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"MuiltDropDownAction プロセス中にエラーが発生しました:",
|
||||
"CascadingDropDownAction プロセス中にエラーが発生しました:",
|
||||
error
|
||||
);
|
||||
context.errors.handleError(error, actionNode);
|
||||
@@ -223,14 +226,14 @@ export class MuiltDropDownAction implements IAction {
|
||||
case "edit":
|
||||
case "show":
|
||||
if (currentState.type === "show" && currentState.mode !== "edit") break;
|
||||
await DropDownConfig.init(this.props.multiDropDown);
|
||||
this.#setupMultiDropdown(currentState.type);
|
||||
await DropDownConfig.init(this.props.cascadingDropDown);
|
||||
this.#setupCascadingDropDown(currentState.type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 多段ドロップダウンメニューを設定
|
||||
#setupMultiDropdown(pageType: string): void {
|
||||
#setupCascadingDropDown(pageType: string): void {
|
||||
const tableElement = document.getElementById(
|
||||
pageType === "app" ? "view-list-data-gaia" : "record-gaia"
|
||||
);
|
||||
@@ -242,7 +245,7 @@ export class MuiltDropDownAction implements IAction {
|
||||
DropdownContainer.init(
|
||||
pageType,
|
||||
tableElement,
|
||||
this.props.multiDropDown.fieldList
|
||||
this.props.cascadingDropDown.fieldList
|
||||
);
|
||||
DropdownContainer.addSaveBtnEvent(
|
||||
pageType === "app"
|
||||
@@ -257,7 +260,7 @@ export class MuiltDropDownAction implements IAction {
|
||||
}
|
||||
}
|
||||
|
||||
new MuiltDropDownAction();
|
||||
new CascadingDropDownAction();
|
||||
|
||||
// ドロップダウンメニューコンテナの名前空間
|
||||
namespace DropdownContainer {
|
||||
@@ -22,7 +22,7 @@ import '../actions/half-full-conversion';
|
||||
import '../actions/login-user-getter';
|
||||
import '../actions/auto-lookup';
|
||||
import '../actions/field-disable';
|
||||
import '../actions/muilt-dropdown';
|
||||
import '../actions/cascading-dropdown-selectors';
|
||||
import { ActionFlow,ErrorManager,IActionFlow, IActionResult,IContext } from "./ActionTypes";
|
||||
const ShowErrorEvents:string[] = [
|
||||
"app.record.create.submit.success",
|
||||
|
||||
Reference in New Issue
Block a user