Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
web_component
submodule
Commits
66e4d2ef
You need to sign in or sign up before continuing.
Commit
66e4d2ef
authored
Aug 11, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update column
parent
b8ff5b9b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
63 deletions
+68
-63
Column.less
components/apolloTable/component/Column.less
+34
-35
Column.tsx
components/apolloTable/component/Column.tsx
+28
-27
Table.tsx
components/apolloTable/component/Table.tsx
+3
-1
index.tsx
components/apolloTable/component/index.tsx
+2
-0
interface.tsx
components/apolloTable/component/interface.tsx
+1
-0
No files found.
components/apolloTable/component/Column.less
View file @
66e4d2ef
...
@@ -15,23 +15,23 @@
...
@@ -15,23 +15,23 @@
.colBrief {
.colBrief {
display: flex;
display: flex;
align-items: center;
align-items: center;
margin-right: @marginSmX;
flex: 1;
//flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.colIcon {
.colIcon {
display: flex;
width: @textFontGen;
width: @textFontGen;
color: @textPrimaryColor;
color: @textPrimaryColor;
margin-right: 5px;
margin-right: 5px;
}
}
.colTitle {
.colTitle {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: left;
text-align: left;
color: @textPrimaryColor;
color: @textPrimaryColor;
font-weight: @weightSemiblod;
font-weight: @weightSemiblod;
display: flex;
display: flex;
margin-right: @marginSmX;
&.required:before {
&.required:before {
display: inline-block;
display: inline-block;
margin-right: 4px;
margin-right: 4px;
...
@@ -60,8 +60,6 @@
...
@@ -60,8 +60,6 @@
}
}
}
}
}
}
}
.sortArrowGroup {
.sortArrowGroup {
.upArrow {
.upArrow {
width: 0;
width: 0;
...
@@ -93,6 +91,7 @@
...
@@ -93,6 +91,7 @@
}
}
}
}
}
}
}
.colOpera {
.colOpera {
width: 20px;
width: 20px;
...
...
components/apolloTable/component/Column.tsx
View file @
66e4d2ef
...
@@ -76,17 +76,18 @@ export default class TableColumn extends PureComponent<ColumnProps> {
...
@@ -76,17 +76,18 @@ export default class TableColumn extends PureComponent<ColumnProps> {
rowSelection
,
rowSelection
,
icon
,
icon
,
required
,
required
,
leftMargin
=
0
,
}
=
this
.
props
;
}
=
this
.
props
;
const
{
value
=
[]
}
=
sortConfig
||
{};
const
{
value
=
[]
}
=
sortConfig
||
{};
const
sort
=
value
.
find
((
item
:
any
)
=>
{
const
sort
=
value
.
find
((
item
:
any
)
=>
{
return
item
.
colName
===
columnName
;
return
item
.
colName
===
columnName
;
});
});
const
{
sortType
}:
{
sortType
:
string
}
=
sort
||
{};
const
{
sortType
}:
{
sortType
:
string
}
=
sort
||
{};
let
marginLeft
:
any
=
0
;
let
marginLeft
:
any
=
0
;
if
(
columnIndex
===
0
&&
(
rowSelection
||
showIndex
))
{
if
(
columnIndex
===
0
&&
(
rowSelection
||
showIndex
))
{
marginLeft
=
'72px'
;
marginLeft
=
`
${
leftMargin
+
36
}
px`
;
if
(
!
rowSelection
)
{
if
(
!
rowSelection
)
{
marginLeft
=
'91px'
;
marginLeft
=
`
${
leftMargin
+
70
}
px`
;
}
}
}
}
return
(
return
(
...
@@ -102,7 +103,6 @@ export default class TableColumn extends PureComponent<ColumnProps> {
...
@@ -102,7 +103,6 @@ export default class TableColumn extends PureComponent<ColumnProps> {
</
Tooltip
>
</
Tooltip
>
)
}
)
}
</
span
>
</
span
>
</
div
>
{
sortConfig
&&
!!
sortFlag
&&
(
{
sortConfig
&&
!!
sortFlag
&&
(
<
div
className=
{
s
.
sortArrowGroup
}
>
<
div
className=
{
s
.
sortArrowGroup
}
>
<
div
<
div
...
@@ -128,6 +128,7 @@ export default class TableColumn extends PureComponent<ColumnProps> {
...
@@ -128,6 +128,7 @@ export default class TableColumn extends PureComponent<ColumnProps> {
</
div
>
</
div
>
)
}
)
}
</
div
>
</
div
>
</
div
>
);
);
}
}
}
}
components/apolloTable/component/Table.tsx
View file @
66e4d2ef
...
@@ -239,12 +239,13 @@ export default class AirTable extends Component<TableProps, TableState> {
...
@@ -239,12 +239,13 @@ export default class AirTable extends Component<TableProps, TableState> {
showIndex
,
showIndex
,
rowSelection
,
rowSelection
,
dataSource
,
dataSource
,
canResized
,
canResized
=
true
,
onDragResized
,
onDragResized
,
canSorted
,
canSorted
,
onDragSorted
,
onDragSorted
,
tableId
,
tableId
,
cachedFeAttr
,
cachedFeAttr
,
leftMargin
,
}
=
this
.
props
;
}
=
this
.
props
;
const
{
columns
}
=
this
.
state
;
const
{
columns
}
=
this
.
state
;
const
formatColumns
=
this
.
memoizeFormatColumns
(
columns
,
cachedFeAttr
,
tableId
);
const
formatColumns
=
this
.
memoizeFormatColumns
(
columns
,
cachedFeAttr
,
tableId
);
...
@@ -299,6 +300,7 @@ export default class AirTable extends Component<TableProps, TableState> {
...
@@ -299,6 +300,7 @@ export default class AirTable extends Component<TableProps, TableState> {
dataSource=
{
dataSource
}
dataSource=
{
dataSource
}
icon=
{
icon
}
icon=
{
icon
}
required=
{
requiredFlag
}
required=
{
requiredFlag
}
leftMargin=
{
leftMargin
}
/>
/>
</
DragSorted
>
</
DragSorted
>
</
DragResized
>
</
DragResized
>
...
...
components/apolloTable/component/index.tsx
View file @
66e4d2ef
...
@@ -92,6 +92,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
...
@@ -92,6 +92,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
tableId
,
tableId
,
cachedFeAttr
,
cachedFeAttr
,
renderFirstLeft
,
renderFirstLeft
,
leftMargin
,
}
=
this
.
props
;
}
=
this
.
props
;
const
sortConfig
=
operateConfig
const
sortConfig
=
operateConfig
&&
operateConfig
.
menusGroup
&&
operateConfig
.
menusGroup
...
@@ -156,6 +157,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
...
@@ -156,6 +157,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
canSorted=
{
canSorted
}
canSorted=
{
canSorted
}
onDragSorted=
{
onDragSorted
}
onDragSorted=
{
onDragSorted
}
renderFirstLeft=
{
renderFirstLeft
}
renderFirstLeft=
{
renderFirstLeft
}
leftMargin=
{
leftMargin
}
/>
/>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
components/apolloTable/component/interface.tsx
View file @
66e4d2ef
...
@@ -85,6 +85,7 @@ export interface TableProps extends LoadConfigProps {
...
@@ -85,6 +85,7 @@ export interface TableProps extends LoadConfigProps {
onEmitMsg
?:
Function
;
// 是否支持消息协同
onEmitMsg
?:
Function
;
// 是否支持消息协同
cachedFeAttr
?:
boolean
;
// 是否启用前端缓存
cachedFeAttr
?:
boolean
;
// 是否启用前端缓存
renderFirstLeft
?:
Function
;
// 第一个单元格特殊渲染
renderFirstLeft
?:
Function
;
// 第一个单元格特殊渲染
leftMargin
?:
number
;
// 第一个表头左侧对齐距离
}
}
export
interface
TableState
{
export
interface
TableState
{
columns
:
ColumnProps
[];
columns
:
ColumnProps
[];
...
...
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