1
1
<script >
2
2
import DatasourceUtils from ' ../utils/DatasourceUtils'
3
3
import Pagination from ' ./Pagination.vue'
4
- import { EventBus } from ' ../utils/EventBus'
4
+ import {EventBus } from ' ../utils/EventBus'
5
5
export default {
6
6
name: ' ServerDatasource' ,
7
7
components: {Pagination},
@@ -12,13 +12,13 @@ export default {
12
12
< div class = " panel-heading" >
13
13
< div class = " form-inline" >
14
14
< div class = " form-group pull-left" >
15
- < label class = " control-label pr2" > { this .translation .limit }< / label>
16
- < select on- change= { (e ) => this .sync (' perpage' , parseInt (e .target .value )) } class = " form-control" number>
17
- { this .limitOptions }
15
+ < label class = " control-label pr2" > {this .translation .limit }< / label>
16
+ < select on- change= {(e ) => this .sync (' perpage' , parseInt (e .target .value ))} class = " form-control" number>
17
+ {this .limitOptions }
18
18
< / select>
19
19
< / div>
20
20
< div class = " form-group pull-right" >
21
- < input class = " form-control mr1" type= " text" on- input= { (e ) => this .searching (e) } placeholder= {this .translation .placeholder_search } / >
21
+ < input class = " form-control mr1" type= " text" on- input= {(e ) => this .searching (e)} placeholder= {this .translation .placeholder_search } / >
22
22
< / div>
23
23
< div class = " clearfix" >< / div>
24
24
< / div>
@@ -27,23 +27,23 @@ export default {
27
27
< table class = " table table-striped" >
28
28
< thead>
29
29
< tr>
30
- { this .columnItems }
30
+ {this .columnItems }
31
31
< / tr>
32
32
< / thead>
33
33
< tbody>
34
- { this .columnObjects }
34
+ {this .columnObjects }
35
35
< tr>
36
- < td class = " text-center warning" colspan= { this .columns .length }> { this .tableInfo }< / td>
36
+ < td class = " text-center warning" colspan= {this .columns .length }> {this .tableInfo }< / td>
37
37
< / tr>
38
38
< / tbody>
39
39
< / table>
40
40
< / div>
41
41
< div class = " panel-footer" >
42
42
< div class = " pull-left btn-group btn-group-actions" >
43
- { this .actionsObject }
43
+ {this .actionsObject }
44
44
< / div>
45
45
< div class = " pull-right" >
46
- < pagination pages= { this .pagination }>< / pagination>
46
+ < pagination pages= {this .pagination }>< / pagination>
47
47
< / div>
48
48
< div class = " clearfix" >< / div>
49
49
< / div>
@@ -131,35 +131,35 @@ export default {
131
131
computed: {
132
132
limitOptions () {
133
133
return this .limits .map ((limit , index ) => {
134
- return < option value= { limit } selected= { parseInt (this .perpage ) === parseInt (limit) }> { limit }< / option>
134
+ return < option value= {limit} selected= {parseInt (this .perpage ) === parseInt (limit)}> {limit}< / option>
135
135
})
136
136
},
137
137
columnItems () {
138
138
return this .columns .map ((column , index ) => {
139
- return < th> { column .name }< / th>
139
+ return < th> {column .name }< / th>
140
140
})
141
141
},
142
142
columnObjects () {
143
143
if (this .source .length === 0 ) {
144
144
return < tr class = " text-center" >
145
- < td colspan= { this .columns .length }> { this .translation .records_not_found }< / td>
145
+ < td colspan= {this .columns .length }> {this .translation .records_not_found }< / td>
146
146
< / tr>
147
147
} else {
148
148
return this .source .map ((row , index ) => {
149
149
let columns = this .columns .map ((column , index ) => {
150
- return < td domPropsInnerHTML = { this .fetchFromObject (row, column .key , column .render ) } > </ td>
150
+ return < td> { this .fetchFromObject (row, column .key , column .render )} < / td>
151
151
})
152
- return < tr class = {{ success: index === this .indexSelected }} on- click= { (e ) => this .selectRow (e, row, index) }> { columns }< / tr>
152
+ return < tr class = {{success: index === this .indexSelected }} on- click= {(e ) => this .selectRow (e, row, index)}> {columns}< / tr>
153
153
})
154
154
}
155
155
},
156
156
actionsObject () {
157
157
return this .actions .map ((action , index ) => {
158
158
try {
159
159
if (action .show (this .selected )) {
160
- return < button class = {this .dynamicClass (' btn' , action .class )} type= " button" on- click= { (e ) => action .event (e, this .selected ) }>
161
- < i class = { this .dynamicClass (' pr1' , action .icon ) }>< / i>
162
- { action .text }
160
+ return < button class = {this .dynamicClass (' btn' , action .class )} type= " button" on- click= {(e ) => action .event (e, this .selected )}>
161
+ < i class = {this .dynamicClass (' pr1' , action .icon )}>< / i>
162
+ {action .text }
163
163
< / button>
164
164
}
165
165
} catch (ex) {
0 commit comments