Merge remote-tracking branch 'origin/master'
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.billion.main.sc.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.billion.common.annotation.Log; |
| | | import com.billion.common.core.controller.BaseController; |
| | | import com.billion.common.core.domain.AjaxResult; |
| | | import com.billion.common.enums.BusinessType; |
| | | import com.billion.main.sc.domain.ScOpcConf; |
| | | import com.billion.main.sc.service.IScOpcConfService; |
| | | import com.billion.common.utils.poi.ExcelUtil; |
| | | import com.billion.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * OPC交äºé
ç½®Controller |
| | | * |
| | | * @author HDY |
| | | * @date 2024-11-20 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sc/opcConf") |
| | | public class ScOpcConfController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IScOpcConfService scOpcConfService; |
| | | |
| | | /** |
| | | * æ¥è¯¢OPC交äºé
ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sc:opcConf:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ScOpcConf scOpcConf) |
| | | { |
| | | startPage(); |
| | | List<ScOpcConf> list = scOpcConfService.selectScOpcConfList(scOpcConf); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºOPC交äºé
ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sc:opcConf:export')") |
| | | @Log(title = "OPC交äºé
ç½®", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ScOpcConf scOpcConf) |
| | | { |
| | | List<ScOpcConf> list = scOpcConfService.selectScOpcConfList(scOpcConf); |
| | | ExcelUtil<ScOpcConf> util = new ExcelUtil<ScOpcConf>(ScOpcConf.class); |
| | | util.exportExcel(response, list, "OPC交äºé
ç½®æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åOPC交äºé
置详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sc:opcConf:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(scOpcConfService.selectScOpcConfById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢OPC交äºé
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sc:opcConf:add')") |
| | | @Log(title = "OPC交äºé
ç½®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ScOpcConf scOpcConf) |
| | | { |
| | | return toAjax(scOpcConfService.insertScOpcConf(scOpcConf)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹OPC交äºé
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sc:opcConf:edit')") |
| | | @Log(title = "OPC交äºé
ç½®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ScOpcConf scOpcConf) |
| | | { |
| | | return toAjax(scOpcConfService.updateScOpcConf(scOpcConf)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤OPC交äºé
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sc:opcConf:remove')") |
| | | @Log(title = "OPC交äºé
ç½®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(scOpcConfService.deleteScOpcConfByIds(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.billion.main.sc.domain; |
| | | |
| | | import com.billion.common.annotation.Excel; |
| | | import com.billion.main.common.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * OPC交äºé
置对象 sc_opc_conf |
| | | * |
| | | * @author HDY |
| | | * @date 2024-11-20 |
| | | */ |
| | | @Data |
| | | public class ScOpcConf extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主é®id */ |
| | | private Long id; |
| | | |
| | | /** å·¥ä½ç¼ç */ |
| | | @Excel(name = "å·¥ä½ç¼ç ") |
| | | private String locationCode; |
| | | |
| | | /** å·¥ä½å称 */ |
| | | @Excel(name = "å·¥ä½å称") |
| | | private String locationName; |
| | | |
| | | /** å°å */ |
| | | @Excel(name = "å°å") |
| | | private String node; |
| | | |
| | | /** ééç±»å */ |
| | | @Excel(name = "ééç±»å") |
| | | private String type; |
| | | |
| | | /** æ¯å¦è®¢é
*/ |
| | | @Excel(name = "æ¯å¦è®¢é
") |
| | | private String subscribe; |
| | | |
| | | /** å é¤æ å¿ï¼0代表åå¨ 1代表å é¤ï¼ */ |
| | | private String delFlag; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.billion.main.sc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.billion.main.sc.domain.ScOpcConf; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * OPC交äºé
ç½®Mapperæ¥å£ |
| | | * |
| | | * @author HDY |
| | | * @date 2024-11-20 |
| | | */ |
| | | public interface ScOpcConfMapper extends BaseMapper<ScOpcConf> |
| | | { |
| | | /** |
| | | * æ¥è¯¢OPC交äºé
ç½® |
| | | * |
| | | * @param id OPC交äºé
ç½®ä¸»é® |
| | | * @return OPC交äºé
ç½® |
| | | */ |
| | | public ScOpcConf selectScOpcConfById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢OPC交äºé
ç½®å表 |
| | | * |
| | | * @param scOpcConf OPC交äºé
ç½® |
| | | * @return OPC交äºé
ç½®éå |
| | | */ |
| | | public List<ScOpcConf> selectScOpcConfList(ScOpcConf scOpcConf); |
| | | |
| | | /** |
| | | * æ°å¢OPC交äºé
ç½® |
| | | * |
| | | * @param scOpcConf OPC交äºé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertScOpcConf(ScOpcConf scOpcConf); |
| | | |
| | | /** |
| | | * ä¿®æ¹OPC交äºé
ç½® |
| | | * |
| | | * @param scOpcConf OPC交äºé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateScOpcConf(ScOpcConf scOpcConf); |
| | | |
| | | /** |
| | | * å é¤OPC交äºé
ç½® |
| | | * |
| | | * @param id OPC交äºé
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteScOpcConfById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤OPC交äºé
ç½® |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteScOpcConfByIds(Long[] ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.billion.main.sc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.billion.main.sc.domain.ScOpcConf; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * OPC交äºé
ç½®Serviceæ¥å£ |
| | | * |
| | | * @author HDY |
| | | * @date 2024-11-20 |
| | | */ |
| | | public interface IScOpcConfService extends IService<ScOpcConf> |
| | | { |
| | | /** |
| | | * æ¥è¯¢OPC交äºé
ç½® |
| | | * |
| | | * @param id OPC交äºé
ç½®ä¸»é® |
| | | * @return OPC交äºé
ç½® |
| | | */ |
| | | public ScOpcConf selectScOpcConfById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢OPC交äºé
ç½®å表 |
| | | * |
| | | * @param scOpcConf OPC交äºé
ç½® |
| | | * @return OPC交äºé
ç½®éå |
| | | */ |
| | | public List<ScOpcConf> selectScOpcConfList(ScOpcConf scOpcConf); |
| | | |
| | | /** |
| | | * æ°å¢OPC交äºé
ç½® |
| | | * |
| | | * @param scOpcConf OPC交äºé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertScOpcConf(ScOpcConf scOpcConf); |
| | | |
| | | /** |
| | | * ä¿®æ¹OPC交äºé
ç½® |
| | | * |
| | | * @param scOpcConf OPC交äºé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateScOpcConf(ScOpcConf scOpcConf); |
| | | |
| | | /** |
| | | * æ¹éå é¤OPC交äºé
ç½® |
| | | * |
| | | * @param ids éè¦å é¤çOPC交äºé
置主é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteScOpcConfByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤OPC交äºé
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param id OPC交äºé
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteScOpcConfById(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.billion.main.sc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.billion.common.utils.DateUtils; |
| | | import com.billion.main.sc.domain.ScOpcConf; |
| | | import com.billion.main.sc.mapper.ScOpcConfMapper; |
| | | import com.billion.main.sc.service.IScOpcConfService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * OPC交äºé
ç½®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author HDY |
| | | * @date 2024-11-20 |
| | | */ |
| | | @Service |
| | | public class ScOpcConfServiceImpl extends ServiceImpl<ScOpcConfMapper, ScOpcConf> implements IScOpcConfService |
| | | { |
| | | @Autowired |
| | | private ScOpcConfMapper scOpcConfMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢OPC交äºé
ç½® |
| | | * |
| | | * @param id OPC交äºé
ç½®ä¸»é® |
| | | * @return OPC交äºé
ç½® |
| | | */ |
| | | @Override |
| | | public ScOpcConf selectScOpcConfById(Long id) |
| | | { |
| | | return scOpcConfMapper.selectScOpcConfById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢OPC交äºé
ç½®å表 |
| | | * |
| | | * @param scOpcConf OPC交äºé
ç½® |
| | | * @return OPC交äºé
ç½® |
| | | */ |
| | | @Override |
| | | public List<ScOpcConf> selectScOpcConfList(ScOpcConf scOpcConf) |
| | | { |
| | | return scOpcConfMapper.selectScOpcConfList(scOpcConf); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢OPC交äºé
ç½® |
| | | * |
| | | * @param scOpcConf OPC交äºé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertScOpcConf(ScOpcConf scOpcConf) |
| | | { |
| | | scOpcConf.setCreateTime(DateUtils.getNowDate()); |
| | | return scOpcConfMapper.insertScOpcConf(scOpcConf); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹OPC交äºé
ç½® |
| | | * |
| | | * @param scOpcConf OPC交äºé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateScOpcConf(ScOpcConf scOpcConf) |
| | | { |
| | | scOpcConf.setUpdateTime(DateUtils.getNowDate()); |
| | | return scOpcConfMapper.updateScOpcConf(scOpcConf); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤OPC交äºé
ç½® |
| | | * |
| | | * @param ids éè¦å é¤çOPC交äºé
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteScOpcConfByIds(Long[] ids) |
| | | { |
| | | return scOpcConfMapper.deleteScOpcConfByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤OPC交äºé
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param id OPC交äºé
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteScOpcConfById(Long id) |
| | | { |
| | | return scOpcConfMapper.deleteScOpcConfById(id); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.billion.main.sc.mapper.ScOpcConfMapper"> |
| | | |
| | | <resultMap type="ScOpcConf" id="ScOpcConfResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="locationCode" column="location_code" /> |
| | | <result property="locationName" column="location_name" /> |
| | | <result property="node" column="node" /> |
| | | <result property="type" column="type" /> |
| | | <result property="subscribe" column="subscribe" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectScOpcConfVo"> |
| | | select id, location_code, location_name, node, type, subscribe, del_flag, create_by, create_time, update_by, update_time from sc_opc_conf |
| | | </sql> |
| | | |
| | | <select id="selectScOpcConfList" parameterType="ScOpcConf" resultMap="ScOpcConfResult"> |
| | | <include refid="selectScOpcConfVo"/> |
| | | <where> |
| | | <if test="locationCode != null and locationCode != ''"> and location_code like concat('%', #{locationCode}, '%')</if> |
| | | <if test="locationName != null and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if> |
| | | <if test="node != null and node != ''"> and node like concat('%', #{node}, '%')</if> |
| | | <if test="type != null and type != ''"> and type = #{type}</if> |
| | | <if test="subscribe != null and subscribe != ''"> and subscribe = #{subscribe}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectScOpcConfById" parameterType="Long" resultMap="ScOpcConfResult"> |
| | | <include refid="selectScOpcConfVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertScOpcConf" parameterType="ScOpcConf" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into sc_opc_conf |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="locationCode != null">location_code,</if> |
| | | <if test="locationName != null">location_name,</if> |
| | | <if test="node != null">node,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="subscribe != null">subscribe,</if> |
| | | <if test="delFlag != null">del_flag,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="locationCode != null">#{locationCode},</if> |
| | | <if test="locationName != null">#{locationName},</if> |
| | | <if test="node != null">#{node},</if> |
| | | <if test="type != null">#{type},</if> |
| | | <if test="subscribe != null">#{subscribe},</if> |
| | | <if test="delFlag != null">#{delFlag},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateScOpcConf" parameterType="ScOpcConf"> |
| | | update sc_opc_conf |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="locationCode != null">location_code = #{locationCode},</if> |
| | | <if test="locationName != null">location_name = #{locationName},</if> |
| | | <if test="node != null">node = #{node},</if> |
| | | <if test="type != null">type = #{type},</if> |
| | | <if test="subscribe != null">subscribe = #{subscribe},</if> |
| | | <if test="delFlag != null">del_flag = #{delFlag},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteScOpcConfById" parameterType="Long"> |
| | | delete from sc_opc_conf where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteScOpcConfByIds" parameterType="String"> |
| | | delete from sc_opc_conf where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢OPC交äºé
ç½®å表 |
| | | export function listOpcConf(query) { |
| | | return request({ |
| | | url: '/sc/opcConf/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢OPC交äºé
ç½®è¯¦ç» |
| | | export function getOpcConf(id) { |
| | | return request({ |
| | | url: '/sc/opcConf/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢OPC交äºé
ç½® |
| | | export function addOpcConf(data) { |
| | | return request({ |
| | | url: '/sc/opcConf', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹OPC交äºé
ç½® |
| | | export function updateOpcConf(data) { |
| | | return request({ |
| | | url: '/sc/opcConf', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤OPC交äºé
ç½® |
| | | export function delOpcConf(id) { |
| | | return request({ |
| | | url: '/sc/opcConf/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="locationName"> |
| | | <el-input |
| | | v-model="queryParams.locationName" |
| | | placeholder="请è¾å
¥å·¥ä½å称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å°å" prop="node"> |
| | | <el-input |
| | | v-model="queryParams.node" |
| | | 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="['sc:opcConf: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="['sc:opcConf: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="['sc:opcConf: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="['sc:opcConf:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="opcConfList" @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="locationCode" /> |
| | | <el-table-column label="å·¥ä½å称" align="center" prop="locationName" /> |
| | | <el-table-column label="å°å" align="center" prop="node" /> |
| | | <el-table-column label="ééç±»å" align="center" prop="type" /> |
| | | <el-table-column label="æ¯å¦è®¢é
" align="center" prop="subscribe" /> |
| | | <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="['sc:opcConf:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['sc:opcConf: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" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹OPC交äºé
置对è¯æ¡ --> |
| | | <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="locationCode"> |
| | | <el-input v-model="form.locationCode" type="textarea" placeholder="请è¾å
¥å
容" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥ä½å称" prop="locationName"> |
| | | <el-input v-model="form.locationName" placeholder="请è¾å
¥å·¥ä½å称" /> |
| | | </el-form-item> |
| | | <el-form-item label="å°å" prop="node"> |
| | | <el-input v-model="form.node" 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 { listOpcConf, getOpcConf, delOpcConf, addOpcConf, updateOpcConf } from "@/api/main/sc/opcConf"; |
| | | |
| | | export default { |
| | | name: "OpcConf", |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // OPC交äºé
ç½®è¡¨æ ¼æ°æ® |
| | | opcConfList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | locationCode: null, |
| | | locationName: null, |
| | | node: null, |
| | | type: null, |
| | | subscribe: null, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢OPC交äºé
ç½®å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listOpcConf(this.queryParams).then(response => { |
| | | this.opcConfList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | locationCode: null, |
| | | locationName: null, |
| | | node: null, |
| | | type: null, |
| | | subscribe: null, |
| | | delFlag: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: 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 = "æ·»å OPC交äºé
ç½®"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getOpcConf(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹OPC交äºé
ç½®"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateOpcConf(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addOpcConf(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤OPC交äºé
ç½®ç¼å·ä¸º"' + ids + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delOpcConf(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('sc/opcConf/export', { |
| | | ...this.queryParams |
| | | }, `opcConf_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |