Commit 4c77f19a authored by christianrhansen's avatar christianrhansen

setup table

parent 1e65306f
Pipeline #52698 passed with stage
in 1 minute and 22 seconds
<template lang="pug">
div
| Default Access Rights
q-table(:columns="config.columns", :data="tableData", dark, :pagination.sync="config.pagination", hide-bottom)
q-td(slot="body-cell-title", slot-scope="props", :props="props")
template(v-if="props.value") {{ props.value }}
span.text-grey-7(v-else) unset
q-td(slot="body-cell-actions", slot-scope="props", :props="props")
template(v-for="btn in actions")
q-btn.inline(
v-if="btn.type !== 'acl'", :key="btn.icon", flat, size="md", :icon="btn.icon",
@click="defaultClick(btn, props)",
:disabled="btn.type === 'copy' && props.row.name",
:class="{'text-grey-7': btn.type === 'copy' && props.row.name}") {{ $t(btn.title) }}
q-select.inline.ui-border.q-pl-sm.q-mr-sm(
v-else, v-model="model.acl", :options="btn.options", dark,
@change="inputChange", hide-underline, no-parent-field)
</template>
<script>
export default {
name: 'Permissions'
name: 'Permissions',
data () {
return {
model: {acl: 'none'},
inviteUrl: 'https://url.motionbank.org/Dh23DJa7',
tableData: [
{ title: 'My Super Group', id: 'asdf-1234' },
{ title: 'My Other Group', id: 'qwer-5678' }
],
config: {
pagination: {
rowsPerPage: 0
},
columns: [
{
name: 'title',
required: true,
label: 'Title',
align: 'left',
field: 'title',
sortable: true
},
{
name: 'id',
required: true,
label: 'ID',
align: 'left',
field: 'id',
sortable: true
}
]
},
actions: [
{
type: 'acl',
options: [
{
label: 'None',
value: 'none',
click: (item) => console.log(item)
},
{
label: 'Read',
value: 'read',
click: (item) => console.log(item)
},
{
label: 'Write',
value: 'write',
click: (item) => console.log(item)
}
]
},
{
type: 'delete',
icon: 'delete',
color: 'primary',
click: (item) => this.$refs.confirmModal.show('messages.confirm_delete_group', item.__index)
}
]
}
},
mounted () {
this.config.columns.push({
name: 'actions',
align: 'right',
type: 'string',
filter: false,
sortable: false,
sort: false
// format: makeFormatter('actions')
})
},
methods: {
inputChange () {
console.log('select change')
}
}
}
</script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment