Commit 3b628f8b authored by 耿迪迪's avatar 耿迪迪

企业数据监控 gengdidi

parent 7dbf6501
...@@ -152,4 +152,16 @@ public class TDetectorInfoController extends BaseController ...@@ -152,4 +152,16 @@ public class TDetectorInfoController extends BaseController
return AjaxResult.success(map); return AjaxResult.success(map);
} }
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
@GetMapping("/selectDetectorMointor")
public TableDataInfo selectDetectorMointor(TDetectorInfo tDetectorInfo){
startPage();
List<TDetectorInfo> list = tDetectorInfoService.selectDetectorMointor(tDetectorInfo);
return getDataTable(list);
}
} }
...@@ -84,6 +84,28 @@ public class TDetectorInfo extends BaseEntity ...@@ -84,6 +84,28 @@ public class TDetectorInfo extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; private String remarks;
/**所属设备名称*/
private String beyondDevicename;
public String getBeyondDevicename() {
return beyondDevicename;
}
public void setBeyondDevicename(String beyondDevicename) {
this.beyondDevicename = beyondDevicename;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
/**所属企业名称*/
private String enterpriseName;
public void setDetectorId(Long detectorId) public void setDetectorId(Long detectorId)
{ {
this.detectorId = detectorId; this.detectorId = detectorId;
......
...@@ -90,6 +90,26 @@ public class TDeviceReportData extends BaseEntity ...@@ -90,6 +90,26 @@ public class TDeviceReportData extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; private String remarks;
private String beyondDeviceName;
private String deviceType;
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getBeyondDeviceName() {
return beyondDeviceName;
}
public void setBeyondDeviceName(String beyondDeviceName) {
this.beyondDeviceName = beyondDeviceName;
}
public void setDeviceReportDataId(Long deviceReportDataId) public void setDeviceReportDataId(Long deviceReportDataId)
{ {
this.deviceReportDataId = deviceReportDataId; this.deviceReportDataId = deviceReportDataId;
......
...@@ -79,4 +79,11 @@ public interface TDetectorInfoMapper ...@@ -79,4 +79,11 @@ public interface TDetectorInfoMapper
* @return * @return
*/ */
public Map<String,Object> selectDetectorNum(@Param("enterpriseIds")String[] enterpriseIds); public Map<String,Object> selectDetectorNum(@Param("enterpriseIds")String[] enterpriseIds);
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
List<TDetectorInfo> selectDetectorMointor(TDetectorInfo tDetectorInfo);
} }
...@@ -86,4 +86,11 @@ public interface ITDetectorInfoService ...@@ -86,4 +86,11 @@ public interface ITDetectorInfoService
* @return * @return
*/ */
public Map<String,Object> selectDetectorNum(String enterpriseId); public Map<String,Object> selectDetectorNum(String enterpriseId);
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
List<TDetectorInfo> selectDetectorMointor(TDetectorInfo tDetectorInfo);
} }
...@@ -156,4 +156,14 @@ public class TDetectorInfoServiceImpl implements ITDetectorInfoService ...@@ -156,4 +156,14 @@ public class TDetectorInfoServiceImpl implements ITDetectorInfoService
public Map<String,Object> selectDetectorNum(String enterpriseId){ public Map<String,Object> selectDetectorNum(String enterpriseId){
return tDetectorInfoMapper.selectDetectorNum(enterpriseId.split(",")); return tDetectorInfoMapper.selectDetectorNum(enterpriseId.split(","));
} }
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
@Override
public List<TDetectorInfo> selectDetectorMointor(TDetectorInfo tDetectorInfo){
return tDetectorInfoMapper.selectDetectorMointor(tDetectorInfo);
}
} }
...@@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="detectorStatus" column="detector_status" /> <result property="detectorStatus" column="detector_status" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
<result property="remarks" column="remarks" /> <result property="remarks" column="remarks" />
<result property="beyondDevicename" column="beyondDevicename" />
<result property="enterpriseName" column="enterprise_name" />
</resultMap> </resultMap>
<sql id="selectTDetectorInfoVo"> <sql id="selectTDetectorInfoVo">
...@@ -262,4 +264,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -262,4 +264,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
(SELECT COUNT(user_id) FROM t_detector_user WHERE is_del = 0) AS userNum (SELECT COUNT(user_id) FROM t_detector_user WHERE is_del = 0) AS userNum
FROM t_detector_info WHERE is_del = 0 FROM t_detector_info WHERE is_del = 0
</select> </select>
<select id="selectDetectorMointor" parameterType="TDetectorInfo" resultMap="TDetectorInfoResult">
SELECT
device.device_name AS beyondDevicename,
detector.detector_name,
detector.detector_code,
enterprise.enterprise_name,
detector.medium,
detector.detector_status,
detector.update_time AS reportTime
FROM
t_relation_device_detail_info relation
INNER JOIN t_detector_info detector ON detector.detector_code = relation.iot_no
INNER JOIN t_device_info device ON device.device_id = relation.relation_device_id
INNER JOIN t_enterprise_info enterprise ON enterprise.enterprise_id = device.beyond_enterprise_id
<where>
relation.device_type = '3' AND relation.is_del = '0'
<if test="enterpriseId != null and enterpriseId != ''"> and enterprise.enterprise_id = #{enterpriseId}</if>
<if test="detectorName != null and detectorName != ''"> and detector.detector_name like concat('%', #{detectorName}, '%')</if>
<if test="detectorCode != null and detectorCode != ''"> and detector.detector_code like concat('%', #{detectorCode}, '%')</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -27,38 +27,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -27,38 +27,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
<result property="remarks" column="remarks" /> <result property="remarks" column="remarks" />
<result property="beyondDeviceName" column="beyondDeviceName" />
<result property="deviceType" column="device_type" />
</resultMap> </resultMap>
<sql id="selectTDeviceReportDataVo"> <sql id="selectTDeviceReportDataVo">
select device_report_data_id, device_name, device_num, standard_condition_accumulation, working_condition_accumulation, backing_standard_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, report_time, communication_status, device_status, beyond_enterprise_id, beyond_enterprise_name, create_by, create_time, update_by, update_time, is_del, remarks from t_device_report_data SELECT
report.device_report_data_id,
report.device_name,
report.device_num,
report.standard_condition_accumulation,
report.working_condition_accumulation,
report.backing_standard_condition_accumulation,
report.residual_quantity,
report.standard_condition_flow,
report.working_condition_flow,
report.temperature,
report.pressure,
report.report_time,
report.communication_status,
report.device_status,
report.beyond_enterprise_id,
enterprise.enterprise_name AS beyond_enterprise_name,
report.create_by,
report.create_time,
report.update_by,
report.update_time,
report.is_del,
report.remarks,
device.device_name AS beyondDeviceName
FROM
t_device_report_data report
INNER JOIN t_relation_device_detail_info detail ON detail.iot_no = report.device_num
INNER JOIN t_device_info device ON device.device_id = detail.relation_device_id
INNER JOIN t_enterprise_info enterprise ON enterprise.enterprise_id = report.beyond_enterprise_id
</sql> </sql>
<select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult"> <select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/> <include refid="selectTDeviceReportDataVo"/>
<where> <where>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if> <if test="deviceName != null and deviceName != ''"> and report.device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceNum != null and deviceNum != ''"> and device_num like concat('%', #{deviceNum}, '%')</if> <if test="deviceNum != null and deviceNum != ''"> and report.device_num like concat('%', #{deviceNum}, '%')</if>
<if test="standardConditionAccumulation != null "> and standard_condition_accumulation = #{standardConditionAccumulation}</if> <if test="standardConditionAccumulation != null "> and report.standard_condition_accumulation = #{standardConditionAccumulation}</if>
<if test="workingConditionAccumulation != null "> and working_condition_accumulation = #{workingConditionAccumulation}</if> <if test="workingConditionAccumulation != null "> and report.working_condition_accumulation = #{workingConditionAccumulation}</if>
<if test="backingStandardConditionAccumulation != null "> and backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if> <if test="backingStandardConditionAccumulation != null "> and report.backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if>
<if test="residualQuantity != null "> and residual_quantity = #{residualQuantity}</if> <if test="residualQuantity != null "> and report.residual_quantity = #{residualQuantity}</if>
<if test="standardConditionFlow != null "> and standard_condition_flow = #{standardConditionFlow}</if> <if test="standardConditionFlow != null "> and report.standard_condition_flow = #{standardConditionFlow}</if>
<if test="workingConditionFlow != null "> and working_condition_flow = #{workingConditionFlow}</if> <if test="workingConditionFlow != null "> and report.working_condition_flow = #{workingConditionFlow}</if>
<if test="temperature != null "> and temperature = #{temperature}</if> <if test="temperature != null "> and report.temperature = #{temperature}</if>
<if test="pressure != null "> and pressure = #{pressure}</if> <if test="pressure != null "> and report.pressure = #{pressure}</if>
<if test="reportTime != null "> and report_time = #{reportTime}</if> <if test="reportTime != null "> and report.report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if> <if test="communicationStatus != null and communicationStatus != ''"> and report.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if> <if test="deviceStatus != null and deviceStatus != ''"> and report.device_status = #{deviceStatus}</if>
<if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if> <if test="beyondEnterpriseId != null "> and report.beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if> <if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and report.beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if> <if test="isDel != null and isDel != ''"> and report.is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="remarks != null and remarks != ''"> and report.remarks = #{remarks}</if>
<if test="deviceType != null and deviceType != ''">AND detail.device_type = #{deviceType}</if>
</where> </where>
</select> </select>
<select id="selectTDeviceReportDataById" parameterType="Long" resultMap="TDeviceReportDataResult"> <select id="selectTDeviceReportDataById" parameterType="Long" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/> <include refid="selectTDeviceReportDataVo"/>
where device_report_data_id = #{deviceReportDataId} where report.device_report_data_id = #{deviceReportDataId}
</select> </select>
<insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId"> <insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId">
......
...@@ -81,3 +81,16 @@ export function selectDeviceNum(query) { ...@@ -81,3 +81,16 @@ export function selectDeviceNum(query) {
params: query params: query
}) })
} }
//数据监控获取探测器数据
export function selectDetectorMointor(query){
return request({
url: '/detector/detectorInfo/selectDetectorMointor',
method: 'get',
params: {
pageNum: 1,
pageSize: 20,
...query,
},
})
}
<template>
<div class="detectorTab">
<el-table v-loading="loading" :data="childrenDataList">
<el-table-column label="所属设备名称" align="center" prop="beyondDevicename"/>
<el-table-column label="设备名称" align="center" prop="detectorName"/>
<el-table-column label="设备编号" align="center" prop="detectorCode"/>
<el-table-column label="所属企业" align="center" prop="enterpriseName" />
<el-table-column label="探测介质" align="center" prop="medium">
<template slot-scope="scope">
<span v-if="scope.row.medium == 1">甲烷</span>
<span v-if="scope.row.medium == 2">氨气</span>
<span v-if="scope.row.medium == 3">一氧化碳</span>
<span v-if="scope.row.medium == 4">可燃气体</span>
<span v-if="scope.row.medium == 5">有毒气体</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="detectorStatus">
<template slot-scope="scope">
<span v-if="scope.row.detectorStatus == 0">正常</span>
<span v-if="scope.row.detectorStatus == 1">离线</span>
<span v-if="scope.row.detectorStatus == 2">报警</span>
</template>
</el-table-column>
<el-table-column label="上报时间" align="center" prop="workingConditionAccumulation" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { selectDetectorMointor } from "@/api/detector/detectorInfo"
export default {
props:{
childrenQueryParams: {}
},
name: "DetectorTabData",
components: {
},
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10,
enterpriseId: 0,
detectorName: "",
detectorCode: ""
},
loading: true,
childrenDataList: [],
total: 0
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.queryParams.enterpriseId = this.childrenQueryParams.beyondEnterpriseId;
this.queryParams.detectorName = this.childrenQueryParams.deviceName;
this.queryParams.detectorCode = this.childrenQueryParams.deviceNum;
selectDetectorMointor(this.queryParams).then(response => {
this.childrenDataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
detectorHandleQuery(){
this.queryParams.pageNum = 1;
this.getList();
}
}
};
</script>
<style>
.detectorTab{
margin-bottom: 20px;
}
</style>
<template>
<div class="flowmeterTab">
<el-table v-loading="loading" :data="childrenDataList">
<el-table-column label="所属设备名称" align="center" prop="beyondDeviceName" width="155"/>
<el-table-column label="设备名称" align="center" prop="deviceName" width="155"/>
<el-table-column label="设备编号" align="center" prop="deviceNum" width="155"/>
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="标况累计量(m³)" align="center" prop="standardConditionAccumulation"/>
<el-table-column label="工况累计量(m³)" align="center" prop="workingConditionAccumulation" />
<el-table-column label="逆向标况累计量(m³)" align="center" prop="backingStandardConditionAccumulation" />
<el-table-column label="剩余量(m³)" align="center" prop="residualQuantity" />
<el-table-column label="标况流量(m³/h)" align="center" prop="standardConditionFlow" />
<el-table-column label="工况流量(m³/h)" align="center" prop="workingConditionFlow" />
<el-table-column label="温度(℃)" align="center" prop="temperature" />
<el-table-column label="压力(KPa)" align="center" prop="pressure" />
<el-table-column label="上报时间" align="center" prop="createTime" width="180" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data";
export default {
props:{
childrenQueryParams: {}
},
name: "FlowmeterTabData",
components: {
},
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10
},
loading: true,
childrenDataList: [],
total: 0
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.childrenQueryParams.pageNum = this.queryParams.pageNum;
this.childrenQueryParams.pageSize = this.queryParams.pageSize;
this.childrenQueryParams.deviceType = '2';
listData(this.childrenQueryParams).then(response => {
this.childrenDataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
flowmeterHandleQuery(){
this.queryParams.pageNum = 1;
this.getList();
}
}
};
</script>
<style>
.flowmeterTab {
margin-bottom: 20px;
}
</style>
<template>
<div class="pressureTab">
<el-table v-loading="loading" :data="childrenDataList">
<el-table-column label="所属设备名称" align="center" prop="beyondDeviceName"/>
<el-table-column label="设备名称" align="center" prop="deviceName"/>
<el-table-column label="设备编号" align="center" prop="deviceNum"/>
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName"/>
<el-table-column label="压力(KPa)" align="center" prop="pressure" />
<el-table-column label="上报时间" align="center" prop="createTime"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data";
export default {
props:{
childrenQueryParams: {}
},
name: "PressureTabData",
components: {
},
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10
},
loading: true,
childrenDataList: [],
total: 0
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.childrenQueryParams.pageNum = this.queryParams.pageNum;
this.childrenQueryParams.pageSize = this.queryParams.pageSize;
this.childrenQueryParams.deviceType = '1';
listData(this.childrenQueryParams).then(response => {
this.childrenDataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
pressureHandleQuery(){
this.queryParams.pageNum = 1;
this.getList();
}
}
};
</script>
<style>
.pressureTab{
margin-bottom: 20px;
}
</style>
...@@ -20,13 +20,6 @@ ...@@ -20,13 +20,6 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="所属企业" prop="beyondEnterpriseId"> <el-form-item label="所属企业" prop="beyondEnterpriseId">
<!--<el-input
v-model="queryParams.beyondEnterpriseName"
placeholder="请输入所属企业名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>-->
<el-select v-model="queryParams.beyondEnterpriseId" placeholder="请选择所属企业"> <el-select v-model="queryParams.beyondEnterpriseId" placeholder="请选择所属企业">
<el-option <el-option
v-for="item in enterprises" v-for="item in enterprises"
...@@ -42,169 +35,50 @@ ...@@ -42,169 +35,50 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<!--<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:data:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:data:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:data:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:data:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>-->
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-table-column type="selection" width="55" align="center" /> <el-tab-pane label="压力表" name="first" key="first">
<el-table-column label="设备名称" align="center" prop="deviceName" width="155"/> <pressureTab
<el-table-column label="设备编号" align="center" prop="deviceNum" width="155"/> :activeName="activeName"
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" /> :childrenQueryParams="queryParams"
<el-table-column label="标况累计量(m³)" align="center" prop="standardConditionAccumulation"/> v-if="activeName === 'first'"
<el-table-column label="工况累计量(m³)" align="center" prop="workingConditionAccumulation" /> ref="pressure"></pressureTab>
<el-table-column label="逆向标况累计量(m³)" align="center" prop="backingStandardConditionAccumulation" /> </el-tab-pane>
<el-table-column label="剩余量(m³)" align="center" prop="residualQuantity" />
<el-table-column label="标况流量(m³/h)" align="center" prop="standardConditionFlow" />
<el-table-column label="工况流量(m³/h)" align="center" prop="workingConditionFlow" />
<el-table-column label="温度(℃)" align="center" prop="temperature" />
<el-table-column label="压力(KPa)" align="center" prop="pressure" />
<el-table-column label="上报时间" align="center" prop="createTime" width="180" />
<!-- <template slot-scope="scope">
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>-->
<!--<el-table-column label="创建时间" align="center" prop="createTime" />-->
<!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:data:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:data:remove']"
>删除</el-button>
</template>
</el-table-column>-->
</el-table>
<pagination <el-tab-pane label="流量计" name="second" key="second">
v-show="total>0" <flowmeterTab
:total="total" :activeName="activeName"
:page.sync="queryParams.pageNum" :childrenQueryParams="queryParams"
:limit.sync="queryParams.pageSize" v-if="activeName === 'second'"
@pagination="getList" ref="flowmeter"></flowmeterTab>
/> </el-tab-pane>
<el-tab-pane label="探测器" name="third" key="third">
<detector-tab
:activeName="activeName"
:childrenQueryParams="queryParams"
v-if="activeName === 'third'"
ref="detector">
</detector-tab>
</el-tab-pane>
</el-tabs>
<!-- 添加或修改设备监控对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备编号" prop="deviceNum">
<el-input v-model="form.deviceNum" placeholder="请输入设备编号" />
</el-form-item>
<el-form-item label="标况累计量" prop="standardConditionAccumulation">
<el-input v-model="form.standardConditionAccumulation" placeholder="请输入标况累计量" />
</el-form-item>
<el-form-item label="工况累计量" prop="workingConditionAccumulation">
<el-input v-model="form.workingConditionAccumulation" placeholder="请输入工况累计量" />
</el-form-item>
<el-form-item label="逆向标况累计量" prop="backingStandardConditionAccumulation">
<el-input v-model="form.backingStandardConditionAccumulation" placeholder="请输入逆向标况累计量" />
</el-form-item>
<el-form-item label="剩余量" prop="residualQuantity">
<el-input v-model="form.residualQuantity" placeholder="请输入剩余量" />
</el-form-item>
<el-form-item label="标况流量" prop="standardConditionFlow">
<el-input v-model="form.standardConditionFlow" placeholder="请输入标况流量" />
</el-form-item>
<el-form-item label="工况流量" prop="workingConditionFlow">
<el-input v-model="form.workingConditionFlow" placeholder="请输入工况流量" />
</el-form-item>
<el-form-item label="温度" prop="temperature">
<el-input v-model="form.temperature" placeholder="请输入温度" />
</el-form-item>
<el-form-item label="压力" prop="pressure">
<el-input v-model="form.pressure" placeholder="请输入压力" />
</el-form-item>
<el-form-item label="上报时间" prop="reportTime">
<el-date-picker clearable size="small"
v-model="form.reportTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择上报时间">
</el-date-picker>
</el-form-item>
<!--<el-form-item label="通讯状态">
<el-radio-group v-model="form.communicationStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="设备状态">
<el-radio-group v-model="form.deviceStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否删除(0正常,1删除)" prop="isDel">
<el-input v-model="form.isDel" placeholder="请输入是否删除(0正常,1删除)" />
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data"; import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data";
import { enterpriseLists } from "@/api/regulation/info"; import { enterpriseLists } from "@/api/regulation/info";
import detectorTab from "./component/detectorTab";
import flowmeterTab from "./component/flowmeterTab";
import pressureTab from "./component/pressureTab"
export default { export default {
name: "Data", name: "Data",
components: { components: {
detectorTab,
flowmeterTab,
pressureTab
}, },
data() { data() {
return { return {
...@@ -245,7 +119,8 @@ export default { ...@@ -245,7 +119,8 @@ export default {
communicationStatus: null, communicationStatus: null,
deviceStatus: null, deviceStatus: null,
isDel: null, isDel: null,
remarks: null remarks: null,
deviceType: "1"
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -255,23 +130,15 @@ export default { ...@@ -255,23 +130,15 @@ export default {
{ required: true, message: "设备id不能为空", trigger: "blur" } { required: true, message: "设备id不能为空", trigger: "blur" }
], ],
}, },
enterprises:[] enterprises:[],
activeName: "first"
}; };
}, },
created() { created() {
this.getList(); //this.getList();
this.getEnterpriseLists(); this.getEnterpriseLists();
}, },
methods: { methods: {
/** 查询设备监控列表 */
getList() {
this.loading = true;
listData(this.queryParams).then(response => {
this.dataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.open = false;
...@@ -304,91 +171,42 @@ export default { ...@@ -304,91 +171,42 @@ export default {
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; if("first" == this.activeName){
this.getList(); this.$refs.pressure.pressureHandleQuery();
}else if("second" == this.activeName){
this.$refs.flowmeter.flowmeterHandleQuery();
}else{
this.$refs.detector.detectorHandleQuery();
}
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.deviceReportDataId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备监控";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const deviceReportDataId = row.deviceReportDataId || this.ids
getData(deviceReportDataId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备监控";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.deviceReportDataId != null) {
updateData(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addData(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const deviceReportDataIds = row.deviceReportDataId || this.ids;
this.$confirm('是否确认删除设备监控编号为"' + deviceReportDataIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delData(deviceReportDataIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有设备监控数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportData(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
//所属单位 //所属单位
getEnterpriseLists(){ getEnterpriseLists(){
enterpriseLists().then(response => { enterpriseLists().then(response => {
this.enterprises = response.rows; this.enterprises = response.rows;
}); });
},
//切换tag
handleClick(tab, event){
if("0" == tab.index){
this.activeName = "first"
}else if("1" == tab.index){
this.activeName = "second"
}else{
this.activeName = "third"
}
} }
} }
}; };
</script> </script>
<style>
.el-tag {
margin-left: 10px;
text-align: center;
width: 200px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment