change - add提示路由信息

master
yinq 7 months ago
parent 86e3921bd6
commit 1f2801a7db

@ -0,0 +1,109 @@
package com.hw.system.common.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.system.common.domain.SysPointRouter;
import com.hw.system.common.service.ISysPointRouterService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.utils.poi.ExcelUtil;
import com.hw.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Yinq
* @date 2024-04-22
*/
@RestController
@RequestMapping("/pointRouter")
public class SysPointRouterController extends BaseController {
@Autowired
private ISysPointRouterService sysPointRouterService;
/**
*
*/
@RequiresPermissions("system:pointRouter:list")
@GetMapping("/list")
public TableDataInfo list(SysPointRouter sysPointRouter) {
startPage();
List<SysPointRouter> list = sysPointRouterService.selectSysPointRouterList(sysPointRouter);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:pointRouter:export")
@Log(title = "提示路由信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SysPointRouter sysPointRouter) {
List<SysPointRouter> list = sysPointRouterService.selectSysPointRouterList(sysPointRouter);
ExcelUtil<SysPointRouter> util = new ExcelUtil<SysPointRouter>(SysPointRouter.class);
util.exportExcel(response, list, "提示路由信息数据");
}
/**
*
*/
@RequiresPermissions("system:pointRouter:query")
@GetMapping(value = "/{pointRouterId}")
public AjaxResult getInfo(@PathVariable("pointRouterId") Long pointRouterId) {
return success(sysPointRouterService.selectSysPointRouterByPointRouterId(pointRouterId));
}
/**
*
*/
@RequiresPermissions("system:pointRouter:add")
@Log(title = "提示路由信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysPointRouter sysPointRouter) {
return toAjax(sysPointRouterService.insertSysPointRouter(sysPointRouter));
}
/**
*
*/
@RequiresPermissions("system:pointRouter:edit")
@Log(title = "提示路由信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysPointRouter sysPointRouter) {
return toAjax(sysPointRouterService.updateSysPointRouter(sysPointRouter));
}
/**
*
*/
@RequiresPermissions("system:pointRouter:remove")
@Log(title = "提示路由信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{pointRouterIds}")
public AjaxResult remove(@PathVariable Long[] pointRouterIds) {
return toAjax(sysPointRouterService.deleteSysPointRouterByPointRouterIds(pointRouterIds));
}
/**
*
* @param sysPointRouter
* @return
*/
@PostMapping("/insertPointRouterInfo")
public AjaxResult insertPointRouterInfo(@RequestBody SysPointRouter sysPointRouter) {
return toAjax(sysPointRouterService.insertSysPointRouter(sysPointRouter));
}
}

@ -0,0 +1,133 @@
package com.hw.system.common.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* sys_point_router
*
* @author Yinq
* @date 2024-04-22
*/
public class SysPointRouter extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long pointRouterId;
/**
*
*/
@Excel(name = "功能模块")
private String moduleCode;
/**
* (1=;2=)
*/
@Excel(name = "提示类型(1=报警;2=审核)")
private String pointType;
/**
*
*/
@Excel(name = "路由地址")
private String routerAddress;
/**
*
*/
@Excel(name = "路由地址详情")
private String routerAddressDetail;
/**
* (0=;1=)
*/
@Excel(name = "跳转标识(0=未跳转;1=已跳转)")
private String routerFlag;
/** 提示信息 */
@Excel(name = "提示信息")
private String remark;
@Override
public String getRemark() {
return remark;
}
@Override
public void setRemark(String remark) {
this.remark = remark;
}
public void setPointRouterId(Long pointRouterId) {
this.pointRouterId = pointRouterId;
}
public Long getPointRouterId() {
return pointRouterId;
}
public void setModuleCode(String moduleCode) {
this.moduleCode = moduleCode;
}
public String getModuleCode() {
return moduleCode;
}
public void setPointType(String pointType) {
this.pointType = pointType;
}
public String getPointType() {
return pointType;
}
public void setRouterAddress(String routerAddress) {
this.routerAddress = routerAddress;
}
public String getRouterAddress() {
return routerAddress;
}
public void setRouterAddressDetail(String routerAddressDetail) {
this.routerAddressDetail = routerAddressDetail;
}
public String getRouterAddressDetail() {
return routerAddressDetail;
}
public void setRouterFlag(String routerFlag) {
this.routerFlag = routerFlag;
}
public String getRouterFlag() {
return routerFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("pointRouterId", getPointRouterId())
.append("moduleCode", getModuleCode())
.append("pointType", getPointType())
.append("routerAddress", getRouterAddress())
.append("routerAddressDetail", getRouterAddressDetail())
.append("routerFlag", getRouterFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.toString();
}
}

@ -0,0 +1,61 @@
package com.hw.system.common.mapper;
import java.util.List;
import com.hw.system.common.domain.SysPointRouter;
/**
* Mapper
*
* @author Yinq
* @date 2024-04-22
*/
public interface SysPointRouterMapper
{
/**
*
*
* @param pointRouterId
* @return
*/
public SysPointRouter selectSysPointRouterByPointRouterId(Long pointRouterId);
/**
*
*
* @param sysPointRouter
* @return
*/
public List<SysPointRouter> selectSysPointRouterList(SysPointRouter sysPointRouter);
/**
*
*
* @param sysPointRouter
* @return
*/
public int insertSysPointRouter(SysPointRouter sysPointRouter);
/**
*
*
* @param sysPointRouter
* @return
*/
public int updateSysPointRouter(SysPointRouter sysPointRouter);
/**
*
*
* @param pointRouterId
* @return
*/
public int deleteSysPointRouterByPointRouterId(Long pointRouterId);
/**
*
*
* @param pointRouterIds
* @return
*/
public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds);
}

