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
aa596af6
Commit
aa596af6
authored
Jan 02, 2021
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(table): table columns setting will uncheck all render columns #154
parent
0419a070
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
EditableCell.vue
...components/Table/src/components/editable/EditableCell.vue
+3
-3
useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+2
-1
projectSetting.ts
src/settings/projectSetting.ts
+1
-1
No files found.
src/components/Table/src/components/editable/EditableCell.vue
View file @
aa596af6
...
...
@@ -250,7 +250,7 @@
if
(
props
.
record
)
{
/* eslint-disable */
isArray
(
props
.
record
[
cbs
])
?
props
.
record
[
cbs
].
push
(
handle
)
?
props
.
record
[
cbs
]
?
.
push
(
handle
)
:
(
props
.
record
[
cbs
]
=
[
handle
]);
}
}
...
...
@@ -267,9 +267,9 @@
/* eslint-disable */
props
.
record
.
onSubmitEdit
=
async
()
=>
{
if
(
isArray
(
props
.
record
?.
submitCbs
))
{
const
validFns
=
props
.
record
?.
validCbs
||
[]
;
const
validFns
=
(
props
.
record
?.
validCbs
||
[]).
map
((
fn
)
=>
fn
())
;
const
res
=
await
Promise
.
all
(
validFns
.
map
((
fn
)
=>
fn
())
);
const
res
=
await
Promise
.
all
(
validFns
);
const
pass
=
res
.
every
((
item
)
=>
!!
item
);
if
(
!
pass
)
return
;
...
...
src/components/Table/src/hooks/useColumns.ts
View file @
aa596af6
...
...
@@ -185,13 +185,14 @@ export function useColumns(
const
columnKeys
=
columns
as
string
[];
const
newColumns
:
BasicColumn
[]
=
[];
cacheColumns
.
forEach
((
item
)
=>
{
if
(
columnKeys
.
includes
(
`
${
item
.
key
}
`
!
||
item
.
dataIndex
!
))
{
if
(
columnKeys
.
includes
(
item
.
dataIndex
!
||
(
item
.
key
as
string
)
))
{
newColumns
.
push
({
...
item
,
defaultHidden
:
false
,
});
}
});
// Sort according to another array
if
(
!
isEqual
(
cacheKeys
,
columns
))
{
newColumns
.
sort
((
prev
,
next
)
=>
{
...
...
src/settings/projectSetting.ts
View file @
aa596af6
...
...
@@ -109,7 +109,7 @@ const setting: ProjectConfig = {
// Switch page to close menu
closeMixSidebarOnChange
:
false
,
// Module opening method ‘click’ |'hover'
mixSideTrigger
:
'
hover
'
,
mixSideTrigger
:
'
click
'
,
},
// Multi-label
...
...
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