@shisyamo4131/air-guard-v2-schemas 2.4.2-dev.5 → 2.4.2-dev.7
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/Site.js +29 -1
package/package.json
CHANGED
package/src/Site.js
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* - 取引先未定での現場登録のシチュエーションを考慮して現場情報は仮登録を可能とする。
|
|
8
8
|
* - 仮登録状態の現場は `isTemporary` プロパティが `true` となる。
|
|
9
9
|
* - 但し、一度取引先を設定した後に未設定に戻すことはできない。
|
|
10
|
+
* - 取引先未設定の場合に、`Site` インスタンスから取引先名を参照する必要があるケースに備えて
|
|
11
|
+
* `customerName` プロパティを設ける。
|
|
10
12
|
* - 自身の従属先データを持たせる場合に `XxxxxMinimal` クラスを使用するが、アプリ側でオブジェクト選択を行う場合に
|
|
11
13
|
* `Xxxxx` クラスにするのか `XxxxxMinimal` クラスにするのかを判断できないため、docId を持たせて
|
|
12
14
|
* `beforeCreate` フックでオブジェクトを取得するようにする。
|
|
@@ -30,8 +32,34 @@ const classProps = {
|
|
|
30
32
|
// },
|
|
31
33
|
// },
|
|
32
34
|
// }),
|
|
33
|
-
customerId: defField("customerId"
|
|
35
|
+
customerId: defField("customerId", {
|
|
36
|
+
component: {
|
|
37
|
+
attrs: {
|
|
38
|
+
/**
|
|
39
|
+
* `_beforeData.customerId` が存在する場合(本登録後の編集時を表す)には `customerId` を必須とする。
|
|
40
|
+
*/
|
|
41
|
+
required: ({ item }) => {
|
|
42
|
+
return !!item._beforeData.customerId;
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
34
47
|
customer: defField("customer", { hidden: true, customClass: Customer }),
|
|
48
|
+
customerName: defField("name", {
|
|
49
|
+
label: "取引先名",
|
|
50
|
+
required: ({ item }) => {
|
|
51
|
+
return !item.customerId; // isTemporary プロパティでの判定でも良いか?
|
|
52
|
+
},
|
|
53
|
+
component: {
|
|
54
|
+
attrs: {
|
|
55
|
+
rules: [
|
|
56
|
+
(value) =>
|
|
57
|
+
(value && value.length >= 2) ||
|
|
58
|
+
"取引先名を2文字以上で入力してください。",
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
35
63
|
code: defField("code", { label: "現場コード" }),
|
|
36
64
|
name: defField("name", {
|
|
37
65
|
label: "現場名",
|