Jelajahi Sumber

feat: 停泊点策略管理

hum 1 tahun lalu
induk
melakukan
3b7899876a

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

@@ -27,6 +27,10 @@ public interface BerthingService {
 
     BerthingPoint queryBerthingById(Long id);
 
+    BerthingPoint queryBerthingBySiteId(Long siteId);
+
+    Boolean deleteStopPointsById(Long id);
+
     Boolean deleteBerthingById(Long id);
 
     boolean  downFile(Long siteId, HttpServletResponse response);
@@ -37,6 +41,8 @@ public interface BerthingService {
 
     Page<BerthingPointConfig> queryStopPrint(StopPointQuery stopPointQuery);
 
+    BerthingPointConfig queryStopPointsById(Long id);
+
     boolean addTimePrint(BerthingTimeDTO berthingTimeDTO);
 
     Page<BerthingTimeConfig> queryTimePrint(TimePointQuery timePointQuery);

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

@@ -130,6 +130,11 @@ public class BerthingServiceImpl implements BerthingService {
         return berthingPointMapper.queryById(id);
     }
 
+    @Override
+    public BerthingPoint queryBerthingBySiteId(Long siteId) {
+        return berthingPointMapper.queryBySiteId(siteId);
+    }
+
     @Override
     public Boolean deleteBerthingById(Long id) {
         BerthingPoint berthingPoint = berthingPointMapper.queryById(id);
@@ -254,6 +259,17 @@ public class BerthingServiceImpl implements BerthingService {
 
     }
 
+    @Override
+    public BerthingPointConfig queryStopPointsById(Long id) {
+        return berthingPointConfigMapper.queryById(id);
+    }
+
+    @Override
+    public Boolean deleteStopPointsById(Long id) {
+        berthingPointConfigMapper.deleteById(id);
+        return true;
+    }
+
     @Override
     public boolean addTimePrint(BerthingTimeDTO berthingTimeDTO) {
         SiteInfo siteInfo = siteInfoMapper.queryById(berthingTimeDTO.getSiteId());

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

@@ -39,6 +39,7 @@
                 and a.site_id = #{stopPointQuery.siteId}
             </if>
         </where>
+        order by a.wlevel desc
     </select>
 
     <!--统计总行数-->

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

@@ -15,6 +15,13 @@ export function getSection(id) {
   })
 }
 
+export function getSiteSection(siteId) {
+  return request({
+    url: `/berthing/site/${siteId}`,
+    method: 'get'
+  })
+}
+
 export function uploadSection(formData) {
   return request({
     url: '/berthing/uploadFile',
@@ -40,3 +47,33 @@ export function deleteSection(id) {
     method: 'delete',
   })
 }
+
+export function getPlainPoint(id) {
+  return request({
+    url: `/berthing/stopPoint/${id}`,
+    method: 'get'
+  })
+}
+
+export function listPlainPoint(query) {
+  return request({
+    url: '/berthing/queryStopPrint',
+    method: 'post',
+    data: query
+  })
+}
+
+export function savePlainPoint(data) {
+  return request({
+    url: '/berthing/addStopPrint',
+    method: 'post',
+    data: data
+  })
+}
+
+export function deletePlainPoint(id) {
+  return request({
+    url: `/berthing/stopPoint/${id}`,
+    method: 'delete',
+  })
+}

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

@@ -0,0 +1,226 @@
+<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" @addPoint="addPoint" />
+    </div>
+    <div class="hum-page-title" style="margin-top: 30px">停泊点</div>
+    <div class="hum-page-section">
+      <el-table v-loading="loading" :data="points" border>
+        <el-table-column label="序号" type="index" />
+        <el-table-column label="起点距">
+          <template slot-scope="scope">
+            <span>{{ scope.row.x }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="水面修正系数">
+          <template slot-scope="scope">
+            <el-input-number
+              placeholder="请输入水面修正系数"
+              v-model="scope.row.factor"
+              :precision="2"
+              :step="0.1"
+              :min="0.0" />
+          </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="deletePoint(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 { savePlainPoint, getSiteSection, getPlainPoint } from '@/api/site/berthing'
+import SectionChart from './chart';
+
+export default {
+  components: {
+    SectionChart,
+  },
+  data() {
+    return {
+      stopId: 0,
+      siteId: 0,
+      site: {},
+      loading: false,
+      points: [],
+      plain: {
+        sections: [],
+        wlevelmax: 0,
+        wlevelmin: 0,
+        wlevel: 0,
+        positions: [],
+      },
+      form: {
+        stopId: '',
+        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.stopId ? '编辑停泊点策略' : '新增停泊点策略';
+    }
+  },
+  methods: {
+    loadPlainPoint() {
+      getPlainPoint(this.stopId).then((res) => {
+        const { stopId, planid, siteId, wlevel, positions, factors } = res.data || {};
+
+        const positions1 = JSON.parse(positions);
+        const factors1 = JSON.parse(factors);
+
+        this.plain.wlevel = wlevel;
+        this.plain.positions = positions1.map(({ x }) => x);
+
+        this.points = positions1.map((p, index) => ({ ...p, factor: factors1[index] }))
+
+        this.form.stopId = stopId;
+        this.form.planid = planid;
+
+        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 } = res.data || {};
+        this.plain.wlevelmax = wlevelmax;
+        this.plain.wlevelmin = wlevelmin;
+        this.form.wlevel = this.plain.wlevel;
+      })
+    },
+    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.form.type = site.type;
+        this.site = site;
+      })
+    },
+    addPoint(point) {
+      const p = this.plain.sections.find(({ x }) => x === point);
+      const points = [...this.points, { ...p, factor: 1 }];
+      points.sort((a, b) => a.x - b.x);
+      this.points = points;
+      this.plain.positions = [...this.plain.positions, point];
+    },
+    deletePoint(index) {
+      this.points.splice(index, 1);
+      this.plain.positions.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,
+          positions: this.points.map(({ x, y }) => ({ x, y })),
+          factors: this.points.map(({ factor }) => factor),
+        }
+        savePlainPoint(data).then(response => {
+          this.$modal.msgSuccess(this.stopId ? "编辑成功" : "新增成功");
+          this.$router.back();
+        }).finally(() => {
+          this.loading = false;
+        });
+      });
+    },
+    download() {
+      window.open(`${process.env.VUE_APP_BASE_API}/berthing/downFile/${this.id}`, '_blank')
+    },
+  },
+  mounted() {
+    this.stopId = this.$route.params.id;
+    this.siteId = this.$route.query.siteId;
+    if (this.siteId) {
+      this.loadSite();
+      this.loadSection();
+      this.loadConfig();
+    }
+    if (this.stopId) {
+      this.loadPlainPoint()
+    }
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.el-input-number {
+  width: 100%;
+}
+</style>

+ 238 - 0
ruoyi-ui/src/views/site/plain-point/chart-list.vue

@@ -0,0 +1,238 @@
+<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: '#46C67F' },
+                name: '最高水位',
+                label: {
+                  formatter: '{b}'
+                }
+              },
+              {
+                yAxis: wlevelmin,
+                lineStyle: { width: 1, color: '#46C67F' },
+                name: '最低水位',
+                label: {
+                  formatter: '{b}'
+                }
+              },
+            ]
+          },
+        }]
+      };
+      list.forEach((plain, index) => {
+        const themes = [
+          '#2ec7c9',
+          '#b6a2de',
+          '#5ab1ef',
+          '#d87a80',
+          '#8d98b3',
+          '#97b552',
+          '#95706d',
+          '#dc69aa',
+          '#07a2a4',
+          '#9a7fd1',
+        ]
+        const { wlevel, positions } = plain;
+        const positions1 = JSON.parse(positions) || [];
+        const pointsData = positions1.reduce((init, p) => {
+          const xIndex = xAxisData.findIndex(x => x === p.x);
+          if (xIndex !== -1) {
+            init.push({ coord: [xIndex, wlevel] })
+          }
+          return init;
+        }, []);
+        options.series.push({
+          name: '起测水位',
+          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],
+            },
+            data: [{
+              type: 'average',
+              label: {
+                formatter: '{b}'
+              }
+            }],
+          },
+          markPoint: {
+            label: {
+              formatter: ({ data }) => xAxisData[data.coord[0]],
+            },
+            itemStyle: {
+              color: themes[index],
+            },
+            data: pointsData,
+          },
+        });
+      })
+      this.chart.setOption(options);
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

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