@ -0,0 +1,61 @@
package com.hw.system.common.service;
import java.util.List;
import com.hw.system.common.domain.SysPointRouter;
/**
* Service
*
* @author Yinq
* @date 2024-04-22
*/
public interface ISysPointRouterService
{
/**
*
*
* @param pointRouterId
* @return
*/
public SysPointRouter selectSysPointRouterByPointRouterId(Long pointRouterId);
/**
*
*
* @param sysPointRouter
* @return
*/
public List<SysPointRouter> selectSysPointRouterList(SysPointRouter sysPointRouter);
/**
*
*
* @param sysPointRouter
* @return
*/
public int insertSysPointRouter(SysPointRouter sysPointRouter);
/**
*
*
* @param sysPointRouter
* @return
*/
public int updateSysPointRouter(SysPointRouter sysPointRouter);
/**
*
*
* @param pointRouterIds
* @return
*/
public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds);
/**
*
*
* @param pointRouterId
* @return
*/
public int deleteSysPointRouterByPointRouterId(Long pointRouterId);
}

@ -0,0 +1,95 @@
package com.hw.system.common.service.impl;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.system.common.mapper.SysPointRouterMapper;
import com.hw.system.common.domain.SysPointRouter;
import com.hw.system.common.service.ISysPointRouterService;
/**
* Service
*
* @author Yinq
* @date 2024-04-22
*/
@Service
public class SysPointRouterServiceImpl implements ISysPointRouterService {
@Autowired
private static SysPointRouterMapper sysPointRouterMapper;
/**
*
*
* @param pointRouterId
* @return
*/
@Override
public SysPointRouter selectSysPointRouterByPointRouterId(Long pointRouterId) {
return sysPointRouterMapper.selectSysPointRouterByPointRouterId(pointRouterId);
}
/**
*
*
* @param sysPointRouter
* @return
*/
@Override
public List<SysPointRouter> selectSysPointRouterList(SysPointRouter sysPointRouter) {
return sysPointRouterMapper.selectSysPointRouterList(sysPointRouter);
}
/**
*
*
* @param sysPointRouter
* @return
*/
@Override
public int insertSysPointRouter(SysPointRouter sysPointRouter) {
sysPointRouter.setCreateBy(SecurityUtils.getUsername());
sysPointRouter.setCreateTime(DateUtils.getNowDate());
return sysPointRouterMapper.insertSysPointRouter(sysPointRouter);
}
/**
*
*
* @param sysPointRouter
* @return
*/
@Override
public int updateSysPointRouter(SysPointRouter sysPointRouter) {
sysPointRouter.setUpdateBy(SecurityUtils.getUsername());
sysPointRouter.setUpdateTime(DateUtils.getNowDate());
return sysPointRouterMapper.updateSysPointRouter(sysPointRouter);
}
/**
*
*
* @param pointRouterIds
* @return
*/
@Override
public int deleteSysPointRouterByPointRouterIds(Long[] pointRouterIds) {
return sysPointRouterMapper.deleteSysPointRouterByPointRouterIds(pointRouterIds);
}
/**
*
*
* @param pointRouterId
* @return
*/
@Override
public int deleteSysPointRouterByPointRouterId(Long pointRouterId) {
return sysPointRouterMapper.deleteSysPointRouterByPointRouterId(pointRouterId);
}
}

