33 <div >
44
55 <div class =" flex flex-row" >
6- <!-- button group -->
7- <div v-if =" $parent.$props.config.toolbar && $parent.$props.config.toolbar.show != false" class =" my-2 ml-2 bg-gray-100 w-38 p-2 rounded-lg flex flex-row justify-center items-center" >
8- <div v-if =" !$parent.$props.config.toolbar.hasOwnProperty('delete') || $parent.$props.config.toolbar.delete.show != false" > <i @click =" deleteElements()" class =" confirm text-gray-500 far fa-trash-alt cursor-pointer hover:text-red-500 transition-colors duration-150 " ></i ></div >
9- <!-- <div><i @click="edit()" class="ml-2 text-gray-500 far fa-edit cursor-pointer hover:text-blue-500 transition-colors duration-150 "></i></div>-->
10- <!-- <div><i @click="exportElements()" class="ml-2 text-gray-500 fas fa-file-export cursor-pointer hover:text-green-500 transition-colors duration-150 "></i></div>-->
11- </div >
6+ <!-- button group -->
7+ <div v-if =" $parent.$props.config.toolbar && $parent.$props.config.toolbar.show != false" class =" my-2 ml-2 bg-gray-100 w-38 p-2 rounded-lg flex flex-row justify-center items-center" >
8+ <div v-if =" !$parent.$props.config.toolbar.hasOwnProperty('delete') || $parent.$props.config.toolbar.delete.show != false" > <i @click =" deleteElements()" class =" confirm text-gray-500 far fa-trash-alt cursor-pointer hover:text-red-500 transition-colors duration-150 " ></i ></div >
9+ <!-- <div><i @click="edit()" class="ml-2 text-gray-500 far fa-edit cursor-pointer hover:text-blue-500 transition-colors duration-150 "></i></div>-->
10+ <!-- <div><i @click="exportElements()" class="ml-2 text-gray-500 fas fa-file-export cursor-pointer hover:text-green-500 transition-colors duration-150 "></i></div>-->
11+ </div >
1212
1313
14- <!-- per page selection -->
15- <div v-if =" !$parent.$props.hasOwnProperty('perPage') || $parent.$props.perPage.show != false" class =" my-2 ml-2 bg-gray-100 w-40 p-2 rounded-lg flex flex-row justify-center items-center" >
16- <div class =" w-full " >Per Page </div >
17- <div class =" relative w-full" >
18- <select @change =" rowsChange()" v-model =" perPage" class =" focus:ring-blue-400 focus:border-blue-400 block appearance-none w-full bg-white border border-gray-400 hover:border-gray-500 px-4 py-2 pr-8 rounded shadow leading-tight focus:outline-none focus:shadow-outline" >
19- <option v-for =" page in $parent.perPage.counts" :value =" page" >{{ page }}</option >
14+ <!-- per page selection -->
15+ <div v-if =" !$parent.$props.hasOwnProperty('perPage') || $parent.$props.perPage.show != false" class =" my-2 ml-2 bg-gray-100 w-40 p-2 rounded-lg flex flex-row justify-center items-center shadow-lg " >
16+ <div class =" w-full " >{{trans('perPage')}} </div >
17+ <div class =" relative w-full" >
18+ <select @change =" rowsChange()" v-model =" perPage" class =" focus:ring-blue-400 focus:border-blue-400 block appearance-none w-full bg-white border border-gray-400 hover:border-gray-500 px-4 py-2 pr-8 rounded shadow leading-tight focus:outline-none focus:shadow-outline" >
19+ <option v-for =" page in $parent.perPage.counts" :value =" page" >{{ page }}</option >
2020
21- </select >
21+ </select >
2222
23+ </div >
2324 </div >
24- </div >
2525
2626 </div >
2727
3535 <select v-model =" filtration.selectVal[select.label]"
3636
3737 @change =" filter().select( {
38- relation : select.relation,
38+ type : select.type || 'normal',
39+ relation : select.relation || null,
40+ searchColumn : select.searchColumn || null,
3941 value : filtration.selectVal[select.label],
4042 }, select.label)"
4143
42- class =" focus:ring-blue-400 focus:border-blue-400 block appearance-none w-full bg-white border border-gray-400 hover:border-gray-500 px-4 py-2 pr-8 rounded shadow leading-tight focus:outline-none focus:shadow-outline" >
44+ class =" focus:ring-blue-400 focus:border-blue-400 block appearance-none w-full bg-white border border-gray-400 hover:border-gray-500 px-4 py-2 pr-8 rounded shadow leading-tight focus:outline-none focus:shadow-outline" >
4345 <option selected value =" " > All </option >
44- <option v-for =" (model, index) in select.rows" :value =" model['id']" > {{ model[select.column] }} </option >
46+ <option v-for =" (model, index) in select.rows" :value =" model[select.searchColumn.split('.').length > 1 ? select.searchColumn.split('.')[1] : select.searchColumn] ? model[select.searchColumn.split('.').length > 1 ? select.searchColumn.split('.')[1] : select.searchColumn] : model[ 'id']" > {{ model[select.column] }} </option >
4547
4648 </select >
4749
@@ -65,6 +67,15 @@ export default {
6567 props: [' list' ],
6668 data : function (){
6769 return {
70+ language: {
71+ ar: {
72+ perPage: " كل صفحة" ,
73+
74+ },
75+ en: {
76+ perPage: " Per Pae" ,
77+ },
78+ },
6879 perPage: 10 ,
6980 filtration: {
7081 select: {},
@@ -75,7 +86,7 @@ export default {
7586
7687 methods: {
7788 deleteElements : function (){
78- if (this .checkList ()) return ;
89+ if (this .checkList ()) return ;
7990
8091 this .destroy ();
8192
@@ -119,7 +130,7 @@ export default {
119130 return {
120131 select : (model , label )=> {
121132 this .filtration .select [label] = model;
122- this .$parent .$data .requests .relations = this .filtration .select ;
133+ this .$parent .$data .requests .select = this .filtration .select ;
123134 this .$parent .all ();
124135 }
125136
@@ -131,14 +142,13 @@ export default {
131142 this .$parent .$data .dataAlert .setShow ().setStatus (' error' ).setMessage ( ' you didn\' t Selected any element' ).hide (5000 );
132143 return true ;
133144 }
134- return false ;
145+ return false ;
135146 },
136147 removeAllSelection : function (){
137148 this .$parent .selectedAll ? this .$parent .removeSelection () : ' ' ;
138149 },
139150
140151 }
141152
142-
143153}
144154 </script >
0 commit comments