From 9ea8ffd7fd311cac525d349359191dce1cac3fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BC=A0=E9=BE=99?= Date: Wed, 31 Aug 2022 10:16:38 +0800 Subject: [PATCH] wip: crud table --- src/components/query-bar/QueryBar.vue | 12 +++++ src/components/query-bar/QueryBarItem.vue | 29 +++++++++++ src/components/table/CrudModal.vue | 44 +++++++++++++++++ src/components/table/CrudTable.vue | 16 +++++++ src/composables/useCRUD.js | 5 ++ src/views/examples/table/post/index.vue | 48 +++++++++++++------ src/views/examples/table/post/usePostTable.js | 32 +++++++++++-- 7 files changed, 168 insertions(+), 18 deletions(-) create mode 100644 src/components/query-bar/QueryBar.vue create mode 100644 src/components/query-bar/QueryBarItem.vue create mode 100644 src/components/table/CrudModal.vue create mode 100644 src/components/table/CrudTable.vue create mode 100644 src/composables/useCRUD.js diff --git a/src/components/query-bar/QueryBar.vue b/src/components/query-bar/QueryBar.vue new file mode 100644 index 0000000..4062389 --- /dev/null +++ b/src/components/query-bar/QueryBar.vue @@ -0,0 +1,12 @@ + diff --git a/src/components/query-bar/QueryBarItem.vue b/src/components/query-bar/QueryBarItem.vue new file mode 100644 index 0000000..c0e03cf --- /dev/null +++ b/src/components/query-bar/QueryBarItem.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/components/table/CrudModal.vue b/src/components/table/CrudModal.vue new file mode 100644 index 0000000..40404f4 --- /dev/null +++ b/src/components/table/CrudModal.vue @@ -0,0 +1,44 @@ + + + diff --git a/src/components/table/CrudTable.vue b/src/components/table/CrudTable.vue new file mode 100644 index 0000000..195f559 --- /dev/null +++ b/src/components/table/CrudTable.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/composables/useCRUD.js b/src/composables/useCRUD.js new file mode 100644 index 0000000..e683ac5 --- /dev/null +++ b/src/composables/useCRUD.js @@ -0,0 +1,5 @@ +const ACTIONS = { + view: '查看', + edit: '编辑', + add: '新增', +} diff --git a/src/views/examples/table/post/index.vue b/src/views/examples/table/post/index.vue index b1ffd6b..38e88bd 100644 --- a/src/views/examples/table/post/index.vue +++ b/src/views/examples/table/post/index.vue @@ -1,24 +1,44 @@