Prechádzať zdrojové kódy

feat: 时间点策略管理

hum 1 rok pred
rodič
commit
51e2ec65cd

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/BerthingService.java

@@ -47,6 +47,10 @@ public interface BerthingService {
 
     Page<BerthingTimeConfig> queryTimePrint(TimePointQuery timePointQuery);
 
+    BerthingTimeConfig queryStopTimeById(Long id);
+
+    boolean deleteStopTimeById(Long id);
+
     boolean addFloatPrint(BerthingFloatDTO berthingFloatDTO);
 
     Page<BerthingFloatConfig> queryFloatPrint(FloatPointQuery floatPointQuery);

+ 10 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BerthingServiceImpl.java

@@ -328,6 +328,16 @@ public class BerthingServiceImpl implements BerthingService {
 
     }
 
+    @Override
+    public BerthingTimeConfig queryStopTimeById(Long id) {
+        return berthingTimeConfigMapper.queryById(id);
+    }
+
+    @Override
+    public boolean deleteStopTimeById(Long id) {
+        berthingTimeConfigMapper.deleteById(id);
+        return true;
+    }
 
     @Override
     public boolean addFloatPrint(BerthingFloatDTO berthingFloatDTO) {

+ 1 - 0
ruoyi-system/src/main/resources/mapper/BerthingTimeConfigMapper.xml

@@ -38,6 +38,7 @@ time_id, id, site_id, planid, create_time, status, is_del, wlevel, times, type
                 and a.site_id = #{timePointQuery.siteId}
             </if>
         </where>
+        order by a.wlevel desc
     </select>
 
     <!--统计总行数-->

+ 30 - 0
ruoyi-ui/src/api/site/berthing.js

@@ -77,3 +77,33 @@ export function deletePlainPoint(id) {
     method: 'delete',
   })
 }
+
+export function getPlainTime(id) {
+  return request({
+    url: `/berthing/stopTime/${id}`,
+    method: 'get'
+  })
+}
+
+export function listPlainTime(query) {
+  return request({
+    url: '/berthing/queryTimePrint',
+    method: 'post',
+    data: query
+  })
+}
+
+export function savePlainTime(data) {
+  return request({
+    url: '/berthing/addTimePrint',
+    method: 'post',
+    data: data
+  })
+}
+
+export function deletePlainTime(id) {
+  return request({
+    url: `/berthing/stopTime/${id}`,
+    method: 'delete',
+  })
+}

+ 3 - 0
ruoyi-ui/src/assets/styles/hum.scss

@@ -27,6 +27,9 @@
   line-height: 32px;
   color: #1D2738;
   padding-bottom: 20px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
 }
 
 .hum-page-main {

+ 2 - 2
ruoyi-ui/src/views/site/plain-point/add.vue

@@ -152,10 +152,11 @@ export default {
     },
     loadConfig() {
       getConfig(this.siteId).then((res) => {
-        const { wlevelmax, wlevelmin } = res.data || {};
+        const { wlevelmax, wlevelmin, type } = res.data || {};
         this.plain.wlevelmax = wlevelmax;
         this.plain.wlevelmin = wlevelmin;
         this.form.wlevel = this.plain.wlevel;
+        this.form.type = type;
       })
     },
     loadSite() {
@@ -164,7 +165,6 @@ export default {
         this.form.id = this.id;
         this.form.siteId = this.siteId;
         this.form.siteName = site.siteName;
-        this.form.type = site.type;
         this.site = site;
       })
     },

+ 7 - 5
ruoyi-ui/src/views/site/plain-point/chart-list.vue

