From 78e423cc50bf6792a35421d844b0a49cb4faafb7 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 10 Jan 2023 18:30:05 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=E8=A1=A8=E6=A0=BC=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/index.vue | 96 ++++++++++++++++++++++++++++------ src/views/demo/table/index.vue | 12 +++-- 2 files changed, 90 insertions(+), 18 deletions(-) diff --git a/src/components/Table/index.vue b/src/components/Table/index.vue index 9b21c30c..c921bd97 100644 --- a/src/components/Table/index.vue +++ b/src/components/Table/index.vue @@ -4,17 +4,17 @@
-
-
+
+
-
+
-
+
- + + +
@@ -49,14 +63,17 @@ From d682234293d68ddae95b91bf6a6793eeef7e6269 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Wed, 11 Jan 2023 10:01:28 +0800 Subject: [PATCH 2/6] fix: merge --- src/components/Table/index.vue | 44 ++++++++++++++++++---------------- src/views/demo/table/index.vue | 31 ++++++++++++++---------- 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/src/components/Table/index.vue b/src/components/Table/index.vue index c921bd97..c7143149 100644 --- a/src/components/Table/index.vue +++ b/src/components/Table/index.vue @@ -53,8 +53,13 @@
@@ -135,33 +140,30 @@ const modelChange = (type: keyof typeof ModelEnum) => { // 请求数据 const handleSearch = async (params1?: Record) => { const resp = await props.request({ - pageSize: 10, + pageSize: 12, pageIndex: 1, ...params1 }) if(resp.status === 200){ - dataSource.value = [ // resp.result?.data || - { - key: '1', - name: '胡彦斌', - age: 32, - address: '西湖区湖底公园1号', - }, - { - key: '2', - name: '胡彦祖', - age: 42, - address: '西湖区湖底公园1号', - }, - ], + dataSource.value = resp.result?.data || [] pageIndex.value = resp.result?.pageIndex || 0 pageSize.value = resp.result?.pageSize || 6 total.value = resp.result?.total || 0 } } -const pageChange = () => { - +const pageChange = (page: number, size: number) => { + if(pageSize.value === size) { + handleSearch({ + pageSize: size, + pageIndex: page, + }) + } else { + handleSearch({ + pageSize: size, + pageIndex: 1, + }) + } } watchEffect(() => { @@ -226,9 +228,9 @@ watchEffect(() => { margin-top: 20px; display: flex; justify-content: flex-end; - // position: absolute; - // right: 24px; - // bottom: 24px; + /deep/ .ant-pagination-item { + display: none !important; + } } } \ No newline at end of file diff --git a/src/views/demo/table/index.vue b/src/views/demo/table/index.vue index 1aa3ed02..66db096e 100644 --- a/src/views/demo/table/index.vue +++ b/src/views/demo/table/index.vue @@ -3,19 +3,19 @@ server.post(`/device-product/_query`, data) -const actions = [{ - key: 'delete', - disabled: true, - text: "删除" -}] +const actions = [ + { + key: 'edit', + // disabled: true, + text: "编辑" + }, + { + key: 'delete', + disabled: true, + text: "删除" + } +] From e3c3e43b31d582e4f67987104a8ae6dcae8584bc Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Wed, 11 Jan 2023 14:33:17 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=E8=A1=A8=E6=A0=BC=E6=8F=92?= =?UTF-8?q?=E6=A7=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 14 +++ src/components/CardBox/index.vue | 2 +- src/components/Table/index.vue | 203 ++++++++++++++++++------------- src/components/index.ts | 4 +- src/views/demo/table/index.vue | 58 +++++++-- 5 files changed, 186 insertions(+), 95 deletions(-) diff --git a/components.d.ts b/components.d.ts index c6352220..810334ea 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,29 +7,43 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { + AAlert: typeof import('ant-design-vue/es')['Alert'] + ABadge: typeof import('ant-design-vue/es')['Badge'] AButton: typeof import('ant-design-vue/es')['Button'] ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup'] ACol: typeof import('ant-design-vue/es')['Col'] ACollapse: typeof import('ant-design-vue/es')['Collapse'] ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel'] + ADatePicker: typeof import('ant-design-vue/es')['DatePicker'] + ADivider: typeof import('ant-design-vue/es')['Divider'] + AEmpty: typeof import('ant-design-vue/es')['Empty'] AForm: typeof import('ant-design-vue/es')['Form'] AFormItem: typeof import('ant-design-vue/es')['FormItem'] AInput: typeof import('ant-design-vue/es')['Input'] AInputNumber: typeof import('ant-design-vue/es')['InputNumber'] + AInputPassword: typeof import('ant-design-vue/es')['InputPassword'] AModal: typeof import('ant-design-vue/es')['Modal'] + APagination: typeof import('ant-design-vue/es')['Pagination'] + APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] ARow: typeof import('ant-design-vue/es')['Row'] ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] + ASpace: typeof import('ant-design-vue/es')['Space'] ASpin: typeof import('ant-design-vue/es')['Spin'] + ATable: typeof import('ant-design-vue/es')['Table'] ATooltip: typeof import('ant-design-vue/es')['Tooltip'] AUpload: typeof import('ant-design-vue/es')['Upload'] BadgeStatus: typeof import('./src/components/BadgeStatus/index.vue')['default'] CardBox: typeof import('./src/components/CardBox/index.vue')['default'] + FormFormBuilder: typeof import('./src/components/Form/FormBuilder.vue')['default'] GeoComponent: typeof import('./src/components/GeoComponent/index.vue')['default'] MonacoEditor: typeof import('./src/components/MonacoEditor/index.vue')['default'] + PermissionButton: typeof import('./src/components/PermissionButton/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + Table: typeof import('./src/components/Table/index.vue')['default'] + TitleComponent: typeof import('./src/components/TitleComponent/index.vue')['default'] ValueItem: typeof import('./src/components/ValueItem/index.vue')['default'] } } diff --git a/src/components/CardBox/index.vue b/src/components/CardBox/index.vue index 7eda82d6..fc942f65 100644 --- a/src/components/CardBox/index.vue +++ b/src/components/CardBox/index.vue @@ -60,7 +60,7 @@
- +
-
-
-
- -
-
-
- + +
+
+
+
-
- +
+
+ +
+
+ +
-
-
-
-
+
+ +
- +
+ + + + +
+
+
+
- + + +
-
- - - +
+
-
- -
-
+ From bf493c3a96c762d5bccfba4502fdaacb4ed0fd0a Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Wed, 11 Jan 2023 16:06:06 +0800 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84FormBuilder?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 17 ++ src/components/Form/FormBuilder.vue | 251 ++++++++++++++++++++++++- src/components/Form/index.modules.d.ts | 40 ++++ src/components/Form/index.ts | 1 + src/components/Form/util.ts | 15 ++ src/style.css | 4 + src/views/demo/Form.vue | 54 +++++- 7 files changed, 376 insertions(+), 6 deletions(-) create mode 100644 src/components/Form/index.modules.d.ts create mode 100644 src/components/Form/util.ts diff --git a/components.d.ts b/components.d.ts index 7c068950..d63a4b41 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,8 +8,25 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { AButton: typeof import('ant-design-vue/es')['Button'] + ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] + ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup'] + ACol: typeof import('ant-design-vue/es')['Col'] + ADatePicker: typeof import('ant-design-vue/es')['DatePicker'] + ADivider: typeof import('ant-design-vue/es')['Divider'] + AForm: typeof import('ant-design-vue/es')['Form'] + AFormItem: typeof import('ant-design-vue/es')['FormItem'] + AInput: typeof import('ant-design-vue/es')['Input'] + AInputPassword: typeof import('ant-design-vue/es')['InputPassword'] APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] + ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup'] + ARow: typeof import('ant-design-vue/es')['Row'] + ASelect: typeof import('ant-design-vue/es')['Select'] + ASpin: typeof import('ant-design-vue/es')['Spin'] + ASwitch: typeof import('ant-design-vue/es')['Switch'] + ATimePicker: typeof import('ant-design-vue/es')['TimePicker'] ATooltip: typeof import('ant-design-vue/es')['Tooltip'] + ATreeSelect: typeof import('ant-design-vue/es')['TreeSelect'] + AUpload: typeof import('ant-design-vue/es')['Upload'] BadgeStatus: typeof import('./src/components/BadgeStatus/index.vue')['default'] CardBox: typeof import('./src/components/CardBox/index.vue')['default'] FormFormBuilder: typeof import('./src/components/Form/FormBuilder.vue')['default'] diff --git a/src/components/Form/FormBuilder.vue b/src/components/Form/FormBuilder.vue index d1a74645..6de34440 100644 --- a/src/components/Form/FormBuilder.vue +++ b/src/components/Form/FormBuilder.vue @@ -1,11 +1,254 @@ -