Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
pro-blocks
Commits
66b26c6e
Commit
66b26c6e
authored
Apr 21, 2019
by
愚道
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove ant-design-pro/Charts/Radar
parent
45474f29
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
7 deletions
+82
-7
Workplace/package.json
Workplace/package.json
+3
-2
Workplace/src/components/Radar/autoHeight.tsx
Workplace/src/components/Radar/autoHeight.tsx
+75
-0
Workplace/src/components/Radar/index.less
Workplace/src/components/Radar/index.less
+0
-0
Workplace/src/components/Radar/index.tsx
Workplace/src/components/Radar/index.tsx
+2
-2
Workplace/src/index.tsx
Workplace/src/index.tsx
+2
-3
No files found.
Workplace/package.json
View file @
66b26c6e
...
...
@@ -16,7 +16,8 @@
"moment"
:
"^2.22.2"
,
"prop-types"
:
"^15.5.10"
,
"react"
:
"^16.6.3"
,
"umi-request"
:
"^1.0.0"
"umi-request"
:
"^1.0.0"
,
"bizcharts"
:
"^3.5.2"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
...
...
Workplace/src/components/Radar/autoHeight.tsx
0 → 100644
View file @
66b26c6e
import
React
from
'
react
'
;
export
type
IReactComponent
<
P
=
any
>
=
|
React
.
StatelessComponent
<
P
>
|
React
.
ComponentClass
<
P
>
|
React
.
ClassicComponentClass
<
P
>
;
function
computeHeight
(
node
:
HTMLDivElement
)
{
node
.
style
.
height
=
'
100%
'
;
const
totalHeight
=
parseInt
(
getComputedStyle
(
node
).
height
+
''
,
10
);
const
padding
=
parseInt
(
getComputedStyle
(
node
).
paddingTop
+
''
,
10
)
+
parseInt
(
getComputedStyle
(
node
).
paddingBottom
+
''
,
10
);
return
totalHeight
-
padding
;
}
function
getAutoHeight
(
n
:
HTMLDivElement
)
{
if
(
!
n
)
{
return
0
;
}
let
node
=
n
;
let
height
=
computeHeight
(
node
);
const
parentNode
=
node
.
parentNode
as
HTMLDivElement
;
if
(
parentNode
)
{
height
=
computeHeight
(
parentNode
);
}
return
height
;
}
interface
IAutoHeightProps
{
height
?:
number
;
}
function
autoHeight
()
{
return
function
<
P
extends
IAutoHeightProps
>
(
WrappedComponent: React.ComponentClass
<
P
>
| React.SFC
<
P
>
): React.ComponentClass
<
P
>
{
class
AutoHeightComponent
extends
React
.
Component
<
P
&
IAutoHeightProps
>
{
state
=
{
computedHeight
:
0
,
};
root
!
:
HTMLDivElement
;
componentDidMount
()
{
const
{
height
}
=
this
.
props
;
if
(
!
height
)
{
const
h
=
getAutoHeight
(
this
.
root
);
// eslint-disable-next-line
this
.
setState
({
computedHeight
:
h
});
if
(
h
<
1
)
{
const
h
=
getAutoHeight
(
this
.
root
);
this
.
setState
({
computedHeight
:
h
});
}
}
}
handleRoot
=
(
node
:
HTMLDivElement
)
=>
{
this
.
root
=
node
;
};
render
()
{
const
{
height
}
=
this
.
props
;
const
{
computedHeight
}
=
this
.
state
;
const
h
=
height
||
computedHeight
;
return
(
<
div
ref
=
{
this
.
handleRoot
}
>
{
h
>
0
&&
<
WrappedComponent
{
...
this
.
props
}
height
=
{
h
}
/>
}
</
div
>
);
}
}
return
AutoHeightComponent
;
}
;
}
export default autoHeight;
Analysis/src/components/Char
ts/Radar/index.less
→
Workplace/src/componen
ts/Radar/index.less
View file @
66b26c6e
File moved
Analysis/src/components/Char
ts/Radar/index.tsx
→
Workplace/src/componen
ts/Radar/index.tsx
View file @
66b26c6e
import
React
,
{
Component
}
from
'
react
'
;
import
{
Chart
,
G2
,
Tooltip
,
Geom
,
Coord
,
Axis
}
from
'
bizcharts
'
;
import
{
Chart
,
Tooltip
,
Geom
,
Coord
,
Axis
}
from
'
bizcharts
'
;
import
{
Row
,
Col
}
from
'
antd
'
;
import
autoHeight
from
'
.
.
/autoHeight
'
;
import
autoHeight
from
'
./autoHeight
'
;
import
styles
from
'
./index.less
'
;
export
interface
IRadarProps
{
...
...
Workplace/src/index.tsx
View file @
66b26c6e
...
...
@@ -4,17 +4,16 @@ import { connect } from 'dva';
import
Link
from
'
umi/link
'
;
import
{
Row
,
Col
,
Card
,
List
,
Avatar
}
from
'
antd
'
;
import
{
Dispatch
}
from
'
redux
'
;
import
{
Charts
}
from
'
ant-design-pro
'
;
import
EditableLinkGroup
from
'
./components/EditableLinkGroup
'
;
import
PageHeaderWrapper
from
'
./components/PageHeaderWrapper
'
;
import
Radar
from
'
./components/Radar
'
;
import
{
ModalState
}
from
'
./model
'
;
import
{
CurrentUser
,
Activeties
,
RadarData
,
Notice
}
from
'
./data
'
;
import
styles
from
'
./style.less
'
;
const
{
Radar
}
=
Charts
;
const
links
=
[
{
title
:
'
操作一
'
,
...
...
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