Skip to content

Commit

Permalink
fix default show
Browse files Browse the repository at this point in the history
  • Loading branch information
yyy2015 committed Sep 5, 2017
1 parent 38e08dd commit 5c53bdd
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion StatDisplay/src/components/charts/selectorForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const SelectorForm = ({
className={styles['form-item']}
>
{getFieldDecorator('threshold',{
initialValue: 'HOUR'
initialValue: 'DAY'
})(
<Select>
<Option value = "HOUR">小时</Option>
Expand Down
8 changes: 6 additions & 2 deletions StatDisplay/src/models/activeness/activenessInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ export default {
history.listen(location => {
const matchFlow = pathToRegexp('/activeness').exec(location.pathname);
if(matchFlow) {
const currentDate = new Date();
const currentHour = parseInt(currentDate.valueOf()/(1000*60*60));//距离现在最近的整点对应的小时数
const beforeHour = currentHour-5*24;//获取距离最近整点前5天的数据
console.log("currentHour :"+currentHour+";beforehour:"+beforeHour);
dispatch({
type: 'getHourData',
payload: {probeId:"1s12sz",startHour:40000,startRange:5,threshold:"HOUR"}
payload: {probeId:"1s12sz",startHour:beforeHour,startRange:5,threshold:"DAY"}
});
dispatch({
type: 'getDetail',
payload: {hour:415300,probeId:"1s12sz"}
payload: {hour:currentHour,probeId:"1s12sz"}
});
dispatch({
type: 'getProbeOptions',
Expand Down
8 changes: 6 additions & 2 deletions StatDisplay/src/models/customerFlow/customerFlowInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ export default {
history.listen(location => {
const matchFlow = pathToRegexp('/customerFlow').exec(location.pathname);
if(matchFlow) {
const currentDate = new Date();
const currentHour = parseInt(currentDate.valueOf()/(1000*60*60));//距离现在最近的整点对应的小时数
const beforeHour = currentHour-5*24;//获取距离最近整点前5天的数据
console.log("currentHour :"+currentHour+";beforehour:"+beforeHour);
dispatch({
type: 'getFlow',
payload: {probeId:"1s12sz",startHour:414897,startRange:5,threshold:"HOUR"}
payload: {probeId:"1s12sz",startHour:beforeHour,startRange:5,threshold:"DAY"}
});
dispatch({
type: 'getDetail',
payload: {hour:415357,probeId:"1s12sz"}
payload: {hour:currentHour,probeId:"1s12sz"}
});
dispatch({
type: 'getProbeOptions',
Expand Down
8 changes: 6 additions & 2 deletions StatDisplay/src/models/inStoreHour/inStoreHourInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ export default {
history.listen(location => {
const matchFlow = pathToRegexp('/inStoreHour').exec(location.pathname);
if(matchFlow) {
const currentDate = new Date();
const currentHour = parseInt(currentDate.valueOf()/(1000*60*60));//距离现在最近的整点对应的小时数
const beforeHour = currentHour-5*24;//获取距离最近整点前5天的数据
console.log("currentHour :"+currentHour);
dispatch({
type: 'getHourData',
payload: {probeId:"1s12sz",startHour:40000,startRange:5,threshold:"HOUR"}
payload: {probeId:"1s12sz",startHour:beforeHour,startRange:5,threshold:"DAY"}
});
dispatch({
type: 'getDetail',
payload: {hour:415300,probeId:"1s12sz"}
payload: {hour:currentHour,probeId:"1s12sz"}
});
dispatch({
type: 'getProbeOptions',
Expand Down
8 changes: 6 additions & 2 deletions StatDisplay/src/models/newOld/newOldInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@ export default {
history.listen(location => {
const matchFlow = pathToRegexp('/newAndOld').exec(location.pathname);
if(matchFlow) {
const currentDate = new Date();
const currentHour = parseInt(currentDate.valueOf()/(1000*60*60));//距离现在最近的整点对应的小时数
const beforeHour = currentHour-5*24;//获取距离最近整点前5天的数据
console.log("currentHour :"+currentHour);
dispatch({
type: 'getProbeOptions',
payload: {page:0, size: 10}
});
dispatch({
type: 'getHourData',
payload: {probeId: '1s12sz', startHour:40000, startRange:5, threshold:"HOUR"}
payload: {probeId: '1s12sz', startHour:beforeHour, startRange:5, threshold:"DAY"}
});
dispatch({
type: 'getDetail',
payload: {hour:415300,probeId:"1s12sz"}
payload: {hour:currentHour,probeId:"1s12sz"}
});
}
})
Expand Down
8 changes: 6 additions & 2 deletions StatDisplay/src/models/visitCircle/visitCircleInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ export default {
history.listen(location => {
const matchFlow = pathToRegexp('/visitCircle').exec(location.pathname);
if(matchFlow) {
const currentDate = new Date();
const currentHour = parseInt(currentDate.valueOf()/(1000*60*60));//距离现在最近的整点对应的小时数
const beforeHour = currentHour-5*24;//获取距离最近整点前5天的数据
console.log("currentHour :"+currentHour);
dispatch({
type: 'getHourData',
payload: {probeId:"1s12sz",startHour:40000,startRange:5,threshold:"HOUR"}
payload: {probeId:"1s12sz",startHour:beforeHour,startRange:5,threshold:"DAY"}
});
dispatch({
type: 'getDetail',
payload: {hour:415300,probeId:"1s12sz"}
payload: {hour:currentHour,probeId:"1s12sz"}
});
dispatch({
type: 'getProbeOptions',
Expand Down

0 comments on commit 5c53bdd

Please sign in to comment.