Commit 9a63bb8d authored by 王晓倩's avatar 王晓倩

管道信息、设备信息、巡线员、巡检记录页面调整,统计管道总长度、统计各类设备总数

parent e5f6c55d
package com.zehong.web.controller.device;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -100,4 +103,15 @@ public class TDeviceInfoController extends BaseController
{
return toAjax(tDeviceInfoService.deleteTDeviceInfoByIds(deviceIds));
}
/**
* 统计各设备类型的设备总数
*/
@PreAuthorize("@ss.hasPermi('device:deviceInfo:countDeviceByType')")
@GetMapping("/countDeviceByType")
public AjaxResult countDeviceByType()
{
List<Map<Object, Object>> list = tDeviceInfoService.countDeviceByType();
return AjaxResult.success(list);
}
}
......@@ -94,4 +94,14 @@ public class TPipeController extends BaseController
{
return toAjax(tPipeService.deleteTPipeByIds(pipeIds));
}
/**
* 统计管道总长度
*/
@PreAuthorize("@ss.hasPermi('device:pipe:countPipeLength')")
@GetMapping("/countPipeLength")
public AjaxResult countPipeLength()
{
return AjaxResult.success(tPipeService.countPipeLength());
}
}
package com.zehong.web.controller.device;
package com.zehong.web.controller.deviceInspection;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -27,7 +27,7 @@ import com.zehong.common.core.page.TableDataInfo;
* @date 2021-07-09
*/
@RestController
@RequestMapping("/device/inspectionData")
@RequestMapping("/deviceInspection/inspectionData")
public class TInspectionDataController extends BaseController
{
@Autowired
......@@ -36,7 +36,7 @@ public class TInspectionDataController extends BaseController
/**
* 查询巡检记录列表
*/
@PreAuthorize("@ss.hasPermi('device:inspectionData:list')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionData:list')")
@GetMapping("/list")
public TableDataInfo list(TInspectionData tInspectionData)
{
......@@ -48,7 +48,7 @@ public class TInspectionDataController extends BaseController
/**
* 导出巡检记录列表
*/
@PreAuthorize("@ss.hasPermi('device:inspectionData:export')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionData:export')")
@Log(title = "巡检记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TInspectionData tInspectionData)
......@@ -61,7 +61,7 @@ public class TInspectionDataController extends BaseController
/**
* 获取巡检记录详细信息
*/
@PreAuthorize("@ss.hasPermi('device:inspectionData:query')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionData:query')")
@GetMapping(value = "/{dataId}")
public AjaxResult getInfo(@PathVariable("dataId") Long dataId)
{
......@@ -71,7 +71,7 @@ public class TInspectionDataController extends BaseController
/**
* 新增巡检记录
*/
@PreAuthorize("@ss.hasPermi('device:inspectionData:add')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionData:add')")
@Log(title = "巡检记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TInspectionData tInspectionData)
......@@ -82,7 +82,7 @@ public class TInspectionDataController extends BaseController
/**
* 修改巡检记录
*/
@PreAuthorize("@ss.hasPermi('device:inspectionData:edit')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionData:edit')")
@Log(title = "巡检记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TInspectionData tInspectionData)
......@@ -93,7 +93,7 @@ public class TInspectionDataController extends BaseController
/**
* 删除巡检记录
*/
@PreAuthorize("@ss.hasPermi('device:inspectionData:remove')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionData:remove')")
@Log(title = "巡检记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{dataIds}")
public AjaxResult remove(@PathVariable Long[] dataIds)
......
package com.zehong.web.controller.device;
package com.zehong.web.controller.deviceInspection;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
......@@ -21,7 +21,7 @@ import java.util.List;
* @date 2021-07-08
*/
@RestController
@RequestMapping("/device/inspector")
@RequestMapping("/deviceInspection/inspector")
public class TInspectorController extends BaseController
{
@Autowired
......@@ -30,7 +30,7 @@ public class TInspectorController extends BaseController
/**
* 查询巡检员列表
*/
@PreAuthorize("@ss.hasPermi('device:inspector:list')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:list')")
@GetMapping("/list")
public TableDataInfo list(TInspector tInspector)
{
......@@ -42,7 +42,7 @@ public class TInspectorController extends BaseController
/**
* 导出巡检员列表
*/
@PreAuthorize("@ss.hasPermi('device:inspector:export')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:export')")
@Log(title = "巡检员", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TInspector tInspector)
......@@ -55,7 +55,7 @@ public class TInspectorController extends BaseController
/**
* 获取巡检员详细信息
*/
@PreAuthorize("@ss.hasPermi('device:inspector:query')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:query')")
@GetMapping(value = "/{inspectorId}")
public AjaxResult getInfo(@PathVariable("inspectorId") Long inspectorId)
{
......@@ -65,7 +65,7 @@ public class TInspectorController extends BaseController
/**
* 新增巡检员
*/
@PreAuthorize("@ss.hasPermi('device:inspector:add')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:add')")
@Log(title = "巡检员", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TInspector tInspector)
......@@ -76,7 +76,7 @@ public class TInspectorController extends BaseController
/**
* 修改巡检员
*/
@PreAuthorize("@ss.hasPermi('device:inspector:edit')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:edit')")
@Log(title = "巡检员", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TInspector tInspector)
......@@ -87,7 +87,7 @@ public class TInspectorController extends BaseController
/**
* 删除巡检员
*/
@PreAuthorize("@ss.hasPermi('device:inspector:remove')")
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:remove')")
@Log(title = "巡检员", businessType = BusinessType.DELETE)
@DeleteMapping("/{inspectorIds}")
public AjaxResult remove(@PathVariable Long[] inspectorIds)
......
......@@ -70,13 +70,13 @@ public class TDeviceInfo extends BaseEntity
private String phone;
/** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd")
@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")
@Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
private Date inspectionTime;
/** 备注 */
......
package com.zehong.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
......@@ -31,6 +34,11 @@ public class TInspectionData extends BaseEntity
@Excel(name = "纬度")
private BigDecimal latitude;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
private Date createTime;
/** 备注 */
@Excel(name = "备注")
private String remarks;
......@@ -81,6 +89,14 @@ public class TInspectionData extends BaseEntity
return remarks;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -41,11 +41,11 @@ public class TPipe extends BaseEntity
private Long pipeLength;
/** 管道类型(1地埋管线、2地表管线) */
@Excel(name = "管道类型", readConverterExp = "1=地埋管线、2地表管线")
@Excel(name = "管道类型", readConverterExp = "1地埋管线、2地表管线")
private String pipeType;
/** 管道压力(低压,中压,次高压,高压) */
@Excel(name = "管道压力", readConverterExp = "低=压,中压,次高压,高压")
@Excel(name = "管道压力", readConverterExp = "1低压,2中压,3次高压,4高压")
private String pipePressure;
/** 设备图片路径 */
......@@ -53,13 +53,13 @@ public class TPipe extends BaseEntity
private String iconUrl;
/** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd")
@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")
@Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
private Date inspectionTime;
/** 备注 */
......
package com.zehong.system.mapper;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TDeviceInfo;
/**
......@@ -27,6 +29,12 @@ public interface TDeviceInfoMapper
*/
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo);
/**
* 统计各设备类型的设备总数
* @return
*/
public List<Map<Object, Object>> countDeviceByType();
/**
* 新增设备信息
*
......
......@@ -27,6 +27,12 @@ public interface TPipeMapper
*/
public List<TPipe> selectTPipeList(TPipe tPipe);
/**
* 统计管道总长度
* @return
*/
public Long countPipeLength();
/**
* 新增管道信息
*
......
package com.zehong.system.service;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TDeviceInfo;
/**
......@@ -27,6 +29,12 @@ public interface ITDeviceInfoService
*/
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo);
/**
* 统计各设备类型的设备总数
* @return
*/
public List<Map<Object, Object>> countDeviceByType();
/**
* 新增设备信息
*
......
......@@ -27,6 +27,13 @@ public interface ITPipeService
*/
public List<TPipe> selectTPipeList(TPipe tPipe);
/**
* 统计管道总长度
* @param tPipe
* @return
*/
public Long countPipeLength();
/**
* 新增管道信息
*
......
package com.zehong.system.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceInfoMapper;
......@@ -43,6 +45,14 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
return tDeviceInfoMapper.selectTDeviceInfoList(tDeviceInfo);
}
/**
* 统计各设备类型的设备总数
* @return
*/
public List<Map<Object, Object>> countDeviceByType(){
return tDeviceInfoMapper.countDeviceByType();
};
/**
* 新增设备信息
*
......
......@@ -43,6 +43,15 @@ public class TPipeServiceImpl implements ITPipeService
return tPipeMapper.selectTPipeList(tPipe);
}
/**
* 统计管道总长度
* @return
*/
@Override
public Long countPipeLength() {
return tPipeMapper.countPipeLength();
};
/**
* 新增管道信息
*
......
......@@ -52,6 +52,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTDeviceInfoVo"/>
where device_id = #{deviceId}
</select>
<select id="countDeviceByType" resultType="map">
select count(device_id) number, device_type type from t_device_info
group by device_type
</select>
<insert id="insertTDeviceInfo" parameterType="TDeviceInfo" useGeneratedKeys="true" keyProperty="deviceId">
insert into t_device_info
......
......@@ -44,6 +44,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTPipeVo"/>
where pipe_id = #{pipeId}
</select>
<select id="countPipeLength" resultType="java.lang.Long">
select sum(pipe_length) from t_pipe
</select>
<insert id="insertTPipe" parameterType="TPipe" useGeneratedKeys="true" keyProperty="pipeId">
insert into t_pipe
......
......@@ -50,4 +50,12 @@ export function exportDeviceInfo(query) {
method: 'get',
params: query
})
}
\ No newline at end of file
}
// 统计各设备类型的设备总数
export function countDeviceByType(){
return request({
url: '/device/deviceInfo/countDeviceByType',
method: 'get'
})
}
......@@ -51,3 +51,11 @@ export function exportPipe(query) {
params: query
})
}
// 统计各设备类型的设备总数
export function countPipeLength(){
return request({
url: '/device/pipe/countPipeLength',
method: 'get'
})
}
......@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询巡检记录列表
export function listInspectionData(query) {
return request({
url: '/device/inspectionData/list',
url: '/deviceInspection/inspectionData/list',
method: 'get',
params: query
})
......@@ -12,7 +12,7 @@ export function listInspectionData(query) {
// 查询巡检记录详细
export function getInspectionData(dataId) {
return request({
url: '/device/inspectionData/' + dataId,
url: '/deviceInspection/inspectionData/' + dataId,
method: 'get'
})
}
......@@ -20,7 +20,7 @@ export function getInspectionData(dataId) {
// 新增巡检记录
export function addInspectionData(data) {
return request({
url: '/device/inspectionData',
url: '/deviceInspection/inspectionData',
method: 'post',
data: data
})
......@@ -29,7 +29,7 @@ export function addInspectionData(data) {
// 修改巡检记录
export function updateInspectionData(data) {
return request({
url: '/device/inspectionData',
url: '/deviceInspection/inspectionData',
method: 'put',
data: data
})
......@@ -38,7 +38,7 @@ export function updateInspectionData(data) {
// 删除巡检记录
export function delInspectionData(dataId) {
return request({
url: '/device/inspectionData/' + dataId,
url: '/deviceInspection/inspectionData/' + dataId,
method: 'delete'
})
}
......@@ -46,8 +46,8 @@ export function delInspectionData(dataId) {
// 导出巡检记录
export function exportInspectionData(query) {
return request({
url: '/device/inspectionData/export',
url: '/deviceInspection/inspectionData/export',
method: 'get',
params: query
})
}
\ No newline at end of file
}
......@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询巡检员列表
export function listInspector(query) {
return request({
url: '/device/inspector/list',
url: '/deviceInspection/inspector/list',
method: 'get',
params: query
})
......@@ -12,7 +12,7 @@ export function listInspector(query) {
// 查询巡检员详细
export function getInspector(inspectorId) {
return request({
url: '/device/inspector/' + inspectorId,
url: '/deviceInspection/inspector/' + inspectorId,
method: 'get'
})
}
......@@ -20,7 +20,7 @@ export function getInspector(inspectorId) {
// 新增巡检员
export function addInspector(data) {
return request({
url: '/device/inspector',
url: '/deviceInspection/inspector',
method: 'post',
data: data
})
......@@ -29,7 +29,7 @@ export function addInspector(data) {
// 修改巡检员
export function updateInspector(data) {
return request({
url: '/device/inspector',
url: '/deviceInspection/inspector',
method: 'put',
data: data
})
......@@ -38,7 +38,7 @@ export function updateInspector(data) {
// 删除巡检员
export function delInspector(inspectorId) {
return request({
url: '/device/inspector/' + inspectorId,
url: '/deviceInspection/inspector/' + inspectorId,
method: 'delete'
})
}
......@@ -46,7 +46,7 @@ export function delInspector(inspectorId) {
// 导出巡检员
export function exportInspector(query) {
return request({
url: '/device/inspector/export',
url: '/deviceInspection/inspector/export',
method: 'get',
params: query
})
......
......@@ -20,8 +20,13 @@
/>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="物联网编号" prop="iotNo">
......@@ -92,16 +97,23 @@
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="所在地址" align="center" prop="deviceAddr" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="设备类型" align="center" prop="deviceType">
<template slot-scope="scope">
<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="iotNo" />
<el-table-column label="安装时间" align="center" prop="installationTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.installationTime, '{y}-{m}-{d}') }}</span>
<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, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.inspectionTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
......@@ -133,13 +145,10 @@
/>
<!-- 添加或修改设备信息对话框 -->
<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="企业id" prop="enterpriseId">
<el-input v-model="form.enterpriseId" placeholder="请输入企业id" />
</el-form-item>
<el-form-item label="所属管道id" prop="pipeId">
<el-input v-model="form.pipeId" placeholder="请输入所属管道id" />
<el-dialog :title="title" :visible.sync="open" width="850px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-form-item label="所属管道" prop="pipeId">
<el-input v-model="form.pipeId" placeholder="请输入所属管道" />
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
......@@ -150,9 +159,14 @@
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.deviceModel" placeholder="请输入设备型号" />
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-form-item label="设备类型">
<el-select v-model="form.deviceType" placeholder="请选择设备类型">
<el-option label="请选择字典生成" value="" />
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="经度" prop="longitude">
......@@ -164,8 +178,8 @@
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
<el-form-item label="设备图片路径" prop="iconUrl">
<el-input v-model="form.iconUrl" type="textarea" placeholder="请输入内容" />
<el-form-item label="设备图片上传" prop="iconUrl">
<FileUpload :fileArr="fileList" @resFun="getFileInfo"/>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
......@@ -176,19 +190,11 @@
<el-form-item label="安装时间" prop="installationTime">
<el-date-picker clearable size="small"
v-model="form.installationTime"
type="date"
value-format="yyyy-MM-dd"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择安装时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后巡检时间" prop="inspectionTime">
<el-date-picker clearable size="small"
v-model="form.inspectionTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择最后巡检时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>
......@@ -202,11 +208,13 @@
</template>
<script>
import { listDeviceInfo, getDeviceInfo, delDeviceInfo, addDeviceInfo, updateDeviceInfo, exportDeviceInfo } from "@/api/device/deviceInfo";
import { listDeviceInfo, getDeviceInfo, delDeviceInfo, addDeviceInfo, updateDeviceInfo, exportDeviceInfo, countDeviceByType } from "@/api/device/deviceInfo";
import FileUpload from '@/components/FileUpload';
export default {
name: "DeviceInfo",
components: {
FileUpload,
},
data() {
return {
......@@ -230,6 +238,10 @@ export default {
title: "",
// 是否显示弹出层
open: false,
// 上传文件列表
fileList: [],
// 设备类型字典
typeOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
......@@ -258,7 +270,14 @@ export default {
};
},
created() {
countDeviceByType().then(response => {
let data = response.data;
console.log(data,"data");
});
this.getList();
this.getDicts("t_device_type").then(response => {
this.typeOptions = response.data;
});
},
methods: {
/** 查询设备信息列表 */
......@@ -270,10 +289,14 @@ export default {
this.loading = false;
});
},
getFileInfo(res){
this.form.iconUrl = res.url;
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.fileList = [];
},
// 表单重置
reset() {
......@@ -328,6 +351,11 @@ export default {
this.open = true;
this.title = "修改设备信息";
});
if (this.form.iconUrl) {
this.fileList.push({
url: this.form.iconUrl,
});
}
},
/** 提交按钮 */
submitForm() {
......
......@@ -11,8 +11,13 @@
/>
</el-form-item>
<el-form-item label="管道类型" prop="pipeType">
<el-select v-model="queryParams.pipeType" placeholder="请选择管道类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
<el-select v-model="queryParams.pipeType" placeholder="请选择管道类型" size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
......@@ -71,19 +76,31 @@
<el-table v-loading="loading" :data="pipeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="管道名称" align="center" prop="pipeName" />
<el-table-column label="管道所在地址" align="center" prop="pipeAddr" />
<el-table-column label="坐标" align="center" prop="coordinates" />
<el-table-column label="所在地址" align="center" prop="pipeAddr" />
<el-table-column label="管道坐标" align="center" prop="coordinates" />
<el-table-column label="管道长度" align="center" prop="pipeLength" />
<el-table-column label="管道类型" align="center" prop="pipeType" />
<el-table-column label="管道压力" align="center" prop="pipePressure" />
<el-table-column label="管道类型" align="center" prop="pipeType" >
<template slot-scope="scope">
<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="pipePressure" >
<template slot-scope="scope">
<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="installationTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.installationTime, '{y}-{m}-{d}') }}</span>
<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, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.inspectionTime)}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
......@@ -115,50 +132,51 @@
/>
<!-- 添加或修改管道信息对话框 -->
<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="企业id" prop="enterpriseId">
<el-input v-model="form.enterpriseId" placeholder="请输入企业id" />
</el-form-item>
<el-dialog :title="title" :visible.sync="open" width="850px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-form-item label="管道名称" prop="pipeName">
<el-input v-model="form.pipeName" placeholder="请输入管道名称" />
</el-form-item>
<el-form-item label="管道所在地址" prop="pipeAddr">
<el-input v-model="form.pipeAddr" placeholder="请输入管道所在地址" />
<el-form-item label="所在地址" prop="pipeAddr">
<el-input v-model="form.pipeAddr" placeholder="请输入所在地址" />
</el-form-item>
<el-form-item label="坐标" prop="coordinates">
<el-input v-model="form.coordinates" type="textarea" placeholder="请输入内容" />
<el-form-item label="管道坐标" prop="coordinates">
<el-input v-model="form.coordinates" placeholder="请输入坐标" />
</el-form-item>
<el-form-item label="管道长度" prop="pipeLength">
<el-input v-model="form.pipeLength" placeholder="请输入管道长度" />
</el-form-item>
<el-form-item label="管道类型" prop="pipeType">
<el-form-item label="管道类型">
<el-select v-model="form.pipeType" placeholder="请选择管道类型">
<el-option label="请选择字典生成" value="" />
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="管道压力" prop="pipePressure">
<el-input v-model="form.pipePressure" placeholder="请输入管道压力" />
<el-form-item label="管道压力">
<el-select v-model="form.pipePressure" placeholder="请选择管道压力">
<el-option
v-for="dict in pressureOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备图片路径" prop="iconUrl">
<el-input v-model="form.iconUrl" type="textarea" placeholder="请输入内容" />
<el-form-item label="设备图片上传" prop="iconUrl">
<FileUpload :fileArr="fileList" @resFun="getFileInfo"/>
</el-form-item>
<el-form-item label="安装时间" prop="installationTime">
<el-date-picker clearable size="small"
v-model="form.installationTime"
type="date"
value-format="yyyy-MM-dd"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择安装时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后巡检时间" prop="inspectionTime">
<el-date-picker clearable size="small"
v-model="form.inspectionTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择最后巡检时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>
......@@ -173,10 +191,12 @@
<script>
import { listPipe, getPipe, delPipe, addPipe, updatePipe, exportPipe } from "@/api/device/pipe";
import FileUpload from '@/components/FileUpload';
export default {
name: "Pipe",
components: {
FileUpload
},
data() {
return {
......@@ -200,6 +220,12 @@ export default {
title: "",
// 是否显示弹出层
open: false,
// 上传文件列表
fileList: [],
// 管道类型字典
typeOptions: [],
// 管道压力字典
pressureOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
......@@ -225,6 +251,12 @@ export default {
},
created() {
this.getList();
this.getDicts("t_pipe_type").then(response => {
this.typeOptions = response.data;
});
this.getDicts("t_pipe_pressure").then(response => {
this.pressureOptions = response.data;
});
},
methods: {
/** 查询管道信息列表 */
......@@ -236,10 +268,14 @@ export default {
this.loading = false;
});
},
getFileInfo(res){
this.form.iconUrl = res.url;
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.fileList = [];
},
// 表单重置
reset() {
......@@ -289,6 +325,11 @@ export default {
this.form = response.data;
this.open = true;
this.title = "修改管道信息";
if (this.form.iconUrl) {
this.fileList.push({
name: this.form.iconUrl,
});
}
});
},
/** 提交按钮 */
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="经度" prop="longitude">
<!--<el-form-item label="经度" prop="longitude">
<el-input
v-model="queryParams.longitude"
placeholder="请输入经度"
......@@ -31,7 +31,7 @@
<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-item>-->
</el-form>
<el-row :gutter="10" class="mb8">
......@@ -56,7 +56,12 @@
<el-table-column label="经度" align="center" prop="longitude" />
<el-table-column label="纬度" align="center" prop="latitude" />
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
......@@ -73,7 +78,7 @@
v-hasPermi="['device:inspectionData:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table-column>-->
</el-table>
<pagination
......@@ -109,7 +114,7 @@
</template>
<script>
import { listInspectionData, getInspectionData, delInspectionData, addInspectionData, updateInspectionData, exportInspectionData } from "@/api/device/inspectionData";
import { listInspectionData, getInspectionData, delInspectionData, addInspectionData, updateInspectionData, exportInspectionData } from "@/api/deviceInspection/inspectionData";
export default {
name: "InspectionData",
......
......@@ -108,11 +108,8 @@
/>
<!-- 添加或修改巡检员对话框 -->
<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="企业id" prop="enterpriseId">
<el-input v-model="form.enterpriseId" placeholder="请输入企业id" />
</el-form-item>
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
......@@ -132,7 +129,7 @@
</template>
<script>
import { listInspector, getInspector, delInspector, addInspector, updateInspector, exportInspector } from "@/api/device/inspector";
import { listInspector, getInspector, delInspector, addInspector, updateInspector, exportInspector } from "@/api/deviceInspection/inspector";
export default {
name: "Inspector",
......
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