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
54d14056
Commit
54d14056
authored
Nov 28, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix table column settings not displayed by setting
parent
de499a14
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+2
-0
TableSetting.vue
src/components/Table/src/components/TableSetting.vue
+14
-7
vite.config.ts
vite.config.ts
+1
-1
No files found.
CHANGELOG.zh_CN.md
View file @
54d14056
...
...
@@ -31,6 +31,8 @@
-
form: 修复表单校验先设置在校验及控制台错误信息问题
-
`modal`
&
`drawer`
修复组件传递数组参数问题
-
form: 修复
`updateSchema`
赋值含有
`[]`
时不生效
-
table: 修复表格
`TableAction`
图标显示问题
-
table: 修复表格列设置通过
`setColumns`
设置不显示
### 🎫 Chores
...
...
src/components/Table/src/components/TableSetting.vue
View file @
54d14056
...
...
@@ -77,7 +77,7 @@
</div>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
,
reactive
,
toRefs
,
PropType
,
computed
}
from
'
vue
'
;
import
{
defineComponent
,
ref
,
reactive
,
toRefs
,
PropType
,
computed
,
watchEffect
}
from
'
vue
'
;
import
{
injectTable
}
from
'
../hooks/useProvinceTable
'
;
import
{
Tooltip
,
Divider
,
Dropdown
,
Menu
,
Popover
,
Checkbox
}
from
'
ant-design-vue
'
;
import
{
...
...
@@ -132,7 +132,7 @@
const
{
toggleFullscreen
,
isFullscreenRef
}
=
useFullscreen
(
table
.
wrapRef
);
const
selectedKeysRef
=
ref
<
SizeType
[]
>
([
table
.
getSize
()]);
let
plainOptions
:
Options
[]
=
[]
;
const
plainOptions
=
ref
<
Options
[]
>
([])
;
const
state
=
reactive
<
State
>
({
indeterminate
:
false
,
checkAll
:
true
,
...
...
@@ -142,6 +142,12 @@
const
{
t
}
=
useI18n
(
'
component.table
'
);
watchEffect
(()
=>
{
const
columns
=
table
.
getColumns
();
if
(
columns
.
length
)
{
init
();
}
});
function
init
()
{
let
ret
:
Options
[]
=
[];
table
.
getColumns
({
ignoreIndex
:
true
,
ignoreAction
:
true
}).
forEach
((
item
)
=>
{
...
...
@@ -150,7 +156,8 @@
value
:
(
item
.
dataIndex
||
item
.
title
)
as
string
,
});
});
plainOptions
=
ret
;
plainOptions
.
value
=
ret
;
const
checkList
=
table
.
getColumns
()
.
map
((
item
)
=>
item
.
dataIndex
||
item
.
title
)
as
string
[];
...
...
@@ -171,7 +178,7 @@
function
onCheckAllChange
(
e
:
ChangeEvent
)
{
state
.
indeterminate
=
false
;
const
checkList
=
plainOptions
.
map
((
item
)
=>
item
.
value
);
const
checkList
=
plainOptions
.
value
.
map
((
item
)
=>
item
.
value
);
if
(
e
.
target
.
checked
)
{
state
.
checkedList
=
checkList
;
table
.
setColumns
(
checkList
);
...
...
@@ -182,8 +189,9 @@
}
function
onChange
(
checkedList
:
string
[])
{
state
.
indeterminate
=
!!
checkedList
.
length
&&
checkedList
.
length
<
plainOptions
.
length
;
state
.
checkAll
=
checkedList
.
length
===
plainOptions
.
length
;
const
len
=
plainOptions
.
value
.
length
;
state
.
indeterminate
=
!!
checkedList
.
length
&&
checkedList
.
length
<
len
;
state
.
checkAll
=
checkedList
.
length
===
len
;
table
.
setColumns
(
checkedList
);
}
...
...
@@ -207,7 +215,6 @@
}
);
init
();
return
{
redo
:
()
=>
table
.
reload
(),
handleTitleClick
,
...
...
vite.config.ts
View file @
54d14056
...
...
@@ -55,7 +55,7 @@ const viteConfig: UserConfig = {
* Available options are 'terser' or 'esbuild'.
* @default 'terser'
*/
minify
:
isDevFn
()
?
'
esbuild
'
:
'
terser
'
,
minify
:
isDevFn
()
?
false
:
'
terser
'
,
/**
* Base public path when served in production.
* @default '/'
...
...
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