|
17 | 17 |
|
18 | 18 | <template> |
19 | 19 | <div> |
20 | | - <a-card class="mobile-breadcrumb" v-if="device === 'mobile'"> |
21 | | - <breadcrumb /> |
22 | | - </a-card> |
23 | | - <a-row> |
24 | | - <a-col :span="18"> |
25 | | - <span |
26 | | - v-for="(action, actionIndex) in actions" |
27 | | - :key="actionIndex"> |
28 | | - <a-tooltip |
29 | | - placement="bottom" |
30 | | - v-if="action.api in $store.getters.apis && |
31 | | - ((!dataView && (action.listView || action.groupAction && selectedRowKeys.length > 0)) || |
32 | | - (dataView && action.dataView && ('show' in action ? action.show(resource) : true)))"> |
33 | | - <template slot="title"> |
34 | | - {{ $t(action.label) }} |
35 | | - </template> |
36 | | - <a-button |
37 | | - :icon="action.icon" |
38 | | - :type="action.icon === 'delete' ? 'danger' : (action.icon === 'plus' ? 'primary' : 'default')" |
39 | | - shape="circle" |
40 | | - style="margin-right: 5px" |
41 | | - @click="execAction(action)" |
42 | | - > |
43 | | - </a-button> |
44 | | - </a-tooltip> |
45 | | - </span> |
46 | | - <span v-if="!dataView" style="float: right; padding-right: 8px; margin-top: -2px"> |
47 | | - <a-tooltip placement="bottom"> |
48 | | - <template slot="title"> |
49 | | - {{ "Auto-Refresh" }} |
50 | | - </template> |
51 | | - <a-switch |
52 | | - style="margin: 8px;" |
53 | | - :loading="loading" |
54 | | - :checked="autoRefresh" |
55 | | - @change="toggleAutoRefresh" |
56 | | - /> |
57 | | - </a-tooltip> |
58 | | - <a-tooltip placement="bottom"> |
59 | | - <template slot="title"> |
60 | | - {{ "Refresh" }} |
61 | | - </template> |
62 | | - <a-button |
63 | | - @click="fetchData()" |
64 | | - :loading="loading" |
65 | | - shape="circle" |
66 | | - icon="reload" |
67 | | - /> |
68 | | - </a-tooltip> |
69 | | - </span> |
70 | | - </a-col> |
71 | | - <a-col :span="6"> |
72 | | - <a-tooltip placement="bottom" v-if="dataView"> |
73 | | - <template slot="title"> |
74 | | - {{ "Refresh" }} |
75 | | - </template> |
76 | | - <a-button |
77 | | - style="float: right" |
78 | | - @click="fetchData()" |
79 | | - :loading="loading" |
80 | | - shape="circle" |
81 | | - icon="reload" |
82 | | - /> |
83 | | - </a-tooltip> |
84 | | - <a-tooltip placement="bottom" v-if="dataView"> |
85 | | - <template slot="title"> |
86 | | - {{ "Auto-Refresh" }} |
87 | | - </template> |
88 | | - <a-switch |
89 | | - v-if="dataView" |
90 | | - style="float: right; margin: 5px;" |
91 | | - :loading="loading" |
92 | | - :checked="autoRefresh" |
93 | | - @change="toggleAutoRefresh" |
94 | | - /> |
95 | | - </a-tooltip> |
| 20 | + <a-card class="mobile-breadcrumb"> |
| 21 | + <a-row> |
| 22 | + <a-col :span="24" style="display: inline-flex"> |
| 23 | + <breadcrumb style="margin-right: 10px; width: 100%" @refresh="fetchData()" /> |
| 24 | + <span |
| 25 | + v-for="(action, actionIndex) in actions" |
| 26 | + :key="actionIndex"> |
| 27 | + <a-tooltip |
| 28 | + placement="bottom" |
| 29 | + v-if="action.api in $store.getters.apis && |
| 30 | + ((!dataView && (action.listView || action.groupAction && selectedRowKeys.length > 0)) || |
| 31 | + (dataView && action.dataView && ('show' in action ? action.show(resource) : true)))"> |
| 32 | + <template slot="title"> |
| 33 | + {{ $t(action.label) }} |
| 34 | + </template> |
| 35 | + <a-button |
| 36 | + :icon="action.icon" |
| 37 | + :type="action.icon === 'delete' ? 'danger' : (action.icon === 'plus' ? 'primary' : 'default')" |
| 38 | + shape="circle" |
| 39 | + style="margin-right: 5px" |
| 40 | + @click="execAction(action)" |
| 41 | + > |
| 42 | + </a-button> |
| 43 | + </a-tooltip> |
| 44 | + </span> |
96 | 45 |
|
97 | | - <a-input-search |
98 | | - size="default" |
99 | | - placeholder="Search" |
100 | | - v-model="searchQuery" |
101 | | - v-if="!dataView" |
102 | | - @search="onSearch" |
103 | | - > |
104 | | - </a-input-search> |
105 | | - </a-col> |
106 | | - </a-row> |
| 46 | + <a-input-search |
| 47 | + style="width: 100%; padding-left: 5px" |
| 48 | + size="default" |
| 49 | + placeholder="Search" |
| 50 | + v-model="searchQuery" |
| 51 | + v-if="!dataView" |
| 52 | + @search="onSearch" |
| 53 | + > |
| 54 | + </a-input-search> |
| 55 | + </a-col> |
| 56 | + <a-col :span="24" v-if="false"> |
| 57 | + <span |
| 58 | + v-for="(action, actionIndex) in actions" |
| 59 | + :key="actionIndex"> |
| 60 | + <a-tooltip |
| 61 | + placement="bottom" |
| 62 | + v-if="action.api in $store.getters.apis && |
| 63 | + ((!dataView && (action.listView || action.groupAction && selectedRowKeys.length > 0)) || |
| 64 | + (dataView && action.dataView && ('show' in action ? action.show(resource) : true)))"> |
| 65 | + <template slot="title"> |
| 66 | + {{ $t(action.label) }} |
| 67 | + </template> |
| 68 | + <a-button |
| 69 | + :icon="action.icon" |
| 70 | + :type="action.icon === 'delete' ? 'danger' : (action.icon === 'plus' ? 'primary' : 'default')" |
| 71 | + shape="circle" |
| 72 | + style="margin-right: 5px" |
| 73 | + @click="execAction(action)" |
| 74 | + > |
| 75 | + </a-button> |
| 76 | + </a-tooltip> |
| 77 | + </span> |
| 78 | + </a-col> |
| 79 | + </a-row> |
| 80 | + </a-card> |
107 | 81 |
|
108 | 82 | <div v-show="showAction"> |
109 | 83 | <keep-alive v-if="currentAction.component"> |
@@ -244,7 +218,6 @@ export default { |
244 | 218 | return { |
245 | 219 | apiName: '', |
246 | 220 | loading: false, |
247 | | - autoRefresh: false, |
248 | 221 | columns: [], |
249 | 222 | items: [], |
250 | 223 | itemCount: 0, |
@@ -418,21 +391,6 @@ export default { |
418 | 391 | this.searchQuery = value |
419 | 392 | this.fetchData() |
420 | 393 | }, |
421 | | - toggleAutoRefresh () { |
422 | | - this.autoRefresh = !this.autoRefresh |
423 | | - this.doRefresh() |
424 | | - }, |
425 | | - doRefresh () { |
426 | | - if (!this.autoRefresh) { |
427 | | - return |
428 | | - } |
429 | | - const doRefresh = this.doRefresh |
430 | | - const fetchData = this.fetchData |
431 | | - setTimeout(function () { |
432 | | - fetchData() |
433 | | - doRefresh() |
434 | | - }, 5000) |
435 | | - }, |
436 | 394 | closeAction () { |
437 | 395 | this.currentAction.loading = false |
438 | 396 | this.showAction = false |
@@ -626,8 +584,8 @@ export default { |
626 | 584 | <style scoped> |
627 | 585 |
|
628 | 586 | .mobile-breadcrumb { |
629 | | - margin-left: -16px; |
630 | | - margin-right: -16px; |
| 587 | + margin-left: -24px; |
| 588 | + margin-right: -24px; |
631 | 589 | margin-top: -16px; |
632 | 590 | margin-bottom: 12px; |
633 | 591 | } |
|
0 commit comments