|
|
@@ -10,6 +10,7 @@
|
|
|
placeholder="监测站点"
|
|
|
:maxTagCount="2"
|
|
|
:maxTagTextLength="4"
|
|
|
+ @change="changeStid"
|
|
|
v-model:value="dataCenter.formData.stcd"
|
|
|
:options="dataCenter.st_options"
|
|
|
/>
|
|
|
@@ -281,6 +282,7 @@ function queryData() {
|
|
|
// }
|
|
|
// 查询展示数据
|
|
|
function getHistoryWaterData() {
|
|
|
+ dataCenter.chartsData = []
|
|
|
dataCenter.formData.start_time = dataCenter.timeData.time[0];
|
|
|
dataCenter.formData.end_time = dataCenter.timeData.time[1];
|
|
|
getSingleStAnalyze(dataCenter.formData).then((res) => {
|
|
|
@@ -357,6 +359,34 @@ function setunit(name) {
|
|
|
});
|
|
|
return text;
|
|
|
}
|
|
|
+function waterLevel(max, min) {
|
|
|
+ let maxValue = Math.ceil(max);
|
|
|
+ let minValue = Math.floor(min);
|
|
|
+ let interval = 0;
|
|
|
+ console.log((max - min) / 5);
|
|
|
+ if ((max - min) / 5 <= 0.2) {
|
|
|
+ interval = 0.2;
|
|
|
+ maxValue = Math.floor(maxValue);
|
|
|
+ maxValue = Math.ceil(maxValue);
|
|
|
+ } else if ((max - min) / 5 <= 0.5) {
|
|
|
+ interval = 0.5;
|
|
|
+ maxValue = Math.floor(maxValue);
|
|
|
+ maxValue = Math.ceil(maxValue);
|
|
|
+ } else if ((max - min) / 5 <= 1) {
|
|
|
+ interval = 0.5;
|
|
|
+ maxValue = Math.floor(maxValue);
|
|
|
+ maxValue = Math.ceil(maxValue);
|
|
|
+ } else {
|
|
|
+ // 获取余数
|
|
|
+ minValue = minValue - (5 - ((maxValue - minValue) % 5));
|
|
|
+ interval = (maxValue - minValue) / 5;
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ interval: interval,
|
|
|
+ maxValue: maxValue,
|
|
|
+ minValue: minValue,
|
|
|
+ };
|
|
|
+}
|
|
|
// 循环渲染数据
|
|
|
function chartsArrBox(arr, dchar_type) {
|
|
|
arr.forEach((element, index) => {
|
|
|
@@ -482,6 +512,7 @@ function chartsArrBox(arr, dchar_type) {
|
|
|
},
|
|
|
yAxis: {
|
|
|
type: 'value',
|
|
|
+ scale:true,
|
|
|
},
|
|
|
series: [
|
|
|
// {
|
|
|
@@ -521,8 +552,15 @@ async function getDataData() {
|
|
|
}
|
|
|
dataCenter.st_options = arr;
|
|
|
dataCenter.formData.stcd = dataCenter.st_options[0].value;
|
|
|
+ getDataAllElementsFn([dataCenter.st_options[0].value])
|
|
|
});
|
|
|
- await getDataAllElements().then((res) => {
|
|
|
+
|
|
|
+}
|
|
|
+const changeStid = (e) => {
|
|
|
+ getDataAllElementsFn([e])
|
|
|
+ }
|
|
|
+async function getDataAllElementsFn(ids) {
|
|
|
+ await getDataAllElements({station:ids}).then((res) => {
|
|
|
res.data.forEach((element) => {
|
|
|
element.label = element.dchar_name;
|
|
|
element.value = element.dchar;
|
|
|
@@ -532,7 +570,6 @@ async function getDataData() {
|
|
|
});
|
|
|
getHistoryWaterData();
|
|
|
}
|
|
|
-
|
|
|
function resetting() {
|
|
|
getDataData();
|
|
|
}
|