mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-09 04:20:08 +08:00
提交充电桩固件信息实体类
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
package com.jsowell.web.controller.pile;
|
||||
|
||||
import com.jsowell.common.annotation.Log;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.core.domain.AjaxResult;
|
||||
import com.jsowell.common.core.page.TableDataInfo;
|
||||
import com.jsowell.common.enums.BusinessType;
|
||||
import com.jsowell.common.util.poi.ExcelUtil;
|
||||
import com.jsowell.pile.domain.PileFirmwareInfo;
|
||||
import com.jsowell.pile.service.IPileFirmwareInfoService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 充电桩固件信息Controller
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-06-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pile/firmware")
|
||||
public class PileFirmwareInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IPileFirmwareInfoService pileFirmwareInfoService;
|
||||
|
||||
/**
|
||||
* 查询充电桩固件信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:firmware:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PileFirmwareInfo pileFirmwareInfo) {
|
||||
startPage();
|
||||
List<PileFirmwareInfo> list = pileFirmwareInfoService.selectPileFirmwareInfoList(pileFirmwareInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出充电桩固件信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:firmware:export')")
|
||||
@Log(title = "充电桩固件信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PileFirmwareInfo pileFirmwareInfo) {
|
||||
List<PileFirmwareInfo> list = pileFirmwareInfoService.selectPileFirmwareInfoList(pileFirmwareInfo);
|
||||
ExcelUtil<PileFirmwareInfo> util = new ExcelUtil<PileFirmwareInfo>(PileFirmwareInfo.class);
|
||||
util.exportExcel(response, list, "充电桩固件信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充电桩固件信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:firmware:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(pileFirmwareInfoService.selectPileFirmwareInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增充电桩固件信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:firmware:add')")
|
||||
@Log(title = "充电桩固件信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PileFirmwareInfo pileFirmwareInfo) {
|
||||
return toAjax(pileFirmwareInfoService.insertPileFirmwareInfo(pileFirmwareInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充电桩固件信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:firmware:edit')")
|
||||
@Log(title = "充电桩固件信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody PileFirmwareInfo pileFirmwareInfo) {
|
||||
return toAjax(pileFirmwareInfoService.updatePileFirmwareInfo(pileFirmwareInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除充电桩固件信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:firmware:remove')")
|
||||
@Log(title = "充电桩固件信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(pileFirmwareInfoService.deletePileFirmwareInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.jsowell.pile.domain;
|
||||
|
||||
import com.jsowell.common.annotation.Excel;
|
||||
import com.jsowell.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 充电桩固件信息对象 pile_firmware_info
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-06-28
|
||||
*/
|
||||
public class PileFirmwareInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 固件名称
|
||||
*/
|
||||
@Excel(name = "固件名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 固件描述
|
||||
*/
|
||||
@Excel(name = "固件描述")
|
||||
private String desc;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
@Excel(name = "路径")
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 删除标识(0-正常;1-删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("desc", getDesc())
|
||||
.append("filePath", getFilePath())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.PileFirmwareInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充电桩固件信息Mapper接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-06-28
|
||||
*/
|
||||
public interface PileFirmwareInfoMapper {
|
||||
/**
|
||||
* 查询充电桩固件信息
|
||||
*
|
||||
* @param id 充电桩固件信息主键
|
||||
* @return 充电桩固件信息
|
||||
*/
|
||||
public PileFirmwareInfo selectPileFirmwareInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询充电桩固件信息列表
|
||||
*
|
||||
* @param pileFirmwareInfo 充电桩固件信息
|
||||
* @return 充电桩固件信息集合
|
||||
*/
|
||||
public List<PileFirmwareInfo> selectPileFirmwareInfoList(PileFirmwareInfo pileFirmwareInfo);
|
||||
|
||||
/**
|
||||
* 新增充电桩固件信息
|
||||
*
|
||||
* @param pileFirmwareInfo 充电桩固件信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPileFirmwareInfo(PileFirmwareInfo pileFirmwareInfo);
|
||||
|
||||
/**
|
||||
* 修改充电桩固件信息
|
||||
*
|
||||
* @param pileFirmwareInfo 充电桩固件信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePileFirmwareInfo(PileFirmwareInfo pileFirmwareInfo);
|
||||
|
||||
/**
|
||||
* 删除充电桩固件信息
|
||||
*
|
||||
* @param id 充电桩固件信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePileFirmwareInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除充电桩固件信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePileFirmwareInfoByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.domain.PileFirmwareInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充电桩固件信息Service接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-06-28
|
||||
*/
|
||||
public interface IPileFirmwareInfoService {
|
||||
/**
|
||||
* 查询充电桩固件信息
|
||||
*
|
||||
* @param id 充电桩固件信息主键
|
||||
* @return 充电桩固件信息
|
||||
*/
|
||||
public PileFirmwareInfo selectPileFirmwareInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询充电桩固件信息列表
|
||||
*
|
||||
* @param pileFirmwareInfo 充电桩固件信息
|
||||
* @return 充电桩固件信息集合
|
||||
*/
|
||||
public List<PileFirmwareInfo> selectPileFirmwareInfoList(PileFirmwareInfo pileFirmwareInfo);
|
||||
|
||||
/**
|
||||
* 新增充电桩固件信息
|
||||
*
|
||||
* @param pileFirmwareInfo 充电桩固件信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPileFirmwareInfo(PileFirmwareInfo pileFirmwareInfo);
|
||||
|
||||
/**
|
||||
* 修改充电桩固件信息
|
||||
*
|
||||
* @param pileFirmwareInfo 充电桩固件信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePileFirmwareInfo(PileFirmwareInfo pileFirmwareInfo);
|
||||
|
||||
/**
|
||||
* 批量删除充电桩固件信息
|
||||
*
|
||||
* @param ids 需要删除的充电桩固件信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePileFirmwareInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除充电桩固件信息信息
|
||||
*
|
||||
* @param id 充电桩固件信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePileFirmwareInfoById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.pile.domain.PileFirmwareInfo;
|
||||
import com.jsowell.pile.mapper.PileFirmwareInfoMapper;
|
||||
import com.jsowell.pile.service.IPileFirmwareInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充电桩固件信息Service业务层处理
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-06-28
|
||||
*/
|
||||
@Service
|
||||
public class PileFirmwareInfoServiceImpl implements IPileFirmwareInfoService {
|
||||
@Autowired
|
||||
private PileFirmwareInfoMapper pileFirmwareInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询充电桩固件信息
|
||||
*
|
||||
* @param id 充电桩固件信息主键
|
||||
* @return 充电桩固件信息
|
||||
*/
|
||||
@Override
|
||||
public PileFirmwareInfo selectPileFirmwareInfoById(Long id) {
|
||||
return pileFirmwareInfoMapper.selectPileFirmwareInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充电桩固件信息列表
|
||||
*
|
||||
* @param pileFirmwareInfo 充电桩固件信息
|
||||
* @return 充电桩固件信息
|
||||
*/
|
||||
@Override
|
||||
public List<PileFirmwareInfo> selectPileFirmwareInfoList(PileFirmwareInfo pileFirmwareInfo) {
|
||||
return pileFirmwareInfoMapper.selectPileFirmwareInfoList(pileFirmwareInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增充电桩固件信息
|
||||
*
|
||||
* @param pileFirmwareInfo 充电桩固件信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPileFirmwareInfo(PileFirmwareInfo pileFirmwareInfo) {
|
||||
pileFirmwareInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return pileFirmwareInfoMapper.insertPileFirmwareInfo(pileFirmwareInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充电桩固件信息
|
||||
*
|
||||
* @param pileFirmwareInfo 充电桩固件信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePileFirmwareInfo(PileFirmwareInfo pileFirmwareInfo) {
|
||||
pileFirmwareInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return pileFirmwareInfoMapper.updatePileFirmwareInfo(pileFirmwareInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除充电桩固件信息
|
||||
*
|
||||
* @param ids 需要删除的充电桩固件信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePileFirmwareInfoByIds(Long[] ids) {
|
||||
return pileFirmwareInfoMapper.deletePileFirmwareInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除充电桩固件信息信息
|
||||
*
|
||||
* @param id 充电桩固件信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePileFirmwareInfoById(Long id) {
|
||||
return pileFirmwareInfoMapper.deletePileFirmwareInfoById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?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.jsowell.pile.mapper.PileFirmwareInfoMapper">
|
||||
|
||||
<resultMap type="PileFirmwareInfo" id="PileFirmwareInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="desc" column="desc" />
|
||||
<result property="filePath" column="file_path" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPileFirmwareInfoVo">
|
||||
select id, name, desc, file_path, create_time, create_by, update_time, update_by, del_flag from pile_firmware_info
|
||||
</sql>
|
||||
|
||||
<select id="selectPileFirmwareInfoList" parameterType="PileFirmwareInfo" resultMap="PileFirmwareInfoResult">
|
||||
<include refid="selectPileFirmwareInfoVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPileFirmwareInfoById" parameterType="Long" resultMap="PileFirmwareInfoResult">
|
||||
<include refid="selectPileFirmwareInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPileFirmwareInfo" parameterType="PileFirmwareInfo">
|
||||
insert into pile_firmware_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="desc != null">desc,</if>
|
||||
<if test="filePath != null">file_path,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="desc != null">#{desc},</if>
|
||||
<if test="filePath != null">#{filePath},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePileFirmwareInfo" parameterType="PileFirmwareInfo">
|
||||
update pile_firmware_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="desc != null">desc = #{desc},</if>
|
||||
<if test="filePath != null">file_path = #{filePath},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deletePileFirmwareInfoById" parameterType="Long">
|
||||
delete from pile_firmware_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePileFirmwareInfoByIds" parameterType="String">
|
||||
delete from pile_firmware_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
44
jsowell-ui/src/api/pile/firmware.js
Normal file
44
jsowell-ui/src/api/pile/firmware.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询充电桩固件信息列表
|
||||
export function listFirmware(query) {
|
||||
return request({
|
||||
url: '/pile/firmware/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询充电桩固件信息详细
|
||||
export function getFirmware(id) {
|
||||
return request({
|
||||
url: '/pile/firmware/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增充电桩固件信息
|
||||
export function addFirmware(data) {
|
||||
return request({
|
||||
url: '/pile/firmware',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改充电桩固件信息
|
||||
export function updateFirmware(data) {
|
||||
return request({
|
||||
url: '/pile/firmware',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除充电桩固件信息
|
||||
export function delFirmware(id) {
|
||||
return request({
|
||||
url: '/pile/firmware/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
263
jsowell-ui/src/views/pile/firmware/index.vue
Normal file
263
jsowell-ui/src/views/pile/firmware/index.vue
Normal file
@@ -0,0 +1,263 @@
|
||||
<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="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
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="['pile:firmware: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="['pile:firmware: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="['pile:firmware: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="['pile:firmware:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="firmwareList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键id" align="center" prop="id" />
|
||||
<el-table-column label="固件名称" align="center" prop="name" />
|
||||
<el-table-column label="固件描述" align="center" prop="desc" />
|
||||
<el-table-column label="路径" align="center" prop="filePath" />
|
||||
<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="['pile:firmware:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pile:firmware: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="80px">
|
||||
<el-form-item label="固件名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入固件名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="固件描述" prop="desc">
|
||||
<el-input v-model="form.desc" placeholder="请输入固件描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="路径" prop="filePath">
|
||||
<el-input v-model="form.filePath" placeholder="请输入路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标识" prop="delFlag">
|
||||
<el-input v-model="form.delFlag" 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 { listFirmware, getFirmware, delFirmware, addFirmware, updateFirmware } from "@/api/pile/firmware";
|
||||
|
||||
export default {
|
||||
name: "Firmware",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 充电桩固件信息表格数据
|
||||
firmwareList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询充电桩固件信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFirmware(this.queryParams).then(response => {
|
||||
this.firmwareList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
desc: null,
|
||||
filePath: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null,
|
||||
delFlag: 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
|
||||
getFirmware(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) {
|
||||
updateFirmware(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addFirmware(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除充电桩固件信息编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delFirmware(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('pile/firmware/export', {
|
||||
...this.queryParams
|
||||
}, `firmware_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user