Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
cdf2c59e
Commit
cdf2c59e
authored
Nov 08, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(table): fix the problem that multi-level header configuration does not take effect
parent
36a7e70c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
93 deletions
+30
-93
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+29
-12
selection.less
src/design/ant/selection.less
+0
-81
No files found.
CHANGELOG.zh_CN.md
View file @
cdf2c59e
...
...
@@ -30,6 +30,7 @@
-
修复
`useECharts`
在
`resize`
时不能自适应,报错
-
修复
`useWatermark`
在清空后
`resize`
未删除
-
修复表单校验问题
-
修复多级表头配置不生效问题
## 2.0.0-rc.8 (2020-11-2)
...
...
src/components/Table/src/hooks/useColumns.ts
View file @
cdf2c59e
...
...
@@ -23,18 +23,11 @@ export function useColumns(
}
let
pushIndexColumns
=
false
;
columns
.
forEach
((
item
)
=>
{
const
{
key
,
dataIndex
}
=
item
;
item
.
align
=
item
.
align
||
'
center
'
;
if
(
ellipsis
)
{
if
(
!
key
)
{
item
.
key
=
dataIndex
;
}
if
(
!
isBoolean
(
item
.
ellipsis
))
{
Object
.
assign
(
item
,
{
ellipsis
,
});
}
}
const
{
children
}
=
item
;
handleItem
(
item
,
!!
ellipsis
);
handleChildren
(
children
,
!!
ellipsis
);
const
indIndex
=
columns
.
findIndex
((
column
)
=>
column
.
flag
===
'
INDEX
'
);
if
(
showIndexColumn
&&
!
isTreeTable
)
{
pushIndexColumns
=
indIndex
===
-
1
;
...
...
@@ -88,6 +81,30 @@ export function useColumns(
cacheColumnsRef
.
value
=
columns
;
});
function
handleItem
(
item
:
BasicColumn
,
ellipsis
:
boolean
)
{
const
{
key
,
dataIndex
}
=
item
;
item
.
align
=
item
.
align
||
'
center
'
;
if
(
ellipsis
)
{
if
(
!
key
)
{
item
.
key
=
dataIndex
;
}
if
(
!
isBoolean
(
item
.
ellipsis
))
{
Object
.
assign
(
item
,
{
ellipsis
,
});
}
}
}
function
handleChildren
(
children
:
BasicColumn
[]
|
undefined
,
ellipsis
:
boolean
)
{
if
(
!
children
)
return
;
children
.
forEach
((
item
)
=>
{
const
{
children
}
=
item
;
handleItem
(
item
,
ellipsis
);
handleChildren
(
children
,
ellipsis
);
});
}
function
setColumns
(
columns
:
BasicColumn
[]
|
string
[])
{
if
(
!
isArray
(
columns
))
return
;
...
...
src/design/ant/selection.less
deleted
100644 → 0
View file @
36a7e70c
.ant-radio {
&-inner {
border-color: @text-color-base;
&::after {
top: 1px;
left: 1px;
width: 12px;
height: 12px;
}
}
}
.ant-radio-disabled .ant-radio-inner {
border-color: @text-color-help-light !important;
}
.ant-checkbox {
&-inner {
border-color: @text-color-base;
}
}
.ant-checkbox-disabled .ant-checkbox-inner {
border-color: @text-color-help-light !important;
}
// select
.ant-select {
&-selection {
border-color: @border-color-shallow-dark;
}
&-selection__placeholder,
&-search__field__placeholder {
color: @text-color-help-dark;
}
}
.ant-select-disabled .ant-select-arrow {
visibility: hidden;
}
.ant-select-dropdown {
min-width: 84px !important;
&.ant-select-dropdown--multiple {
.ant-select-dropdown-menu-item-selected .ant-select-selected-icon,
.ant-select-dropdown-menu-item-selected:hover .ant-select-selected-icon {
color: @white;
}
}
&-menu-item {
height: 34px;
min-width: 84px;
line-height: 22px;
color: @text-color-call-out;
&:hover {
// color: @--norm-select-item-hover-color;
background: @tree-hover-background-color;
}
&-selected,
&-selected:hover {
color: @primary-color;
background: @tree-hover-background-color;
}
&-disabled,
&-disabled:hover {
color: @disabled-color;
background-color: @white;
}
}
}
.ant-select-disabled .ant-select-selection {
background: @tree-hover-font-color;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment