Allow customized list view per space

This commit is contained in:
2020-09-01 11:33:42 +02:00
parent 93bf448b6c
commit ef1e92a79d
2 changed files with 42 additions and 4 deletions
+30 -1
View File
@@ -20,5 +20,34 @@ export default {
label: 'Email',
required: true
}
]
],
list: {
columns: {
name: {
as: 'text',
label: '@ui.name',
bold: true,
link: item =>
{
return {
name: 'space-item',
params: { alias: 'team', id: item.id }
};
}
},
position: {
as: 'text',
label: 'Position'
},
email: {
as: 'text',
label: 'Email'
},
createdDate: {
as: 'date',
label: '@ui.createdDate'
}
}
}
};
+12 -3
View File
@@ -1,5 +1,5 @@
<template>
<div class="list">
<div v-if="!loading" class="list">
<ui-header-bar :title="space.name" title-empty="List">
<ui-table-filter v-model="tableConfig" />
<ui-button label="@ui.add" icon="fth-plus" @click="add" />
@@ -18,6 +18,7 @@
props: [ 'space', 'config' ],
data: () => ({
loading: true,
tableConfig: {}
}),
@@ -35,8 +36,14 @@
load()
{
this.tableConfig = {
items: SpacesApi.getList.bind(this, this.space.alias),
this.loading = true;
const alias = 'space.' + this.space.alias;
let renderer = zero.renderers[alias];
this.loading = false;
this.tableConfig = renderer && typeof renderer.list === 'object' ? renderer.list : {
columns: {
name: {
as: 'text',
@@ -61,6 +68,8 @@
}
}
};
this.tableConfig.items = SpacesApi.getList.bind(this, this.space.alias);
},