@ -0,0 +1,118 @@
<?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.hw.system.common.mapper.SysPointRouterMapper">
<resultMap type="SysPointRouter" id="SysPointRouterResult">
<result property="pointRouterId" column="point_router_id"/>
<result property="moduleCode" column="module_code"/>
<result property="pointType" column="point_type"/>
<result property="routerAddress" column="router_address"/>
<result property="routerAddressDetail" column="router_address_detail"/>
<result property="routerFlag" column="router_flag"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectSysPointRouterVo">
select point_router_id,
module_code,
point_type,
router_address,
router_address_detail,
router_flag,
remark,
create_by,
create_time,
update_by,
update_time
from sys_point_router
</sql>
<select id="selectSysPointRouterList" parameterType="SysPointRouter" resultMap="SysPointRouterResult">
<include refid="selectSysPointRouterVo"/>
<where>
<if test="moduleCode != null and moduleCode != ''">and module_code = #{moduleCode}</if>
<if test="pointType != null and pointType != ''">and point_type = #{pointType}</if>
<if test="routerAddress != null and routerAddress != ''">and router_address = #{routerAddress}</if>
<if test="routerAddressDetail != null and routerAddressDetail != ''">and router_address_detail =
#{routerAddressDetail}
</if>
<if test="routerFlag != null and routerFlag != ''">and router_flag = #{routerFlag}</if>
<if test="params.begincreateTime != null and params.begincreateTime != '' and params.endcreateTime != null and params.endcreateTime != ''">
and create_time between #{params.begincreateTime} and #{params.endcreateTime}
</if>
<if test="params.beginupdateTime != null and params.beginupdateTime != '' and params.endupdateTime != null and params.endupdateTime != ''">
and update_time between #{params.beginupdateTime} and #{params.endupdateTime}
</if>
</where>
</select>
<select id="selectSysPointRouterByPointRouterId" parameterType="Long" resultMap="SysPointRouterResult">
<include refid="selectSysPointRouterVo"/>
where point_router_id = #{pointRouterId}
</select>
<insert id="insertSysPointRouter" parameterType="SysPointRouter" useGeneratedKeys="true"
keyProperty="pointRouterId">
insert into sys_point_router
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="moduleCode != null and moduleCode != ''">module_code,</if>
<if test="pointType != null and pointType != ''">point_type,</if>
<if test="routerAddress != null and routerAddress != ''">router_address,</if>
<if test="routerAddressDetail != null">router_address_detail,</if>
<if test="routerFlag != null">router_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="moduleCode != null and moduleCode != ''">#{moduleCode},</if>
<if test="pointType != null and pointType != ''">#{pointType},</if>
<if test="routerAddress != null and routerAddress != ''">#{routerAddress},</if>
<if test="routerAddressDetail != null">#{routerAddressDetail},</if>
<if test="routerFlag != null">#{routerFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSysPointRouter" parameterType="SysPointRouter">
update sys_point_router
<trim prefix="SET" suffixOverrides=",">
<if test="moduleCode != null and moduleCode != ''">module_code = #{moduleCode},</if>
<if test="pointType != null and pointType != ''">point_type = #{pointType},</if>
<if test="routerAddress != null and routerAddress != ''">router_address = #{routerAddress},</if>
<if test="routerAddressDetail != null">router_address_detail = #{routerAddressDetail},</if>
<if test="routerFlag != null">router_flag = #{routerFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where point_router_id = #{pointRouterId}
</update>
<delete id="deleteSysPointRouterByPointRouterId" parameterType="Long">
delete
from sys_point_router
where point_router_id = #{pointRouterId}
</delete>
<delete id="deleteSysPointRouterByPointRouterIds" parameterType="String">
delete from sys_point_router where point_router_id in
<foreach item="pointRouterId" collection="array" open="(" separator="," close=")">
#{pointRouterId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询提示路由信息列表
export function listPointRouter(query) {
return request({
url: '/system/pointRouter/list',
method: 'get',
params: query
})
}
// 查询提示路由信息详细
export function getPointRouter(pointRouterId) {
return request({
url: '/system/pointRouter/' + pointRouterId,
method: 'get'
})
}
// 新增提示路由信息
export function addPointRouter(data) {
return request({
url: '/system/pointRouter',
method: 'post',
data: data
})
}
// 修改提示路由信息
export function updatePointRouter(data) {
return request({
url: '/system/pointRouter',
method: 'put',
data: data
})
}
// 删除提示路由信息
export function delPointRouter(pointRouterId) {
return request({
url: '/system/pointRouter/' + pointRouterId,
method: 'delete'
})
}

