提交代码
parent
c7c3ae6fc5
commit
094cf572e2
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.device.domain;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
|
@ -305,4 +306,22 @@ public class PitmonitSouthsmosData extends BaseEntity
|
|||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
||||
public void convertToHorizontal(JSONObject o) {
|
||||
changeRate=o.getBigDecimal("changeRateX");
|
||||
changeRate2=o.getBigDecimal("changeRateY");
|
||||
displace=o.getBigDecimal("displaceX");
|
||||
displace2=o.getBigDecimal("displaceY");
|
||||
totalize=o.getBigDecimal("totalizeX");
|
||||
totalize2=o.getBigDecimal("totalizeY");
|
||||
variation=o.getBigDecimal("variationX");
|
||||
variation2=o.getBigDecimal("variationY");
|
||||
}
|
||||
|
||||
//围护墙侧向土压力
|
||||
public void convertToPresureWallsideSoil(JSONObject jsonObject) {
|
||||
}
|
||||
//地下水位
|
||||
public void convertToWaterLevel(JSONObject jsonObject) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.yanzhu.common.core.web.domain.BaseEntity;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -128,6 +129,16 @@ public class PitmonitSouthsmosDevice extends BaseEntity
|
|||
private String prjName;
|
||||
private String deptName;
|
||||
|
||||
private List<PitmonitSouthsmosDevSp> spDevices=new ArrayList<>();
|
||||
|
||||
public List<PitmonitSouthsmosDevSp> getSpDevices() {
|
||||
return spDevices;
|
||||
}
|
||||
|
||||
public void setSpDevices(List<PitmonitSouthsmosDevSp> spDevices) {
|
||||
this.spDevices = spDevices;
|
||||
}
|
||||
|
||||
private List<PitmonitSouthsmosSurveypoint> surveypoints;
|
||||
|
||||
public List<PitmonitSouthsmosSurveypoint> getSurveypoints() {
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.yanzhu.common.core.web.domain.BaseEntity;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -151,13 +152,23 @@ public class PitmonitSouthsmosElement extends BaseEntity
|
|||
private String prjName;
|
||||
private String deptName;
|
||||
|
||||
private List<com.yanzhu.device.domain.PitmonitSouthsmosElementItem> children;
|
||||
private List<PitmonitSouthsmosElementItem> items=new ArrayList<>();
|
||||
|
||||
public List<com.yanzhu.device.domain.PitmonitSouthsmosElementItem> getChildren() {
|
||||
public List<PitmonitSouthsmosElementItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<PitmonitSouthsmosElementItem> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
private List<PitmonitSouthsmosElementItem> children;
|
||||
|
||||
public List<PitmonitSouthsmosElementItem> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<com.yanzhu.device.domain.PitmonitSouthsmosElementItem> children) {
|
||||
public void setChildren(List<PitmonitSouthsmosElementItem> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,14 @@ public interface PitmonitSouthsmosAlarmMapper
|
|||
*/
|
||||
public PitmonitSouthsmosAlarm selectDevPitmonitSouthsmosAlarmById(Long id);
|
||||
|
||||
/**
|
||||
* 查询报警信息
|
||||
*
|
||||
* @param id 报警信息主键
|
||||
* @return 报警信息
|
||||
*/
|
||||
public PitmonitSouthsmosAlarm selectDevPitmonitSouthsmosAlarmBySrvId(Long id);
|
||||
|
||||
/**
|
||||
* 查询报警信息列表
|
||||
*
|
||||
|
|
|
@ -21,6 +21,14 @@ public interface PitmonitSouthsmosDataMapper
|
|||
*/
|
||||
public PitmonitSouthsmosData selectDevPitmonitSouthsmosDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询测点数据
|
||||
*
|
||||
* @param dataId 测点数据主键
|
||||
* @return 测点数据
|
||||
*/
|
||||
public PitmonitSouthsmosData selectDevPitmonitSouthsmosAlarmByDataId(Long dataId);
|
||||
|
||||
/**
|
||||
* 查询测点数据列表
|
||||
*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.yanzhu.device.mapper;
|
||||
|
||||
import com.yanzhu.device.domain.PitmonitSouthsmosDevSp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,6 +21,15 @@ public interface PitmonitSouthsmosDevSpMapper
|
|||
*/
|
||||
public PitmonitSouthsmosDevSp selectDevPitmonitSouthsmosDevSpById(Long id);
|
||||
|
||||
/**
|
||||
* 查询设测点关系
|
||||
*
|
||||
* @param devId 设测点关系主键
|
||||
* @param spId 设测点关系主键
|
||||
* @return 设测点关系
|
||||
*/
|
||||
public PitmonitSouthsmosDevSp selectDevPitmonitSouthsmosDevSpByParams(@Param("devId") Long devId, @Param("devId") Long spId);
|
||||
|
||||
/**
|
||||
* 查询设测点关系列表
|
||||
*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.yanzhu.device.mapper;
|
||||
|
||||
import com.yanzhu.device.domain.PitmonitSouthsmosDevice;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,6 +21,15 @@ public interface PitmonitSouthsmosDeviceMapper
|
|||
*/
|
||||
public PitmonitSouthsmosDevice selectDevPitmonitSouthsmosDeviceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询设备管理
|
||||
*
|
||||
* @param cfgId 设备管理主键
|
||||
* @param devId 设备管理主键
|
||||
* @return 设备管理
|
||||
*/
|
||||
public PitmonitSouthsmosDevice selectDevPitmonitSouthsmosDeviceByParams(@Param("cfgId") Long cfgId, @Param("devId") Long devId);
|
||||
|
||||
/**
|
||||
* 查询设备管理列表
|
||||
*
|
||||
|
|
|
@ -20,6 +20,14 @@ public interface PitmonitSouthsmosElementItemMapper
|
|||
*/
|
||||
public PitmonitSouthsmosElementItem selectDevPitmonitSouthsmosElementItemById(Long id);
|
||||
|
||||
/**
|
||||
* 查询测项明细
|
||||
*
|
||||
* @param srvId 测项明细主键
|
||||
* @return 测项明细
|
||||
*/
|
||||
public PitmonitSouthsmosElementItem selectDevPitmonitSouthsmosElementItemBySrvId(Long srvId);
|
||||
|
||||
/**
|
||||
* 查询测项明细列表
|
||||
*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.yanzhu.device.mapper;
|
||||
|
||||
import com.yanzhu.device.domain.PitmonitSouthsmosElement;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,6 +21,14 @@ public interface PitmonitSouthsmosElementMapper
|
|||
*/
|
||||
public PitmonitSouthsmosElement selectDevPitmonitSouthsmosElementById(Long id);
|
||||
|
||||
/**
|
||||
* 查询监测项管理
|
||||
*
|
||||
* @param cfgId 监测项管理主键
|
||||
* @return 监测项管理
|
||||
*/
|
||||
public PitmonitSouthsmosElement selectDevPitmonitSouthsmosElementByParams(@Param("cfgId") Long cfgId, @Param("srvId") Long srvId);
|
||||
|
||||
/**
|
||||
* 查询监测项管理列表
|
||||
*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.yanzhu.device.mapper;
|
||||
|
||||
import com.yanzhu.device.domain.PitmonitSouthsmosSurveypoint;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,6 +21,15 @@ public interface PitmonitSouthsmosSurveypointMapper
|
|||
*/
|
||||
public PitmonitSouthsmosSurveypoint selectDevPitmonitSouthsmosSurveypointById(Long id);
|
||||
|
||||
/**
|
||||
* 查询测点管理
|
||||
*
|
||||
* @param cfgId 测点管理主键
|
||||
* @param spId 测点管理主键
|
||||
* @return 测点管理
|
||||
*/
|
||||
public PitmonitSouthsmosSurveypoint selectDevPitmonitSouthsmosSurveypointByParams(@Param("cfgId") Long cfgId, @Param("spId") Long spId);
|
||||
|
||||
/**
|
||||
* 查询测点管理列表
|
||||
*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.yanzhu.device.mapper;
|
||||
|
||||
import com.yanzhu.device.domain.PitmonitSouthsmosThreshold;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,6 +21,15 @@ public interface PitmonitSouthsmosThresholdMapper
|
|||
*/
|
||||
public PitmonitSouthsmosThreshold selectDevPitmonitSouthsmosThresholdById(Long id);
|
||||
|
||||
/**
|
||||
* 查询报警阈值
|
||||
*
|
||||
* @param cfgId 报警阈值主键
|
||||
* @param srvId 报警阈值主键
|
||||
* @return 报警阈值
|
||||
*/
|
||||
public PitmonitSouthsmosThreshold selectDevPitmonitSouthsmosThresholdByParams(@Param("cfgId") Long cfgId, @Param("srvId") Long srvId);
|
||||
|
||||
/**
|
||||
* 查询报警阈值列表
|
||||
*
|
||||
|
|
|
@ -92,6 +92,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDevPitmonitSouthsmosAlarmVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosAlarmBySrvId" parameterType="Long" resultMap="PitmonitSouthsmosAlarmResult">
|
||||
<include refid="selectDevPitmonitSouthsmosAlarmVo"/>
|
||||
where srvId = #{srvId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevPitmonitSouthsmosAlarm" parameterType="PitmonitSouthsmosAlarm" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_pitmonit_southsmos_alarm
|
||||
|
|
|
@ -70,6 +70,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDevPitmonitSouthsmosDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosAlarmByDataId" parameterType="Long" resultMap="PitmonitSouthsmosDataResult">
|
||||
<include refid="selectDevPitmonitSouthsmosDataVo"/>
|
||||
where dataId = #{dataId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevPitmonitSouthsmosData" parameterType="PitmonitSouthsmosData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_pitmonit_southsmos_data
|
||||
|
|
|
@ -37,7 +37,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDevPitmonitSouthsmosDevSpVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosDevSpByParams" parameterType="Long" resultMap="PitmonitSouthsmosDevSpResult">
|
||||
<include refid="selectDevPitmonitSouthsmosDevSpVo"/>
|
||||
where devId = #{devId} and spId = #{spId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevPitmonitSouthsmosDevSp" parameterType="PitmonitSouthsmosDevSp" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_pitmonit_southsmos_dev_sp
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -97,7 +97,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDevPitmonitSouthsmosDeviceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosDeviceByParams" parameterType="Long" resultMap="PitmonitSouthsmosDeviceResult">
|
||||
<include refid="selectDevPitmonitSouthsmosDeviceVo"/>
|
||||
where cfgId = #{cfgId} and devId = #{devId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevPitmonitSouthsmosDevice" parameterType="PitmonitSouthsmosDevice" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_pitmonit_southsmos_device
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -49,7 +49,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDevPitmonitSouthsmosElementItemVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosElementItemBySrvId" parameterType="Long" resultMap="PitmonitSouthsmosElementItemResult">
|
||||
<include refid="selectDevPitmonitSouthsmosElementItemVo"/>
|
||||
where srvId = #{srvId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevPitmonitSouthsmosElementItem" parameterType="PitmonitSouthsmosElementItem" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_pitmonit_southsmos_element_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -65,7 +65,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDevPitmonitSouthsmosElementVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosElementByParams" parameterType="Long" resultMap="PitmonitSouthsmosElementResult">
|
||||
SELECT a.*,c.unitName AS deptName,b.project_id AS projectId,p.projectName prjName,c.unitName AS deptName,b.sub_dept_id subDeptId,
|
||||
it.id itemId,it.name itemName,it.step itemStep,it.unit itemUnit,it.valueRange itemValueRange,it.gmtCreate itemGmtCreate,it.gmtModified itemGmtModified
|
||||
FROM dev_pitmonit_southsmos_element a
|
||||
JOIN sur_project_pit_monit_cfg b ON a.cfgId = b.id
|
||||
JOIN sur_project p ON b.project_id =p.id
|
||||
JOIN sur_project_unit_info c ON b.sub_dept_id = c.unitId AND b.project_id = c.projectId
|
||||
JOIN dev_pitmonit_southsmos_element_item it ON a.srvId=monitorElementId AND it.is_del=0
|
||||
where a.cfgId = #{cfgId} and a.srvId = #{srvId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevPitmonitSouthsmosElement" parameterType="PitmonitSouthsmosElement" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_pitmonit_southsmos_element
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -64,7 +64,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDevPitmonitSouthsmosSurveypointVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosSurveypointByParams" parameterType="Long" resultMap="PitmonitSouthsmosSurveypointResult">
|
||||
<include refid="selectDevPitmonitSouthsmosSurveypointVo"/>
|
||||
where cfgId = #{cfgId} and spId = #{spId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevPitmonitSouthsmosSurveypoint" parameterType="PitmonitSouthsmosSurveypoint" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_pitmonit_southsmos_surveypoint
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -69,7 +69,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDevPitmonitSouthsmosThresholdVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosThresholdByParams" parameterType="Long" resultMap="PitmonitSouthsmosThresholdResult">
|
||||
<include refid="selectDevPitmonitSouthsmosThresholdVo"/>
|
||||
where cfgId = #{cfgId} and srvId = #{srvId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevPitmonitSouthsmosThreshold" parameterType="PitmonitSouthsmosThreshold" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_pitmonit_southsmos_threshold
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -23,15 +23,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectPitMonitCfgVo">
|
||||
|
||||
select id, project_id, sub_dept_id, vendor_code, vendor_paramter, enabled, state, remark, is_del, create_by, create_time, update_by, update_time,projectName,deptName
|
||||
from (
|
||||
|
||||
select a.*,p.projectName,b.unitName as deptName
|
||||
from sur_project_pit_monit_cfg a
|
||||
JOIN sur_project p on a.project_id =p.id
|
||||
join sur_project_unit_info b on a.sub_dept_id=b.unitId and a.project_id=b.projectId ) sur_project_pit_monit_cfg
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectPitMonitCfgList" parameterType="ProjectPitMonitCfg" resultMap="ProjectPitMonitCfgResult">
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- YanZhu Common Swagger -->
|
||||
<!-- YanZhu Common Mapper -->
|
||||
<dependency>
|
||||
<groupId>com.yanzhu</groupId>
|
||||
<artifactId>yanzhu-common-mapper</artifactId>
|
||||
|
|
|
@ -78,6 +78,14 @@
|
|||
<artifactId>yanzhu-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- YanZhu Common Mapper -->
|
||||
<dependency>
|
||||
<groupId>com.yanzhu</groupId>
|
||||
<artifactId>yanzhu-common-mapper</artifactId>
|
||||
<version>3.6.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-http</artifactId>
|
||||
|
|
|
@ -0,0 +1,451 @@
|
|||
package com.yanzhu.job.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.device.domain.*;
|
||||
import com.yanzhu.device.mapper.*;
|
||||
import okhttp3.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
@Component("pitmonitSouthsmosTask")
|
||||
|
||||
public class PitmonitSouthsmosTask {
|
||||
|
||||
@Autowired
|
||||
private ProjectPitMonitCfgMapper cfgService;
|
||||
|
||||
@Autowired
|
||||
private PitmonitSouthsmosAlarmMapper alarmService;
|
||||
|
||||
@Autowired
|
||||
private PitmonitSouthsmosDataMapper dataService;
|
||||
|
||||
@Autowired
|
||||
private PitmonitSouthsmosElementMapper elementService;
|
||||
|
||||
@Autowired
|
||||
private PitmonitSouthsmosElementItemMapper elementItemService;
|
||||
|
||||
@Autowired
|
||||
private PitmonitSouthsmosSurveypointMapper surveypointService;
|
||||
|
||||
@Autowired
|
||||
private PitmonitSouthsmosThresholdMapper thresholdService;
|
||||
|
||||
@Autowired
|
||||
private PitmonitSouthsmosDeviceMapper deviceService;
|
||||
|
||||
@Autowired
|
||||
private PitmonitSouthsmosDevSpMapper devspService;
|
||||
|
||||
static String APIBASEURL="https://www.southsmos.com/api/";
|
||||
|
||||
/**
|
||||
* 同步基本信息
|
||||
* 4.获取监测项列表
|
||||
* 5.获取测点列表
|
||||
* 7.获取报警阈值
|
||||
* 9.获取设备
|
||||
*/
|
||||
public void syncBaseInfo() {
|
||||
ProjectPitMonitCfg cfgWhere=new ProjectPitMonitCfg();
|
||||
cfgWhere.setEnabled(1l);
|
||||
cfgWhere.setIsDel(0l);
|
||||
List<ProjectPitMonitCfg> cfgList= cfgService.selectSurProjectPitMonitCfgList(cfgWhere);
|
||||
cfgList.forEach(cfg->{
|
||||
JSONObject jo=JSON.parseObject(cfg.getVendorParamter());
|
||||
String identifier=jo.getString("identifier");
|
||||
String credential=jo.getString("credential");
|
||||
String orgId=jo.getString("orgId");
|
||||
String token=getToken(identifier,credential);
|
||||
//4.获取监测项列表
|
||||
List<PitmonitSouthsmosElement> elList=getMonitorElement(token,orgId);
|
||||
elList.forEach(el->{
|
||||
el.setCfgId(cfg.getId());
|
||||
PitmonitSouthsmosElement old=elementService.selectDevPitmonitSouthsmosElementByParams(el.getCfgId(),el.getSrvId());
|
||||
if(old==null){
|
||||
elementService.insertDevPitmonitSouthsmosElement(el);
|
||||
}
|
||||
if(el.getItems()!=null){
|
||||
el.getItems().forEach(item->{
|
||||
item.setCfgId(cfg.getId());
|
||||
elementItemService.insertDevPitmonitSouthsmosElementItem(item);
|
||||
});
|
||||
}
|
||||
});
|
||||
//5.获取测点列表
|
||||
List<PitmonitSouthsmosSurveypoint> ptList=getSurveyPoint(token,orgId);
|
||||
ptList.forEach(pt->{
|
||||
pt.setCfgId(cfg.getId());
|
||||
PitmonitSouthsmosSurveypoint old=surveypointService.selectDevPitmonitSouthsmosSurveypointByParams(pt.getCfgId(),pt.getSpId());
|
||||
if(old==null){
|
||||
surveypointService.insertDevPitmonitSouthsmosSurveypoint(pt);
|
||||
}
|
||||
});
|
||||
//7.获取报警阈值
|
||||
PitmonitSouthsmosSurveypoint ptWhere=new PitmonitSouthsmosSurveypoint();
|
||||
ptWhere.setCfgId(cfg.getId());
|
||||
ptWhere.setIsDel(0l);
|
||||
ptList=surveypointService.selectDevPitmonitSouthsmosSurveypointList(ptWhere);
|
||||
ptList.forEach(d->{
|
||||
List<PitmonitSouthsmosThreshold> thList=getThreshold(""+d.getSpId(),token);
|
||||
thList.forEach(th->{
|
||||
th.setCfgId(cfg.getId());
|
||||
PitmonitSouthsmosThreshold old=thresholdService.selectDevPitmonitSouthsmosThresholdByParams(th.getCfgId(),th.getSrvId());
|
||||
if(old==null){
|
||||
thresholdService.insertDevPitmonitSouthsmosThreshold(th);
|
||||
}
|
||||
});
|
||||
});
|
||||
//9.获取设备
|
||||
List<PitmonitSouthsmosDevice> devList=getDevices(token,orgId);
|
||||
devList.forEach(it->{
|
||||
it.setCfgId(cfg.getId());
|
||||
PitmonitSouthsmosDevice old=deviceService.selectDevPitmonitSouthsmosDeviceByParams(it.getCfgId(),it.getDevId());
|
||||
if(old==null) {
|
||||
deviceService.insertDevPitmonitSouthsmosDevice(it);
|
||||
}
|
||||
it.getSpDevices().forEach(item->{
|
||||
item.setCfgId(cfg.getId());
|
||||
PitmonitSouthsmosDevSp oldItem = devspService.selectDevPitmonitSouthsmosDevSpByParams(item.getDevId(),item.getSpId());
|
||||
if(oldItem==null){
|
||||
devspService.insertDevPitmonitSouthsmosDevSp(item);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当天数据
|
||||
* 6.获取测点数据
|
||||
* 8.获取报警信息
|
||||
*/
|
||||
public void syncTodayData(){
|
||||
doGetData(new Date());
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步最近7天数据
|
||||
* 6.获取测点数据
|
||||
* 8.获取报警信息
|
||||
*/
|
||||
public void sync7DayData(){
|
||||
long endTime=DateUtil.current();
|
||||
Date dt = DateUtil.date(endTime - 3600l * 1000 * 24 * 7);
|
||||
doGetData(dt);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步从2023-01-01开始的所有数据
|
||||
* 6.获取测点数据
|
||||
* 8.获取报警信息
|
||||
*/
|
||||
public void syncAllData(){
|
||||
doGetData(DateUtil.parse("2023-01-01"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步数据
|
||||
* 6.获取测点数据
|
||||
* 8.获取报警信息
|
||||
*/
|
||||
private void doGetData(Date date) {
|
||||
ProjectPitMonitCfg cfgWhere=new ProjectPitMonitCfg();
|
||||
cfgWhere.setEnabled(1l);
|
||||
cfgWhere.setIsDel(0l);
|
||||
List<ProjectPitMonitCfg> cfgList= cfgService.selectSurProjectPitMonitCfgList(cfgWhere);
|
||||
cfgList.forEach(cfg->{
|
||||
JSONObject jo=JSON.parseObject(cfg.getVendorParamter());
|
||||
String identifier=jo.getString("identifier");
|
||||
String credential=jo.getString("credential");
|
||||
String orgId=jo.getString("orgId");
|
||||
String token=getToken(identifier,credential);
|
||||
//6.获取测点数据
|
||||
PitmonitSouthsmosElement elWhere=new PitmonitSouthsmosElement();
|
||||
elWhere.setCfgId(cfg.getId());
|
||||
elWhere.setIsDel(0l);
|
||||
List<PitmonitSouthsmosElement> elList=elementService.selectDevPitmonitSouthsmosElementList(elWhere);
|
||||
elList.forEach(el->{
|
||||
List<PitmonitSouthsmosData> dataList=getElementData(orgId,""+el.getSrvId(),el.getNameEn(),token,date,1);
|
||||
dataList.forEach(item ->{
|
||||
item.setCfgId(cfg.getId());
|
||||
PitmonitSouthsmosData old=dataService.selectDevPitmonitSouthsmosAlarmByDataId(item.getDataId());
|
||||
if(old==null){
|
||||
dataService.insertDevPitmonitSouthsmosData(item);
|
||||
}
|
||||
});
|
||||
});
|
||||
//8.获取报警信息
|
||||
List<PitmonitSouthsmosAlarm> alarmList=getAlarm(orgId,token,date);
|
||||
alarmList.forEach(item->{
|
||||
item.setCfgId(cfg.getId());
|
||||
PitmonitSouthsmosAlarm old= alarmService.selectDevPitmonitSouthsmosAlarmBySrvId(item.getSrvId());
|
||||
if(old==null){
|
||||
alarmService.insertDevPitmonitSouthsmosAlarm(item);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 1.登录
|
||||
* @param identifier
|
||||
* @param credential
|
||||
* @return
|
||||
*/
|
||||
private String getToken(String identifier,String credential){
|
||||
String url="auth/tologin";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("identifier",identifier);
|
||||
params.put("credential",credential);
|
||||
params.put("type", "password");
|
||||
Request request = new Request.Builder()
|
||||
.url(APIBASEURL+url)
|
||||
.post(toJsonBody(params))
|
||||
.build();
|
||||
String data=getResult(request);
|
||||
if(StringUtils.isEmpty(data)){
|
||||
return "";
|
||||
}
|
||||
JSONObject jo=JSON.parseObject(data);
|
||||
data=jo.getJSONObject("data").getString("token");
|
||||
return data;
|
||||
}
|
||||
|
||||
private RequestBody toJsonBody(Map<String, Object> params) {
|
||||
return RequestBody.create(MediaType.parse("application/json"), JSON.toJSONString(params));
|
||||
}
|
||||
|
||||
private List<PitmonitSouthsmosDevice> getDevices(String token,String orgId){
|
||||
String url="instrument/device";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("structureId",orgId);
|
||||
String data=getJSON(APIBASEURL+url,token,params);
|
||||
if(StringUtils.isEmpty(data)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
JSONObject jo=JSON.parseObject(data);
|
||||
List<PitmonitSouthsmosDevice> list=jo.getList("data",PitmonitSouthsmosDevice.class);
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* 4.获取监测项列表
|
||||
* @param token
|
||||
* @param orgId
|
||||
* @return
|
||||
*/
|
||||
private List<PitmonitSouthsmosElement> getMonitorElement(String token,String orgId){
|
||||
String url="service/structure/"+orgId+"/monitorElement";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("isPaged","false");
|
||||
String data=getJSON(APIBASEURL+url,token,params);
|
||||
if(StringUtils.isEmpty(data)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
JSONArray jo=JSON.parseObject(data).getJSONArray("data");
|
||||
List<PitmonitSouthsmosElement> list=jo.toList(PitmonitSouthsmosElement.class);
|
||||
list.forEach(it->{
|
||||
it.setSrvId(it.getId());
|
||||
it.setId(null);
|
||||
it.getItems().forEach(item->{
|
||||
item.setSrvId(item.getId());
|
||||
item.setId(null);
|
||||
});
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 5.获取测点列表
|
||||
* @param token
|
||||
* @param orgId
|
||||
* @return
|
||||
*/
|
||||
private List<PitmonitSouthsmosSurveypoint> getSurveyPoint(String token,String orgId){
|
||||
String url="service/structure/"+orgId+"/surveyPoint";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("isPaged","false");
|
||||
String data=getJSON(APIBASEURL+url,token,params);
|
||||
if(StringUtils.isEmpty(data)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
JSONArray jo=JSON.parseObject(data).getJSONArray("data");
|
||||
List<PitmonitSouthsmosSurveypoint> list=jo.toList(PitmonitSouthsmosSurveypoint.class);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 6.获取测点数据
|
||||
* @param orgId
|
||||
* @param spId
|
||||
* @param type
|
||||
* @param token
|
||||
* @param dt
|
||||
* @param pageIndex
|
||||
* @return
|
||||
*/
|
||||
private List<PitmonitSouthsmosData> getElementData(String orgId,String spId,String type, String token,Date dt,int pageIndex){
|
||||
String url="service/structure/"+orgId+"/element/"+spId+"/Data";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("isPaged","true");
|
||||
params.put("type",type);
|
||||
params.put("beginTime", DateUtil.format(dt, "YYYY-MM-dd 00:00:00"));
|
||||
params.put("size",""+100);
|
||||
params.put("page",""+pageIndex);
|
||||
String data=getJSON(APIBASEURL+url,token,params);
|
||||
if(StringUtils.isEmpty(data)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
JSONObject jo=JSON.parseObject(data).getJSONObject("data");
|
||||
List<PitmonitSouthsmosData> list=jo.getList("list",PitmonitSouthsmosData.class);
|
||||
JSONArray jarr=jo.getJSONArray("list");
|
||||
for (int i = 0; i < jarr.size(); i++) {
|
||||
if(type.equals("horizontal")) {
|
||||
list.get(i).convertToHorizontal(jarr.getJSONObject(i));//水平位移(x,y)
|
||||
}else if(type.equals("presureWallsideSoil")){ //围护墙侧向土压力
|
||||
list.get(i).convertToPresureWallsideSoil(jarr.getJSONObject(i));
|
||||
}else if(type.equals("waterLevel")){ //地下水位
|
||||
list.get(i).convertToWaterLevel(jarr.getJSONObject(i));
|
||||
}
|
||||
}
|
||||
if(jarr.size()>0){
|
||||
List<PitmonitSouthsmosData> tmps= getElementData(orgId,spId,type,token,dt,pageIndex+1);
|
||||
list.addAll(tmps);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 7.获取报警阈值
|
||||
* @param spId
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
private List<PitmonitSouthsmosThreshold> getThreshold(String spId,String token){
|
||||
String url="service/threshold";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("isPaged","false");
|
||||
params.put("spId",spId);
|
||||
String data=getJSON(APIBASEURL+url,token,params);
|
||||
if(StringUtils.isEmpty(data)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
JSONObject jo=JSON.parseObject(data);
|
||||
List<PitmonitSouthsmosThreshold> list=jo.getList("data",PitmonitSouthsmosThreshold.class);
|
||||
list.forEach(d->{
|
||||
d.setSrvId(d.getId());
|
||||
d.setId(null);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 8.获取报警信息
|
||||
* @param orgId
|
||||
* @param token
|
||||
* @param dt
|
||||
* @return
|
||||
*/
|
||||
private List<PitmonitSouthsmosAlarm> getAlarm(String orgId,String token,Date dt){
|
||||
String url="service/alarm/all";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("structureId",orgId);
|
||||
params.put("beginTime", DateUtil.format(dt, "YYYY-MM-dd 00:00:00"));
|
||||
params.put("status","false");
|
||||
String data=getJSON(APIBASEURL+url,token,params);
|
||||
if(StringUtils.isEmpty(data)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
JSONObject jo=JSON.parseObject(data);
|
||||
List<PitmonitSouthsmosAlarm> list=jo.getList("data", PitmonitSouthsmosAlarm.class);
|
||||
list.forEach(d->{
|
||||
d.setSrvId(d.getId());
|
||||
d.setId(null);
|
||||
});
|
||||
params.remove("status");
|
||||
params.put("status","true");
|
||||
data=getJSON(APIBASEURL+url,token,params);
|
||||
jo=JSON.parseObject(data);
|
||||
List<PitmonitSouthsmosAlarm> list2=jo.getList("data", PitmonitSouthsmosAlarm.class);
|
||||
list2.forEach(d->{
|
||||
d.setSrvId(d.getId());
|
||||
d.setId(null);
|
||||
});
|
||||
list.addAll(list2);
|
||||
return list;
|
||||
}
|
||||
|
||||
private String getJSON(String url, String token, Map<String, Object> params) {
|
||||
HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(url)).newBuilder();
|
||||
params.forEach((s, o) -> {
|
||||
urlBuilder.addQueryParameter(s, (String) o);
|
||||
});
|
||||
Request request = new Request.Builder()
|
||||
.header("token",token)
|
||||
.url(urlBuilder.build())
|
||||
.build();
|
||||
return getResult(request);
|
||||
}
|
||||
|
||||
private static String getResult(Request request) {
|
||||
OkHttpClient client = new OkHttpClient.Builder()
|
||||
.sslSocketFactory(SSLSocketClient.getSSLSocketFactory(), SSLSocketClient.getX509TrustManager())
|
||||
.hostnameVerifier(SSLSocketClient.getHostnameVerifier())
|
||||
.build();
|
||||
Response response;
|
||||
try {
|
||||
response = client.newCall(request).execute();
|
||||
if (response.body() != null) {
|
||||
return response.body().string();
|
||||
} else {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
private static RequestBody toFormBody(Map<String, Object> params ){
|
||||
FormBody.Builder builder=new FormBody.Builder();
|
||||
for(String key :params.keySet()){
|
||||
builder.add(key,params.get(key).toString());
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
String identifier="SXYZ";
|
||||
String credential="Admin123!";
|
||||
String orgId="5131";
|
||||
//String token=getToken(identifier,credential);
|
||||
//4.获取监测项列表
|
||||
//List<PitmonitSouthsmosElement> list=getMonitorElement(token,orgId);
|
||||
//System.out.println(list);
|
||||
//5.获取测点列表
|
||||
//List<PitmonitSouthsmosSurveypoint> spList=getSurveyPoint(token,orgId);
|
||||
//System.out.println(spList);
|
||||
//6.获取测点数据
|
||||
//List<PitmonitSouthsmosData> dataList=getElementData(orgId,"22","horizontal",token,DateUtil.parse("2024-01-01"),1);
|
||||
//System.out.println(dataList);
|
||||
//System.out.println(dataList.size());
|
||||
//7.获取报警阈值
|
||||
//List<PitmonitSouthsmosThreshold> thList=getThreshold("53245",token);
|
||||
//System.out.println(thList);
|
||||
//8.获取报警信息
|
||||
//List<PitmonitSouthsmosAlarm> alarmList=getAlarm(orgId,token,DateUtil.parse("2024-12-31"));
|
||||
//System.out.println(alarmList);
|
||||
//9.获取设备
|
||||
//List<PitmonitSouthsmosDevice> devList=getDevices(token,orgId);
|
||||
//System.out.println(devList);
|
||||
}
|
||||
}
|
|
@ -83,7 +83,7 @@
|
|||
<version>4.9.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- YanZhu Common Swagger -->
|
||||
<!-- YanZhu Common Mapper -->
|
||||
<dependency>
|
||||
<groupId>com.yanzhu</groupId>
|
||||
<artifactId>yanzhu-common-mapper</artifactId>
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询报警信息列表
|
||||
export function listPitAlarm(query) {
|
||||
return request({
|
||||
url: '/device/pitAlarm/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询报警信息详细
|
||||
export function getPitAlarm(id) {
|
||||
return request({
|
||||
url: '/device/pitAlarm/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增报警信息
|
||||
export function addPitAlarm(data) {
|
||||
return request({
|
||||
url: '/device/pitAlarm',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改报警信息
|
||||
export function updatePitAlarm(data) {
|
||||
return request({
|
||||
url: '/device/pitAlarm',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除报警信息
|
||||
export function delPitAlarm(id) {
|
||||
return request({
|
||||
url: '/device/pitAlarm/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询项目基坑监测配置列表
|
||||
export function listPitConfig(query) {
|
||||
return request({
|
||||
url: '/device/pitConfig/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询项目基坑监测配置详细
|
||||
export function getPitConfig(id) {
|
||||
return request({
|
||||
url: '/device/pitConfig/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增项目基坑监测配置
|
||||
|
||||
export function addPitConfig(data) {
|
||||
return request({
|
||||
url: '/device/pitConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改项目基坑监测配置
|
||||
|
||||
export function updatePitConfig(data) {
|
||||
return request({
|
||||
url: '/device/pitConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除项目基坑监测配置
|
||||
|
||||
export function delPitConfig(id) {
|
||||
return request({
|
||||
url: '/device/pitConfig/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function findByProjIdDeptId(prjId,deptId){
|
||||
|
||||
let where={
|
||||
projectId:prjId,
|
||||
subDeptId:deptId
|
||||
}
|
||||
return listPitConfig(where);
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询测点数据列表
|
||||
export function listPitData(query) {
|
||||
return request({
|
||||
url: '/device/pitData/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询测点数据详细
|
||||
export function getPitData(id) {
|
||||
return request({
|
||||
url: '/device/pitData/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增测点数据
|
||||
export function addPitData(data) {
|
||||
return request({
|
||||
url: '/device/pitData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改测点数据
|
||||
export function updatePitData(data) {
|
||||
return request({
|
||||
url: '/device/pitData',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除测点数据
|
||||
export function delPitData(id) {
|
||||
return request({
|
||||
url: '/device/pitData/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备管理列表
|
||||
export function listPitDevice(query) {
|
||||
return request({
|
||||
url: '/device/pitDevice/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备管理详细
|
||||
export function getPitDevice(id) {
|
||||
return request({
|
||||
url: '/device/pitDevice/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备管理
|
||||
export function addPitDevice(data) {
|
||||
return request({
|
||||
url: '/device/pitDevice',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备管理
|
||||
export function updatePitDevice(data) {
|
||||
return request({
|
||||
url: '/device/pitDevice',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备管理
|
||||
export function delPitDevice(id) {
|
||||
return request({
|
||||
url: '/device/pitDevice/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询设测点关系列表
|
||||
export function listPitDeviceSurveyPoint(query) {
|
||||
return request({
|
||||
url: '/device/pitDeviceSurveyPoint/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设测点关系详细
|
||||
export function getPitDeviceSurveyPoint(id) {
|
||||
return request({
|
||||
url: '/device/pitDeviceSurveyPoint/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设测点关系
|
||||
export function addPitDeviceSurveyPoint(data) {
|
||||
return request({
|
||||
url: '/device/pitDeviceSurveyPoint',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设测点关系
|
||||
export function updatePitDeviceSurveyPoint(data) {
|
||||
return request({
|
||||
url: '/device/pitDeviceSurveyPoint',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设测点关系
|
||||
export function delPitDeviceSurveyPoint(id) {
|
||||
return request({
|
||||
url: '/device/pitDeviceSurveyPoint/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询监测项管理列表
|
||||
export function listPitElement(query) {
|
||||
return request({
|
||||
url: '/device/pitElement/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询监测项管理详细
|
||||
export function getPitElement(id) {
|
||||
return request({
|
||||
url: '/device/pitElement/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增监测项管理
|
||||
export function addPitElement(data) {
|
||||
return request({
|
||||
url: '/device/pitElement',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改监测项管理
|
||||
export function updatePitElement(data) {
|
||||
return request({
|
||||
url: '/device/pitElement',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除监测项管理
|
||||
export function delPitElement(id) {
|
||||
return request({
|
||||
url: '/device/pitElement/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询测项明细列表
|
||||
export function listPitElementItem(query) {
|
||||
return request({
|
||||
url: '/device/pitElementItem/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询测项明细详细
|
||||
export function getPitElementItem(id) {
|
||||
return request({
|
||||
url: '/device/pitElementItem/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增测项明细
|
||||
export function addPitElementItem(data) {
|
||||
return request({
|
||||
url: '/device/pitElementItem',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改测项明细
|
||||
export function updatePitElementItem(data) {
|
||||
return request({
|
||||
url: '/device/pitElementItem',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除测项明细
|
||||
export function delPitElementItem(id) {
|
||||
return request({
|
||||
url: '/device/pitElementItem/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询测点管理列表
|
||||
export function listPitSurveyPoint(query) {
|
||||
return request({
|
||||
url: '/device/pitSurveyPoint/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询测点管理详细
|
||||
export function getPitSurveyPoint(id) {
|
||||
return request({
|
||||
url: '/device/pitSurveyPoint/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增测点管理
|
||||
export function addPitSurveyPoint(data) {
|
||||
return request({
|
||||
url: '/device/pitSurveyPoint',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改测点管理
|
||||
export function updatePitSurveyPoint(data) {
|
||||
return request({
|
||||
url: '/device/pitSurveyPoint',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除测点管理
|
||||
export function delPitSurveyPoint(id) {
|
||||
return request({
|
||||
url: '/device/pitSurveyPoint/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询报警阈值列表
|
||||
export function listPitThreshold(query) {
|
||||
return request({
|
||||
url: '/device/pitThreshold/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询报警阈值详细
|
||||
export function getPitThreshold(id) {
|
||||
return request({
|
||||
url: '/device/pitThreshold/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增报警阈值
|
||||
export function addPitThreshold(data) {
|
||||
return request({
|
||||
url: '/device/pitThreshold',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改报警阈值
|
||||
export function updatePitThreshold(data) {
|
||||
return request({
|
||||
url: '/device/pitThreshold',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除报警阈值
|
||||
export function delPitThreshold(id) {
|
||||
return request({
|
||||
url: '/device/pitThreshold/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1751704305430" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4761" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M889.667368 419.920842c0-210.297263-164.432842-382.005895-371.2-392.434526C284.752842 15.683368 97.953684 201.781895 107.789474 436.655158a393.108211 393.108211 0 0 0 205.850947 329.566316 153.653895 153.653895 0 0 1 54.649263 49.717894l103.936 155.162948a30.854737 30.854737 0 0 0 51.253895 0l103.154526-153.950316a154.085053 154.085053 0 0 1 55.430737-50.122105 393.135158 393.135158 0 0 0 207.629474-347.082106z" fill="#322916" p-id="4762"></path><path d="M205.392842 419.920842c0 105.229474 55.861895 202.455579 146.566737 255.08379a291.974737 291.974737 0 0 0 293.160421 0 294.750316 294.750316 0 0 0 146.566737-255.08379c0-105.229474-55.861895-202.455579-146.593684-255.056842a291.974737 291.974737 0 0 0-293.133474 0 294.750316 294.750316 0 0 0-146.593684 255.056842z" fill="#FFFFFF" p-id="4763"></path><path d="M273.973895 425.714526a229.726316 229.726316 0 0 0 114.229894 198.790737 227.570526 227.570526 0 0 0 228.486737 0 229.726316 229.726316 0 0 0 114.229895-198.790737 229.726316 229.726316 0 0 0-114.256842-198.817684 227.570526 227.570526 0 0 0-228.45979 0 229.726316 229.726316 0 0 0-114.256842 198.817684z" fill="#322916" p-id="4764"></path><path d="M371.226947 373.032421l-52.358736 127.676632H700.631579l-56.158316-115.038316s-42.846316-18.944-54.272-20.210526c-11.425684-1.266526-46.645895 10.105263-42.846316 12.638315 2.856421 3.772632 0 44.247579-6.656 54.352842-6.656 11.371789-23.794526 37.914947-47.616 24.010106-23.794526-13.904842-20.938105-13.904842-20.938105-30.31579-0.943158-15.171368-7.599158-56.885895-24.737684-54.379789-18.108632 3.799579-76.180211 1.266526-76.180211 1.266526z" fill="#FFFFFF" p-id="4765"></path></svg>
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -0,0 +1,125 @@
|
|||
<template>
|
||||
<el-dialog title="报警详情" custom-class="alarm-detail-dlg" v-model="open" width="960px" append-to-body
|
||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-row class="row-header">
|
||||
<el-col>
|
||||
<span class="sp-label">工程:</span>
|
||||
<span class="sp-data">{{ row.structureName }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="row-header">
|
||||
<el-col :span="8">
|
||||
<span class="sp-label">监测项:</span>
|
||||
<span class="sp-data">{{ row.meName }}</span>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<span class="sp-label">报警项:</span>
|
||||
<span class="sp-data">{{ row.variety }}</span>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<span class="sp-label">报警阈值:</span>
|
||||
<span class="sp-data">{{ row.threshold }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="datas" border stripe height="50vh">
|
||||
<el-table-column label="测点" align="center" prop="spName" />
|
||||
<el-table-column label="X方向位移(mm)" align="center" prop="displace">
|
||||
<template slot-scope="scope">{{scope.row.displace.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="X方向累计变化量(mm)" align="center" prop="totalize" >
|
||||
<template slot-scope="scope">{{scope.row.totalize.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="X方向单次变化量(mm)" align="center" prop="variation" >
|
||||
<template slot-scope="scope">{{scope.row.variation.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="X方向变化速率(mm/d)" align="center" prop="changeRate" >
|
||||
<template slot-scope="scope">{{scope.row.changeRate.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Y方向位移(mm)" align="center" prop="displace2" >
|
||||
<template slot-scope="scope">{{scope.row.displace2.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Y方向累计变化量(mm)" align="center" prop="totalize2" >
|
||||
<template slot-scope="scope">{{scope.row.totalize2.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Y方向单次变化量(mm)" align="center" prop="variation2" >
|
||||
<template slot-scope="scope">{{scope.row.variation2.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Y方向变化速率(mm/d)" align="center" prop="changeRate2">
|
||||
<template slot-scope="scope">{{scope.row.changeRate2.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采集时间" align="center" prop="collectTime" />
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="pageNum"
|
||||
:limit.sync="pageSize"
|
||||
@pagination="loadData" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPitData} from "@/api/device/pitData";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
open: false,
|
||||
row: {},
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total:0,
|
||||
datas:[],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showDialog(row) {
|
||||
this.pageNum=1;
|
||||
this.row = row;
|
||||
this.open = true;
|
||||
this.loadData();
|
||||
},
|
||||
loadData(){
|
||||
let postData={
|
||||
pageNum:this.pageNum,
|
||||
pageSize:this.pageSize,
|
||||
spId:this.row.spId,
|
||||
createTime:this.row.gmtCreate,
|
||||
updateTime:this.row.gmtModified
|
||||
};
|
||||
this.loading=true;
|
||||
listPitData(postData).then(d => {
|
||||
this.loading=false;
|
||||
this.total=d.total||0;
|
||||
this.datas=d.rows||[];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.alarm-detail-dlg {
|
||||
.row-header {
|
||||
line-height: 30px;
|
||||
|
||||
.sp-label {
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sp-data {
|
||||
margin-left: 4px;
|
||||
columns: #888;
|
||||
}
|
||||
}
|
||||
.el-table__header{
|
||||
th{
|
||||
background: #ccccccba;
|
||||
}
|
||||
}
|
||||
.el-table__body-wrapper{
|
||||
max-height: 50vh !important;
|
||||
height: unset !important;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,338 @@
|
|||
<template>
|
||||
<div class="app-container pit-alarm-index">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目名称" prop="projectId">
|
||||
<el-select v-model="queryParams.projectId" filterable placeholder="请选择项目" clearable @change="doQuerySub">
|
||||
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总包单位" prop="subDeptId">
|
||||
<el-select v-model="queryParams.subDeptId" filterable placeholder="请选择总包单位" clearable>
|
||||
<el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="告警状态" prop="status">
|
||||
<el-radio-group v-model="queryParams.status" @change="getList">
|
||||
<el-radio label="false">未处理</el-radio>
|
||||
<el-radio label="true">已处理</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="告警原因" prop="type">
|
||||
<el-select v-model="queryParams.type" filterable placeholder="请选择总包单位" clearable>
|
||||
<el-option v-for="(item, index) in '数据异常,DTU异常,传感器异常,网关异常,节点异常'.split(',')" :key="index" :label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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" v-if="1==2">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['device:pitAlarm: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="['device:pitAlarm: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="['device:pitAlarm: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="['device:pitAlarm:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pitAlarmList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="编号" align="center" prop="id" width="80" />
|
||||
<el-table-column label="项目名称" align="center" prop="prjName" width="180" />
|
||||
<el-table-column label="总包单位" align="center" prop="deptName" width="180" />
|
||||
<el-table-column label="告警源" align="center" prop="alarmSource" width="180" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.alarmSource}}-{{ scope.row.variety}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="等级" align="center" prop="level" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span class="sp-data" :class="'sp-level-'+scope.row.level">{{ getLevel(scope.row.level)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="告警信息" align="center" prop="alarmInfo" width="180"/>
|
||||
<el-table-column label="产生次数" align="center" prop="numbers" width="80"/>
|
||||
<el-table-column label="产生时间" align="center" prop="gmtCreate" width="150"/>
|
||||
<el-table-column label="更新时间" align="center" prop="gmtModified" width="150"/>
|
||||
<el-table-column label="处理人" align="center" prop="staff" width="100" v-if="queryParams.status=='true'"/>
|
||||
<el-table-column label="处理人电话" align="center" prop="staffPhone" width="180" v-if="queryParams.status=='true'"/>
|
||||
<el-table-column label="处理人结果" align="center" prop="result" width="180" v-if="queryParams.status=='true'"/>
|
||||
<el-table-column label="处理图片" align="center" prop="result" width="180" v-if="queryParams.status=='true'">
|
||||
<template slot-scope="scope">
|
||||
<span style="color:#ccc" v-if="!scope.row.resultUrl">暂无</span>
|
||||
<el-image :src="scope.row.resultUrl" v-else
|
||||
:preview-src-list="[scope.row.resultUrl]"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" v-if="queryParams.status=='false'" icon="el-icon-tickets" @click="showDetail(scope.row)">详情</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['device:pitAlarm: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" />
|
||||
<alarmDetailDlg ref="detailDlg"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPitAlarm, getPitAlarm, delPitAlarm, addPitAlarm, updatePitAlarm } from "@/api/device/pitAlarm";
|
||||
import alarmDetailDlg from './alarmDetailDlg.vue'
|
||||
export default {
|
||||
components:{
|
||||
alarmDetailDlg
|
||||
},
|
||||
name: "PitAlarm",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 报警信息表格数据
|
||||
pitAlarmList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
subDeptId: null,
|
||||
status: 'false',
|
||||
type: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
projectOptions: [],
|
||||
depts: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
showDetail(row){
|
||||
this.$refs.detailDlg.showDialog(row);
|
||||
},
|
||||
doQuerySub() {
|
||||
let prjId=this.queryParams.projectId;
|
||||
let tmps = this.prjDept2 && this.prjDept2[prjId] ? this.prjDept2[prjId] || [] : [];
|
||||
if (tmps.length > 0 || !prjId) {
|
||||
this.depts = tmps;
|
||||
if (tmps.length == 1) {
|
||||
this.queryParams.subDeptId = tmps[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.getList();
|
||||
return;
|
||||
}
|
||||
this.$api.publics.queryUnitList({
|
||||
projectId: prjId,
|
||||
unitTypes: "2".split(","),
|
||||
}).then((d) => {
|
||||
let objs = d.rows || [];
|
||||
if (!this.prjDept2) {
|
||||
this.prjDept2 = {};
|
||||
}
|
||||
this.prjDept2[prjId] = objs;
|
||||
this.depts = objs;
|
||||
if (objs.length == 1) {
|
||||
this.queryParams.subDeptId = objs[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
init() {
|
||||
if (this.projectOptions && this.projectOptions.length > 0) {
|
||||
return;
|
||||
}
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询报警信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPitAlarm(this.queryParams).then(response => {
|
||||
this.pitAlarmList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getLevel(lvl){
|
||||
return ["正常","超预警值","超报警值","超控制值"][lvl];
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
srvId: null,
|
||||
alarmInfo: null,
|
||||
alarmSource: null,
|
||||
gmtAlarm: null,
|
||||
gmtAlarmOver: null,
|
||||
gmtAlarmStart: null,
|
||||
gmtCreate: null,
|
||||
gmtModified: null,
|
||||
level: null,
|
||||
meId: null,
|
||||
meName: null,
|
||||
monitorItemId: null,
|
||||
numbers: null,
|
||||
result: null,
|
||||
resultUrl: null,
|
||||
spId: null,
|
||||
spName: null,
|
||||
staff: null,
|
||||
staffPhone: null,
|
||||
status: null,
|
||||
structureId: null,
|
||||
structureName: null,
|
||||
threshold: null,
|
||||
type: null,
|
||||
variety: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加报警信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getPitAlarm(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) {
|
||||
updatePitAlarm(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPitAlarm(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 delPitAlarm(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('device/pitAlarm/export', {
|
||||
...this.queryParams
|
||||
}, `pitAlarm_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.pit-alarm-index{
|
||||
.sp-data{
|
||||
&.sp-level-0{
|
||||
color: #FFEBEE;
|
||||
}
|
||||
&.sp-level-1{
|
||||
color: #EF9A9A;
|
||||
}
|
||||
&.sp-level-2{
|
||||
color: #EF5350;
|
||||
}
|
||||
&.sp-level-3{
|
||||
color: #D32F2F;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,388 @@
|
|||
<template>
|
||||
<div class="app-container prj-pit-config">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目名称" prop="projectId">
|
||||
<el-select v-model="queryParams.projectId" filterable placeholder="请选择项目" clearable
|
||||
@change="doQuerySub('query')">
|
||||
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总包单位" prop="subDeptId">
|
||||
<el-select v-model="queryParams.subDeptId" filterable placeholder="请选择总包单位" clearable>
|
||||
<el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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="['device:pitConfig: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="['device:pitConfig: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="['device:pitConfig:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="1 == 2">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['device:pitConfig:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pitConfigList" @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="projectName" />
|
||||
<el-table-column label="总包单位" align="center" prop="deptName" />
|
||||
<el-table-column label="对接厂商" align="center" prop="vendorCode" />
|
||||
<el-table-column label="是否启用" align="center" prop="enabled">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" v-if="scope.row.enabled == 1">启用</el-button>
|
||||
<el-button type="text" disabled v-if="scope.row.enabled == 0">停用</el-button>
|
||||
</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="['device:pitConfig:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['device:pitConfig: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-drawer v-if="open" v-model="open" direction="rtl" size="60%" :title="title">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px" style="padding:0px 20px">
|
||||
<el-form-item label="项目名称" prop="projectId">
|
||||
<el-select v-model="form.projectId" filterable placeholder="请选择项目" style="width:300px;" clearable
|
||||
@change="doQuerySub('dlg')">
|
||||
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总包单位" prop="subDeptId">
|
||||
<el-select v-model="form.subDeptId" filterable placeholder="请选择总包单位" style="width:300px;" clearable
|
||||
@change="doQueryCfg">
|
||||
<el-option v-for="(item, index) in dlgDepts" :key="index" :label="item.deptName" :value="item.deptId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-tabs type="card" v-model="form.vendorCode">
|
||||
<el-tab-pane :label="it.label" :name="it.value" v-for="(it, idx) in dict.type.pitmonit_vendors" :key="idx">
|
||||
<el-form-item label="工程编号" prop="orgId">
|
||||
<el-input v-model="form.orgId"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名" prop="identifier">
|
||||
<el-input v-model="form.identifier" auto-complete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="credential">
|
||||
<el-input v-model="form.credential"></el-input>
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-form-item label="是否启用" prop="enabled">
|
||||
<el-switch v-model="form.enabled" active-color="#13ce66" inactive-color="#ccc">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPitConfig, getPitConfig, delPitConfig, addPitConfig, updatePitConfig, findByProjIdDeptId } from "@/api/device/pitConfig";
|
||||
|
||||
export default {
|
||||
name: "PitConfig",
|
||||
dicts: ['pitmonit_vendors'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 项目基坑监测配置表格数据
|
||||
pitConfigList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
subDeptId: null,
|
||||
vendorCode: null,
|
||||
vendorParamter: null,
|
||||
enabled: null,
|
||||
state: null,
|
||||
isDel: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
projectId:null,
|
||||
subDeptId:null,
|
||||
orgId:'',
|
||||
identifier:'',
|
||||
credential:'',
|
||||
enabled:true
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
projectId: [{ required: true, message: "请输入工程编号", trigger: "blur" }],
|
||||
subDeptId: [{ required: true, message: "请输入工程编号", trigger: "blur" }],
|
||||
orgId: [{ required: true, message: "请输入工程编号", trigger: "blur" }],
|
||||
identifier: [{ required: true, message: "请输入用户名", trigger: "blur" }],
|
||||
credential: [{ required: true, message: "请输入密码", trigger: "blur" }],
|
||||
},
|
||||
projectOptions: [],
|
||||
depts: [],
|
||||
dlgDepts: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
doQueryCfg() {
|
||||
if (this.form.projectId && this.form.subDeptId) {
|
||||
findByProjIdDeptId(this.form.projectId, this.form.subDeptId).then(d => {
|
||||
let row = d.rows && d.rows.length > 0 ? d.rows[0] : null;
|
||||
if (row) {
|
||||
this.handleUpdate(row, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
doQuerySub(type, cb) {
|
||||
let prjId = type == "query" ? this.queryParams.projectId : this.form.projectId;
|
||||
if (!prjId) {
|
||||
if (type == "query") {
|
||||
this.depts = [];
|
||||
this.queryParams.subDeptId = ""
|
||||
} else {
|
||||
this.dlgDepts = [];
|
||||
this.form.subDeptId = ""
|
||||
}
|
||||
if (cb) cb();
|
||||
return;
|
||||
}
|
||||
let tmps = this.prjDept2 && this.prjDept2[prjId] ? this.prjDept2[prjId] || [] : [];
|
||||
if (tmps.length > 0) {
|
||||
if (type == 'query') {
|
||||
this.depts = tmps;
|
||||
this.queryParams.subDeptId = tmps.length == 1 ? tmps[0].deptId : '';
|
||||
} else {
|
||||
this.dlgDepts = tmps;
|
||||
this.form.subDeptId = tmps.length == 1 ? tmps[0].deptId : '';
|
||||
this.doQueryCfg();
|
||||
}
|
||||
if (cb) cb();
|
||||
return;
|
||||
}
|
||||
this.$api.publics.queryUnitList({
|
||||
projectId: prjId,
|
||||
unitTypes: "2".split(","),
|
||||
}).then((d) => {
|
||||
let objs = d.rows || [];
|
||||
if (!this.prjDept2) {
|
||||
this.prjDept2 = {};
|
||||
}
|
||||
this.prjDept2[prjId] = objs;
|
||||
let tmps = objs;
|
||||
if (type == 'query') {
|
||||
this.depts = tmps;
|
||||
this.queryParams.subDeptId = tmps.length == 1 ? tmps[0].deptId : '';
|
||||
} else {
|
||||
this.dlgDepts = tmps;
|
||||
this.form.subDeptId = tmps.length == 1 ? tmps[0].deptId : '';
|
||||
this.doQueryCfg();
|
||||
}
|
||||
if (cb) cb();
|
||||
});
|
||||
},
|
||||
init() {
|
||||
if (this.projectOptions && this.projectOptions.length > 0) {
|
||||
return;
|
||||
}
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询项目基坑监测配置列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPitConfig(this.queryParams).then(response => {
|
||||
this.pitConfigList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
projectId: null,
|
||||
subDeptId: null,
|
||||
vendorCode: null,
|
||||
vendorParamter: null,
|
||||
orgId:'',
|
||||
identifier:'',
|
||||
credential:'',
|
||||
enabled: true,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加项目基坑监测配置";
|
||||
this.form.vendorCode = this.dict.type.pitmonit_vendors[0].value;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row, fromAdd) {
|
||||
this.reset();
|
||||
this.form = {...row,orgId:'',
|
||||
identifier:'',
|
||||
credential:'',};
|
||||
let oldDeptId = this.form.subDeptId;
|
||||
if (!fromAdd) {
|
||||
this.doQuerySub("dlg", () => {
|
||||
this.form.subDeptId = oldDeptId;
|
||||
});
|
||||
}
|
||||
let param = this.$tryToJson(this.form.vendorParamter, {});
|
||||
this.form.orgId = param.orgId || "";
|
||||
this.form.identifier = param.identifier || "";
|
||||
this.form.credential = param.credential || "";
|
||||
this.form.enabled=row.enabled==1;
|
||||
this.open = true;
|
||||
this.title = "修改项目基坑监测配置";
|
||||
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
let param = {
|
||||
orgId: this.form.orgId,
|
||||
identifier: this.form.identifier,
|
||||
credential: this.form.credential
|
||||
};
|
||||
var postData = {
|
||||
projectId: this.form.projectId,
|
||||
subDeptId: this.form.subDeptId,
|
||||
vendorCode: this.form.vendorCode,
|
||||
enabled: this.form.enabled ? 1 : 0,
|
||||
vendorParamter: JSON.stringify(param)
|
||||
};
|
||||
if (this.form.id != null) {
|
||||
postData.id = this.form.id;
|
||||
updatePitConfig(postData).then(response => {
|
||||
this.$modal.msgSuccess("修改配置成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPitConfig(postData).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 delPitConfig(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('device/pitConfig/export', {
|
||||
...this.queryParams
|
||||
}, `pitConfig_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.prj-pit-config {
|
||||
.el-drawer {
|
||||
.el-drawer__body {
|
||||
position: relative;
|
||||
|
||||
.dialog-footer {
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,36 @@
|
|||
<template>
|
||||
<div class="app-container pit-data-index">
|
||||
<el-tabs v-model="activeName" >
|
||||
<!--
|
||||
<el-tab-pane label="数据概况" name="index"></el-tab-pane>-->
|
||||
<el-tab-pane label="测点数据" name="spData"></el-tab-pane>
|
||||
<!--
|
||||
<el-tab-pane label="监测项数据" name="monitData"></el-tab-pane>
|
||||
-->
|
||||
<surveyPointData v-if="activeName=='spData'"/>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import surveyPointData from './surveyPointData.vue'
|
||||
export default {
|
||||
name: 'RuoyiUiIndex',
|
||||
components:{
|
||||
surveyPointData
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName:"spData"
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,554 @@
|
|||
<template>
|
||||
<div class="app-container survey-point-data-index">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
|
||||
<el-form-item label="项目名称" prop="projectId">
|
||||
<el-select v-model="queryParams.projectId" filterable placeholder="请选择项目" clearable @change="doQuerySub">
|
||||
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总包单位" prop="subDeptId">
|
||||
<el-select v-model="queryParams.subDeptId" filterable placeholder="请选择总包单位" clearable @change="doQueryPitEL">
|
||||
<el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="监测项" prop="meId">
|
||||
<el-select v-model="queryParams.meId" filterable placeholder="请选择监测项" clearable @change="doQueryPitSps">
|
||||
<el-option v-for="(item, index) in pitEls" :key="index" :label="item.name" :value="item.srvId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="测点" prop="spId">
|
||||
<el-select v-model="queryParams.spId" filterable placeholder="请选择监测项" clearable>
|
||||
<el-option v-for="(item, index) in pitSps" :key="index" :label="item.name" :value="item.spId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="查询日期" prop="spId">
|
||||
<el-date-picker v-model="queryParams.selDate" type="daterange" align="right" unlink-panels 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" v-if="1 == 2">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['device:pitData: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="['device:pitData: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="['device:pitData: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="['device:pitData:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pitDataList" height="50vh" class="dt-main">
|
||||
<el-table-column label="测点" align="center" prop="spName" />
|
||||
<template v-if="queryParams.meId == 22">
|
||||
<el-table-column label="X方向位移(mm)" align="center" prop="displace">
|
||||
<template slot-scope="scope">{{ scope.row.displace.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="X方向累计变化量(mm)" align="center" prop="totalize">
|
||||
<template slot-scope="scope">{{ scope.row.totalize.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="X方向单次变化量(mm)" align="center" prop="variation">
|
||||
<template slot-scope="scope">{{ scope.row.variation.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="X方向变化速率(mm/d)" align="center" prop="changeRate">
|
||||
<template slot-scope="scope">{{ scope.row.changeRate.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Y方向位移(mm)" align="center" prop="displace2">
|
||||
<template slot-scope="scope">{{ scope.row.displace2.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Y方向累计变化量(mm)" align="center" prop="totalize2">
|
||||
<template slot-scope="scope">{{ scope.row.totalize2.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Y方向单次变化量(mm)" align="center" prop="variation2">
|
||||
<template slot-scope="scope">{{ scope.row.variation2.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Y方向变化速率(mm/d)" align="center" prop="changeRate2">
|
||||
<template slot-scope="scope">{{ scope.row.changeRate2.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-if="queryParams.meId == 14">
|
||||
<el-table-column label="压力(MPa)" align="center" prop="displace">
|
||||
<template slot-scope="scope">{{ scope.row.displace.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="累计变化量(MPa)" align="center" prop="totalize">
|
||||
<template slot-scope="scope">{{ scope.row.totalize.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单次变化量(MPa)" align="center" prop="variation">
|
||||
<template slot-scope="scope">{{ scope.row.variation.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变化速率(MPa/d)" align="center" prop="changeRate">
|
||||
<template slot-scope="scope">{{ scope.row.changeRate.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-if="queryParams.meId == 3">
|
||||
<el-table-column label="水位(m)" align="center" prop="displace">
|
||||
<template slot-scope="scope">{{ scope.row.displace.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="累计变化量(mm)" align="center" prop="totalize">
|
||||
<template slot-scope="scope">{{ scope.row.totalize.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单次变化量(mm)" align="center" prop="variation">
|
||||
<template slot-scope="scope">{{ scope.row.variation.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变化速率(mm/d)" align="center" prop="changeRate">
|
||||
<template slot-scope="scope">{{ scope.row.changeRate.toFixed(3) }}</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="采集时间" align="center" prop="collectTime" />
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<div v-if="chartData && queryParams.meId==22" class="div-chart">
|
||||
<el-radio-group v-model="selChart1" class="chart1-group" @change="showChartData(1)">
|
||||
<el-radio :label="0" border>X方向位移(mm)</el-radio>
|
||||
<el-radio :label="1" border>X方向累计变化量(mm)</el-radio>
|
||||
<el-radio :label="2" border>X方向单次变化量(mm)</el-radio>
|
||||
<el-radio :label="3" border>X方向变化速率(mm/d)</el-radio>
|
||||
</el-radio-group>
|
||||
<Chart ref="chart1" :chgOpt="opt=>changeOpt(opt,1)" :key="'c1-'+spId"/>
|
||||
|
||||
<el-radio-group v-model="selChart2" class="chart2-group" @change="showChartData(2)">
|
||||
<el-radio :label="0" border>Y方向位移(mm)</el-radio>
|
||||
<el-radio :label="1" border>Y方向累计变化量(mm)</el-radio>
|
||||
<el-radio :label="2" border>Y方向单次变化量(mm)</el-radio>
|
||||
<el-radio :label="3" border>Y方向变化速率(mm/d)</el-radio>
|
||||
</el-radio-group>
|
||||
<Chart ref="chart2" :chgOpt="opt=>changeOpt(opt,2)" :key="'c2-'+spId"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPitData, getPitData, delPitData, addPitData, updatePitData } from "@/api/device/pitData";
|
||||
import { listPitElement } from '@/api/device/pitElement'
|
||||
import { listPitSurveyPoint } from '@/api/device/pitSurveyPoint'
|
||||
import Chart from '@/components/Chart'
|
||||
export default {
|
||||
name: "PitData",
|
||||
components:{
|
||||
Chart
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 测点数据表格数据
|
||||
pitDataList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
subDeptId: null,
|
||||
meId: null,
|
||||
spId: null,
|
||||
selDate: []
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
projectOptions: [],
|
||||
depts: [],
|
||||
pitEls: [],//监测项
|
||||
pitSps: [],//测点
|
||||
chartData:null,
|
||||
selChart1:0,
|
||||
selChart2:0,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//let dt1 = this.$dt((+new Date()) - 30 * 24 * 3600 * 1000);
|
||||
//let dt2 = this.$dt(new Date());
|
||||
//this.queryParams.selDate = [dt1, dt2];
|
||||
this.getList();
|
||||
this.init();
|
||||
},
|
||||
computed:{
|
||||
spId(){
|
||||
return this.queryParams.spId;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
spId(n,o){
|
||||
if(n!=o){
|
||||
if(n){
|
||||
let postData = {
|
||||
spId: this.queryParams.spId,
|
||||
pageNum:this.queryParams.pageNum,
|
||||
pageSize:5000
|
||||
};
|
||||
listPitData(postData).then(d=>{
|
||||
let tmps=d.rows||[];
|
||||
this.chartData=tmps.length>0?tmps:null;
|
||||
this.selChart1=0;
|
||||
this.selChart2=0;
|
||||
this.showChartData(1);
|
||||
this.showChartData(2);
|
||||
});
|
||||
}else{
|
||||
this.chartData=null;
|
||||
}
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doQuerySub() {
|
||||
let prjId = this.queryParams.projectId;
|
||||
let tmps = this.prjDept2 && this.prjDept2[prjId] ? this.prjDept2[prjId] || [] : [];
|
||||
if (tmps.length > 0 || !prjId) {
|
||||
this.depts = tmps;
|
||||
if (tmps.length >= 1) {
|
||||
this.queryParams.subDeptId = tmps[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
this.pitEls=[];
|
||||
this.pitSps=[];
|
||||
this.queryParams.meId="";
|
||||
this.queryParams.spId="";
|
||||
}
|
||||
this.doQueryPitEL();
|
||||
return;
|
||||
}
|
||||
this.$api.publics.queryUnitList({
|
||||
projectId: prjId,
|
||||
unitTypes: "2".split(","),
|
||||
}).then((d) => {
|
||||
let objs = d.rows || [];
|
||||
if (!this.prjDept2) {
|
||||
this.prjDept2 = {};
|
||||
}
|
||||
this.prjDept2[prjId] = objs;
|
||||
this.depts = objs;
|
||||
if (objs.length >= 1) {
|
||||
this.queryParams.subDeptId = objs[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.doQueryPitEL();
|
||||
});
|
||||
},
|
||||
doQueryPitEL() {
|
||||
if (!this.queryParams.subDeptId) {
|
||||
this.pitEls = [];
|
||||
this.queryParams.meId = "";
|
||||
this.pitSps=[];
|
||||
this.queryParams.spId="";
|
||||
this.getList();
|
||||
return;
|
||||
}
|
||||
listPitElement({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
projectId: this.queryParams.projectId,
|
||||
subDeptId: this.queryParams.subDeptId
|
||||
}).then(d => {
|
||||
this.pitEls = d.rows || [];
|
||||
if (this.pitEls.length > 0) {
|
||||
this.queryParams.meId = this.pitEls[0].srvId;
|
||||
} else {
|
||||
this.queryParams.meId = "";
|
||||
}
|
||||
this.doQueryPitSps();
|
||||
});
|
||||
},
|
||||
doQueryPitSps() {
|
||||
if (!this.queryParams.meId) {
|
||||
this.pitSps = [];
|
||||
this.queryParams.spId = "";
|
||||
this.getList();
|
||||
return;
|
||||
}
|
||||
listPitSurveyPoint({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
meId: this.queryParams.meId
|
||||
}).then(d => {
|
||||
this.pitSps = d.rows || [];
|
||||
if (this.pitSps.length > 0) {
|
||||
this.queryParams.spId = this.pitSps[0].spId;
|
||||
} else {
|
||||
this.queryParams.spId = "";
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
changeOpt(opt,type){
|
||||
opt = {
|
||||
tooltip: {
|
||||
trigger: "axis"
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: !0x0
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
'saveAsImage': {}
|
||||
}
|
||||
},
|
||||
dataZoom:[{
|
||||
type:'slider',
|
||||
show:true
|
||||
},{
|
||||
type:"inside"
|
||||
}],
|
||||
xAxis:{
|
||||
type:"time"
|
||||
},
|
||||
yAxis:{
|
||||
|
||||
},
|
||||
series:[{
|
||||
data:this.chartData.map(it=>{
|
||||
let tmps=[];
|
||||
tmps.push(it.collectTime);
|
||||
let data=0;
|
||||
if(type==1){
|
||||
data=(it["displace,totalize,variation,changeRate".split(",")[this.selChart1]]||0).toFixed(3)
|
||||
}else{
|
||||
data=(it["displace2,totalize2,variation2,changeRate2".split(",")[this.selChart2]]||0).toFixed(3)
|
||||
}
|
||||
tmps.push(data);
|
||||
return tmps;
|
||||
}),
|
||||
sampling:'max',
|
||||
showSymbol:false,
|
||||
type:'line'
|
||||
}]
|
||||
}
|
||||
return opt;
|
||||
},
|
||||
showChartData(type){
|
||||
if(type==1){
|
||||
if(this.$refs.chart1){
|
||||
this.$refs.chart1.initChart();
|
||||
}else{
|
||||
setTimeout(()=>{
|
||||
this.showChartData(1);
|
||||
},400);
|
||||
}
|
||||
}
|
||||
if(type==2){
|
||||
if(this.$refs.chart2){
|
||||
this.$refs.chart2.initChart();
|
||||
}else{
|
||||
setTimeout(()=>{
|
||||
this.showChartData(2);
|
||||
},400);
|
||||
}
|
||||
}
|
||||
},
|
||||
init() {
|
||||
if (this.projectOptions && this.projectOptions.length > 0) {
|
||||
return;
|
||||
}
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询测点数据列表 */
|
||||
getList() {
|
||||
if (!this.queryParams.spId) {
|
||||
this.pitDataList = [];
|
||||
this.total = 0;
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
let postData = {
|
||||
spId: this.queryParams.spId,
|
||||
pageNum:this.queryParams.pageNum,
|
||||
pageSize:this.queryParams.pageSize
|
||||
};
|
||||
let selDate = this.queryParams.selDate;
|
||||
if (selDate && selDate.length > 0) {
|
||||
postData.createTime = this.$dt(selDate[0]).format("YYYY-MM-DD HH:mm:ss");
|
||||
if (selDate.length > 1) {
|
||||
postData.updateTime = this.$dt(selDate[1]).format("YYYY-MM-DD HH:mm:ss");
|
||||
}
|
||||
}
|
||||
listPitData(postData).then(response => {
|
||||
this.pitDataList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
dataType: null,
|
||||
dataId: null,
|
||||
spId: null,
|
||||
spName: null,
|
||||
collectTime: null,
|
||||
changeRate: null,
|
||||
changeRate2: null,
|
||||
displace: null,
|
||||
displace2: null,
|
||||
totalize: null,
|
||||
totalize2: null,
|
||||
variation: null,
|
||||
variation2: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加测点数据";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getPitData(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) {
|
||||
updatePitData(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPitData(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 delPitData(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('device/pitData/export', {
|
||||
...this.queryParams
|
||||
}, `pitData_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.survey-point-data-index {
|
||||
|
||||
.el-table {
|
||||
max-height: 50vh;
|
||||
height: unset !important;
|
||||
|
||||
.el-table__body-wrapper {
|
||||
height: auto !important;
|
||||
max-height: 40vh !important;
|
||||
}
|
||||
}
|
||||
.pagination-container{
|
||||
height: 50px !important;
|
||||
}
|
||||
.div-chart{
|
||||
padding-top:10px;
|
||||
.chart1-group{
|
||||
.el-radio{
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
.chart1-group{
|
||||
margin-top:10px;
|
||||
.el-radio{
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,92 @@
|
|||
<template>
|
||||
<el-dialog title="设备详情" custom-class="device-detail-dlg" top="30vh !important " v-model="open" width="960px" append-to-body
|
||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<div class="nav-header">
|
||||
<span class="nav-text">基本信息</span>
|
||||
<span class="nav-line"></span>
|
||||
</div>
|
||||
<el-row class="row-header">
|
||||
<el-col :span="8">
|
||||
<span class="sp-label">设备名称:</span>
|
||||
<span class="sp-data">{{ row.name }}</span>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<span class="sp-label">设备编号:</span>
|
||||
<span class="sp-data">{{ row.devCode }}</span>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<span class="sp-label">设备型号:</span>
|
||||
<span class="sp-data">{{ row.devTypeName }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="nav-header">
|
||||
<span class="nav-text">关联测点</span>
|
||||
<span class="nav-line"></span>
|
||||
</div>
|
||||
<el-table :data="row.surveypoints" border stripe >
|
||||
<el-table-column label="监测项名称" align="center" prop="meName" />
|
||||
<el-table-column label="测点组名称" align="center" prop="groupName" />
|
||||
<el-table-column label="测点名称" align="center" prop="name" />
|
||||
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
open:false,
|
||||
row:{}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
showDialog(row){
|
||||
this.row=row;
|
||||
this.open=true;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.device-detail-dlg{
|
||||
.el-dialog__body{
|
||||
padding:10px 20px;
|
||||
}
|
||||
.row-header {
|
||||
line-height: 30px;
|
||||
|
||||
.sp-label {
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sp-data {
|
||||
margin-left: 4px;
|
||||
columns: #888;
|
||||
}
|
||||
}
|
||||
.nav-header{
|
||||
position: relative;
|
||||
line-height: 60px;
|
||||
.nav-text{
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #444;
|
||||
background: #ffff;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: inline-block;
|
||||
padding-right: 8px;
|
||||
}
|
||||
.nav-line{
|
||||
|
||||
display: block;
|
||||
position: absolute;
|
||||
border-bottom: solid 1px #cccccc54;
|
||||
width: 100%;
|
||||
top: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,303 @@
|
|||
<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="projectId">
|
||||
<el-select v-model="queryParams.projectId" filterable placeholder="请选择项目" clearable @change="doQuerySub">
|
||||
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总包单位" prop="subDeptId">
|
||||
<el-select v-model="queryParams.subDeptId" filterable placeholder="请选择总包单位" clearable>
|
||||
<el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设备名称" prop="devCode">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入设备名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设备编号" prop="cfgId">
|
||||
<el-input v-model="queryParams.devCode" placeholder="请输入设备编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设备型号" prop="cfgId">
|
||||
<el-input v-model="queryParams.devTypeName" 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" v-if="1==2">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['device:pitDevice: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="['device:pitDevice: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="['device:pitDevice: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="['device:pitDevice:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pitDeviceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="编号" align="center" prop="id" width="80" />
|
||||
<el-table-column label="项目名称" align="center" prop="prjName" width="180" />
|
||||
<el-table-column label="总包单位" align="center" prop="deptName" width="180" />
|
||||
<el-table-column label="设备名称" align="center" prop="name" />
|
||||
<el-table-column label="设备编号" align="center" prop="devCode" />
|
||||
<el-table-column label="设备类型" align="center" prop="devTypeName" />
|
||||
<el-table-column label="关联测点数目" align="center" prop="ptCount" />
|
||||
<el-table-column label="当前电量" align="center" prop="batDl" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" v-if="1==2" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['device:pitDevice:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-tickets" @click="handleDetail(scope.row)">详情</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['device:pitDevice: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" />
|
||||
<deviceDetailDlg ref="detailDlg"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPitDevice, getPitDevice, delPitDevice, addPitDevice, updatePitDevice } from "@/api/device/pitDevice";
|
||||
import deviceDetailDlg from './deviceDetailDlg.vue'
|
||||
export default {
|
||||
components:{
|
||||
deviceDetailDlg
|
||||
},
|
||||
name: "PitDevice",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设备管理表格数据
|
||||
pitDeviceList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
subDeptId: null,
|
||||
name: null,
|
||||
devCode: null,
|
||||
devTypeName: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
projectOptions: [],
|
||||
depts: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
doQuerySub() {
|
||||
let prjId=this.queryParams.projectId;
|
||||
let tmps = this.prjDept2 && this.prjDept2[prjId] ? this.prjDept2[prjId] || [] : [];
|
||||
if (tmps.length > 0 || !prjId) {
|
||||
this.depts = tmps;
|
||||
if (tmps.length == 1) {
|
||||
this.queryParams.subDeptId = tmps[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.getList();
|
||||
return;
|
||||
}
|
||||
this.$api.publics.queryUnitList({
|
||||
projectId: prjId,
|
||||
unitTypes: "2".split(","),
|
||||
}).then((d) => {
|
||||
let objs = d.rows || [];
|
||||
if (!this.prjDept2) {
|
||||
this.prjDept2 = {};
|
||||
}
|
||||
this.prjDept2[prjId] = objs;
|
||||
this.depts = objs;
|
||||
if (objs.length == 1) {
|
||||
this.queryParams.subDeptId = objs[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
init() {
|
||||
if (this.projectOptions && this.projectOptions.length > 0) {
|
||||
return;
|
||||
}
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询设备管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPitDevice(this.queryParams).then(response => {
|
||||
this.pitDeviceList = (response.rows||[]).map(it=>{
|
||||
it.ptCount=it.surveypoints?it.surveypoints.length:0;
|
||||
let obj=this.$tryToJson(it.devShadow,{});
|
||||
let batDl=obj.state?.reported?.BAT_DL||'';
|
||||
it.batDl=batDl?batDl+"%":"-";
|
||||
return it;
|
||||
});
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
devId: null,
|
||||
autoType: null,
|
||||
certUrl: null,
|
||||
checkDate: null,
|
||||
devCode: null,
|
||||
devShadow: null,
|
||||
devType: null,
|
||||
devTypeName: null,
|
||||
key: null,
|
||||
manufacturer: null,
|
||||
name: null,
|
||||
orgId: null,
|
||||
parent: null,
|
||||
parentIds: null,
|
||||
productType: null,
|
||||
position: null,
|
||||
status: null,
|
||||
structureId: null,
|
||||
structureName: null,
|
||||
typeCategory: null,
|
||||
typeName: null,
|
||||
verifyDate: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加设备管理";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getPitDevice(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) {
|
||||
updatePitDevice(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPitDevice(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDetail(row){
|
||||
this.$refs.detailDlg.showDialog(row);
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除设备管理编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delPitDevice(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('device/pitDevice/export', {
|
||||
...this.queryParams
|
||||
}, `pitDevice_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,310 @@
|
|||
<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="配置ID" prop="cfgId">
|
||||
<el-input
|
||||
v-model="queryParams.cfgId"
|
||||
placeholder="请输入配置ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备ID" prop="devId">
|
||||
<el-input
|
||||
v-model="queryParams.devId"
|
||||
placeholder="请输入设备ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="测点ID" prop="spId">
|
||||
<el-input
|
||||
v-model="queryParams.spId"
|
||||
placeholder="请输入测点ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="state">
|
||||
<el-input
|
||||
v-model="queryParams.state"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input
|
||||
v-model="queryParams.isDel"
|
||||
placeholder="请输入${comment}"
|
||||
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="['device:pitDeviceSurveyPoint: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="['device:pitDeviceSurveyPoint: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="['device:pitDeviceSurveyPoint: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="['device:pitDeviceSurveyPoint:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pitDeviceSurveyPointList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="id" />
|
||||
<el-table-column label="配置ID" align="center" prop="cfgId" />
|
||||
<el-table-column label="设备ID" align="center" prop="devId" />
|
||||
<el-table-column label="测点ID" align="center" prop="spId" />
|
||||
<el-table-column label="${comment}" align="center" prop="state" />
|
||||
<el-table-column label="${comment}" align="center" prop="remark" />
|
||||
<el-table-column label="${comment}" align="center" prop="isDel" />
|
||||
<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="['device:pitDeviceSurveyPoint:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['device:pitDeviceSurveyPoint: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" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="配置ID" prop="cfgId">
|
||||
<el-input v-model="form.cfgId" placeholder="请输入配置ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备ID" prop="devId">
|
||||
<el-input v-model="form.devId" placeholder="请输入设备ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="测点ID" prop="spId">
|
||||
<el-input v-model="form.spId" placeholder="请输入测点ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="state">
|
||||
<el-input v-model="form.state" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input v-model="form.isDel" placeholder="请输入${comment}" />
|
||||
</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 { listPitDeviceSurveyPoint, getPitDeviceSurveyPoint, delPitDeviceSurveyPoint, addPitDeviceSurveyPoint, updatePitDeviceSurveyPoint } from "@/api/device/pitDeviceSurveyPoint";
|
||||
|
||||
export default {
|
||||
name: "PitDeviceSurveyPoint",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设测点关系表格数据
|
||||
pitDeviceSurveyPointList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
cfgId: null,
|
||||
devId: null,
|
||||
spId: null,
|
||||
state: null,
|
||||
isDel: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询设测点关系列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPitDeviceSurveyPoint(this.queryParams).then(response => {
|
||||
this.pitDeviceSurveyPointList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
devId: null,
|
||||
spId: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加设测点关系";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getPitDeviceSurveyPoint(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) {
|
||||
updatePitDeviceSurveyPoint(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPitDeviceSurveyPoint(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 delPitDeviceSurveyPoint(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('device/pitDeviceSurveyPoint/export', {
|
||||
...this.queryParams
|
||||
}, `pitDeviceSurveyPoint_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,257 @@
|
|||
<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="projectId">
|
||||
<el-select v-model="queryParams.projectId" filterable placeholder="请选择项目" clearable @change="doQuerySub">
|
||||
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总包单位" prop="subDeptId">
|
||||
<el-select v-model="queryParams.subDeptId" filterable placeholder="请选择总包单位" clearable>
|
||||
<el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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" v-if="1==2">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['device:pitElement: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="['device:pitElement: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="['device:pitElement: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="['device:pitElement:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pitElementList" stripe>
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<el-table :data="props.row.children" border stripe>
|
||||
<el-table-column label="子项名称" align="center" prop="name" />
|
||||
<el-table-column label="子项步长" align="center" prop="step" />
|
||||
<el-table-column label="子项单位" align="center" prop="unit" />
|
||||
<el-table-column label="子项值范围" align="center" prop="valueRange" />
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="编号" align="center" prop="srvId" width="80" />
|
||||
<el-table-column label="项目名称" align="center" prop="prjName" width="250" />
|
||||
<el-table-column label="总包单位" align="center" prop="deptName" width="250" />
|
||||
<el-table-column label="监测项名称" align="center" prop="name" />
|
||||
<el-table-column label="监测项名称(EN)" align="center" prop="nameEn" />
|
||||
<el-table-column label="类型" align="center" prop="type" />
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPitElement, getPitElement, delPitElement, addPitElement, updatePitElement } from "@/api/device/pitElement";
|
||||
|
||||
export default {
|
||||
name: "PitElement",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 监测项管理表格数据
|
||||
pitElementList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
subDeptId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
projectOptions: [],
|
||||
depts: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
doQuerySub() {
|
||||
let prjId=this.queryParams.projectId;
|
||||
let tmps = this.prjDept2 && this.prjDept2[prjId] ? this.prjDept2[prjId] || [] : [];
|
||||
if (tmps.length > 0 || !prjId) {
|
||||
this.depts = tmps;
|
||||
if (tmps.length == 1) {
|
||||
this.queryParams.subDeptId = tmps[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.getList();
|
||||
return;
|
||||
}
|
||||
this.$api.publics.queryUnitList({
|
||||
projectId: prjId,
|
||||
unitTypes: "2".split(","),
|
||||
}).then((d) => {
|
||||
let objs = d.rows || [];
|
||||
if (!this.prjDept2) {
|
||||
this.prjDept2 = {};
|
||||
}
|
||||
this.prjDept2[prjId] = objs;
|
||||
this.depts = objs;
|
||||
if (objs.length == 1) {
|
||||
this.queryParams.subDeptId = objs[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
init() {
|
||||
if (this.projectOptions && this.projectOptions.length > 0) {
|
||||
return;
|
||||
}
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询监测项管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPitElement(this.queryParams).then(response => {
|
||||
this.pitElementList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
srvId: null,
|
||||
maxSp: null,
|
||||
monitorStatus: null,
|
||||
name: null,
|
||||
nameEn: null,
|
||||
type: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加监测项管理";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getPitElement(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) {
|
||||
updatePitElement(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPitElement(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 delPitElement(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('device/pitElement/export', {
|
||||
...this.queryParams
|
||||
}, `pitElement_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,394 @@
|
|||
<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="配置ID" prop="cfgId">
|
||||
<el-input
|
||||
v-model="queryParams.cfgId"
|
||||
placeholder="请输入配置ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端ID" prop="srvId">
|
||||
<el-input
|
||||
v-model="queryParams.srvId"
|
||||
placeholder="请输入服务端ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="dev_pitmonit_southsmos_element表srvId" prop="monitorElementId">
|
||||
<el-input
|
||||
v-model="queryParams.monitorElementId"
|
||||
placeholder="请输入dev_pitmonit_southsmos_element表srvId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端name" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入服务端name"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端step" prop="step">
|
||||
<el-input
|
||||
v-model="queryParams.step"
|
||||
placeholder="请输入服务端step"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端unit" prop="unit">
|
||||
<el-input
|
||||
v-model="queryParams.unit"
|
||||
placeholder="请输入服务端unit"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端valueRange" prop="valueRange">
|
||||
<el-input
|
||||
v-model="queryParams.valueRange"
|
||||
placeholder="请输入服务端valueRange"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端gmtCreate" prop="gmtCreate">
|
||||
<el-input
|
||||
v-model="queryParams.gmtCreate"
|
||||
placeholder="请输入服务端gmtCreate"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端gmtModified" prop="gmtModified">
|
||||
<el-input
|
||||
v-model="queryParams.gmtModified"
|
||||
placeholder="请输入服务端gmtModified"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-input
|
||||
v-model="queryParams.state"
|
||||
placeholder="请输入状态"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input
|
||||
v-model="queryParams.isDel"
|
||||
placeholder="请输入${comment}"
|
||||
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="['device:pitElementItem: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="['device:pitElementItem: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="['device:pitElementItem: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="['device:pitElementItem:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pitElementItemList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="id" />
|
||||
<el-table-column label="配置ID" align="center" prop="cfgId" />
|
||||
<el-table-column label="服务端ID" align="center" prop="srvId" />
|
||||
<el-table-column label="dev_pitmonit_southsmos_element表srvId" align="center" prop="monitorElementId" />
|
||||
<el-table-column label="服务端name" align="center" prop="name" />
|
||||
<el-table-column label="服务端step" align="center" prop="step" />
|
||||
<el-table-column label="服务端unit" align="center" prop="unit" />
|
||||
<el-table-column label="服务端valueRange" align="center" prop="valueRange" />
|
||||
<el-table-column label="服务端gmtCreate" align="center" prop="gmtCreate" />
|
||||
<el-table-column label="服务端gmtModified" align="center" prop="gmtModified" />
|
||||
<el-table-column label="状态" align="center" prop="state" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="${comment}" align="center" prop="isDel" />
|
||||
<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="['device:pitElementItem:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['device:pitElementItem: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" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="配置ID" prop="cfgId">
|
||||
<el-input v-model="form.cfgId" placeholder="请输入配置ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端ID" prop="srvId">
|
||||
<el-input v-model="form.srvId" placeholder="请输入服务端ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="dev_pitmonit_southsmos_element表srvId" prop="monitorElementId">
|
||||
<el-input v-model="form.monitorElementId" placeholder="请输入dev_pitmonit_southsmos_element表srvId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端name" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入服务端name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端step" prop="step">
|
||||
<el-input v-model="form.step" placeholder="请输入服务端step" />
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端unit" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入服务端unit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端valueRange" prop="valueRange">
|
||||
<el-input v-model="form.valueRange" placeholder="请输入服务端valueRange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端gmtCreate" prop="gmtCreate">
|
||||
<el-input v-model="form.gmtCreate" placeholder="请输入服务端gmtCreate" />
|
||||
</el-form-item>
|
||||
<el-form-item label="服务端gmtModified" prop="gmtModified">
|
||||
<el-input v-model="form.gmtModified" placeholder="请输入服务端gmtModified" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-input v-model="form.state" placeholder="请输入状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input v-model="form.isDel" placeholder="请输入${comment}" />
|
||||
</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 { listPitElementItem, getPitElementItem, delPitElementItem, addPitElementItem, updatePitElementItem } from "@/api/device/pitElementItem";
|
||||
|
||||
export default {
|
||||
name: "PitElementItem",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 测项明细表格数据
|
||||
pitElementItemList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
cfgId: null,
|
||||
srvId: null,
|
||||
monitorElementId: null,
|
||||
name: null,
|
||||
step: null,
|
||||
unit: null,
|
||||
valueRange: null,
|
||||
gmtCreate: null,
|
||||
gmtModified: null,
|
||||
state: null,
|
||||
isDel: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询测项明细列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPitElementItem(this.queryParams).then(response => {
|
||||
this.pitElementItemList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
srvId: null,
|
||||
monitorElementId: null,
|
||||
name: null,
|
||||
step: null,
|
||||
unit: null,
|
||||
valueRange: null,
|
||||
gmtCreate: null,
|
||||
gmtModified: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加测项明细";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getPitElementItem(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) {
|
||||
updatePitElementItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPitElementItem(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 delPitElementItem(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('device/pitElementItem/export', {
|
||||
...this.queryParams
|
||||
}, `pitElementItem_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,285 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
|
||||
<el-form-item label="项目名称" prop="projectId">
|
||||
<el-select v-model="queryParams.projectId" filterable placeholder="请选择项目" clearable @change="doQuerySub">
|
||||
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总包单位" prop="subDeptId">
|
||||
<el-select v-model="queryParams.subDeptId" filterable placeholder="请选择总包单位" clearable >
|
||||
<el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="监测项名称" prop="meName">
|
||||
<el-input v-model="queryParams.meName" placeholder="请输入监测项名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<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" v-if="hasPosition" plain icon="el-icon-location-outline" size="mini" @click="handlePosition">标注</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8" v-if="1==2">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['device:pitSurveyPoint: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="['device:pitSurveyPoint: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="['device:pitSurveyPoint: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="['device:pitSurveyPoint:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pitSurveyPointList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="编号" align="center" prop="spId" width="80" />
|
||||
<el-table-column label="项目名称" align="center" prop="prjName" width="180" />
|
||||
<el-table-column label="总包单位" align="center" prop="deptName" width="180" />
|
||||
<el-table-column label="所属监测点组名称" align="center" prop="groupName" />
|
||||
<el-table-column label="监测项名称" align="center" prop="meName" />
|
||||
<el-table-column label="监测项英文标识名" align="center" prop="meNameEn" />
|
||||
<el-table-column label="测点名称" align="center" prop="name" />
|
||||
<el-table-column label="数据来源形式" align="center" prop="dataSource" >
|
||||
<template slot-scope="scope">{{ ["人工上传","设备"][scope.row.dataSource] }}</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<surveyPointPositionDrawer ref="ptDrawer" @success="handleQuery"></surveyPointPositionDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPitSurveyPoint, getPitSurveyPoint, delPitSurveyPoint, addPitSurveyPoint, updatePitSurveyPoint } from "@/api/device/pitSurveyPoint";
|
||||
import surveyPointPositionDrawer from './surveyPointPositionDrawer.vue'
|
||||
export default {
|
||||
name: "PitSurveyPoint",
|
||||
components:{
|
||||
surveyPointPositionDrawer
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 测点管理表格数据
|
||||
pitSurveyPointList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId:null,
|
||||
subDeptId:null,
|
||||
meName:'',
|
||||
name:'',
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
projectOptions: [],
|
||||
depts: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.init();
|
||||
},
|
||||
computed:{
|
||||
hasPosition(){
|
||||
return this.queryParams.projectId && this.pitSurveyPointList.length>0;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handlePosition(){
|
||||
this.$refs.ptDrawer.show(this.pitSurveyPointList,this.queryParams);
|
||||
},
|
||||
doQuerySub() {
|
||||
let prjId=this.queryParams.projectId;
|
||||
let tmps = this.prjDept2 && this.prjDept2[prjId] ? this.prjDept2[prjId] || [] : [];
|
||||
if (tmps.length > 0 || !prjId) {
|
||||
this.depts = tmps;
|
||||
if (tmps.length == 1) {
|
||||
this.queryParams.subDeptId = tmps[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.getList();
|
||||
return;
|
||||
}
|
||||
this.$api.publics.queryUnitList({
|
||||
projectId: prjId,
|
||||
unitTypes: "2".split(","),
|
||||
}).then((d) => {
|
||||
let objs = d.rows || [];
|
||||
if (!this.prjDept2) {
|
||||
this.prjDept2 = {};
|
||||
}
|
||||
this.prjDept2[prjId] = objs;
|
||||
this.depts = objs;
|
||||
if (objs.length == 1) {
|
||||
this.queryParams.subDeptId = objs[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
init() {
|
||||
if (this.projectOptions && this.projectOptions.length > 0) {
|
||||
return;
|
||||
}
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询测点管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPitSurveyPoint(this.queryParams).then(response => {
|
||||
this.pitSurveyPointList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
spId: null,
|
||||
groupId: null,
|
||||
groupName: null,
|
||||
meId: null,
|
||||
meName: null,
|
||||
meNameEn: null,
|
||||
modifyDate: null,
|
||||
name: null,
|
||||
position: null,
|
||||
dataSource: null,
|
||||
createDate: null,
|
||||
status: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加测点管理";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getPitSurveyPoint(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) {
|
||||
updatePitSurveyPoint(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPitSurveyPoint(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 delPitSurveyPoint(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('device/pitSurveyPoint/export', {
|
||||
...this.queryParams
|
||||
}, `pitSurveyPoint_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,81 @@
|
|||
<template>
|
||||
<div class="pit-image-drawer" v-if="isOpen" style="padding:0px 10px">
|
||||
<el-drawer v-if="isOpen" v-model="isOpen" direction="rtl" size="50%"
|
||||
style="padding-left: 20px" title="项目基坑图片管理">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="基坑图片" prop="imageUrls">
|
||||
<image-upload v-model="form.imageUrls" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
updateSurProject
|
||||
} from "@/api/project/surProject";
|
||||
export default {
|
||||
name: 'RuoyiUiPitImageDrawer',
|
||||
|
||||
data() {
|
||||
return {
|
||||
isOpen:false,
|
||||
prj:null,
|
||||
form:{
|
||||
imageUrls:[]
|
||||
},
|
||||
rules: {
|
||||
imageUrls: [{ required: true, message: "请上传验收图片", trigger: "blur" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
submitForm(){
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
let postData={
|
||||
id:this.prj.id,
|
||||
prjPlanUrl:this.form.imageUrls
|
||||
};
|
||||
updateSurProject(postData).then(d=>{
|
||||
if(d.code==200){
|
||||
this.prj.prjPlanUrl=this.form.imageUrls;
|
||||
this.$modal.msgSuccess("修改成功!");
|
||||
}else{
|
||||
this.$modal.msgError("修改失败!");
|
||||
}
|
||||
this.isOpen=false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel(){
|
||||
this.isOpen=false;
|
||||
},
|
||||
show(prj) {
|
||||
this.prj = prj;
|
||||
if(prj.prjPlanUrl){
|
||||
this.form.imageUrls=prj.prjPlanUrl;
|
||||
}
|
||||
this.isOpen = true;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.pit-image-drawer{
|
||||
.el-drawer__body{
|
||||
padding:0px 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,128 @@
|
|||
<template>
|
||||
<div class="survey-point-position-drawer" v-if="isOpen" style="padding:0px 10px">
|
||||
<el-drawer v-if="isOpen" v-model="isOpen" direction="rtl" size="960px"
|
||||
style="padding-left: 20px" title="项目基坑标注">
|
||||
<div style="width:940px;height:560px;" class="main-div" :style="'background-image:url('+imgUrl+')'">
|
||||
<span v-for="(it,idx) in pts" :key="idx" class="pt-item"
|
||||
v-move
|
||||
:style="'top:'+it.y+'px;left:'+it.x+'px;'">
|
||||
<i class="el-icon-location-outline pt-icon" ></i>
|
||||
<span class="pt-name">{{ it.name }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getSurProject} from "@/api/project/surProject";
|
||||
import {updatePitSurveyPoint } from "@/api/device/pitSurveyPoint";
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
name: 'RuoyiUiPitImageDrawer',
|
||||
data() {
|
||||
return {
|
||||
isOpen:false,
|
||||
pts:null,
|
||||
query:null,
|
||||
imgUrl:'',
|
||||
dragging:false,
|
||||
dragItem:null,
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
submitForm(){
|
||||
let pts=this.$el.querySelectorAll(".pt-item");
|
||||
let ajaxs=[];
|
||||
for(let i=0;i<pts.length;i++){
|
||||
let pt=pts[i];
|
||||
let top=pt.style.top.replace("px","");
|
||||
let left=pt.style.left.replace("px","");
|
||||
let obj={
|
||||
x:left,y:top
|
||||
}
|
||||
this.pts[i].position=JSON.stringify(obj);
|
||||
ajaxs.push(updatePitSurveyPoint({id:this.pts[i].id,position:this.pts[i].position}))
|
||||
}
|
||||
if(ajaxs.length>0){
|
||||
axios.all(ajaxs).then(res=>{
|
||||
if(res[0].code==200){
|
||||
this.$modal.msgSuccess("修改成功!");
|
||||
this.$emit("success")
|
||||
}else{
|
||||
this.$modal.msgError("修改失败!");
|
||||
}
|
||||
this.isOpen=false;
|
||||
});
|
||||
}else{
|
||||
this.isOpen=false;
|
||||
}
|
||||
},
|
||||
cancel(){
|
||||
this.isOpen=false;
|
||||
},
|
||||
show(pts,query) {
|
||||
this.pts = (pts||[]).map(it=>{
|
||||
let pt=this.$tryToJson(it.position,{x:0,y:0});
|
||||
it.x=pt.x||0;
|
||||
it.y=pt.y||0;
|
||||
return it;
|
||||
});
|
||||
this.query=query;
|
||||
this.isOpen = true;
|
||||
this.loadPitImage();
|
||||
},
|
||||
loadPitImage(){
|
||||
getSurProject(this.query.projectId).then(d=>{
|
||||
let url=d.data?.prjPlanUrl||"";
|
||||
if(!url){
|
||||
this.$modal.msgError("请配置项目的基坑图片[项目管理->更多操作->基坑图片管理]")
|
||||
}else{
|
||||
this.imgUrl=process.env.VUE_APP_BASE_API+url;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.survey-point-position-drawer{
|
||||
.el-drawer__body{
|
||||
padding:0px 10px;
|
||||
.main-div{
|
||||
margin-bottom: 20px;
|
||||
position: relative;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
.pt-item{
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
.pt-icon{
|
||||
color:#2962FF;
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
text-shadow: 1px 1px 0px #F3E5F5;
|
||||
}
|
||||
.pt-name{
|
||||
display: block;
|
||||
color: #2962FF;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
text-shadow: 1px 1px 0px #F3E5F5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,262 @@
|
|||
<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="projectId">
|
||||
<el-select v-model="queryParams.projectId" filterable placeholder="请选择项目" clearable @change="doQuerySub">
|
||||
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总包单位" prop="subDeptId">
|
||||
<el-select v-model="queryParams.subDeptId" filterable placeholder="请选择总包单位" clearable>
|
||||
<el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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" v-if="1==2">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['device:pitThreshold: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="['device:pitThreshold: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="['device:pitThreshold: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="['device:pitThreshold:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pitThresholdList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="编号" align="center" prop="id" width="80" />
|
||||
<el-table-column label="项目名称" align="center" prop="prjName" width="180" />
|
||||
<el-table-column label="总包单位" align="center" prop="deptName" width="180" />
|
||||
<el-table-column label="监测项" align="center" prop="elName" />
|
||||
<el-table-column label="监测分项" align="center" prop="monitorItemName" />
|
||||
<el-table-column label="类型" align="center" prop="type" />
|
||||
<el-table-column label="报警值等级" align="center" prop="level">
|
||||
<template slot-scope="scope">{{ ["正常","超预警值","超报警值","超控制值"][scope.row.level] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报警值配置" align="center" prop="threshold" />
|
||||
<el-table-column label="每天时间范围" align="center" prop="intervalA" >
|
||||
<template slot-scope="scope">{{scope.row.intervalA}}时 ~ {{ scope.row.intervalB }}时</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报警提示信息" align="center" prop="alarmInfo" />
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPitThreshold, getPitThreshold, delPitThreshold, addPitThreshold, updatePitThreshold } from "@/api/device/pitThreshold";
|
||||
|
||||
export default {
|
||||
name: "PitThreshold",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 报警阈值表格数据
|
||||
pitThresholdList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
subDeptId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
projectOptions: [],
|
||||
depts: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
doQuerySub() {
|
||||
let prjId=this.queryParams.projectId;
|
||||
let tmps = this.prjDept2 && this.prjDept2[prjId] ? this.prjDept2[prjId] || [] : [];
|
||||
if (tmps.length > 0 || !prjId) {
|
||||
this.depts = tmps;
|
||||
if (tmps.length == 1) {
|
||||
this.queryParams.subDeptId = tmps[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.getList();
|
||||
return;
|
||||
}
|
||||
this.$api.publics.queryUnitList({
|
||||
projectId: prjId,
|
||||
unitTypes: "2".split(","),
|
||||
}).then((d) => {
|
||||
let objs = d.rows || [];
|
||||
if (!this.prjDept2) {
|
||||
this.prjDept2 = {};
|
||||
}
|
||||
this.prjDept2[prjId] = objs;
|
||||
this.depts = objs;
|
||||
if (objs.length == 1) {
|
||||
this.queryParams.subDeptId = objs[0].deptId;
|
||||
} else {
|
||||
this.queryParams.subDeptId = '';
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
init() {
|
||||
if (this.projectOptions && this.projectOptions.length > 0) {
|
||||
return;
|
||||
}
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询报警阈值列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPitThreshold(this.queryParams).then(response => {
|
||||
this.pitThresholdList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
srvId: null,
|
||||
alarmInfo: null,
|
||||
alarmName: null,
|
||||
intervalA: null,
|
||||
intervalB: null,
|
||||
level: null,
|
||||
monitorElementId: null,
|
||||
monitorItemId: null,
|
||||
monitorItemName: null,
|
||||
tgId: null,
|
||||
threshold: null,
|
||||
type: null,
|
||||
unit: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加报警阈值";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getPitThreshold(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) {
|
||||
updatePitThreshold(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPitThreshold(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 delPitThreshold(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('device/pitThreshold/export', {
|
||||
...this.queryParams
|
||||
}, `pitThreshold_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue