Compare commits
32 Commits
a32ba2c6b9
...
7022e20ad1
Author | SHA1 | Date |
---|---|---|
|
7022e20ad1 | |
|
9f2fd917ef | |
|
21a17709ff | |
|
2d8812212c | |
|
ed64e47598 | |
|
79997243f5 | |
|
a120716c7e | |
|
5d0b4abbd8 | |
|
ab97c58f74 | |
|
745a5848f1 | |
|
fb9a66a663 | |
|
f6fca9e2f6 | |
|
6e482aa995 | |
|
bfaf42d443 | |
|
142e680e65 | |
|
a45eb8ad3b | |
|
a9782ded5a | |
|
bf656004ce | |
|
02f1a6168d | |
|
ad95ad5d63 | |
|
6683dde126 | |
|
7446520dd4 | |
|
8ccac56e8b | |
|
5b21bdcd24 | |
|
10c575c4d7 | |
|
9648c11d6b | |
|
dd55cd3072 | |
|
1c2a8b9ca4 | |
|
34e4bc3010 | |
|
2c0aeb06fd | |
|
6c9c561b2c | |
|
dbeb12bc0a |
|
@ -0,0 +1,100 @@
|
|||
package com.ruoyi.web.controller.board;
|
||||
|
||||
import com.ruoyi.board.domain.BoardProtocol;
|
||||
import com.ruoyi.board.service.IBoardProtocolService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
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 fuhao
|
||||
* @date 2024-09-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/board/protocol")
|
||||
public class BoardProtocolController extends BaseController {
|
||||
@Autowired
|
||||
private IBoardProtocolService boardProtocolService;
|
||||
|
||||
/**
|
||||
* 查询情报板协议库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BoardProtocol boardProtocol) {
|
||||
startPage();
|
||||
List<BoardProtocol> list = boardProtocolService.list();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出情报板协议库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:export')")
|
||||
@Log(title = "情报板协议库", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BoardProtocol boardProtocol) {
|
||||
List<BoardProtocol> list = boardProtocolService.list();
|
||||
ExcelUtil<BoardProtocol> util = new ExcelUtil<BoardProtocol>(BoardProtocol.class);
|
||||
util.exportExcel(response, list, "情报板协议库数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取情报板协议库详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(boardProtocolService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增情报板协议库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:add')")
|
||||
@Log(title = "情报板协议库", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BoardProtocol boardProtocol) {
|
||||
return toAjax(boardProtocolService.save(boardProtocol));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改情报板协议库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:edit')")
|
||||
@Log(title = "情报板协议库", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BoardProtocol boardProtocol) {
|
||||
return toAjax(boardProtocolService.saveOrUpdate(boardProtocol));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除情报板协议库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:remove')")
|
||||
@Log(title = "情报板协议库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(boardProtocolService.removeByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取协议树列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('plan:type:list')")
|
||||
@GetMapping("/protocolTree")
|
||||
public AjaxResult deptTree(BoardProtocol planType) {
|
||||
return success(boardProtocolService.listProtocolTree(planType));
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ public class BoardTypeController extends BaseController {
|
|||
@GetMapping("/list")
|
||||
public TableDataInfo list(BoardType boardType) {
|
||||
startPage();
|
||||
List<BoardType> list = boardTypeService.list();
|
||||
List<BoardType> list = boardTypeService.listByParams(boardType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.web.controller.board;
|
||||
|
||||
import com.ruoyi.board.domain.PresetContent;
|
||||
import com.ruoyi.board.domain.dto.PresetContentDTO;
|
||||
import com.ruoyi.board.service.IPresetContentService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
@ -37,7 +38,7 @@ public class PresetContentController extends BaseController
|
|||
public TableDataInfo list(PresetContent presetContent)
|
||||
{
|
||||
startPage();
|
||||
List<PresetContent> list = presetContentService.listPage(presetContent);
|
||||
List<PresetContentDTO> list = presetContentService.listDTO(presetContent);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,91 @@
|
|||
package com.ruoyi.web.controller.board;
|
||||
|
||||
import com.ruoyi.board.domain.PubWhiteIp;
|
||||
import com.ruoyi.board.service.IPubWhiteIpService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
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 fuhao
|
||||
* @date 2024-09-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/board/whiteIp")
|
||||
public class PubWhiteIpController extends BaseController {
|
||||
@Autowired
|
||||
private IPubWhiteIpService pubWhiteIpService;
|
||||
|
||||
/**
|
||||
* 查询发布源白名单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:whiteIp:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PubWhiteIp pubWhiteIp) {
|
||||
startPage();
|
||||
List<PubWhiteIp> list = pubWhiteIpService.list();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出发布源白名单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:whiteIp:export')")
|
||||
@Log(title = "发布源白名单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PubWhiteIp pubWhiteIp) {
|
||||
List<PubWhiteIp> list = pubWhiteIpService.list();
|
||||
ExcelUtil<PubWhiteIp> util = new ExcelUtil<PubWhiteIp>(PubWhiteIp.class);
|
||||
util.exportExcel(response, list, "发布源白名单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发布源白名单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:whiteIp:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(pubWhiteIpService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发布源白名单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:whiteIp:add')")
|
||||
@Log(title = "发布源白名单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PubWhiteIp pubWhiteIp) {
|
||||
return toAjax(pubWhiteIpService.save(pubWhiteIp));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发布源白名单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:whiteIp:edit')")
|
||||
@Log(title = "发布源白名单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody PubWhiteIp pubWhiteIp) {
|
||||
return toAjax(pubWhiteIpService.saveOrUpdate(pubWhiteIp));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发布源白名单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:whiteIp:remove')")
|
||||
@Log(title = "发布源白名单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(pubWhiteIpService.removeByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.ruoyi.web.controller.board;
|
||||
|
||||
import com.ruoyi.board.domain.ReleaseLog;
|
||||
import com.ruoyi.board.service.IReleaseLogService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
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 fuhao
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/board/releaseLog")
|
||||
public class ReleaseLogController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IReleaseLogService releaseLogService;
|
||||
|
||||
/**
|
||||
* 查询发布日志记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:releaseLog:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ReleaseLog releaseLog)
|
||||
{
|
||||
startPage();
|
||||
List<ReleaseLog> list = releaseLogService.list();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出发布日志记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:releaseLog:export')")
|
||||
@Log(title = "发布日志记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ReleaseLog releaseLog)
|
||||
{
|
||||
List<ReleaseLog> list = releaseLogService.list();
|
||||
ExcelUtil<ReleaseLog> util = new ExcelUtil<ReleaseLog>(ReleaseLog.class);
|
||||
util.exportExcel(response, list, "发布日志记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发布日志记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:releaseLog:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(releaseLogService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发布日志记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:releaseLog:add')")
|
||||
@Log(title = "发布日志记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ReleaseLog releaseLog)
|
||||
{
|
||||
return toAjax(releaseLogService.save(releaseLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发布日志记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:releaseLog:edit')")
|
||||
@Log(title = "发布日志记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ReleaseLog releaseLog)
|
||||
{
|
||||
return toAjax(releaseLogService.saveOrUpdate(releaseLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发布日志记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:releaseLog:remove')")
|
||||
@Log(title = "发布日志记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable List<Long> ids)
|
||||
{
|
||||
return toAjax(releaseLogService.removeByIds(ids));
|
||||
}
|
||||
}
|
|
@ -5,10 +5,11 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 警报计划表
|
||||
*/
|
||||
|
@ -32,7 +33,7 @@ public class AlertPlan extends BaseEntity {
|
|||
* 等级
|
||||
*/
|
||||
@TableField(value = "`level`")
|
||||
private Integer level;
|
||||
private String level;
|
||||
|
||||
/**
|
||||
* 最大值
|
||||
|
@ -49,6 +50,6 @@ public class AlertPlan extends BaseEntity {
|
|||
/**
|
||||
* 显示内容
|
||||
*/
|
||||
@TableField(value = "display_content")
|
||||
private String displayContent;
|
||||
@TableField(value = "preset_content_id")
|
||||
private Long presetContentId;
|
||||
}
|
|
@ -48,30 +48,18 @@ public class BoardInfo extends BaseEntity {
|
|||
/**
|
||||
* 情报板尺寸
|
||||
*/
|
||||
@TableField(value = "board_size")
|
||||
private String boardSize;
|
||||
@TableField(value = "board_size_type")
|
||||
private Integer boardSizeType;
|
||||
|
||||
/**
|
||||
* 情报板品牌
|
||||
* 情报板品牌协议
|
||||
*/
|
||||
@TableField(value = "board_brand")
|
||||
private String boardBrand;
|
||||
|
||||
/**
|
||||
* 情报板通讯协议
|
||||
*/
|
||||
@TableField(value = "board_communication_protocol")
|
||||
private String boardCommunicationProtocol;
|
||||
@TableField(value = "board_brand_protocol")
|
||||
private Integer boardBrandProtocol;
|
||||
|
||||
/**
|
||||
* 情报板IP
|
||||
*/
|
||||
@TableField(value = "board_ip")
|
||||
private String boardIp;
|
||||
|
||||
/**
|
||||
* 情报板端口号
|
||||
*/
|
||||
@TableField(value = "board_port")
|
||||
private Integer boardPort;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.ruoyi.board.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 情报板协议库
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "pub_board_protocol")
|
||||
public class BoardProtocol {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 情报板品牌
|
||||
*/
|
||||
@TableField(value = "brand")
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 情报板通讯协议
|
||||
*/
|
||||
@TableField(value = "protocol")
|
||||
private String protocol;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
}
|
|
@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 预置信息及模版表
|
||||
*/
|
||||
|
@ -28,8 +29,8 @@ public class PresetContent {
|
|||
/**
|
||||
* 情报板尺寸
|
||||
*/
|
||||
@TableField(value = "board_size")
|
||||
private String boardSize;
|
||||
@TableField(value = "board_size_type")
|
||||
private Integer boardSizeType;
|
||||
|
||||
/**
|
||||
* 信息类型
|
||||
|
@ -52,8 +53,8 @@ public class PresetContent {
|
|||
/**
|
||||
* 字体样式
|
||||
*/
|
||||
@TableField(value = "font_style")
|
||||
private String fontStyle;
|
||||
@TableField(value = "font_family")
|
||||
private String fontFamily;
|
||||
|
||||
/**
|
||||
* 字体大小
|
||||
|
@ -91,6 +92,12 @@ public class PresetContent {
|
|||
@TableField(value = "play_time")
|
||||
private Integer playTime;
|
||||
|
||||
@TableField(value = "horizontal_center")
|
||||
private Boolean horizontalCenter;
|
||||
|
||||
@TableField(value = "vertical_center")
|
||||
private Boolean verticalCenter;
|
||||
|
||||
/**
|
||||
* 当前预置类型 1:内置模版 0:预发布信息
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package com.ruoyi.board.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 发布源白名单
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "pub_white_ip")
|
||||
public class PubWhiteIp {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* IP地址
|
||||
*/
|
||||
@TableField(value = "ip")
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 安全密钥
|
||||
*/
|
||||
@TableField(value = "security_key")
|
||||
private String securityKey;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.ruoyi.board.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 发布日志记录
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "pub_release_log")
|
||||
public class ReleaseLog {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
@TableField(value = "`operator`")
|
||||
private String operator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 情报板ID
|
||||
*/
|
||||
@TableField(value = "board_id")
|
||||
private Integer boardId;
|
||||
|
||||
/**
|
||||
* 情报板名称
|
||||
*/
|
||||
@TableField(value = "board_name")
|
||||
private String boardName;
|
||||
|
||||
/**
|
||||
* 发布内容
|
||||
*/
|
||||
@TableField(value = "release_content")
|
||||
private String releaseContent;
|
||||
}
|
|
@ -18,11 +18,10 @@ public class AlertPlanAndPlanTypeDTO {
|
|||
|
||||
private String typeName;
|
||||
|
||||
|
||||
/**
|
||||
* 等级
|
||||
*/
|
||||
private Integer level;
|
||||
private String level;
|
||||
|
||||
/**
|
||||
* 最大值
|
||||
|
@ -35,7 +34,12 @@ public class AlertPlanAndPlanTypeDTO {
|
|||
private BigDecimal minValue;
|
||||
|
||||
/**
|
||||
* 显示内容
|
||||
* 显示内容 ID
|
||||
*/
|
||||
private String displayContent;
|
||||
private Long presetContentId;
|
||||
|
||||
/**
|
||||
* 显示内容名称
|
||||
*/
|
||||
private String presetContentName;
|
||||
}
|
||||
|
|
|
@ -29,20 +29,35 @@ public class BoardInfoAndRoadDTO {
|
|||
*/
|
||||
private String boardMileage;
|
||||
|
||||
/**
|
||||
* 情报板类型ID
|
||||
*/
|
||||
private Integer boardSizeType;
|
||||
|
||||
/**
|
||||
* 情报板类型名称
|
||||
*/
|
||||
private String boardSizeName;
|
||||
|
||||
/**
|
||||
* 情报板尺寸
|
||||
*/
|
||||
private String boardSize;
|
||||
|
||||
/**
|
||||
* 情报板品牌
|
||||
* 情报板品牌协议ID
|
||||
*/
|
||||
private String boardBrand;
|
||||
private Integer boardBrandProtocol;
|
||||
|
||||
/**
|
||||
* 情报板通讯协议
|
||||
* 情报板品牌名
|
||||
*/
|
||||
private String boardCommunicationProtocol;
|
||||
private String boardBrandName;
|
||||
|
||||
/**
|
||||
* 情报板协议名
|
||||
*/
|
||||
private String boardProtocolName;
|
||||
|
||||
/**
|
||||
* 情报板IP
|
||||
|
@ -53,6 +68,4 @@ public class BoardInfoAndRoadDTO {
|
|||
* 路段名称
|
||||
*/
|
||||
private String roadName;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
package com.ruoyi.board.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class PresetContentDTO {
|
||||
/**
|
||||
* 主键自增
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 预置信息名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 情报板尺寸
|
||||
*/
|
||||
@TableField(value = "board_size_type")
|
||||
private Integer boardSizeType;
|
||||
|
||||
@TableField(value = "board_size_type_name")
|
||||
private String boardSizeTypeName;
|
||||
|
||||
/**
|
||||
* 信息类型
|
||||
*/
|
||||
@TableField(value = "info_type")
|
||||
private Integer infoType;
|
||||
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 预置内容
|
||||
*/
|
||||
@TableField(value = "content")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 预览路径
|
||||
*/
|
||||
@TableField(value = "preview_path")
|
||||
private String previewPath;
|
||||
|
||||
/**
|
||||
* 字体样式
|
||||
*/
|
||||
@TableField(value = "font_family")
|
||||
private String fontFamily;
|
||||
|
||||
/**
|
||||
* 字体大小
|
||||
*/
|
||||
@TableField(value = "font_size")
|
||||
private Integer fontSize;
|
||||
|
||||
/**
|
||||
* 字体间距
|
||||
*/
|
||||
@TableField(value = "letter_spacing")
|
||||
private Integer letterSpacing;
|
||||
|
||||
/**
|
||||
* 字体颜色
|
||||
*/
|
||||
@TableField(value = "font_color")
|
||||
private String fontColor;
|
||||
|
||||
/**
|
||||
* 字体坐标X
|
||||
*/
|
||||
@TableField(value = "font_position_x")
|
||||
private Integer fontPositionX;
|
||||
|
||||
/**
|
||||
* 字体坐标Y
|
||||
*/
|
||||
@TableField(value = "font_position_y")
|
||||
private Integer fontPositionY;
|
||||
|
||||
/**
|
||||
* 播放时间
|
||||
*/
|
||||
@TableField(value = "play_time")
|
||||
private Integer playTime;
|
||||
|
||||
/**
|
||||
* 当前预置类型 1:内置模版 0:预发布信息
|
||||
*/
|
||||
@TableField(value = "preset_type")
|
||||
private Integer presetType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@TableField(value = "create_by")
|
||||
private Integer createBy;
|
||||
|
||||
/**
|
||||
* 更新人id
|
||||
*/
|
||||
@TableField(value = "update_by")
|
||||
private Integer updateBy;
|
||||
|
||||
/**
|
||||
* 是否水平居中
|
||||
*/
|
||||
@TableField(value = "horizontal_center")
|
||||
private Boolean horizontalCenter;
|
||||
|
||||
/**
|
||||
* 是否垂直居中
|
||||
*/
|
||||
@TableField(value = "vertical_center")
|
||||
private Boolean verticalCenter;
|
||||
}
|
|
@ -1,7 +1,24 @@
|
|||
package com.ruoyi.board.domain.enums;
|
||||
|
||||
import com.ruoyi.board.domain.PlanType;
|
||||
import com.ruoyi.board.service.IPlanTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class AlertPlanType {
|
||||
|
||||
static Map<String, Long> typeNameIDMap = new HashMap<>();
|
||||
|
||||
@Autowired
|
||||
private IPlanTypeService planTypeService;
|
||||
|
||||
|
||||
public static int getPlanTypeByName(String planTypeName) {
|
||||
// 0:雾,1:雨,2:雪
|
||||
switch (planTypeName) {
|
||||
|
@ -15,4 +32,17 @@ public class AlertPlanType {
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public void setTypeNameIDMap() {
|
||||
typeNameIDMap.clear();
|
||||
List<PlanType> planTypeList = planTypeService.list();
|
||||
typeNameIDMap.putAll(planTypeList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
PlanType::getTypeName,
|
||||
PlanType::getId
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package com.ruoyi.board.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.ruoyi.board.domain.BoardProtocol;
|
||||
|
||||
public interface BoardProtocolMapper extends MPJBaseMapper<BoardProtocol> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.ruoyi.board.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.ruoyi.board.domain.PubWhiteIp;
|
||||
|
||||
public interface PubWhiteIpMapper extends MPJBaseMapper<PubWhiteIp> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.ruoyi.board.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.ruoyi.board.domain.ReleaseLog;
|
||||
|
||||
public interface ReleaseLogMapper extends MPJBaseMapper<ReleaseLog> {
|
||||
}
|
|
@ -10,7 +10,9 @@ public interface IAlertPlanService extends MPJBaseService<AlertPlan> {
|
|||
|
||||
List<AlertPlanAndPlanTypeDTO> listPage(AlertPlan alertPlan);
|
||||
|
||||
AlertPlan getOneByTypeAndValue(Integer type, Double value);
|
||||
AlertPlan getOneByTypeAndValue(Long type, Double value);
|
||||
|
||||
AlertPlanAndPlanTypeDTO getDTOById(Long id);
|
||||
|
||||
AlertPlan getOneByPresetContentId(Integer id, Integer typeId);
|
||||
}
|
||||
|
|
|
@ -8,9 +8,7 @@ import java.util.List;
|
|||
|
||||
public interface IBoardInfoService extends MPJBaseService<BoardInfo> {
|
||||
|
||||
BoardInfo getOneByIP(String ip);
|
||||
|
||||
List<BoardInfo> listPage(BoardInfo boardInfo);
|
||||
BoardInfoAndRoadDTO getOneByIP(String ip);
|
||||
|
||||
List<BoardInfoAndRoadDTO> listBoardInfoDTO(BoardInfo boardInfo);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package com.ruoyi.board.service;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.ruoyi.board.domain.BoardProtocol;
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IBoardProtocolService extends MPJBaseService<BoardProtocol> {
|
||||
List<TreeSelect> listProtocolTree(BoardProtocol planType);
|
||||
}
|
|
@ -3,5 +3,8 @@ package com.ruoyi.board.service;
|
|||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.ruoyi.board.domain.BoardType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IBoardTypeService extends MPJBaseService<BoardType> {
|
||||
List<BoardType> listByParams(BoardType boardType);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,13 @@ package com.ruoyi.board.service;
|
|||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.ruoyi.board.domain.PresetContent;
|
||||
import com.ruoyi.board.domain.dto.PresetContentDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IPresetContentService extends MPJBaseService<PresetContent> {
|
||||
|
||||
PresetContent getOneByContentAndBoardSize(String content, String boardSize, Integer type);
|
||||
PresetContent getOneByContentAndBoardSize(String content, String boardSize, Long type);
|
||||
|
||||
List<PresetContent> listPage(PresetContent presetContent);
|
||||
List<PresetContentDTO> listDTO(PresetContent presetContent);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package com.ruoyi.board.service;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.ruoyi.board.domain.PubWhiteIp;
|
||||
|
||||
public interface IPubWhiteIpService extends MPJBaseService<PubWhiteIp> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.ruoyi.board.service;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.ruoyi.board.domain.ReleaseLog;
|
||||
|
||||
public interface IReleaseLogService extends MPJBaseService<ReleaseLog> {
|
||||
}
|
|
@ -2,13 +2,9 @@ package com.ruoyi.board.service;
|
|||
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.ruoyi.board.domain.ReleaseRecord;
|
||||
import com.ruoyi.board.domain.dto.ReleaseRecordAndPresetContentDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IReleaseRecordService extends MPJBaseService<ReleaseRecord> {
|
||||
|
||||
List<ReleaseRecordAndPresetContentDTO> listLatest2minRecordDtoByBoardId(Integer boardId);
|
||||
|
||||
List<ReleaseRecord> listLatest2minRecordByBoardId(Integer boardId);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
|
|||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.ruoyi.board.domain.AlertPlan;
|
||||
import com.ruoyi.board.domain.PlanType;
|
||||
import com.ruoyi.board.domain.PresetContent;
|
||||
import com.ruoyi.board.domain.dto.AlertPlanAndPlanTypeDTO;
|
||||
import com.ruoyi.board.mapper.AlertPlanMapper;
|
||||
import com.ruoyi.board.service.IAlertPlanService;
|
||||
|
@ -25,13 +26,15 @@ public class AlertPlanServiceImpl extends MPJBaseServiceImpl<AlertPlanMapper, Al
|
|||
MPJLambdaWrapper<AlertPlan> eq = new MPJLambdaWrapper<AlertPlan>()
|
||||
.selectAll(AlertPlan.class)
|
||||
.select(PlanType::getTypeName)
|
||||
.selectAs(PresetContent::getName, "preset_content_name")
|
||||
.leftJoin(PlanType.class, PlanType::getId, AlertPlan::getType)
|
||||
.leftJoin(PresetContent.class, PresetContent::getId, AlertPlan::getPresetContentId)
|
||||
.eq(ObjectUtils.isNotEmpty(alertPlan.getType()), AlertPlan::getType, alertPlan.getType());
|
||||
return selectJoinList(AlertPlanAndPlanTypeDTO.class, eq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlertPlan getOneByTypeAndValue(Integer planType, Double value) {
|
||||
public AlertPlan getOneByTypeAndValue(Long planType, Double value) {
|
||||
if (planType < 0) {
|
||||
return null;
|
||||
}
|
||||
|
@ -53,4 +56,12 @@ public class AlertPlanServiceImpl extends MPJBaseServiceImpl<AlertPlanMapper, Al
|
|||
return selectJoinOne(AlertPlanAndPlanTypeDTO.class, eq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlertPlan getOneByPresetContentId(Integer id, Integer typeId) {
|
||||
LambdaQueryWrapper<AlertPlan> alertPlanLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
alertPlanLambdaQueryWrapper.eq(AlertPlan::getPresetContentId, id);
|
||||
alertPlanLambdaQueryWrapper.eq(AlertPlan::getType, typeId);
|
||||
return getOne(alertPlanLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package com.ruoyi.board.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.ruoyi.board.domain.BoardInfo;
|
||||
import com.ruoyi.board.domain.BoardProtocol;
|
||||
import com.ruoyi.board.domain.BoardType;
|
||||
import com.ruoyi.board.domain.RoadGroup;
|
||||
import com.ruoyi.board.domain.dto.BoardInfoAndRoadDTO;
|
||||
import com.ruoyi.board.mapper.BoardInfoMapper;
|
||||
|
@ -17,33 +18,32 @@ import java.util.List;
|
|||
public class BoardInfoServiceImpl extends MPJBaseServiceImpl<BoardInfoMapper, BoardInfo> implements IBoardInfoService {
|
||||
|
||||
@Override
|
||||
public BoardInfo getOneByIP(String ip) {
|
||||
LambdaQueryWrapper<BoardInfo> boardInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
boardInfoLambdaQueryWrapper.eq(BoardInfo::getBoardIp, ip);
|
||||
return getOne(boardInfoLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BoardInfo> listPage(BoardInfo boardInfo) {
|
||||
LambdaQueryWrapper<BoardInfo> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.likeRight(StringUtils.isNotEmpty(boardInfo.getBoardName()), BoardInfo::getBoardName, boardInfo.getBoardName());
|
||||
wrapper.likeRight(StringUtils.isNotEmpty(boardInfo.getBoardMileage()), BoardInfo::getBoardMileage, boardInfo.getBoardMileage());
|
||||
wrapper.eq(StringUtils.isNotEmpty(boardInfo.getBoardSize()), BoardInfo::getBoardSize, boardInfo.getBoardSize());
|
||||
wrapper.eq(StringUtils.isNotEmpty(boardInfo.getBoardBrand()), BoardInfo::getBoardBrand, boardInfo.getBoardBrand());
|
||||
wrapper.eq(StringUtils.isNotEmpty(boardInfo.getBoardCommunicationProtocol()), BoardInfo::getBoardCommunicationProtocol, boardInfo.getBoardCommunicationProtocol());
|
||||
wrapper.eq(StringUtils.isNotEmpty(boardInfo.getBoardRoadSection()), BoardInfo::getBoardRoadSection, boardInfo.getBoardRoadSection());
|
||||
return list(wrapper);
|
||||
public BoardInfoAndRoadDTO getOneByIP(String ip) {
|
||||
MPJLambdaWrapper<BoardInfo> eq = condition()
|
||||
.eq(StringUtils.isNotEmpty(ip), BoardInfo::getBoardIp, ip);
|
||||
return selectJoinOne(BoardInfoAndRoadDTO.class, eq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BoardInfoAndRoadDTO> listBoardInfoDTO(BoardInfo boardInfo) {
|
||||
MPJLambdaWrapper<BoardInfo> eq = new MPJLambdaWrapper<BoardInfo>()
|
||||
.selectAll(BoardInfo.class)
|
||||
.select(RoadGroup::getRoadName)
|
||||
.leftJoin(RoadGroup.class, RoadGroup::getId, BoardInfo::getBoardRoadSection)
|
||||
MPJLambdaWrapper<BoardInfo> eq = condition()
|
||||
.likeRight(StringUtils.isNotEmpty(boardInfo.getBoardName()), BoardInfo::getBoardName, boardInfo.getBoardName())
|
||||
.likeRight(StringUtils.isNotEmpty(boardInfo.getBoardMileage()), BoardInfo::getBoardMileage, boardInfo.getBoardMileage())
|
||||
.eq(StringUtils.isNotEmpty(boardInfo.getBoardRoadSection()), BoardInfo::getBoardRoadSection, boardInfo.getBoardRoadSection());
|
||||
return selectJoinList(BoardInfoAndRoadDTO.class, eq);
|
||||
}
|
||||
|
||||
|
||||
private MPJLambdaWrapper<BoardInfo> condition() {
|
||||
return new MPJLambdaWrapper<BoardInfo>()
|
||||
.selectAll(BoardInfo.class)
|
||||
.select(RoadGroup::getRoadName)
|
||||
.selectAs(BoardType::getName, "board_size_name")
|
||||
.selectAs(BoardType::getSize, "board_size")
|
||||
.selectAs(BoardProtocol::getBrand, "board_brand_name")
|
||||
.selectAs(BoardProtocol::getProtocol, "board_protocol_name")
|
||||
.leftJoin(RoadGroup.class, RoadGroup::getId, BoardInfo::getBoardRoadSection)
|
||||
.leftJoin(BoardType.class, BoardType::getId, BoardInfo::getBoardSizeType)
|
||||
.leftJoin(BoardProtocol.class, BoardProtocol::getId, BoardInfo::getBoardBrandProtocol);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package com.ruoyi.board.service.impl;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.ruoyi.board.domain.BoardProtocol;
|
||||
import com.ruoyi.board.mapper.BoardProtocolMapper;
|
||||
import com.ruoyi.board.service.IBoardProtocolService;
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class BoardProtocolServiceImpl extends MPJBaseServiceImpl<BoardProtocolMapper, BoardProtocol> implements IBoardProtocolService {
|
||||
private static final Logger log = LoggerFactory.getLogger(BoardProtocolServiceImpl.class);
|
||||
private static final Long DEFAULT_ID = 0L;
|
||||
|
||||
@Override
|
||||
public List<TreeSelect> listProtocolTree(BoardProtocol planType) {
|
||||
List<BoardProtocol> protocols = list();
|
||||
Map<String, List<BoardProtocol>> protocolsByBrand = protocols.stream().collect(Collectors.groupingBy(BoardProtocol::getBrand));
|
||||
List<TreeSelect> treeSelects = new ArrayList<>();
|
||||
protocolsByBrand.forEach((brand, brandProtocols) -> treeSelects.add(createTreeSelectForBrand(brand, brandProtocols)));
|
||||
return treeSelects;
|
||||
}
|
||||
|
||||
private TreeSelect createTreeSelectForBrand(String brand, List<BoardProtocol> brandProtocols) {
|
||||
TreeSelect treeSelect = new TreeSelect();
|
||||
treeSelect.setLabel(brand);
|
||||
treeSelect.setId(DEFAULT_ID);
|
||||
treeSelect.setChildren(brandProtocols.stream().map(this::mapToTreeSelect).collect(Collectors.toList()));
|
||||
return treeSelect;
|
||||
}
|
||||
|
||||
private TreeSelect mapToTreeSelect(BoardProtocol protocol) {
|
||||
TreeSelect treeSelect = new TreeSelect();
|
||||
treeSelect.setId(protocol.getId());
|
||||
treeSelect.setLabel(protocol.getProtocol());
|
||||
return treeSelect;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,11 +1,21 @@
|
|||
package com.ruoyi.board.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.ruoyi.board.domain.BoardType;
|
||||
import com.ruoyi.board.mapper.BoardTypeMapper;
|
||||
import com.ruoyi.board.service.IBoardTypeService;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class BoardTypeServiceImpl extends MPJBaseServiceImpl<BoardTypeMapper, BoardType> implements IBoardTypeService {
|
||||
@Override
|
||||
public List<BoardType> listByParams(BoardType boardType) {
|
||||
LambdaQueryWrapper<BoardType> boardTypeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
boardTypeLambdaQueryWrapper.likeRight(StringUtils.isNotEmpty(boardType.getName()), BoardType::getName, boardType.getName());
|
||||
return list(boardTypeLambdaQueryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class PlanTypeServiceImpl extends MPJBaseServiceImpl<PlanTypeMapper, Plan
|
|||
treeSelect.setLabel(planType.getTypeName());
|
||||
treeSelect.setChildren(childTreeSelectList);
|
||||
return treeSelect;
|
||||
};
|
||||
}
|
||||
|
||||
private List<PlanType> buildPlanTree(List<PlanType> list) {
|
||||
List<PlanType> returnList = new ArrayList<>();
|
||||
|
|
|
@ -2,33 +2,38 @@ package com.ruoyi.board.service.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.board.mapper.PresetContentMapper;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.ruoyi.board.domain.BoardType;
|
||||
import com.ruoyi.board.domain.PlanType;
|
||||
import com.ruoyi.board.domain.PresetContent;
|
||||
import com.ruoyi.board.domain.dto.PresetContentDTO;
|
||||
import com.ruoyi.board.mapper.PresetContentMapper;
|
||||
import com.ruoyi.board.service.IPresetContentService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PresetContentServiceImpl extends MPJBaseServiceImpl<PresetContentMapper, PresetContent> implements IPresetContentService {
|
||||
@Override
|
||||
public PresetContent getOneByContentAndBoardSize(String content, String boardSize, Integer type) {
|
||||
public PresetContent getOneByContentAndBoardSize(String content, String boardSize, Long type) {
|
||||
LambdaQueryWrapper<PresetContent> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper
|
||||
.eq(PresetContent::getContent, content)
|
||||
.eq(PresetContent::getBoardSize, boardSize)
|
||||
.eq(PresetContent::getBoardSizeType, boardSize)
|
||||
.eq(PresetContent::getInfoType, type);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PresetContent> listPage(PresetContent presetContent) {
|
||||
LambdaQueryWrapper<PresetContent> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.likeRight(StringUtils.isNotEmpty(presetContent.getName()), PresetContent::getName, presetContent.getName());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(presetContent.getBoardSize()), PresetContent::getBoardSize, presetContent.getBoardSize());
|
||||
queryWrapper.eq(ObjectUtils.isNotEmpty(presetContent.getInfoType()), PresetContent::getInfoType, presetContent.getInfoType());
|
||||
return list(queryWrapper);
|
||||
public List<PresetContentDTO> listDTO(PresetContent presetContent) {
|
||||
MPJLambdaWrapper<PresetContent> eq = new MPJLambdaWrapper<PresetContent>()
|
||||
.selectAll(PresetContent.class)
|
||||
.selectAs(PlanType::getTypeName, "type_name")
|
||||
.selectAs(BoardType::getName,"board_size_type_name")
|
||||
.leftJoin(PlanType.class, PlanType::getId, PresetContent::getInfoType)
|
||||
.leftJoin(BoardType.class, BoardType::getId, PresetContent::getBoardSizeType)
|
||||
.eq(presetContent.getInfoType() != null && presetContent.getInfoType() > 0, PresetContent::getInfoType, presetContent.getInfoType());
|
||||
return selectJoinList(PresetContentDTO.class, eq);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package com.ruoyi.board.service.impl;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.ruoyi.board.domain.PubWhiteIp;
|
||||
import com.ruoyi.board.mapper.PubWhiteIpMapper;
|
||||
import com.ruoyi.board.service.IPubWhiteIpService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PubWhiteIpServiceImpl extends MPJBaseServiceImpl<PubWhiteIpMapper, PubWhiteIp> implements IPubWhiteIpService {
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.ruoyi.board.service.impl;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.ruoyi.board.domain.ReleaseLog;
|
||||
import com.ruoyi.board.mapper.ReleaseLogMapper;
|
||||
import com.ruoyi.board.service.IReleaseLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ReleaseLogServiceImpl extends MPJBaseServiceImpl<ReleaseLogMapper, ReleaseLog> implements IReleaseLogService {
|
||||
|
||||
}
|
|
@ -20,23 +20,9 @@ import java.util.List;
|
|||
public class ReleaseRecordServiceImpl extends MPJBaseServiceImpl<ReleaseRecordMapper, ReleaseRecord> implements IReleaseRecordService {
|
||||
private static final Logger log = LoggerFactory.getLogger(ReleaseRecordServiceImpl.class);
|
||||
|
||||
@Override
|
||||
public List<ReleaseRecordAndPresetContentDTO> listLatest2minRecordDtoByBoardId(Integer boardId) {
|
||||
Date before2min = new Date(System.currentTimeMillis() - 30 * 60 * 1000);
|
||||
return selectJoinList(ReleaseRecordAndPresetContentDTO.class,
|
||||
new MPJLambdaWrapper<ReleaseRecord>()
|
||||
.selectAll(ReleaseRecord.class)
|
||||
.select(PresetContent::getInfoType)
|
||||
.leftJoin(PresetContent.class, PresetContent::getId, ReleaseRecord::getPresetContentId)
|
||||
.eq(ReleaseRecord::getBoardId, boardId)
|
||||
.gt(ReleaseRecord::getCreateTime, before2min)
|
||||
.eq(PresetContent::getPresetType, 0)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReleaseRecord> listLatest2minRecordByBoardId(Integer boardId) {
|
||||
Date before2min = new Date(System.currentTimeMillis() - 30 * 60 * 1000);
|
||||
Date before2min = new Date(System.currentTimeMillis() - 2 * 60 * 1000);
|
||||
LambdaQueryWrapper<ReleaseRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ReleaseRecord::getBoardId, boardId)
|
||||
.gt(ReleaseRecord::getCreateTime, before2min);
|
||||
|
|
|
@ -4,7 +4,7 @@ import lombok.Getter;
|
|||
|
||||
@Getter
|
||||
public enum ProtocolDefault {
|
||||
SanSi(1, "SanSi", 2929),;
|
||||
SanSi(1, "三思", 2929),;
|
||||
private final Integer id;
|
||||
private final String name;
|
||||
private final Integer port;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.ruoyi.protocol.sansi;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.board.domain.BoardInfo;
|
||||
import com.ruoyi.board.domain.PresetContent;
|
||||
import com.ruoyi.board.domain.dto.BoardInfoAndRoadDTO;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.protocol.enums.ProtocolDefault;
|
||||
|
@ -32,7 +32,7 @@ public class SanSiProtocol implements IProtocolService {
|
|||
private static final Logger log = LoggerFactory.getLogger(SanSiProtocol.class);
|
||||
Integer deviceId = 0;
|
||||
|
||||
private String createTextItem(List<PresetContent> presetContentList, BoardInfo boardInfo) {
|
||||
private String createTextItem(List<PresetContent> presetContentList, BoardInfoAndRoadDTO boardInfo) {
|
||||
Animation animation = new Animation();
|
||||
animation.setInAnimation(0);
|
||||
animation.setInAnimationSpeed(200);
|
||||
|
@ -41,8 +41,8 @@ public class SanSiProtocol implements IProtocolService {
|
|||
int index = 1;
|
||||
presetContentList.forEach(i -> {
|
||||
TextBase textBase = new TextBase(0, i.getContent());
|
||||
textBase.setFontSize(i.getFontSize()+","+i.getFontSize());
|
||||
textBase.setFontName(SanSiFontStyle.getStyleValueByName(i.getFontStyle()));
|
||||
textBase.setFontSize(i.getFontSize() + "," + i.getFontSize());
|
||||
textBase.setFontName(SanSiFontStyle.getStyleValueByName(i.getFontFamily()));
|
||||
textBase.setWordSpace(i.getLetterSpacing());
|
||||
BaseColour fontColour = SanSiFontColor.getBaseColourByColorName(i.getFontColor());
|
||||
if (null == fontColour) {
|
||||
|
@ -56,7 +56,6 @@ public class SanSiProtocol implements IProtocolService {
|
|||
textPlayItem.setY(i.getFontPositionY());
|
||||
playItemList.add(textPlayItem);
|
||||
});
|
||||
|
||||
String boardSize = boardInfo.getBoardSize();
|
||||
String[] split = StringUtils.split(boardSize, "*");
|
||||
if (split.length < 2) {
|
||||
|
@ -67,12 +66,12 @@ public class SanSiProtocol implements IProtocolService {
|
|||
int width = Integer.parseInt(split[1]);
|
||||
|
||||
AreaPositon areaPositon = new AreaPositon(0, 0, height, width, 0);
|
||||
AreaItem areaItem = new AreaItem("1", "areaItem", areaPositon, playItemList);
|
||||
AreaItem areaItem = new AreaItem("2", "areaItem", areaPositon, playItemList);
|
||||
|
||||
List<AreaItem> areaItemList = new ArrayList<>();
|
||||
areaItemList.add(areaItem);
|
||||
|
||||
PageItem pageItem = new PageItem("1", "pageItem", areaItemList);
|
||||
PageItem pageItem = new PageItem("2", "pageItem", areaItemList);
|
||||
PlayListFcms plf = new PlayListFcms();
|
||||
|
||||
String path = "./protocolFile/SanSi/" + DateUtils.dateTimeNow();
|
||||
|
@ -93,19 +92,16 @@ public class SanSiProtocol implements IProtocolService {
|
|||
|
||||
@Override
|
||||
public boolean protocolSupport(String protocolName) {
|
||||
return StringUtils.equals(ProtocolDefault.SanSi.getName(), protocolName);
|
||||
return StringUtils.contains(protocolName, ProtocolDefault.SanSi.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loginDevice(BoardInfo boardInfo) {
|
||||
public void loginDevice(BoardInfoAndRoadDTO boardInfo) {
|
||||
if (deviceId > 10) {
|
||||
deviceId = 0;
|
||||
}
|
||||
deviceId++;
|
||||
if (boardInfo.getBoardPort()<1) {
|
||||
boardInfo.setBoardPort(ProtocolDefault.SanSi.getPort());
|
||||
}
|
||||
DeviceVar.deviceInforInit(Integer.toString(deviceId), 1, boardInfo.getBoardIp(), boardInfo.getBoardPort(), 2048);
|
||||
DeviceVar.deviceInforInit(Integer.toString(deviceId), 1, boardInfo.getBoardIp(), ProtocolDefault.SanSi.getPort(), 2048);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -114,7 +110,7 @@ public class SanSiProtocol implements IProtocolService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void publishContent(BoardInfo boardInfo, List<PresetContent> presetContentList) {
|
||||
public void publishContent(BoardInfoAndRoadDTO boardInfo, List<PresetContent> presetContentList) {
|
||||
String path = createTextItem(presetContentList, boardInfo);
|
||||
uploadAndStartPlayList(path);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,9 @@ import java.util.stream.Stream;
|
|||
|
||||
@Getter
|
||||
public enum SanSiFontStyle {
|
||||
SongTi("宋体", "s");
|
||||
SongTi("SimSun", "s"),
|
||||
HeiTi("SimHei", "h"),
|
||||
KaiTi("KaiTi", "k");
|
||||
private final String name;
|
||||
private final String value;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.ruoyi.protocol.service;
|
||||
|
||||
import com.ruoyi.board.domain.BoardInfo;
|
||||
import com.ruoyi.board.domain.PresetContent;
|
||||
import com.ruoyi.board.domain.dto.BoardInfoAndRoadDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -9,13 +9,13 @@ public interface IProtocolService {
|
|||
|
||||
boolean protocolSupport(String protocolName);
|
||||
|
||||
void loginDevice(BoardInfo boardInfo);
|
||||
void loginDevice(BoardInfoAndRoadDTO boardInfo);
|
||||
|
||||
void logoutDevice();
|
||||
|
||||
void publishContent(BoardInfo boardInfo, List<PresetContent> presetContentList);
|
||||
void publishContent(BoardInfoAndRoadDTO boardInfo, List<PresetContent> presetContentList);
|
||||
|
||||
default void publishInformation(BoardInfo boardInfo, List<PresetContent> presetContentList){
|
||||
default void publishInformation(BoardInfoAndRoadDTO boardInfo, List<PresetContent> presetContentList){
|
||||
// 登录
|
||||
loginDevice(boardInfo);
|
||||
// 发布
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.ruoyi.protocol.service.impl;
|
||||
|
||||
import com.ruoyi.board.domain.BoardInfo;
|
||||
import com.ruoyi.board.domain.PresetContent;
|
||||
import com.ruoyi.board.domain.dto.BoardInfoAndRoadDTO;
|
||||
import com.ruoyi.protocol.service.IProtocolService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -16,8 +16,8 @@ public class ContentPublishingService {
|
|||
@Autowired
|
||||
List<IProtocolService> protocolServiceList;
|
||||
|
||||
public void contentPublish(BoardInfo boardInfo, List<PresetContent> presetContentList) {
|
||||
IProtocolService iProtocolService = protocolServiceList.stream().filter(i -> i.protocolSupport(boardInfo.getBoardCommunicationProtocol())).findFirst().orElse(null);
|
||||
public void contentPublish(BoardInfoAndRoadDTO boardInfo, List<PresetContent> presetContentList) {
|
||||
IProtocolService iProtocolService = protocolServiceList.stream().filter(i -> i.protocolSupport(boardInfo.getBoardProtocolName())).findFirst().orElse(null);
|
||||
if (iProtocolService ==null) {
|
||||
log.error("协议不支持");
|
||||
return;
|
||||
|
|
|
@ -9,4 +9,6 @@ public interface ISensorDataService {
|
|||
void putPerceptionParamsToMap(PerceptionParams perceptionParams);
|
||||
|
||||
void handlerPerceptionMap();
|
||||
|
||||
void setPlanTypeNameIdMap();
|
||||
}
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
package com.ruoyi.sensor.service.impl;
|
||||
|
||||
import com.ruoyi.board.domain.AlertPlan;
|
||||
import com.ruoyi.board.domain.BoardInfo;
|
||||
import com.ruoyi.board.domain.PresetContent;
|
||||
import com.ruoyi.board.domain.ReleaseRecord;
|
||||
import com.ruoyi.board.domain.enums.AlertPlanType;
|
||||
import com.ruoyi.board.service.IAlertPlanService;
|
||||
import com.ruoyi.board.service.IBoardInfoService;
|
||||
import com.ruoyi.board.service.IPresetContentService;
|
||||
import com.ruoyi.board.service.IReleaseRecordService;
|
||||
import com.ruoyi.board.domain.*;
|
||||
import com.ruoyi.board.domain.dto.BoardInfoAndRoadDTO;
|
||||
import com.ruoyi.board.service.*;
|
||||
import com.ruoyi.protocol.service.impl.ContentPublishingService;
|
||||
import com.ruoyi.sensor.common.PerceptionHandlerMap;
|
||||
import com.ruoyi.sensor.domain.PerceptionParams;
|
||||
|
@ -19,7 +13,6 @@ import com.ruoyi.sensor.domain.dto.PerceptionHandlerDTO;
|
|||
import com.ruoyi.sensor.enums.PrintColor;
|
||||
import com.ruoyi.sensor.merchants.MerchantsHttp;
|
||||
import com.ruoyi.sensor.service.ISensorDataService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -47,11 +40,19 @@ public class SensorDataServiceImpl implements ISensorDataService {
|
|||
private IReleaseRecordService releaseRecordService;
|
||||
@Autowired
|
||||
private ContentPublishingService contentPublishingService;
|
||||
@Autowired
|
||||
private IPlanTypeService planTypeService;
|
||||
|
||||
private static final Map<String, Long> planTypeNameIdMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void perceptionParamsHandler(PerceptionParams params) {
|
||||
int currentContentPlanType = AlertPlanType.getPlanTypeByName(params.getPerceptionType());
|
||||
long currentContentPlanType = planTypeNameIdMap.getOrDefault(params.getPerceptionType(), (long) -1);
|
||||
if (currentContentPlanType == -1) {
|
||||
log.error("没有这个预警的类型");
|
||||
return;
|
||||
}
|
||||
// 找到符合计划的预警
|
||||
AlertPlan currentAlertPlan = alertPlanService.getOneByTypeAndValue(currentContentPlanType, params.getPerceptionValue());
|
||||
if (null == currentAlertPlan) {
|
||||
|
@ -59,13 +60,13 @@ public class SensorDataServiceImpl implements ISensorDataService {
|
|||
return;
|
||||
}
|
||||
// 情报板设备信息
|
||||
BoardInfo boardInfo = boardInfoService.getOneByIP(params.getBoardIp());
|
||||
BoardInfoAndRoadDTO boardInfo = boardInfoService.getOneByIP(params.getBoardIp());
|
||||
if (null == boardInfo) {
|
||||
log.error("找不到情报板信息");
|
||||
return;
|
||||
}
|
||||
// 预置发布的信息
|
||||
PresetContent currentContent = presetContentService.getOneByContentAndBoardSize(currentAlertPlan.getDisplayContent(), boardInfo.getBoardSize(), currentContentPlanType);
|
||||
PresetContent currentContent = presetContentService.getById(currentAlertPlan.getPresetContentId());
|
||||
if (null == currentContent) {
|
||||
log.error("找不到预置发布的信息");
|
||||
return;
|
||||
|
@ -80,7 +81,7 @@ public class SensorDataServiceImpl implements ISensorDataService {
|
|||
informationToBeReleasedList.add(currentContent);
|
||||
} else {
|
||||
// 如果不为空,说明 2 分钟内是发布了内容的,查询所有的发布内容
|
||||
List<Integer> presetContentIdList = releaseRecordList.stream().map(ReleaseRecord::getPresetContentId).collect(Collectors.toList());
|
||||
Set<Integer> presetContentIdList = releaseRecordList.stream().map(ReleaseRecord::getPresetContentId).collect(Collectors.toSet());
|
||||
List<PresetContent> existPresetContentList = presetContentService.listByIds(presetContentIdList);
|
||||
// 先把已经存在的都加入进去
|
||||
informationToBeReleasedList.addAll(existPresetContentList);
|
||||
|
@ -93,36 +94,24 @@ public class SensorDataServiceImpl implements ISensorDataService {
|
|||
// 说明这是一个已有的类型,需要获取预警等级,然后进行判断
|
||||
// 判断已有类型是否和现在的一样然后再替换掉
|
||||
// 现在需要知道这个同类型的属于是哪个级别的
|
||||
int foundPlanId = releaseRecordList.stream()
|
||||
.filter(i -> Objects.equals(i.getPresetContentId(), isExistsPresetContent.getId()))
|
||||
.mapToInt(ReleaseRecord::getPlanId)
|
||||
.findFirst().orElse(-1);
|
||||
AlertPlan byId = alertPlanService.getById(foundPlanId);
|
||||
int compare = NumberUtils.compare(byId.getLevel(),
|
||||
currentAlertPlan.getLevel());
|
||||
switch (compare) {
|
||||
case 0:
|
||||
// 两个一样等级
|
||||
// 这时候就不需要替换,也不需要重新发布
|
||||
presetStatus = "预警持续";
|
||||
break;
|
||||
case 1:
|
||||
// getPresetContentLevel > alertPlan.getLevel()
|
||||
// 预警减弱
|
||||
// 此时需要将同类型的信息给替换掉,并重新发布
|
||||
presetStatus = "预警减弱";
|
||||
break;
|
||||
case -1:
|
||||
// getPresetContentLevel < alertPlan.getLevel()
|
||||
// 预警加强
|
||||
// 此时需要将同类型的信息给替换掉,并重新发布
|
||||
presetStatus = "预警加强";
|
||||
break;
|
||||
}
|
||||
// 替换同类型的预警信息
|
||||
for (int i = 0; i < existPresetContentList.size(); i++) {
|
||||
if (existPresetContentList.get(i).getInfoType() == currentContentPlanType) {
|
||||
existPresetContentList.set(i, currentContent);
|
||||
AlertPlan existContentAlertPlan = alertPlanService.getOneByPresetContentId(isExistsPresetContent.getId(), currentAlertPlan.getType());
|
||||
if (existContentAlertPlan != null) {
|
||||
switch (currentAlertPlan.getMinValue().compareTo(existContentAlertPlan.getMinValue())) {
|
||||
case 0:
|
||||
presetStatus = "预警持续";
|
||||
break;
|
||||
case 1:
|
||||
presetStatus = "预警加强";
|
||||
break;
|
||||
case -1:
|
||||
presetStatus = "预警减弱";
|
||||
break;
|
||||
}
|
||||
// 替换同类型的预警信息
|
||||
for (int i = 0; i < informationToBeReleasedList.size(); i++) {
|
||||
if (informationToBeReleasedList.get(i).getInfoType() == currentContentPlanType) {
|
||||
informationToBeReleasedList.set(i, currentContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,9 +122,11 @@ public class SensorDataServiceImpl implements ISensorDataService {
|
|||
// 发布之后记录发布内容 ReleaseRecord
|
||||
this.saveRecord(boardInfo.getId(), currentContent.getId(), currentAlertPlan.getId());
|
||||
// 记录完了之后就需要向对方发送状态日志记录
|
||||
this.sendStatus(presetStatus, boardInfo.getBoardIp(), params.getPerceptionType(), currentContent.getContent(), params.getPerceptionValue(), currentAlertPlan.getLevel());
|
||||
// this.sendStatus(presetStatus, boardInfo.getBoardIp(), params.getPerceptionType(), currentContent.getContent(), params.getPerceptionValue(), currentAlertPlan.getLevel());
|
||||
this.sendStatus(presetStatus, boardInfo.getBoardIp(), params.getPerceptionType(), currentContent.getContent(), params.getPerceptionValue(), 1);
|
||||
// 发送情报板发布信息日志记录
|
||||
this.sendPublicLog(boardInfo.getBoardIp(), params.getPerceptionType(), currentAlertPlan.getLevel(), currentContent.getContent(), informationToBeReleasedList);
|
||||
// this.sendPublicLog(boardInfo.getBoardIp(), params.getPerceptionType(), currentAlertPlan.getLevel(), currentContent.getContent(), informationToBeReleasedList);
|
||||
this.sendPublicLog(boardInfo.getBoardIp(), params.getPerceptionType(), 1, currentContent.getContent(), informationToBeReleasedList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -149,10 +140,8 @@ public class SensorDataServiceImpl implements ISensorDataService {
|
|||
PerceptionHandlerMap.perceptionHandlerMap.put(key, orDefault);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void handlerPerceptionMap(){
|
||||
public void handlerPerceptionMap() {
|
||||
List<PerceptionParams> publishList = new ArrayList<>();
|
||||
List<PerceptionParams> cancelList = new ArrayList<>();
|
||||
List<String> delList = new ArrayList<>();
|
||||
|
@ -163,7 +152,7 @@ public class SensorDataServiceImpl implements ISensorDataService {
|
|||
// 最后的接收时间大于 1 分钟
|
||||
if (now - lastUpdateTime > 60 * 1000) {
|
||||
delList.add(key);
|
||||
if (value.getAllReceiveTimes() > ALL_TIMES_THRESHOLD ) {
|
||||
if (value.getAllReceiveTimes() > ALL_TIMES_THRESHOLD) {
|
||||
cancelList.add(value.getPerceptionParams());
|
||||
}
|
||||
} else {
|
||||
|
@ -194,9 +183,10 @@ public class SensorDataServiceImpl implements ISensorDataService {
|
|||
releaseLogReport.setReleaseStatus("发布成功");
|
||||
List<PresetContentStyle> presetContentStyles = new ArrayList<>();
|
||||
informationToBeReleasedList.forEach(i -> {
|
||||
String[] split = StringUtils.split(i.getBoardSize(), "*");
|
||||
// String[] split = StringUtils.split(i.getBoardSize(), "*");
|
||||
String[] split = null;
|
||||
PresetContentStyle p = new PresetContentStyle();
|
||||
p.setFont(i.getFontStyle());
|
||||
p.setFont(i.getFontFamily());
|
||||
p.setFontSize(i.getFontSize());
|
||||
p.setFontColor(PrintColor.getBitColor(i.getFontColor()));
|
||||
p.setContent(i.getContent());
|
||||
|
@ -247,4 +237,11 @@ public class SensorDataServiceImpl implements ISensorDataService {
|
|||
releaseRecord.setCreatedBy(1);
|
||||
releaseRecordService.save(releaseRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlanTypeNameIdMap() {
|
||||
planTypeNameIdMap.clear();
|
||||
Map<String, Long> collect = planTypeService.list().stream().collect(Collectors.toMap(PlanType::getTypeName, PlanType::getId));
|
||||
planTypeNameIdMap.putAll(collect);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ public class ClearPerceptionTask {
|
|||
private static final Logger log = LoggerFactory.getLogger(ClearPerceptionTask.class);
|
||||
|
||||
public void clearPerception(){
|
||||
sensorDataService.setPlanTypeNameIdMap();
|
||||
sensorDataService.handlerPerceptionMap();
|
||||
log.info("handlerPerceptionMap 处理完了");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<?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.ruoyi.board.mapper.BoardProtocolMapper">
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.board.domain.BoardProtocol">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table pub_board_protocol-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="brand" jdbcType="VARCHAR" property="brand" />
|
||||
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, brand, protocol, remark
|
||||
</sql>
|
||||
</mapper>
|
|
@ -1,33 +1,4 @@
|
|||
<?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.ruoyi.board.mapper.PresetContentMapper">
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.board.domain.PresetContent">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table pub_preset_content-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="board_size" jdbcType="VARCHAR" property="boardSize" />
|
||||
<result column="info_type" jdbcType="INTEGER" property="infoType" />
|
||||
<result column="content" jdbcType="VARCHAR" property="content" />
|
||||
<result column="preview_path" jdbcType="VARCHAR" property="previewPath" />
|
||||
<result column="font_style" jdbcType="VARCHAR" property="fontStyle" />
|
||||
<result column="font_size" jdbcType="INTEGER" property="fontSize" />
|
||||
<result column="letter_spacing" jdbcType="INTEGER" property="letterSpacing" />
|
||||
<result column="font_color" jdbcType="VARCHAR" property="fontColor" />
|
||||
<result column="font_position_x" jdbcType="INTEGER" property="fontPositionX" />
|
||||
<result column="font_position_y" jdbcType="INTEGER" property="fontPositionY" />
|
||||
<result column="play_time" jdbcType="INTEGER" property="playTime" />
|
||||
<result column="preset_type" jdbcType="INTEGER" property="presetType" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="create_by" jdbcType="INTEGER" property="createBy" />
|
||||
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, `name`, board_size, info_type, content, preview_path, font_style, font_size,
|
||||
letter_spacing, font_color, font_position_x, font_position_y, play_time, preset_type,
|
||||
remark, create_time, update_time, create_by, update_by
|
||||
</sql>
|
||||
</mapper>
|
|
@ -0,0 +1,4 @@
|
|||
<?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.ruoyi.board.mapper.PubWhiteIpMapper">
|
||||
</mapper>
|
|
@ -0,0 +1,4 @@
|
|||
<?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.ruoyi.board.mapper.ReleaseLogMapper">
|
||||
</mapper>
|
|
@ -0,0 +1,52 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询情报板协议库列表
|
||||
export function listProtocol(query) {
|
||||
return request({
|
||||
url: '/board/protocol/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询情报板协议库详细
|
||||
export function getProtocol(id) {
|
||||
return request({
|
||||
url: '/board/protocol/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增情报板协议库
|
||||
export function addProtocol(data) {
|
||||
return request({
|
||||
url: '/board/protocol',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改情报板协议库
|
||||
export function updateProtocol(data) {
|
||||
return request({
|
||||
url: '/board/protocol',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除情报板协议库
|
||||
export function delProtocol(id) {
|
||||
return request({
|
||||
url: '/board/protocol/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询情报板协议的级联菜单结构
|
||||
export function protocolTreeSelect() {
|
||||
return request({
|
||||
url: '/board/protocol/protocolTree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询发布日志记录列表
|
||||
export function listReleaseLog(query) {
|
||||
return request({
|
||||
url: '/board/releaseLog/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询发布日志记录详细
|
||||
export function getReleaseLog(id) {
|
||||
return request({
|
||||
url: '/board/releaseLog/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增发布日志记录
|
||||
export function addReleaseLog(data) {
|
||||
return request({
|
||||
url: '/board/releaseLog',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改发布日志记录
|
||||
export function updateReleaseLog(data) {
|
||||
return request({
|
||||
url: '/board/releaseLog',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除发布日志记录
|
||||
export function delReleaseLog(id) {
|
||||
return request({
|
||||
url: '/board/releaseLog/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询发布源白名单列表
|
||||
export function listWhiteIp(query) {
|
||||
return request({
|
||||
url: '/board/whiteIp/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询发布源白名单详细
|
||||
export function getWhiteIp(id) {
|
||||
return request({
|
||||
url: '/board/whiteIp/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增发布源白名单
|
||||
export function addWhiteIp(data) {
|
||||
return request({
|
||||
url: '/board/whiteIp',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改发布源白名单
|
||||
export function updateWhiteIp(data) {
|
||||
return request({
|
||||
url: '/board/whiteIp',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除发布源白名单
|
||||
export function delWhiteIp(id) {
|
||||
return request({
|
||||
url: '/board/whiteIp/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -35,7 +35,7 @@ export default {
|
|||
};
|
||||
},
|
||||
props: {
|
||||
fontStyle: {
|
||||
fontFamily: {
|
||||
type: String,
|
||||
default: 'normal',
|
||||
},
|
||||
|
@ -73,7 +73,15 @@ export default {
|
|||
},
|
||||
content: {
|
||||
type: String,
|
||||
default: '这里是示例内容,哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈',
|
||||
default: '这里是示例内容',
|
||||
},
|
||||
horizontalCenter: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
verticalCenter: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
|
@ -85,20 +93,19 @@ export default {
|
|||
background: '#000000',
|
||||
overflow: 'hidden',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
alignItems: this.verticalCenter ? 'center' : 'flex-start',
|
||||
justifyContent: this.horizontalCenter ? 'center' : 'flex-start',
|
||||
};
|
||||
},
|
||||
textStyle() {
|
||||
return {
|
||||
position: 'absolute',
|
||||
top: `${-this.fontY * this.scale}px`,
|
||||
left: `${this.fontX * this.scale}px`,
|
||||
fontStyle: this.fontStyle,
|
||||
fontFamily: this.fontFamily,
|
||||
whiteSpace: 'preserve-breaks',
|
||||
color: this.fontColor,
|
||||
fontSize: `${this.fontSize * this.scale}px`,
|
||||
letterSpacing: `${this.letterSpacing * this.scale}px`,
|
||||
lineHeight: `${this.lineHeight}`,
|
||||
transform: `translate(${this.horizontalCenter ? this.fontX * this.scale : this.fontX}px, ${this.verticalCenter ? this.fontY * this.scale : this.fontY}px)`,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="auto">
|
||||
<el-form-item label="预置信息名称" prop="name">
|
||||
<el-form-item label="内容模版名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入预置信息名称"
|
||||
|
@ -9,32 +9,13 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="情报板尺寸" prop="boardSize">
|
||||
<el-select
|
||||
v-model="queryParams.boardSize"
|
||||
clearable
|
||||
placeholder="全部">
|
||||
<el-option
|
||||
v-for="dict in dict.type.board_size"
|
||||
:key="dict.value"
|
||||
:label="dict.label + ' ' + dict.value"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="信息类型" prop="type">
|
||||
<el-select
|
||||
<el-cascader
|
||||
v-model="queryParams.infoType"
|
||||
:options="planTypeOptions"
|
||||
:props="{lable: 'lable', value: 'id', expandTrigger:'hover', emitPath: false}"
|
||||
clearable
|
||||
placeholder="全部"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.alert_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
@ -75,40 +56,18 @@
|
|||
v-hasPermi="['board:content: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="['board:content:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="contentList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="唯一编号" align="center" prop="id" />
|
||||
<el-table-column label="预置信息名称" align="center" prop="name" />
|
||||
<el-table-column label="情报板尺寸" align="center" prop="boardSize" />
|
||||
<el-table-column label="信息类型" align="center" prop="infoType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.alert_type" :value="scope.row.infoType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预置内容" align="center" prop="content" />
|
||||
<el-table-column label="预览路径" align="center" prop="previewPath" />
|
||||
<!-- <el-table-column label="字体样式" align="center" prop="fontStyle" />-->
|
||||
<!-- <el-table-column label="字体大小" align="center" prop="fontSize" />-->
|
||||
<!-- <el-table-column label="字体间距" align="center" prop="letterSpacing" />-->
|
||||
<!-- <el-table-column label="字体颜色" align="center" prop="fontColor" />-->
|
||||
<!-- <el-table-column label="字体坐标X" align="center" prop="fontPositionX" />-->
|
||||
<!-- <el-table-column label="字体坐标Y" align="center" prop="fontPositionY" />-->
|
||||
<el-table-column label="播放时间" align="center" prop="playTime" />
|
||||
<!-- <el-table-column label="当前预置类型 1:内置模版 0:预发布信息" align="center" prop="presetType" />-->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="唯一编号" align="center" prop="id"/>
|
||||
<el-table-column label="内容模版名称" align="center" prop="name"/>
|
||||
<el-table-column label="情报板尺寸" align="center" prop="boardSizeTypeName"/>
|
||||
<el-table-column label="信息类型" align="center" prop="typeName"/>
|
||||
<el-table-column label="预置内容" align="center" prop="content"/>
|
||||
<el-table-column label="播放时间" align="center" prop="playTime"/>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -138,91 +97,114 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改预置信息及模版对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="auto">
|
||||
<el-form-item label="预置信息名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入预置信息名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预置信息类型" prop="infoType">
|
||||
<el-select
|
||||
v-model="form.infoType"
|
||||
placeholder="全部"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.alert_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="情报板尺寸" prop="boardSize">
|
||||
<el-select
|
||||
v-model="form.boardSize"
|
||||
placeholder="请选择情报板尺寸">
|
||||
<el-option
|
||||
v-for="dict in dict.type.board_size"
|
||||
:key="dict.value"
|
||||
:label="dict.label + ' ' + dict.value"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预置内容" prop="content">
|
||||
<el-input v-model="form.content" placeholder="请输入预置内容"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字体样式" prop="fontStyle">
|
||||
<el-select
|
||||
v-model="form.fontStyle"
|
||||
placeholder="请选择字体样式">
|
||||
<el-option
|
||||
v-for="dict in dict.type.font_style"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="字体颜色" prop="fontColor">
|
||||
<el-select
|
||||
v-model="form.fontColor"
|
||||
placeholder="请选择字体颜色">
|
||||
<el-option
|
||||
v-for="dict in dict.type.font_color"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="字体大小" prop="fontSize">
|
||||
<el-input-number :min="20" :max="50" v-model="form.fontSize" placeholder="请输入字体大小" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字体间距" prop="letterSpacing">
|
||||
<el-input-number :min="0" v-model="form.letterSpacing" placeholder="请输入字体间距" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字体坐标X" prop="fontPositionX">
|
||||
<el-input-number v-model="form.fontPositionX" placeholder="请输入字体坐标X" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字体坐标Y" prop="fontPositionY">
|
||||
<el-input-number v-model="form.fontPositionY" placeholder="请输入字体坐标Y" />
|
||||
</el-form-item>
|
||||
<el-form-item label="播放时间" prop="playTime">
|
||||
<el-input-number :min="0" v-model="form.playTime" placeholder="请输入播放时间" />
|
||||
</el-form-item>
|
||||
<text-preview
|
||||
fontStyle="SongTi"
|
||||
:fontSize="form.fontSize"
|
||||
:letterSpacing="form.letterSpacing"
|
||||
:fontX="form.fontPositionX"
|
||||
:fontY="form.fontPositionY"
|
||||
:backgroundWidth="bgSize.width"
|
||||
:backgroundHeight="bgSize.height"
|
||||
:lineHeight="1"
|
||||
:content="form.content" />
|
||||
<el-row :gutter="0">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="内容模版名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入预置信息名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预置信息类型" prop="infoType">
|
||||
<el-cascader
|
||||
v-model="form.infoType"
|
||||
:options="planTypeOptions"
|
||||
:props="{lable: 'lable', value: 'id', expandTrigger:'hover', emitPath: false}"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="情报板尺寸" prop="boardSizeType">
|
||||
<el-select
|
||||
v-model="form.boardSizeType"
|
||||
placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in this.boardTypeOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预置内容" prop="content">
|
||||
<el-input type="textarea" v-model="form.content" placeholder="请输入预置内容"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="字体大小" prop="fontSize">
|
||||
<el-input-number :controls="false" :min="20" :max="50" v-model="form.fontSize" placeholder="请输入字体大小" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字体间距" prop="letterSpacing">
|
||||
<el-input-number :controls="false" :min="0" v-model="form.letterSpacing" placeholder="请输入字体间距" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字体坐标X" prop="fontPositionX">
|
||||
<el-input-number :controls="false" v-model="form.fontPositionX" placeholder="请输入字体坐标X" size="small"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="字体坐标Y" prop="fontPositionY">
|
||||
<el-input-number :controls="false" v-model="form.fontPositionY" placeholder="请输入字体坐标Y" size="small"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="播放时间" prop="playTime">
|
||||
<el-input-number :controls="false" :min="0" v-model="form.playTime" placeholder="请输入播放时间" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="字体样式" prop="fontFamily">
|
||||
<el-select
|
||||
v-model="form.fontFamily"
|
||||
placeholder="请选择字体样式">
|
||||
<el-option
|
||||
v-for="dict in dict.type.font_family"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="字体颜色" prop="fontColor">
|
||||
<el-select
|
||||
v-model="form.fontColor"
|
||||
placeholder="请选择字体颜色">
|
||||
<el-option
|
||||
v-for="dict in dict.type.font_color"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="水平居中" prop="horizontalCenter">
|
||||
<el-switch
|
||||
v-model="form.horizontalCenter"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="垂直居中" prop="verticalCenter">
|
||||
<el-switch
|
||||
v-model="form.verticalCenter"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<text-preview
|
||||
:fontFamily="form.fontFamily"
|
||||
:fontSize="form.fontSize"
|
||||
:fontColor="form.fontColor"
|
||||
:letterSpacing="form.letterSpacing"
|
||||
:fontX="form.fontPositionX"
|
||||
:fontY="form.fontPositionY"
|
||||
:backgroundWidth="bgSize.width"
|
||||
:backgroundHeight="bgSize.height"
|
||||
:lineHeight="1"
|
||||
:horizontalCenter="form.horizontalCenter"
|
||||
:verticalCenter="form.verticalCenter"
|
||||
:content="form.content"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -234,13 +216,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listContent, getContent, delContent, addContent, updateContent } from "@/api/board/content";
|
||||
import {listContent, getContent, delContent, addContent, updateContent} from "@/api/board/content";
|
||||
import TextPreview from "@/views/board/component/TextPreview.vue";
|
||||
import {planTypeTreeSelect} from "@/api/board/plantype";
|
||||
import {listBoardType} from "@/api/board/boardtype";
|
||||
|
||||
export default {
|
||||
name: "Content",
|
||||
components: {TextPreview},
|
||||
dicts: ['board_size','font_color','font_style', 'alert_type'],
|
||||
dicts: ['board_size', 'font_color', 'font_family', 'alert_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
@ -261,12 +245,13 @@ export default {
|
|||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
planTypeOptions: [],
|
||||
boardTypeOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
boardSize: null,
|
||||
infoType: null,
|
||||
content: null,
|
||||
previewPath: null,
|
||||
|
@ -284,69 +269,71 @@ export default {
|
|||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "预置信息名称不能为空", trigger: "blur" }
|
||||
{required: true, message: "预置信息名称不能为空", trigger: "blur"}
|
||||
],
|
||||
boardSize: [
|
||||
{ required: true, message: "情报板尺寸不能为空", trigger: "blur" }
|
||||
boardSizeType: [
|
||||
{required: true, message: "情报板尺寸不能为空", trigger: "blur"}
|
||||
],
|
||||
infoType: [
|
||||
{ required: true, message: "信息类型不能为空", trigger: "change" }
|
||||
{required: true, message: "信息类型不能为空", trigger: "change"}
|
||||
],
|
||||
content: [
|
||||
{ required: true, message: "预置内容不能为空", trigger: "blur" }
|
||||
{required: true, message: "预置内容不能为空", trigger: "blur"}
|
||||
],
|
||||
previewPath: [
|
||||
{ required: true, message: "预览路径不能为空", trigger: "blur" }
|
||||
{required: true, message: "预览路径不能为空", trigger: "blur"}
|
||||
],
|
||||
fontStyle: [
|
||||
{ required: true, message: "字体样式不能为空", trigger: "blur" }
|
||||
{required: true, message: "字体样式不能为空", trigger: "blur"}
|
||||
],
|
||||
fontSize: [
|
||||
{ required: true, message: "字体大小不能为空", trigger: "blur" }
|
||||
{required: true, message: "字体大小不能为空", trigger: "blur"}
|
||||
],
|
||||
letterSpacing: [
|
||||
{ required: true, message: "字体间距不能为空", trigger: "blur" }
|
||||
{required: true, message: "字体间距不能为空", trigger: "blur"}
|
||||
],
|
||||
fontColor: [
|
||||
{ required: true, message: "字体颜色不能为空", trigger: "blur" }
|
||||
{required: true, message: "字体颜色不能为空", trigger: "blur"}
|
||||
],
|
||||
fontPositionX: [
|
||||
{ required: true, message: "字体坐标X不能为空", trigger: "blur" }
|
||||
{required: true, message: "字体坐标X不能为空", trigger: "blur"}
|
||||
],
|
||||
fontPositionY: [
|
||||
{ required: true, message: "字体坐标Y不能为空", trigger: "blur" }
|
||||
{required: true, message: "字体坐标Y不能为空", trigger: "blur"}
|
||||
],
|
||||
playTime: [
|
||||
{ required: true, message: "播放时间不能为空", trigger: "blur" }
|
||||
{required: true, message: "播放时间不能为空", trigger: "blur"}
|
||||
],
|
||||
presetType: [
|
||||
{ required: false, message: "当前预置类型 1:内置模版 0:预发布信息不能为空", trigger: "change" }
|
||||
{required: false, message: "当前预置类型 1:内置模版 0:预发布信息不能为空", trigger: "change"}
|
||||
],
|
||||
remark: [
|
||||
{ required: false, message: "备注不能为空", trigger: "blur" }
|
||||
{required: false, message: "备注不能为空", trigger: "blur"}
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
{required: true, message: "创建时间不能为空", trigger: "blur"}
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: "更新时间不能为空", trigger: "blur" }
|
||||
{required: true, message: "更新时间不能为空", trigger: "blur"}
|
||||
],
|
||||
createBy: [
|
||||
{ required: true, message: "创建人id不能为空", trigger: "blur" }
|
||||
{required: true, message: "创建人id不能为空", trigger: "blur"}
|
||||
],
|
||||
updateBy: [
|
||||
{ required: true, message: "更新人id不能为空", trigger: "blur" }
|
||||
{required: true, message: "更新人id不能为空", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getPlanTypeTree();
|
||||
this.getBoardTypeList();
|
||||
},
|
||||
computed:{
|
||||
computed: {
|
||||
bgSize() {
|
||||
if (!this.form.boardSize) {
|
||||
return {width: 320, height:160}
|
||||
return {width: 320, height: 160}
|
||||
}
|
||||
let [height, width] = this.form.boardSize.split("*").map(Number);
|
||||
return {width, height}
|
||||
|
@ -376,7 +363,7 @@ export default {
|
|||
infoType: null,
|
||||
content: null,
|
||||
previewPath: null,
|
||||
fontStyle: null,
|
||||
fontFamily: null,
|
||||
fontSize: null,
|
||||
letterSpacing: null,
|
||||
fontColor: null,
|
||||
|
@ -388,7 +375,9 @@ export default {
|
|||
createTime: null,
|
||||
updateTime: null,
|
||||
createBy: null,
|
||||
updateBy: null
|
||||
updateBy: null,
|
||||
horizontalCenter: true,
|
||||
verticalCenter: true,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
@ -405,7 +394,7 @@ export default {
|
|||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
|
@ -420,7 +409,6 @@ export default {
|
|||
const id = row.id || this.ids
|
||||
getContent(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.infoType += '';
|
||||
this.open = true;
|
||||
this.title = "修改预置信息及模版";
|
||||
});
|
||||
|
@ -448,7 +436,7 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除预置信息及模版编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除预置信息及模版编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delContent(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
|
@ -460,7 +448,19 @@ export default {
|
|||
this.download('board/content/export', {
|
||||
...this.queryParams
|
||||
}, `content_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
/** 查询类型下拉树结构 */
|
||||
getPlanTypeTree() {
|
||||
planTypeTreeSelect().then(response => {
|
||||
this.planTypeOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 查询情报板类型定义 */
|
||||
getBoardTypeList() {
|
||||
listBoardType().then(response => {
|
||||
this.boardTypeOptions = response.rows;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -68,41 +68,21 @@
|
|||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExport"-->
|
||||
<!-- v-hasPermi="['board:info:export']"-->
|
||||
<!-- >导出-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange" append-to-body>
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="唯一编号" align="center" prop="id"/>
|
||||
<el-table-column label="情报板名称" align="center" prop="boardName"/>
|
||||
<el-table-column label="情报板路段" align="center" prop="roadName"/>
|
||||
<el-table-column label="情报板方向" align="center" prop="boardDirection"/>
|
||||
<el-table-column label="情报板工桩号" align="center" prop="boardMileage"/>
|
||||
<el-table-column label="情报板尺寸" align="center" prop="boardSize">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.board_size" :value="scope.row.boardSize"/>
|
||||
{{ scope.row.boardSize }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="情报板品牌" align="center" prop="boardBrand"/>
|
||||
<el-table-column label="情报板通讯协议" align="center" prop="boardCommunicationProtocol">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.board_protocol" :value="scope.row.boardCommunicationProtocol"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="情报板IP" align="center" prop="boardIp"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column type="selection" width="55" align="left"/>
|
||||
<el-table-column label="唯一编号" align="left" prop="id"/>
|
||||
<el-table-column label="所属路段" align="left" prop="roadName"/>
|
||||
<el-table-column label="情报板名称" align="left" prop="boardName"/>
|
||||
<el-table-column label="方向" align="left" prop="boardDirection"/>
|
||||
<el-table-column label="工桩号" align="left" prop="boardMileage"/>
|
||||
<el-table-column label="情报板类型" align="left" prop="boardSizeName" show-overflow-tooltip />
|
||||
<el-table-column label="品牌" align="left" prop="boardBrandName"/>
|
||||
<el-table-column label="通讯协议" align="left" prop="boardProtocolName" show-overflow-tooltip />
|
||||
<el-table-column label="情报板IP" align="left" prop="boardIp" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="left" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
|
@ -150,32 +130,23 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="情报板类型" prop="boardSize">
|
||||
<el-select
|
||||
v-model="form.boardSize"
|
||||
v-model="form.boardSizeType"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.board_size"
|
||||
:key="dict.value"
|
||||
:label="dict.label + ' ' + dict.value"
|
||||
:value="dict.value"
|
||||
v-for="dict in this.boardTypeOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌" prop="boardBrand">
|
||||
<el-input v-model="form.boardBrand" placeholder="请输入情报板品牌"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通讯协议" prop="boardCommunicationProtocol">
|
||||
<el-select
|
||||
v-model="form.boardCommunicationProtocol"
|
||||
placeholder="全部"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.board_protocol"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item label="品牌/协议" prop="boardBrandProtocol">
|
||||
<el-cascader
|
||||
v-model="form.boardBrandProtocol"
|
||||
:options="boardProtocolOptions"
|
||||
:props="{lable: 'lable', value: 'id', expandTrigger:'hover', emitPath: false}"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="情报板IP" prop="boardIp">
|
||||
<el-input v-model="form.boardIp" placeholder="请输入情报板IP"/>
|
||||
|
@ -195,6 +166,8 @@ import Treeselect from "@riophae/vue-treeselect";
|
|||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import TextPreview from "@/views/board/component/TextPreview.vue";
|
||||
import {roadGroupTreeSelect} from "@/api/board/roadgroup";
|
||||
import {listBoardType} from "@/api/board/boardtype";
|
||||
import {protocolTreeSelect} from "@/api/board/protocol";
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
|
@ -210,8 +183,13 @@ export default {
|
|||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 部门树选项
|
||||
// 路段树选项
|
||||
roadGroupOptions: [],
|
||||
// 情报板类型列表
|
||||
boardTypeOptions: [],
|
||||
boardTypeId: null,
|
||||
// 情报板协议树
|
||||
boardProtocolOptions: [],
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
|
@ -252,15 +230,12 @@ export default {
|
|||
boardMileage: [
|
||||
{required: true, message: "情报板工桩号不能为空", trigger: "blur"}
|
||||
],
|
||||
boardSize: [
|
||||
{required: true, message: "情报板尺寸不能为空", trigger: "blur"}
|
||||
boardSizeType: [
|
||||
{required: true, message: "情报板类型不能为空", trigger: "blur"}
|
||||
],
|
||||
boardBrand: [
|
||||
boardBrandProtocol: [
|
||||
{required: true, message: "情报板品牌不能为空", trigger: "blur"}
|
||||
],
|
||||
boardCommunicationProtocol: [
|
||||
{required: true, message: "情报板通讯协议不能为空", trigger: "blur"}
|
||||
],
|
||||
boardIp: [
|
||||
{required: true, message: "情报板IP不能为空", trigger: "blur"},
|
||||
{
|
||||
|
@ -275,6 +250,8 @@ export default {
|
|||
created() {
|
||||
this.getList();
|
||||
this.getRoadTree();
|
||||
this.getBoardTypeList();
|
||||
this.getProtocolTree();
|
||||
},
|
||||
methods: {
|
||||
/** 查询情报板信息列表 */
|
||||
|
@ -299,7 +276,7 @@ export default {
|
|||
boardRoadSection: null,
|
||||
boardDirection: null,
|
||||
boardMileage: null,
|
||||
boardSize: null,
|
||||
boardSizeType: null,
|
||||
boardBrand: null,
|
||||
boardCommunicationProtocol: null,
|
||||
boardIp: null,
|
||||
|
@ -382,6 +359,18 @@ export default {
|
|||
this.roadGroupOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 查询情报板类型定义 */
|
||||
getBoardTypeList() {
|
||||
listBoardType().then(response => {
|
||||
this.boardTypeOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询情报板协议树 */
|
||||
getProtocolTree() {
|
||||
protocolTreeSelect().then(response => {
|
||||
this.boardProtocolOptions = response.data;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -50,16 +50,6 @@
|
|||
v-hasPermi="['board:plan: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="['board:plan:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange">
|
||||
|
@ -69,7 +59,7 @@
|
|||
<el-table-column label="等级" align="center" prop="level" />
|
||||
<el-table-column label="最大值" align="center" prop="maxValue" />
|
||||
<el-table-column label="最小值" align="center" prop="minValue" />
|
||||
<el-table-column label="显示内容" align="center" prop="displayContent" />
|
||||
<el-table-column label="显示内容" align="center" prop="presetContentName" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -115,7 +105,16 @@
|
|||
<el-input-number :min="form.minValue" :precision="2" v-model="form.maxValue" placeholder="请输入最大值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示内容">
|
||||
<el-input v-model="form.displayContent" :min-height="192"/>
|
||||
<el-select
|
||||
v-model="form.presetContentId"
|
||||
placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in this.contentModelOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -130,6 +129,7 @@
|
|||
import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/board/plan";
|
||||
import PlanTypeTree from "@/views/board/plan/planTypeTree.vue";
|
||||
import {planTypeTreeSelect} from "@/api/board/plantype";
|
||||
import {listContent} from "@/api/board/content";
|
||||
|
||||
export default {
|
||||
name: "Plan",
|
||||
|
@ -152,6 +152,7 @@ export default {
|
|||
total: 0,
|
||||
// 警报计划表格数据
|
||||
planList: [],
|
||||
contentModelOptions: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
|
@ -186,7 +187,7 @@ export default {
|
|||
minValue: [
|
||||
{ required: true, message: "最小值不能为空", trigger: "blur" }
|
||||
],
|
||||
displayContent: [
|
||||
presetContentId: [
|
||||
{ required: true, message: "显示内容不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
|
@ -218,7 +219,7 @@ export default {
|
|||
level: null,
|
||||
maxValue: null,
|
||||
minValue: null,
|
||||
displayContent: null
|
||||
presetContentId: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
@ -295,12 +296,26 @@ export default {
|
|||
this.clickNodeData = data;
|
||||
this.queryParams.type = data.id;
|
||||
this.handleQuery();
|
||||
this.getContentList();
|
||||
},
|
||||
getPlanTypeTree() {
|
||||
planTypeTreeSelect().then(response => {
|
||||
this.clickNodeData = response.data[0].children[0];
|
||||
this.queryParams.type = response.data[0].children[0].id;
|
||||
this.getList();
|
||||
this.getContentList();
|
||||
});
|
||||
},
|
||||
getContentList() {
|
||||
this.contentModelOptions = [];
|
||||
listContent({infoType: this.queryParams.type}).then(response => {
|
||||
response.rows.forEach(row => {
|
||||
let model = {
|
||||
name: row.name + " - " + row.boardSizeTypeName + " - " + row.content,
|
||||
id: row.id
|
||||
}
|
||||
this.contentModelOptions.push(model)
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
@ -0,0 +1,270 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="auto">
|
||||
<el-form-item label="情报板品牌" prop="brand">
|
||||
<el-input
|
||||
v-model="queryParams.brand"
|
||||
placeholder="请输入情报板品牌"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="情报板通讯协议" prop="protocol">
|
||||
<el-input
|
||||
v-model="queryParams.protocol"
|
||||
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="['board:protocol: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="['board:protocol: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="['board:protocol: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="['board:protocol:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="protocolList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="唯一编号" align="center" prop="id" />
|
||||
<el-table-column label="情报板品牌" align="center" prop="brand" />
|
||||
<el-table-column label="情报板通讯协议" align="center" prop="protocol" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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="['board:protocol:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['board:protocol: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="auto">
|
||||
<el-form-item label="情报板品牌" prop="brand">
|
||||
<el-input v-model="form.brand" placeholder="请输入情报板品牌" />
|
||||
</el-form-item>
|
||||
<el-form-item label="情报板通讯协议" prop="protocol">
|
||||
<el-input v-model="form.protocol" placeholder="请输入情报板通讯协议" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" 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 { listProtocol, getProtocol, delProtocol, addProtocol, updateProtocol } from "@/api/board/protocol";
|
||||
|
||||
export default {
|
||||
name: "Protocol",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 情报板协议库表格数据
|
||||
protocolList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
brand: null,
|
||||
protocol: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
brand: [
|
||||
{ required: true, message: "情报板品牌不能为空", trigger: "blur" }
|
||||
],
|
||||
protocol: [
|
||||
{ required: true, message: "情报板通讯协议不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询情报板协议库列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listProtocol(this.queryParams).then(response => {
|
||||
this.protocolList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
brand: null,
|
||||
protocol: null,
|
||||
remark: 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
|
||||
getProtocol(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) {
|
||||
updateProtocol(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addProtocol(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 delProtocol(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('board/protocol/export', {
|
||||
...this.queryParams
|
||||
}, `protocol_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,160 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="auto">
|
||||
<el-form-item label="操作人" prop="operator">
|
||||
<el-input
|
||||
v-model="queryParams.operator"
|
||||
placeholder="请输入操作人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="情报板名称" prop="boardName">
|
||||
<el-input
|
||||
v-model="queryParams.boardName"
|
||||
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="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['board:releaseLog: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="['board:releaseLog:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="releaseLogList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="唯一编号" align="center" prop="id" />
|
||||
<el-table-column label="操作人" align="center" prop="operator" />
|
||||
<el-table-column label="情报板名称" align="center" prop="boardName" />
|
||||
<el-table-column label="发布内容" align="center" prop="releaseContent" />
|
||||
<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="handleDelete(scope.row)"
|
||||
v-hasPermi="['board:releaseLog: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"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listReleaseLog, delReleaseLog,} from "@/api/board/releaseLog";
|
||||
|
||||
export default {
|
||||
name: "ReleaseLog",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 发布日志记录表格数据
|
||||
releaseLogList: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
operator: null,
|
||||
boardId: null,
|
||||
boardName: null,
|
||||
releaseContent: null
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询发布日志记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listReleaseLog(this.queryParams).then(response => {
|
||||
this.releaseLogList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
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
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除发布日志记录编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delReleaseLog(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('board/releaseLog/export', {
|
||||
...this.queryParams
|
||||
}, `releaseLog_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,272 @@
|
|||
<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="['board:whiteIp: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="['board:whiteIp: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="['board:whiteIp:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="whiteIpList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="唯一标识" align="center" prop="id" />
|
||||
<el-table-column label="名称" align="center" prop="name" />
|
||||
<el-table-column label="IP地址" align="center" prop="ip" />
|
||||
<el-table-column label="安全密钥" align="center" prop="securityKey" :formatter="(row) => formatSecurityKey(row.securityKey)" show-overflow-tooltip />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<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="['board:whiteIp:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['board:whiteIp: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="IP地址" prop="ip">
|
||||
<el-input v-model="form.ip" placeholder="请输入IP地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="安全密钥" prop="securityKey">
|
||||
<el-input type="password" v-model="form.securityKey" placeholder="请输入安全密钥" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" 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 { listWhiteIp, getWhiteIp, delWhiteIp, addWhiteIp, updateWhiteIp } from "@/api/board/whiteip";
|
||||
|
||||
export default {
|
||||
name: "WhiteIp",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 发布源白名单表格数据
|
||||
whiteIpList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
ip: null,
|
||||
securityKey: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "名称不能为空", trigger: "blur" }
|
||||
],
|
||||
ip: [
|
||||
{required: true, message: "IP地址不能为空", trigger: "blur"},
|
||||
{
|
||||
pattern: /^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$/,
|
||||
message: "请输入正确的 IP",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
securityKey: [
|
||||
{ required: true, message: "安全密钥不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询发布源白名单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listWhiteIp(this.queryParams).then(response => {
|
||||
this.whiteIpList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
ip: null,
|
||||
securityKey: null,
|
||||
remark: 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
|
||||
getWhiteIp(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) {
|
||||
updateWhiteIp(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addWhiteIp(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 delWhiteIp(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('board/whiteIp/export', {
|
||||
...this.queryParams
|
||||
}, `whiteIp_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
formatSecurityKey(securityKey) {
|
||||
if (securityKey && securityKey.length > 6) {
|
||||
return securityKey.substring(0, 6) + '*'.repeat(securityKey.length - 6);
|
||||
}
|
||||
return securityKey;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue