diff --git a/src/views/pictureOnMap/inputSearch.vue b/src/views/pictureOnMap/inputSearch.vue index 7663ccd..62e4522 100644 --- a/src/views/pictureOnMap/inputSearch.vue +++ b/src/views/pictureOnMap/inputSearch.vue @@ -3,7 +3,7 @@ + + + + appStore.MapData, (newValue, oldValue) => { if (appStore.MapData && appStore.MapData.length) { if (number.value === 1) { - GetSearchList(); + GetSearchList(appStore.MapData); number.value = 4; } } @@ -62,9 +105,9 @@ { deep: true, once: true } ); -function GetSearchList() { +function GetSearchList(data) { SelectList.value = []; - appStore.MapData.map(item => { + data.map(item => { SelectList.value = SelectList.value.concat(item.data); }); // console.log('MapData', appStore.MapData, SelectList.value); @@ -123,6 +166,16 @@ // bus.emit('removeMapDatas',['temporary']); }, 500); +const tabsClick = e => { + let type = e.paneName; + getItem.value = ''; + selectmodel.value = ''; + if (type == 'zhandian') { + GetSearchList(appStore.MapData); + } else if (type == 'daolu') { + GetSearchList(roadData.value); + } +}; onMounted(() => { bus.on('YQ_head', val => { console.log('appStore.MapData', appStore.MapData); @@ -146,6 +199,13 @@ z-index: 999; border-radius: 6px; } +.selectTabs { + position: absolute; + + width: 100%; + left: 0; + top: 0; +} :deep(.el-input__wrapper) { height: 30px !important; @@ -175,7 +235,9 @@ background: #0d2359 !important; border-radius: 6px !important; border: 1px solid #0b9bff !important; - + .el-scrollbar { + padding-top: 40px; + } .el-select-dropdown__item { font-family: Source Han Sans CN; font-weight: bold; diff --git a/src/views/pictureOnMap/inputSearch.vue b/src/views/pictureOnMap/inputSearch.vue index 7663ccd..62e4522 100644 --- a/src/views/pictureOnMap/inputSearch.vue +++ b/src/views/pictureOnMap/inputSearch.vue @@ -3,7 +3,7 @@ + + + + appStore.MapData, (newValue, oldValue) => { if (appStore.MapData && appStore.MapData.length) { if (number.value === 1) { - GetSearchList(); + GetSearchList(appStore.MapData); number.value = 4; } } @@ -62,9 +105,9 @@ { deep: true, once: true } ); -function GetSearchList() { +function GetSearchList(data) { SelectList.value = []; - appStore.MapData.map(item => { + data.map(item => { SelectList.value = SelectList.value.concat(item.data); }); // console.log('MapData', appStore.MapData, SelectList.value); @@ -123,6 +166,16 @@ // bus.emit('removeMapDatas',['temporary']); }, 500); +const tabsClick = e => { + let type = e.paneName; + getItem.value = ''; + selectmodel.value = ''; + if (type == 'zhandian') { + GetSearchList(appStore.MapData); + } else if (type == 'daolu') { + GetSearchList(roadData.value); + } +}; onMounted(() => { bus.on('YQ_head', val => { console.log('appStore.MapData', appStore.MapData); @@ -146,6 +199,13 @@ z-index: 999; border-radius: 6px; } +.selectTabs { + position: absolute; + + width: 100%; + left: 0; + top: 0; +} :deep(.el-input__wrapper) { height: 30px !important; @@ -175,7 +235,9 @@ background: #0d2359 !important; border-radius: 6px !important; border: 1px solid #0b9bff !important; - + .el-scrollbar { + padding-top: 40px; + } .el-select-dropdown__item { font-family: Source Han Sans CN; font-weight: bold; diff --git a/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue b/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue index 7187410..11b5504 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue @@ -31,6 +31,7 @@ ? "当日水量分析" : "" }} + {{ AllData.TjData1 ? `(${AllData.TjData1 + AllData.TjData1Unit})` : `` }}
{ @@ -397,6 +406,7 @@ AllData.regionGrade = item.grade; AllData.regionName = item.Name; AllData.waterRegionCode = item.id; + clearEchartsData(); // debugger; // 视角切换 if (item.sort == 0) { @@ -436,7 +446,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData3(); getData7(); @@ -469,7 +478,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData2(); getData3(); @@ -495,7 +503,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData4(); getData5(); @@ -513,7 +520,6 @@ sort: 4, }; - clearEchartsData(); getData2(); getData4(); getData5(); @@ -610,7 +616,7 @@ : "five"; //分区级别(one:一级 || two:二级 || three:三级 || four:四级) AllData.regionName = AllData.TitleName[res.data.length].Name; AllData.waterRegionCode = AllData.TitleName[res.data.length].id; - // clearEchartsData(); + clearEchartsData(); if (AllData.regionGrade == "two") { // 二级 console.log("二级"); @@ -719,20 +725,33 @@ if (AllData.regionGrade == "one") { // 一级Ecahrts 名称 AllData.chartData2.yAxis_Name = "摸排管网"; + AllData.TjData2 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData2Unit = "km"; } if (AllData.regionGrade == "two") { // 二级Ecahrts 名称 AllData.chartData2.yAxis_Name = "问题管网"; + AllData.TjData2 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData2Unit = "km"; } if (AllData.regionGrade == "three") { // 三级Ecahrts 名称 AllData.chartData2.yAxis_Name = "摸排管网"; + AllData.TjData1 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData1Unit = "km"; } // 数据赋值 AllData.chartData2.xAxis = res.data.regionNameList; AllData.chartData2.yAxis = res.data.pipelineProblemLengthList; AllData.chartData2.yAxis2 = res.data.pipelineLengthList; AllData.chartData2.yAxis2_Name = "总长度"; + AllData.chartData2.y1_Unit = "km"; AllData.refresh2++; } }); @@ -766,6 +785,10 @@ AllData.chartData1.yAxis3_line_Name = ""; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = res.data.pipelinePointCount + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData1Unit = "个"; } if (AllData.regionGrade == "four") { // AllData.chartData3.xAxis = res.data.regionNameList; @@ -789,6 +812,8 @@ AllData.chartData3.y2_Unit = "万方"; //Y轴单位 AllData.chartData3.y2_show = false; AllData.refresh3++; + AllData.TjData3 = null; + AllData.TjData3Unit = null; } } }); @@ -803,17 +828,21 @@ if (res && res.code == 200) { if (AllData.regionGrade == "one") { AllData.chartData3.xAxis = res.data.partitionName; - AllData.chartData3.yAxis1_bar = res.data.outletsNumber; - AllData.chartData3.yAxis1_bar_Name = "排口"; + AllData.chartData3.yAxis1_bar = res.data.inflowWater; + AllData.chartData3.yAxis1_bar_Name = "进水量"; AllData.chartData3.yAxis2_bar = null; AllData.chartData3.yAxis2_bar_Name = ""; - AllData.chartData3.yAxis3_line = res.data.inflowWater; - AllData.chartData3.yAxis3_line_Name = "进水量"; + AllData.chartData3.yAxis3_line = res.data.outletsNumber; + AllData.chartData3.yAxis3_line_Name = "排口"; AllData.chartData3.yAxis3_line_Index = 1; - AllData.chartData3.y1_Unit = "个"; //Y轴单位 - AllData.chartData3.y2_Unit = "万方"; //Y轴单位 + AllData.chartData3.y1_Unit = "万方"; //Y轴单位 + AllData.chartData3.y2_Unit = "个"; //Y轴单位 AllData.chartData3.y2_show = true; AllData.refresh3++; + AllData.TjData3 = res.data.outletsNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } if (AllData.regionGrade == "two") { AllData.chartData3.xAxis = res.data.partitionName; @@ -831,6 +860,11 @@ // debugger; AllData.refresh3++; // }, 1000); + + AllData.TjData3 = res.data.outletsNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } } }); @@ -856,15 +890,26 @@ AllData.chartData3.y2_Unit = "万方"; //Y轴单位 AllData.chartData3.y2_show = false; AllData.refresh3++; + + AllData.TjData3 = res.data.pointNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } if (AllData.regionGrade == "four") { // AllData.chartData2.xAxis = res.data.partitionName; AllData.chartData2.yAxis = null; AllData.chartData2.yAxis2 = res.data.pointNumber; - AllData.chartData2.yAxis2_Name = "总长度"; + AllData.chartData2.yAxis2_Name = "数量"; AllData.chartData2.yAxis_Name = null; + AllData.chartData2.y1_Unit = "个"; AllData.refresh2++; + + AllData.TjData2 = res.data.pointNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData2Unit = "个"; } } }); @@ -881,26 +926,28 @@ res.data.forEach((element) => { XData.push(element.lakeName); data1.push(element.nowWaterlevel); - data2.push(element.fortifyWaterlevel); + data2.push(element.bestPromitWaterlevel); data3.push(element.volume); }); AllData.chartData1.xAxis = XData; //X轴数据 - AllData.chartData1.y1_Unit = "m"; //Y轴单位 - AllData.chartData1.y2_Unit = "万方"; //2号Y轴单位 + AllData.chartData1.y1_Unit = "万方"; //Y轴单位 + AllData.chartData1.y2_Unit = "m"; //2号Y轴单位 AllData.chartData1.y2_show = true; //是否展示右侧的2号轴 - AllData.chartData1.yAxis1_bar = data1; //数据1 - AllData.chartData1.yAxis1_bar_Name = "当前水位"; //数据1的名称 + AllData.chartData1.yAxis1_bar = data3; //数据1 + AllData.chartData1.yAxis1_bar_Name = "库容量"; //数据1的名称 AllData.chartData1.yAxis1_bar_index = 0; AllData.chartData1.yAxis2_bar = null; //数据2 AllData.chartData1.yAxis2_bar_Name = ""; //数据1的名称 AllData.chartData1.yAxis2_bar_index = 0; AllData.chartData1.yAxis2_line = data2; - AllData.chartData1.yAxis2_line_Name = "设防水位"; - AllData.chartData1.yAxis2_line_Index = 0; - AllData.chartData1.yAxis3_line = data3; - AllData.chartData1.yAxis3_line_Name = "库容量"; + AllData.chartData1.yAxis2_line_Name = "控制水位"; + AllData.chartData1.yAxis2_line_Index = 1; + AllData.chartData1.yAxis3_line = data1; + AllData.chartData1.yAxis3_line_Name = "当前水位"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = null; + AllData.TjData1Unit = null; } } }); @@ -939,6 +986,11 @@ AllData.chartData1.yAxis3_line_Name = "出水"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + + AllData.TjData2 = YData1.reduce( + (accu, curren) => Number(accu) + Number(curren) + ).toFixed(0); + AllData.TjData2Unit = "个"; } if (AllData.regionGrade == "four") { AllData.chartData1.xAxis = XData; //X轴数据 @@ -958,6 +1010,10 @@ AllData.chartData1.yAxis3_line_Name = "出水"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = YData1.reduce( + (accu, curren) => Number(accu) + Number(curren) + ).toFixed(0); + AllData.TjData1Unit = "个"; } } }); @@ -1024,6 +1080,8 @@ yAxis3_line_Index: 0, }; AllData.refresh1++; + AllData.TjData1 = null; + AllData.TjData1Unit = null; AllData.chartData3 = { xAxis: [], //X轴数据 y1_Unit: "", //Y轴单位 @@ -1043,14 +1101,19 @@ yAxis3_line_Index: 0, }; AllData.refresh3++; + AllData.TjData3 = null; + AllData.TjData3Unit = null; AllData.chartData2 = { xAxis: [], yAxis: [], yAxis2: [], yAxis_Name: "", yAxis2_Name: "", + y1_Unit: "km", }; AllData.refresh2++; + AllData.TjData2 = null; + AllData.TjData2Unit = null; }; onMounted(() => { let initeGLTimer = setInterval(() => { diff --git a/src/views/pictureOnMap/inputSearch.vue b/src/views/pictureOnMap/inputSearch.vue index 7663ccd..62e4522 100644 --- a/src/views/pictureOnMap/inputSearch.vue +++ b/src/views/pictureOnMap/inputSearch.vue @@ -3,7 +3,7 @@ + + + + appStore.MapData, (newValue, oldValue) => { if (appStore.MapData && appStore.MapData.length) { if (number.value === 1) { - GetSearchList(); + GetSearchList(appStore.MapData); number.value = 4; } } @@ -62,9 +105,9 @@ { deep: true, once: true } ); -function GetSearchList() { +function GetSearchList(data) { SelectList.value = []; - appStore.MapData.map(item => { + data.map(item => { SelectList.value = SelectList.value.concat(item.data); }); // console.log('MapData', appStore.MapData, SelectList.value); @@ -123,6 +166,16 @@ // bus.emit('removeMapDatas',['temporary']); }, 500); +const tabsClick = e => { + let type = e.paneName; + getItem.value = ''; + selectmodel.value = ''; + if (type == 'zhandian') { + GetSearchList(appStore.MapData); + } else if (type == 'daolu') { + GetSearchList(roadData.value); + } +}; onMounted(() => { bus.on('YQ_head', val => { console.log('appStore.MapData', appStore.MapData); @@ -146,6 +199,13 @@ z-index: 999; border-radius: 6px; } +.selectTabs { + position: absolute; + + width: 100%; + left: 0; + top: 0; +} :deep(.el-input__wrapper) { height: 30px !important; @@ -175,7 +235,9 @@ background: #0d2359 !important; border-radius: 6px !important; border: 1px solid #0b9bff !important; - + .el-scrollbar { + padding-top: 40px; + } .el-select-dropdown__item { font-family: Source Han Sans CN; font-weight: bold; diff --git a/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue b/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue index 7187410..11b5504 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue @@ -31,6 +31,7 @@ ? "当日水量分析" : "" }} + {{ AllData.TjData1 ? `(${AllData.TjData1 + AllData.TjData1Unit})` : `` }}
{ @@ -397,6 +406,7 @@ AllData.regionGrade = item.grade; AllData.regionName = item.Name; AllData.waterRegionCode = item.id; + clearEchartsData(); // debugger; // 视角切换 if (item.sort == 0) { @@ -436,7 +446,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData3(); getData7(); @@ -469,7 +478,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData2(); getData3(); @@ -495,7 +503,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData4(); getData5(); @@ -513,7 +520,6 @@ sort: 4, }; - clearEchartsData(); getData2(); getData4(); getData5(); @@ -610,7 +616,7 @@ : "five"; //分区级别(one:一级 || two:二级 || three:三级 || four:四级) AllData.regionName = AllData.TitleName[res.data.length].Name; AllData.waterRegionCode = AllData.TitleName[res.data.length].id; - // clearEchartsData(); + clearEchartsData(); if (AllData.regionGrade == "two") { // 二级 console.log("二级"); @@ -719,20 +725,33 @@ if (AllData.regionGrade == "one") { // 一级Ecahrts 名称 AllData.chartData2.yAxis_Name = "摸排管网"; + AllData.TjData2 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData2Unit = "km"; } if (AllData.regionGrade == "two") { // 二级Ecahrts 名称 AllData.chartData2.yAxis_Name = "问题管网"; + AllData.TjData2 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData2Unit = "km"; } if (AllData.regionGrade == "three") { // 三级Ecahrts 名称 AllData.chartData2.yAxis_Name = "摸排管网"; + AllData.TjData1 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData1Unit = "km"; } // 数据赋值 AllData.chartData2.xAxis = res.data.regionNameList; AllData.chartData2.yAxis = res.data.pipelineProblemLengthList; AllData.chartData2.yAxis2 = res.data.pipelineLengthList; AllData.chartData2.yAxis2_Name = "总长度"; + AllData.chartData2.y1_Unit = "km"; AllData.refresh2++; } }); @@ -766,6 +785,10 @@ AllData.chartData1.yAxis3_line_Name = ""; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = res.data.pipelinePointCount + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData1Unit = "个"; } if (AllData.regionGrade == "four") { // AllData.chartData3.xAxis = res.data.regionNameList; @@ -789,6 +812,8 @@ AllData.chartData3.y2_Unit = "万方"; //Y轴单位 AllData.chartData3.y2_show = false; AllData.refresh3++; + AllData.TjData3 = null; + AllData.TjData3Unit = null; } } }); @@ -803,17 +828,21 @@ if (res && res.code == 200) { if (AllData.regionGrade == "one") { AllData.chartData3.xAxis = res.data.partitionName; - AllData.chartData3.yAxis1_bar = res.data.outletsNumber; - AllData.chartData3.yAxis1_bar_Name = "排口"; + AllData.chartData3.yAxis1_bar = res.data.inflowWater; + AllData.chartData3.yAxis1_bar_Name = "进水量"; AllData.chartData3.yAxis2_bar = null; AllData.chartData3.yAxis2_bar_Name = ""; - AllData.chartData3.yAxis3_line = res.data.inflowWater; - AllData.chartData3.yAxis3_line_Name = "进水量"; + AllData.chartData3.yAxis3_line = res.data.outletsNumber; + AllData.chartData3.yAxis3_line_Name = "排口"; AllData.chartData3.yAxis3_line_Index = 1; - AllData.chartData3.y1_Unit = "个"; //Y轴单位 - AllData.chartData3.y2_Unit = "万方"; //Y轴单位 + AllData.chartData3.y1_Unit = "万方"; //Y轴单位 + AllData.chartData3.y2_Unit = "个"; //Y轴单位 AllData.chartData3.y2_show = true; AllData.refresh3++; + AllData.TjData3 = res.data.outletsNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } if (AllData.regionGrade == "two") { AllData.chartData3.xAxis = res.data.partitionName; @@ -831,6 +860,11 @@ // debugger; AllData.refresh3++; // }, 1000); + + AllData.TjData3 = res.data.outletsNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } } }); @@ -856,15 +890,26 @@ AllData.chartData3.y2_Unit = "万方"; //Y轴单位 AllData.chartData3.y2_show = false; AllData.refresh3++; + + AllData.TjData3 = res.data.pointNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } if (AllData.regionGrade == "four") { // AllData.chartData2.xAxis = res.data.partitionName; AllData.chartData2.yAxis = null; AllData.chartData2.yAxis2 = res.data.pointNumber; - AllData.chartData2.yAxis2_Name = "总长度"; + AllData.chartData2.yAxis2_Name = "数量"; AllData.chartData2.yAxis_Name = null; + AllData.chartData2.y1_Unit = "个"; AllData.refresh2++; + + AllData.TjData2 = res.data.pointNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData2Unit = "个"; } } }); @@ -881,26 +926,28 @@ res.data.forEach((element) => { XData.push(element.lakeName); data1.push(element.nowWaterlevel); - data2.push(element.fortifyWaterlevel); + data2.push(element.bestPromitWaterlevel); data3.push(element.volume); }); AllData.chartData1.xAxis = XData; //X轴数据 - AllData.chartData1.y1_Unit = "m"; //Y轴单位 - AllData.chartData1.y2_Unit = "万方"; //2号Y轴单位 + AllData.chartData1.y1_Unit = "万方"; //Y轴单位 + AllData.chartData1.y2_Unit = "m"; //2号Y轴单位 AllData.chartData1.y2_show = true; //是否展示右侧的2号轴 - AllData.chartData1.yAxis1_bar = data1; //数据1 - AllData.chartData1.yAxis1_bar_Name = "当前水位"; //数据1的名称 + AllData.chartData1.yAxis1_bar = data3; //数据1 + AllData.chartData1.yAxis1_bar_Name = "库容量"; //数据1的名称 AllData.chartData1.yAxis1_bar_index = 0; AllData.chartData1.yAxis2_bar = null; //数据2 AllData.chartData1.yAxis2_bar_Name = ""; //数据1的名称 AllData.chartData1.yAxis2_bar_index = 0; AllData.chartData1.yAxis2_line = data2; - AllData.chartData1.yAxis2_line_Name = "设防水位"; - AllData.chartData1.yAxis2_line_Index = 0; - AllData.chartData1.yAxis3_line = data3; - AllData.chartData1.yAxis3_line_Name = "库容量"; + AllData.chartData1.yAxis2_line_Name = "控制水位"; + AllData.chartData1.yAxis2_line_Index = 1; + AllData.chartData1.yAxis3_line = data1; + AllData.chartData1.yAxis3_line_Name = "当前水位"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = null; + AllData.TjData1Unit = null; } } }); @@ -939,6 +986,11 @@ AllData.chartData1.yAxis3_line_Name = "出水"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + + AllData.TjData2 = YData1.reduce( + (accu, curren) => Number(accu) + Number(curren) + ).toFixed(0); + AllData.TjData2Unit = "个"; } if (AllData.regionGrade == "four") { AllData.chartData1.xAxis = XData; //X轴数据 @@ -958,6 +1010,10 @@ AllData.chartData1.yAxis3_line_Name = "出水"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = YData1.reduce( + (accu, curren) => Number(accu) + Number(curren) + ).toFixed(0); + AllData.TjData1Unit = "个"; } } }); @@ -1024,6 +1080,8 @@ yAxis3_line_Index: 0, }; AllData.refresh1++; + AllData.TjData1 = null; + AllData.TjData1Unit = null; AllData.chartData3 = { xAxis: [], //X轴数据 y1_Unit: "", //Y轴单位 @@ -1043,14 +1101,19 @@ yAxis3_line_Index: 0, }; AllData.refresh3++; + AllData.TjData3 = null; + AllData.TjData3Unit = null; AllData.chartData2 = { xAxis: [], yAxis: [], yAxis2: [], yAxis_Name: "", yAxis2_Name: "", + y1_Unit: "km", }; AllData.refresh2++; + AllData.TjData2 = null; + AllData.TjData2Unit = null; }; onMounted(() => { let initeGLTimer = setInterval(() => { diff --git a/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue b/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue index 2d990f7..3611592 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue @@ -39,6 +39,13 @@ var option; option = { color: ["#3FFFC2", "#FFF21C"], + legend: { + // data: [props.data.yAxis_Name, props.data.yAxis2_Name, props.data.yAxis3_Name], + textStyle: { + color: "#FFFFFF", + fontSize: 12, + }, + }, tooltip: { trigger: "axis", backgroundColor: "#004284", @@ -121,6 +128,7 @@ // return value.toFixed(2); // 保留两位小数 // }, }, + max: Math.ceil(Math.max.apply(null, props.data.yAxis1_bar) * 1.2), nameTextStyle: { color: "#AAC1CF", }, @@ -174,11 +182,12 @@ name: props.data.y2_Unit, type: "value", min: 0, + minInterval: 1, axisLabel: { color: "#AAC1CF", show: true, // formatter: function (value) { - // return value.toFixed(2); // 保留两位小数 + // return value.toFixed(0); // 保留两位小数 // }, }, nameTextStyle: { @@ -190,7 +199,7 @@ color: "#2161a8", }, }, - // alignTicks: true, + alignTicks: true, position: "right", offset: 0, }); @@ -219,9 +228,20 @@ return value + unit; }, }, + + label: { + show: true, + position: "top", + valueAnimation: true, + color: "inherit", + fontSize: 12, + formatter: (params) => { + return params.value; + }, + }, }, { - name: "", + name: props.data.yAxis1_bar_Name, type: "bar", barWidth: barWidth, itemStyle: { @@ -264,7 +284,7 @@ }, }, { - name: "", + name: props.data.yAxis2_bar_Name, type: "bar", barWidth: barWidth, itemStyle: { diff --git a/src/views/pictureOnMap/inputSearch.vue b/src/views/pictureOnMap/inputSearch.vue index 7663ccd..62e4522 100644 --- a/src/views/pictureOnMap/inputSearch.vue +++ b/src/views/pictureOnMap/inputSearch.vue @@ -3,7 +3,7 @@ + + + + appStore.MapData, (newValue, oldValue) => { if (appStore.MapData && appStore.MapData.length) { if (number.value === 1) { - GetSearchList(); + GetSearchList(appStore.MapData); number.value = 4; } } @@ -62,9 +105,9 @@ { deep: true, once: true } ); -function GetSearchList() { +function GetSearchList(data) { SelectList.value = []; - appStore.MapData.map(item => { + data.map(item => { SelectList.value = SelectList.value.concat(item.data); }); // console.log('MapData', appStore.MapData, SelectList.value); @@ -123,6 +166,16 @@ // bus.emit('removeMapDatas',['temporary']); }, 500); +const tabsClick = e => { + let type = e.paneName; + getItem.value = ''; + selectmodel.value = ''; + if (type == 'zhandian') { + GetSearchList(appStore.MapData); + } else if (type == 'daolu') { + GetSearchList(roadData.value); + } +}; onMounted(() => { bus.on('YQ_head', val => { console.log('appStore.MapData', appStore.MapData); @@ -146,6 +199,13 @@ z-index: 999; border-radius: 6px; } +.selectTabs { + position: absolute; + + width: 100%; + left: 0; + top: 0; +} :deep(.el-input__wrapper) { height: 30px !important; @@ -175,7 +235,9 @@ background: #0d2359 !important; border-radius: 6px !important; border: 1px solid #0b9bff !important; - + .el-scrollbar { + padding-top: 40px; + } .el-select-dropdown__item { font-family: Source Han Sans CN; font-weight: bold; diff --git a/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue b/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue index 7187410..11b5504 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue @@ -31,6 +31,7 @@ ? "当日水量分析" : "" }} + {{ AllData.TjData1 ? `(${AllData.TjData1 + AllData.TjData1Unit})` : `` }}
{ @@ -397,6 +406,7 @@ AllData.regionGrade = item.grade; AllData.regionName = item.Name; AllData.waterRegionCode = item.id; + clearEchartsData(); // debugger; // 视角切换 if (item.sort == 0) { @@ -436,7 +446,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData3(); getData7(); @@ -469,7 +478,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData2(); getData3(); @@ -495,7 +503,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData4(); getData5(); @@ -513,7 +520,6 @@ sort: 4, }; - clearEchartsData(); getData2(); getData4(); getData5(); @@ -610,7 +616,7 @@ : "five"; //分区级别(one:一级 || two:二级 || three:三级 || four:四级) AllData.regionName = AllData.TitleName[res.data.length].Name; AllData.waterRegionCode = AllData.TitleName[res.data.length].id; - // clearEchartsData(); + clearEchartsData(); if (AllData.regionGrade == "two") { // 二级 console.log("二级"); @@ -719,20 +725,33 @@ if (AllData.regionGrade == "one") { // 一级Ecahrts 名称 AllData.chartData2.yAxis_Name = "摸排管网"; + AllData.TjData2 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData2Unit = "km"; } if (AllData.regionGrade == "two") { // 二级Ecahrts 名称 AllData.chartData2.yAxis_Name = "问题管网"; + AllData.TjData2 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData2Unit = "km"; } if (AllData.regionGrade == "three") { // 三级Ecahrts 名称 AllData.chartData2.yAxis_Name = "摸排管网"; + AllData.TjData1 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData1Unit = "km"; } // 数据赋值 AllData.chartData2.xAxis = res.data.regionNameList; AllData.chartData2.yAxis = res.data.pipelineProblemLengthList; AllData.chartData2.yAxis2 = res.data.pipelineLengthList; AllData.chartData2.yAxis2_Name = "总长度"; + AllData.chartData2.y1_Unit = "km"; AllData.refresh2++; } }); @@ -766,6 +785,10 @@ AllData.chartData1.yAxis3_line_Name = ""; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = res.data.pipelinePointCount + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData1Unit = "个"; } if (AllData.regionGrade == "four") { // AllData.chartData3.xAxis = res.data.regionNameList; @@ -789,6 +812,8 @@ AllData.chartData3.y2_Unit = "万方"; //Y轴单位 AllData.chartData3.y2_show = false; AllData.refresh3++; + AllData.TjData3 = null; + AllData.TjData3Unit = null; } } }); @@ -803,17 +828,21 @@ if (res && res.code == 200) { if (AllData.regionGrade == "one") { AllData.chartData3.xAxis = res.data.partitionName; - AllData.chartData3.yAxis1_bar = res.data.outletsNumber; - AllData.chartData3.yAxis1_bar_Name = "排口"; + AllData.chartData3.yAxis1_bar = res.data.inflowWater; + AllData.chartData3.yAxis1_bar_Name = "进水量"; AllData.chartData3.yAxis2_bar = null; AllData.chartData3.yAxis2_bar_Name = ""; - AllData.chartData3.yAxis3_line = res.data.inflowWater; - AllData.chartData3.yAxis3_line_Name = "进水量"; + AllData.chartData3.yAxis3_line = res.data.outletsNumber; + AllData.chartData3.yAxis3_line_Name = "排口"; AllData.chartData3.yAxis3_line_Index = 1; - AllData.chartData3.y1_Unit = "个"; //Y轴单位 - AllData.chartData3.y2_Unit = "万方"; //Y轴单位 + AllData.chartData3.y1_Unit = "万方"; //Y轴单位 + AllData.chartData3.y2_Unit = "个"; //Y轴单位 AllData.chartData3.y2_show = true; AllData.refresh3++; + AllData.TjData3 = res.data.outletsNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } if (AllData.regionGrade == "two") { AllData.chartData3.xAxis = res.data.partitionName; @@ -831,6 +860,11 @@ // debugger; AllData.refresh3++; // }, 1000); + + AllData.TjData3 = res.data.outletsNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } } }); @@ -856,15 +890,26 @@ AllData.chartData3.y2_Unit = "万方"; //Y轴单位 AllData.chartData3.y2_show = false; AllData.refresh3++; + + AllData.TjData3 = res.data.pointNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } if (AllData.regionGrade == "four") { // AllData.chartData2.xAxis = res.data.partitionName; AllData.chartData2.yAxis = null; AllData.chartData2.yAxis2 = res.data.pointNumber; - AllData.chartData2.yAxis2_Name = "总长度"; + AllData.chartData2.yAxis2_Name = "数量"; AllData.chartData2.yAxis_Name = null; + AllData.chartData2.y1_Unit = "个"; AllData.refresh2++; + + AllData.TjData2 = res.data.pointNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData2Unit = "个"; } } }); @@ -881,26 +926,28 @@ res.data.forEach((element) => { XData.push(element.lakeName); data1.push(element.nowWaterlevel); - data2.push(element.fortifyWaterlevel); + data2.push(element.bestPromitWaterlevel); data3.push(element.volume); }); AllData.chartData1.xAxis = XData; //X轴数据 - AllData.chartData1.y1_Unit = "m"; //Y轴单位 - AllData.chartData1.y2_Unit = "万方"; //2号Y轴单位 + AllData.chartData1.y1_Unit = "万方"; //Y轴单位 + AllData.chartData1.y2_Unit = "m"; //2号Y轴单位 AllData.chartData1.y2_show = true; //是否展示右侧的2号轴 - AllData.chartData1.yAxis1_bar = data1; //数据1 - AllData.chartData1.yAxis1_bar_Name = "当前水位"; //数据1的名称 + AllData.chartData1.yAxis1_bar = data3; //数据1 + AllData.chartData1.yAxis1_bar_Name = "库容量"; //数据1的名称 AllData.chartData1.yAxis1_bar_index = 0; AllData.chartData1.yAxis2_bar = null; //数据2 AllData.chartData1.yAxis2_bar_Name = ""; //数据1的名称 AllData.chartData1.yAxis2_bar_index = 0; AllData.chartData1.yAxis2_line = data2; - AllData.chartData1.yAxis2_line_Name = "设防水位"; - AllData.chartData1.yAxis2_line_Index = 0; - AllData.chartData1.yAxis3_line = data3; - AllData.chartData1.yAxis3_line_Name = "库容量"; + AllData.chartData1.yAxis2_line_Name = "控制水位"; + AllData.chartData1.yAxis2_line_Index = 1; + AllData.chartData1.yAxis3_line = data1; + AllData.chartData1.yAxis3_line_Name = "当前水位"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = null; + AllData.TjData1Unit = null; } } }); @@ -939,6 +986,11 @@ AllData.chartData1.yAxis3_line_Name = "出水"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + + AllData.TjData2 = YData1.reduce( + (accu, curren) => Number(accu) + Number(curren) + ).toFixed(0); + AllData.TjData2Unit = "个"; } if (AllData.regionGrade == "four") { AllData.chartData1.xAxis = XData; //X轴数据 @@ -958,6 +1010,10 @@ AllData.chartData1.yAxis3_line_Name = "出水"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = YData1.reduce( + (accu, curren) => Number(accu) + Number(curren) + ).toFixed(0); + AllData.TjData1Unit = "个"; } } }); @@ -1024,6 +1080,8 @@ yAxis3_line_Index: 0, }; AllData.refresh1++; + AllData.TjData1 = null; + AllData.TjData1Unit = null; AllData.chartData3 = { xAxis: [], //X轴数据 y1_Unit: "", //Y轴单位 @@ -1043,14 +1101,19 @@ yAxis3_line_Index: 0, }; AllData.refresh3++; + AllData.TjData3 = null; + AllData.TjData3Unit = null; AllData.chartData2 = { xAxis: [], yAxis: [], yAxis2: [], yAxis_Name: "", yAxis2_Name: "", + y1_Unit: "km", }; AllData.refresh2++; + AllData.TjData2 = null; + AllData.TjData2Unit = null; }; onMounted(() => { let initeGLTimer = setInterval(() => { diff --git a/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue b/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue index 2d990f7..3611592 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue @@ -39,6 +39,13 @@ var option; option = { color: ["#3FFFC2", "#FFF21C"], + legend: { + // data: [props.data.yAxis_Name, props.data.yAxis2_Name, props.data.yAxis3_Name], + textStyle: { + color: "#FFFFFF", + fontSize: 12, + }, + }, tooltip: { trigger: "axis", backgroundColor: "#004284", @@ -121,6 +128,7 @@ // return value.toFixed(2); // 保留两位小数 // }, }, + max: Math.ceil(Math.max.apply(null, props.data.yAxis1_bar) * 1.2), nameTextStyle: { color: "#AAC1CF", }, @@ -174,11 +182,12 @@ name: props.data.y2_Unit, type: "value", min: 0, + minInterval: 1, axisLabel: { color: "#AAC1CF", show: true, // formatter: function (value) { - // return value.toFixed(2); // 保留两位小数 + // return value.toFixed(0); // 保留两位小数 // }, }, nameTextStyle: { @@ -190,7 +199,7 @@ color: "#2161a8", }, }, - // alignTicks: true, + alignTicks: true, position: "right", offset: 0, }); @@ -219,9 +228,20 @@ return value + unit; }, }, + + label: { + show: true, + position: "top", + valueAnimation: true, + color: "inherit", + fontSize: 12, + formatter: (params) => { + return params.value; + }, + }, }, { - name: "", + name: props.data.yAxis1_bar_Name, type: "bar", barWidth: barWidth, itemStyle: { @@ -264,7 +284,7 @@ }, }, { - name: "", + name: props.data.yAxis2_bar_Name, type: "bar", barWidth: barWidth, itemStyle: { diff --git a/src/views/pictureOnMap/page/DrainageSystem/components/DraBarChartsLeft.vue b/src/views/pictureOnMap/page/DrainageSystem/components/DraBarChartsLeft.vue index f35f44b..b12fa14 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/components/DraBarChartsLeft.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/components/DraBarChartsLeft.vue @@ -55,7 +55,7 @@ var relVal = "" + params[0].name; for (var i = 0, l = params.length; i < l; i++) { if (params[i].seriesName) { - let unit = "km"; + let unit = props.data.y1_Unit; relVal += "
" + params[i].marker + @@ -70,7 +70,7 @@ }, legend: { textStyle: { - color: "#FFFFFF", // 这里设置为红色 + color: "#FFFFFF", }, }, grid: { @@ -87,7 +87,7 @@ align: "right", fontSize: 10, }, - max: Math.ceil(Math.max.apply(null, props.data.yAxis2) * 1.1), + max: Math.ceil(Math.max.apply(null, props.data.yAxis2) * 1.2), nameLocation: "start", type: "value", minInterval: 1, @@ -109,7 +109,7 @@ axisLabel: { color: "#EBFEFF", show: true, - fontSize: 12, + fontSize: props.data.xAxis.length > 8 ? 8 : 12, }, nameTextStyle: { color: "#FFFFFF", @@ -119,31 +119,48 @@ { name: props.data.yAxis2_Name, type: "bar", - barWidth: 10, + // barWidth: 10, // label: { // show: true, // }, data: props.data.yAxis2, barGap: "-100%", itemStyle: { - borderRadius: [20, 20, 20, 20], + borderRadius: [0, 20, 20, 0], color: "#31FEDF", }, + label: { + show: true, + position: "right", + valueAnimation: true, + color: "inherit", + fontSize: 12, + formatter: (params) => { + return params.value + props.data.y1_Unit; + }, + }, }, { name: props.data.yAxis_Name, type: "bar", - barWidth: 10, + // barWidth: 10, // label: { // show: true, // }, data: props.data.yAxis, itemStyle: { borderRadius: [20, 20, 20, 20], - color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ - { offset: 0, color: "#FF6464" }, - { offset: 1, color: "#FF9A9A" }, - ]), + color: "#FF6464", + }, + label: { + show: false, + position: "right", + valueAnimation: true, + color: "inherit", + fontSize: 12, + formatter: (params) => { + return params.value + props.data.y1_Unit; + }, }, }, ], diff --git a/src/views/pictureOnMap/inputSearch.vue b/src/views/pictureOnMap/inputSearch.vue index 7663ccd..62e4522 100644 --- a/src/views/pictureOnMap/inputSearch.vue +++ b/src/views/pictureOnMap/inputSearch.vue @@ -3,7 +3,7 @@ + + + + appStore.MapData, (newValue, oldValue) => { if (appStore.MapData && appStore.MapData.length) { if (number.value === 1) { - GetSearchList(); + GetSearchList(appStore.MapData); number.value = 4; } } @@ -62,9 +105,9 @@ { deep: true, once: true } ); -function GetSearchList() { +function GetSearchList(data) { SelectList.value = []; - appStore.MapData.map(item => { + data.map(item => { SelectList.value = SelectList.value.concat(item.data); }); // console.log('MapData', appStore.MapData, SelectList.value); @@ -123,6 +166,16 @@ // bus.emit('removeMapDatas',['temporary']); }, 500); +const tabsClick = e => { + let type = e.paneName; + getItem.value = ''; + selectmodel.value = ''; + if (type == 'zhandian') { + GetSearchList(appStore.MapData); + } else if (type == 'daolu') { + GetSearchList(roadData.value); + } +}; onMounted(() => { bus.on('YQ_head', val => { console.log('appStore.MapData', appStore.MapData); @@ -146,6 +199,13 @@ z-index: 999; border-radius: 6px; } +.selectTabs { + position: absolute; + + width: 100%; + left: 0; + top: 0; +} :deep(.el-input__wrapper) { height: 30px !important; @@ -175,7 +235,9 @@ background: #0d2359 !important; border-radius: 6px !important; border: 1px solid #0b9bff !important; - + .el-scrollbar { + padding-top: 40px; + } .el-select-dropdown__item { font-family: Source Han Sans CN; font-weight: bold; diff --git a/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue b/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue index 7187410..11b5504 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/YSIndex.vue @@ -31,6 +31,7 @@ ? "当日水量分析" : "" }} + {{ AllData.TjData1 ? `(${AllData.TjData1 + AllData.TjData1Unit})` : `` }}
{ @@ -397,6 +406,7 @@ AllData.regionGrade = item.grade; AllData.regionName = item.Name; AllData.waterRegionCode = item.id; + clearEchartsData(); // debugger; // 视角切换 if (item.sort == 0) { @@ -436,7 +446,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData3(); getData7(); @@ -469,7 +478,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData2(); getData3(); @@ -495,7 +503,6 @@ }; // 切换时进行数据请求,默认视角请求 - clearEchartsData(); getData1(); getData4(); getData5(); @@ -513,7 +520,6 @@ sort: 4, }; - clearEchartsData(); getData2(); getData4(); getData5(); @@ -610,7 +616,7 @@ : "five"; //分区级别(one:一级 || two:二级 || three:三级 || four:四级) AllData.regionName = AllData.TitleName[res.data.length].Name; AllData.waterRegionCode = AllData.TitleName[res.data.length].id; - // clearEchartsData(); + clearEchartsData(); if (AllData.regionGrade == "two") { // 二级 console.log("二级"); @@ -719,20 +725,33 @@ if (AllData.regionGrade == "one") { // 一级Ecahrts 名称 AllData.chartData2.yAxis_Name = "摸排管网"; + AllData.TjData2 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData2Unit = "km"; } if (AllData.regionGrade == "two") { // 二级Ecahrts 名称 AllData.chartData2.yAxis_Name = "问题管网"; + AllData.TjData2 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData2Unit = "km"; } if (AllData.regionGrade == "three") { // 三级Ecahrts 名称 AllData.chartData2.yAxis_Name = "摸排管网"; + AllData.TjData1 = res.data.pipelineLengthList + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(2); + AllData.TjData1Unit = "km"; } // 数据赋值 AllData.chartData2.xAxis = res.data.regionNameList; AllData.chartData2.yAxis = res.data.pipelineProblemLengthList; AllData.chartData2.yAxis2 = res.data.pipelineLengthList; AllData.chartData2.yAxis2_Name = "总长度"; + AllData.chartData2.y1_Unit = "km"; AllData.refresh2++; } }); @@ -766,6 +785,10 @@ AllData.chartData1.yAxis3_line_Name = ""; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = res.data.pipelinePointCount + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData1Unit = "个"; } if (AllData.regionGrade == "four") { // AllData.chartData3.xAxis = res.data.regionNameList; @@ -789,6 +812,8 @@ AllData.chartData3.y2_Unit = "万方"; //Y轴单位 AllData.chartData3.y2_show = false; AllData.refresh3++; + AllData.TjData3 = null; + AllData.TjData3Unit = null; } } }); @@ -803,17 +828,21 @@ if (res && res.code == 200) { if (AllData.regionGrade == "one") { AllData.chartData3.xAxis = res.data.partitionName; - AllData.chartData3.yAxis1_bar = res.data.outletsNumber; - AllData.chartData3.yAxis1_bar_Name = "排口"; + AllData.chartData3.yAxis1_bar = res.data.inflowWater; + AllData.chartData3.yAxis1_bar_Name = "进水量"; AllData.chartData3.yAxis2_bar = null; AllData.chartData3.yAxis2_bar_Name = ""; - AllData.chartData3.yAxis3_line = res.data.inflowWater; - AllData.chartData3.yAxis3_line_Name = "进水量"; + AllData.chartData3.yAxis3_line = res.data.outletsNumber; + AllData.chartData3.yAxis3_line_Name = "排口"; AllData.chartData3.yAxis3_line_Index = 1; - AllData.chartData3.y1_Unit = "个"; //Y轴单位 - AllData.chartData3.y2_Unit = "万方"; //Y轴单位 + AllData.chartData3.y1_Unit = "万方"; //Y轴单位 + AllData.chartData3.y2_Unit = "个"; //Y轴单位 AllData.chartData3.y2_show = true; AllData.refresh3++; + AllData.TjData3 = res.data.outletsNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } if (AllData.regionGrade == "two") { AllData.chartData3.xAxis = res.data.partitionName; @@ -831,6 +860,11 @@ // debugger; AllData.refresh3++; // }, 1000); + + AllData.TjData3 = res.data.outletsNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } } }); @@ -856,15 +890,26 @@ AllData.chartData3.y2_Unit = "万方"; //Y轴单位 AllData.chartData3.y2_show = false; AllData.refresh3++; + + AllData.TjData3 = res.data.pointNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData3Unit = "个"; } if (AllData.regionGrade == "four") { // AllData.chartData2.xAxis = res.data.partitionName; AllData.chartData2.yAxis = null; AllData.chartData2.yAxis2 = res.data.pointNumber; - AllData.chartData2.yAxis2_Name = "总长度"; + AllData.chartData2.yAxis2_Name = "数量"; AllData.chartData2.yAxis_Name = null; + AllData.chartData2.y1_Unit = "个"; AllData.refresh2++; + + AllData.TjData2 = res.data.pointNumber + .reduce((accu, curren) => Number(accu) + Number(curren)) + .toFixed(0); + AllData.TjData2Unit = "个"; } } }); @@ -881,26 +926,28 @@ res.data.forEach((element) => { XData.push(element.lakeName); data1.push(element.nowWaterlevel); - data2.push(element.fortifyWaterlevel); + data2.push(element.bestPromitWaterlevel); data3.push(element.volume); }); AllData.chartData1.xAxis = XData; //X轴数据 - AllData.chartData1.y1_Unit = "m"; //Y轴单位 - AllData.chartData1.y2_Unit = "万方"; //2号Y轴单位 + AllData.chartData1.y1_Unit = "万方"; //Y轴单位 + AllData.chartData1.y2_Unit = "m"; //2号Y轴单位 AllData.chartData1.y2_show = true; //是否展示右侧的2号轴 - AllData.chartData1.yAxis1_bar = data1; //数据1 - AllData.chartData1.yAxis1_bar_Name = "当前水位"; //数据1的名称 + AllData.chartData1.yAxis1_bar = data3; //数据1 + AllData.chartData1.yAxis1_bar_Name = "库容量"; //数据1的名称 AllData.chartData1.yAxis1_bar_index = 0; AllData.chartData1.yAxis2_bar = null; //数据2 AllData.chartData1.yAxis2_bar_Name = ""; //数据1的名称 AllData.chartData1.yAxis2_bar_index = 0; AllData.chartData1.yAxis2_line = data2; - AllData.chartData1.yAxis2_line_Name = "设防水位"; - AllData.chartData1.yAxis2_line_Index = 0; - AllData.chartData1.yAxis3_line = data3; - AllData.chartData1.yAxis3_line_Name = "库容量"; + AllData.chartData1.yAxis2_line_Name = "控制水位"; + AllData.chartData1.yAxis2_line_Index = 1; + AllData.chartData1.yAxis3_line = data1; + AllData.chartData1.yAxis3_line_Name = "当前水位"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = null; + AllData.TjData1Unit = null; } } }); @@ -939,6 +986,11 @@ AllData.chartData1.yAxis3_line_Name = "出水"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + + AllData.TjData2 = YData1.reduce( + (accu, curren) => Number(accu) + Number(curren) + ).toFixed(0); + AllData.TjData2Unit = "个"; } if (AllData.regionGrade == "four") { AllData.chartData1.xAxis = XData; //X轴数据 @@ -958,6 +1010,10 @@ AllData.chartData1.yAxis3_line_Name = "出水"; AllData.chartData1.yAxis3_line_Index = 1; AllData.refresh1++; + AllData.TjData1 = YData1.reduce( + (accu, curren) => Number(accu) + Number(curren) + ).toFixed(0); + AllData.TjData1Unit = "个"; } } }); @@ -1024,6 +1080,8 @@ yAxis3_line_Index: 0, }; AllData.refresh1++; + AllData.TjData1 = null; + AllData.TjData1Unit = null; AllData.chartData3 = { xAxis: [], //X轴数据 y1_Unit: "", //Y轴单位 @@ -1043,14 +1101,19 @@ yAxis3_line_Index: 0, }; AllData.refresh3++; + AllData.TjData3 = null; + AllData.TjData3Unit = null; AllData.chartData2 = { xAxis: [], yAxis: [], yAxis2: [], yAxis_Name: "", yAxis2_Name: "", + y1_Unit: "km", }; AllData.refresh2++; + AllData.TjData2 = null; + AllData.TjData2Unit = null; }; onMounted(() => { let initeGLTimer = setInterval(() => { diff --git a/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue b/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue index 2d990f7..3611592 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/components/DraBarCharts2Y.vue @@ -39,6 +39,13 @@ var option; option = { color: ["#3FFFC2", "#FFF21C"], + legend: { + // data: [props.data.yAxis_Name, props.data.yAxis2_Name, props.data.yAxis3_Name], + textStyle: { + color: "#FFFFFF", + fontSize: 12, + }, + }, tooltip: { trigger: "axis", backgroundColor: "#004284", @@ -121,6 +128,7 @@ // return value.toFixed(2); // 保留两位小数 // }, }, + max: Math.ceil(Math.max.apply(null, props.data.yAxis1_bar) * 1.2), nameTextStyle: { color: "#AAC1CF", }, @@ -174,11 +182,12 @@ name: props.data.y2_Unit, type: "value", min: 0, + minInterval: 1, axisLabel: { color: "#AAC1CF", show: true, // formatter: function (value) { - // return value.toFixed(2); // 保留两位小数 + // return value.toFixed(0); // 保留两位小数 // }, }, nameTextStyle: { @@ -190,7 +199,7 @@ color: "#2161a8", }, }, - // alignTicks: true, + alignTicks: true, position: "right", offset: 0, }); @@ -219,9 +228,20 @@ return value + unit; }, }, + + label: { + show: true, + position: "top", + valueAnimation: true, + color: "inherit", + fontSize: 12, + formatter: (params) => { + return params.value; + }, + }, }, { - name: "", + name: props.data.yAxis1_bar_Name, type: "bar", barWidth: barWidth, itemStyle: { @@ -264,7 +284,7 @@ }, }, { - name: "", + name: props.data.yAxis2_bar_Name, type: "bar", barWidth: barWidth, itemStyle: { diff --git a/src/views/pictureOnMap/page/DrainageSystem/components/DraBarChartsLeft.vue b/src/views/pictureOnMap/page/DrainageSystem/components/DraBarChartsLeft.vue index f35f44b..b12fa14 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/components/DraBarChartsLeft.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/components/DraBarChartsLeft.vue @@ -55,7 +55,7 @@ var relVal = "" + params[0].name; for (var i = 0, l = params.length; i < l; i++) { if (params[i].seriesName) { - let unit = "km"; + let unit = props.data.y1_Unit; relVal += "
" + params[i].marker + @@ -70,7 +70,7 @@ }, legend: { textStyle: { - color: "#FFFFFF", // 这里设置为红色 + color: "#FFFFFF", }, }, grid: { @@ -87,7 +87,7 @@ align: "right", fontSize: 10, }, - max: Math.ceil(Math.max.apply(null, props.data.yAxis2) * 1.1), + max: Math.ceil(Math.max.apply(null, props.data.yAxis2) * 1.2), nameLocation: "start", type: "value", minInterval: 1, @@ -109,7 +109,7 @@ axisLabel: { color: "#EBFEFF", show: true, - fontSize: 12, + fontSize: props.data.xAxis.length > 8 ? 8 : 12, }, nameTextStyle: { color: "#FFFFFF", @@ -119,31 +119,48 @@ { name: props.data.yAxis2_Name, type: "bar", - barWidth: 10, + // barWidth: 10, // label: { // show: true, // }, data: props.data.yAxis2, barGap: "-100%", itemStyle: { - borderRadius: [20, 20, 20, 20], + borderRadius: [0, 20, 20, 0], color: "#31FEDF", }, + label: { + show: true, + position: "right", + valueAnimation: true, + color: "inherit", + fontSize: 12, + formatter: (params) => { + return params.value + props.data.y1_Unit; + }, + }, }, { name: props.data.yAxis_Name, type: "bar", - barWidth: 10, + // barWidth: 10, // label: { // show: true, // }, data: props.data.yAxis, itemStyle: { borderRadius: [20, 20, 20, 20], - color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ - { offset: 0, color: "#FF6464" }, - { offset: 1, color: "#FF9A9A" }, - ]), + color: "#FF6464", + }, + label: { + show: false, + position: "right", + valueAnimation: true, + color: "inherit", + fontSize: 12, + formatter: (params) => { + return params.value + props.data.y1_Unit; + }, }, }, ], diff --git a/src/views/pictureOnMap/page/DrainageSystem/components/DraLineChartsLeft.vue b/src/views/pictureOnMap/page/DrainageSystem/components/DraLineChartsLeft.vue index 263ec56..1542859 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/components/DraLineChartsLeft.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/components/DraLineChartsLeft.vue @@ -152,9 +152,6 @@ color: "aqua", // 数据点颜色 }, }, - - - { name: props.data.yAxis3_line_Name, type: "line",