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
dce3fb0f
Commit
dce3fb0f
authored
Jul 24, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(table): fix tableSettings popup in fullscreen mode
修复全屏模式下的表格设置组件的弹出层配置
parent
a5a9b3fb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
11 deletions
+36
-11
ColumnSetting.vue
...omponents/Table/src/components/settings/ColumnSetting.vue
+20
-5
index.vue
src/components/Table/src/components/settings/index.vue
+16
-6
No files found.
src/components/Table/src/components/settings/ColumnSetting.vue
View file @
dce3fb0f
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
trigger=
"click"
trigger=
"click"
@
visibleChange=
"handleVisibleChange"
@
visibleChange=
"handleVisibleChange"
:overlayClassName=
"`${prefixCls}__cloumn-list`"
:overlayClassName=
"`${prefixCls}__cloumn-list`"
:getPopupContainer=
"getPopupContainer"
>
>
<
template
#title
>
<
template
#title
>
<div
:class=
"`$
{prefixCls}__popover-title`">
<div
:class=
"`$
{prefixCls}__popover-title`">
...
@@ -47,7 +48,11 @@
...
@@ -47,7 +48,11 @@
{{
item
.
label
}}
{{
item
.
label
}}
</Checkbox>
</Checkbox>
<Tooltip
placement=
"bottomLeft"
:mouseLeaveDelay=
"0.4"
>
<Tooltip
placement=
"bottomLeft"
:mouseLeaveDelay=
"0.4"
:getPopupContainer=
"getPopupContainer"
>
<template
#title
>
<template
#title
>
{{
t
(
'
component.table.settingFixedLeft
'
)
}}
{{
t
(
'
component.table.settingFixedLeft
'
)
}}
</
template
>
</
template
>
...
@@ -64,7 +69,11 @@
...
@@ -64,7 +69,11 @@
/>
/>
</Tooltip>
</Tooltip>
<Divider
type=
"vertical"
/>
<Divider
type=
"vertical"
/>
<Tooltip
placement=
"bottomLeft"
:mouseLeaveDelay=
"0.4"
>
<Tooltip
placement=
"bottomLeft"
:mouseLeaveDelay=
"0.4"
:getPopupContainer=
"getPopupContainer"
>
<
template
#title
>
<
template
#title
>
{{
t
(
'
component.table.settingFixedRight
'
)
}}
{{
t
(
'
component.table.settingFixedRight
'
)
}}
</
template
>
</
template
>
...
@@ -109,8 +118,8 @@
...
@@ -109,8 +118,8 @@
import
{
useTableContext
}
from
'
../../hooks/useTableContext
'
;
import
{
useTableContext
}
from
'
../../hooks/useTableContext
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
import
{
useSortable
}
from
'
/@/hooks/web/useSortable
'
;
import
{
useSortable
}
from
'
/@/hooks/web/useSortable
'
;
import
{
isNullAndUnDef
}
from
'
/@/utils/is
'
;
import
{
is
Function
,
is
NullAndUnDef
}
from
'
/@/utils/is
'
;
import
{
getPopupContainer
}
from
'
/@/utils
'
;
import
{
getPopupContainer
as
getParentContainer
}
from
'
/@/utils
'
;
import
{
omit
}
from
'
lodash-es
'
;
import
{
omit
}
from
'
lodash-es
'
;
interface
State
{
interface
State
{
...
@@ -140,7 +149,7 @@
...
@@ -140,7 +149,7 @@
},
},
emits
:
[
'
columns-change
'
],
emits
:
[
'
columns-change
'
],
setup
(
_
,
{
emit
})
{
setup
(
_
,
{
emit
,
attrs
})
{
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
table
=
useTableContext
();
const
table
=
useTableContext
();
...
@@ -350,6 +359,12 @@
...
@@ -350,6 +359,12 @@
emit
(
'
columns-change
'
,
data
);
emit
(
'
columns-change
'
,
data
);
}
}
function
getPopupContainer
()
{
return
isFunction
(
attrs
.
getPopupContainer
)
?
attrs
.
getPopupContainer
()
:
getParentContainer
();
}
return
{
return
{
t
,
t
,
...
toRefs
(
state
),
...
toRefs
(
state
),
...
...
src/components/Table/src/components/settings/index.vue
View file @
dce3fb0f
<
template
>
<
template
>
<div
class=
"table-settings"
>
<div
class=
"table-settings"
>
<RedoSetting
v-if=
"getSetting.redo"
/>
<RedoSetting
v-if=
"getSetting.redo"
:getPopupContainer=
"getTableContainer"
/>
<SizeSetting
v-if=
"getSetting.size"
/>
<SizeSetting
v-if=
"getSetting.size"
:getPopupContainer=
"getTableContainer"
/>
<ColumnSetting
v-if=
"getSetting.setting"
@
columns-change=
"handleColumnChange"
/>
<ColumnSetting
<FullScreenSetting
v-if=
"getSetting.fullScreen"
/>
v-if=
"getSetting.setting"
@
columns-change=
"handleColumnChange"
:getPopupContainer=
"getTableContainer"
/>
<FullScreenSetting
v-if=
"getSetting.fullScreen"
:getPopupContainer=
"getTableContainer"
/>
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
type
{
PropType
}
from
'
vue
'
;
import
type
{
PropType
}
from
'
vue
'
;
import
type
{
TableSetting
,
ColumnChangeParam
}
from
'
../../types/table
'
;
import
type
{
TableSetting
,
ColumnChangeParam
}
from
'
../../types/table
'
;
import
{
defineComponent
,
computed
}
from
'
vue
'
;
import
{
defineComponent
,
computed
,
unref
}
from
'
vue
'
;
import
ColumnSetting
from
'
./ColumnSetting.vue
'
;
import
ColumnSetting
from
'
./ColumnSetting.vue
'
;
import
SizeSetting
from
'
./SizeSetting.vue
'
;
import
SizeSetting
from
'
./SizeSetting.vue
'
;
import
RedoSetting
from
'
./RedoSetting.vue
'
;
import
RedoSetting
from
'
./RedoSetting.vue
'
;
import
FullScreenSetting
from
'
./FullScreenSetting.vue
'
;
import
FullScreenSetting
from
'
./FullScreenSetting.vue
'
;
import
{
useI18n
}
from
'
/@/hooks/web/useI18n
'
;
import
{
useI18n
}
from
'
/@/hooks/web/useI18n
'
;
import
{
useTableContext
}
from
'
../../hooks/useTableContext
'
;
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'
TableSetting
'
,
name
:
'
TableSetting
'
,
...
@@ -33,6 +38,7 @@
...
@@ -33,6 +38,7 @@
emits
:
[
'
columns-change
'
],
emits
:
[
'
columns-change
'
],
setup
(
props
,
{
emit
})
{
setup
(
props
,
{
emit
})
{
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
table
=
useTableContext
();
const
getSetting
=
computed
(():
TableSetting
=>
{
const
getSetting
=
computed
(():
TableSetting
=>
{
return
{
return
{
...
@@ -48,7 +54,11 @@
...
@@ -48,7 +54,11 @@
emit
(
'
columns-change
'
,
data
);
emit
(
'
columns-change
'
,
data
);
}
}
return
{
getSetting
,
t
,
handleColumnChange
};
function
getTableContainer
()
{
return
table
?
unref
(
table
.
wrapRef
)
:
document
.
body
;
}
return
{
getSetting
,
t
,
handleColumnChange
,
getTableContainer
};
},
},
});
});
</
script
>
</
script
>
...
...
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