conghelong 1 год назад
Родитель
Сommit
c64ea057bf

+ 98 - 0
songhua-admin/src/main/java/com/songhua/web/controller/system/BasicCruiseShipController.java

@@ -0,0 +1,98 @@
+package com.songhua.web.controller.system;
+
+import com.songhua.common.annotation.Log;
+import com.songhua.common.core.controller.BaseController;
+import com.songhua.common.core.domain.AjaxResult;
+import com.songhua.common.core.page.TableDataInfo;
+import com.songhua.common.enums.BusinessType;
+import com.songhua.common.utils.poi.ExcelUtil;
+import com.songhua.system.domain.BasicCruiseShip;
+import com.songhua.system.service.IBasicCruiseShipService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 游船基本信息
+ * 
+ * @author ruoyi
+ * @date 2024-04-23
+ */
+@RestController
+@RequestMapping("/system/ship")
+public class BasicCruiseShipController extends BaseController
+{
+    @Autowired
+    private IBasicCruiseShipService basicCruiseShipService;
+
+    /**
+     * 查询游船列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:ship:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BasicCruiseShip basicCruiseShip)
+    {
+        startPage();
+        List<BasicCruiseShip> list = basicCruiseShipService.selectBasicCruiseShipList(basicCruiseShip);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出游船列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:ship:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BasicCruiseShip basicCruiseShip)
+    {
+        List<BasicCruiseShip> list = basicCruiseShipService.selectBasicCruiseShipList(basicCruiseShip);
+        ExcelUtil<BasicCruiseShip> util = new ExcelUtil<BasicCruiseShip>(BasicCruiseShip.class);
+        util.exportExcel(response, list, "游船数据");
+    }
+
+    /**
+     * 获取游船详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:ship:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(basicCruiseShipService.selectBasicCruiseShipById(id));
+    }
+
+    /**
+     * 新增游船
+     */
+    @PreAuthorize("@ss.hasPermi('system:ship:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BasicCruiseShip basicCruiseShip)
+    {
+        return toAjax(basicCruiseShipService.insertBasicCruiseShip(basicCruiseShip));
+    }
+
+    /**
+     * 修改游船
+     */
+    @PreAuthorize("@ss.hasPermi('system:ship:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BasicCruiseShip basicCruiseShip)
+    {
+        return toAjax(basicCruiseShipService.updateBasicCruiseShip(basicCruiseShip));
+    }
+
+    /**
+     * 删除游船
+     */
+    @PreAuthorize("@ss.hasPermi('system:ship:remove')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(basicCruiseShipService.deleteBasicCruiseShipByIds(ids));
+    }
+}

+ 152 - 0
songhua-system/src/main/java/com/songhua/system/domain/BasicCruiseShip.java

@@ -0,0 +1,152 @@
+package com.songhua.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.songhua.common.annotation.Excel;
+import com.songhua.common.core.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】对象 basic_cruise_ship
+ * 
+ * @author ruoyi
+ * @date 2024-04-23
+ */
+
+public class BasicCruiseShip extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+
+    private Long id;
+
+    /** 船名 */
+    @Excel(name = "船名")
+    private String shipName;
+
+    /** 船型 */
+    @Excel(name = "船型")
+    private String shipType;
+
+    /** 船长 */
+    @Excel(name = "船长")
+    private String lengthOverall;
+
+
+    /** 船舶注册号 */
+    @Excel(name = "船舶注册号")
+    private String registrationNumber;
+
+    /** 船舱数量 */
+    @Excel(name = "船舱数量")
+    private String quantity;
+
+
+
+    /** 船舱数量 */
+    @Excel(name = "驱动类型")
+    private String propulsion;
+
+    /** 乘客容量 */
+    @Excel(name = "乘客容量")
+    private String passengerCapacity;
+
+
+
+    /** 乘客容量 */
+    @Excel(name = "安全设备")
+    private String safetyEquipment;
+
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setShipName(String shipName) 
+    {
+        this.shipName = shipName;
+    }
+
+    public String getShipName() 
+    {
+        return shipName;
+    }
+    public void setShipType(String shipType) 
+    {
+        this.shipType = shipType;
+    }
+
+    public String getShipType() 
+    {
+        return shipType;
+    }
+    public void setLengthOverall(String lengthOverall)
+    {
+        this.lengthOverall = lengthOverall;
+    }
+
+    public String getLengthOverall()
+    {
+        return lengthOverall;
+    }
+
+    public void setRegistrationNumber(String registrationNumber)
+    {
+        this.registrationNumber = registrationNumber;
+    }
+
+    public String getRegistrationNumber()
+    {
+        return registrationNumber;
+    }
+    public void setQuantity(String quantity) 
+    {
+        this.quantity = quantity;
+    }
+
+    public String getQuantity() 
+    {
+        return quantity;
+    }
+    public void setPassengerCapacity(String passengerCapacity) 
+    {
+        this.passengerCapacity = passengerCapacity;
+    }
+
+    public String getPassengerCapacity() 
+    {
+        return passengerCapacity;
+    }
+
+    public String getPropulsion() {
+        return propulsion;
+    }
+
+    public void setPropulsion(String propulsion) {
+        this.propulsion = propulsion;
+    }
+    public String getSafetyEquipment() {
+        return safetyEquipment;
+    }
+
+    public void setSafetyEquipment(String safetyEquipment) {
+        this.safetyEquipment = safetyEquipment;
+    }
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("shipName", getShipName())
+            .append("shipType", getShipType())
+            .append("lengthOverall", getLengthOverall())
+            .append("registrationNumber", getRegistrationNumber())
+            .append("quantity", getQuantity())
+            .append("passengerCapacity", getPassengerCapacity())
+
+            .toString();
+    }
+}

