diff --git a/shandan-browser/src/main/resources/static/js/report.js b/shandan-browser/src/main/resources/static/js/report.js index ce31424..ec1d0b9 100644 --- a/shandan-browser/src/main/resources/static/js/report.js +++ b/shandan-browser/src/main/resources/static/js/report.js @@ -63,7 +63,7 @@ ReportComponent.prototype.openEchartsConfigLayer = function () { $('#echartsConfigForm').parent().css('overflow', 'visible') }, yes: function (index) { - _this.requestData(()=> layer.close(index)); + _this.requestData(() => layer.close(index)); } }); } @@ -203,12 +203,15 @@ ReportComponent.prototype.validate = function (formVal) { if (!formVal.aggregationType) { showErrorMsg('请设置聚合方式'); return; - } else { - if ((formVal.aggregationType == 'sum' || formVal.aggregationType == 'avg') && !formVal.fieldY) { - showErrorMsg('请设置聚合字段'); - return; - } } + if ((formVal.aggregationType == 'sum' || formVal.aggregationType == 'avg') && !formVal.fieldY) { + showErrorMsg('请设置聚合字段'); + return; + } + if(formVal.aggregationType == 'count' && !formVal.fieldY){ + formVal.fieldY = formVal.fieldX; + } + return true; }