@ -9,25 +9,25 @@
<template v-if="device!=='mobile'"> <template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" /> <search id="header-search" class="right-menu-item" />
<el-tooltip content="源码地址" effect="dark" placement="bottom"> <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">-->
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" /> <!-- <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />-->
</el-tooltip> <!-- </el-tooltip>-->
<el-tooltip content="文档地址" effect="dark" placement="bottom"> <!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">-->
<ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" /> <!-- <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />-->
</el-tooltip> <!-- </el-tooltip>-->
<screenfull id="screenfull" class="right-menu-item hover-effect" /> <el-tooltip content="异常处理" class="right-menu-item hover-effect" >
<el-tooltip content="异常处理">
<span <span
class="exceptionHandling" class="exceptionHandling"
:class="{ warnTxt: (typeList && typeList.length) || 0 }" :class="{ warnTxt: (pointRouterList && pointRouterList.length) || 0 }"
@click="getAlarmData(true)" @click="getAlarmData(true)"
><i class="el-icon-message"></i>{{ ><i class="el-icon-message"></i>{{
(typeList && typeList.length > 0 && typeList.length) || "" (pointRouterList && pointRouterList.length > 0 && pointRouterList.length) || ""
}} }}
</span> </span>
</el-tooltip> </el-tooltip>
<screenfull id="screenfull" class="right-menu-item hover-effect" />
<el-tooltip content="布局大小" effect="dark" placement="bottom"> <el-tooltip content="布局大小" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" /> <size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> </el-tooltip>
@ -54,57 +54,55 @@
</div> </div>
<!-- 警告对话框 --> <!-- 警告对话框 -->
<el-dialog <el-dialog
:title="title1" :title="alarmTitle"
:visible.sync="open1" :visible.sync="alarmOpen"
width="800px" width="800px"
append-to-body append-to-body
> >
<el-table <el-table
v-loading="deviceloading" v-loading="alarmLoading"
:data="typeList" :data="pointRouterList"
@selection-change="handleSelectionChange1" @selection-change="handleSelectionChangeAlarm"
> >
<el-table-column type="selection" width="55" align="center" /> <!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column <el-table-column label="功能模块" align="center" prop="moduleCode" >
label="计量设备名称" <template slot-scope="scope">
align="center" <dict-tag :options="dict.type.module_code" :value="scope.row.moduleCode"/>
prop="monitorName" </template>
/> </el-table-column>
<el-table-column <el-table-column label="提示类型" align="center" prop="pointType" >
label="采集设备编号" <template slot-scope="scope">
align="center" <dict-tag :options="dict.type.point_type" :value="scope.row.pointType"/>
prop="collectDeviceId" </template>
/> </el-table-column>
<el-table-column label="记录时间" align="center" prop="collectTime" /> <el-table-column label="提示信息" align="center" prop="remark" />
<el-table-column label="异常类型" align="center" prop="alarmType"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
:options="dict.type.alarm_type"
:value="scope.row.alarmType"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="异常状态" align="center" prop="alarmStatus"> <el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <el-button
:options="dict.type.alarmStatus" icon="el-icon-d-arrow-right"
:value="scope.row.alarmStatus" size="small"
/> type="Info"
@click="jumpProcessing(scope.row)"
>跳转
</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="异常数据" align="center" prop="alarmData" />
<el-table-column label="备注" align="center" prop="cause" />
</el-table> </el-table>
<!-- <pagination <pagination
v-show="devicetotal > 0" v-show="pointRouterTotal > 0"
:total="devicetotal" :total="pointRouterTotal"
:page.sync="queryParams1.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams1.pageSize" :limit.sync="queryParams.pageNum"
@pagination="getDeviceList" @pagination="getPointRouterList"
/> --> />
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="editAlarmStatus"> </el-button> <!-- <el-button type="primary" @click="editAlarmStatus"> </el-button>-->
<el-button @click="open1 = false"> </el-button> <el-button @click="alarmOpen = false"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -120,41 +118,40 @@ import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch' import Search from '@/components/HeaderSearch'
import RuoYiGit from '@/components/RuoYi/Git' import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc' import RuoYiDoc from '@/components/RuoYi/Doc'
import { listData, editAlarmStatus } from "@/api/ems/base/exception/data.js"; import {listPointRouter, updatePointRouter} from "@//api/system/common/pointRouter";
import { changePoolName } from "@/api/system/user"; import router from "@//router";
export default { export default {
dicts: ["alarm_type", "alarmStatus"], dicts: ['point_type', 'router_flag', 'module_code'],
data() { data() {
return { return {
poolNameList: [], poolNameList: [],
poolName: "", poolName: "",
title1: "异常处理", alarmTitle: "异常处理",
open1: false, alarmOpen: false,
deviceloading: false, alarmLoading: false,
typeList: null, pointRouterList: [],
devicetotal: null, pointRouterTotal: 0,
// //
ids1: [], routerIds: [],
// //
single1: true, single: true,
// //
multiple1: true, multiple: true,
//
queryParams: {
pageNum: 1,
pageSize: 10,
routerFlag: '0',
},
}; };
}, },
created() { created() {
localStorage.setItem("this.devicetotal", 0); localStorage.setItem("this.pointRouterTotal", 0);
}, },
mounted() { mounted() {
// this.getAlarmData(); //
this.getAlarmData();
// setInterval(() => this.getAlarmData(), 1000 * 60); // setInterval(() => this.getAlarmData(), 1000 * 60);
// this.poolNameList = JSON.parse(localStorage.getItem("POOL_NAME_LIST"));
// this.poolName = localStorage.getItem("USER_POOL_NAME_CURRENT");
// if(this.$route.query.id) {
// changePoolName(this.$route.query.id).then((res) => {
// localStorage.setItem("USER_POOL_NAME_CURRENT", this.$route.query.id);
// this.poolName = this.$route.query.id;
// });
// }
}, },
components: { components: {
Breadcrumb, Breadcrumb,
@ -208,36 +205,52 @@ export default {
), ),
}); });
}, },
// /** 跳转处理 */
editAlarmStatus() { jumpProcessing(row) {
editAlarmStatus({ objIds: this.ids1 }).then((res) => { let params = {};
this.$message({ if (row.routerAddressDetail != null){
type: "success", params = JSON.parse(row.routerAddressDetail)
message: "异常数据已处理!",
duration: 1500, }
}); updatePointRouter({pointRouterId: row.pointRouterId, routerFlag: '1'}).then(response => {
this.getAlarmData(); this.$tab.openPage(row.moduleCode + this.selectDictLabel(this.dict.type.point_type, row.pointType),
row.routerAddress, params);
this.alarmOpen = false;
}); });
}, },
//
// editAlarmStatus() {
// editAlarmStatus({ objIds: this.routerIds }).then((res) => {
// this.$message({
// type: "success",
// message: "",
// duration: 1500,
// });
// this.getAlarmData();
// });
// },
/** 报警列表 */ /** 报警列表 */
getAlarmData(open) { getAlarmData(open) {
this.open1 = open; this.alarmOpen = open;
this.deviceloading = true; this.alarmLoading = true;
listData({ alarmStatus: 1 }).then((response) => { this.getPointRouterList();
this.typeList = response.rows; },
this.devicetotal = response.total; getPointRouterList() {
this.deviceloading = false; listPointRouter(this.queryParams).then((response) => {
if (localStorage.getItem("this.devicetotal") != this.devicetotal) { this.pointRouterList = response.rows;
localStorage.setItem("this.devicetotal", this.devicetotal); this.pointRouterTotal = response.total;
this.openAlarm(); this.alarmLoading = false;
} // if (localStorage.getItem("this.pointRouterTotal") != this.pointRouterTotal) {
// localStorage.setItem("this.pointRouterTotal", this.pointRouterTotal);
// this.openAlarm();
// }
}); });
}, },
// //
handleSelectionChange1(selection) { handleSelectionChangeAlarm(selection) {
this.ids1 = selection.map((item) => item.objId); this.routerIds = selection.map((item) => item.pointRouterId);
this.single1 = selection.length !== 1; this.single = selection.length !== 1;
this.multiple1 = !selection.length; this.multiple = !selection.length;
}, },
toggleSideBar() { toggleSideBar() {
this.$store.dispatch('app/toggleSideBar') this.$store.dispatch('app/toggleSideBar')

@ -0,0 +1,436 @@
<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="moduleCode">
<el-select v-model="queryParams.moduleCode" placeholder="请选择功能模块" clearable>
<el-option
v-for="dict in dict.type.module_code"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="提示类型" prop="pointType">
<el-select v-model="queryParams.pointType" placeholder="请选择提示类型" clearable>
<el-option
v-for="dict in dict.type.point_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="路由地址" prop="routerAddress">-->
<!-- <el-input-->
<!-- v-model="queryParams.routerAddress"-->
<!-- placeholder="请输入路由地址"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="路由地址详情" prop="routerAddressDetail">-->
<!-- <el-input-->
<!-- v-model="queryParams.routerAddressDetail"-->
<!-- placeholder="请输入路由地址详情"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="跳转标识" prop="routerFlag">
<el-select v-model="queryParams.routerFlag" placeholder="请选择跳转标识" clearable>
<el-option
v-for="dict in dict.type.router_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="daterangecreateTime"
style="width: 340px"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<!-- <el-form-item label="更新时间">-->
<!-- <el-date-picker-->
<!-- v-model="daterangeupdateTime"-->
<!-- style="width: 240px"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="-"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:pointRouter:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:pointRouter:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:pointRouter:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:pointRouter:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="pointRouterList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="提示路由ID" align="center" prop="pointRouterId" v-if="columns[0].visible"/>
<el-table-column label="功能模块" align="center" prop="moduleCode" v-if="columns[1].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.module_code" :value="scope.row.moduleCode"/>
</template>
</el-table-column>
<el-table-column label="提示类型" align="center" prop="pointType" v-if="columns[2].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.point_type" :value="scope.row.pointType"/>
</template>
</el-table-column>
<el-table-column label="路由地址" align="center" prop="routerAddress" v-if="columns[3].visible"/>
<el-table-column label="路由地址详情" align="center" prop="routerAddressDetail" v-if="columns[4].visible"/>
<el-table-column label="跳转标识" align="center" prop="routerFlag" v-if="columns[5].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.router_flag" :value="scope.row.routerFlag"/>
</template>
</el-table-column>
<el-table-column label="提示信息" align="center" prop="remark" v-if="columns[6].visible"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180" v-if="columns[8].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" v-if="columns[10].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:pointRouter:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:pointRouter:remove']"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改提示路由信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="功能模块" prop="moduleCode">
<el-select v-model="form.moduleCode" placeholder="请选择功能模块">
<el-option
v-for="dict in dict.type.module_code"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="提示类型" prop="pointType">
<el-radio-group v-model="form.pointType">
<el-radio
v-for="dict in dict.type.point_type"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="路由地址" prop="routerAddress">
<el-input v-model="form.routerAddress" placeholder="请输入路由地址"/>
</el-form-item>
<el-form-item label="路由地址详情" prop="routerAddressDetail">
<el-input v-model="form.routerAddressDetail" placeholder="请输入路由地址详情"/>
</el-form-item>
<!-- <el-form-item label="跳转标识" prop="routerFlag">-->
<!-- <el-radio-group v-model="form.routerFlag">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.router_flag"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{ dict.label }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label="提示信息" prop="remark">
<el-input v-model="form.remark" type="textarea" 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 {
listPointRouter,
getPointRouter,
delPointRouter,
addPointRouter,
updatePointRouter
} from "@/api/system/common/pointRouter";
export default {
name: "PointRouter",
dicts: ['point_type', 'router_flag', 'module_code'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
pointRouterList: [],
//
title: "",
//
open: false,
//
daterangecreateTime: [],
//
daterangeupdateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
moduleCode: null,
pointType: null,
routerAddress: null,
routerAddressDetail: null,
routerFlag: '0',
createTime: null,
updateTime: null
},
//
form: {},
//
rules: {
moduleCode: [
{required: true, message: "功能模块不能为空", trigger: "change"}
],
pointType: [
{required: true, message: "提示类型不能为空", trigger: "change"}
],
routerAddress: [
{required: true, message: "路由地址不能为空", trigger: "blur"}
],
},
columns: [
{key: 0, label: `提示路由ID`, visible: false},
{key: 1, label: `功能模块`, visible: true},
{key: 2, label: `提示类型`, visible: true},
{key: 3, label: `路由地址`, visible: true},
{key: 4, label: `路由地址详情`, visible: true},
{key: 5, label: `跳转标识`, visible: true},
{key: 6, label: `提示信息`, visible: false},
{key: 7, label: `创建人`, visible: false},
{key: 8, label: `创建时间`, visible: true},
{key: 9, label: `更新人`, visible: false},
{key: 10, label: `更新时间`, visible: false},
],
};
},
created() {
console.log('url参数',this.$route.query)
this.getList();
},
methods: {
/** 查询提示路由信息列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangecreateTime && '' != this.daterangecreateTime) {
this.queryParams.params["begincreateTime"] = this.daterangecreateTime[0];
this.queryParams.params["endcreateTime"] = this.daterangecreateTime[1];
}
if (null != this.daterangeupdateTime && '' != this.daterangeupdateTime) {
this.queryParams.params["beginupdateTime"] = this.daterangeupdateTime[0];
this.queryParams.params["endupdateTime"] = this.daterangeupdateTime[1];
}
listPointRouter(this.queryParams).then(response => {
this.pointRouterList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
pointRouterId: null,
moduleCode: null,
pointType: '1',
routerAddress: null,
routerAddressDetail: null,
routerFlag: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangecreateTime = [];
this.daterangeupdateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.pointRouterId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加提示路由信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const pointRouterId = row.pointRouterId || this.ids
getPointRouter(pointRouterId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改提示路由信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.pointRouterId != null) {
updatePointRouter(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.form.routerFlag = '0'
addPointRouter(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const pointRouterIds = row.pointRouterId || this.ids;
this.$modal.confirm('是否确认删除提示路由信息编号为"' + pointRouterIds + '"的数据项?').then(function () {
return delPointRouter(pointRouterIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/pointRouter/export', {
...this.queryParams
}, `pointRouter_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save