diff --git a/Dockerfile.dev b/Dockerfile.dev
index f5a50e58..96fddc25 100644
--- a/Dockerfile.dev
+++ b/Dockerfile.dev
@@ -3,7 +3,7 @@ FROM node:latest
WORKDIR /usr/src/app/
COPY package.json ./
-RUN npm install --silent --no-cache
+RUN npm install --silent --no-cache --registry=https://registry.npm.taobao.org
COPY ./ ./
diff --git a/config/router.config.js b/config/router.config.js
index e954ced9..cdff38e0 100644
--- a/config/router.config.js
+++ b/config/router.config.js
@@ -155,7 +155,6 @@ export default [
},
{
path: '/profile/basic/:id',
- name: 'basic',
hideInMenu: true,
component: './Profile/BasicProfile',
},
diff --git a/package.json b/package.json
index d31018c2..0704f91a 100644
--- a/package.json
+++ b/package.json
@@ -53,7 +53,7 @@
"dependencies": {
"@antv/data-set": "^0.10.1",
"antd": "^3.16.1",
- "bizcharts": "3.5.2-beta.1",
+ "bizcharts": "^3.5.3-beta.0",
"bizcharts-plugin-slider": "^2.1.1-beta.1",
"classnames": "^2.2.6",
"dva": "^2.4.1",
diff --git a/src/components/Charts/Bar/index.js b/src/components/Charts/Bar/index.js
index f898a122..2f7ee243 100644
--- a/src/components/Charts/Bar/index.js
+++ b/src/components/Charts/Bar/index.js
@@ -11,14 +11,6 @@ class Bar extends Component {
autoHideXLabels: false,
};
- componentDidMount() {
- window.addEventListener('resize', this.resize, { passive: true });
- }
-
- componentWillUnmount() {
- window.removeEventListener('resize', this.resize);
- }
-
handleRoot = n => {
this.root = n;
};
@@ -30,6 +22,7 @@ class Bar extends Component {
resizeObserver() {
const ro = new ResizeObserver(entries => {
const { width, height } = entries[0].contentRect;
+ this.resize();
this.setState(preState => {
if (preState.width !== width || preState.height !== height) {
return {
diff --git a/src/components/Charts/Pie/index.js b/src/components/Charts/Pie/index.js
index 5f80d747..ae3201f2 100644
--- a/src/components/Charts/Pie/index.js
+++ b/src/components/Charts/Pie/index.js
@@ -6,7 +6,6 @@ import classNames from 'classnames';
import ReactFitText from 'react-fittext';
import Debounce from 'lodash-decorators/debounce';
import Bind from 'lodash-decorators/bind';
-import ResizeObserver from 'resize-observer-polyfill';
import styles from './index.less';
/* eslint react/no-danger:0 */
@@ -17,17 +16,6 @@ class Pie extends Component {
legendBlock: false,
};
- componentDidMount() {
- window.addEventListener(
- 'resize',
- () => {
- this.requestRef = requestAnimationFrame(() => this.resize());
- },
- { passive: true }
- );
- this.resizeObserver();
- }
-
componentDidUpdate(preProps) {
const { data } = this.props;
if (data !== preProps.data) {
@@ -37,17 +25,10 @@ class Pie extends Component {
}
}
- componentWillUnmount() {
- window.cancelAnimationFrame(this.requestRef);
- window.removeEventListener('resize', this.resize);
- this.resize.cancel();
- }
-
getG2Instance = chart => {
this.chart = chart;
requestAnimationFrame(() => {
this.getLegendData();
- this.resize();
});
};
@@ -93,23 +74,6 @@ class Pie extends Component {
});
};
- resizeObserver() {
- const ro = new ResizeObserver(entries => {
- const { height } = entries[0].contentRect;
- this.setState(preState => {
- if (preState.height !== height) {
- return {
- height,
- };
- }
- return null;
- });
- });
- if (this.chartDom) {
- ro.observe(this.chartDom);
- }
- }
-
// for window resize auto responsive legend
@Bind()
@Debounce(300)
@@ -223,45 +187,39 @@ class Pie extends Component {
return (
-
{
- this.chartDom = ref;
- }}
- >
-
-
-
- {!!tooltip && }
-
-
-
-
- {(subTitle || total) && (
-
- {subTitle &&
{subTitle}
}
- {/* eslint-disable-next-line */}
- {total && (
-
{typeof total === 'function' ? total() : total}
- )}
-
- )}
-
-
-
+
+
+
+ {!!tooltip && }
+
+
+
+
+ {(subTitle || total) && (
+
+ {subTitle &&
{subTitle}
}
+ {/* eslint-disable-next-line */}
+ {total && (
+
{typeof total === 'function' ? total() : total}
+ )}
+
+ )}
+
+
{hasLegend && (
{legendData.map((item, i) => (
diff --git a/src/components/Charts/TagCloud/index.js b/src/components/Charts/TagCloud/index.js
index 4898d821..2f60124a 100644
--- a/src/components/Charts/TagCloud/index.js
+++ b/src/components/Charts/TagCloud/index.js
@@ -19,11 +19,8 @@ class TagCloud extends Component {
};
componentDidMount() {
- requestAnimationFrame(() => {
- this.initTagCloud();
- this.renderChart();
- });
- window.addEventListener('resize', this.resize, { passive: true });
+ this.initTagCloud();
+ this.renderChart();
}
componentDidUpdate(preProps) {
@@ -35,16 +32,8 @@ class TagCloud extends Component {
componentWillUnmount() {
this.isUnmount = true;
- window.cancelAnimationFrame(this.requestRef);
- window.removeEventListener('resize', this.resize);
}
- resize = () => {
- this.requestRef = requestAnimationFrame(() => {
- this.renderChart();
- });
- };
-
saveRootRef = node => {
this.root = node;
};
diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js
index 609bf199..e76271ac 100644
--- a/src/pages/Dashboard/Analysis.js
+++ b/src/pages/Dashboard/Analysis.js
@@ -18,7 +18,6 @@ const OfflineData = React.lazy(() => import('./OfflineData'));
}))
class Analysis extends Component {
state = {
- loading: true,
salesType: 'all',
currentTabKey: '',
rangePickerValue: getTimeDistance('year'),
@@ -31,18 +30,9 @@ class Analysis extends Component {
type: 'chart/fetch',
});
});
- setTimeout(() => {
- this.setState({
- loading: false,
- });
- }, 2000);
}
componentWillUnmount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'chart/clear',
- });
cancelAnimationFrame(this.reqRef);
}
@@ -96,9 +86,8 @@ class Analysis extends Component {
};
render() {
- const { rangePickerValue, salesType, currentTabKey, loading: stateLoading } = this.state;
- const { chart, loading: propsLoading } = this.props;
- const loading = stateLoading || propsLoading;
+ const { rangePickerValue, salesType, currentTabKey } = this.state;
+ const { chart, loading } = this.props;
const {
visitData,
visitData2,
diff --git a/src/pages/Dashboard/Workplace.js b/src/pages/Dashboard/Workplace.js
index d71b122a..3021c2ff 100644
--- a/src/pages/Dashboard/Workplace.js
+++ b/src/pages/Dashboard/Workplace.js
@@ -62,13 +62,6 @@ class Workplace extends PureComponent {
});
}
- componentWillUnmount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'chart/clear',
- });
- }
-
renderActivities() {
const {
activities: { list },
diff --git a/src/pages/List/TableList.js b/src/pages/List/TableList.js
index 1230c509..f3b9a1dd 100644
--- a/src/pages/List/TableList.js
+++ b/src/pages/List/TableList.js
@@ -1,7 +1,7 @@
import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva';
import moment from 'moment';
-import router from 'umi/router';
+import Link from 'umi/link';
import {
Row,
Col,
@@ -293,7 +293,7 @@ class TableList extends PureComponent {
{
title: '规则名称',
dataIndex: 'name',
- render: text => this.previewItem(text)}>{text},
+ render: text => {text},
},
{
title: '描述',
@@ -383,10 +383,6 @@ class TableList extends PureComponent {
});
};
- previewItem = id => {
- router.push(`/profile/basic/${id}`);
- };
-
handleFormReset = () => {
const { form, dispatch } = this.props;
form.resetFields();