hum 1 год назад
Родитель
Сommit
db388945b8

+ 2 - 2
ruoyi-ui/src/api/analysis/achievement.js

@@ -31,11 +31,11 @@ export function listScatterPlot(query) {
   })
 }
 
-export function listMeasureLine(siteId) {
+export function listMeasureLine(data) {
   return request({
     url: '/reportData/getMeasureLine',
     method: 'get',
-    params: { siteId },
+    params: data,
   })
 }
 

+ 12 - 3
ruoyi-ui/src/views/analysis/task/realtime/realtime.vue

@@ -1,8 +1,8 @@
 <template>
-  <div>
+  <div class="hum-page-container">
     <el-row :gutter="10">
       <el-col :span="18">
-        <Simulation :siteId="siteId" :positions="positions" :measureLine="measureLine" />
+        <Simulation ref="simulation" :siteId="siteId" :positions="positions" :measureLine="measureLine" />
         <el-row :gutter="20" style="margin-top: 10px">
           <el-col :span="8">
             <Site :siteRealTime="siteRealTime" />
@@ -66,10 +66,19 @@ export default {
       })
     },
     loadMeasureLine() {
-      listMeasureLine(this.siteId).then((res) => {
+      const params = {
+        siteId: this.siteId,
+      }
+      if (this.$route.query.taskid) {
+        params.taskId = this.$route.query.taskid;
+      }
+      listMeasureLine(params).then((res) => {
         const measureLine = res.data || [];
         this.measureLine = measureLine;
         this.$refs.flow.setOptions(measureLine)
+        this.$nextTick(() => {
+          this.$refs.simulation.setOptions()
+        })
       })
     },
     loadTaskNotice() {

+ 0 - 1
ruoyi-ui/src/views/analysis/task/realtime/report.vue

@@ -22,7 +22,6 @@ export default {
 <style scoped>
 .realtime-container {
   background: #fff;
-  height: 300px;
   border-radius: 4px;
   padding: 20px;
 }

+ 33 - 8
ruoyi-ui/src/views/analysis/water-flow/chart.vue

@@ -42,20 +42,34 @@ export default {
         ...this.pagination,
       };
       listScatterPlot(params).then((res) => {
-        const chartData = res.data.records || [];
-        const seriesData = chartData.map(({ flowsum, waterlevel }) => [flowsum, waterlevel]);
+        const chartData = res.data || [];
+        const flows = chartData.map(({flowsum}) => flowsum)
+        const max = Math.max(...flows);
+        const min = Math.min(...flows);
+        const seriesData = chartData.map(({ flowsum, waterlevel }) => [waterlevel, flowsum]);
+
         this.chart.setOption({
           xAxis: {
-            name: '流量(m³/h)',
-            scale: true
+            name: '水位(m)',
+            scale: true,
+            axisLine: {
+              lineStyle: {
+                color: '#54606C'
+              }
+            }
           },
           yAxis: {
-            name: '水位(m)',
-            scale: true
+            name: '流量(m³/h)',
+            scale: true,
+            axisLine: {
+              lineStyle: {
+                color: '#54606C'
+              }
+            }
           },
           grid: {
-            left: 50,
-            right: 50,
+            left: 30,
+            right: 70,
             bottom: 40,
             top: 40,
             containLabel: true
@@ -65,12 +79,23 @@ export default {
             axisPointer: {
               type: 'cross'
             },
+            formatter: (params) => {
+              const { data } = params[0];
+              return `水位:${data[1]} m<br />流量:${data[0]} m³/h`;
+            },
             padding: [5, 10]
           },
           series: [{
             name: '水位',
             type: 'scatter',
             data: seriesData,
+            symbolSize: (value) => {
+              const per = (value[1] - min) / (max - min);
+              return 10 + 10 * per;
+            },
+            itemStyle: {
+              color: '#54D192'
+            }
           }]
         })
       })

+ 0 - 1
ruoyi-ui/src/views/analysis/water-flow/index.vue

@@ -95,7 +95,6 @@ export default {
   },
   methods: {
     handleQuery() {
-      this.getList()
     },
     resetQuery() {},
     init() {

+ 1 - 15
ruoyi-ui/src/views/analysis/water-flow/table.vue

@@ -4,14 +4,6 @@
       <el-table-column label="瞬时总流量" prop="flowsum" />
       <el-table-column label="水位" prop="waterlevel" />
     </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="pagination.page"
-      :limit.sync="pagination.size"
-      @pagination="getList"
-    />
   </div>
 </template>
 
@@ -27,10 +19,6 @@ export default {
       total: 0,
       list: [],
       loading: false,
-      pagination: {
-        page: 1,
-        size: 10,
-      },
     }
   },
   mounted() {
@@ -50,12 +38,10 @@ export default {
       if (!queryParams.siteId) return;
       const params = {
         ...this.queryParams,
-        ...this.pagination,
       };
       this.loading = true;
       listScatterPlot(params).then(response => {
-          this.list = response.data.records;
-          this.total = response.data.total;
+          this.list = response.data;
           this.loading = false;
         }
       );

+ 0 - 4
ruoyi-ui/src/views/analysis/water-time/chart.vue

@@ -134,10 +134,6 @@ export default {
                 }
               }
             },
-            areaStyle: {
-              color: '#FF8500',
-              opacity: 0.5
-            },
             smooth: false,
             type: 'line',
             data: seriesData,