some fix and update document

This commit is contained in:
2025-02-13 10:19:09 +08:00
parent 3031c07b9c
commit bd59a1c267
6 changed files with 19 additions and 15 deletions

Binary file not shown.

View File

@@ -5,8 +5,8 @@ const env = {
appId: 19, appId: 19,
excelName: "出欠集計表", excelName: "出欠集計表",
view: { view: {
'0,1歳日誌データ連携用途': 13352636, linkFor0to1: 13352636,
'2歳以上日誌データ連携用途': 13352638, linkForOthers: 13352638,
} }
}, },
"0,1歳日誌出力用": { "0,1歳日誌出力用": {

View File

@@ -268,24 +268,24 @@ function showError(show, text) {
} }
} }
function showSuccess(show, text) { function showSuccess(show, text, time = 3000) {
if (show) { if (show) {
buildNotification('success', text); buildNotification('success', text, time);
notificationEl.open(); notificationEl.open();
} else { } else {
notificationEl && notificationEl.close(); notificationEl && notificationEl.close();
} }
} }
function buildNotification(type, text) { function buildNotification(type, text, duration = -1) {
const param = {
type,
text,
duration
}
if (!notificationEl) { if (!notificationEl) {
notificationEl = new Kuc.Notification({ notificationEl = new Kuc.Notification(param);
type,
text
});
} else { } else {
notificationEl.close(); Object.assign(notificationEl, param)
notificationEl.type = type;
notificationEl.text = text;
} }
} }

View File

@@ -29,6 +29,7 @@ class BatchCreateHandler {
// console.log(records); // console.log(records);
const createResult = await this.createData(api, records, todayString); const createResult = await this.createData(api, records, todayString);
showSuccess(true, "出欠簿一括作成完了");
location.reload(); location.reload();
loading(false); loading(false);
} }

View File

@@ -44,7 +44,7 @@ class Link2Handler {
return await api.record.getAllRecordsWithId({ return await api.record.getAllRecordsWithId({
app: env["園児別出欠簿入力"].appId, app: env["園児別出欠簿入力"].appId,
fields: ['クラス', "園児名", "園での様子_伝達事項", "評価反省"], fields: ['クラス', "園児名", "園での様子_伝達事項", "評価反省"],
condition: `学年 not in ("歳児", "歳児") and 登園日 = "${dateString}"` condition: `学年 in ("歳児", "3歳児", "4歳児", "歳児") and 登園日 = "${dateString}"`
}); });
} catch (e) { } catch (e) {
showError(true, '園児台帳アプリのデータ読み取りエラー\n - ' + e); showError(true, '園児台帳アプリのデータ読み取りエラー\n - ' + e);
@@ -78,13 +78,16 @@ class Link2Handler {
condition: `登園日 = "${dateString}"` condition: `登園日 = "${dateString}"`
}) })
const generatedRecordId = generatedRecords[0]?.$id.value; const generatedRecordId = generatedRecords[0]?.$id.value;
const param = { const param = {
app: env["2歳以上日誌出力用"].appId, app: env["2歳以上日誌出力用"].appId,
record record
} }
let addResult; let addResult;
if (generatedRecordId) { if (generatedRecordId) {
param.id = generatedRecordId; param.id = generatedRecordId;
// 本アプリの当日データでテーブルを上書きし、対応する園児データがない行を【削除】します
addResult = await api.record.updateRecord(param); addResult = await api.record.updateRecord(param);
} else { } else {
addResult = await api.record.addRecord(param); addResult = await api.record.addRecord(param);

View File

@@ -5,12 +5,12 @@
kintone.events.on("app.record.index.show", (event) => { kintone.events.on("app.record.index.show", (event) => {
const headerSpace = getHeaderSpace('single-label-line'); const headerSpace = getHeaderSpace('single-label-line');
if (event.viewId === APP_ENV.view["0,1歳日誌データ連携用途"]) { if (event.viewId === APP_ENV.view.linkFor0to1) {
Link1Handler.getInstance(headerSpace); Link1Handler.getInstance(headerSpace);
return event; return event;
} }
if (event.viewId === APP_ENV.view["2歳以上日誌データ連携用途"]) { if (event.viewId === APP_ENV.view.linkForOthers) {
Link2Handler.getInstance(headerSpace); Link2Handler.getInstance(headerSpace);
return event; return event;
} }