Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
球球不吃虾
vue-vben-admin
提交
3ef5087b
V
vue-vben-admin
项目概览
球球不吃虾
/
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,发现更多精彩内容 >>
提交
3ef5087b
编写于
5月 22, 2021
作者:
Z
zuihou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
style: formatting code
上级
2d3d04f5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
64 addition
and
81 deletion
+64
-81
src/components/Table/src/components/editable/EditableCell.vue
...components/Table/src/components/editable/EditableCell.vue
+7
-9
src/components/Table/src/components/settings/index.vue
src/components/Table/src/components/settings/index.vue
+9
-11
src/components/Table/src/hooks/useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+1
-1
src/components/Table/src/hooks/useDataSource.ts
src/components/Table/src/hooks/useDataSource.ts
+2
-9
src/components/Table/src/hooks/useTable.ts
src/components/Table/src/hooks/useTable.ts
+2
-4
src/components/Table/src/hooks/useTableForm.ts
src/components/Table/src/hooks/useTableForm.ts
+10
-12
src/components/Table/src/hooks/useTableHeader.ts
src/components/Table/src/hooks/useTableHeader.ts
+33
-35
未找到文件。
src/components/Table/src/components/editable/EditableCell.vue
浏览文件 @
3ef5087b
...
@@ -131,16 +131,14 @@
...
@@ -131,16 +131,14 @@
return
option
?.
label
??
value
;
return
option
?.
label
??
value
;
});
});
const
getWrapperStyle
=
computed
(
const
getWrapperStyle
=
computed
(():
CSSProperties
=>
{
():
CSSProperties
=>
{
if
(
unref
(
getIsCheckComp
)
||
unref
(
getRowEditable
))
{
if
(
unref
(
getIsCheckComp
)
||
unref
(
getRowEditable
))
{
return
{};
return
{};
}
return
{
width
:
'
calc(100% - 48px)
'
,
};
}
}
);
return
{
width
:
'
calc(100% - 48px)
'
,
};
});
const
getRowEditable
=
computed
(()
=>
{
const
getRowEditable
=
computed
(()
=>
{
const
{
editable
}
=
props
.
record
||
{};
const
{
editable
}
=
props
.
record
||
{};
...
...
src/components/Table/src/components/settings/index.vue
浏览文件 @
3ef5087b
...
@@ -36,17 +36,15 @@
...
@@ -36,17 +36,15 @@
setup
(
props
)
{
setup
(
props
)
{
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
getSetting
=
computed
(
const
getSetting
=
computed
(():
TableSetting
=>
{
():
TableSetting
=>
{
return
{
return
{
redo
:
true
,
redo
:
true
,
size
:
true
,
size
:
true
,
setting
:
true
,
setting
:
true
,
fullScreen
:
false
,
fullScreen
:
false
,
...
props
.
setting
,
...
props
.
setting
,
};
};
});
}
);
return
{
getSetting
,
t
};
return
{
getSetting
,
t
};
},
},
...
...
src/components/Table/src/hooks/useColumns.ts
浏览文件 @
3ef5087b
...
@@ -109,7 +109,7 @@ export function useColumns(
...
@@ -109,7 +109,7 @@ export function useColumns(
propsRef
:
ComputedRef
<
BasicTableProps
>
,
propsRef
:
ComputedRef
<
BasicTableProps
>
,
getPaginationRef
:
ComputedRef
<
boolean
|
PaginationProps
>
getPaginationRef
:
ComputedRef
<
boolean
|
PaginationProps
>
)
{
)
{
const
columnsRef
=
(
ref
(
unref
(
propsRef
).
columns
)
as
unknown
)
as
Ref
<
BasicColumn
[]
>
;
const
columnsRef
=
ref
(
unref
(
propsRef
).
columns
)
as
unknown
as
Ref
<
BasicColumn
[]
>
;
let
cacheColumns
=
unref
(
propsRef
).
columns
;
let
cacheColumns
=
unref
(
propsRef
).
columns
;
const
getColumnsRef
=
computed
(()
=>
{
const
getColumnsRef
=
computed
(()
=>
{
...
...
src/components/Table/src/hooks/useDataSource.ts
浏览文件 @
3ef5087b
...
@@ -150,15 +150,8 @@ export function useDataSource(
...
@@ -150,15 +150,8 @@ export function useDataSource(
}
}
async
function
fetch
(
opt
?:
FetchParams
)
{
async
function
fetch
(
opt
?:
FetchParams
)
{
const
{
const
{
api
,
searchInfo
,
fetchSetting
,
beforeFetch
,
afterFetch
,
useSearchForm
,
pagination
}
=
api
,
unref
(
propsRef
);
searchInfo
,
fetchSetting
,
beforeFetch
,
afterFetch
,
useSearchForm
,
pagination
,
}
=
unref
(
propsRef
);
if
(
!
api
||
!
isFunction
(
api
))
return
;
if
(
!
api
||
!
isFunction
(
api
))
return
;
try
{
try
{
setLoading
(
true
);
setLoading
(
true
);
...
...
src/components/Table/src/hooks/useTable.ts
浏览文件 @
3ef5087b
...
@@ -15,9 +15,7 @@ type UseTableMethod = TableActionType & {
...
@@ -15,9 +15,7 @@ type UseTableMethod = TableActionType & {
getForm
:
()
=>
FormActionType
;
getForm
:
()
=>
FormActionType
;
};
};
export
function
useTable
(
export
function
useTable
(
tableProps
?:
Props
):
[
tableProps
?:
Props
):
[
(
instance
:
TableActionType
,
formInstance
:
UseTableMethod
)
=>
void
,
(
instance
:
TableActionType
,
formInstance
:
UseTableMethod
)
=>
void
,
TableActionType
&
{
TableActionType
&
{
getForm
:
()
=>
FormActionType
;
getForm
:
()
=>
FormActionType
;
...
@@ -129,7 +127,7 @@ export function useTable(
...
@@ -129,7 +127,7 @@ export function useTable(
return
toRaw
(
getTableInstance
().
getCacheColumns
());
return
toRaw
(
getTableInstance
().
getCacheColumns
());
},
},
getForm
:
()
=>
{
getForm
:
()
=>
{
return
(
unref
(
formRef
)
as
unknown
)
as
FormActionType
;
return
unref
(
formRef
)
as
unknown
as
FormActionType
;
},
},
setShowPagination
:
async
(
show
:
boolean
)
=>
{
setShowPagination
:
async
(
show
:
boolean
)
=>
{
getTableInstance
().
setShowPagination
(
show
);
getTableInstance
().
setShowPagination
(
show
);
...
...
src/components/Table/src/hooks/useTableForm.ts
浏览文件 @
3ef5087b
...
@@ -9,18 +9,16 @@ export function useTableForm(
...
@@ -9,18 +9,16 @@ export function useTableForm(
fetch
:
(
opt
?:
FetchParams
|
undefined
)
=>
Promise
<
void
>
,
fetch
:
(
opt
?:
FetchParams
|
undefined
)
=>
Promise
<
void
>
,
getLoading
:
ComputedRef
<
boolean
|
undefined
>
getLoading
:
ComputedRef
<
boolean
|
undefined
>
)
{
)
{
const
getFormProps
=
computed
(
const
getFormProps
=
computed
(():
Partial
<
FormProps
>
=>
{
():
Partial
<
FormProps
>
=>
{
const
{
formConfig
}
=
unref
(
propsRef
);
const
{
formConfig
}
=
unref
(
propsRef
);
const
{
submitButtonOptions
}
=
formConfig
||
{};
const
{
submitButtonOptions
}
=
formConfig
||
{};
return
{
return
{
showAdvancedButton
:
true
,
showAdvancedButton
:
true
,
...
formConfig
,
...
formConfig
,
submitButtonOptions
:
{
loading
:
unref
(
getLoading
),
...
submitButtonOptions
},
submitButtonOptions
:
{
loading
:
unref
(
getLoading
),
...
submitButtonOptions
},
compact
:
true
,
compact
:
true
,
};
};
});
}
);
const
getFormSlotKeys
=
computed
(()
=>
{
const
getFormSlotKeys
=
computed
(()
=>
{
const
keys
=
Object
.
keys
(
slots
);
const
keys
=
Object
.
keys
(
slots
);
...
...
src/components/Table/src/hooks/useTableHeader.ts
浏览文件 @
3ef5087b
...
@@ -8,41 +8,39 @@ import { isString } from '/@/utils/is';
...
@@ -8,41 +8,39 @@ import { isString } from '/@/utils/is';
import
{
getSlot
}
from
'
/@/utils/helper/tsxHelper
'
;
import
{
getSlot
}
from
'
/@/utils/helper/tsxHelper
'
;
export
function
useTableHeader
(
propsRef
:
ComputedRef
<
BasicTableProps
>
,
slots
:
Slots
)
{
export
function
useTableHeader
(
propsRef
:
ComputedRef
<
BasicTableProps
>
,
slots
:
Slots
)
{
const
getHeaderProps
=
computed
(
const
getHeaderProps
=
computed
(():
Recordable
=>
{
():
Recordable
=>
{
const
{
title
,
showTableSetting
,
titleHelpMessage
,
tableSetting
}
=
unref
(
propsRef
);
const
{
title
,
showTableSetting
,
titleHelpMessage
,
tableSetting
}
=
unref
(
propsRef
);
const
hideTitle
=
!
slots
.
tableTitle
&&
!
title
&&
!
slots
.
toolbar
&&
!
showTableSetting
;
const
hideTitle
=
!
slots
.
tableTitle
&&
!
title
&&
!
slots
.
toolbar
&&
!
showTableSetting
;
if
(
hideTitle
&&
!
isString
(
title
))
{
if
(
hideTitle
&&
!
isString
(
title
))
{
return
{};
return
{};
}
return
{
title
:
hideTitle
?
null
:
()
=>
h
(
TableHeader
,
{
title
,
titleHelpMessage
,
showTableSetting
,
tableSetting
,
}
as
Recordable
,
{
...(
slots
.
toolbar
?
{
toolbar
:
()
=>
getSlot
(
slots
,
'
toolbar
'
),
}
:
{}),
...(
slots
.
tableTitle
?
{
tableTitle
:
()
=>
getSlot
(
slots
,
'
tableTitle
'
),
}
:
{}),
}
),
};
}
}
);
return
{
title
:
hideTitle
?
null
:
()
=>
h
(
TableHeader
,
{
title
,
titleHelpMessage
,
showTableSetting
,
tableSetting
,
}
as
Recordable
,
{
...(
slots
.
toolbar
?
{
toolbar
:
()
=>
getSlot
(
slots
,
'
toolbar
'
),
}
:
{}),
...(
slots
.
tableTitle
?
{
tableTitle
:
()
=>
getSlot
(
slots
,
'
tableTitle
'
),
}
:
{}),
}
),
};
});
return
{
getHeaderProps
};
return
{
getHeaderProps
};
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录