|
@@ -2831,8 +2831,8 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 趋势分析对话框 -->
|
|
|
- <el-dialog @close="disposeChart" :title="analysis.title" :visible.sync="analysis.open" width="1400px" append-to-body>
|
|
|
- <el-form :model="analysisQueryParams" ref="queryForm" :inline="true" label-width="68px">
|
|
|
+ <el-dialog @close="handleDialogClose" :title="analysis.title" :visible.sync="analysis.open" width="1400px" append-to-body>
|
|
|
+ <el-form :model="analysisQueryParams" ref="queryForm" :inline="true" label-width="102px">
|
|
|
<el-form-item label="开始日期" prop="startDate">
|
|
|
<el-date-picker
|
|
|
@change="handleAnalysisQuery"
|
|
@@ -2864,6 +2864,13 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <br/>
|
|
|
+ <el-form-item label="纵坐标最小值" prop="minY">
|
|
|
+ <el-input v-model="minY" placeholder="请输入" @change="handleAnalysisQuery"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="纵坐标最大值" prop="maxY">
|
|
|
+ <el-input v-model="maxY" placeholder="请输入" @change="handleAnalysisQuery"></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<div id="trendChart" style="width:1340px;height:600px;"></div>
|
|
|
</el-dialog>
|
|
@@ -2883,10 +2890,12 @@ export default {
|
|
|
components: { Treeselect },
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 纵坐标最小值
|
|
|
+ minY: null,
|
|
|
+ // 纵坐标最大值
|
|
|
+ maxY: null,
|
|
|
fileList: [], // 上传文件列表
|
|
|
uploading: false, // 是否正在上传文件
|
|
|
-
|
|
|
-
|
|
|
// 选中的对比指标
|
|
|
chemicalChosen: null,
|
|
|
// 对比指标下拉框
|
|
@@ -4143,6 +4152,12 @@ export default {
|
|
|
this.handleAnalysisQuery();
|
|
|
}
|
|
|
},
|
|
|
+ handleDialogClose() {
|
|
|
+ this.disposeChart();
|
|
|
+ this.minY = null;
|
|
|
+ this.maxY = null;
|
|
|
+ this.chemicalChosen = null;
|
|
|
+ },
|
|
|
/** 销毁趋势图 */
|
|
|
disposeChart() {
|
|
|
this.echarts.dispose(this.chart);
|
|
@@ -4162,7 +4177,7 @@ export default {
|
|
|
let startDate = new Date(this.analysisQueryParams.startDate);
|
|
|
this.analysisQueryParams.endDate = endDate.getFullYear() + "-" + Number(endDate.getMonth() + 1) + "-" + endDate.getDate();
|
|
|
this.analysisQueryParams.startDate = startDate.getFullYear() + "-" + Number(startDate.getMonth() + 1) + "-" + startDate.getDate();
|
|
|
- this.draw2();
|
|
|
+ this.draw2(this.minY, this.maxY);
|
|
|
} else {
|
|
|
this.disposeChart();
|
|
|
this.valueList = [];
|
|
@@ -4171,28 +4186,59 @@ export default {
|
|
|
let startDate = new Date(this.analysisQueryParams.startDate);
|
|
|
this.analysisQueryParams.endDate = endDate.getFullYear() + "-" + Number(endDate.getMonth() + 1) + "-" + endDate.getDate();
|
|
|
this.analysisQueryParams.startDate = startDate.getFullYear() + "-" + Number(startDate.getMonth() + 1) + "-" + startDate.getDate();
|
|
|
- this.draw();
|
|
|
+ this.draw(this.minY, this.maxY);
|
|
|
}
|
|
|
},
|
|
|
/** 绘制趋势图 */
|
|
|
- draw() {
|
|
|
+ draw(minY, maxY) {
|
|
|
+ let yValueIsNull = false;
|
|
|
+ if (minY != null && maxY != null) {
|
|
|
+ yValueIsNull = false;
|
|
|
+ } else {
|
|
|
+ yValueIsNull = true;
|
|
|
+ }
|
|
|
getAnalysisData(this.analysisQueryParams).then(response => {
|
|
|
let data = response.data;
|
|
|
- this.maxValue = 0;
|
|
|
- this.minValue = data[0].valueData;
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
- if (data[i].valueData != null) {
|
|
|
- if (data[i].valueData.toString().search("%") != -1) {
|
|
|
- this.valueList[i] = data[i].valueData.substr(0, data[i].valueData.length - 1);
|
|
|
- } else {
|
|
|
- this.valueList[i] = data[i].valueData;
|
|
|
+ if (yValueIsNull == false) {
|
|
|
+ this.maxValue = maxY;
|
|
|
+ this.minValue = minY;
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].valueData != null) {
|
|
|
+ if (data[i].valueData.toString().search("%") != -1) {
|
|
|
+ this.valueList[i] = data[i].valueData.substr(0, data[i].valueData.length - 1);
|
|
|
+ } else {
|
|
|
+ this.valueList[i] = data[i].valueData;
|
|
|
+ }
|
|
|
+ this.dateList[i] = data[i].dateData;
|
|
|
}
|
|
|
- this.dateList[i] = data[i].dateData;
|
|
|
- if (data[i].valueData > this.maxValue) {
|
|
|
- this.maxValue = data[i].valueData;
|
|
|
+ }
|
|
|
+ let tempValueList = [];
|
|
|
+ let tempDateList = [];
|
|
|
+ for (let i = 0; i < this.valueList.length; i++) {
|
|
|
+ if (Number(this.valueList[i]) >= Number(minY) && Number(this.valueList[i]) <= Number(maxY)) {
|
|
|
+ tempValueList.push(this.valueList[i]);
|
|
|
+ tempDateList.push(this.dateList[i]);
|
|
|
}
|
|
|
- if (data[i].valueData < this.minValue) {
|
|
|
- this.minValue = data[i].valueData;
|
|
|
+ }
|
|
|
+ this.valueList = tempValueList;
|
|
|
+ this.dateList = tempDateList;
|
|
|
+ } else {
|
|
|
+ this.maxValue = 0;
|
|
|
+ this.minValue = data[0].valueData;
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].valueData != null) {
|
|
|
+ if (data[i].valueData.toString().search("%") != -1) {
|
|
|
+ this.valueList[i] = data[i].valueData.substr(0, data[i].valueData.length - 1);
|
|
|
+ } else {
|
|
|
+ this.valueList[i] = data[i].valueData;
|
|
|
+ }
|
|
|
+ this.dateList[i] = data[i].dateData;
|
|
|
+ if (data[i].valueData > this.maxValue) {
|
|
|
+ this.maxValue = data[i].valueData;
|
|
|
+ }
|
|
|
+ if (data[i].valueData < this.minValue) {
|
|
|
+ this.minValue = data[i].valueData;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -4242,7 +4288,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
/** 绘制包含对比指标的趋势图 */
|
|
|
- draw2() {
|
|
|
+ draw2(minY, maxY) {
|
|
|
getAnalysisData(this.analysisQueryParams).then(response => {
|
|
|
let data = response.data;
|
|
|
this.maxValue2 = 0;
|