poohr 3 tygodni temu
rodzic
commit
fdd9746ac2

+ 6
- 2
src/app/pages/danka-edit/danka-edit.scss Wyświetl plik

@@ -62,7 +62,8 @@
62 62
 
63 63
 .basic-edit-section,
64 64
 .phone-edit-section {
65
-  padding: 26px 28px 28px;
65
+  overflow: hidden;
66
+  padding: 0 28px 28px;
66 67
   border: 2px solid #d8caba;
67 68
   border-radius: 12px;
68 69
   background: #fffdf9;
@@ -72,7 +73,10 @@
72 73
 .basic-edit-section h2,
73 74
 .phone-edit-section h2,
74 75
 .support-box h2 {
75
-  margin: 0 0 18px;
76
+  margin: 0 -28px 20px;
77
+  padding: 14px 28px;
78
+  background: #eadfce;
79
+  border-bottom: 2px solid #d8caba;
76 80
   color: #2f2720;
77 81
   font-size: 22px;
78 82
   line-height: 1.3;

+ 16
- 18
src/app/pages/family-edit/family-edit.html Wyświetl plik

@@ -86,16 +86,26 @@
86 86
                 </div>
87 87
               </div>
88 88
 
89
-              <div class="form-row form-row-heading">
90
-                <label></label>
89
+              <div class="form-row householder-setting-row">
90
+                <label>施主設定</label>
91 91
                 <div class="form-field">
92
-                  <h3 class="sub-section-title">家系図情報</h3>
93
-                  <p class="sub-section-description">
94
-                    家系図に反映する親子・配偶者の関係を設定します。
95
-                  </p>
92
+                  <button type="button"
93
+                          class="set-householder-button"
94
+                          (click)="setAsHouseholder()">
95
+                    この方を施主にする
96
+                  </button>
96 97
                 </div>
97 98
               </div>
99
+            </div>
100
+          </section>
98 101
 
102
+          <section class="family-tree-edit-section">
103
+            <h2>家系図情報</h2>
104
+            <p class="section-description">
105
+              家系図に反映する親子・配偶者の関係を設定します。
106
+            </p>
107
+
108
+            <div class="form-list">
99 109
               <div class="form-row">
100 110
                 <label for="fatherId">父</label>
101 111
                 <div class="form-field">
@@ -167,18 +177,6 @@
167 177
 
168 178
             </div>
169 179
           </section>
170
-
171
-          <section class="phone-edit-section">
172
-            <div class="householder-area">
173
-              <h3>この方を施主にする</h3>
174
-
175
-              <button type="button"
176
-                      class="set-householder-button"
177
-                      (click)="setAsHouseholder()">
178
-                施主に設定
179
-              </button>
180
-            </div>
181
-          </section>
182 180
         </div>
183 181
 
184 182
         <div class="bottom-actions">

+ 32
- 55
src/app/pages/family-edit/family-edit.scss Wyświetl plik

@@ -2,7 +2,7 @@
2 2
   position: relative;
3 3
   display: block;
4 4
   min-height: 100vh;
5
-  background: #f4eee4;
5
+  background: #f6f0e7;
6 6
   color: #2f2720;
7 7
 }
8 8
 
@@ -11,7 +11,7 @@
11 11
   grid-template-columns: 172px minmax(0, 1fr);
12 12
   gap: 20px;
13 13
   padding: 0 38px 36px 0;
14
-  background: #f4eee4;
14
+  background: #f6f0e7;
15 15
 }
16 16
 