@@ -0,0 +1,222 @@
+<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');
+      this.chart.on('click', (params) => {
+        if (params.componentType === 'series') {
+          const { seriesIndex, dataIndex } = params;
+          const { series, xAxis } = this.chart.getOption();
+          const { markPoint: { data } } = series[seriesIndex];
+          if (!data.some(({ coord }) => coord[0] === dataIndex)) {
+            this.$emit('addPoint', xAxis[0].data[dataIndex])
+          }
+        }
+      })
+    })
+  },
+  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, positions } = plain;
+      const xAxisData = sections.map(({ x }) => x);
+      const seriesData = sections.map(({ y }) => y);
+      const pointsData = positions.reduce((init, p) => {
+        const xIndex = xAxisData.findIndex(x => x === p);
+        if (xIndex !== -1) {
+          init.push({ coord: [xIndex, wlevel] })
+        }
+        return init;
+      }, []);
+      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: '#46C67F' },
+                name: '最高水位',
+                label: {
+                  formatter: '{b}'
+                }
+              },
+              {
+                yAxis: wlevelmin,
+                lineStyle: { width: 1, color: '#46C67F' },
+                name: '最低水位',
+                label: {
+                  formatter: '{b}'
+                }
+              },
+            ]
+          },
+        }]
+      };
+      if (wlevel > wlevelmin && wlevel < wlevelmax) {
+        options.series.push({
+          name: '起测水位',
+          lineStyle: {
+            width: 0,
+          },
+          data: new Array(seriesData.length).fill(wlevel),
+          type: 'line',
+          markLine: {
+            symbol: 'none',
+            silent: true,
+            data: [{
+              type: 'average',
+              label: {
+                formatter: '{b}'
+              }
+            }],
+          },
+          markPoint: {
+            label: {
+              formatter: ({ data }) => xAxisData[data.coord[0]],
+            },
+            data: pointsData,
+          },
+        });
+      }
+      this.chart.setOption(options);
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 146 - 0
ruoyi-ui/src/views/site/plain-point/index.vue