+ 61 - 0
songhua-system/src/main/java/com/songhua/system/mapper/BasicCruiseShipMapper.java

@@ -0,0 +1,61 @@
+package com.songhua.system.mapper;
+
+import java.util.List;
+import com.songhua.system.domain.BasicCruiseShip;
+
+/**
+ * 游船Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-04-23
+ */
+public interface BasicCruiseShipMapper 
+{
+    /**
+     * 查询游船
+     * 
+     * @param id 游船主键
+     * @return 游船
+     */
+    public BasicCruiseShip selectBasicCruiseShipById(Long id);
+
+    /**
+     * 查询游船列表
+     * 
+     * @param basicCruiseShip 游船
+     * @return 游船集合
+     */
+    public List<BasicCruiseShip> selectBasicCruiseShipList(BasicCruiseShip basicCruiseShip);
+
+    /**
+     * 新增游船
+     * 
+     * @param basicCruiseShip 游船
+     * @return 结果
+     */
+    public int insertBasicCruiseShip(BasicCruiseShip basicCruiseShip);
+
+    /**
+     * 修改游船
+     * 
+     * @param basicCruiseShip 游船
+     * @return 结果
+     */
+    public int updateBasicCruiseShip(BasicCruiseShip basicCruiseShip);
+
+    /**
+     * 删除游船
+     * 
+     * @param id 游船主键
+     * @return 结果
+     */
+    public int deleteBasicCruiseShipById(Long id);
+
+    /**
+     * 批量删除游船
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBasicCruiseShipByIds(Long[] ids);
+}

+ 61 - 0
songhua-system/src/main/java/com/songhua/system/service/IBasicCruiseShipService.java

@@ -0,0 +1,61 @@
+package com.songhua.system.service;
+
+import java.util.List;
+import com.songhua.system.domain.BasicCruiseShip;
+
+/**
+ * 游船Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-04-23
+ */
+public interface IBasicCruiseShipService 
+{
+    /**
+     * 查询游船
+     * 
+     * @param id 游船主键
+     * @return 游船列表
+     */
+    public BasicCruiseShip selectBasicCruiseShipById(Long id);
+
+    /**
+     * 查询游船列表
+     * 
+     * @param basicCruiseShip 游船
+     * @return 游船集合
+     */
+    public List<BasicCruiseShip> selectBasicCruiseShipList(BasicCruiseShip basicCruiseShip);
+
+    /**
+     * 新增游船
+     * 
+     * @param basicCruiseShip 游船
+     * @return 结果
+     */
+    public int insertBasicCruiseShip(BasicCruiseShip basicCruiseShip);
+
+    /**
+     * 修改游船
+     * 
+     * @param basicCruiseShip 游船
+     * @return 结果
+     */
+    public int updateBasicCruiseShip(BasicCruiseShip basicCruiseShip);
+
+    /**
+     * 批量删除游船
+     * 
+     * @param ids 需要删除的游船主键集合
+     * @return 结果
+     */
+    public int deleteBasicCruiseShipByIds(Long[] ids);
+
+    /**
+     * 删除游船信息
+     * 
+     * @param id 游船主键
+     * @return 结果
+     */
+    public int deleteBasicCruiseShipById(Long id);
+}

+ 93 - 0
songhua-system/src/main/java/com/songhua/system/service/impl/BasicCruiseShipServiceImpl.java

@@ -0,0 +1,93 @@
+package com.songhua.system.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.songhua.system.mapper.BasicCruiseShipMapper;
+import com.songhua.system.domain.BasicCruiseShip;
+import com.songhua.system.service.IBasicCruiseShipService;
+
+/**
+ * 游船Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-04-23
+ */
+@Service
+public class BasicCruiseShipServiceImpl implements IBasicCruiseShipService 
+{
+    @Autowired
+    private BasicCruiseShipMapper basicCruiseShipMapper;
+
+    /**
+     * 查询游船
+     * 
+     * @param id 游船主键
+     * @return 游船
+     */
+    @Override
+    public BasicCruiseShip selectBasicCruiseShipById(Long id)
+    {
+        return basicCruiseShipMapper.selectBasicCruiseShipById(id);
+    }
+
+    /**
+     * 查询游船列表
+     * 
+     * @param basicCruiseShip 游船
+     * @return 游船
+     */
+    @Override
+    public List<BasicCruiseShip> selectBasicCruiseShipList(BasicCruiseShip basicCruiseShip)
+    {
+        return basicCruiseShipMapper.selectBasicCruiseShipList(basicCruiseShip);
+    }
+
+    /**
+     * 新增游船
+     * 
+     * @param basicCruiseShip 游船
+     * @return 结果
+     */
+    @Override
+    public int insertBasicCruiseShip(BasicCruiseShip basicCruiseShip)
+    {
+        return basicCruiseShipMapper.insertBasicCruiseShip(basicCruiseShip);
+    }
+
+    /**
+     * 修改游船
+     * 
+     * @param basicCruiseShip 游船
+     * @return 结果
+     */
+    @Override
+    public int updateBasicCruiseShip(BasicCruiseShip basicCruiseShip)
+    {
+        return basicCruiseShipMapper.updateBasicCruiseShip(basicCruiseShip);
+    }
+
+    /**
+     * 批量删除游船
+     * 
+     * @param ids 需要删除的游船主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBasicCruiseShipByIds(Long[] ids)
+    {
+        return basicCruiseShipMapper.deleteBasicCruiseShipByIds(ids);
+    }
+
+    /**
+     * 删除游船信息
+     * 
+     * @param id 游船主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBasicCruiseShipById(Long id)
+    {
+        return basicCruiseShipMapper.deleteBasicCruiseShipById(id);
+    }
+}

+ 84 - 0
songhua-system/src/main/resources/mapper/system/BasicCruiseShipMapper.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.songhua.system.mapper.BasicCruiseShipMapper">
+    
+    <resultMap type="BasicCruiseShip" id="BasicCruiseShipResult">
+        <result property="id"    column="id"    />
+        <result property="shipName"    column="ship_name"    />
+        <result property="shipType"    column="ship_type"    />
+        <result property="lengthOverall"    column="length_overall"    />
+        <result property="registrationNumber"    column="registration_number"    />
+        <result property="quantity"    column="quantity"    />
+        <result property="propulsion"    column="propulsion"    />
+        <result property="safetyEquipment"    column="safety_equipment"    />
+        <result property="passengerCapacity"    column="passenger_capacity"    />
+    </resultMap>
+
+    <sql id="selectBasicCruiseShipVo">
+        select id, ship_name, ship_type, length_overall, registration_number, quantity, propulsion,safety_equipment,passenger_capacity from basic_cruise_ship
+    </sql>
+
+    <select id="selectBasicCruiseShipList" parameterType="BasicCruiseShip" resultMap="BasicCruiseShipResult">
+        <include refid="selectBasicCruiseShipVo"/>
+        <where>  
+            <if test="shipName != null  and shipName != ''"> and ship_name like concat('%', #{shipName}, '%')</if>
+        </where>
+    </select>
+    
+    <select id="selectBasicCruiseShipById" parameterType="Long" resultMap="BasicCruiseShipResult">
+        <include refid="selectBasicCruiseShipVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertBasicCruiseShip" parameterType="BasicCruiseShip" useGeneratedKeys="true" keyProperty="id">
+        insert into basic_cruise_ship
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="shipName != null">ship_name,</if>
+            <if test="shipType != null">ship_type,</if>
+            <if test="lengthOverall != null">length_overall,</if>
+            <if test="registrationNumber != null">registration_number,</if>
+            <if test="quantity != null">quantity,</if>
+            <if test="propulsion != null">propulsion,</if>
+            <if test="passengerCapacity != null">passenger_capacity,</if>
+            <if test="safetyEquipment != null">safety_equipment,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="shipName != null">#{shipName},</if>
+            <if test="shipType != null">#{shipType},</if>
+            <if test="lengthOverall != null">#{lengthOverall},</if>
+            <if test="propulsion != null">#{propulsion},</if>
+            <if test="registrationNumber != null">#{registrationNumber},</if>
+            <if test="quantity != null">#{quantity},</if>
+            <if test="passengerCapacity != null">#{passengerCapacity},</if>
+            <if test="safetyEquipment != null">#{safetyEquipment},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBasicCruiseShip" parameterType="BasicCruiseShip">
+        update basic_cruise_ship
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="shipName != null">ship_name = #{shipName},</if>
+            <if test="shipType != null">ship_type = #{shipType},</if>
+            <if test="lengthOverall != null">length_overall = #{lengthOverall},</if>
+            <if test="registrationNumber != null">registration_number = #{registrationNumber},</if>
+            <if test="quantity != null">quantity = #{quantity},</if>
+            <if test="propulsion != null">propulsion = #{propulsion},</if>
+            <if test="passengerCapacity != null">passenger_capacity = #{passengerCapacity},</if>
+            <if test="safetyEquipment != null">safety_equipment = #{safetyEquipment},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBasicCruiseShipById" parameterType="Long">
+        delete from basic_cruise_ship where id = #{id}
+    </delete>
+
+    <delete id="deleteBasicCruiseShipByIds" parameterType="String">
+        delete from basic_cruise_ship where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 44 - 0
songhua-ui/src/api/system/ship.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询游船列表
+export function listShip(query) {
+  return request({
+    url: '/system/ship/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询游船详细
+export function getShip(id) {
+  return request({
+    url: '/system/ship/' + id,
+    method: 'get'
+  })
+}
+
+// 新增游船
+export function addShip(data) {
+  return request({
+    url: '/system/ship',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改游船
+export function updateShip(data) {
+  return request({
+    url: '/system/ship',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除游船
+export function delShip(id) {
+  return request({
+    url: '/system/ship/' + id,
+    method: 'delete'
+  })
+}

+ 286 - 0
songhua-ui/src/views/system/ships/index.vue

@@ -0,0 +1,286 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="船名" prop="shipName">
+        <el-input
+          v-model="queryParams.shipName"
+          placeholder="请输入船名"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:ship:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['system:ship:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['system:ship:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:ship:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="shipList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="船名" align="center" prop="shipName" />
+      <el-table-column label="船型" align="center" prop="shipType" />
+      <el-table-column label="船长" align="center" prop="lengthOverall" />
+      <el-table-column label="驱动类型" align="center" prop="propulsion" />
+      <el-table-column label="船舶注册号" align="center" prop="registrationNumber" />
+      <el-table-column label="船舱数量" align="center" prop="quantity" />
+      <el-table-column label="乘客容量" align="center" prop="passengerCapacity" />
+      <el-table-column label="安全设备" align="center" prop="safetyEquipment" />
+      <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)"
+            v-hasPermi="['system:ship:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:ship:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改游船对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="船名" prop="shipName">
+          <el-input v-model="form.shipName" placeholder="请输入船名" />
+        </el-form-item>
+        <el-form-item label="船长" prop="lengthOverall">
+          <el-input v-model="form.lengthOverall" placeholder="请输入船长" />
+        </el-form-item>
+        <el-form-item label="船型" prop="shipType">
+          <el-input v-model="form.shipType" placeholder="请输入船型" />
+        </el-form-item>
+        <el-form-item label="驱动类型" prop="propulsion">
+          <el-input v-model="form.propulsion" placeholder="请输入驱动类型" />
+        </el-form-item>
+        <el-form-item label="船舶注册号" prop="registrationNumber">
+          <el-input v-model="form.registrationNumber" placeholder="请输入船舶注册号" />
+        </el-form-item>
+        <el-form-item label="船舱数量" prop="quantity">
+          <el-input v-model="form.quantity" placeholder="请输入船舱数量" />
+        </el-form-item>
+        <el-form-item label="乘客容量" prop="passengerCapacity">
+          <el-input v-model="form.passengerCapacity" placeholder="请输入乘客容量" />
+        </el-form-item>
+        <el-form-item label="安全设备" prop="safetyEquipment">
+          <el-input v-model="form.safetyEquipment" placeholder="请输入安全设备" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listShip, getShip, delShip, addShip, updateShip } from "@/api/system/ship";
+
+export default {
+  name: "Ship",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 【请填写功能名称】表格数据
+      shipList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        shipName: null,
+        shipType: null,
+        lengthOverall: null,
+        safetyEquipment:null,
+        propulsion:null,
+        registrationNumber: null,
+        quantity: null,
+        passengerCapacity: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询游船列表 */
+    getList() {
+      this.loading = true;
+      listShip(this.queryParams).then(response => {
+        this.shipList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        shipName: null,
+        shipType: null,
+        lengthOverall: null,
+        propulsion:null,
+        safetyEquipment:null,
+        registrationNumber: null,
+        quantity: null,
+        passengerCapacity: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "新增游船";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getShip(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改游船";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateShip(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addShip(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除该游船').then(function() {
+        return delShip(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('system/ship/export', {
+        ...this.queryParams
+      }, `ship_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>