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
A
ant-design-pro
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
ant-design-pro
Commits
5684b5d5
Unverified
Commit
5684b5d5
authored
Mar 13, 2019
by
ιεΈ
Committed by
GitHub
Mar 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: remove import lib (#3736)
parent
cb5a0834
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
81 deletions
+14
-81
config/config.js
config/config.js
+1
-1
src/components/Charts/AsyncLoadBizCharts.js
src/components/Charts/AsyncLoadBizCharts.js
+0
-44
src/components/Charts/index.js
src/components/Charts/index.js
+10
-18
src/pages/Dashboard/Analysis.js
src/pages/Dashboard/Analysis.js
+1
-6
src/pages/Dashboard/Monitor.js
src/pages/Dashboard/Monitor.js
+1
-6
src/pages/Dashboard/Workplace.js
src/pages/Dashboard/Workplace.js
+1
-6
No files found.
config/config.js
View file @
5684b5d5
...
@@ -6,7 +6,7 @@ import defaultSettings from '../src/defaultSettings';
...
@@ -6,7 +6,7 @@ import defaultSettings from '../src/defaultSettings';
import
slash
from
'
slash2
'
;
import
slash
from
'
slash2
'
;
const
{
pwa
,
primaryColor
}
=
defaultSettings
;
const
{
pwa
,
primaryColor
}
=
defaultSettings
;
const
{
NODE_ENV
,
APP_TYPE
,
TEST
}
=
process
.
env
;
const
{
APP_TYPE
,
TEST
}
=
process
.
env
;
const
plugins
=
[
const
plugins
=
[
[
[
...
...
src/components/Charts/AsyncLoadBizCharts.js
deleted
100644 β 0
View file @
cb5a0834
import
React
from
'
react
'
;
import
PageLoading
from
'
../PageLoading
'
;
import
{
importCDN
}
from
'
@/utils/utils
'
;
let
isLoaderBizChart
=
false
;
const
loadBizCharts
=
async
()
=>
{
if
(
isLoaderBizChart
)
{
return
Promise
.
resolve
(
true
);
}
await
Promise
.
all
([
importCDN
(
'
//gw.alipayobjects.com/os/lib/bizcharts/3.4.3/umd/BizCharts.min.js
'
),
importCDN
(
'
//gw.alipayobjects.com/os/lib/antv/data-set/0.10.1/dist/data-set.min.js
'
),
]);
// eslint-disable-next-line no-console
console
.
log
(
'
bizCharts load success
'
);
isLoaderBizChart
=
true
;
return
Promise
.
resolve
(
true
);
};
class
AsyncLoadBizCharts
extends
React
.
Component
{
state
=
{
loading
:
!
isLoaderBizChart
,
};
async
componentDidMount
()
{
await
loadBizCharts
();
requestAnimationFrame
(()
=>
{
this
.
setState
({
loading
:
false
,
});
});
}
render
()
{
const
{
children
}
=
this
.
props
;
const
{
loading
}
=
this
.
state
;
if
(
!
loading
)
{
return
children
;
}
return
<
PageLoading
/>
;
}
}
export
{
loadBizCharts
,
AsyncLoadBizCharts
};
src/components/Charts/index.js
View file @
5684b5d5
import
React
,
{
Suspense
}
from
'
react
'
;
import
numeral
from
'
numeral
'
;
import
numeral
from
'
numeral
'
;
import
ChartCard
from
'
./ChartCard
'
;
import
ChartCard
from
'
./ChartCard
'
;
import
Field
from
'
./Field
'
;
import
Field
from
'
./Field
'
;
import
Bar
from
'
./Bar
'
;
const
getComponent
=
Component
=>
props
=>
(
import
Pie
from
'
./Pie
'
;
<
Suspense
fallback
=
"
...
"
>
import
Radar
from
'
./Radar
'
;
<
Component
{...
props
}
/
>
import
Gauge
from
'
./Gauge
'
;
<
/Suspense
>
import
MiniArea
from
'
./MiniArea
'
;
);
import
MiniBar
from
'
./MiniBar
'
;
import
MiniProgress
from
'
./MiniProgress
'
;
const
Bar
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./Bar
'
)));
import
WaterWave
from
'
./WaterWave
'
;
const
Pie
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./Pie
'
)));
import
TagCloud
from
'
./TagCloud
'
;
const
Radar
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./Radar
'
)));
import
TimelineChart
from
'
./TimelineChart
'
;
const
Gauge
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./Gauge
'
)));
const
MiniArea
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./MiniArea
'
)));
const
MiniBar
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./MiniBar
'
)));
const
MiniProgress
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./MiniProgress
'
)));
const
WaterWave
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./WaterWave
'
)));
const
TagCloud
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./TagCloud
'
)));
const
TimelineChart
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./TimelineChart
'
)));
const
yuan
=
val
=>
`Β₯
${
numeral
(
val
).
format
(
'
0,0
'
)}
`
;
const
yuan
=
val
=>
`Β₯
${
numeral
(
val
).
format
(
'
0,0
'
)}
`
;
...
...
src/pages/Dashboard/Analysis.js
View file @
5684b5d5
...
@@ -5,7 +5,6 @@ import GridContent from '@/components/PageHeaderWrapper/GridContent';
...
@@ -5,7 +5,6 @@ import GridContent from '@/components/PageHeaderWrapper/GridContent';
import
{
getTimeDistance
}
from
'
@/utils/utils
'
;
import
{
getTimeDistance
}
from
'
@/utils/utils
'
;
import
styles
from
'
./Analysis.less
'
;
import
styles
from
'
./Analysis.less
'
;
import
PageLoading
from
'
@/components/PageLoading
'
;
import
PageLoading
from
'
@/components/PageLoading
'
;
import
{
AsyncLoadBizCharts
}
from
'
@/components/Charts/AsyncLoadBizCharts
'
;
const
IntroduceRow
=
React
.
lazy
(()
=>
import
(
'
./IntroduceRow
'
));
const
IntroduceRow
=
React
.
lazy
(()
=>
import
(
'
./IntroduceRow
'
));
const
SalesCard
=
React
.
lazy
(()
=>
import
(
'
./SalesCard
'
));
const
SalesCard
=
React
.
lazy
(()
=>
import
(
'
./SalesCard
'
));
...
@@ -182,8 +181,4 @@ class Analysis extends Component {
...
@@ -182,8 +181,4 @@ class Analysis extends Component {
}
}
}
}
export
default
props
=>
(
export
default
Analysis
;
<
AsyncLoadBizCharts
>
<
Analysis
{...
props
}
/
>
<
/AsyncLoadBizCharts
>
);
src/pages/Dashboard/Monitor.js
View file @
5684b5d5
import
React
,
{
Component
}
from
'
react
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
{
AsyncLoadBizCharts
}
from
'
@/components/Charts/AsyncLoadBizCharts
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
{
formatMessage
,
FormattedMessage
}
from
'
umi/locale
'
;
import
{
formatMessage
,
FormattedMessage
}
from
'
umi/locale
'
;
import
{
Row
,
Col
,
Card
,
Tooltip
}
from
'
antd
'
;
import
{
Row
,
Col
,
Card
,
Tooltip
}
from
'
antd
'
;
...
@@ -242,8 +241,4 @@ class Monitor extends Component {
...
@@ -242,8 +241,4 @@ class Monitor extends Component {
}
}
}
}
export
default
props
=>
(
export
default
Monitor
;
<
AsyncLoadBizCharts
>
<
Monitor
{...
props
}
/
>
<
/AsyncLoadBizCharts
>
);
src/pages/Dashboard/Workplace.js
View file @
5684b5d5
...
@@ -3,7 +3,6 @@ import moment from 'moment';
...
@@ -3,7 +3,6 @@ import moment from 'moment';
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
Link
from
'
umi/link
'
;
import
Link
from
'
umi/link
'
;
import
{
Row
,
Col
,
Card
,
List
,
Avatar
}
from
'
antd
'
;
import
{
Row
,
Col
,
Card
,
List
,
Avatar
}
from
'
antd
'
;
import
{
AsyncLoadBizCharts
}
from
'
@/components/Charts/AsyncLoadBizCharts
'
;
import
{
Radar
}
from
'
@/components/Charts
'
;
import
{
Radar
}
from
'
@/components/Charts
'
;
import
EditableLinkGroup
from
'
@/components/EditableLinkGroup
'
;
import
EditableLinkGroup
from
'
@/components/EditableLinkGroup
'
;
import
PageHeaderWrapper
from
'
@/components/PageHeaderWrapper
'
;
import
PageHeaderWrapper
from
'
@/components/PageHeaderWrapper
'
;
...
@@ -253,8 +252,4 @@ class Workplace extends PureComponent {
...
@@ -253,8 +252,4 @@ class Workplace extends PureComponent {
}
}
}
}
export
default
props
=>
(
export
default
Workplace
;
<
AsyncLoadBizCharts
>
<
Workplace
{...
props
}
/
>
<
/AsyncLoadBizCharts
>
);
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