summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/ConfiguratorModule.vue
diff options
context:
space:
mode:
authorUdo Walter2019-02-24 03:41:35 +0100
committerUdo Walter2019-02-24 03:41:35 +0100
commit40dc6c93cbb64ce85a5f56085772bcd44e2eebda (patch)
tree24f093e62d683cb6c4067b6fc649c68a0fb0442a /webapp/src/components/ConfiguratorModule.vue
parent[account] Add editable user info, change statuscodes, delete account (diff)
downloadbas-40dc6c93cbb64ce85a5f56085772bcd44e2eebda.tar.gz
bas-40dc6c93cbb64ce85a5f56085772bcd44e2eebda.tar.xz
bas-40dc6c93cbb64ce85a5f56085772bcd44e2eebda.zip
[webapp/configurator] switch from old table to the new data table
Diffstat (limited to 'webapp/src/components/ConfiguratorModule.vue')
-rw-r--r--webapp/src/components/ConfiguratorModule.vue65
1 files changed, 19 insertions, 46 deletions
diff --git a/webapp/src/components/ConfiguratorModule.vue b/webapp/src/components/ConfiguratorModule.vue
index 5121fcf..62a9534 100644
--- a/webapp/src/components/ConfiguratorModule.vue
+++ b/webapp/src/components/ConfiguratorModule.vue
@@ -39,25 +39,11 @@
<v-tab-item>
<v-subheader>{{ $t('configs') }}</v-subheader>
<v-card>
- <component-search-table v-model="selectedConfigs" :headers="configHeaders" :items="configs" select-all>
- <template slot="items" slot-scope="row">
- <tr :style="row.color" @click="row.data.selected = !row.data.selected" @dblclick="editConfig(row.data.item)">
- <td style="width: 10px">
- <v-checkbox
- color="primary"
- v-model="row.data.selected"
- hide-details
- ></v-checkbox>
- </td>
- <td class="narrow-td">{{ row.data.item.id }}</td>
- <td>{{ row.data.item.name }}</td>
- <td>{{ row.data.item.description }}</td>
- <td class="narrow-td">
- <v-btn icon @click.stop="editConfig(row.data.item)"><v-icon color="primary">edit</v-icon></v-btn>
- </td>
- </tr>
- </template>
- </component-search-table>
+ <data-table v-model="selectedConfigs" :headers="configHeaders" :items="configs" min-width="600px">
+ <div slot="actions" slot-scope="row" style="text-align: right">
+ <v-btn icon @click.stop="editConfig(row.item)"><v-icon color="primary">edit</v-icon></v-btn>
+ </div>
+ </data-table>
</v-card>
<div class="text-xs-right">
<v-btn flat color="error" @click="deleteSelectedConfigs" :disabled="selectedConfigs.length === 0">
@@ -69,24 +55,11 @@
<v-tab-item>
<v-subheader>{{ $t('entries') }}</v-subheader>
<v-card>
- <component-search-table v-model="selectedEntries" :headers="entryHeaders" :items="entries" select-all>
- <template slot="items" slot-scope="row">
- <tr :style="row.color" @click="row.data.selected = !row.data.selected" @dblclick="editEntry(row.data.item)">
- <td style="width: 10px">
- <v-checkbox
- color="primary"
- v-model="row.data.selected"
- hide-details
- ></v-checkbox>
- </td>
- <td class="narrow-td">{{ row.data.item.id }}</td>
- <td>{{ row.data.item.name }}</td>
- <td class="narrow-td">
- <v-btn icon @click.stop="editEntry(row.data.item)"><v-icon color="primary">edit</v-icon></v-btn>
- </td>
- </tr>
- </template>
- </component-search-table>
+ <data-table v-model="selectedEntries" :headers="entryHeaders" :items="entries" min-width="600px">
+ <div slot="actions" slot-scope="row" style="text-align: right">
+ <v-btn icon @click.stop="editEntry(row.item)"><v-icon color="primary">edit</v-icon></v-btn>
+ </div>
+ </data-table>
</v-card>
<div class="text-xs-right">
<v-btn flat color="error" @click="deleteSelectedEntries" :disabled="selectedEntries.length === 0">
@@ -114,7 +87,7 @@
</template>
<script>
-import ComponentSearchTable from '@/components/ComponentSearchTable'
+import DataTable from '@/components/DataTable'
import ConfiguratorModuleDelete from '@/components/ConfiguratorModuleDelete'
import ConfiguratorModuleConfig from '@/components/ConfiguratorModuleConfig'
import ConfiguratorModuleEntry from '@/components/ConfiguratorModuleEntry'
@@ -123,7 +96,7 @@ import { mapState, mapGetters, mapMutations } from 'vuex'
export default {
name: 'ConfiguratorModule',
components: {
- ComponentSearchTable,
+ DataTable,
ConfiguratorModuleDelete,
ConfiguratorModuleConfig,
ConfiguratorModuleEntry
@@ -140,17 +113,17 @@ export default {
...mapState('configurator', ['configs', 'entries', 'dialog']),
configHeaders () {
return [
- { text: this.$t('id'), value: 'id' },
- { text: this.$t('name'), value: 'name' },
- { text: this.$t('description'), value: 'description' },
- { sortable: false }
+ { key: 'id', text: this.$t('id'), width: '50px' },
+ { key: 'name', text: this.$t('name') },
+ { key: 'description', text: this.$t('description') },
+ { key: 'actions', width: '60px' }
]
},
entryHeaders () {
return [
- { text: this.$t('id'), value: 'id' },
- { text: this.$t('name'), value: 'name' },
- { sortable: false }
+ { key: 'id', text: this.$t('id'), width: '50px' },
+ { key: 'name', text: this.$t('name') },
+ { key: 'actions', width: '60px' }
]
}
},