Files
kintone-attendance-system/src/8.学期反省・評価/processBatchApproval.js
2025-09-19 16:56:33 +08:00

55 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function () {
"use strict";
// マイビューのID
const mineView = 13352759;
// 分類フィールドのプレースホルダー
const classifyField = "${classify}";
// ボタン分類マッピング
const btnClassifyMap = {
"0歳児": "0~2歳",
"1歳児": "0~2歳",
"2歳児": "0~2歳",
"3歳児": "3~5歳",
"4歳児": "3~5歳",
"5歳児": "3~5歳",
}
// アクションマッピング
const actionMap = {
"担任作成中": `指導教諭確認依頼${classifyField}`,
"指導教諭確認中": `承認する`,
"園長確認中": `承認する${classifyField}`
}
/**
* ステータスから接頭辞を取得する
* @param {string} status - ステータス文字列
*/
const getStatusPrefix = (status) => {
return status.split("")[0];
};
// kintoneイベントの登録
kintone.events.on("app.record.index.show", (event) => {
// 特定のビューの場合のみ処理を実行
if (event.viewId === mineView) {
// BatchApprovalHandlerクラスのインスタンスを作成
const batchApproval = new BatchApprovalHandler(
mineView,
classifyField,
btnClassifyMap,
actionMap,
getStatusPrefix,
_StatusFieldMap
);
// 一括承認ボタンを作成
batchApproval.createApproveBtn();
}
return event;
});
})();