File tree Expand file tree Collapse file tree
resources/js/components/requests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 hide-footer
99 :title =" $t('New Case')"
1010 :size =" size"
11+ @hidden =" hideModal"
1112 >
1213 <progress-loader
1314 ref =" progressLoader"
@@ -171,10 +172,21 @@ export default {
171172 },
172173 showModal () {
173174 this .loaded = true ;
174- // Perform initial load of requests from backend
175175 this .$refs .requestModalAdd .show ();
176176 this .fetch ();
177177 },
178+ hideModal () {
179+ this .loaded = false ;
180+ this .filter = " " ;
181+ this .error = false ;
182+ this .processes = {};
183+ this .page = 1 ;
184+ this .perPage = 15 ;
185+ const pagination = this .$refs .listProcess ;
186+ if (pagination && String (pagination .perPage ) !== " 15" ) {
187+ pagination .perPage = " 15" ;
188+ }
189+ },
178190 // Overwrite handler to change the page based on events fired
179191 onPageChange : function onPageChange (page ) {
180192 if (page === " next" ) {
@@ -192,6 +204,19 @@ export default {
192204 }
193205 this .fetch ();
194206 },
207+ changePerPage (value ) {
208+ const perPage = Number (value);
209+ this .perPage = perPage;
210+ const pagination = this .$refs .listProcess ? this .$refs .listProcess .tablePagination : null ;
211+ const total = pagination && pagination .total ? pagination .total : 0 ;
212+ if (total > 0 && this .page * perPage > total) {
213+ this .page = Math .ceil (total / perPage);
214+ }
215+ if (this .page <= 0 ) {
216+ this .page = 1 ;
217+ }
218+ this .fetch ();
219+ },
195220 fetch () {
196221 if (! this .loaded ) {
197222 return ;
You can’t perform that action at this time.
0 commit comments