2018-10-10 18:51:03 +00:00
|
|
|
<template>
|
|
|
|
<div class="bg-light">
|
|
|
|
<page-header :title="meta.label || meta.name" />
|
|
|
|
<div class="px-4 py-3">
|
|
|
|
<list-toolbar
|
|
|
|
:doctype="doctype"
|
|
|
|
@newClick="openNewForm"
|
2018-10-22 19:10:45 +00:00
|
|
|
@filterList="keyword => filterList(keyword)"
|
2018-10-10 18:51:03 +00:00
|
|
|
class="mb-4"
|
|
|
|
/>
|
|
|
|
<list
|
|
|
|
:doctype="doctype"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import frappe from 'frappejs';
|
2018-10-22 19:10:45 +00:00
|
|
|
import Observable from 'frappejs/utils/observable';
|
2018-10-10 18:51:03 +00:00
|
|
|
import PageHeader from '@/components/PageHeader';
|
|
|
|
import ListToolbar from './ListToolbar';
|
|
|
|
import List from './List';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ListView',
|
|
|
|
props: ['doctype'],
|
|
|
|
components: {
|
|
|
|
PageHeader,
|
|
|
|
ListToolbar,
|
|
|
|
List
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
meta() {
|
|
|
|
return frappe.getMeta(this.doctype);
|
|
|
|
}
|
|
|
|
},
|
2018-10-22 19:10:45 +00:00
|
|
|
created() {
|
|
|
|
frappe.listView = new Observable();
|
|
|
|
},
|
2018-10-10 18:51:03 +00:00
|
|
|
methods: {
|
|
|
|
async openNewForm() {
|
|
|
|
const doc = await frappe.getNewDoc(this.doctype);
|
|
|
|
this.$router.push(`/edit/${this.doctype}/${doc.name}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|