@@ -150,7 +150,7 @@ export default {
             data: [
               {
                 yAxis: wlevelmax,
-                lineStyle: { width: 1, color: '#46C67F' },
+                lineStyle: { width: 1, color: 'red' },
                 name: '最高水位',
                 label: {
                   formatter: '{b}'
@@ -158,7 +158,7 @@ export default {
               },
               {
                 yAxis: wlevelmin,
-                lineStyle: { width: 1, color: '#46C67F' },
+                lineStyle: { width: 1, color: 'red' },
                 name: '最低水位',
                 label: {
                   formatter: '{b}'
@@ -181,7 +181,7 @@ export default {
           '#07a2a4',
           '#9a7fd1',
         ]
-        const { wlevel, positions } = plain;
+        const { wlevel, positions, planid } = plain;
         const positions1 = JSON.parse(positions) || [];
         const pointsData = positions1.reduce((init, p) => {
           const xIndex = xAxisData.findIndex(x => x === p.x);
@@ -191,7 +191,7 @@ export default {
           return init;
         }, []);
         options.series.push({
-          name: '起测水位',
+          name: `策略编号(${planid})`,
           symbol: 'none',
           itemStyle: {
             normal: {
@@ -209,8 +209,10 @@ export default {
             lineStyle: {
               color: themes[index],
             },
+            label: { position: 'start' },
             data: [{
-              type: 'average',
+              yAxis: wlevel,
+              name: `策略编号(${planid})`,
               label: {
                 formatter: '{b}'
               }

+ 2 - 2
ruoyi-ui/src/views/site/plain-point/chart.vue

@@ -167,7 +167,7 @@ export default {
             data: [
               {
                 yAxis: wlevelmax,
-                lineStyle: { width: 1, color: '#46C67F' },
+                lineStyle: { width: 1, color: 'red' },
                 name: '最高水位',
                 label: {
                   formatter: '{b}'
@@ -175,7 +175,7 @@ export default {
               },
               {
                 yAxis: wlevelmin,
-                lineStyle: { width: 1, color: '#46C67F' },
+                lineStyle: { width: 1, color: 'red' },
                 name: '最低水位',
                 label: {
                   formatter: '{b}'

+ 213 - 0
ruoyi-ui/src/views/site/plain-time/add.vue

@@ -0,0 +1,213 @@
+<template>
+  <div class="hum-page-container">
+    <div class="hum-page-title">测流设置</div>
+    <el-form :model="form" :rules="rules" size="large" ref="form" label-position="top">
+      <div class="hum-page-form">
+        <el-row :gutter="30">
+          <el-col :span="6">
+            <el-form-item label="当前站点" prop="siteId">
+              <el-input
+                v-model="form.siteName"
+                disabled
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="策略编号" prop="planid">
+              <el-input
+                v-model="form.planid"
+                placeholder="请输入策略编号"
+                clearable
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="起测水位" prop="wlevel">
+              <el-input-number
+                placeholder="请输入起测水位"
+                v-model="form.wlevel"
+                @change="wlevel => plain.wlevel = wlevel"
+                :precision="2"
+                :step="0.1"
+                :min="plain.wlevelmin"
+                :max="plain.wlevelmax" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
+    </el-form>
+    <div class="hum-page-title" style="margin-top: 30px">断面图</div>
+    <div class="hum-page-section">
+      <SectionChart :plain="plain" />
+    </div>
+    <div class="hum-page-title" style="margin-top: 30px">
+      <span>时间点</span>
+      <el-button type="primary" @click="addTime">新增</el-button>
+    </div>
+    <div class="hum-page-section">
+      <el-table v-loading="loading" :data="times" border>
+        <el-table-column label="序号" type="index" />
+        <el-table-column label="时间点">
+          <template slot-scope="scope">
+            <el-time-picker
+              v-model="scope.row.time"
+              value-format="HH:mm"
+              :picker-options="{ format: 'HH:mm' }"
+              placeholder="请选择时间点">
+            </el-time-picker>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button size="mini" type="text" icon="el-icon-delete" @click="deleteTime(scope.$index)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <div class="hum-page-form-action">
+      <el-button @click="$router.back()">取消</el-button>
+      <el-button type="primary" @click="submitForm" :loading="loading">保存</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getSite, getConfig } from '@/api/site/site'
+import { savePlainTime, getSiteSection, getPlainTime } from '@/api/site/berthing'
+import SectionChart from './chart';
+
+export default {
+  components: {
+    SectionChart,
+  },
+  data() {
+    return {
+      timeId: 0,
+      siteId: 0,
+      site: {},
+      loading: false,
+      times: [],
+      plain: {
+        sections: [],
+        wlevelmax: 0,
+        wlevelmin: 0,
+        wlevel: 0,
+      },
+      form: {
+        timeId: '',
+        id: '',
+        berthingId: '',
+        siteId: '',
+        siteName: '',
+        type: '',
+        planid: '',
+        wlevel: 0,
+      },
+      rules: {
+        planid: [
+          {required: true, message: "策略编号不能为空", trigger: "blur"}
+        ],
+        wlevel: [
+          {required: true, message: "起测水位不能为空", trigger: "blur"}
+        ],
+      },
+    }
+  },
+  computed: {
+    title() {
+      return this.timeId ? '编辑时间点策略' : '新增时间点策略';
+    }
+  },
+  methods: {
+    loadPlainTime() {
+      getPlainTime(this.timeId).then((res) => {
+        const { timeId, planid, siteId, wlevel, times } = res.data || {};
+
+        this.plain.wlevel = wlevel;
+
+        this.form.timeId = timeId;
+        this.form.planid = planid;
+
+        this.times = (JSON.parse(times) || []).map((time) => ({ time }));
+
+        this.siteId = siteId;
+        this.loadSite();
+        this.loadSection();
+        this.loadConfig();
+      })
+    },
+    loadSection() {
+      getSiteSection(this.siteId).then((res) => {
+        const { positions, berthingId } = res.data || {};
+        this.form.berthingId = berthingId;
+        this.plain.sections = JSON.parse(positions) || [];
+      })
+    },
+    loadConfig() {
+      getConfig(this.siteId).then((res) => {
+        const { wlevelmax, wlevelmin, type } = res.data || {};
+        this.plain.wlevelmax = wlevelmax;
+        this.plain.wlevelmin = wlevelmin;
+        this.form.wlevel = this.plain.wlevel;
+        this.form.type = type;
+      })
+    },
+    loadSite() {
+      getSite(this.siteId).then((res) => {
+        const site = res.data || {};
+        this.form.id = this.id;
+        this.form.siteId = this.siteId;
+        this.form.siteName = site.siteName;
+        this.site = site;
+      })
+    },
+    addTime() {
+      this.times = [...this.times, { time: '' }];
+    },
+    deleteTime(index) {
+      this.times.splice(index, 1);
+    },
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (!valid) {
+          return;
+        }
+        this.loading = true;
+        const data = {
+          ...this.form,
+          wlevelmax: this.plain.wlevelmax,
+          wlevelmin: this.plain.wlevelmin,
+          times: this.times.map(({ time }) => time).sort(),
+        }
+        savePlainTime(data).then(response => {
+          this.$modal.msgSuccess(this.timeId ? "编辑成功" : "新增成功");
+          this.$router.back();
+        }).finally(() => {
+          this.loading = false;
+        });
+      });
+    },
+    download() {
+      window.open(`${process.env.VUE_APP_BASE_API}/berthing/downFile/${this.id}`, '_blank')
+    },
+  },
+  mounted() {
+    this.timeId = this.$route.params.id;
+    this.siteId = this.$route.query.siteId;
+    if (this.siteId) {
+      this.loadSite();
+      this.loadSection();
+      this.loadConfig();
+    }
+    if (this.timeId) {
+      this.loadPlainTime()
+    }
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.el-input-number {
+  width: 100%;
+}
+</style>

+ 223 - 0
ruoyi-ui/src/views/site/plain-time/chart-list.vue

@@ -0,0 +1,223 @@
+<template>
+  <div ref="chart" class="chart" :style="{height: '400px', width: '100%'}" />
+</template>
+
+<script>
+import * as echarts from "echarts";
+require('echarts/theme/macarons') // echarts theme
+import resize from '@/utils/resize'
+
+export default {
+  mixins: [resize],
+  props: {
+    plain: Object,
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.chart = echarts.init(this.$refs.chart, 'macarons');
+    })
+  },
+  beforeDestroy() {
+    if (!this.chart) {
+      return
+    }
+    this.chart.dispose()
+    this.chart = null
+  },
+  watch: {
+    plain: {
+      handler(value) {
+        this.setOptions(value)
+      },
+      deep: true,
+      immediate: true,
+    }
+  },
+  methods: {
+    setOptions(plain) {
+      if (!this.chart) {
+        return;
+      }
+      const { sections, wlevelmax, wlevelmin, list } = plain;
+      const xAxisData = sections.map(({ x }) => x);
+      const seriesData = sections.map(({ y }) => y);
+      const options = {
+        xAxis: {
+          name: '起点距',
+          boundaryGap: false,
+          data: xAxisData,
+          type: 'category',
+          axisLine: {
+            lineStyle: {
+              color: '#FF8500'
+            }
+          },
+          axisTick: {
+            lineStyle: {
+              color: '#8D99A4'
+            }
+          },
+          axisLabel: {
+            color: '#54606C'
+          },
+          nameTextStyle: {
+            color: '#54606C'
+          }
+        },
+        yAxis: [
+          {
+            name: '高程(m)',
+            triggerEvent: true,
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: '#FF8500'
+              }
+            },
+            axisTick: {
+              show: true,
+              lineStyle: {
+                color: '#8D99A4'
+              }
+            },
+            axisLabel: {
+              color: '#54606C'
+            },
+            nameTextStyle: {
+              color: '#54606C'
+            },
+            min: function (value) {
+              return Math.round(value.min - (value.max - value.min) * 0.1);
+            },
+            max: function (value) {
+              return Math.round(value.max + (value.max - value.min) * 0.1);
+            },
+          },
+          {
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: '#FF8500'
+              }
+            },
+            axisTick: {
+              show: false,
+            },
+            axisLabel: {
+              show: false,
+            },
+          },
+        ],
+        grid: {
+          left: 50,
+          right: 50,
+          bottom: 40,
+          top: 40,
+          containLabel: true
+        },
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'cross'
+          },
+          padding: [5, 10]
+        },
+        series: [{
+          name: '高程',
+          itemStyle: {
+            normal: {
+              color: '#FF8500',
+              lineStyle: {
+                color: '#FF8500',
+                width: 2
+              }
+            }
+          },
+          areaStyle: {
+            color: '#FF8500',
+            opacity: 0.5
+          },
+          smooth: false,
+          symbol: 'none',
+          type: 'line',
+          data: seriesData,
+          animations: false,
+          markLine: {
+            symbol: 'none',
+            silent: true,
+            lineStyle: { normal: { type: 'dashed' } },
+            label: { position: 'start' },
+            data: [
+              {
+                yAxis: wlevelmax,
+                lineStyle: { width: 1, color: 'red' },
+                name: '最高水位',
+                label: {
+                  formatter: '{b}'
+                }
+              },
+              {
+                yAxis: wlevelmin,
+                lineStyle: { width: 1, color: 'red' },
+                name: '最低水位',
+                label: {
+                  formatter: '{b}'
+                }
+              },
+            ]
+          },
+        }]
+      };
+      list.forEach((plain, index) => {
+        const themes = [
+          '#2ec7c9',
+          '#b6a2de',
+          '#5ab1ef',
+          '#d87a80',
+          '#8d98b3',
+          '#97b552',
+          '#95706d',
+          '#dc69aa',
+          '#07a2a4',
+          '#9a7fd1',
+        ]
+        const { wlevel, planid } = plain;
+        options.series.push({
+          name: `策略编号(${planid})`,
+          symbol: 'none',
+          itemStyle: {
+            normal: {
+              color: themes[index],
+              lineStyle: {
+                width: 0
+              }
+            }
+          },
+          data: new Array(seriesData.length).fill(wlevel),
+          type: 'line',
+          markLine: {
+            symbol: 'none',
+            silent: true,
+            lineStyle: {
+              color: themes[index],
+            },
+            label: { position: 'start' },
+            data: [{
+              yAxis: wlevel,
+              name: `策略编号(${planid})`,
+              label: {
+                formatter: '{b}'
+              }
+            }],
+          },
+        });
+      })
+      this.chart.setOption(options);
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 204 - 0
ruoyi-ui/src/views/site/plain-time/chart.vue

@@ -0,0 +1,204 @@
+<template>
+  <div ref="chart" class="chart" :style="{height: '400px', width: '100%'}" />
+</template>
+
+<script>
+import * as echarts from "echarts";
+require('echarts/theme/macarons') // echarts theme
+import resize from '@/utils/resize'
+
+export default {
+  mixins: [resize],
+  props: {
+    plain: Object,
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.chart = echarts.init(this.$refs.chart, 'macarons');
+    })
+  },
+  beforeDestroy() {
+    if (!this.chart) {
+      return
+    }
+    this.chart.dispose()
+    this.chart = null
+  },
+  watch: {
+    plain: {
+      handler(value) {
+        this.setOptions(value)
+      },
+      deep: true,
+      immediate: true,
+    }
+  },
+  methods: {
+    setOptions(plain) {
+      if (!this.chart) {
+        return;
+      }
+      const { sections, wlevelmax, wlevelmin, wlevel } = plain;
+      const xAxisData = sections.map(({ x }) => x);
+      const seriesData = sections.map(({ y }) => y);
+      const options = {
+        xAxis: {
+          name: '起点距',
+          boundaryGap: false,
+          data: xAxisData,
+          type: 'category',
+          axisLine: {
+            lineStyle: {
+              color: '#FF8500'
+            }
+          },
+          axisTick: {
+            lineStyle: {
+              color: '#8D99A4'
+            }
+          },
+          axisLabel: {
+            color: '#54606C'
+          },
+          nameTextStyle: {
+            color: '#54606C'
+          }
+        },
+        yAxis: [
+          {
+            name: '高程(m)',
+            triggerEvent: true,
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: '#FF8500'
+              }
+            },
+            axisTick: {
+              show: true,
+              lineStyle: {
+                color: '#8D99A4'
+              }
+            },
+            axisLabel: {
+              color: '#54606C'
+            },
+            nameTextStyle: {
+              color: '#54606C'
+            },
+            min: function (value) {
+              return Math.round(value.min - (value.max - value.min) * 0.1);
+            },
+            max: function (value) {
+              return Math.round(value.max + (value.max - value.min) * 0.1);
+            },
+          },
+          {
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: '#FF8500'
+              }
+            },
+            axisTick: {
+              show: false,
+            },
+            axisLabel: {
+              show: false,
+            },
+          },
+        ],
+        grid: {
+          left: 50,
+          right: 50,
+          bottom: 40,
+          top: 40,
+          containLabel: true
+        },
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'cross'
+          },
+          padding: [5, 10]
+        },
+        series: [{
+          name: '高程',
+          itemStyle: {
+            normal: {
+              color: '#FF8500',
+              lineStyle: {
+                color: '#FF8500',
+                width: 2
+              }
+            }
+          },
+          areaStyle: {
+            color: '#FF8500',
+            opacity: 0.5
+          },
+          smooth: false,
+          symbol: 'none',
+          type: 'line',
+          data: seriesData,
+          animations: false,
+          markLine: {
+            symbol: 'none',
+            silent: true,
+            lineStyle: { normal: { type: 'dashed' } },
+            label: { position: 'start' },
+            data: [
+              {
+                yAxis: wlevelmax,
+                lineStyle: { width: 1, color: 'red' },
+                name: '最高水位',
+                label: {
+                  formatter: '{b}'
+                }
+              },
+              {
+                yAxis: wlevelmin,
+                lineStyle: { width: 1, color: 'red' },
+                name: '最低水位',
+                label: {
+                  formatter: '{b}'
+                }
+              },
+            ]
+          },
+        }]
+      };
+      if (wlevel > wlevelmin && wlevel < wlevelmax) {
+        options.series.push({
+          name: '起测水位',
+          symbol: 'none',
+          silent: true,
+          lineStyle: {
+            width: 0,
+          },
+          data: new Array(seriesData.length).fill(wlevel),
+          type: 'line',
+          markLine: {
+            symbol: 'none',
+            silent: true,
+            lineStyle: { normal: { type: 'dashed' } },
+            label: { position: 'start' },
+            data: [{
+              name: '起测水位',
+              yAxis: wlevel,
+              label: {
+                formatter: '{b}'
+              }
+            }],
+          },
+        });
+      }
+      this.chart.setOption(options);
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 157 - 0
ruoyi-ui/src/views/site/plain-time/index.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="hum-page-container">
+    <div class="hum-page-title">时间点策略管理</div>
+    <div class="hum-page-section">
+      <div class="hum-page-search">
+        <el-form :model="queryParams" size="large" ref="queryForm" label-position="top">
+          <el-row :gutter="30">
+            <el-col :span="6">
+              <el-form-item label="选择站点">
+                <el-select v-model="siteId" placeholder="请选择站点" @change="getList">
+                  <el-option
+                    v-for="item in siteList"
+                    :key="item.siteId"
+                    :label="item.siteName"
+                    :value="item.siteId">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="hum-page-search-action">
+                <el-button type="primary" @click="handleQuery">查询</el-button>
+                <el-button @click="resetQuery">重置</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <div class="hum-page-action">
+        <el-button type="primary" @click="handleAdd">新增策略</el-button>
+      </div>
+      <el-table v-loading="loading" :data="list" border>
+        <el-table-column label="站码" prop="id" />
+        <el-table-column label="站点名称" prop="siteName" />
+        <el-table-column label="策略编号" prop="planid" />
+        <el-table-column label="起测水位" prop="wlevel" />
+        <el-table-column label="时间点">
+          <template slot-scope="scope">
+            <el-tag
+              v-for="time in scope.row.times"
+              :key="time"
+              type="info"
+              effect="plain">
+              {{ time }}
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">编辑</el-button>
+            <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <div class="hum-page-title" style="margin-top: 30px">断面图</div>
+    <div class="hum-page-section">
+      <ChartList :plain="plain" />
+    </div>
+  </div>
+</template>
+
+<script>
+import { getConfig, listSite } from "@/api/site/site";
+import { deletePlainTime, getSiteSection, listPlainTime } from "@/api/site/berthing";
+import ChartList from './chart-list';
+
+export default {
+  components: {
+    ChartList
+  },
+  data() {
+    return {
+      siteId: '',
+      siteList: [],
+      plain: {
+        wlevelmax: 0,
+        wlevelmin: 0,
+        list: [],
+        sections: [],
+      },
+      queryParams: {
+        page: 1,
+        size: 1000,
+      },
+      loading: true,
+      total: 0,
+      list: []
+    }
+  },
+  created() {
+    this.init();
+  },
+  methods: {
+    handleQuery() {
+      this.getList()
+    },
+    resetQuery() {},
+    init() {
+      this.loading = true;
+      listSite({ page: 1, size: 1000 }).then(response => {
+          this.siteList = response.data.records || [];
+          if (this.siteList.length > 0) {
+            this.siteId = this.siteList[0].siteId;
+            this.getList();
+            this.loadConfig();
+            this.loadSection();
+          }
+        }
+      ).catch(() => {
+        this.loading = false;
+      });
+    },
+    getList() {
+      this.loading = true;
+      listPlainTime({ ...this.queryParams, siteId: this.siteId }).then(response => {
+          this.list = response.data.records.map((time) => ({ ...time, times: JSON.parse(time.times) }));
+          this.total = response.data.total;
+          this.plain.list = response.data.records;
+          this.loading = false;
+        }
+      );
+    },
+    loadConfig() {
+      getConfig(this.siteId).then((res) => {
+        const { wlevelmax, wlevelmin } = res.data || {};
+        this.plain.wlevelmax = wlevelmax;
+        this.plain.wlevelmin = wlevelmin;
+      })
+    },
+    loadSection() {
+      getSiteSection(this.siteId).then((res) => {
+        const { positions } = res.data || {};
+        this.plain.sections = JSON.parse(positions) || [];
+      })
+    },
+    handleAdd() {
+      this.$router.push(`/site/plain/time/add?siteId=${this.siteId}`);
+    },
+    handleUpdate(plain) {
+      this.$router.push(`/site/plain/time/edit/${plain.timeId}`);
+    },
+    handleDelete(plain) {
+      this.$modal.confirm('是否确认删除策略编号为"' + plain.planid + '"的数据项?').then(function() {
+        return deletePlainTime(plain.timeId);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 12 - 0
waterAffairs-admin/src/main/java/com/ruoyi/web/controller/tool/BerthingController.java

@@ -119,6 +119,18 @@ public class BerthingController {
         return R.ok(berthingService.addTimePrint(berthingTimeDTO));
     }
 
+    @GetMapping(value = "/stopTime/{id}")
+    @ApiOperation("查询时间策略")
+    public R<BerthingTimeConfig> queryStopTimeById(@PathVariable("id") Long id) {
+        return R.ok(berthingService.queryStopTimeById(id));
+    }
+
+    @DeleteMapping(value = "/stopTime/{id}")
+    @ApiOperation("删除时间策略")
+    public R<Boolean> deleteStopTimeById(@PathVariable("id") Long id) {
+        return R.ok(berthingService.deleteStopTimeById(id));
+    }
+
     @PostMapping(value = "/queryTimePrint")
     @ApiOperation("查询时间策略")
     public R<Page<BerthingTimeConfig>> queryTimePrint(@RequestBody TimePointQuery timePointQuery) {