@shisyamo4131/air-guard-v2-schemas 2.4.2-dev.67 → 2.4.2-dev.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Billing.js +5 -34
- package/src/Insurance.js +11 -3
- package/src/OperationResult.js +3 -17
- package/src/SiteOperationSchedule.js +2 -6
- package/src/WorkTimeBase.js +2 -8
- package/src/parts/fieldDefinitions/array.js +8 -0
- package/src/parts/fieldDefinitions/check.js +20 -0
- package/src/parts/fieldDefinitions/code.js +8 -0
- package/src/parts/fieldDefinitions/constants.js +9 -0
- package/src/parts/fieldDefinitions/dateAt.js +58 -0
- package/src/parts/fieldDefinitions/dateTimeAt.js +8 -0
- package/src/parts/fieldDefinitions/defaultDefinition.js +118 -0
- package/src/parts/fieldDefinitions/multipleLine.js +12 -0
- package/src/parts/fieldDefinitions/number.js +69 -0
- package/src/parts/fieldDefinitions/object.js +30 -0
- package/src/parts/fieldDefinitions/oneLine.js +306 -0
- package/src/parts/fieldDefinitions/radio.js +8 -0
- package/src/parts/fieldDefinitions/select.js +240 -0
- package/src/parts/fieldDefinitions/time.js +8 -0
- package/src/parts/fieldDefinitions.js +39 -858
- package/src/utils/CutoffDate.js +11 -15
- package/src/utils/index.js +24 -0
package/package.json
CHANGED
package/src/Billing.js
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
import FireModel from "@shisyamo4131/air-firebase-v2";
|
|
30
30
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
31
|
+
import { formatJstDate } from "./utils/index.js";
|
|
31
32
|
import OperationResult from "./OperationResult.js";
|
|
32
33
|
|
|
33
34
|
const STATUS = {
|
|
@@ -74,16 +75,7 @@ export default class Billing extends FireModel {
|
|
|
74
75
|
configurable: true,
|
|
75
76
|
enumerable: true,
|
|
76
77
|
get() {
|
|
77
|
-
|
|
78
|
-
const jstDate = new Date(
|
|
79
|
-
this.billingDateAt.getTime() + 9 * 60 * 60 * 1000
|
|
80
|
-
); /* JST補正 */
|
|
81
|
-
const year = jstDate.getUTCFullYear();
|
|
82
|
-
const month = jstDate.getUTCMonth() + 1;
|
|
83
|
-
const day = jstDate.getUTCDate();
|
|
84
|
-
return `${year}-${String(month).padStart(2, "0")}-${String(
|
|
85
|
-
day
|
|
86
|
-
).padStart(2, "0")}`;
|
|
78
|
+
return formatJstDate(this.billingDateAt);
|
|
87
79
|
},
|
|
88
80
|
set(v) {},
|
|
89
81
|
},
|
|
@@ -91,13 +83,7 @@ export default class Billing extends FireModel {
|
|
|
91
83
|
configurable: true,
|
|
92
84
|
enumerable: true,
|
|
93
85
|
get() {
|
|
94
|
-
|
|
95
|
-
const jstDate = new Date(
|
|
96
|
-
this.billingDateAt.getTime() + 9 * 60 * 60 * 1000
|
|
97
|
-
); /* JST補正 */
|
|
98
|
-
const year = jstDate.getUTCFullYear();
|
|
99
|
-
const month = jstDate.getUTCMonth() + 1;
|
|
100
|
-
return `${year}-${String(month).padStart(2, "0")}`;
|
|
86
|
+
return formatJstDate(this.billingDateAt, "YYYY-MM");
|
|
101
87
|
},
|
|
102
88
|
set(v) {},
|
|
103
89
|
},
|
|
@@ -108,16 +94,7 @@ export default class Billing extends FireModel {
|
|
|
108
94
|
configurable: true,
|
|
109
95
|
enumerable: true,
|
|
110
96
|
get() {
|
|
111
|
-
|
|
112
|
-
const jstDate = new Date(
|
|
113
|
-
this.paymentDueDateAt.getTime() + 9 * 60 * 60 * 1000
|
|
114
|
-
); /* JST補正 */
|
|
115
|
-
const year = jstDate.getUTCFullYear();
|
|
116
|
-
const month = jstDate.getUTCMonth() + 1;
|
|
117
|
-
const day = jstDate.getUTCDate();
|
|
118
|
-
return `${year}-${String(month).padStart(2, "0")}-${String(
|
|
119
|
-
day
|
|
120
|
-
).padStart(2, "0")}`;
|
|
97
|
+
return formatJstDate(this.paymentDueDateAt);
|
|
121
98
|
},
|
|
122
99
|
set(v) {},
|
|
123
100
|
},
|
|
@@ -125,13 +102,7 @@ export default class Billing extends FireModel {
|
|
|
125
102
|
configurable: true,
|
|
126
103
|
enumerable: true,
|
|
127
104
|
get() {
|
|
128
|
-
|
|
129
|
-
const jstDate = new Date(
|
|
130
|
-
this.paymentDueDateAt.getTime() + 9 * 60 * 60 * 1000
|
|
131
|
-
); /* JST補正 */
|
|
132
|
-
const year = jstDate.getUTCFullYear();
|
|
133
|
-
const month = jstDate.getUTCMonth() + 1;
|
|
134
|
-
return `${year}-${String(month).padStart(2, "0")}`;
|
|
105
|
+
return formatJstDate(this.paymentDueDateAt, "YYYY-MM");
|
|
135
106
|
},
|
|
136
107
|
set(v) {},
|
|
137
108
|
},
|
package/src/Insurance.js
CHANGED
|
@@ -30,16 +30,17 @@ export const ERROR_MESSAGES = Object.freeze({
|
|
|
30
30
|
* @property {Date|null} lossDateAt - 喪失日を表す日付オブジェクト。加入していない場合は null になります。
|
|
31
31
|
* @property {string|null} lossReason - 喪失理由を表す文字列。加入していない場合は null になります。
|
|
32
32
|
* @property {boolean} isProcessing - 加入手続き中であるかどうかを表す真偽値。加入手続き中の場合は true、そうでない場合は false になります。
|
|
33
|
+
* @property {boolean} isRetire - 退職による喪失であるかどうかを表す真偽値。退職による喪失の場合は true、そうでない場合は false になります。
|
|
33
34
|
* @property {Array} history - 状態遷移の履歴を記録するための配列。各要素は状態遷移前の状態を表すオブジェクトです。
|
|
34
35
|
*
|
|
35
36
|
* @note
|
|
36
37
|
* - 各プロパティは `現在の状態` を表すもので、状態の遷移には対応するメソッドを利用します。
|
|
37
|
-
* - `lossDateAt
|
|
38
|
+
* - `lossDateAt`(喪失日)、`lossReason`(喪失理由)、`isRetire`(退職フラグ)は、`現在の状態` という意味では不要なプロパティですが、
|
|
38
39
|
* 資格喪失処理の際に必要になる情報であるため、プロパティとして用意しています。
|
|
39
40
|
* - 状態を遷移させるために必要な情報をこのインスタンスに設定(入力)する場合、
|
|
40
41
|
* 必ず複製したインスタンスのプロパティを編集し、複製元インスタンスの
|
|
41
42
|
* 状態遷移用メソッドを呼び出す際に引数として渡す、という形で利用してください。
|
|
42
|
-
* - 各状態遷移メソッドでは、`lossDateAt
|
|
43
|
+
* - 各状態遷移メソッドでは、`lossDateAt`(喪失日)、`lossReason`(喪失理由)、`isRetire`(退職フラグ)は必ず初期化されます。
|
|
43
44
|
*
|
|
44
45
|
* @method exempt - 現在の状態を `EXEMPT (適用除外)` に更新します。
|
|
45
46
|
* @method enroll - 現在の状態を `ENROLLED (加入)` に更新します。
|
|
@@ -58,6 +59,7 @@ export default class Insurance extends BaseClass {
|
|
|
58
59
|
lossDateAt: defField("lossDateAt"),
|
|
59
60
|
lossReason: defField("lossReason"),
|
|
60
61
|
isProcessing: defField("check", { label: "加入手続き中", default: false }),
|
|
62
|
+
isRetire: defField("check", { label: "退職", default: false }),
|
|
61
63
|
history: defField("array"), // 状態遷移の履歴を記録するための配列
|
|
62
64
|
};
|
|
63
65
|
|
|
@@ -208,6 +210,7 @@ export default class Insurance extends BaseClass {
|
|
|
208
210
|
this.number = null;
|
|
209
211
|
this.lossDateAt = null; // 念のため null に更新しておく
|
|
210
212
|
this.lossReason = null; // 念のため null に更新しておく
|
|
213
|
+
this.isRetire = false; // 念のため false に更新しておく
|
|
211
214
|
}
|
|
212
215
|
|
|
213
216
|
/**
|
|
@@ -252,6 +255,7 @@ export default class Insurance extends BaseClass {
|
|
|
252
255
|
this.isProcessing = !!isProcessing;
|
|
253
256
|
this.lossDateAt = null; // 念のため null に更新しておく
|
|
254
257
|
this.lossReason = null; // 念のため null に更新しておく
|
|
258
|
+
this.isRetire = false; // 念のため false に更新しておく
|
|
255
259
|
}
|
|
256
260
|
|
|
257
261
|
/**
|
|
@@ -282,6 +286,7 @@ export default class Insurance extends BaseClass {
|
|
|
282
286
|
this.isProcessing = false;
|
|
283
287
|
this.lossDateAt = null; // 念のため null に更新しておく
|
|
284
288
|
this.lossReason = null; // 念のため null に更新しておく
|
|
289
|
+
this.isRetire = false; // 念のため false に更新しておく
|
|
285
290
|
}
|
|
286
291
|
|
|
287
292
|
/**
|
|
@@ -305,6 +310,7 @@ export default class Insurance extends BaseClass {
|
|
|
305
310
|
this.isProcessing = false;
|
|
306
311
|
this.lossDateAt = null; // 念のため null に更新しておく
|
|
307
312
|
this.lossReason = null; // 念のため null に更新しておく
|
|
313
|
+
this.isRetire = false; // 念のため false に更新しておく
|
|
308
314
|
}
|
|
309
315
|
|
|
310
316
|
/**
|
|
@@ -323,7 +329,7 @@ export default class Insurance extends BaseClass {
|
|
|
323
329
|
* @throws {Error} 喪失日が日付オブジェクトでない場合にエラーをスローします。
|
|
324
330
|
* @throws {Error} 喪失理由が指定されていない場合にエラーをスローします。
|
|
325
331
|
*/
|
|
326
|
-
loss({ lossDateAt, lossReason
|
|
332
|
+
loss({ lossDateAt, lossReason, isRetire = false } = {}) {
|
|
327
333
|
// validation
|
|
328
334
|
if (!this.isEnrolled()) {
|
|
329
335
|
throw new Error(ERROR_MESSAGES.ENROLLED_ONLY("喪失手続き"));
|
|
@@ -348,6 +354,7 @@ export default class Insurance extends BaseClass {
|
|
|
348
354
|
this.number = null;
|
|
349
355
|
this.lossDateAt = null; // 念のため null に更新しておく
|
|
350
356
|
this.lossReason = null; // 念のため null に更新しておく
|
|
357
|
+
this.isRetire = false; // 念のため false に更新しておく
|
|
351
358
|
}
|
|
352
359
|
|
|
353
360
|
/**
|
|
@@ -376,5 +383,6 @@ export default class Insurance extends BaseClass {
|
|
|
376
383
|
this.isProcessing = false; // 念のため false に戻しておく
|
|
377
384
|
this.lossDateAt = null; // 念のため null に戻しておく
|
|
378
385
|
this.lossReason = null; // 念のため null に戻しておく
|
|
386
|
+
this.isRetire = false; // 念のため false に戻しておく
|
|
379
387
|
}
|
|
380
388
|
}
|
package/src/OperationResult.js
CHANGED
|
@@ -147,6 +147,7 @@ import AgreementV2 from "./AgreementV2.js";
|
|
|
147
147
|
import { ContextualError } from "./utils/ContextualError.js";
|
|
148
148
|
import OperationResultDetail from "./OperationResultDetail.js";
|
|
149
149
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
150
|
+
import { formatJstDate } from "./utils/index.js";
|
|
150
151
|
import Tax from "./Tax.js";
|
|
151
152
|
import { VALUES as BILLING_UNIT_TYPE } from "./constants/billing-unit-type.js";
|
|
152
153
|
import RoundSetting from "./RoundSetting.js";
|
|
@@ -452,16 +453,7 @@ export default class OperationResult extends Operation {
|
|
|
452
453
|
configurable: true,
|
|
453
454
|
enumerable: true,
|
|
454
455
|
get() {
|
|
455
|
-
|
|
456
|
-
const jstDate = new Date(
|
|
457
|
-
this.billingDateAt.getTime() + 9 * 60 * 60 * 1000,
|
|
458
|
-
); /* JST補正 */
|
|
459
|
-
const year = jstDate.getUTCFullYear();
|
|
460
|
-
const month = jstDate.getUTCMonth() + 1;
|
|
461
|
-
const day = jstDate.getUTCDate();
|
|
462
|
-
return `${year}-${String(month).padStart(2, "0")}-${String(
|
|
463
|
-
day,
|
|
464
|
-
).padStart(2, "0")}`;
|
|
456
|
+
return formatJstDate(this.billingDateAt);
|
|
465
457
|
},
|
|
466
458
|
set(v) {},
|
|
467
459
|
},
|
|
@@ -469,13 +461,7 @@ export default class OperationResult extends Operation {
|
|
|
469
461
|
configurable: true,
|
|
470
462
|
enumerable: true,
|
|
471
463
|
get() {
|
|
472
|
-
|
|
473
|
-
const jstDate = new Date(
|
|
474
|
-
this.billingDateAt.getTime() + 9 * 60 * 60 * 1000,
|
|
475
|
-
); /* JST補正 */
|
|
476
|
-
const year = jstDate.getUTCFullYear();
|
|
477
|
-
const month = jstDate.getUTCMonth() + 1;
|
|
478
|
-
return `${year}-${String(month).padStart(2, "0")}`;
|
|
464
|
+
return formatJstDate(this.billingDateAt, "YYYY-MM");
|
|
479
465
|
},
|
|
480
466
|
set(v) {},
|
|
481
467
|
},
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
*****************************************************************************/
|
|
117
117
|
import Operation from "./Operation.js";
|
|
118
118
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
119
|
-
import { ContextualError } from "./utils/index.js";
|
|
119
|
+
import { ContextualError, formatJstDate } from "./utils/index.js";
|
|
120
120
|
import ArrangementNotification from "./ArrangementNotification.js";
|
|
121
121
|
import SiteOperationScheduleDetail from "./SiteOperationScheduleDetail.js";
|
|
122
122
|
import OperationResult from "./OperationResult.js";
|
|
@@ -499,11 +499,7 @@ export default class SiteOperationSchedule extends Operation {
|
|
|
499
499
|
const targetDates = dates
|
|
500
500
|
.map((date) => {
|
|
501
501
|
if (date instanceof Date) {
|
|
502
|
-
|
|
503
|
-
const year = jstDate.getUTCFullYear();
|
|
504
|
-
const month = String(jstDate.getUTCMonth() + 1).padStart(2, "0");
|
|
505
|
-
const day = String(jstDate.getUTCDate()).padStart(2, "0");
|
|
506
|
-
return `${year}-${month}-${day}`;
|
|
502
|
+
return formatJstDate(date);
|
|
507
503
|
}
|
|
508
504
|
return date;
|
|
509
505
|
})
|
package/src/WorkTimeBase.js
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
*****************************************************************************/
|
|
54
54
|
import FireModel from "@shisyamo4131/air-firebase-v2";
|
|
55
55
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
56
|
-
import { getDateAt } from "./utils/index.js";
|
|
56
|
+
import { getDateAt, formatJstDate } from "./utils/index.js";
|
|
57
57
|
import { VALUES as SHIFT_TYPE } from "./constants/shift-type.js";
|
|
58
58
|
|
|
59
59
|
const classProps = {
|
|
@@ -129,13 +129,7 @@ export default class WorkTimeBase extends FireModel {
|
|
|
129
129
|
configurable: true,
|
|
130
130
|
enumerable: true,
|
|
131
131
|
get() {
|
|
132
|
-
|
|
133
|
-
// UTC時刻に9時間(JST)を加算してJST日付を取得
|
|
134
|
-
const jstDate = new Date(this.dateAt.getTime() + 9 * 60 * 60 * 1000);
|
|
135
|
-
const year = jstDate.getUTCFullYear();
|
|
136
|
-
const month = String(jstDate.getUTCMonth() + 1).padStart(2, "0");
|
|
137
|
-
const day = String(jstDate.getUTCDate()).padStart(2, "0");
|
|
138
|
-
return `${year}-${month}-${day}`;
|
|
132
|
+
return formatJstDate(this.dateAt) || "";
|
|
139
133
|
},
|
|
140
134
|
set(v) {},
|
|
141
135
|
},
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { generalDefinitions } from "./defaultDefinition.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CHECK型のフィールド定義
|
|
5
|
+
*/
|
|
6
|
+
export const checkFields = {
|
|
7
|
+
check: generalDefinitions.check,
|
|
8
|
+
hasPeriodOfStayLimit: {
|
|
9
|
+
...generalDefinitions.check,
|
|
10
|
+
label: "在留期間制限",
|
|
11
|
+
},
|
|
12
|
+
hasWorkRestrictions: {
|
|
13
|
+
...generalDefinitions.check,
|
|
14
|
+
label: "就労制限",
|
|
15
|
+
},
|
|
16
|
+
isForeigner: {
|
|
17
|
+
...generalDefinitions.check,
|
|
18
|
+
label: "外国籍",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* フィールド定義で使用する定数
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const DEFAULT_WORKING_MINUTES = 480;
|
|
6
|
+
export const DEFAULT_BREAK_MINUTES = 60;
|
|
7
|
+
export const MINUTES_PER_HOUR = 60;
|
|
8
|
+
export const MINUTES_PER_QUARTER_HOUR = 15;
|
|
9
|
+
export const MAX_SCHEDULED_WORKING_MINUTES = 480; // 8時間 * 60分
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { generalDefinitions } from "./defaultDefinition.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* DATE AT型のフィールド定義
|
|
5
|
+
*/
|
|
6
|
+
export const dateAtFields = {
|
|
7
|
+
dateAt: generalDefinitions.dateAt,
|
|
8
|
+
dateOfBirth: {
|
|
9
|
+
...generalDefinitions.dateAt,
|
|
10
|
+
label: "生年月日",
|
|
11
|
+
default: null, // 2025-12-26 Set default to null
|
|
12
|
+
component: {
|
|
13
|
+
...generalDefinitions.dateAt.component,
|
|
14
|
+
attrs: {
|
|
15
|
+
viewMode: "year", // 2025-12-26 Added
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
dateOfHire: {
|
|
20
|
+
...generalDefinitions.dateAt,
|
|
21
|
+
label: "入社日",
|
|
22
|
+
},
|
|
23
|
+
// 2025-12-26 Added
|
|
24
|
+
dateOfSecurityGuardRegistration: {
|
|
25
|
+
...generalDefinitions.dateAt,
|
|
26
|
+
label: "警備員登録日",
|
|
27
|
+
default: null,
|
|
28
|
+
},
|
|
29
|
+
dateOfTermination: {
|
|
30
|
+
...generalDefinitions.dateAt,
|
|
31
|
+
label: "退職日",
|
|
32
|
+
default: null, // 2025-12-26 Set default to null
|
|
33
|
+
},
|
|
34
|
+
enrollmentDateAt: {
|
|
35
|
+
...generalDefinitions.dateAt,
|
|
36
|
+
label: "資格取得日",
|
|
37
|
+
default: null,
|
|
38
|
+
},
|
|
39
|
+
// 2025-12-26 Added
|
|
40
|
+
expirationDateAt: {
|
|
41
|
+
...generalDefinitions.dateAt,
|
|
42
|
+
label: "有効期限",
|
|
43
|
+
default: null,
|
|
44
|
+
},
|
|
45
|
+
issueDateAt: {
|
|
46
|
+
...generalDefinitions.dateAt,
|
|
47
|
+
label: "取得日",
|
|
48
|
+
},
|
|
49
|
+
lossDateAt: {
|
|
50
|
+
...generalDefinitions.dateAt,
|
|
51
|
+
label: "資格喪失日",
|
|
52
|
+
default: null,
|
|
53
|
+
},
|
|
54
|
+
periodOfStay: {
|
|
55
|
+
...generalDefinitions.dateAt,
|
|
56
|
+
label: "在留期間満了日",
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* フィールド定義のデフォルト値
|
|
3
|
+
* - `air-firebase` が提供する `FireModel (BaseClass)` において、クラスが保有するフィールドの定義および値の検証に使用されます。
|
|
4
|
+
* - `component` プロパティは `air-vuetify` の入力コンポーネント生成の為の属性として使用されます。
|
|
5
|
+
* 但し、required, label, hidden, length は入力コンポーネントの属性としても使用されます。
|
|
6
|
+
* - `validator` の返り値は原則オブジェクトです。文字列を返すこともでき、その文字列がエラーメッセージとして扱われますが多言語対応のためには
|
|
7
|
+
* オブジェクトを返すことを推奨します。
|
|
8
|
+
* 返り値が true/false の場合は、従来通りのバリデーション結果として扱われます。
|
|
9
|
+
* @key {String|Number|Boolean|Object|Array|Date} type - データの型
|
|
10
|
+
* @key {any} default - 既定値
|
|
11
|
+
* @key {String} label - フィールドのラベル
|
|
12
|
+
* @key {Number} length - 入力可能な最大文字数(文字列型の場合)
|
|
13
|
+
* @key {Boolean} required - 入力必須かどうか
|
|
14
|
+
* @key {Boolean} hidden - フィールドをUI上で非表示にするかどうか
|
|
15
|
+
* @key {Function} validator - フィールドの値を検証する関数。引数に値を取り、エラーメッセージを返すか、true/falseで検証結果を返す。
|
|
16
|
+
* @key {Object} component - フィールドに対応するUIコンポーネントの定義
|
|
17
|
+
* @key {String} component.name - 使用するコンポーネントの名前(AirVuetifyコンポーネントのみ指定可能)
|
|
18
|
+
* @key {Object} component.attrs - コンポーネントに渡す属性の定義
|
|
19
|
+
*/
|
|
20
|
+
export const defaultDefinition = {
|
|
21
|
+
type: String,
|
|
22
|
+
default: null,
|
|
23
|
+
label: undefined,
|
|
24
|
+
length: undefined,
|
|
25
|
+
required: undefined,
|
|
26
|
+
hidden: undefined,
|
|
27
|
+
validator: undefined,
|
|
28
|
+
component: {
|
|
29
|
+
name: undefined,
|
|
30
|
+
attrs: {},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** 汎用パーツ */
|
|
35
|
+
export const generalDefinitions = {
|
|
36
|
+
array: {
|
|
37
|
+
...defaultDefinition,
|
|
38
|
+
type: Array,
|
|
39
|
+
default: () => [],
|
|
40
|
+
component: { name: "air-select", attrs: { multiple: true } },
|
|
41
|
+
},
|
|
42
|
+
check: {
|
|
43
|
+
...defaultDefinition,
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false,
|
|
46
|
+
component: { name: "air-checkbox", attrs: {} },
|
|
47
|
+
},
|
|
48
|
+
code: {
|
|
49
|
+
...defaultDefinition,
|
|
50
|
+
length: 10,
|
|
51
|
+
component: { name: "air-text-field", attrs: { inputType: "alphanumeric" } },
|
|
52
|
+
},
|
|
53
|
+
// 日付(00時固定としたDateオブジェクトとして使用する)
|
|
54
|
+
dateAt: {
|
|
55
|
+
...defaultDefinition,
|
|
56
|
+
type: Object,
|
|
57
|
+
label: "日付",
|
|
58
|
+
default: () => {
|
|
59
|
+
const date = new Date();
|
|
60
|
+
date.setHours(0, 0, 0, 0);
|
|
61
|
+
return date;
|
|
62
|
+
},
|
|
63
|
+
component: {
|
|
64
|
+
name: "air-date-input",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
// 日時(時刻までを含んだDateオブジェクト)
|
|
68
|
+
dateTimeAt: {
|
|
69
|
+
...defaultDefinition,
|
|
70
|
+
type: Object,
|
|
71
|
+
label: "日時",
|
|
72
|
+
default: null,
|
|
73
|
+
component: { name: "air-date-time-picker-input", attrs: {} },
|
|
74
|
+
},
|
|
75
|
+
multipleLine: {
|
|
76
|
+
...defaultDefinition,
|
|
77
|
+
length: 200,
|
|
78
|
+
component: {
|
|
79
|
+
name: "air-textarea",
|
|
80
|
+
attrs: { counter: true, maxlength: 200 },
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
number: {
|
|
84
|
+
...defaultDefinition,
|
|
85
|
+
type: Number,
|
|
86
|
+
component: {
|
|
87
|
+
name: "air-number-input",
|
|
88
|
+
attrs: {
|
|
89
|
+
controlVariant: "split",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
object: {
|
|
94
|
+
...defaultDefinition,
|
|
95
|
+
type: Object,
|
|
96
|
+
component: { name: "air-select" }, // `AirTextField` that is used as default ui component could not handle object type.
|
|
97
|
+
},
|
|
98
|
+
oneLine: {
|
|
99
|
+
...defaultDefinition,
|
|
100
|
+
component: { name: "air-text-field", attrs: {} },
|
|
101
|
+
},
|
|
102
|
+
radio: {
|
|
103
|
+
...defaultDefinition,
|
|
104
|
+
component: { name: "air-radio-group", attrs: {} },
|
|
105
|
+
},
|
|
106
|
+
select: {
|
|
107
|
+
...defaultDefinition,
|
|
108
|
+
component: { name: "air-select", attrs: {} },
|
|
109
|
+
},
|
|
110
|
+
// 時刻文字列
|
|
111
|
+
time: {
|
|
112
|
+
...defaultDefinition,
|
|
113
|
+
label: "時刻",
|
|
114
|
+
component: {
|
|
115
|
+
name: "air-time-picker-input",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { generalDefinitions } from "./defaultDefinition.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MULTIPLE LINE型のフィールド定義
|
|
5
|
+
*/
|
|
6
|
+
export const multipleLineFields = {
|
|
7
|
+
multipleLine: generalDefinitions.multipleLine,
|
|
8
|
+
remarks: {
|
|
9
|
+
...generalDefinitions.multipleLine,
|
|
10
|
+
label: "備考",
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { generalDefinitions } from "./defaultDefinition.js";
|
|
2
|
+
import { DEFAULT_BREAK_MINUTES, DEFAULT_WORKING_MINUTES } from "./constants.js";
|
|
3
|
+
import { VALIDATION_ERRORS } from "../../errorDefinitions.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* NUMBER型のフィールド定義
|
|
7
|
+
*/
|
|
8
|
+
export const numberFields = {
|
|
9
|
+
number: generalDefinitions.number,
|
|
10
|
+
breakMinutes: {
|
|
11
|
+
...generalDefinitions.number,
|
|
12
|
+
label: "休憩時間(分)",
|
|
13
|
+
default: DEFAULT_BREAK_MINUTES,
|
|
14
|
+
validator: (v) => {
|
|
15
|
+
if (v < 0) {
|
|
16
|
+
return VALIDATION_ERRORS.MIN_VALUE_ERROR(0);
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
},
|
|
20
|
+
component: {
|
|
21
|
+
...generalDefinitions.number.component,
|
|
22
|
+
attrs: {
|
|
23
|
+
...generalDefinitions.number.component.attrs,
|
|
24
|
+
min: 0,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
overtimeWorkMinutes: {
|
|
29
|
+
...generalDefinitions.number,
|
|
30
|
+
label: "残業時間(分)",
|
|
31
|
+
default: 0,
|
|
32
|
+
validator: (v) => {
|
|
33
|
+
if (v < 0) {
|
|
34
|
+
return VALIDATION_ERRORS.MIN_VALUE_ERROR(0);
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
},
|
|
38
|
+
component: {
|
|
39
|
+
...generalDefinitions.number.component,
|
|
40
|
+
attrs: {
|
|
41
|
+
...generalDefinitions.number.component.attrs,
|
|
42
|
+
min: 0,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
regulationWorkMinutes: {
|
|
47
|
+
...generalDefinitions.number,
|
|
48
|
+
label: "規定実働時間(分)",
|
|
49
|
+
default: DEFAULT_WORKING_MINUTES,
|
|
50
|
+
validator: (v) => {
|
|
51
|
+
if (v < 0) {
|
|
52
|
+
return VALIDATION_ERRORS.MIN_VALUE_ERROR(0);
|
|
53
|
+
}
|
|
54
|
+
return true;
|
|
55
|
+
},
|
|
56
|
+
component: {
|
|
57
|
+
...generalDefinitions.number.component,
|
|
58
|
+
attrs: {
|
|
59
|
+
...generalDefinitions.number.component.attrs,
|
|
60
|
+
min: 0,
|
|
61
|
+
persistentHint: true,
|
|
62
|
+
hint: "この時間を超えると残業扱いになります。",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
price: {
|
|
67
|
+
...generalDefinitions.number,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { generalDefinitions } from "./defaultDefinition.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OBJECT型のフィールド定義
|
|
5
|
+
*/
|
|
6
|
+
export const objectFields = {
|
|
7
|
+
object: generalDefinitions.object,
|
|
8
|
+
customer: {
|
|
9
|
+
...generalDefinitions.object,
|
|
10
|
+
label: "取引先",
|
|
11
|
+
component: {
|
|
12
|
+
name: "air-autocomplete-api",
|
|
13
|
+
attrs: {
|
|
14
|
+
cacheItems: true,
|
|
15
|
+
clearable: true,
|
|
16
|
+
itemTitle: "name",
|
|
17
|
+
itemValue: "docId",
|
|
18
|
+
returnObject: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
employmentInsurance: {
|
|
23
|
+
...generalDefinitions.object,
|
|
24
|
+
label: "雇用保険",
|
|
25
|
+
},
|
|
26
|
+
location: {
|
|
27
|
+
...generalDefinitions.object,
|
|
28
|
+
hidden: true,
|
|
29
|
+
},
|
|
30
|
+
};
|