poohr 3 settimane fa
parent
commit
fdd9746ac2

+ 6
- 2
src/app/pages/danka-edit/danka-edit.scss Vedi File

62
 
62
 
63
 .basic-edit-section,
63
 .basic-edit-section,
64
 .phone-edit-section {
64
 .phone-edit-section {
65
-  padding: 26px 28px 28px;
65
+  overflow: hidden;
66
+  padding: 0 28px 28px;
66
   border: 2px solid #d8caba;
67
   border: 2px solid #d8caba;
67
   border-radius: 12px;
68
   border-radius: 12px;
68
   background: #fffdf9;
69
   background: #fffdf9;
72
 .basic-edit-section h2,
73
 .basic-edit-section h2,
73
 .phone-edit-section h2,
74
 .phone-edit-section h2,
74
 .support-box h2 {
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
   color: #2f2720;
80
   color: #2f2720;
77
   font-size: 22px;
81
   font-size: 22px;
78
   line-height: 1.3;
82
   line-height: 1.3;

+ 16
- 18
src/app/pages/family-edit/family-edit.html Vedi File

86
                 </div>
86
                 </div>
87
               </div>
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
                 <div class="form-field">
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
                 </div>
97
                 </div>
97
               </div>
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
               <div class="form-row">
109
               <div class="form-row">
100
                 <label for="fatherId">父</label>
110
                 <label for="fatherId">父</label>
101
                 <div class="form-field">
111
                 <div class="form-field">
167
 
177
 
168
             </div>
178
             </div>
169
           </section>
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
         </div>
180
         </div>
183
 
181
 
184
         <div class="bottom-actions">
182
         <div class="bottom-actions">

+ 32
- 55
src/app/pages/family-edit/family-edit.scss Vedi File

2
   position: relative;
2
   position: relative;
3
   display: block;
3
   display: block;
4
   min-height: 100vh;
4
   min-height: 100vh;
5
-  background: #f4eee4;
5
+  background: #f6f0e7;
6
   color: #2f2720;
6
   color: #2f2720;
7
 }
7
 }
8
 
8
 
11
   grid-template-columns: 172px minmax(0, 1fr);
11
   grid-template-columns: 172px minmax(0, 1fr);
12
   gap: 20px;
12
   gap: 20px;
13
   padding: 0 38px 36px 0;
13
   padding: 0 38px 36px 0;
14
-  background: #f4eee4;
14
+  background: #f6f0e7;
15
 }
15
 }
16
 
16
 
