File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 24
24
<PatientRegistered v-else :new-patient =" newPatient" :sended =" sended" />
25
25
</ModalBase >
26
26
<div class =" searchContainer" >
27
- <SearchField v-model =" inputSearch" />
27
+ <SearchField v-model =" inputSearch" @input = " handleSearch " />
28
28
<SortSelect v-model =" sortSelect" @input =" handleSortSelect" />
29
29
<HiddenSelect v-model =" displaySelect" @input =" handleDisplaySelect" />
30
30
</div >
@@ -191,6 +191,25 @@ export default class CenterId extends Vue {
191
191
this .fetchPatients ()
192
192
}
193
193
194
+ handleSearch(value : string ): void {
195
+ if (value ) {
196
+ if (this .timer ) {
197
+ clearInterval (this .timer )
198
+ }
199
+ patientsStore .load (this .$route .params .centerId ).then ((patients ) => {
200
+ this .patients = patients .filter ((item ) => {
201
+ const pattern = new RegExp (value , ' ig' )
202
+ return item .phone .match (pattern ) || item .memo ?.match (pattern )
203
+ })
204
+ })
205
+ } else {
206
+ this .fetchPatients ()
207
+ this .timer = setInterval (() => {
208
+ this .checkAndFetchPatients ()
209
+ }, 30000 )
210
+ }
211
+ }
212
+
194
213
handleInputTel(): void {
195
214
this .errorMessage = ' '
196
215
}
You can’t perform that action at this time.
0 commit comments