Переглянути джерело

feat: 手动测流任务下发,界面显示当前触发的停泊点垂线即可,无需显示所有策略配置停泊点

hum 1 рік тому
батько
коміт
0e06cf4b6c

+ 1 - 1
ruoyi-ui/src/views/analysis/task/result/manual.vue

@@ -5,7 +5,7 @@
       <el-radio :label="2">指定临时垂线测流</el-radio>
     </el-radio-group>
     <div style="margin-top: 10px">
-      <ChartList v-if="plain.type===1" :plain="plain" />
+      <ChartList v-if="plain.type===1" :plain="plain" onlyShowCurrentPlain />
       <Chart v-if="plain.type===2" :plain="plain" @addPoint="addPoint" />
     </div>
     <div slot="footer" class="dialog-footer">

+ 13 - 3
ruoyi-ui/src/views/site/plain-point/chart-list.vue

@@ -10,6 +10,10 @@ export default {
   mixins: [resize],
   props: {
     plain: Object,
+    onlyShowCurrentPlain: {
+      type: Boolean,
+      default: false,
+    }
   },
   mounted() {
     this.$nextTick(() => {
@@ -37,7 +41,7 @@ export default {
       if (!this.chart) {
         return;
       }
-      const { sections, wlevelmax, wlevelmin, list } = plain;
+      const { sections, wlevelmax, wlevelmin, list, waterlevel } = plain;
       const xAxisData = sections.map(({ x }) => x);
       const seriesData = sections.map(({ x, y }) => ([x, y]));
       const options = {
@@ -159,9 +163,9 @@ export default {
           },
         }]
       };
-      if (plain.waterlevel) {
+      if (waterlevel) {
         options.series.push({
-          data: [[Math.min(...xAxisData), plain.waterlevel],[Math.max(...xAxisData), plain.waterlevel]],
+          data: [[Math.min(...xAxisData), waterlevel],[Math.max(...xAxisData), waterlevel]],
           type: 'line',
           symbol: 'none',
           z: 0,
@@ -174,6 +178,7 @@ export default {
           }
         })
       }
+      let hasSetCurrent = false;
       list.forEach((plain, index) => {
         const themes = [
           '#2ec7c9',
@@ -188,6 +193,11 @@ export default {
           '#9a7fd1',
         ]
         const { wlevel, positions, planid } = plain;
+        if (this.onlyShowCurrentPlain && (hasSetCurrent || wlevel > waterlevel)) {
+          return;
+        } else {
+          hasSetCurrent = true;
+        }
         const positions1 = JSON.parse(positions) || [];
         const pointsData = positions1.reduce((init, p) => {
           const xIndex = xAxisData.findIndex(x => x === p.x);