From a416114ce77048634dbb21c0b25a8ef19aed15e1 Mon Sep 17 00:00:00 2001 From: Szczepan Masny Date: Wed, 27 Feb 2019 19:28:51 +0100 Subject: [PATCH] crud customization --- examples/crm/main.js | 2 +- examples/simple-crud/main.js | 2 +- examples/simple-crud/routes/Crud.vue | 175 ++++++++++++------ src/utils/crud/components/Crud.vue | 43 ++++- .../crud/components/DataTableClientSide.vue | 21 ++- .../crud/components/DataTableControls.vue | 26 ++- src/utils/crud/components/DataTableRow.vue | 15 +- .../crud/components/DataTableServerSide.vue | 21 ++- src/utils/crud/mixins/datatable-main.js | 11 +- 9 files changed, 221 insertions(+), 95 deletions(-) diff --git a/examples/crm/main.js b/examples/crm/main.js index acee4db..eee0cc0 100644 --- a/examples/crm/main.js +++ b/examples/crm/main.js @@ -10,7 +10,7 @@ import store from './store' import './register-service-worker' import { api } from './config/api' -Vue.config.productionTip = false +Vue.config.productionTip = true Vue.http.options.emulateJSON = true; Vue.http.options.root = api.url + api.path.default Vue.http.interceptors.push((request, next) => { diff --git a/examples/simple-crud/main.js b/examples/simple-crud/main.js index 45abf09..17c5b4d 100644 --- a/examples/simple-crud/main.js +++ b/examples/simple-crud/main.js @@ -10,7 +10,7 @@ import store from './store' import './register-service-worker' import { api } from './config/api' -Vue.config.productionTip = false +Vue.config.productionTip = true Vue.http.options.emulateJSON = true; Vue.http.options.root = api.url + api.path.default diff --git a/examples/simple-crud/routes/Crud.vue b/examples/simple-crud/routes/Crud.vue index 1492ef8..847918a 100644 --- a/examples/simple-crud/routes/Crud.vue +++ b/examples/simple-crud/routes/Crud.vue @@ -1,62 +1,121 @@ - - \ No newline at end of file + }, + } + \ No newline at end of file diff --git a/src/utils/crud/components/Crud.vue b/src/utils/crud/components/Crud.vue index 8e609a0..0b9dddc 100644 --- a/src/utils/crud/components/Crud.vue +++ b/src/utils/crud/components/Crud.vue @@ -11,8 +11,15 @@ :tableFields="tableFields" :primaryKey="primaryKey" :activeColumnName="activeColumnName" - :creator="creator" - :editor="editor" + :createMode="createMode" + :editMode="editMode" + :mainFilter="mainFilter" + :fieldFilters="fieldFilters" + :refreshButton="refreshButton" + :exportButton="exportButton" + :selectManyMode="selectManyMode" + :updateManyMode="updateManyMode" + :removeManyMode="removeManyMode" > @@ -99,11 +106,39 @@ export default { }, default: 'ClientSide' }, - creator: { + createMode: { type: Boolean, default: true }, - editor: { + editMode: { + type: Boolean, + default: true + }, + mainFilter: { + type: Boolean, + default: true + }, + fieldFilters: { + type: Boolean, + default: true + }, + exportButton: { + type: Boolean, + default: true + }, + refreshButton: { + type: Boolean, + default: true + }, + selectManyMode: { + type: Boolean, + default: true + }, + updateManyMode: { + type: Boolean, + default: true + }, + removeManyMode: { type: Boolean, default: true }, diff --git a/src/utils/crud/components/DataTableClientSide.vue b/src/utils/crud/components/DataTableClientSide.vue index ede4585..ea0f429 100644 --- a/src/utils/crud/components/DataTableClientSide.vue +++ b/src/utils/crud/components/DataTableClientSide.vue @@ -2,6 +2,14 @@