Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Fix cancel_label request
Browse files Browse the repository at this point in the history
  • Loading branch information
cuiyuan committed Aug 9, 2018
1 parent 62c2733 commit 1061ffd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions web/src/common/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ let COMMON_SERVER = '';
let apiConfig = {
// Get the operation menu
getTooltipMenu: COMMON_SERVER + '/v1/menus',
// Menu data operation
menuOpera: COMMON_SERVER + '/v1/data/',
// Get the trend graph
getTrend: COMMON_SERVER + '/v1/data/',
// Get the thumbnail trend graph
Expand Down
1 change: 0 additions & 1 deletion web/src/common/baseComponent/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default class Chart extends Component {
let chartConfig = config.chart;
let chartType = this.props.type || 'chart';

console.log(config)
this.chart = new Highcharts[chartType]({
...config,
chart: {
Expand Down
23 changes: 22 additions & 1 deletion web/src/index/component/trend.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export default class Trend extends Component {
}
if (startTime && endTime) {
self.labelSet.splice(currentLabelItemIndex, 1);
self.cancelLabel(startTime, endTime, 'simple', e);
self.actionLabel(startTime, endTime, action);
}
});

Expand Down Expand Up @@ -501,6 +501,27 @@ export default class Trend extends Component {
}
}

actionLabel(startTime, endTime, action, selectType) {
let dataName = this.props.dataName;
let chart = this.chart;
let url = api.menuOpera
+ dataName
+ '?startTime=' + startTime
+ '&endTime=' + endTime
+ '&action=' + action;
let time = chart && chart.xAxis[0].getExtremes();
if (!selectType || selectType === 'simple') {
axiosInstance.put(url).then(response => {
return this.setTrendData(dataName, time.min, time.max);
}).catch(err => {
console.log(err);
});
}
else {

}
}

cancelLabel(selectedMin, selectedMax, selectType, e) {
let dataName = this.props.dataName;
let chart = this.chart;
Expand Down

0 comments on commit 1061ffd

Please sign in to comment.