17 17
 .danka-edit-main {
@@ -22,7 +22,7 @@
22 22
 .edit-panel {
23 23
   min-height: 760px;
24 24
   padding: 34px 42px 40px;
25
-  background: #ffffff;
25
+  background: #fffdf9;
26 26
   border: 2px solid #d8caba;
27 27
   border-radius: 64px;
28 28
   box-sizing: border-box;
@@ -56,18 +56,28 @@
56 56
 
57 57
 .edit-content {
58 58
   display: grid;
59
-  grid-template-columns: minmax(0, 1fr) 500px;
60
-  gap: 32px;
59
+  grid-template-columns: 1fr;
60
+  gap: 16px;
61 61
   align-items: start;
62 62
 }
63 63
 
64
-.basic-edit-section {
65
-  padding-left: 0;
64
+.basic-edit-section,
65
+.family-tree-edit-section {
66
+  overflow: hidden;
67
+  padding: 0 22px 24px;
68
+  border: 2px solid #d8caba;
69
+  border-radius: 12px;
70
+  background: #fffdf9;
71
+  box-sizing: border-box;
66 72
 }
67 73
 
68 74
 .basic-edit-section h2,
75
+.family-tree-edit-section h2,
69 76
 .section-heading h2 {
70
-  margin: 0;
77
+  margin: 0 -22px 18px;
78
+  padding: 12px 22px;
79
+  background: #eadfce;
80
+  border-bottom: 2px solid #d8caba;
71 81
   color: #2f2720;
72 82
   font-size: 22px;
73 83
   line-height: 1.3;
@@ -84,14 +94,21 @@
84 94
   font-size: 14px;
85 95
 }
86 96
 
97
+.section-description {
98
+  margin: 6px 0 0;
99
+  color: #7b6b5c;
100
+  font-size: 14px;
101
+  line-height: 1.6;
102
+}
103
+
87 104
 .form-list {
88
-  width: 100%;
89
-  margin-top: 12px;
105
+  width: min(100%, 620px);
106
+  margin-top: 14px;
90 107
 }
91 108
 
92 109
 .form-row {
93 110
   display: grid;
94
-  grid-template-columns: 140px 1fr;
111
+  grid-template-columns: 150px minmax(0, 1fr);
95 112
   align-items: center;
96 113
   gap: 14px;
97 114
   margin-bottom: 12px;
@@ -129,7 +146,7 @@
129 146
 }
130 147
 
131 148
 .form-row textarea {
132
-  min-height: 104px;
149
+  min-height: 112px;
133 150
   padding: 12px 14px;
134 151
   resize: vertical;
135 152
   line-height: 1.6;
@@ -178,49 +195,9 @@
178 195
   line-height: 1.6;
179 196
 }
180 197
 
181
-.phone-edit-section {
182
-  min-height: 240px;
183
-  padding: 18px 20px;
184
-  border: 2px solid #d8caba;
185
-  border-radius: 8px;
186
-  background: #fffdf9;
187
-  box-sizing: border-box;
188
-}
189
-
190
-.family-edit-guide {
191
-  padding: 18px 22px;
192
-  border: 2px solid #d8caba;
193
-  border-radius: 14px;
194
-  background: #ffffff;
195
-  box-sizing: border-box;
196
-}
197
-
198
-.family-edit-guide ul {
199
-  margin: 0;
200
-  padding-left: 20px;
201
-  color: #7b6b5c;
202
-  font-size: 15px;
203
-  line-height: 2;
204
-}
205
-
206
-.householder-area {
207
-  margin-top: 0;
208
-  padding: 18px 20px;
209
-  border: 2px solid #d8caba;
210
-  border-radius: 8px;
211
-  background: #eadfce;
212
-  box-sizing: border-box;
213
-}
214
-
215
-.householder-area h3 {
216
-  margin: 0 0 12px;
217
-  color: #2f2720;
218
-  font-size: 17px;
219
-  font-weight: 800;
220
-}
221
-
222 198
 .set-householder-button {
223
-  width: 148px;
199
+  width: auto;
200
+  min-width: 170px;
224 201
   height: 46px;
225 202
   border: 2px solid #d8caba;
226 203
   border-radius: 6px;
@@ -241,7 +218,7 @@
241 218
   justify-content: flex-end;
242 219
   align-items: center;
243 220
   gap: 12px;
244
-  margin-top: 26px;
221
+  margin-top: 28px;
245 222
 }
246 223
 
247 224
 .delete-button,

+ 31
- 1
src/app/pages/family-edit/family-edit.ts Wyświetl plik

@@ -9,6 +9,7 @@ import {
9 9
 import { ActivatedRoute, Router, RouterLink } from '@angular/router';
10 10
 import { AppHeader } from '../../share/header/app-header';
11 11
 import { AppSideMenu } from '../../share/side-menu/app-side-menu';
12
+import { DankaService } from '../../services/dankaService';
12 13
 import { FamilyService } from '../../services/family-service';
13 14
 import { MarriageRelationService } from '../../services/marriage-relation-service';
14 15
 import { Danka } from '../../models/danka';
@@ -30,8 +31,10 @@ export class FamilyEdit {
30 31
   relationMode: string = '';
31 32
   baseFamilyId: string = '';
32 33
   marriageErrorMessages: string[] = [];
34
+  private setHouseholderOnSave = false;
33 35
 
34 36
   constructor(
37
+    private dankaService: DankaService,
35 38
     private familyService: FamilyService,
36 39
     private marriageRelationService: MarriageRelationService,
37 40
     private route: ActivatedRoute,
@@ -39,6 +42,7 @@ export class FamilyEdit {
39 42
   ) {
40 43
     this.dankaId = this.route.snapshot.params['dankaId'];
41 44
     this.familyId = this.route.snapshot.params['familyId'];
45
+    this.danka = this.dankaService.getDankaById(this.dankaId);
42 46
     this.families = this.familyService.getFamiliesByDankaId(this.dankaId);
43 47
     this.relationMode = this.route.snapshot.queryParamMap.get('relationMode') ?? '';
44 48
     this.baseFamilyId = this.route.snapshot.queryParamMap.get('baseFamilyId') ?? '';
@@ -193,6 +197,7 @@ export class FamilyEdit {
193 197
     }
194 198
 
195 199
     this.familyService.saveFamily(updatedFamily);
200
+    this.saveHouseholderIfSelected(updatedFamily);
196 201
     this.router.navigate(['/danka-detail', dankaId], { queryParams: { tab: 'family' } });
197 202
   }
198 203
 
@@ -210,5 +215,30 @@ export class FamilyEdit {
210 215
     this.router.navigate(['/danka-detail', dankaId], { queryParams: { tab: 'family' } });
211 216
   }
212 217
 
213
-  setAsHouseholder() {}
218
+  setAsHouseholder(): void {
219
+    this.setHouseholderOnSave = true;
220
+    this.familyForm.patchValue({
221
+      relationship: '施主',
222
+    });
223
+  }
224
+
225
+  private saveHouseholderIfSelected(family: Family): void {
226
+    if (!this.setHouseholderOnSave || !this.danka) {
227
+      return;
228
+    }
229
+
230
+    this.dankaService.saveDanka({
231
+      ...this.danka,
232
+      householder: family.name,
233
+      householderFurigana: family.furigana,
234
+      updatedAt: this.formatDateForSave(new Date()),
235
+    });
236
+  }
237
+
238
+  private formatDateForSave(date: Date): string {
239
+    const year = date.getFullYear();
240
+    const month = String(date.getMonth() + 1).padStart(2, '0');
241
+    const day = String(date.getDate()).padStart(2, '0');
242
+    return `${year}-${month}-${day}`;
243
+  }
214 244
 }

+ 17
- 8
src/app/pages/kakocho-edit/kakocho-edit.scss Wyświetl plik

@@ -2,7 +2,7 @@
2 2
   position: relative;
3 3
   display: block;
4 4
   min-height: 100vh;
5
-  background: #f4eee4;
5
+  background: #f6f0e7;
6 6
   color: #2f2720;
7 7
 }
8 8
 
@@ -11,7 +11,7 @@
11 11
   grid-template-columns: 172px minmax(0, 1fr);
12 12
   gap: 20px;
13 13
   padding: 0 38px 36px 0;
14
-  background: #f4eee4;
14
+  background: #f6f0e7;
15 15
 }
16 16
 
17 17
 .danka-edit-main {
@@ -22,7 +22,7 @@
22 22
 .edit-panel {
23 23
   min-height: 760px;
24 24
   padding: 34px 42px 40px;
25
-  background: #ffffff;
25
+  background: #fffdf9;
26 26
   border: 2px solid #d8caba;
27 27
   border-radius: 64px;
28 28
   box-sizing: border-box;
@@ -55,20 +55,28 @@
55 55
 
56 56
 .edit-content {
57 57
   display: grid;
58
-  grid-template-columns: minmax(0, 1fr) 500px;
59
-  gap: 32px;
58
+  grid-template-columns: minmax(0, 1fr);
59
+  gap: 22px;
60 60
   align-items: start;
61 61
 }
62 62
 
63 63
 .basic-edit-section,
64 64
 .phone-edit-section {
65
-  padding-top: 0;
65
+  overflow: hidden;
66
+  padding: 0 28px 28px;
67
+  border: 2px solid #d8caba;
68
+  border-radius: 12px;
69
+  background: #fffdf9;
70
+  box-sizing: border-box;
66 71
 }
67 72
 
68 73
 .basic-edit-section h2,
69 74
 .phone-edit-section h2,
70 75
 .support-box h2 {
71
-  margin: 0;
76
+  margin: 0 -28px 20px;
77
+  padding: 14px 28px;
78
+  background: #eadfce;
79
+  border-bottom: 2px solid #d8caba;
72 80
   color: #2f2720;
73 81
   font-size: 22px;
74 82
   line-height: 1.3;
@@ -83,7 +91,8 @@
83 91
 
84 92
 /* 蝓コ譛ャ諠・ア */
85 93
 .form-list {
86
-  margin-top: 12px;
94
+  width: min(100%, 980px);
95
+  margin-top: 0;
87 96
 }
88 97
 
89 98
 .form-field {

+ 4
- 0
src/app/pages/kakocho-edit/kakocho-edit.ts Wyświetl plik

@@ -146,6 +146,10 @@ export class KakochoEdit {
146 146
       this.kakochoService.addKakocho(
147 147
         newKakocho
148 148
       );
149
+
150
+      if (this.sourceFamily) {
151
+        this.familyService.deleteFamily(this.sourceFamily.id);
152
+      }
149 153
     }
150 154
 
151 155
     // 一覧へ戻る

Ładowanie…
Anuluj
Zapisz