9
9
<th >脈拍</th >
10
10
<th class =" alignLeft" style =" padding-left : 20px " >症状</th >
11
11
<th class =" alignLeft" >症状</th >
12
+ <th ></th >
12
13
</tr >
13
14
</thead >
14
15
<tbody >
59
60
</div >
60
61
</td >
61
62
<td >{{ item.symptom.remarks }}</td >
63
+ <td >
64
+ <DeleteIcon class =" icon" @click =" showModal = true" />
65
+ <ModalBase :show =" showModal" @close =" showModal = false" >
66
+ <h2 >記録を削除する</h2 >
67
+ <p >この記録を削除してもよろしいですか?</p >
68
+ <div class =" buttonContainer" >
69
+ <ActionButton
70
+ class =" button"
71
+ theme =" primary"
72
+ size =" L"
73
+ @click =" deleteStatus(item.statusId)"
74
+ >
75
+ はい
76
+ </ActionButton >
77
+ <ActionButton
78
+ class =" button"
79
+ theme =" outline"
80
+ size =" L"
81
+ @click =" showModal = false"
82
+ >
83
+ いいえ
84
+ </ActionButton >
85
+ </div >
86
+ <p v-if =" message" >{{ message }}</p >
87
+ </ModalBase >
88
+ </td >
62
89
</tr >
63
90
</tbody >
64
91
</table >
@@ -70,13 +97,24 @@ import { Component, Prop, Vue } from 'vue-property-decorator'
70
97
import dayjs from ' dayjs'
71
98
import { Status } from ' @/types/component-interfaces/status'
72
99
import SymptomsStatusText from ' @/components/SymptomsStatusText.vue'
100
+ import ModalBase from ' @/components/ModalBase.vue'
101
+ import DeleteIcon from ' @/static/icon-delete.svg'
102
+ import { statusesStore } from ' @/store'
73
103
74
104
@Component ({
75
105
components: {
76
106
SymptomsStatusText ,
107
+ ModalBase ,
108
+ DeleteIcon ,
77
109
},
78
110
})
79
111
export default class SymptomsHistory extends Vue {
112
+ message = ' '
113
+ showModal = false
114
+
115
+ @Prop ()
116
+ patientId! : string
117
+
80
118
@Prop ({ default: [] })
81
119
statuses! : Status []
82
120
@@ -98,6 +136,19 @@ export default class SymptomsHistory extends Vue {
98
136
getDate(date : string ): string {
99
137
return dayjs (date ).format (' M/D (ddd) HH:mm' )
100
138
}
139
+
140
+ deleteStatus(id : string ): void {
141
+ statusesStore
142
+ .delete ({ patientId: this .patientId , statusId: id })
143
+ .then ((result ) => {
144
+ if (result === true ) {
145
+ this .showModal = false
146
+ this .$emit (' on-deleted' )
147
+ } else {
148
+ this .message = ` 削除に失敗しました。${result } `
149
+ }
150
+ })
151
+ }
101
152
}
102
153
</script >
103
154
@@ -116,7 +167,7 @@ export default class SymptomsHistory extends Vue {
116
167
}
117
168
.symptomsHistoryRow {
118
169
display : grid ;
119
- grid-template-columns : 9em 5em 5em 5em 1fr 28% ;
170
+ grid-template-columns : 9em 5em 5em 5em 1fr 28% 2 em ;
120
171
grid-template-rows : auto ;
121
172
padding : 0 12px 0 0 ;
122
173
td ,
@@ -145,4 +196,16 @@ export default class SymptomsHistory extends Vue {
145
196
.alerted {
146
197
color : $error ;
147
198
}
199
+ .icon {
200
+ cursor : pointer ;
201
+ fill : $gray-2 ;
202
+ }
203
+ .buttonContainer {
204
+ display : flex ;
205
+ justify-content : space-between ;
206
+ margin : 40px 0 30px ;
207
+ }
208
+ .button {
209
+ flex : 0 0 46% ;
210
+ }
148
211
</style >
0 commit comments