Commit ee8f7bd4 authored by 耿迪迪's avatar 耿迪迪

Merge branch 'master' of ssh://111.61.77.35:15/gengdidi/gassafety

parents b1cb5b8e dafae2ab
......@@ -7,6 +7,7 @@ import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TPipe;
import com.zehong.system.domain.vo.PipeVo;
import com.zehong.system.service.ITPipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -35,7 +36,7 @@ public class TPipeController extends BaseController
public TableDataInfo list(TPipe tPipe)
{
startPage();
List<TPipe> list = tPipeService.selectTPipeList(tPipe);
List<PipeVo> list = tPipeService.selectTPipeList(tPipe);
return getDataTable(list);
}
......@@ -43,7 +44,7 @@ public class TPipeController extends BaseController
@GetMapping("/pipeAllInfoList")
public AjaxResult pipeAllInfoList(TPipe tPipe)
{
List<TPipe> list = tPipeService.selectTPipeList(tPipe);
List<PipeVo> list = tPipeService.selectTPipeList(tPipe);
return AjaxResult.success(list);
}
......@@ -55,8 +56,8 @@ public class TPipeController extends BaseController
@GetMapping("/export")
public AjaxResult export(TPipe tPipe)
{
List<TPipe> list = tPipeService.selectTPipeList(tPipe);
ExcelUtil<TPipe> util = new ExcelUtil<TPipe>(TPipe.class);
List<PipeVo> list = tPipeService.selectTPipeList(tPipe);
ExcelUtil<PipeVo> util = new ExcelUtil<PipeVo>(PipeVo.class);
return util.exportExcel(list, "管道信息数据");
}
......
package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TDeviceInfo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* 管道信息对象 t_pipe
*
* @author zehong
* @date 2021-07-08
*/
public class PipeVo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 管道id */
private Integer pipeId;
/** 企业id */
@Excel(name = "企业id")
private Integer enterpriseId;
/** 管道名称 */
@Excel(name = "管道名称")
private String pipeName;
/** 管道编号 */
@Excel(name = "管道编号")
private String pipeCode;
/** 设备列表 */
private List<TDeviceInfo> deviceInfoList;
/** 管道所在地址 */
@Excel(name = "管道所在地址")
private String pipeAddr;
/** 坐标 */
@Excel(name = "坐标")
private String coordinates;
/** 管道长度 */
@Excel(name = "管道长度")
private double pipeLength;
/** 管道类型(1地埋管线、2地表管线) */
@Excel(name = "管道类型", readConverterExp = "1地埋管线、2地表管线")
private String pipeType;
/** 管道压力(低压,中压,次高压,高压) */
@Excel(name = "管道压力", readConverterExp = "1低压,2中压,3次高压,4高压")
private String pipePressure;
/** 设备图片路径 */
@Excel(name = "设备图片路径")
private String iconUrl;
/** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date installationTime;
/** 最后巡检时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inspectionTime;
/** 是否删除 */
@Excel(name = "是否删除")
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setPipeId(Integer pipeId)
{
this.pipeId = pipeId;
}
public Integer getPipeId()
{
return pipeId;
}
public void setEnterpriseId(Integer enterpriseId)
{
this.enterpriseId = enterpriseId;
}
public Integer getEnterpriseId()
{
return enterpriseId;
}
public void setPipeName(String pipeName)
{
this.pipeName = pipeName;
}
public String getPipeName()
{
return pipeName;
}
public String getPipeCode() {
return pipeCode;
}
public void setPipeCode(String pipeCode) {
this.pipeCode = pipeCode;
}
public List<TDeviceInfo> getDeviceInfoList() {
return deviceInfoList;
}
public void setDeviceInfoList(List<TDeviceInfo> deviceInfoList) {
this.deviceInfoList = deviceInfoList;
}
public void setPipeAddr(String pipeAddr)
{
this.pipeAddr = pipeAddr;
}
public String getPipeAddr()
{
return pipeAddr;
}
public void setCoordinates(String coordinates)
{
this.coordinates = coordinates;
}
public String getCoordinates()
{
return coordinates;
}
public void setPipeLength(double pipeLength)
{
this.pipeLength = pipeLength;
}
public double getPipeLength()
{
return pipeLength;
}
public void setPipeType(String pipeType)
{
this.pipeType = pipeType;
}
public String getPipeType()
{
return pipeType;
}
public void setPipePressure(String pipePressure)
{
this.pipePressure = pipePressure;
}
public String getPipePressure()
{
return pipePressure;
}
public void setIconUrl(String iconUrl)
{
this.iconUrl = iconUrl;
}
public String getIconUrl()
{
return iconUrl;
}
public void setInstallationTime(Date installationTime)
{
this.installationTime = installationTime;
}
public Date getInstallationTime()
{
return installationTime;
}
public void setInspectionTime(Date inspectionTime)
{
this.inspectionTime = inspectionTime;
}
public Date getInspectionTime()
{
return inspectionTime;
}
public String getIsDel() {
return isDel;
}
public void setIsDel(String isDel) {
this.isDel = isDel;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
}
......@@ -24,10 +24,10 @@ public interface TDeviceInfoMapper
/**
* 查询设备信息
*
* @param deviceCode 设备信息ID
* @param pipeId 管道ID
* @return 设备信息
*/
public TDeviceInfo selectTDeviceInfoByCode(String deviceCode);
public List<TDeviceInfo> selectTDeviceInfoByPipeId(int pipeId);
/**
* 查询设备信息列表
......
......@@ -19,14 +19,6 @@ public interface TPipeMapper
*/
public TPipe selectTPipeById(int pipeId);
/**
* 查询管道信息
*
* @param pipeCode 管道编号
* @return 管道信息
*/
public TPipe selectTPipeByCode(String pipeCode);
/**
* 查询管道信息列表
*
......
......@@ -2,6 +2,7 @@ package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TPipe;
import com.zehong.system.domain.vo.PipeVo;
/**
* 管道信息Service接口
......@@ -17,7 +18,7 @@ public interface ITPipeService
* @param pipeId 管道信息ID
* @return 管道信息
*/
public TPipe selectTPipeById(int pipeId);
public PipeVo selectTPipeById(int pipeId);
/**
* 查询管道信息列表
......@@ -25,7 +26,7 @@ public interface ITPipeService
* @param tPipe 管道信息
* @return 管道信息集合
*/
public List<TPipe> selectTPipeList(TPipe tPipe);
public List<PipeVo> selectTPipeList(TPipe tPipe);
/**
* 统计管道总长度
......
......@@ -42,14 +42,8 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
TDeviceInfo tDeviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(deviceId);
BeanUtils.copyProperties(tDeviceInfo, deviceInfoVo);
/* if (StringUtils.isNotEmpty(tDeviceInfo.getDeviceType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_device_type");
for (SysDictData sysDictData : sysDictDataList) {
if (tDeviceInfo.getDeviceType().equals(sysDictData.getDictValue())) {
deviceInfoVo.setDeviceType(sysDictData.getDictLabel());
}
}
}*/
TPipe pipe = tPipeMapper.selectTPipeById(tDeviceInfo.getPipeId());
deviceInfoVo.setPipeName(pipe.getPipeName());
return deviceInfoVo;
}
......@@ -75,15 +69,6 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
TPipe pipe = tPipeMapper.selectTPipeById(device.getPipeId());
deviceInfoVo.setPipeName(pipe.getPipeName());
/* if (StringUtils.isNotEmpty(device.getDeviceType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_device_type");
for (SysDictData sysDictData : sysDictDataList) {
if (device.getDeviceType().equals(sysDictData.getDictValue())) {
deviceInfoVo.setDeviceType(sysDictData.getDictLabel());
}
}
}*/
list.add(deviceInfoVo);
}
}
......
package com.zehong.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.zehong.common.core.domain.entity.SysDictData;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.vo.PipeVo;
import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.service.ISysDictTypeService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TPipeMapper;
......@@ -23,8 +28,7 @@ public class TPipeServiceImpl implements ITPipeService
@Autowired
private TPipeMapper tPipeMapper;
@Autowired
private ISysDictTypeService iSysDictTypeService;
private TDeviceInfoMapper tDeviceInfoMapper;
/**
* 查询管道信息
*
......@@ -32,26 +36,18 @@ public class TPipeServiceImpl implements ITPipeService
* @return 管道信息
*/
@Override
public TPipe selectTPipeById(int pipeId)
public PipeVo selectTPipeById(int pipeId)
{
PipeVo pipeVo = new PipeVo();
TPipe tPipe = tPipeMapper.selectTPipeById(pipeId);
if (StringUtils.isNotEmpty(tPipe.getPipeType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_pipe_type");
for (SysDictData sysDictData : sysDictDataList) {
if (tPipe.getPipeType().equals(sysDictData.getDictValue())) {
tPipe.setPipeType(sysDictData.getDictLabel());
}
}
}
if (StringUtils.isNotEmpty(tPipe.getPipePressure())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_pipe_pressure");
for (SysDictData sysDictData : sysDictDataList) {
if (tPipe.getPipePressure().equals(sysDictData.getDictValue())) {
tPipe.setPipePressure(sysDictData.getDictLabel());
}
}
BeanUtils.copyProperties(tPipe, pipeVo);
List<TDeviceInfo> deviceInfoList = tDeviceInfoMapper.selectTDeviceInfoByPipeId(tPipe.getPipeId());
if(deviceInfoList.size() != 0) {
pipeVo.setDeviceInfoList(deviceInfoList);
}
return tPipe;
return pipeVo;
}
/**
......@@ -61,35 +57,26 @@ public class TPipeServiceImpl implements ITPipeService
* @return 管道信息
*/
@Override
public List<TPipe> selectTPipeList(TPipe tPipe)
public List<PipeVo> selectTPipeList(TPipe tPipe)
{
List<PipeVo> list = new ArrayList<>();
List<TPipe> tPipeList = tPipeMapper.selectTPipeList(tPipe);
if(tPipeList.size() != 0){
for(TPipe pipe : tPipeList){
PipeVo pipeVo = new PipeVo();
BeanUtils.copyProperties(pipe, pipeVo);
if (StringUtils.isNotEmpty(pipe.getPipeType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_pipe_type");
for (SysDictData sysDictData : sysDictDataList) {
if (pipe.getPipeType().equals(sysDictData.getDictValue())) {
pipe.setPipeType(sysDictData.getDictLabel());
}
}
}
if (StringUtils.isNotEmpty(pipe.getPipePressure())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_pipe_pressure");
for (SysDictData sysDictData : sysDictDataList) {
if (pipe.getPipePressure().equals(sysDictData.getDictValue())) {
pipe.setPipePressure(sysDictData.getDictLabel());
}
}
List<TDeviceInfo> deviceInfoList = tDeviceInfoMapper.selectTDeviceInfoByPipeId(pipe.getPipeId());
if(deviceInfoList.size() != 0) {
pipeVo.setDeviceInfoList(deviceInfoList);
}
list.add(pipeVo);
}
}
return tPipeList;
return list;
}
/**
......@@ -122,6 +109,16 @@ public class TPipeServiceImpl implements ITPipeService
@Override
public int updateTPipe(TPipe tPipe)
{
if("1".equals(tPipe.getIsDel())){
List<TDeviceInfo> tDeviceInfoList = tDeviceInfoMapper.selectTDeviceInfoByPipeId(tPipe.getPipeId());
if(tDeviceInfoList.size() != 0) {
for (TDeviceInfo device : tDeviceInfoList) {
device.setIsDel("1");
tDeviceInfoMapper.updateTDeviceInfo(device);
}
}
}
return tPipeMapper.updateTPipe(tPipe);
}
......
......@@ -56,9 +56,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where device_id = #{deviceId}
</select>
<select id="selectTDeviceInfoByCode" parameterType="String" resultMap="TDeviceInfoResult">
<select id="selectTDeviceInfoByPipeId" parameterType="int" resultMap="TDeviceInfoResult">
<include refid="selectTDeviceInfoVo"/>
where device_code = #{deviceCode}
where pipe_id = #{pipeId}
</select>
<select id="countDeviceByType" resultType="map">
......
......@@ -48,11 +48,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where pipe_id = #{pipeId}
</select>
<select id="selectTPipeByCode" parameterType="String" resultMap="TPipeResult">
<include refid="selectTPipeVo"/>
where pipe_code = #{pipeCode}
</select>
<select id="countPipeLength" resultType="double">
select sum(pipe_length) from t_pipe
where is_del = '0'
......
......@@ -86,19 +86,18 @@
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="所属管道" align="center" prop="pipeName" />
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="所在地址" align="center" prop="deviceAddr" />
<el-table-column label="安装时间" align="center" prop="installationTime" width="180">
<el-table-column label="设备类型" align="center" prop="deviceType">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.installationTime) }}</span>
</template>
</el-table-column>
<el-table-column label="最后巡检时间" align="center" prop="inspectionTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.inspectionTime) }}</span>
<span v-if="scope.row.deviceType == 1">调压箱</span>
<span v-if="scope.row.deviceType == 2">阀门井</span>
<span v-if="scope.row.deviceType == 3">流量计</span>
<span v-if="scope.row.deviceType == 4">智能燃气表</span>
</template>
</el-table-column>
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="所在地址" align="center" prop="deviceAddr" />
<el-table-column label="安装时间" align="center" prop="installationTime" width="180" />
<el-table-column label="最后巡检时间" align="center" prop="inspectionTime" width="180" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -108,6 +107,12 @@
@click="handleUpdate(scope.row)"
v-hasPermi="['device:deviceInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="showDetail(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
......@@ -209,6 +214,7 @@
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- <Mapdialog v-if="loadmap" :dialogTableVisible="dialogTableVisible" @dialogcancelFun="dialogcancelFun" :slat="form.latitude" :slng="form.longitude" @confirm="qrFun" />-->
</div>
</template>
......@@ -216,6 +222,7 @@
import { listDeviceInfo, getDeviceInfo, addDeviceInfo, updateDeviceInfo, exportDeviceInfo } from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from '@/components/MyFileUpload';
// import Mapdialog from "@/components/maplnglat.vue";
export default {
name: "DeviceInfo",
......@@ -248,6 +255,9 @@ export default {
options: [],
// 上传文件列表
fileList: [],
// 地图
loadmap: false,
dialogTableVisible: false,
// 设备类型字典
typeOptions: [],
// 查询参数
......@@ -300,6 +310,19 @@ export default {
this.form.url = "";
this.fileList = [];
},
// qrFun(res) {
// //确认选择经纬度
// this.form.longitude = res.lng;
// this.form.latitude = res.lat;
// },
// MapdialogFun() {
// this.loadmap = true;
// this.dialogTableVisible = true;
// },
// dialogcancelFun() {
// this.loadmap = false;
// this.dialogTableVisible = false;
// },
// 取消按钮
cancel() {
this.open = false;
......@@ -420,7 +443,16 @@ export default {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
/** 详细信息跳转 */
showDetail(row) {
this.$router.push({
path: '/device/deviceInfoDetail',
query: {
deviceId: row.deviceId
}
})
},
}
};
</script>
......
<template>
<div class="app-container detail" style="background-color: rgb(238, 241, 245);">
<div style="padding-top: 10px;background: #fff;height: 100%;">
<div style="width: 5%;height: 45px;margin-left: 20px;" @click="$router.go(-1)">
<el-button
size="medium"
type="text"
style="font-size: 18px; color: rgb(7, 63, 112);float: left;"
>返回</el-button>
<div style="float: left;margin-top: 8px;margin-left: 5px;"><img src="../../../assets/logo/fanhui.png" style="width: 25px;" alt=""></div>
</div>
<div style="width: 100%;height: 440px;">
<el-divider></el-divider>
<div style="color: #31EAEA;width: 30%;height: 30px;">
<ul><li>详细信息</li></ul>
</div>
<div style="float: left;width: 50%;">
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;margin-left: 50px;width: 50%;margin-bottom: 25px;">
<el-form-item label="设备名称:" prop="deviceName">
<font>{{form.deviceName}}</font>
</el-form-item>
<el-form-item label="设备编号:" prop="deviceCode">
<font>{{form.deviceCode}}</font>
</el-form-item>
<el-form-item label="设备类型:" prop="deviceType">
<font v-if="form.deviceType == 1">调压阀</font>
<font v-if="form.deviceType == 2">阀门井</font>
<font v-if="form.deviceType == 3">流量计</font>
<font v-if="form.deviceType == 4">压力表</font>
</el-form-item>
<el-form-item label="设备型号:" prop="deviceModel">
<font>{{form.deviceModel}}</font>
</el-form-item>
<el-form-item label="物联网编号:" prop="iotNo" v-if="form.iotNo != null || form.iotNo != ''">
<font>{{form.iotNo}}</font>
</el-form-item>
<el-form-item label="联系人:" prop="linkman">
<font>{{form.linkman}}</font>
</el-form-item>
<el-form-item label="联系电话:" prop="phone">
<font>{{form.phone}}</font>
</el-form-item>
<el-form-item label="备注信息:" prop="remarks">
<font>{{form.remarks}}</font>
</el-form-item>
</el-form>
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;width: 40%;">
<el-form-item label="所属管道:" prop="pipeName">
<font>{{form.pipeName}}</font>
</el-form-item>
<el-form-item label="所在地址:" prop="deviceAddr">
<font>{{form.deviceAddr}}</font>
</el-form-item>
<el-form-item label="经度:" prop="longitude">
<font>{{form.longitude}}</font>
</el-form-item>
<el-form-item label="经度:" prop="latitude">
<font>{{form.latitude}}</font>
</el-form-item>
<el-form-item label="安装时间:" prop="installationTime">
<font>{{form.installationTime}}</font>
</el-form-item>
<el-form-item label="最后巡检时间:" prop="inspectionTime">
<font>{{form.inspectionTime}}</font>
</el-form-item>
<el-form-item label="设备图片:" prop="inspectionTime">
<el-image :src="form.iconUrl" :preview-src-list="[form.iconUrl]" style="width: 90px;"></el-image>
</el-form-item>
</el-form>
</div>
<div id="marbox" style="width: 700px;height: 400px;float: left;margin-top: -25px; border: 1px solid rgb(218, 213, 213);">
<div style="width: 100%;height: 100%" id="container"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import { getDeviceInfo } from "@/api/device/deviceInfo";
import gaodeMap from "utils/gaodeMap.js";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
export default {
name: "DeviceInfoDetail",
components: {
},
data() {
return {
// 表单参数
form: { },
// 表单校验
rules: { }
};
},
created() {
// 如果是跳转来的,则接受初始化参数
this.deviceId = this.$route.query.deviceId;
this.getDetail();
},
mounted(){
let gaoMap = new gaodeMap("石家庄");
this.gaoMap = gaoMap;
},
methods: {
/** 获取巡检计划详情 */
getDetail (){
getDeviceInfo(this.deviceId).then(response =>{
this.form = response.data;
console.log("this.form",this.form)
this.gaoMap.resetMapCenter([this.form.longitude, this.form.latitude]);
this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, this.form)
});
},
}
}
</script>
<style>
.el-divider--horizontal {
display: block;
height: 1px;
width: 100%;
margin: 20px 0;
}
.feedbackTime-div{
float: left;margin-left: 150px;margin-top: 10px;
}
.feedbackTime{
height: 120px;
width: 120px;
float: left;
margin-left: 15px;
margin-top: 5px;
margin-bottom: 15px;
display: flex;
justify-content: center;
align-items: center;
}
.el-card__body {
padding: 5px 20px 20px 20px;
}
.detail .el-form{
width: 20%;
}
.detail .el-form-item{
margin-bottom: 0px;
}
.avatar-uploader{
width: 25%;
float: left;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
li{
font-size: 15px;
font-weight: 900;
}
</style>
......@@ -85,20 +85,24 @@
<el-table v-loading="loading" :data="pipeList" @selection-change="handleSelectionChange">
<el-table-column label="管道名称" align="center" prop="pipeName" />
<el-table-column label="管道编号" align="center" prop="pipeCode" />
<el-table-column label="管道类型" align="center" prop="pipeType" />
<el-table-column label="管道压力" align="center" prop="pipePressure" />
<el-table-column label="管道长度" align="center" prop="pipeLength" />
<el-table-column label="所在地址" align="center" prop="pipeAddr" />
<el-table-column label="安装时间" align="center" prop="installationTime" width="180">
<el-table-column label="管道类型" align="center" prop="pipeType" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.installationTime)}}</span>
<span v-if="scope.row.pipeType == 1">地埋管线</span>
<span v-if="scope.row.pipeType == 2">地表管线</span>
</template>
</el-table-column>
<el-table-column label="最后巡检时间" align="center" prop="inspectionTime" width="180">
<el-table-column label="管道压力" align="center" prop="pipePressure" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.inspectionTime)}}</span>
<span v-if="scope.row.pipePressure == 1">低压</span>
<span v-if="scope.row.pipePressure == 2">中压</span>
<span v-if="scope.row.pipePressure == 3">次高压</span>
<span v-if="scope.row.pipePressure == 4">高压</span>
</template>
</el-table-column>
<el-table-column label="管道长度" align="center" prop="pipeLength" />
<el-table-column label="所在地址" align="center" prop="pipeAddr" />
<el-table-column label="安装时间" align="center" prop="installationTime" width="180" />
<el-table-column label="最后巡检时间" align="center" prop="inspectionTime" width="180" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -108,6 +112,12 @@
@click="handleUpdate(scope.row)"
v-hasPermi="['device:pipe:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="showDetail(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
......@@ -369,7 +379,12 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
row.isDel = "1";
this.$confirm('是否确认删除管道名称为"' + row.pipeName + '"的数据项?', "警告", {
var devices = " ";
for(var i = 0; i < row.deviceInfoList.length; i++){
var obj = row.deviceInfoList[i];
devices = devices + obj.deviceName + " ";
}
this.$confirm('请确认是否删除管道名称为"' + row.pipeName + '"的数据项,该管道下包含的设备(' + devices + ')将一并被删除', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......@@ -395,7 +410,16 @@ export default {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
/** 详细信息跳转 */
showDetail(row) {
this.$router.push({
path: '/device/pipeDetail',
query: {
pipeId: row.pipeId
}
})
},
}
};
</script>
<template>
<div class="app-container detail" style="background-color: rgb(238, 241, 245);">
<div style="padding-top: 10px;background: #fff;height: 100%;">
<div style="width: 5%;height: 45px;margin-left: 20px;" @click="$router.go(-1)">
<el-button
size="medium"
type="text"
style="font-size: 18px; color: rgb(7, 63, 112);float: left;"
>返回</el-button>
<div style="float: left;margin-top: 8px;margin-left: 5px;"><img src="../../../assets/logo/fanhui.png" style="width: 25px;" alt=""></div>
</div>
<div style="width: 100%;height: 440px;">
<el-divider></el-divider>
<div style="color: #31EAEA;width: 30%;height: 30px;">
<ul><li>详细信息</li></ul>
</div>
<div style="float: left;width: 50%;">
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;margin-left: 50px;width: 50%;margin-bottom: 25px;">
<el-form-item label="管道名称:" prop="pipeName">
<font>{{form.pipeName}}</font>
</el-form-item>
<el-form-item label="管道编号:" prop="pipeCode">
<font>{{form.pipeCode}}</font>
</el-form-item>
<el-form-item label="管道类型:" prop="pipeType">
<font v-if="form.pipeType == 1">地埋管线</font>
<font v-if="form.pipeType == 2">地表管线</font>
</el-form-item>
<el-form-item label="管道压力:" prop="pipePressure">
<font v-if="form.pipePressure == 1">低压</font>
<font v-if="form.pipePressure == 2">中压</font>
<font v-if="form.pipePressure == 3">次高压</font>
<font v-if="form.pipePressure == 4">高压</font>
</el-form-item>
<el-form-item label="管道长度:" prop="pipeLength">
<font>{{form.pipeLength}}</font>
</el-form-item>
<el-form-item label="备注信息:" prop="remarks">
<font>{{form.remarks}}</font>
</el-form-item>
</el-form>
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;width: 40%;">
<el-form-item label="管道地址:" prop="pipeAddr">
<font>{{form.pipeAddr}}</font>
</el-form-item>
<el-form-item label="安装时间:" prop="installationTime">
<font>{{form.installationTime}}</font>
</el-form-item>
<el-form-item label="最后巡检时间:" prop="inspectionTime">
<font>{{form.inspectionTime}}</font>
</el-form-item>
<el-form-item label="管道图片:" prop="inspectionTime">
<el-image :src="form.iconUrl" :preview-src-list="[form.iconUrl]" style="width: 90px;"></el-image>
</el-form-item>
</el-form>
</div>
<div id="marbox" style="width: 700px;height: 400px;float: left;margin-top: -25px; border: 1px solid rgb(218, 213, 213);">
<div style="width: 100%;height: 100%" id="container"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import { getPipe } from "@/api/device/pipe";
import gaodeMap from "utils/gaodeMap.js";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
export default {
name: "PipeDetail",
components: {
},
data() {
return {
// 表单参数
form: { },
// 表单校验
rules: { }
};
},
created() {
// 如果是跳转来的,则接受初始化参数
this.pipeId = this.$route.query.pipeId;
this.getDetail();
},
mounted(){
let gaoMap = new gaodeMap("石家庄");
this.gaoMap = gaoMap;
},
methods: {
/** 获取巡检计划详情 */
getDetail (){
getPipe(this.pipeId).then(response =>{
this.form = response.data;
console.log("this.form",this.form)
this.gaoMap.resetMapCenter([this.form.longitude, this.form.latitude]);
this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, this.form)
});
},
}
}
</script>
<style>
.el-divider--horizontal {
display: block;
height: 1px;
width: 100%;
margin: 20px 0;
}
.feedbackTime-div{
float: left;margin-left: 150px;margin-top: 10px;
}
.feedbackTime{
height: 120px;
width: 120px;
float: left;
margin-left: 15px;
margin-top: 5px;
margin-bottom: 15px;
display: flex;
justify-content: center;
align-items: center;
}
.el-card__body {
padding: 5px 20px 20px 20px;
}
.detail .el-form{
width: 20%;
}
.detail .el-form-item{
margin-bottom: 0px;
}
.avatar-uploader{
width: 25%;
float: left;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
li{
font-size: 15px;
font-weight: 900;
}
</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