Commit 74a73389 authored by 王晓倩's avatar 王晓倩

设备信息获取经纬度、管道信息获取坐标

parent ae570df8
...@@ -79,13 +79,13 @@ public class DeviceInfoVo extends BaseEntity ...@@ -79,13 +79,13 @@ public class DeviceInfoVo extends BaseEntity
private String phone; private String phone;
/** 安装时间 */ /** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date installationTime; private Date installationTime;
/** 最后巡检时间 */ /** 最后巡检时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date inspectionTime; private Date inspectionTime;
/** 是否删除 */ /** 是否删除 */
......
...@@ -63,13 +63,13 @@ public class PipeVo extends BaseEntity ...@@ -63,13 +63,13 @@ public class PipeVo extends BaseEntity
private String iconUrl; private String iconUrl;
/** 安装时间 */ /** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date installationTime; private Date installationTime;
/** 最后巡检时间 */ /** 最后巡检时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date inspectionTime; private Date inspectionTime;
/** 是否删除 */ /** 是否删除 */
......
...@@ -133,20 +133,31 @@ ...@@ -133,20 +133,31 @@
/> />
<!-- 添加或修改设备信息对话框 --> <!-- 添加或修改设备信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> <el-dialog :title="title" :visible.sync="open" append-to-body @close="cancel">
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-col :span="11">
<el-form-item label="所属管道" prop="pipeId"> <el-form-item label="所属管道" prop="pipeId">
<el-select v-model="form.pipeId" placeholder="请选择所属管道" clearable size="small" style="width: 600px"> <el-select v-model="form.pipeId" placeholder="请选择所属管道" style="width: 100%" >
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.pipeId" :key="item.pipeId"
:label="item.pipeName" :label="item.pipeName"
:value="item.pipeId" :value="item.pipeId"
></el-option> >
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类型"> </el-col>
<el-select v-model="form.deviceType" placeholder="请选择设备类型" style="width: 600px">
<el-col :span="12">
<el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="form.deviceType" placeholder="请选择设备类型" style="width: 100%" >
<el-option <el-option
v-for="dict in typeOptions" v-for="dict in typeOptions"
:key="dict.dictValue" :key="dict.dictValue"
...@@ -155,34 +166,72 @@ ...@@ -155,34 +166,72 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" style="width: 600px" /> <el-input
</el-form-item> v-model="form.deviceName"
<el-form-item label="设备编号" prop="deviceCode"> placeholder="请输入设备名称"
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" style="width: 600px" /> />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel"> <el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.deviceModel" placeholder="请输入设备型号" style="width: 600px" /> <el-input
v-model="form.deviceModel"
placeholder="请输入设备型号"
/>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物联网编号" prop="iotNo"> <el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" /> <el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="23">
<el-form-item label="所在地址" prop="deviceAddr"> <el-form-item label="所在地址" prop="deviceAddr">
<el-input v-model="form.deviceAddr" placeholder="请输入所在地址" style="width: 600px" /> <el-input v-model="form.deviceAddr" placeholder="请输入所在地址" />
</el-form-item> </el-form-item>
<el-form-item label="经纬度" > </el-col>
<el-col :span="23">
<el-form-item label="经纬度坐标" prop="longitude">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-input v-model.number="form.longitude" placeholder="请输入经度" /> <el-input v-model.number="form.longitude" placeholder="请输入经度" />
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8" style="margin-left: 10px">
<el-input v-model.number="form.latitude" placeholder="请输入纬度"/> <el-input v-model.number="form.latitude" placeholder="请输入纬度"/>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5" style="margin-left: 10px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button> <el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="phone">
<el-input
type="number"
maxlength="12"
v-model="form.phone"
placeholder="请输入联系电话"
/>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="设备图片上传" prop="iconUrl"> <el-form-item label="设备图片上传" prop="iconUrl">
<MyFileUpload <MyFileUpload
listType="picture-card" listType="picture-card"
...@@ -190,44 +239,58 @@ ...@@ -190,44 +239,58 @@
@remove="listRemove" @remove="listRemove"
:fileArr="fileList" :fileArr="fileList"
/> />
<el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系人" prop="linkman"> </el-col>
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item> <el-col>
<el-form-item label="电话" prop="phone"> <el-form-item label="安装日期" prop="installationTime">
<el-input v-model="form.phone" placeholder="请输入电话" /> <el-col :span="11">
</el-form-item>
<el-form-item label="安装时间" prop="installationTime">
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
style="width: 100%"
v-model="form.installationTime" v-model="form.installationTime"
type="datetime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd"
placeholder="选择安装时间"> placeholder="请选择安装日期">
</el-date-picker> </el-date-picker>
</el-col>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remarks"> </el-col>
<el-input v-model="form.remarks" placeholder="请输入备注" />
<el-col :span="23">
<el-form-item label="备注信息" prop="remarks">
<el-input type="textarea" v-model="form.remarks" placeholder="请输入备注信息" />
</el-form-item> </el-form-item>
</el-col>
</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>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- <Mapdialog v-if="loadmap" :dialogTableVisible="dialogTableVisible" @dialogcancelFun="dialogcancelFun" :slat="form.latitude" :slng="form.longitude" @confirm="qrFun" />-->
<Mapdialog
v-if="loadmap"
:dialogTableVisible="dialogTableVisible"
@dialogcancelFun="dialogcancelFun"
:slat="form.latitude"
:slng="form.longitude"
@confirmFun="confirmFun($event)"
></Mapdialog>
</div> </div>
</template> </template>
<script> <script>
import { listDeviceInfo, getDeviceInfo, addDeviceInfo, updateDeviceInfo, exportDeviceInfo } from "@/api/device/deviceInfo"; import { listDeviceInfo, getDeviceInfo, addDeviceInfo, updateDeviceInfo, exportDeviceInfo } from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe"; import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from '@/components/MyFileUpload'; import MyFileUpload from '@/components/MyFileUpload';
// import Mapdialog from "@/components/maplnglat.vue"; import Mapdialog from "@/components/mapDialog/checkDeviceLoaction.vue";
export default { export default {
name: "DeviceInfo", name: "DeviceInfo",
components: { components: {
MyFileUpload, MyFileUpload,
Mapdialog
}, },
data() { data() {
return { return {
...@@ -284,6 +347,43 @@ export default { ...@@ -284,6 +347,43 @@ export default {
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
pipeId: [
{ required: true, message: "请选择所属管道", trigger: "blur" },
],
deviceType: [
{ required: true, message: "请选择设备类型", trigger: "blur" },
],
deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" },
],
deviceCode: [
{ required: true, message: "请输入设备编号", trigger: "blur" },
],
deviceModel: [
{ required: true, message: "请输入设备型号", trigger: "blur" },
],
deviceAddr: [
{ required: true, message: "请输入所在地址", trigger: "blur" },
],
longitude: [
{ required: true, message: "请输入经纬度", trigger: "blur" },
],
iotNo: [
{ required: true, message: "请输入物联网编号", trigger: "blur" },
],
/*linkman: [
{ required: true, message: "请输入联系人", trigger: "blur" }
],
phone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
{ min: 11, max: 11, message: "长度11个数字", trigger: "blur" },
],
iconUrl: [
{ required: true, message: "请上传图片", trigger: "change" }
],
installationTime: [
{ required: true, message: "请选择日期", trigger: "change" },
],*/
} }
}; };
}, },
...@@ -307,22 +407,22 @@ export default { ...@@ -307,22 +407,22 @@ export default {
this.form.iconUrl = res.url; this.form.iconUrl = res.url;
}, },
listRemove(e) { listRemove(e) {
this.form.url = ""; this.form.iconUrl = "";
this.fileList = []; this.fileList = [];
}, },
// qrFun(res) { confirmFun(res) {
// //确认选择经纬度 //确认选择经纬度
// this.form.longitude = res.lng; this.form.longitude = res.lng;
// this.form.latitude = res.lat; this.form.latitude = res.lat;
// }, },
// MapdialogFun() { MapdialogFun() {
// this.loadmap = true; this.loadmap = true;
// this.dialogTableVisible = true; this.dialogTableVisible = true;
// }, },
// dialogcancelFun() { dialogcancelFun() {
// this.loadmap = false; this.loadmap = false;
// this.dialogTableVisible = false; this.dialogTableVisible = false;
// }, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.open = false;
...@@ -373,7 +473,7 @@ export default { ...@@ -373,7 +473,7 @@ export default {
pipeAllInfoList().then(response => { pipeAllInfoList().then(response => {
this.options = response.data; this.options = response.data;
this.open = true; this.open = true;
this.title = "添加设备信息"; this.title = "新增设备信息";
}); });
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
...@@ -385,14 +485,14 @@ export default { ...@@ -385,14 +485,14 @@ export default {
const deviceId = row.deviceId || this.ids const deviceId = row.deviceId || this.ids
getDeviceInfo(deviceId).then(response => { getDeviceInfo(deviceId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true;
this.title = "修改设备信息";
});
if (this.form.iconUrl) { if (this.form.iconUrl) {
this.fileList.push({ this.fileList.push({
url: this.form.iconUrl, url: this.form.iconUrl,
}); });
} }
this.open = true;
this.title = "修改设备信息";
});
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
...@@ -405,6 +505,7 @@ export default { ...@@ -405,6 +505,7 @@ export default {
this.getList(); this.getList();
}); });
} else { } else {
console.log(this.form, "this.form");
addDeviceInfo(this.form).then(response => { addDeviceInfo(this.form).then(response => {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
...@@ -454,11 +555,18 @@ export default { ...@@ -454,11 +555,18 @@ export default {
}) })
}, },
} }
}; };
</script> </script>
<style> <style>
.el-col { .notice {
margin-left: 0; background: white;
margin-right: 10px; position: fixed;
top: 102px;
right: 0;
left: 0;
margin: auto;
width: 80%;
height: 80%;
border: solid 1px;
} }
</style> </style>
...@@ -243,11 +243,11 @@ ...@@ -243,11 +243,11 @@
</template> </template>
<script> <script>
import { listPipe, getPipe, addPipe, updatePipe, exportPipe } from "@/api/device/pipe"; import { listPipe, getPipe, addPipe, updatePipe, exportPipe } from "@/api/device/pipe";
import MyFileUpload from '@/components/MyFileUpload'; import MyFileUpload from '@/components/MyFileUpload';
// import Mapdialog from "@/components/mapDialog/checkPipeLineLocation.vue"; import Mapdialog from "@/components/mapDialog/checkPipeLineLocation.vue";
export default { export default {
name: "Pipe", name: "Pipe",
components: { components: {
MyFileUpload, MyFileUpload,
...@@ -280,6 +280,7 @@ export default { ...@@ -280,6 +280,7 @@ export default {
// 地图 // 地图
loadmap: false, loadmap: false,
dialogTableVisible: false, dialogTableVisible: false,
str: "",
// 管道压力数据字典 // 管道压力数据字典
pressureOptions: [], pressureOptions: [],
// 查询参数 // 查询参数
...@@ -365,9 +366,8 @@ export default { ...@@ -365,9 +366,8 @@ export default {
this.fileList = []; this.fileList = [];
}, },
confirmFun(res) { confirmFun(res) {
//确认选择经纬度 //确认选择坐标
this.form.longitude = res.lng; this.form.coordinates = res;
this.form.latitude = res.lat;
}, },
MapdialogFun() { MapdialogFun() {
this.loadmap = true; this.loadmap = true;
...@@ -503,7 +503,7 @@ export default { ...@@ -503,7 +503,7 @@ export default {
}) })
}, },
} }
}; };
</script> </script>
<style> <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