17
 .danka-edit-main {
17
 .danka-edit-main {
22
 .edit-panel {
22
 .edit-panel {
23
   min-height: 760px;
23
   min-height: 760px;
24
   padding: 34px 42px 40px;
24
   padding: 34px 42px 40px;
25
-  background: #ffffff;
25
+  background: #fffdf9;
26
   border: 2px solid #d8caba;
26
   border: 2px solid #d8caba;
27
   border-radius: 64px;
27
   border-radius: 64px;
28
   box-sizing: border-box;
28
   box-sizing: border-box;
56
 
56
 
57
 .edit-content {
57
 .edit-content {
58
   display: grid;
58
   display: grid;
59
-  grid-template-columns: minmax(0, 1fr) 500px;
60
-  gap: 32px;
59
+  grid-template-columns: 1fr;
60
+  gap: 16px;
61
   align-items: start;
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
 .basic-edit-section h2,
74
 .basic-edit-section h2,
75
+.family-tree-edit-section h2,
69
 .section-heading h2 {
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
   color: #2f2720;
81
   color: #2f2720;
72
   font-size: 22px;
82
   font-size: 22px;
73
   line-height: 1.3;
83
   line-height: 1.3;
84
   font-size: 14px;
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
 .form-list {
104
 .form-list {
88
-  width: 100%;
89
-  margin-top: 12px;
105
+  width: min(100%, 620px);
106
+  margin-top: 14px;
90
 }
107
 }
91
 
108
 
92
 .form-row {
109
 .form-row {
93
   display: grid;
110
   display: grid;
94
-  grid-template-columns: 140px 1fr;
111
+  grid-template-columns: 150px minmax(0, 1fr);
95
   align-items: center;
112
   align-items: center;
96
   gap: 14px;
113
   gap: 14px;
97
   margin-bottom: 12px;
114
   margin-bottom: 12px;
129
 }
146
 }
130
 
147
 
131
 .form-row textarea {
148
 .form-row textarea {
132
-  min-height: 104px;
149
+  min-height: 112px;
133
   padding: 12px 14px;
150
   padding: 12px 14px;
134
   resize: vertical;
151
   resize: vertical;
135
   line-height: 1.6;
152
   line-height: 1.6;
178
   line-height: 1.6;
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
 .set-householder-button {
198
 .set-householder-button {
223
-  width: 148px;
199
+  width: auto;
200
+  min-width: 170px;
224
   height: 46px;
201
   height: 46px;
225
   border: 2px solid #d8caba;
202
   border: 2px solid #d8caba;
226
   border-radius: 6px;
203
   border-radius: 6px;
241
   justify-content: flex-end;
218
   justify-content: flex-end;
242
   align-items: center;
219
   align-items: center;
243
   gap: 12px;
220
   gap: 12px;
244
-  margin-top: 26px;
221
+  margin-top: 28px;
245
 }
222
 }
246
 
223
 
247
 .delete-button,
224
 .delete-button,

+ 31
- 1
src/app/pages/family-edit/family-edit.ts Vedi File

9
 import { ActivatedRoute, Router, RouterLink } from '@angular/router';
9
 import { ActivatedRoute, Router, RouterLink } from '@angular/router';
10
 import { AppHeader } from '../../share/header/app-header';
10
 import { AppHeader } from '../../share/header/app-header';
11
 import { AppSideMenu } from '../../share/side-menu/app-side-menu';
11
 import { AppSideMenu } from '../../share/side-menu/app-side-menu';
12
+import { DankaService } from '../../services/dankaService';
12
 import { FamilyService } from '../../services/family-service';
13
 import { FamilyService } from '../../services/family-service';
13
 import { MarriageRelationService } from '../../services/marriage-relation-service';
14
 import { MarriageRelationService } from '../../services/marriage-relation-service';
14
 import { Danka } from '../../models/danka';
15
 import { Danka } from '../../models/danka';
30
   relationMode: string = '';
31
   relationMode: string = '';
31
   baseFamilyId: string = '';
32
   baseFamilyId: string = '';
32
   marriageErrorMessages: string[] = [];
33
   marriageErrorMessages: string[] = [];
34
+  private setHouseholderOnSave = false;
33
 
35
 
34
   constructor(
36
   constructor(
37
+    private dankaService: DankaService,
35
     private familyService: FamilyService,
38
     private familyService: FamilyService,
36
     private marriageRelationService: MarriageRelationService,
39
     private marriageRelationService: MarriageRelationService,
37
     private route: ActivatedRoute,
40
     private route: ActivatedRoute,
39
   ) {
42
   ) {
40
     this.dankaId = this.route.snapshot.params['dankaId'];
43
     this.dankaId = this.route.snapshot.params['dankaId'];
41
     this.familyId = this.route.snapshot.params['familyId'];
44
     this.familyId = this.route.snapshot.params['familyId'];
45
+    this.danka = this.dankaService.getDankaById(this.dankaId);
42
     this.families = this.familyService.getFamiliesByDankaId(this.dankaId);
46
     this.families = this.familyService.getFamiliesByDankaId(this.dankaId);
43
     this.relationMode = this.route.snapshot.queryParamMap.get('relationMode') ?? '';
47
     this.relationMode = this.route.snapshot.queryParamMap.get('relationMode') ?? '';
44
     this.baseFamilyId = this.route.snapshot.queryParamMap.get('baseFamilyId') ?? '';
48
     this.baseFamilyId = this.route.snapshot.queryParamMap.get('baseFamilyId') ?? '';
193
     }
197
     }
194
 
198
 
195
     this.familyService.saveFamily(updatedFamily);
199
     this.familyService.saveFamily(updatedFamily);
200
+    this.saveHouseholderIfSelected(updatedFamily);
196
     this.router.navigate(['/danka-detail', dankaId], { queryParams: { tab: 'family' } });
201
     this.router.navigate(['/danka-detail', dankaId], { queryParams: { tab: 'family' } });
197
   }
202
   }
198
 
203
 
210
     this.router.navigate(['/danka-detail', dankaId], { queryParams: { tab: 'family' } });
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 Vedi File

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

+ 4
- 0
src/app/pages/kakocho-edit/kakocho-edit.ts Vedi File

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

Loading…
Annulla
Salva