@@ -0,0 +1,146 @@
+<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="操作" 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 { deletePlainPoint, getSiteSection, listPlainPoint } 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;
+      listPlainPoint({ ...this.queryParams, siteId: this.siteId }).then(response => {
+          this.list = response.data.records;
+          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/point/add?siteId=${this.siteId}`);
+    },
+    handleUpdate(plain) {
+      this.$router.push(`/site/plain/point/edit/${plain.stopId}`);
+    },
+    handleDelete(plain) {
+      this.$modal.confirm('是否确认删除策略编号为"' + plain.planid + '"的数据项?').then(function() {
+        return deletePlainPoint(plain.stopId);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 4 - 1
ruoyi-ui/src/views/site/section/add.vue

@@ -6,7 +6,7 @@
         <el-upload :action="uploadAction" :on-success="importSection" name="file" :show-file-list="false">
           <el-button type="primary">导入</el-button>
         </el-upload>
-        <el-button class="extra-action-export" @click="resetQuery">导出</el-button>
+        <el-button :disabled="!this.id" class="extra-action-export" @click="download">导出</el-button>
       </div>
     </div>
     <div class="hum-page-title" style="margin-top: 30px">断面图</div>
@@ -173,6 +173,9 @@ export default {
         });
       });
     },
+    download() {
+      window.open(`${process.env.VUE_APP_BASE_API}/berthing/downFile/${this.id}`, '_blank')
+    },
   },
   mounted() {
     this.id = this.$route.params.id;

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

@@ -64,6 +64,12 @@ public class BerthingController {
         return R.ok(berthingService.queryBerthingById(id));
     }
 
+    @GetMapping(value = "/site/{id}")
+    @ApiOperation("查询断面")
+    public R<BerthingPoint> queryBerthingBySiteId(@PathVariable("id") Long siteId) {
+        return R.ok(berthingService.queryBerthingBySiteId(siteId));
+    }
+
     @DeleteMapping(value = "/{id}")
     @ApiOperation("删除断面")
     public R<Boolean> deleteBerthingById(@PathVariable("id") Long id) {
@@ -88,6 +94,17 @@ public class BerthingController {
         return R.ok(berthingService.addStopPrint(berthingPointConfigDTO));
     }
 
+    @GetMapping(value = "/stopPoint/{id}")
+    @ApiOperation("查询停泊点策略")
+    public R<BerthingPointConfig> queryStopPointsById(@PathVariable("id") Long id) {
+        return R.ok(berthingService.queryStopPointsById(id));
+    }
+
+    @DeleteMapping(value = "/stopPoint/{id}")
+    @ApiOperation("删除停泊点策略")
+    public R<Boolean> deleteStopPointsById(@PathVariable("id") Long id) {
+        return R.ok(berthingService.deleteStopPointsById(id));
+    }
 
     @PostMapping(value = "/queryStopPrint")
     @ApiOperation("查询停泊点")