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

监测设备功能添加

parent 3d8735a8
...@@ -39,6 +39,17 @@ public class TGasAlarmController extends BaseController ...@@ -39,6 +39,17 @@ public class TGasAlarmController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 获取报警信息
* @param tGasAlarm
* @return
*/
@GetMapping("/getAlarmInfoList")
public AjaxResult getAlarmInfoList(TGasAlarm tGasAlarm) {
List<TGasAlarm> list = tGasAlarmService.selectTGasAlarmList(tGasAlarm);
return AjaxResult.success(list);
}
/** /**
* 导出报警器报警记录列表 * 导出报警器报警记录列表
*/ */
......
package com.zehong.system.domain; package com.zehong.system.domain;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
...@@ -61,9 +62,22 @@ public class TGasData extends BaseEntity ...@@ -61,9 +62,22 @@ public class TGasData extends BaseEntity
/** $column.columnComment */ /** $column.columnComment */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "位号", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdAt; private Date createdAt;
@Excel(name = "经度")
private BigDecimal longitude;
@Excel(name = "纬度")
private BigDecimal latitude;
private String contacts;
@Excel(name = "联系人")
private String contactsName;
private String contactsTel;
/**上报状态*/ /**上报状态*/
private String reportStatus; private String reportStatus;
...@@ -205,6 +219,46 @@ public class TGasData extends BaseEntity ...@@ -205,6 +219,46 @@ public class TGasData extends BaseEntity
this.type = type; this.type = type;
} }
public BigDecimal getLongitude() {
return longitude;
}
public void setLongitude(BigDecimal longitude) {
this.longitude = longitude;
}
public BigDecimal getLatitude() {
return latitude;
}
public void setLatitude(BigDecimal latitude) {
this.latitude = latitude;
}
public String getContacts() {
return contacts;
}
public void setContacts(String contacts) {
this.contacts = contacts;
}
public String getContactsName() {
return contactsName;
}
public void setContactsName(String contactsName) {
this.contactsName = contactsName;
}
public String getContactsTel() {
return contactsTel;
}
public void setContactsTel(String contactsTel) {
this.contactsTel = contactsTel;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.Date;
import java.util.List; import java.util.List;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -121,8 +122,8 @@ public class TGasDataServiceImpl implements ITGasDataService ...@@ -121,8 +122,8 @@ public class TGasDataServiceImpl implements ITGasDataService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertTGasData(TGasData tGasData) public int insertTGasData(TGasData tGasData) {
{ tGasData.setCreatedAt(new Date());
return tGasDataMapper.insertTGasData(tGasData); return tGasDataMapper.insertTGasData(tGasData);
} }
......
...@@ -17,10 +17,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -17,10 +17,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="unit" column="unit" /> <result property="unit" column="unit" />
<result property="tag" column="tag" /> <result property="tag" column="tag" />
<result property="createdAt" column="created_at" /> <result property="createdAt" column="created_at" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="contacts" column="contacts" />
</resultMap> </resultMap>
<sql id="selectTGasDataVo"> <sql id="selectTGasDataVo">
select id, number,type, position, high_alarm, high_high_alarm, low_alarm, low_low_alarm, `range`, unit, tag, created_at from t_gas_data SELECT
id,
number,
type,
position,
high_alarm,
high_high_alarm,
low_alarm,
low_low_alarm,
`range`,
unit,
tag,
created_at,
longitude,
latitude,
contacts,
(select GROUP_CONCAT(nick_name) from sys_user where find_in_set(user_id,contacts)) as contactsName,
(select GROUP_CONCAT(NULLIF(phonenumber, '')) from sys_user where find_in_set(user_id,contacts)) as contactsTel
FROM
t_gas_data
</sql> </sql>
<select id="selectTGasDataList" parameterType="TGasData" resultMap="TGasDataResult"> <select id="selectTGasDataList" parameterType="TGasData" resultMap="TGasDataResult">
...@@ -59,6 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -59,6 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">unit,</if> <if test="unit != null">unit,</if>
<if test="tag != null">tag,</if> <if test="tag != null">tag,</if>
<if test="createdAt != null">created_at,</if> <if test="createdAt != null">created_at,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="contacts != null">contacts,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="number != null">#{number},</if> <if test="number != null">#{number},</if>
...@@ -72,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -72,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">#{unit},</if> <if test="unit != null">#{unit},</if>
<if test="tag != null">#{tag},</if> <if test="tag != null">#{tag},</if>
<if test="createdAt != null">#{createdAt},</if> <if test="createdAt != null">#{createdAt},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="contacts != null">#{contacts},</if>
</trim> </trim>
</insert> </insert>
...@@ -89,6 +117,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -89,6 +117,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">unit = #{unit},</if> <if test="unit != null">unit = #{unit},</if>
<if test="tag != null">tag = #{tag},</if> <if test="tag != null">tag = #{tag},</if>
<if test="createdAt != null">created_at = #{createdAt},</if> <if test="createdAt != null">created_at = #{createdAt},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="contacts != null">contacts = #{contacts},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
...@@ -9,6 +9,15 @@ export function listAlarm(query) { ...@@ -9,6 +9,15 @@ export function listAlarm(query) {
}) })
} }
//获取所有报警信息
export function getAlarmInfoList(query) {
return request({
url: '/gas/alarm/getAlarmInfoList',
method: 'get',
params: query
})
}
// 查询报警器报警记录详细 // 查询报警器报警记录详细
export function getAlarm(id) { export function getAlarm(id) {
return request({ return request({
......
<template> <template>
<el-dialog title="设备详情" :visible.sync="detailOpen" width="800px" append-to-body destroy-on-close :close-on-click-modal="false"> <el-dialog title="设备详情" :visible.sync="detailOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="80px"> <el-row>
<el-row> <el-col :span="14">
<el-col :span="12"> <el-form label-width="80px">
<el-form-item label="设备编号"> <el-row>
<span>{{ detailInfo.number }}</span> <el-col :span="12">
</el-form-item> <el-form-item label="设备编号">
</el-col> <span>{{ detailInfo.number }}</span>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属厂家"> <el-form-item label="所属厂家">
<span v-if="detailInfo.type">{{ $parent.typeFormat(detailInfo) }}</span> <span v-if="detailInfo.type">{{ $parent.typeFormat(detailInfo) }}</span>
<span v-else>-</span> <span v-else>-</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="位号"> <el-form-item label="位号">
<span>{{ detailInfo.tag }}</span> <span>{{ detailInfo.tag }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="安装位置"> <el-form-item label="安装位置">
<span>{{ detailInfo.position }}</span> <span>{{ detailInfo.position }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="高报"> <el-form-item label="高报">
<span v-if="detailInfo.highAlarm">{{ detailInfo.highAlarm }}</span> <span v-if="detailInfo.highAlarm">{{ detailInfo.highAlarm }}</span>
<span v-else>-</span> <span v-else>-</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="高高报"> <el-form-item label="高高报">
<span v-if="detailInfo.highHighAlarm">{{ detailInfo.highHighAlarm }}</span> <span v-if="detailInfo.highHighAlarm">{{ detailInfo.highHighAlarm }}</span>
<span v-else>-</span> <span v-else>-</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="低报">
<span v-if="detailInfo.lowAlarm">{{ detailInfo.lowAlarm }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="低低报">
<span v-if="detailInfo.lowLowAlarm">{{ detailInfo.lowLowAlarm }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="量程">
<span v-if="detailInfo.range">{{ detailInfo.range }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位">
<span v-if="detailInfo.unit">{{ detailInfo.unit }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人">
<span v-if="detailInfo.contactsName">{{ detailInfo.contactsName }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">
<span v-if="detailInfo.createdAt">{{ detailInfo.createdAt }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-col>
<el-col :span="10">
<div id="monitor_dev_map" style="width: 100%;height: 400px;border: 1px solid"></div>
</el-col>
</el-row>
<el-col :span="12">
<el-form-item label="低报">
<span v-if="detailInfo.lowAlarm">{{ detailInfo.lowAlarm }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="低低报">
<span v-if="detailInfo.lowLowAlarm">{{ detailInfo.lowLowAlarm }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="量程">
<span v-if="detailInfo.range">{{ detailInfo.range }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位">
<span v-if="detailInfo.unit">{{ detailInfo.unit }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">
<span v-if="detailInfo.createdAt">{{ detailInfo.createdAt }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { getData } from "@/api/gasdata/data"; import { getData } from "@/api/gasdata/data";
import { EditorMap } from "@/utils/mapClass/map";
import { mapGetters } from "vuex";
export default { export default {
name: "detail-info", name: "detail-info",
data(){ data(){
...@@ -95,10 +112,33 @@ ...@@ -95,10 +112,33 @@
getData(gasId).then(res =>{ getData(gasId).then(res =>{
if(res.code == 200){ if(res.code == 200){
this.detailInfo = res.data; this.detailInfo = res.data;
this.initMap();
} }
}) })
},
initMap(){
this.$nextTick(() => {
const path = eval(this.systemSetting.map_center);
let map = new EditorMap(
"monitor_dev_map",
{
center: path,
//mapStyle: "amap://styles/f71d3a3d73e14f5b2bf5508bf1411758",
zoom: 14.5,
},
this
);
if(this.detailInfo.longitude){
map.control = 1;
map.addDevice(this.detailInfo);
map.map.setCenter([this.detailInfo.longitude,this.detailInfo.latitude])
}
});
} }
} },
computed: {
...mapGetters(["systemSetting"]),
},
} }
</script> </script>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<!--<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:data:add']" v-hasPermi="['gas:data:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:data:edit']" v-hasPermi="['gas:data:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:data:remove']" v-hasPermi="['gas:data:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -87,13 +87,13 @@ ...@@ -87,13 +87,13 @@
plain plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
:loading="exportLoading" :loading="exportLoading"
@click="handleExport" @click="handleExport"
v-hasPermi="['system:data:export']" v-hasPermi="['gas:data:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>--> </el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
...@@ -137,20 +137,20 @@ ...@@ -137,20 +137,20 @@
icon="el-icon-document" icon="el-icon-document"
@click="handleDetail(scope.row)" @click="handleDetail(scope.row)"
>详情</el-button> >详情</el-button>
<!--<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:data:edit']" v-hasPermi="['gas:data:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:data:remove']" v-hasPermi="['gas:data:remove']"
>删除</el-button>--> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -164,43 +164,117 @@ ...@@ -164,43 +164,117 @@
/> />
<!-- 添加或修改监测设备数据对话框 --> <!-- 添加或修改监测设备数据对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="设备编号" prop="number"> <el-row>
<el-input v-model="form.number" placeholder="请输入设备编号" /> <el-col :span="12">
</el-form-item> <el-form-item label="设备编号" prop="number">
<el-form-item label="安装位置" prop="position"> <el-input v-model="form.number" placeholder="请输入设备编号" />
<el-input v-model="form.position" placeholder="请输入安装位置" /> </el-form-item>
</el-form-item> </el-col>
<el-form-item label="高报" prop="highAlarm"> <el-col :span="12">
<el-input v-model="form.highAlarm" placeholder="请输入高报" /> <el-form-item label="所属厂家" prop="type">
</el-form-item> <el-select
<el-form-item label="高高报" prop="highHighAlarm"> v-model="form.type"
<el-input v-model="form.highHighAlarm" placeholder="请输入高高报" /> placeholder="请选择所属厂家"
</el-form-item> size="small"
<el-form-item label="低报" prop="lowAlarm"> style="width: 100%"
<el-input v-model="form.lowAlarm" placeholder="请输入低报" /> >
</el-form-item> <el-option
<el-form-item label="低低报" prop="lowLowAlarm"> v-for="dict in typeOptions"
<el-input v-model="form.lowLowAlarm" placeholder="请输入低低报" /> :key="dict.dictValue"
</el-form-item> :label="dict.dictLabel"
<el-form-item label="量程" prop="range"> :value="dict.dictValue"
<el-input v-model="form.range" placeholder="请输入量程" /> />
</el-form-item> </el-select>
<el-form-item label="单位" prop="unit"> </el-form-item>
<el-input v-model="form.unit" placeholder="请输入单位" /> </el-col>
</el-form-item> </el-row>
<el-form-item label="位号" prop="tag">
<el-input v-model="form.tag" placeholder="请输入位号" /> <el-row>
</el-form-item> <el-col :span="12">
<el-form-item label="位号" prop="createdAt"> <el-form-item label="位号" prop="tag">
<el-date-picker clearable size="small" <el-input v-model="form.tag" placeholder="请输入位号" />
v-model="form.createdAt" </el-form-item>
type="date" </el-col>
value-format="yyyy-MM-dd" <el-col :span="12">
placeholder="选择位号"> <el-form-item label="高报" prop="highAlarm">
</el-date-picker> <el-input v-model="form.highAlarm" placeholder="请输入高报" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="低报" prop="lowAlarm">
<el-input v-model="form.lowAlarm" placeholder="请输入低报" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="低低报" prop="lowLowAlarm">
<el-input v-model="form.lowLowAlarm" placeholder="请输入低低报" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="量程" prop="range">
<el-input v-model="form.range" placeholder="请输入量程" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="安装位置" prop="position">
<el-input v-model="form.position" placeholder="请输入安装位置" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="经纬度坐标" prop="longitude">
<el-col :span="8">
<el-input v-model="form.longitude" placeholder="请输入经度"/>
</el-col>
<el-col :span="8" style="margin-left: 20px">
<el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-col>
<el-col :span="4" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="联系人" prop="contacts">
<el-select
v-model="contacts"
multiple
placeholder="请选择联系人"
style="width: 100%"
@change="changeContacts"
>
<el-option
v-for="user in userList"
:key="user.userId"
:label="user.nickName"
:value="user.userId"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
...@@ -211,16 +285,29 @@ ...@@ -211,16 +285,29 @@
<!-- 详情 --> <!-- 详情 -->
<DetailInfo ref="detailInfo"/> <DetailInfo ref="detailInfo"/>
<!-- 地图 -->
<GetPos
:dialogVisible.sync="dialogTableVisibles"
:devicePos="devicePos"
@close="dialogcancelFun"
@getPath="getPath"
style="z-index: 3000"
ref="getPos"
/>
</div> </div>
</template> </template>
<script> <script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/gasdata/data"; import { listData, getData, delData, addData, updateData, exportData } from "@/api/gasdata/data";
import DetailInfo from "./components/DetailInfo"; import DetailInfo from "./components/DetailInfo";
import GetPos from '@/components/GetPos';
import { userInfoList } from "@/api/system/user";
export default { export default {
name: "Data", name: "Data",
components: { components: {
DetailInfo DetailInfo,
GetPos,
}, },
data() { data() {
return { return {
...@@ -230,6 +317,7 @@ export default { ...@@ -230,6 +317,7 @@ export default {
exportLoading: false, exportLoading: false,
// 选中数组 // 选中数组
ids: [], ids: [],
numbers: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
...@@ -263,9 +351,26 @@ export default { ...@@ -263,9 +351,26 @@ export default {
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
number: [
{ required: true, message: "设备编号不能为空", trigger: "blur" }
],
type: [
{ required: true, message: "所属厂家不能为空", trigger: "blur" }
],
longitude: [
{ required: true, message: "经纬度不能为空", trigger: "blur" }
],
contacts: [
{ required: true, message: "联系人不能为空", trigger: "blur" }
],
}, },
deviceStatus: [], deviceStatus: [],
typeOptions: [] typeOptions: [],
dialogTableVisibles: false,
devicePos: [],
userList: [],
//联系人数组
contacts: []
}; };
}, },
created() { created() {
...@@ -316,6 +421,8 @@ export default { ...@@ -316,6 +421,8 @@ export default {
tag: null, tag: null,
createdAt: null createdAt: null
}; };
this.devicePos = [];
this.contacts = [];
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -330,13 +437,15 @@ export default { ...@@ -330,13 +437,15 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id);
this.numbers = selection.map(item => item.number);
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.getUserInfo();
this.open = true; this.open = true;
this.title = "添加监测设备数据"; this.title = "添加监测设备数据";
}, },
...@@ -346,6 +455,13 @@ export default { ...@@ -346,6 +455,13 @@ export default {
const id = row.id || this.ids const id = row.id || this.ids
getData(id).then(response => { getData(id).then(response => {
this.form = response.data; this.form = response.data;
if(this.form.longitude){
this.devicePos = [this.form.longitude,this.form.latitude];
}
if(this.form.contacts){
this.contacts = this.form.contacts.split(",");
}
this.getUserInfo();
this.open = true; this.open = true;
this.title = "修改监测设备数据"; this.title = "修改监测设备数据";
}); });
...@@ -373,7 +489,8 @@ export default { ...@@ -373,7 +489,8 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$confirm('是否确认删除监测设备数据编号为"' + ids + '"的数据项?', "警告", { const numbers = row.number || this.numbers;
this.$confirm('是否确认删除监测设备数据编号为"' + numbers + '"的数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
...@@ -402,6 +519,37 @@ export default { ...@@ -402,6 +519,37 @@ export default {
/**详情*/ /**详情*/
handleDetail(row){ handleDetail(row){
this.$refs.detailInfo.openDetail(row.id); this.$refs.detailInfo.openDetail(row.id);
},
/**
* 经纬度坐标方法
*/
MapdialogFun() {
this.dialogTableVisibles = true;
},
/**
* 地图关闭方法
*/
dialogcancelFun() {
this.dialogTableVisibles = false;
},
/**
* 经纬度 选择
* @param res
*/
getPath(res){
//确认选择经纬度
this.form.longitude = res[0];
this.form.latitude = res[1];
},
getUserInfo(){
userInfoList().then(res =>{
if(res.code == 200){
this.userList = res.data;
}
})
},
changeContacts(val){
this.form.contacts = val.join(",");
} }
} }
}; };
......
...@@ -46,6 +46,7 @@ import PipeInfo from "./components/PipeInfo"; ...@@ -46,6 +46,7 @@ import PipeInfo from "./components/PipeInfo";
import axios from "axios"; import axios from "axios";
import gcoord from "gcoord"; import gcoord from "gcoord";
import LineTips from "./components/LineTips"; import LineTips from "./components/LineTips";
import { getAlarmInfoList } from "@/api/gasdata/alarm";
export default { export default {
name: "gao-map-index", name: "gao-map-index",
props: { props: {
...@@ -92,7 +93,8 @@ export default { ...@@ -92,7 +93,8 @@ export default {
}, },
pipeLines: [], pipeLines: [],
lineShow: false, lineShow: false,
lineTipsShow: false lineTipsShow: false,
alarmInfoData: []
}; };
}, },
methods: { methods: {
...@@ -188,7 +190,6 @@ export default { ...@@ -188,7 +190,6 @@ export default {
}, },
getPipeByGeoJson() { getPipeByGeoJson() {
axios.get("../geo_json/huanggezhuang.json").then((res) => { axios.get("../geo_json/huanggezhuang.json").then((res) => {
console.log("haha===========", res.data);
this.gaoMap.map.plugin(["AMap.GeoJSON"], () => { this.gaoMap.map.plugin(["AMap.GeoJSON"], () => {
const geojson = new AMap.GeoJSON({ const geojson = new AMap.GeoJSON({
geoJSON: res.data, geoJSON: res.data,
...@@ -316,6 +317,14 @@ export default { ...@@ -316,6 +317,14 @@ export default {
} }
}); });
}, },
//获取报警信息
getAlarmInfo(){
getAlarmInfoList({reason: "0"}).then(res =>{
if(res.code == 200){
this.alarmInfoData = res.data;
}
})
}
}, },
computed: { computed: {
...mapGetters(["systemSetting"]), ...mapGetters(["systemSetting"]),
......
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