Skip to content

Commit

Permalink
feat: CrudProps与CrudExpose完善
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed May 23, 2022
1 parent 734ef99 commit 78c27ce
Show file tree
Hide file tree
Showing 63 changed files with 821 additions and 586 deletions.
15 changes: 6 additions & 9 deletions docs/zh/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,10 @@ module.exports = {
text: '基础组件', children: [
{text: 'fs-page', link: "/api/components/crud/container/fs-page"},
{text: 'fs-container', link: "/api/components/crud/container/fs-container"},
{text: 'fs-button', link: "/api/components/crud/fs-table"},
{text: 'fs-icon', link: "/api/components/crud/fs-table"},
{text: 'fs-loading', link: "/api/components/crud/fs-loading"},
{text: 'fs-component-render', link: "/api/components/crud/fs-component-render"},
{text: 'fs-render', link: "/api/components/crud/fs-render"},
{text: 'fs-slot-render', link: "/api/components/crud/fs-slot-render"},
{text: 'fs-button', link: "/api/components/crud/basic/fs-button"},
{text: 'fs-icon', link: "/api/components/crud/basic/fs-icon"},
{text: 'fs-iconify', link: "/api/components/crud/basic/fs-iconify"},
{text: 'fs-icon-svg', link: "/api/components/crud/basic/fs-icon-svg"},
]
},
{
Expand All @@ -138,9 +136,8 @@ module.exports = {
{text: 'fs-actionbar', link: "/api/components/crud/actionbar/index"},
{text: 'fs-search', link: "/api/components/crud/search/index"},
{text: 'fs-toolbar', link: "/api/components/crud/toolbar/index"},
{text: 'fs-table', link: "/api/components/crud/fs-table"},
{text: 'fs-table', link: "/api/components/crud/crud/fs-table"},
{text: 'fs-row-handle', link: "/api/components/crud/crud/fs-row-handle"},
{text: 'fs-cell', link: "/api/components/crud/crud/fs-cell"},
{text: 'fs-form-wrapper', link: "/api/components/crud/crud/fs-form-wrapper"},
{text: 'fs-form', link: "/api/components/crud/crud/fs-form"},
{text: 'fs-form-item', link: "/api/components/crud/crud/fs-form-item"},
Expand Down Expand Up @@ -201,7 +198,7 @@ module.exports = {
text: 'JsonEditor', children: [
{
text: "fs-json-editor",
link: '/api/components/extends/json/components/fs-json-editor/index'
link: '/api/components/extends/json/components/fs-json-editor'
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions docs/zh/api/components/crud/actionbar/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Props

| Prop name | Description | Type | Values | Default |
| --------- | ----------------------------------------------------------------------------------- | ---- | ------ | ------- |
| buttons | 按钮配置<br>{<br> add:{<br> ...FsButton,<br> show:true<br> },<br> custom:{...}<br>} | | - | |
| Prop name | Description | Type | Values | Default |
| --------- | ------------------------------------------------------------------------------------------ | ---- | ------ | ------- |
| buttons | 按钮配置<br/>{<br/> add:{<br/> ...FsButton,<br/> show:true<br/> },<br/> custom:{...}<br/>} | | - | |

## Events

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/api/components/crud/basic/fs-box.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FsBox

> 单纯的包裹
> 单纯的包裹一个子组件
## Slots

Expand Down
13 changes: 13 additions & 0 deletions docs/zh/api/components/crud/basic/fs-button.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# fs-button
按钮组件,[x]-button的封装

## Props

| Prop name | Description | Type | Values | Default |
|-----------|-------------| -------------- | ------ | ------- |
| text | 文本 | string | - | |
| icon | 图标 | string | - | |
| iconRight | 文本右边的图标 | string | - | |
| circle | 是否圆形 | boolean | - | false |

---
11 changes: 11 additions & 0 deletions docs/zh/api/components/crud/basic/fs-icon-svg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# FsSvgIcon

## Props

| Prop name | Description | Type | Values | Default |
| --------- | ----------- | -------------- | ------ | ------- |
| icon | | string | - | |
| size | | number\|string | - | 16 |
| spin | | boolean | - | false |

---
15 changes: 15 additions & 0 deletions docs/zh/api/components/crud/basic/fs-icon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# fs-icon

> 图标组件
支持多种类型
* 普通类型: ui自带的图标,需要先注册
* iconify: iconify图标,fs-iconify的封装, icon=iconifygroup:iconname格式,如 ion:search
* svg: svg图标,fs-icon-svg的封装, icon=svg:iconname 格式,如 svg:search

## Props

| Prop name | Description | Type | Values | Default |
|-----------|-----------------| -------------- | ------ | ------- |
| icon | 图标名 | string | - | |

---
9 changes: 9 additions & 0 deletions docs/zh/api/components/crud/container/fs-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@

> crud 的容器,根据外部高度自适应
## Props

| Prop name | Description | Type | Values | Default |
| ----------- | ------------ | ------- | ------ | ------- |
| fixedHeight | 是否固定高度 | boolean | - | true |
| bodyStyle | body 的样式 | object | - | {} |
| innerStyle | inner 的样式 | object | - | {} |

## Slots

| Name | Description | Bindings |
| ------- | ----------- | -------- |
| header | | |
| default | | |
| footer | | |
| box | | |

---
11 changes: 11 additions & 0 deletions docs/zh/api/components/crud/container/fs-page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# FsPage

## Slots

| Name | Description | Bindings |
| ------- | ----------- | -------- |
| header | | |
| default | | |
| footer | | |

---
12 changes: 12 additions & 0 deletions docs/zh/api/components/crud/crud/fs-form-helper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# FsFormHelper

> 表单字段帮助说明组件
## Props

| Prop name | Description | Type | Values | Default |
| --------- | ------------------------------------------------------------ | -------------- | ------ | ------- |
| helper | 帮助说明, text: 说明文字, render: function(scope) 自定义渲染 | object\|string | - | |
| scope | | | - | |

---
3 changes: 2 additions & 1 deletion docs/zh/api/components/crud/crud/fs-form-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
| modelValue | 表单字段值(v-model) | | - | |
| item | 字段配置 | object | - | undefined |
| formSlot | 字段组件插槽 | func | - | undefined |
| getContextFn | 获取上下文方法 | func | - | undefined |
| getContextFn | | func | - | undefined |
| helper | | object | - | |

## Events

Expand Down
13 changes: 12 additions & 1 deletion docs/zh/api/components/crud/crud/fs-form-wrapper.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# FsFormWrapper
待补充

>表单对话框|抽屉
>暴露方法:
>open(options)
## Props

| Prop name | Description | Type | Values | Default |
|-----------|--------------------|---------| ------ | --------- |
| options | 表单配置 | object | - | {} |
| inner | 是否内部打开对话框 | boolean | - | {} |
| innerWrapper | 内部打开对话框时Wrapper的配置 | object | - | {} |
28 changes: 16 additions & 12 deletions docs/zh/api/components/crud/crud/fs-form.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@
## Props

| Prop name | Description | Type | Values | Default |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------ | --------- |
| initialForm | 初始表单数据 | object | - | {} |
| columns | 字段模版<br>{<br> key:{<br> title: "字段名称",<br> component:{<br> name:"组件名称"<br> ...组件参数<br> }<br> }<br>} | object | - | undefined |
| group | 字段分组<br>{<br> type:'xxx', //分组展示类型<br> groups:{ //分组数据<br> groupKey:{ title:'xxx',columns:['fieldKey','fieldKey']}<br> }<br>} | object | - | undefined |
| doSubmit | 点击保存按钮时执行方法 | func | - | undefined |
| slots | 插槽内容 | object | - | {} |
| display | 布局方式【flex\|grid】 | string | - | "flex" |
| index | 序号,编辑时会传入 | number | - | undefined |
| mode | 模式 [add,edit,view,自定义] | string | - | undefined |
| row | 行数据 | object | - | undefined |
| col | el-col\|a-col 配置,可配置跨列 | object | - | undefined |
| Prop name | Description | Type | Values | Default |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------ | --------- |
| initialForm | 初始表单数据 | object | - | {} |
| columns | 字段模版<br/>{<br/> key:{<br/> title: "字段名称",<br/> component:{<br/> name:"组件名称"<br/> ...组件参数<br/> }<br/> }<br/>} | object | - | undefined |
| group | 字段分组<br/>{<br/> type:'xxx', //分组展示类型<br/> groups:{ //分组数据<br/> groupKey:{ title:'xxx',columns:['fieldKey','fieldKey']}<br/> }<br/>} | object | - | undefined |
| doReset | 重置按钮方法 | func | - | |
| doSubmit | 点击保存按钮时执行方法 | func | - | undefined |
| beforeSubmit | 表单提交前处理(async) | func | - | undefined |
| afterSubmit | 表单提交后处理(async) | func | - | undefined |
| slots | 插槽内容 | object | - | {} |
| display | 布局方式【flex\|grid】 | string | - | "flex" |
| index | 序号,编辑时会传入 | number | - | undefined |
| mode | 模式 [add,edit,view,自定义] | string | - | undefined |
| row | 行数据 | object | - | undefined |
| col | el-col\|a-col 配置,可配置跨列 | object | - | undefined |
| helper | helper 位置:{position:'label'} | object | - | |

## Events

Expand Down
22 changes: 15 additions & 7 deletions docs/zh/api/components/crud/crud/fs-row-handle.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,26 @@
## Props

| Prop name | Description | Type | Values | Default |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------ | --------- |
| dropdown | 按钮折叠 | | - | |
| buttons | 按钮配置<br>{<br> view:{...FsButton,click:Function,order:1},<br> edit:{...FsButton,click:Function,order:2},<br> remove:{...FsButton,click:Function,order:3},<br> ...自定义<br>} | | - | |
| group | 按钮分组,上面的 buttons 为默认分组<br> {<br> groupKey:{buttonKey:{},buttonKey2:{}}<br> } | | - | |
| active | 当前激活分组 | string | - | "default" |
| scope | scope | | - | |
| Prop name | Description | Type | Values | Default |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------ | --------- |
| dropdown | 按钮折叠配置 | object | - | |
| buttons | 按钮配置<br/>{<br/> view:{...FsButton,click:Function,order:1},<br/> edit:{...FsButton,click:Function,order:2},<br/> remove:{...FsButton,click:Function,order:3},<br/> ...自定义<br/>} | object | - | |
| group | 按钮分组,上面的 buttons 为默认分组<br/> {<br/> groupKey:{buttonKey:{},buttonKey2:{}}<br/> } | object | - | |
| active | 当前激活分组 | string | - | "default" |
| scope | scope | | - | |

## Events

| Event name | Properties | Description |
| ---------- | ---------- | ----------- |
| handle | |

## Slots

| Name | Description | Bindings |
| --------------------- | ----------- | -------- |
| cell-rowHandle-left | | |
| cell-rowHandle-middle | | |
| cell-rowHandle-right | | |

---
31 changes: 30 additions & 1 deletion docs/zh/api/components/crud/crud/fs-table.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# FsTable
待补充

表格配置
## Props

| Prop name | Description | Type | Values | Default |
|-----------|-------------------|---------| ------ |---------|
| slots | 表格插槽 | object | - | |
| cellSlots | 单元格插槽 | object | - | |
| columns | 列配置 | array | - | |
| rowHandle | 操作列 | object | - | |
| show | 是否显示表格 | boolean | - | true |
| data | 表格数据 | array | - | |
| editable | 行编辑配置 | object | - | |
| request | add、edit、del等请求配置 | object | - | |

---


## Events

| Event name | Properties | Description |
|-------------------| ---------- | ----------- |
| row-handle | |
| value-change | |
| pagination-change | |
| filter-change | |
| sort-change | |
| data-change | |

---
12 changes: 6 additions & 6 deletions docs/zh/api/components/crud/extends/fs-dict-cascader-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
## Props

| Prop name | Description | Type | Values | Default |
| ---------- | ----------------------------------------------------------------------------------------------------------------------- | ------------- | ------ | --------- |
| modelValue | 值<br/><br> 单选时 '1,2,3' 或 [1,2,3]<br/><br> 多选[[1,2,3],[4,5,6]]<br/> | string\|array | - | undefined |
| separator | value 的分隔符<br/><br> 多选时,如果 value 为 string,则以该分隔符分割成多个展示<br/><br> 传入空字符串,表示不分割<br/> | string | - | "," |
| multiple | 是否多选 | boolean | - | false |
| dict | 数据字典 | object | - | undefined |
| Prop name | Description | Type | Values | Default |
| ---------- | ------------------------------------------------------------------------------------------------------------------------- | ------------- | ------ | --------- |
| modelValue | 值<br/><br/> 单选时 '1,2,3' 或 [1,2,3]<br/><br/> 多选[[1,2,3],[4,5,6]]<br/> | string\|array | - | undefined |
| separator | value 的分隔符<br/><br/> 多选时,如果 value 为 string,则以该分隔符分割成多个展示<br/><br/> 传入空字符串,表示不分割<br/> | string | - | "," |
| multiple | 是否多选 | boolean | - | false |
| dict | 数据字典 | object | - | undefined |

---
Loading

0 comments on commit 78c27ce

Please sign in to comment.