Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.0.2 #5

Open
wants to merge 16 commits into
base: v2.0.1
Choose a base branch
from
Prev Previous commit
Next Next commit
lint:js Corrected
  • Loading branch information
Tianlikai committed Feb 19, 2019
commit 02fc1570fb51e1adeb2e451d81ad49ae6d8e3d81
16 changes: 15 additions & 1 deletion src/components/ListCard/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import classnames from 'classnames';
import PropTypes from 'prop-types';

import { Spin, Checkbox } from 'antd';
import Card from './Card';
Expand All @@ -13,10 +14,23 @@ export default class ListCard extends React.Component {
fixContent: 'videoListContent',
};

static propTypes = {
fixWrapper: PropTypes.string,
fixSelect: PropTypes.string,
fixContent: PropTypes.string,
className: PropTypes.string,
display: PropTypes.bool,
loading: PropTypes.bool,
data: PropTypes.array,
selectedRowKeys: PropTypes.array,
handleChange: PropTypes.func,
};

constructor(props) {
super(props);
const { selectedRowKeys } = props;
this.state = {
selectedRowKeys: props.selectedRowKeys ? new Set(props.selectedRowKeys) : new Set([]), // 总数
selectedRowKeys: selectedRowKeys ? new Set(selectedRowKeys) : new Set([]), // 总数
indeterminate: false,
checkAll: false,
};
Expand Down
1 change: 1 addition & 0 deletions src/hoc/TableHoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const TableHoc = config => (WrappedComponent) => {
static propTypes = {
fixClass: PropTypes.string,
className: PropTypes.string,
match: PropTypes.object,
};

componentDidMount() {
Expand Down
1 change: 1 addition & 0 deletions src/layouts/BasicSideMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default class SideMenu extends Component {
</Item>
);
}
return null;
})}
</SubMenu>
);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Home/Detail/BaseDetail/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class BaseDetail extends Component {
this.setState({
visibleModal: false,
});
Storage.del('fromCreatePromotion')
Storage.del('fromCreatePromotion');
};

render() {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Home/Form/BaseForm/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from 'react';

import PropTypes from 'prop-types';
import { Helmet } from 'react-helmet';
import { toJS } from 'mobx'
import { toJS } from 'mobx';
import { inject, observer } from 'mobx-react';

import Spinner from 'components/Spinner/Spinner'; // eslint-disable-line
Expand Down
8 changes: 3 additions & 5 deletions src/routes/Home/Form/UploadForm/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@ import './style.scss';
// @observer
class UploadForm extends Component {
static propTypes = {
FormStore: PropTypes.object.isRequired,
// FormStore: PropTypes.object.isRequired,
routerData: PropTypes.object.isRequired,
history: PropTypes.object.isRequired,
// history: PropTypes.object.isRequired,
};

componentDidMount() {
// const { FormStore } = this.props;
// FormStore.initialData();
}

handleSubmit = (values) => {
console.log(values);
};
handleSubmit = () => {};

render() {
const {
Expand Down
4 changes: 1 addition & 3 deletions src/routes/Home/List/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export default class Container extends React.Component {
routerData: PropTypes.object,
};

handleTabChange = (key) => {
console.log(key);
};
handleTabChange = () => {};

render() {
const {
Expand Down
41 changes: 17 additions & 24 deletions src/utils/echarts/E_BAR_CHART.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import {
formatterHintWithDbClick,
adjustGrid,
getSeriesItem,
} from './EchartUtil';
} from './EChartUtil';
import {
BAR_SeriesItemType,
BAR_LabelPosition,
BAR_MaxWidth,
BAR_MinHeight,
BAR_SERIES_ITEM_TYPE,
BAR_LABEL_POSITION,
BAR_MAX_WIDTH,
BAR_MIN_HEIGHT,
DataZoomWidth,
ColorArray,
} from './EchartType';
} from './EChartType';

/**
* 返回条形图表配置 option
Expand All @@ -28,13 +27,7 @@ function getBarChartOpt({
type, chartData, from, isShow, WhetherTheTrip,
}) {
const {
legend,
x_name: seriesName,
y_name,
x: seriesData,
y,
groupNum,
group_type = [],
legend, xName, yName, x: seriesData, y, groupNum, groupType = [],
} = chartData;
const flag = y.every(ele => ele === ''); // 判断是否所有的刻度标签都为空
const option = {
Expand Down Expand Up @@ -65,14 +58,14 @@ function getBarChartOpt({
containLabel: true,
},
xAxis: {
name: seriesName,
name: xName,
nameLocation: 'middle',
nameGap: 25,
type: 'value',
boundaryGap: [0, 0.01],
},
yAxis: {
name: y_name,
name: yName,
type: 'category',
data: y,
},
Expand All @@ -94,16 +87,16 @@ function getBarChartOpt({
};
if (flag) option.grid.left = '70px'; // 如果坐标轴刻度标签全部为空 则设置该属性 防止坐标轴名称显示不全
const groupCount = seriesData.length; // 多个分组方式时的组数
for (let i = 0; i < groupCount; i++) {
for (let i = 0; i < groupCount; i += 1) {
const datas = foreachDataSetBackgroundColors(seriesData[i], i, type);
const itemInfo = {
name: groupNum === 1 ? seriesName : `${legend[i]}`,
type: BAR_SeriesItemType,
barMaxWidth: BAR_MaxWidth,
barMinHeight: BAR_MinHeight,
name: groupNum === 1 ? xName : `${legend[i]}`,
type: BAR_SERIES_ITEM_TYPE,
barMaxWidth: BAR_MAX_WIDTH,
barMinHeight: BAR_MIN_HEIGHT,
colorIndex: i,
show: false,
position: BAR_LabelPosition,
position: BAR_LABEL_POSITION,
color: '#4A4A4A',
data: datas,
};
Expand All @@ -122,11 +115,11 @@ function getBarChartOpt({
if (isShow) {
// 是否显示数值
const mainAxisLen = y.length; // y轴显示的数目
for (let i = 0, y = option.series.length; i < y; i++) {
for (let i = 0, Y = option.series.length; i < Y; i += 1) {
option.series[i].label.normal.show = true;
}
// 时间类型的数据 需要设置dataDoom 要显示最新的
if (group_type && (group_type[0] === 'datetime' || group_type[0] === 'date')) {
if (groupType && (groupType[0] === 'datetime' || groupType[0] === 'date')) {
option.dataZoom[0].start = 100 - getDataZoomEnd(mainAxisLen);
} else {
option.dataZoom[0].end = getDataZoomEnd(mainAxisLen);
Expand Down
Loading