From eeb6fd4f41ba6b06c4eef5ee94a066892b1dc9fd Mon Sep 17 00:00:00 2001 From: JaguarJack <82664165@qq.com> Date: Tue, 23 Apr 2024 13:11:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=20table=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catchTable/components/ellipsis/index.vue | 34 ++ .../components/switchColumn/index.vue | 62 +++ .../admin/components/catchTable/csearch.vue | 115 +++++ .../admin/components/catchTable/ctable.ts | 63 +++ .../admin/components/catchTable/ctcolumns.tsx | 48 ++ .../admin/components/catchTable/index.vue | 475 ++++++++++++++++++ .../admin/components/catchTable/tcolumns.vue | 151 ++++++ .../admin/components/catchTable/types.ts | 19 + .../admin/components/catchTable/useSearch.ts | 93 ++++ 9 files changed, 1060 insertions(+) create mode 100644 resources/admin/components/catchTable/components/ellipsis/index.vue create mode 100644 resources/admin/components/catchTable/components/switchColumn/index.vue create mode 100644 resources/admin/components/catchTable/csearch.vue create mode 100644 resources/admin/components/catchTable/ctable.ts create mode 100644 resources/admin/components/catchTable/ctcolumns.tsx create mode 100644 resources/admin/components/catchTable/index.vue create mode 100644 resources/admin/components/catchTable/tcolumns.vue create mode 100644 resources/admin/components/catchTable/types.ts create mode 100644 resources/admin/components/catchTable/useSearch.ts diff --git a/resources/admin/components/catchTable/components/ellipsis/index.vue b/resources/admin/components/catchTable/components/ellipsis/index.vue new file mode 100644 index 0000000..bf358be --- /dev/null +++ b/resources/admin/components/catchTable/components/ellipsis/index.vue @@ -0,0 +1,34 @@ + + + diff --git a/resources/admin/components/catchTable/components/switchColumn/index.vue b/resources/admin/components/catchTable/components/switchColumn/index.vue new file mode 100644 index 0000000..3ba1aab --- /dev/null +++ b/resources/admin/components/catchTable/components/switchColumn/index.vue @@ -0,0 +1,62 @@ + + + diff --git a/resources/admin/components/catchTable/csearch.vue b/resources/admin/components/catchTable/csearch.vue new file mode 100644 index 0000000..49d2787 --- /dev/null +++ b/resources/admin/components/catchTable/csearch.vue @@ -0,0 +1,115 @@ + + + diff --git a/resources/admin/components/catchTable/ctable.ts b/resources/admin/components/catchTable/ctable.ts new file mode 100644 index 0000000..892acbd --- /dev/null +++ b/resources/admin/components/catchTable/ctable.ts @@ -0,0 +1,63 @@ +export type columnType = 'expand' | 'selection' | 'index' | 'operate' +export type fixed = 'fiexed' | 'right' | 'left' +export interface Column { + type?: columnType // 类型 expand select index + label?: string + prop?: string + 'min-width'?: string | number + width?: number | string + slot?: 'string' + header: 'string' // 表头插槽名称 + align?: string + fixed?: fixed + sortable?: boolean | string + 'sort-method'?: Function + 'sort-by'?: Function + resizable?: boolean + formatter?: Function // function(row, column, cellValue, index) + 'header-align'?: string + 'class-name'?: string + selectable?: Function // function(row, index) + show: boolean + index?: number | Function // 如果设置了 type=index,可以通过传递 index 属性来自定义索引 + children?: Array // 多级表头 + filter?:Function, + ellipsis?:boolean|number, // 当文字太多时,可以使用省略文字 + switch?: boolean, // swith 字段状态切换 + switchRefresh?: Function, // switch refresh 刷新 + // 图片预览 + image?: boolean, + preview: boolean, // 默认不预览 + // 标签 + tags?: boolean|Array, + // 链接🔗 + link?:boolean, + link_text?: string, + // 操作 + update?: boolean, // 编辑操作 + destroy?: boolean // 删除操作 +} + +// 分页 +export interface paginate { + layout:string, + limit: number, + page: number, + limits: Array, + total: number, + changePage: Function, + changeLimit: Function +} + +// option +export interface Option { + label: string, + value: string|number +} +// 搜索 item +export interface SItem { + type: string, + name: string, + default: any, + options: Array