Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. <template>
  2. <v-card id="transcard" class="elevation-0">
  3. <v-card-title class="pl-0">
  4. <div class="display-1-custom mb-0">{{text}}</div>
  5. </v-card-title>
  6. <v-divider class="mb-5">
  7. </v-divider>
  8. <v-container grid-list-md text-xs-center>
  9. <v-layout row wrap>
  10. <v-flex xs12 sm5 lg5 xl5 class="pb-3">
  11. <v-text-field color="blue lighten-1" solo append-icon="search" :label="$t('search')" v-model="search" class="pl-0 elevation-0"></v-text-field>
  12. </v-flex>
  13. <v-spacer></v-spacer>
  14. <v-btn color="accent_two" class="mt-3 elevation-0" dark slot="activator" @click.native="downloadCSV">
  15. <v-icon>get_app</v-icon>
  16. </v-btn>
  17. <v-btn color="primary" class="mt-3 elevation-0" dark slot="activator" @click.native="goToForm">
  18. <v-icon>add</v-icon>
  19. </v-btn>
  20.  
  21. <v-dialog v-model="dialog" persistent max-width="290">
  22. <v-btn color="red lighten-1" class="mt-3 elevation-0" dark slot="activator">
  23. <v-icon>delete</v-icon>
  24. </v-btn>
  25. <v-card>
  26. <v-card-title class="headline">{{$t('delete_row')}}</v-card-title>
  27. <v-card-text>{{$t('delete_row_description')}}</v-card-text>
  28. <v-card-actions>
  29. <v-spacer></v-spacer>
  30. <v-btn color="secondary" flat @click.native="dialog = false">{{$t('cancel')}}</v-btn>
  31. <v-btn color="primary" flat @click.native="processDelete()">{{$t('confirm')}}</v-btn>
  32. </v-card-actions>
  33. </v-card>
  34. </v-dialog>
  35.  
  36. </v-layout>
  37. </v-container>
  38. <v-data-table v-bind:headers="headers" select-all item-key="id" v-model="selected" :items="items" class="elevation-0" v-bind:search="search" :rows-per-page-text="$t('rows_per_page_text')" :no-data-text="$t('no_datatable_data')" :no-results-text="$t('no_results_found')">
  39. <template slot="headerCell" slot-scope="props">
  40. <v-tooltip bottom>
  41. <span slot="activator">
  42. {{ props.header.text }}
  43. </span>
  44. <span>
  45. {{ props.header.text }}
  46. </span>
  47. </v-tooltip>
  48. </template>
  49.  
  50. <template slot="items" slot-scope="props">
  51. <tr :active="props.selected" @click="props.selected = !props.selected">
  52. <td class="text-xs-center">
  53. <v-checkbox
  54. :input-value="props.selected"
  55. primary
  56. light
  57. hide-details
  58. ></v-checkbox>
  59. </td>
  60.  
  61. <td class="text-xs-center" v-for="item in props.item">
  62. {{ item }}
  63. </td>
  64. <td class="text-xs-center">
  65. <v-btn icon @click.native="processEdit(props.item)">
  66. <v-icon color="orange accent-2">mode_edit</v-icon>
  67. </v-btn>
  68. </td>
  69. </tr>
  70. </template>
  71. <template slot="pageText" slot-scope="props">
  72. {{ props.pageStart }} - {{ props.pageStop }} {{$t('of')}} {{ props.itemsLength }}
  73. </template>
  74. </v-data-table>
  75. </v-card>
  76. </template>
  77.  
  78. <script>
  79. export default {
  80. name: "ListWithFormEvents",
  81. data() {
  82. return {
  83. search: "",
  84. data: "",
  85. selected: [],
  86. dialog: false
  87. };
  88. },
  89. methods: {
  90. processEdit(data) {
  91. this.$emit("editData", data);
  92. },
  93. processDelete() {
  94. this.dialog = false;
  95. this.$emit("deleteData", this.selected);
  96. },
  97. goToForm() {
  98. this.$emit("goToForm");
  99. },
  100. downloadCSV() {
  101. this.$emit("download");
  102. }
  103. },
  104. props: ["text", "items", "headers"]
  105. };
  106. </script>
  107.  
  108. <style>
  109. #transcard {
  110. background: transparent;
  111. }
  112.  
  113. #transcard .container.grid-list-md {
  114. padding-left: 0px;
  115. padding-right: 0px;
  116. }
  117.  
  118. table.table tbody td,
  119. .datatable__actions {
  120. font-size: 14px;
  121. border-bottom: 1px solid #dbe4e8;
  122. color: #4a5961;
  123. font-family: "Quicksand";
  124. background: #fff;
  125. }
  126.  
  127. .application .theme--light.datatable .datatable__actions,
  128. .theme--light .datatable .datatable__actions {
  129. border-top: none;
  130. border-bottom: none;
  131. }
  132.  
  133. .table.table {
  134. border: none;
  135. background: #7460ee;
  136. }
  137.  
  138. .table.table thead th {
  139. font-size: 15px;
  140. font-family: "Nunito";
  141. color: #fff;
  142. font-weight: 600;
  143. text-align: center !important;
  144. }
  145. .application
  146. .thead
  147. .theme--light.input-group--selection-controls
  148. .icon--selection-control,
  149. .theme--light .input-group--selection-controls .icon--selection-control {
  150. color: #fff;
  151. }
  152. .application
  153. .thead
  154. .theme--light.input-group--selection-controls.input-group--active
  155. .icon--selection-control,
  156. .theme--light
  157. .input-group--selection-controls.input-group--active
  158. .icon--selection-control {
  159. color: #fff;
  160. }
  161. .application .theme--light.input-group input,
  162. .application .theme--light.input-group textarea,
  163. .theme--light .input-group input,
  164. .theme--light .input-group textarea {
  165. color: #4a5961;
  166. }
  167.  
  168. .application .theme--light.datatable thead th.column.sortable.active,
  169. .application .theme--light.datatable thead th.column.sortable.active i,
  170. .application .theme--light.datatable thead th.column.sortable:hover,
  171. .theme--light .datatable thead th.column.sortable.active,
  172. .theme--light .datatable thead th.column.sortable.active i,
  173. .theme--light .datatable thead th.column.sortable:hover,
  174. .application .theme--light.datatable thead th.column.sortable i,
  175. .theme--light .datatable thead th.column.sortable i {
  176. color: #fff;
  177. }
  178.  
  179. .datatable__progress {
  180. display: none;
  181. }
  182. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement