Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Simoje丶
vue-vben-admin
提交
a0c31974
V
vue-vben-admin
项目概览
Simoje丶
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a0c31974
编写于
10月 25, 2020
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf: update form types
上级
3713487c
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
100 addition
and
22 deletion
+100
-22
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-1
README.en-US.md
README.en-US.md
+1
-1
README.md
README.md
+1
-1
src/components/Button/types.ts
src/components/Button/types.ts
+66
-0
src/components/Form/src/types/form.ts
src/components/Form/src/types/form.ts
+20
-13
src/components/Table/src/const.ts
src/components/Table/src/const.ts
+11
-0
src/views/demo/comp/transition/index.vue
src/views/demo/comp/transition/index.vue
+0
-1
src/views/demo/form/CustomerForm.vue
src/views/demo/form/CustomerForm.vue
+0
-1
src/views/demo/form/DynamicForm.vue
src/views/demo/form/DynamicForm.vue
+0
-1
src/views/demo/form/RefForm.vue
src/views/demo/form/RefForm.vue
+0
-1
src/views/demo/form/RuleForm.vue
src/views/demo/form/RuleForm.vue
+0
-1
src/views/demo/form/UseForm.vue
src/views/demo/form/UseForm.vue
+0
-1
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
a0c31974
...
...
@@ -2,6 +2,7 @@
### ✨ Features
-
更新组件文档
-
面包屑支持显示图标
-
新增 tinymce 富文本组件
-
表单新增 submitOnReset 控制是否在重置时重新发起请求
...
...
@@ -19,7 +20,6 @@
-
关闭多标签页 tabs 动画
-
升级 vite 版本为
`v1.0.0.rc6`
-
删除中文路径警告。rc6 已修复
-
更新部分组件文档
### 🐛 Bug Fixes
...
...
README.en-US.md
浏览文件 @
a0c31974
...
...
@@ -228,11 +228,11 @@ yarn clean:lib # Delete node_modules, supported window
-
[x] System performance optimization
-
[x] Data import and export
-
[x] Global error handling
-
[x] Rich text component
## Developing features
-
[ ] Upload component
-
[ ] Rich text component
-
[ ] Theme configuration
-
[ ] Dark theme
-
[ ] Build CDN
...
...
README.md
浏览文件 @
a0c31974
...
...
@@ -226,11 +226,11 @@ yarn clean:lib # 删除node_modules,兼容window系统
-
[x] 数据导入导出
-
[x] 系统性能优化
-
[x] 全局错误处理
-
[x] 富文本组件
## 正在开发的功能
-
[ ] 上传组件
-
[ ] 富文本组件
-
[ ] 主题配置
-
[ ] 黑暗主题
-
[ ] 打包 CDN
...
...
src/components/Button/types.ts
0 → 100644
浏览文件 @
a0c31974
import
{
VNodeChild
}
from
'
vue
'
;
export
interface
BasicButtonProps
{
/**
* can be set to primary ghost dashed danger(added in 2.7) or omitted (meaning default)
* @default 'default'
* @type string
*/
type
?:
'
primary
'
|
'
danger
'
|
'
dashed
'
|
'
ghost
'
|
'
default
'
;
/**
* set the original html type of button
* @default 'button'
* @type string
*/
htmlType
?:
'
button
'
|
'
submit
'
|
'
reset
'
|
'
menu
'
;
/**
* set the icon of button
* @type string
*/
icon
?:
VNodeChild
|
JSX
.
Element
;
/**
* can be set to circle or circle-outline or omitted
* @type string
*/
shape
?:
'
circle
'
|
'
circle-outline
'
;
/**
* can be set to small large or omitted
* @default 'default'
* @type string
*/
size
?:
'
small
'
|
'
large
'
|
'
default
'
;
/**
* set the loading status of button
* @default false
* @type boolean | { delay: number }
*/
loading
?:
boolean
|
{
delay
:
number
};
/**
* disabled state of button
* @default false
* @type boolean
*/
disabled
?:
boolean
;
/**
* make background transparent and invert text and border colors, added in 2.7
* @default false
* @type boolean
*/
ghost
?:
boolean
;
/**
* option to fit button width to its parent width
* @default false
* @type boolean
*/
block
?:
boolean
;
onClick
?:
(
e
?:
Event
)
=>
void
;
}
src/components/Form/src/types/form.ts
浏览文件 @
a0c31974
import
type
{
Form
,
ValidationRule
}
from
'
ant-design-vue/types/form/form
'
;
import
type
{
Form
,
NamePath
,
ValidationRule
}
from
'
ant-design-vue/types/form/form
'
;
import
type
{
VNode
}
from
'
vue
'
;
import
type
{
BasicButtonProps
}
from
'
/@/components/Button/types
'
;
import
type
{
FormItem
}
from
'
./formItem
'
;
...
...
@@ -12,16 +12,23 @@ export interface RenderCallbackParams {
model
:
any
;
field
:
string
;
}
export
interface
ButtonProps
extends
BasicButtonProps
{
text
?:
string
;
}
export
interface
FormActionType
extends
Form
{
submit
():
Promise
<
void
>
;
setFieldsValue
<
T
>
(
values
:
T
):
void
;
resetFields
():
Promise
<
any
>
;
submit
:
()
=>
Promise
<
void
>
;
setFieldsValue
:
<
T
>
(
values
:
T
)
=>
void
;
resetFields
:
()
=>
Promise
<
any
>
;
getFieldsValue
:
()
=>
any
;
clearValidate
:
(
name
?:
string
|
string
[])
=>
void
;
updateSchema
(
data
:
Partial
<
FormSchema
>
|
Partial
<
FormSchema
>
[]):
void
;
setProps
(
formProps
:
Partial
<
FormProps
>
):
void
;
removeSchemaByFiled
(
field
:
string
|
string
[]):
void
;
appendSchemaByField
(
schema
:
FormSchema
,
prefixField
?:
string
):
void
;
updateSchema
:
(
data
:
Partial
<
FormSchema
>
|
Partial
<
FormSchema
>
[])
=>
void
;
setProps
:
(
formProps
:
Partial
<
FormProps
>
)
=>
void
;
removeSchemaByFiled
:
(
field
:
string
|
string
[])
=>
void
;
appendSchemaByField
:
(
schema
:
FormSchema
,
prefixField
?:
string
)
=>
void
;
validateFields
:
(
nameList
?:
NamePath
[])
=>
Promise
<
any
>
;
validate
:
(
nameList
?:
NamePath
[])
=>
Promise
<
any
>
;
}
export
type
RegisterFn
=
(
formInstance
:
FormActionType
)
=>
void
;
...
...
@@ -38,7 +45,7 @@ export interface FormProps {
wrapperCol
?:
Partial
<
ColEx
>
;
// 通用col配置
baseColProps
?:
any
;
baseColProps
?:
Partial
<
ColEx
>
;
// 表单配置规则
schemas
?:
FormSchema
[];
...
...
@@ -55,7 +62,7 @@ export interface FormProps {
// 时间区间字段映射成多个
fieldMapToTime
?:
FieldMapToTime
;
// 自动设置placeholder
autoSetPlaceHolder
:
boolean
;
autoSetPlaceHolder
?
:
boolean
;
// 校验信息是否加入label
rulesMessageJoinLabel
?:
boolean
;
// 是否显示收起展开按钮
...
...
@@ -66,10 +73,10 @@ export interface FormProps {
showActionButtonGroup
?:
boolean
;
// 重置按钮配置
resetButtonOptions
?:
Partial
<
B
asicB
uttonProps
>
;
resetButtonOptions
?:
Partial
<
ButtonProps
>
;
// 确认按钮配置
submitButtonOptions
?:
Partial
<
B
asicB
uttonProps
>
;
submitButtonOptions
?:
Partial
<
ButtonProps
>
;
// 操作列配置
actionColOptions
?:
Partial
<
ColEx
>
;
...
...
@@ -129,7 +136,7 @@ export interface FormSchema {
render
?:
(
renderCallbackParams
:
RenderCallbackParams
)
=>
VNode
|
VNode
[]
|
string
;
// 渲染 col内容,需要外层包裹 form-item
renderColContent
?:
(
renderCallbackParams
:
RenderCallbackParams
)
=>
VNode
|
VNode
[];
renderColContent
?:
(
renderCallbackParams
:
RenderCallbackParams
)
=>
VNode
|
VNode
[]
|
string
;
renderComponentContent
?:
(
renderCallbackParams
:
RenderCallbackParams
)
=>
any
;
...
...
src/components/Table/src/const.ts
浏览文件 @
a0c31974
...
...
@@ -2,21 +2,32 @@ import { SorterResult } from 'ant-design-vue/types/table/table';
export
const
ROW_KEY
=
'
key
'
;
// 可选的每页显示条数;
export
const
PAGE_SIZE_OPTIONS
=
[
'
10
'
,
'
50
'
,
'
80
'
,
'
100
'
];
// 每页显示条数
export
const
PAGE_SIZE
=
~~
PAGE_SIZE_OPTIONS
[
0
];
// 通用接口字段设置
// 支持 xxx.xxx.xxx格式
export
const
FETCH_SETTING
=
{
// 传给后台的当前页字段名
pageField
:
'
page
'
,
// 传给后台的每页显示记录数字段名
sizeField
:
'
pageSize
'
,
// 接口返回的表格数据字段名
listField
:
'
items
'
,
// 接口返回的表格总数字段名
totalField
:
'
total
'
,
};
// 配置通用排序函数
export
function
DEFAULT_SORT_FN
(
sortInfo
:
SorterResult
<
any
>
)
{
const
{
field
,
order
}
=
sortInfo
;
return
{
// 传给后台的排序字段你
field
,
// 传给后台的排序方式 asc/desc
order
,
};
}
src/views/demo/comp/transition/index.vue
浏览文件 @
a0c31974
...
...
@@ -59,7 +59,6 @@
Select
,
FadeTransition
,
ScaleTransition
,
SlideYTransition
,
ScrollYTransition
,
SlideYReverseTransition
,
...
...
src/views/demo/form/CustomerForm.vue
浏览文件 @
a0c31974
<
template
>
<div
class=
"m-4"
>
<div
class=
"mb-4"
>
</div>
<CollapseContainer
title=
"自定义表单"
>
<BasicForm
@
register=
"register"
@
submit=
"handleSubmit"
/>
</CollapseContainer>
...
...
src/views/demo/form/DynamicForm.vue
浏览文件 @
a0c31974
...
...
@@ -6,7 +6,6 @@
<a-button
@
click=
"appendField"
class=
"mr-2"
>
往字段3后面插入字段10
</a-button>
<a-button
@
click=
"deleteField"
class=
"mr-2"
>
删除字段11
</a-button>
</div>
<div
class=
"mb-4"
>
</div>
<CollapseContainer
title=
"动态表单示例,动态根据表单内其他值改变"
>
<BasicForm
@
register=
"register"
/>
</CollapseContainer>
...
...
src/views/demo/form/RefForm.vue
浏览文件 @
a0c31974
...
...
@@ -53,7 +53,6 @@
修改查询按钮
</a-button>
</div>
<div
class=
"mb-4"
>
</div>
<CollapseContainer
title=
"使用ref调用表单内部函数示例"
>
<BasicForm
:schemas=
"schemas"
...
...
src/views/demo/form/RuleForm.vue
浏览文件 @
a0c31974
...
...
@@ -6,7 +6,6 @@
<a-button
@
click=
"getFormValues"
class=
"mr-2"
>
获取表单值
</a-button>
<a-button
@
click=
"setFormValues"
class=
"mr-2"
>
设置表单值
</a-button>
</div>
<div
class=
"mb-4"
>
</div>
<CollapseContainer
title=
"表单校验"
>
<BasicForm
@
register=
"register"
@
submit=
"handleSubmit"
/>
</CollapseContainer>
...
...
src/views/demo/form/UseForm.vue
浏览文件 @
a0c31974
...
...
@@ -53,7 +53,6 @@
修改查询按钮
</a-button>
</div>
<div
class=
"mb-4"
>
</div>
<CollapseContainer
title=
"useForm示例"
>
<BasicForm
@
register=
"register"
@
submit=
"handleSubmit"
/>
</CollapseContainer>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录