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
b8ff5b9b
Commit
b8ff5b9b
authored
Aug 11, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update first cell
parent
a18fde7a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
22 deletions
+33
-22
Cell.less
components/apolloTable/component/Cell.less
+13
-15
Cell.tsx
components/apolloTable/component/Cell.tsx
+9
-4
Column.less
components/apolloTable/component/Column.less
+2
-1
Column.tsx
components/apolloTable/component/Column.tsx
+2
-2
Table.tsx
components/apolloTable/component/Table.tsx
+3
-0
index.tsx
components/apolloTable/component/index.tsx
+2
-0
interface.tsx
components/apolloTable/component/interface.tsx
+2
-0
No files found.
components/apolloTable/component/Cell.less
View file @
b8ff5b9b
...
...
@@ -7,12 +7,12 @@
align-items: center;
white-space: nowrap;
overflow: hidden;
max-width: 66px;
//
max-width: 66px;
margin-left: @marginLg;
.num {
min-width: 30px;
max-width: 100px;
margin-right:
10px
;
margin-right:
@marginSmX
;
font-size: @textFontGen;
.icon {
width: 22px;
...
...
@@ -24,7 +24,7 @@
.checkbox {
min-width: 30px;
max-width: 100px;
margin-right:
10px
;
margin-right:
@marginSmX
;
&.hasNum {
display: none;
}
...
...
@@ -33,21 +33,19 @@
}
}
.expand {
text-align: center;
width: 20px;
border-radius: 50%;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
margin-right: @marginSm;
width: 16px;
margin-right: @marginSmX;
cursor: pointer;
visibility: hidden;
&:hover {
background: #d0f0fd;
}
.expandIcon {
border-radius: 50%;
width: 16px;
height: 16px;
&:hover {
background: #d0f0fd;
}
}
}
}
...
...
@@ -55,9 +53,9 @@
background: @tableHoverBgColor;
.firstArea {
.checkbox {
display:
block
;
display:
flex
;
&.hasNum {
display:
block
;
display:
flex
;
}
}
.num {
...
...
components/apolloTable/component/Cell.tsx
View file @
b8ff5b9b
...
...
@@ -37,6 +37,8 @@ const Cell = (props: CellProps) => {
onEmitMsg
,
tableId
,
maxPopHeight
,
renderFirstLeft
,
position
,
}
=
props
;
const
{
columnType
,
...
...
@@ -180,12 +182,12 @@ const Cell = (props: CellProps) => {
};
return
(
<
div
className=
{
s
.
firstArea
}
>
{
rowSelection
&&
columnIndex
===
0
&&
(
{
rowSelection
&&
(
<
div
className=
{
classNames
(
s
.
checkbox
,
showIndex
&&
s
.
hasNum
,
getCheckedIndex
()
>
-
1
&&
s
.
checked
)
}
>
{
getCheckbox
()
}
</
div
>
)
}
{
showIndex
&&
columnIndex
===
0
&&
(
{
showIndex
&&
(
<
div
className=
{
classNames
(
s
.
num
,
...
...
@@ -196,7 +198,7 @@ const Cell = (props: CellProps) => {
{
getIndex
()
}
</
div
>
)
}
{
showExpand
&&
columnIndex
===
0
&&
(
{
showExpand
&&
(
<
div
className=
{
s
.
expand
}
>
<
img
onClick=
{
showExpand
.
bind
(
null
,
{
rowId
:
record
.
id
,
historyGroupId
:
record
.
historyGroupId
})
}
...
...
@@ -206,6 +208,9 @@ const Cell = (props: CellProps) => {
/>
</
div
>
)
}
{
renderFirstLeft
&&
renderFirstLeft
({
record
})
}
</
div
>
);
};
...
...
@@ -390,7 +395,7 @@ const Cell = (props: CellProps) => {
onMouseEnter=
{
onMouseEnter
}
onMouseLeave=
{
onMouseLeave
}
>
{
columnIndex
===
0
&&
(
rowSelection
||
showExpand
||
showIndex
)
&&
renderFirst
()
}
{
columnIndex
===
0
&&
position
!==
'right'
&&
renderFirst
()
}
<
div
id=
{
`cellUnit_${tableId}_${record.id}_${columnName}`
}
className=
{
classNames
(
...
...
components/apolloTable/component/Column.less
View file @
b8ff5b9b
...
...
@@ -9,7 +9,8 @@
padding: 0 @paddingLg;
overflow: hidden;
.checkbox {
margin-right: 10px;
width: 30px;
margin-right: @marginSmX;
}
.colBrief {
display: flex;
...
...
components/apolloTable/component/Column.tsx
View file @
b8ff5b9b
...
...
@@ -84,9 +84,9 @@ export default class TableColumn extends PureComponent<ColumnProps> {
const
{
sortType
}:
{
sortType
:
string
}
=
sort
||
{};
let
marginLeft
:
any
=
0
;
if
(
columnIndex
===
0
&&
(
rowSelection
||
showIndex
))
{
marginLeft
=
'
56
px'
;
marginLeft
=
'
72
px'
;
if
(
!
rowSelection
)
{
marginLeft
=
'
82
px'
;
marginLeft
=
'
91
px'
;
}
}
return
(
...
...
components/apolloTable/component/Table.tsx
View file @
b8ff5b9b
...
...
@@ -329,6 +329,7 @@ export default class AirTable extends Component<TableProps, TableState> {
rowStyle
,
onEmitMsg
,
tableId
,
renderFirstLeft
,
}
=
this
.
props
;
if
(
showColumns
.
length
===
0
||
showData
.
length
===
0
)
{
return
;
...
...
@@ -366,6 +367,7 @@ export default class AirTable extends Component<TableProps, TableState> {
columnConfig
,
columnData
,
cellData
,
record
,
});
const
cellStyleObj
=
getMergeStyle
({
...
style
,
...
cellBorderStyle
},
cellStyle
,
{
columnIndex
,
...
...
@@ -404,6 +406,7 @@ export default class AirTable extends Component<TableProps, TableState> {
onEmitMsg=
{
onEmitMsg
}
tableId=
{
tableId
}
maxPopHeight=
{
maxPopHeight
}
renderFirstLeft=
{
renderFirstLeft
}
/>
);
};
...
...
components/apolloTable/component/index.tsx
View file @
b8ff5b9b
...
...
@@ -91,6 +91,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
onEmitMsg
,
tableId
,
cachedFeAttr
,
renderFirstLeft
,
}
=
this
.
props
;
const
sortConfig
=
operateConfig
&&
operateConfig
.
menusGroup
...
...
@@ -154,6 +155,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
onDragFixed=
{
onDragFixed
}
canSorted=
{
canSorted
}
onDragSorted=
{
onDragSorted
}
renderFirstLeft=
{
renderFirstLeft
}
/>
</
div
>
</
div
>
...
...
components/apolloTable/component/interface.tsx
View file @
b8ff5b9b
...
...
@@ -84,6 +84,7 @@ export interface TableProps extends LoadConfigProps {
onDragResized
?:
Function
;
// 拖拽更改列伸缩回调
onEmitMsg
?:
Function
;
// 是否支持消息协同
cachedFeAttr
?:
boolean
;
// 是否启用前端缓存
renderFirstLeft
?:
Function
;
// 第一个单元格特殊渲染
}
export
interface
TableState
{
columns
:
ColumnProps
[];
...
...
@@ -137,6 +138,7 @@ export interface CellProps {
onEmitMsg
?:
Function
;
tableId
?:
string
|
number
;
maxPopHeight
?:
string
|
number
;
renderFirstLeft
?:
Function
;
}
export
interface
EditCellProps
{
...
...
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