Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
08df1987
提交
08df1987
authored
12月 28, 2020
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(form): form-item style error
上级
3b126e01
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
39 行增加
和
86 行删除
+39
-86
BasicForm.vue
src/components/Form/src/BasicForm.vue
+1
-2
FormAction.vue
src/components/Form/src/components/FormAction.vue
+1
-1
FormItem.tsx
src/components/Form/src/components/FormItem.tsx
+3
-3
useFormEvents.ts
src/components/Form/src/hooks/useFormEvents.ts
+3
-2
index.vue
src/components/Markdown/src/index.vue
+2
-0
BasicTable.vue
src/components/Table/src/BasicTable.vue
+5
-5
props.ts
src/components/Table/src/props.ts
+21
-70
tableAction.ts
src/components/Table/src/types/tableAction.ts
+3
-3
没有找到文件。
src/components/Form/src/BasicForm.vue
浏览文件 @
08df1987
...
...
@@ -53,7 +53,6 @@
export
default
defineComponent
({
name
:
'BasicForm'
,
components
:
{
FormItem
,
Form
,
Row
,
FormAction
},
inheritAttrs
:
false
,
props
:
basicProps
,
emits
:
[
'advanced-change'
,
'reset'
,
'submit'
,
'register'
],
setup
(
props
,
{
emit
})
{
...
...
@@ -279,7 +278,7 @@
&
--compact
{
.ant-form-item
{
margin-bottom
:
8px
;
margin-bottom
:
8px
!important
;
}
}
}
...
...
src/components/Form/src/components/FormAction.vue
浏览文件 @
08df1987
...
...
@@ -55,7 +55,7 @@
export
default
defineComponent
({
name
:
'BasicFormAction'
,
components
:
{
FormItem
:
Form
,
FormItem
:
Form
.
Item
,
Button
,
BasicArrow
,
},
...
...
src/components/Form/src/components/FormItem.tsx
浏览文件 @
08df1987
...
...
@@ -97,7 +97,7 @@ export default defineComponent({
return
disabled
;
});
const
getShow
=
computed
(()
=>
{
function
getShow
()
{
const
{
show
,
ifShow
}
=
props
.
schema
;
const
{
showAdvancedButton
}
=
props
.
formProps
;
const
itemIsAdvanced
=
showAdvancedButton
...
...
@@ -122,7 +122,7 @@ export default defineComponent({
}
isShow
=
isShow
&&
itemIsAdvanced
;
return
{
isShow
,
isIfShow
};
}
);
}
function
handleRules
():
ValidationRule
[]
{
const
{
...
...
@@ -310,7 +310,7 @@ export default defineComponent({
const
{
baseColProps
=
{}
}
=
props
.
formProps
;
const
realColProps
=
{
...
baseColProps
,
...
colProps
};
const
{
isIfShow
,
isShow
}
=
unref
(
getShow
);
const
{
isIfShow
,
isShow
}
=
getShow
(
);
const
getContent
=
()
=>
{
return
colSlot
...
...
src/components/Form/src/hooks/useFormEvents.ts
浏览文件 @
08df1987
...
...
@@ -178,11 +178,12 @@ export function useFormEvents({
}
async
function
validateFields
(
nameList
?:
NamePath
[]
|
undefined
)
{
return
await
unref
(
formElRef
)?.
validateFields
(
nameList
);
const
res
=
await
unref
(
formElRef
)?.
validateFields
(
nameList
||
[]);
return
res
;
}
async
function
validate
(
nameList
?:
NamePath
[]
|
undefined
)
{
return
await
unref
(
formElRef
)?.
validate
(
nameList
);
return
await
unref
(
formElRef
)?.
validate
(
nameList
||
[]
);
}
async
function
clearValidate
(
name
?:
string
|
string
[])
{
...
...
src/components/Markdown/src/index.vue
浏览文件 @
08df1987
...
...
@@ -75,7 +75,9 @@
onUnmounted
(()
=>
{
const
vditorInstance
=
unref
(
vditorRef
);
if
(
!
vditorInstance
)
return
;
try
{
vditorInstance
?.
destroy
?.();
}
catch
(
error
)
{}
});
return
{
...
...
src/components/Table/src/BasicTable.vue
浏览文件 @
08df1987
...
...
@@ -80,14 +80,13 @@
const
innerPropsRef
=
ref
<
Partial
<
BasicTableProps
>>
();
const
[
registerForm
,
{
getFieldsValue
}]
=
useForm
();
const
getMergeProps
=
computed
(
():
BasicTableProps
=>
{
const
getMergeProps
=
computed
(()
=>
{
return
{
...
props
,
...
unref
(
innerPropsRef
),
}
as
BasicTableProps
;
}
);
});
const
{
loadingRef
}
=
useLoading
(
getMergeProps
);
const
{
getPaginationRef
,
setPagination
}
=
usePagination
(
getMergeProps
);
const
{
getColumnsRef
,
setColumns
}
=
useColumns
(
getMergeProps
,
getPaginationRef
);
...
...
@@ -123,7 +122,7 @@
getMergeProps
);
const
hideTitle
=
!
slots
.
tableTitle
&&
!
title
&&
!
slots
.
toolbar
&&
!
showTableSetting
;
const
titleData
:
any
=
const
titleData
:
Recordable
=
hideTitle
&&
!
isString
(
title
)
?
{}
:
{
...
...
@@ -313,6 +312,7 @@
useExpose
<
TableActionType
>
(
tableAction
);
emit
(
'register'
,
tableAction
);
return
{
tableElRef
,
getBindValues
,
...
...
src/components/Table/src/props.ts
浏览文件 @
08df1987
...
...
@@ -10,51 +10,31 @@ import type {
}
from
'./types/table'
;
import
type
{
FormProps
}
from
'/@/components/Form'
;
import
{
DEFAULT_SORT_FN
,
FETCH_SETTING
}
from
'./const'
;
import
{
propTypes
}
from
'/@/utils/propTypes'
;
// 注释看 types/table
export
const
basicProps
=
{
tableSetting
:
{
type
:
Object
as
PropType
<
TableSetting
>
,
},
inset
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
},
inset
:
propTypes
.
bool
,
sortFn
:
{
type
:
Function
as
PropType
<
(
sortInfo
:
SorterResult
)
=>
any
>
,
default
:
DEFAULT_SORT_FN
,
},
showTableSetting
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
},
autoCreateKey
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
,
},
striped
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
,
},
showSummary
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
},
showTableSetting
:
propTypes
.
bool
,
autoCreateKey
:
propTypes
.
bool
.
def
(
true
),
striped
:
propTypes
.
bool
.
def
(
true
),
showSummary
:
propTypes
.
bool
,
summaryFunc
:
{
type
:
[
Function
,
Array
]
as
PropType
<
(...
arg
:
any
[])
=>
any
[]
>
,
default
:
null
,
},
canColDrag
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
,
},
isTreeTable
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
},
canColDrag
:
propTypes
.
bool
.
def
(
true
),
isTreeTable
:
propTypes
.
bool
,
api
:
{
type
:
Function
as
PropType
<
(...
arg
:
any
[])
=>
Promise
<
any
>>
,
default
:
null
,
...
...
@@ -78,22 +58,16 @@ export const basicProps = {
},
},
// 立即请求接口
immediate
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
}
,
immediate
:
propTypes
.
bool
.
def
(
true
)
,
emptyDataIsShowTable
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
,
},
emptyDataIsShowTable
:
propTypes
.
bool
.
def
(
true
),
// 额外的请求参数
searchInfo
:
{
type
:
Object
as
PropType
<
any
>
,
default
:
null
,
},
// 使用搜索表单
useSearchForm
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
},
useSearchForm
:
propTypes
.
bool
,
// 表单配置
formConfig
:
{
type
:
Object
as
PropType
<
Partial
<
FormProps
>>
,
...
...
@@ -103,10 +77,7 @@ export const basicProps = {
type
:
[
Array
]
as
PropType
<
BasicColumn
[]
>
,
default
:
null
,
},
showIndexColumn
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
,
},
showIndexColumn
:
propTypes
.
bool
.
def
(
true
),
indexColumnProps
:
{
type
:
Object
as
PropType
<
BasicColumn
>
,
default
:
null
,
...
...
@@ -115,22 +86,10 @@ export const basicProps = {
type
:
Object
as
PropType
<
BasicColumn
>
,
default
:
null
,
},
ellipsis
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
,
},
canResize
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
,
},
clearSelectOnPageChange
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
},
resizeHeightOffset
:
{
type
:
Number
as
PropType
<
number
>
,
default
:
0
,
},
ellipsis
:
propTypes
.
bool
.
def
(
true
),
canResize
:
propTypes
.
bool
.
def
(
true
),
clearSelectOnPageChange
:
propTypes
.
bool
,
resizeHeightOffset
:
propTypes
.
number
.
def
(
0
),
rowSelection
:
{
type
:
Object
as
PropType
<
TableRowSelection
|
null
>
,
default
:
null
,
...
...
@@ -142,30 +101,22 @@ export const basicProps = {
titleHelpMessage
:
{
type
:
[
String
,
Array
]
as
PropType
<
string
|
string
[]
>
,
},
maxHeight
:
{
type
:
Number
as
PropType
<
number
>
,
},
maxHeight
:
propTypes
.
number
,
dataSource
:
{
type
:
Array
as
PropType
<
any
[]
>
,
type
:
Array
as
PropType
<
Recordable
[]
>
,
default
:
null
,
},
rowKey
:
{
type
:
[
String
,
Function
]
as
PropType
<
string
|
((
record
:
any
)
=>
string
)
>
,
type
:
[
String
,
Function
]
as
PropType
<
string
|
((
record
:
Recordable
)
=>
string
)
>
,
default
:
''
,
},
bordered
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
},
bordered
:
propTypes
.
bool
,
pagination
:
{
type
:
[
Object
,
Boolean
]
as
PropType
<
PaginationProps
|
boolean
>
,
default
:
null
,
},
loading
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
},
loading
:
propTypes
.
bool
,
rowClassName
:
{
type
:
Function
as
PropType
<
(
record
:
TableCustomRecord
<
any
>
,
index
:
number
)
=>
string
>
,
},
...
...
src/components/Table/src/types/tableAction.ts
浏览文件 @
08df1987
import
{
ButtonProps
}
from
'ant-design-vue/es/button/buttonTypes'
;
export
interface
ActionItem
extends
ButtonProps
{
onClick
?:
any
;
onClick
?:
Fn
;
label
:
string
;
color
?:
'success'
|
'error'
|
'warning'
;
icon
?:
string
;
...
...
@@ -11,7 +11,7 @@ export interface PopConfirm {
title
:
string
;
okText
?:
string
;
cancelText
?:
string
;
confirm
:
any
;
cancel
?:
any
;
confirm
:
Fn
;
cancel
?:
Fn
;
icon
?:
string
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论