From 0b6110a8fc92a11df6501346e093246a5abe2b0e Mon Sep 17 00:00:00 2001 From: vben Date: Tue, 17 Nov 2020 17:02:42 +0800 Subject: [PATCH] feat(form-page): add form page demo --- CHANGELOG.zh_CN.md | 3 + README.md | 2 + package.json | 2 +- src/components/Basic/src/BasicHelp.vue | 6 +- src/components/Footer/index.ts | 1 + src/components/Footer/src/index.vue | 57 +++++++ src/components/Form/src/BasicForm.vue | 29 +++- src/components/Form/src/FormItem.tsx | 16 +- src/components/Form/src/helper.ts | 2 +- .../Form/src/hooks/useLabelWidth.ts | 15 +- src/components/Form/src/types/form.ts | 3 + src/components/Menu/src/BasicMenu.tsx | 3 +- src/components/Table/index.ts | 4 +- .../Table/src/components/TableAction.tsx | 4 +- ...derEditableCell.tsx => renderEditable.tsx} | 129 +++++++++++---- src/components/Table/src/types/table.ts | 8 +- src/components/Table/src/types/tableAction.ts | 1 - src/components/registerGlobComp.ts | 7 +- src/design/ant/index.less | 11 +- src/design/index.less | 8 + src/design/transition/base.less | 4 +- src/design/transition/fade.less | 2 +- src/design/var/index.less | 2 +- src/layouts/default/menu/LayoutMenu.tsx | 2 +- src/router/menus/modules/demo/form.ts | 8 +- src/router/menus/modules/demo/page.ts | 21 +++ src/router/menus/modules/demo/table.ts | 10 ++ src/router/routes/modules/demo/page.ts | 37 +++++ src/router/routes/modules/demo/table.ts | 8 + .../demo/page/account/center/Project.vue | 1 - src/views/demo/page/form/basic/data.ts | 119 ++++++++++++++ src/views/demo/page/form/basic/index.vue | 66 ++++++++ src/views/demo/page/form/high/PersonTable.vue | 142 +++++++++++++++++ src/views/demo/page/form/high/data.ts | 149 ++++++++++++++++++ src/views/demo/page/form/high/index.vue | 72 +++++++++ src/views/demo/page/form/step/Step1.vue | 95 +++++++++++ src/views/demo/page/form/step/Step2.vue | 71 +++++++++ src/views/demo/page/form/step/Step3.vue | 45 ++++++ src/views/demo/page/form/step/data.tsx | 63 ++++++++ src/views/demo/page/form/step/index.vue | 86 ++++++++++ src/views/demo/table/EditRowTable.vue | 105 ++++++++++++ src/views/demo/table/FixedColumn.vue | 14 +- yarn.lock | 72 ++++----- 43 files changed, 1389 insertions(+), 116 deletions(-) create mode 100644 src/components/Footer/index.ts create mode 100644 src/components/Footer/src/index.vue rename src/components/Table/src/components/{renderEditableCell.tsx => renderEditable.tsx} (53%) create mode 100644 src/views/demo/page/form/basic/data.ts create mode 100644 src/views/demo/page/form/basic/index.vue create mode 100644 src/views/demo/page/form/high/PersonTable.vue create mode 100644 src/views/demo/page/form/high/data.ts create mode 100644 src/views/demo/page/form/high/index.vue create mode 100644 src/views/demo/page/form/step/Step1.vue create mode 100644 src/views/demo/page/form/step/Step2.vue create mode 100644 src/views/demo/page/form/step/Step3.vue create mode 100644 src/views/demo/page/form/step/data.tsx create mode 100644 src/views/demo/page/form/step/index.vue create mode 100644 src/views/demo/table/EditRowTable.vue diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index d613ac58..202a1c25 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -4,6 +4,9 @@ - 新增 base64 文件流下载 - 优化上传组件及示例 +- 新增可编辑行示例 +- 新增个人页 +- 新增表单页 ### 🎫 Chores diff --git a/README.md b/README.md index 9eefaff4..1c349a45 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,8 @@ yarn clean:lib # 删除node_modules,兼容window系统 ## 正在开发的功能 +- [ ] 新分支全局国家化 +- [ ] 示例 page 页面 - [ ] 主题配置 - [ ] 黑暗主题 - [ ] 打包 CDN diff --git a/package.json b/package.json index 79355d9a..4cacd4a7 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "dependencies": { "@iconify/iconify": "^2.0.0-rc.2", "@vueuse/core": "^4.0.0-beta.41", - "ant-design-vue": "^2.0.0-rc.1", + "ant-design-vue": "^2.0.0-beta.15", "apexcharts": "3.22.0", "axios": "^0.21.0", "echarts": "^4.9.0", diff --git a/src/components/Basic/src/BasicHelp.vue b/src/components/Basic/src/BasicHelp.vue index f2189ac7..8a121b95 100644 --- a/src/components/Basic/src/BasicHelp.vue +++ b/src/components/Basic/src/BasicHelp.vue @@ -48,6 +48,10 @@ bottom: 0, }), }, + placement: { + type: String as PropType, + defualt: 'right', + }, }, setup(props, { slots }) { const getOverlayStyleRef = computed(() => { @@ -97,7 +101,7 @@ overlayClassName: 'base-help__wrap', autoAdjustOverflow: true, overlayStyle: unref(getOverlayStyleRef), - placement: 'right', + placement: props.placement, getPopupContainer: () => getPopupContainer(), }, { diff --git a/src/components/Footer/index.ts b/src/components/Footer/index.ts new file mode 100644 index 00000000..c8d0f622 --- /dev/null +++ b/src/components/Footer/index.ts @@ -0,0 +1 @@ +export { default as AppFooter } from './src/index.vue'; diff --git a/src/components/Footer/src/index.vue b/src/components/Footer/src/index.vue new file mode 100644 index 00000000..706a0786 --- /dev/null +++ b/src/components/Footer/src/index.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/components/Form/src/BasicForm.vue b/src/components/Form/src/BasicForm.vue index c5f7f63a..17accb97 100644 --- a/src/components/Form/src/BasicForm.vue +++ b/src/components/Form/src/BasicForm.vue @@ -1,5 +1,5 @@