Commit af61664b authored by yaqizhang's avatar yaqizhang

Merge branch 'master' of http://111.61.77.35:9999/gengdidi/gassafety into master

parents 92eabaee fc10f4fc
......@@ -77,7 +77,8 @@ public class CommonController
// String fileName = FileUploadUtils.upload(filePath, file);
// String url = serverConfig.getUrl() + fileName;
String fileName = file.getOriginalFilename();
String url = serverConfig.getUrl() + FileUploadUtils.upload(filePath, file);
String fileServer = serverConfig.getUrl().contains("127") && serverConfig.getUrl().contains("8093") && !filePath.contains("/data")? serverConfig.getUrl() : serverConfig.getUrl().replace("127.0.0.1:8903","36.148.23.59:8901");
String url = fileServer + FileUploadUtils.upload(filePath, file);
AjaxResult ajax = AjaxResult.success();
ajax.put("fileName", fileName);
ajax.put("url", url);
......
......@@ -37,7 +37,7 @@ public class TOrderFeedback extends BaseEntity
@Excel(name = "反馈时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date feedbackTime;
/** 是否存在隐患(0正常,1存在隐患) */
/** 是否存在隐患(1是,2否) */
@Excel(name = "是否存在隐患", readConverterExp = "0=正常,1存在隐患")
private String isHiddenDanger;
......
......@@ -4,6 +4,7 @@ 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 com.zehong.system.domain.TOrderFeedback;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
......@@ -42,6 +43,9 @@ public class WorkOrderVo extends BaseEntity
/** 设备列表 */
private List<TDeviceInfo> deviceInfoList;
/** 反馈信息列表 */
private List<TOrderFeedback> feedbackList;
/** 设备数量 */
private int deviceNum;
......@@ -86,28 +90,12 @@ public class WorkOrderVo extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date actualTime;
/** 归档信息 */
private String archiving;
/** 备注 */
private String remarks;
/** 反馈内容 */
private String contents;
/** 反馈时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date feedbackTime;
/** 图片地址1 */
private String pictureUrl1;
/** 图片地址2 */
private String pictureUrl2;
/** 图片地址3 */
private String pictureUrl3;
/** 处理状态 */
private String dealStatus;
public void setOrderId(String orderId)
{
this.orderId = orderId;
......@@ -169,6 +157,14 @@ public class WorkOrderVo extends BaseEntity
this.deviceInfoList = deviceInfoList;
}
public List<TOrderFeedback> getFeedbackList() {
return feedbackList;
}
public void setFeedbackList(List<TOrderFeedback> feedbackList) {
this.feedbackList = feedbackList;
}
public int getDeviceNum() {
return deviceNum;
}
......@@ -234,6 +230,7 @@ public class WorkOrderVo extends BaseEntity
{
return orderStatus;
}
public void setAppointInspector(Long appointInspector)
{
this.appointInspector = appointInspector;
......@@ -243,6 +240,7 @@ public class WorkOrderVo extends BaseEntity
{
return appointInspector;
}
public void setAllotTime(Date allotTime)
{
this.allotTime = allotTime;
......@@ -252,6 +250,7 @@ public class WorkOrderVo extends BaseEntity
{
return allotTime;
}
public void setActualInspector(Long actualInspector)
{
this.actualInspector = actualInspector;
......@@ -261,6 +260,7 @@ public class WorkOrderVo extends BaseEntity
{
return actualInspector;
}
public void setActualTime(Date actualTime)
{
this.actualTime = actualTime;
......@@ -270,6 +270,7 @@ public class WorkOrderVo extends BaseEntity
{
return actualTime;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
......@@ -280,6 +281,14 @@ public class WorkOrderVo extends BaseEntity
return remarks;
}
public String getArchiving() {
return archiving;
}
public void setArchiving(String archiving) {
this.archiving = archiving;
}
public String getAppointInspectorName() {
return appointInspectorName;
}
......@@ -296,54 +305,6 @@ public class WorkOrderVo extends BaseEntity
this.actualInspectorName = actualInspectorName;
}
public String getContents() {
return contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public Date getFeedbackTime() {
return feedbackTime;
}
public void setFeedbackTime(Date feedbackTime) {
this.feedbackTime = feedbackTime;
}
public String getPictureUrl1() {
return pictureUrl1;
}
public void setPictureUrl1(String pictureUrl1) {
this.pictureUrl1 = pictureUrl1;
}
public String getPictureUrl2() {
return pictureUrl2;
}
public void setPictureUrl2(String pictureUrl2) {
this.pictureUrl2 = pictureUrl2;
}
public String getPictureUrl3() {
return pictureUrl3;
}
public void setPictureUrl3(String pictureUrl3) {
this.pictureUrl3 = pictureUrl3;
}
public String getDealStatus() {
return dealStatus;
}
public void setDealStatus(String dealStatus) {
this.dealStatus = dealStatus;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -62,6 +62,11 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
@Override
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback)
{
if("2".equals(tOrderFeedback.getIsHiddenDanger())){
tOrderFeedback.setDealStatus("1");
}
tOrderFeedback.setFeedbackTime(DateUtils.getNowDate());
String deviceCode = tOrderFeedback.getDeviceCode();
String dealStatus = tOrderFeedback.getDealStatus();
......@@ -90,7 +95,7 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
order.setOrderStatus("2");
tWorkOrderMapper.updateTWorkOrder(order);
}
tOrderFeedback.setFeedbackTime(DateUtils.getNowDate());
return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback);
}
......
......@@ -139,14 +139,8 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
workOrderVo.setDeviceInfoList(deviceInfoList);
List<TOrderFeedback> feedbackList = tOrderFeedbackMapper.selectTOrderFeedbackByOrderId(tWorkOrder.getOrderId());
if(feedbackList.size() != 0){
TOrderFeedback feedback = feedbackList.get(0);
workOrderVo.setContents(feedback.getContents());
workOrderVo.setFeedbackTime(feedback.getFeedbackTime());
workOrderVo.setDealStatus(feedback.getDealStatus());
workOrderVo.setPictureUrl1(feedback.getPictureUrl1() != null ? feedback.getPictureUrl1() : null);
workOrderVo.setPictureUrl2(feedback.getPictureUrl2() != null ? feedback.getPictureUrl2() : null);
workOrderVo.setPictureUrl3(feedback.getPictureUrl3() != null ? feedback.getPictureUrl3() : null);
if(feedbackList.size() != 0) {
workOrderVo.setFeedbackList(feedbackList);
}
return workOrderVo;
......
......@@ -266,3 +266,29 @@
position: relative;
float: right;
}
// 上传按钮
.hide {
.el-upload--picture-card {
display: none;
}
}
// 所有的提示框标题
.el-dialog__header{
padding-bottom:0;
padding:0px;
height: 51px;
line-height: 50px;
background-color: #053b6a;
.el-dialog__title{
display: inline-block;
margin-left:22px;
color:#fff;
}
.el-dialog__headerbtn{
i{
color: #fff;
}
}
// background-color: ;
}
\ No newline at end of file
......@@ -118,11 +118,11 @@
.hideSidebar {
.sidebar-container {
width: 54px !important;
// width: 54px !important;
}
.main-container {
margin-left: 54px;
// margin-left: 54px;
}
.submenu-title-noDropdown {
......
......@@ -11,9 +11,11 @@
:on-success="handleUploadSuccess"
:on-remove="handleRemove"
:on-preview="handleFileClick"
:on-change="fileChange"
:show-file-list="true"
:headers="headers"
class="upload-file-uploader"
:class="{hide:addShow}"
ref="upload"
>
<!-- 上传按钮 -->
......@@ -78,6 +80,7 @@ export default {
type: Boolean,
default: false,
},
},
data() {
return {
......@@ -89,6 +92,7 @@ export default {
modal:false,
dialogVisible:false,
dialogImageUrl:"",
addShow:true,
};
},
computed: {
......@@ -163,6 +167,7 @@ export default {
// 文件列表移除文件
handleRemove(file, fileList) {
console.log("列表移除", file, fileList);
this.addShow = fileList.length>0 ?true:false;
this.$emit("remove", file);
},
// 删除文件
......@@ -197,9 +202,15 @@ export default {
return "";
}
},
// 当改变列表改变时
fileChange(file,fileList){
this.addShow = fileList.length>0 ?true:false;
}
},
created() {
// this.fileList = this.list;
this.addShow = this.fileArr.length>0 ?true:false;
},
};
</script>
......@@ -223,4 +234,5 @@ export default {
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
}
</style>
......@@ -2,37 +2,84 @@
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="80%"
:before-close="handleClose">
:before-close="handleClose"
>
<el-row>
<el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row>
<el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode">
<el-select v-model="form.pipeCode" placeholder="请选择所属管道">
<el-select v-model="form.pipeCode" placeholder="请选择所属管道" style="width: 100%">
<el-option
v-for="item in pipeList"
:key="item.pipeCode"
:label="item.pipeName"
:value="item.pipeCode">
:value="item.pipeCode"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
<el-input
v-model="form.deviceName"
placeholder="请输入设备名称"
/>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel">
<el-input
v-model="form.deviceModel"
placeholder="请输入设备型号"
/>
</el-form-item>
</el-col>
</el-row>
<el-col :span="11">
<el-form-item label="所在地址" prop="deviceAddr">
<el-input v-model="form.deviceAddr" placeholder="请输入所在地址" />
</el-form-item>
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.deviceModel" placeholder="请输入设备型号" />
</el-col>
<el-col :span="11">
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<el-col :span="22">
<el-form-item label="经纬度坐标" prop="">
<el-card shadow="newver" class="box-card">
<div v-text="`[[${form.longitude},${form.latitude}]]`"></div>
</el-card>
</el-form-item>
</el-col>
<!-- <el-col>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</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="11">
<el-form-item label="联系电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系电话" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="设备图片上传" prop="iconUrl">
<MyFileUpload
listType="picture-card"
......@@ -40,25 +87,36 @@
@remove="listRemove"
:fileArr="fileArr"
/>
<el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="安装时间" prop="installationTime">
<el-date-picker clearable size="small"
<el-date-picker
clearable
size="small"
v-model="form.installationTime"
type="datetime"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择安装时间">
placeholder="选择安装时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="22">
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
<el-input
type="textarea"
v-model="form.remarks"
placeholder="请输入备注"
/>
</el-form-item>
</el-col>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
......@@ -67,67 +125,99 @@
</template>
<script>
import {
getAllDeviceInfo,
addDeviceInfo,
updateDeviceInfo,
} from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
export default {
export default {
props: {
title: { type: String }
title: { type: String },
},
data () {
data() {
return {
form : {
deviceType : "3"
form: {
deviceType: "3",
},
dialogVisible : false,
dialogVisible: false,
fileList: [],
// 表单校验
rules: {},
map: null,
obj: null,
gaoMap: null,
fileArr: [],
pipeList: [],
rules: {
pipeCode: [
{ required: true, message: "请选择所属管道", trigger: "blur" },
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
],
deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" },
],
deviceModel: [
{ required: true, message: "请输入设备型号", trigger: "blur" },
],
deviceAddr: [
{ required: true, message: "请输入所在地址", trigger: "blur" },
],
iotNo: [
{ required: true, message: "请输入物联网编号", trigger: "blur" },
],
linkman: [{ required: true, message: "请输入联系人", trigger: "blur" }],
phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
iconUrl: [{ required: true, message: "请上传图片", trigger: "change" }],
installationTime: [
{
// type: "date",
required: true,
message: "请选择日期",
trigger: "change",
},
map : null,
obj : null,
gaoMap : null,
fileArr: [],
pipeList: []
}
],
},
};
},
components: {
MyFileUpload,
},
methods: {
show () {
show() {
this.dialogVisible = true;
},
hide () {
this.remove()
hide() {
this.remove();
},
getFileInfo(res){
getFileInfo(res) {
this.form.iconUrl = res.url;
},
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then(response => {
updateDeviceInfo(this.form).then((response) => {
this.dialogVisible = false;
this.map.remove(this.obj);
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
this.msgSuccess("修改成功");
});
} else {
addDeviceInfo(this.form).then(response => {
if(response.code == 200){
addDeviceInfo(this.form).then((response) => {
if (response.code == 200) {
this.remove();
this.map.remove(this.obj);
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
//this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功");
}else{
} else {
this.msgSuccess("新增失败");
}
});
......@@ -141,14 +231,21 @@
listRemove(e) {
this.form.url = "";
this.fileArr = [];
}
},
mounted(){
pipeAllInfoList({}).then(response => {
getPipeInfos(){
pipeAllInfoList({}).then((response) => {
this.pipeList = response.data;
});
}
},
watch:{
dialogVisible(val){
if(val){
this.getPipeInfos();
}
}
}
};
</script>
......@@ -54,7 +54,7 @@
<span>{{ obj.inspectionTime }}</span>
</div>
<div>
<span>备注信息</span>
<span>备注信息</span>
<span>{{ obj.remarks }} </span>
</div>
</div>
......@@ -179,7 +179,7 @@ export default {
vertical-align: top;
display: inline-block;
word-break: break-all;
max-width: 280px;
max-width: 250px;
}
}
}
......
......@@ -2,18 +2,19 @@
<div class="wrapper">
<span class="dot-left"></span>
<div class="top display-default">
<div class="left text">{{title}}</div>
<div class="left text">{{data.deviceName}}</div>
<div class="right text">
<img src="../../assets/images/closeBtn.png" alt="" @click="map.clearInfoWindow()"/>
</div>
</div>
<!-- 设备信息 -->
<div class="content">
<div class="eq-content display-default">
<div class="text-wrapper">
<div class="eq-text">设备名称:<span>{{data.deviceName}}</span></div>
<div class="eq-text">设备类型:<span>{{title}}</span></div>
<div class="eq-text">设备型号:<span>{{data.deviceModel}}</span></div>
<div class="eq-text">所属管道:<span>{{data.pipeCode}}</span></div>
<div class="eq-text">设备状态:<span>报警</span></div>
<div class="eq-text">物联网编号:<span>{{data.iotNo}}</span></div>
</div>
<div class="pic">
<img v-bind:src="data.iconUrl" alt="" />
......@@ -21,15 +22,18 @@
</div>
<!-- 维修人员 -->
<div class="maintain-content">
<div>姓名: <span>{{data.linkman}}</span></div>
<div>电话: <span>{{data.phone}}</span></div>
<div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
<div>管道所在地址:<span>{{data.deviceAddr}}</span></div>
<div>安装日期:<span>{{data.installationTime}}</span></div>
<div>最后巡检日期:<span></span></div>
<div>备注信息:<span>{{data.remarks}}</span></div>
</div>
<!-- 报警状态 -->
<div class="warn-content">
<!--<div class="warn-content">
<div>报警状态 <span>报警</span></div>
<div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
</div>-->
</div>
</div>
</template>
......@@ -48,7 +52,6 @@ export default {
<style lang="scss" scoped>
.wrapper {
width: 406px;
height: 488px;
background: #fff;
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
......@@ -76,7 +79,6 @@ export default {
height: 156px;
box-sizing: border-box;
padding: 13px 16px 13px 22px;
border-bottom: 1px solid #e2e2e2;
.text-wrapper {
padding-top: 1px;
& > div {
......@@ -102,15 +104,20 @@ export default {
.maintain-content {
width: 100%;
height: 109px;
height: 130px;
padding-left: 22px;
padding-top: 16px;
box-sizing: border-box;
border-bottom: 1px solid #e2e2e2;
& > div {
margin-bottom: 8px;
font-size: 14px;
font-weight: 400;
span {
vertical-align: top;
display: inline-block;
word-break: break-all;
max-width: 250px;
}
}
}
......@@ -192,4 +199,46 @@ export default {
}
.content {
max-height: 480px;
overflow: hidden;
overflow-y: auto;
.eq-content {
min-height: 156px;
box-sizing: border-box;
padding: 13px 22px 0px 22px;
// border-bottom: 1px solid #e2e2e2;
.text-wrapper {
padding-top: 1px;
& > div {
margin-bottom: 6px;
}
.eq-text {
font-size: 14px;
font-weight: 400;
color: #1d1d1d;
opacity: 1;
& > span {
vertical-align: top;
display: inline-block;
// white-space: nowrap;
// text-overflow: ellipsis;
// overflow: hidden;
word-break: break-all;
max-width: 88px;
}
}
}
.pic {
width: 177px;
height: 129px;
// background-color: black;
img {
width: 100%;
height: 100%;
}
}
}
}
</style>
<template>
<el-dialog
title="新增"
:title="myTitle"
:visible.sync="dialogVisible"
:before-close="handleClose"
>
......@@ -9,8 +9,8 @@
:rules="rules"
ref="editForm"
:model="editForm"
label-width="120px"
size="mini"
label-width="135px"
>
<el-col>
<el-form-item v-show="false" label="管道id" prop="pipeId">
......@@ -25,7 +25,6 @@
<el-col>
<el-form-item v-show="false" label="企业id" prop="enterpriseId">
<el-input disabled v-model="editForm.enterpriseId"></el-input>
</el-form-item>
</el-col>
......@@ -41,7 +40,7 @@
</el-col>
<el-col :span="11">
<el-form-item label="管道长度" prop="pipeLength">
<el-input type="number" min=0 v-model="editForm.pipeLength">
<el-input type="number" min="0" v-model="editForm.pipeLength">
<i
slot="suffix"
style="color: #000; font-style: normal; margin-right: 10px"
......@@ -225,14 +224,33 @@ export default {
},
};
},
computed:{
myTitle(){
if(this.editForm.pipeId){
return `修改管道信息`
}else{
return `新增管道信息`
}
}
},
created() {
console.log("lineData", this.lineData, this.lnglatsArr, this.pipeLength);
if (this.lineData?.pipeId) {
this.editForm = { ...this.lineData };
} else {
// 如果是新建的里面天蝎过东西就存档
console.log("内部lineDate", this.target.getExtData());
const { lineData } = this.target.getExtData();
console.log(lineData)
if (lineData) {
this.editForm = { ...lineData };
}
}
this.editForm.coordinates = getString(this.lnglatsArr);
// 如果有图片路径就赋显,如果没有就啥也没有
this.fileArr = this.lineData.pipeId ? [{ url: this.editForm.iconUrl }] : [];
this.fileArr = this.editForm?.iconUrl
? [{ url: this.editForm.iconUrl }]
: [];
},
methods: {
mouseup() {
......@@ -293,11 +311,17 @@ export default {
this.remove();
},
handleClose(done) {
this.$confirm("确认关闭?")
.then((_) => {
let options = this.target.getExtData();
options.lineData = { ...this.editForm };
this.target.setExtData(options);
// 把值带出去
done();
})
.catch((_) => {});
// this.$confirm("确认关闭?")
// .then((_) => {
// done();
// })
// .catch((_) => {});
},
// 图片上传成功
fileFinshed(e) {
......
......@@ -2,37 +2,85 @@
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="80%"
:before-close="handleClose">
:before-close="handleClose"
>
<el-row>
<el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row>
<el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode">
<el-select v-model="form.pipeCode" placeholder="请选择所属管道">
<el-select v-model="form.pipeCode" placeholder="请选择所属管道" style="width: 100%">
<el-option
v-for="item in pipeList"
:key="item.pipeCode"
:label="item.pipeName"
:value="item.pipeCode">
:value="item.pipeCode"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
<el-input
v-model="form.deviceName"
placeholder="请输入设备名称"
/>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel">
<el-input
v-model="form.deviceModel"
placeholder="请输入设备型号"
/>
</el-form-item>
</el-col>
</el-row>
<el-col :span="11">
<el-form-item label="所在地址" prop="deviceAddr">
<el-input v-model="form.deviceAddr" placeholder="请输入所在地址" />
</el-form-item>
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.deviceModel" placeholder="请输入设备型号" />
</el-col>
<el-col :span="11">
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<el-col :span="22">
<el-form-item label="经纬度坐标" prop="">
<el-card shadow="newver" class="box-card">
<div v-text="`[[${form.longitude},${form.latitude}]]`"></div>
</el-card>
</el-form-item>
</el-col>
<!-- <el-col>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</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="11">
<el-form-item label="联系电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系电话" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="设备图片上传" prop="iconUrl">
<MyFileUpload
listType="picture-card"
......@@ -40,25 +88,35 @@
@remove="listRemove"
:fileArr="fileArr"
/>
<el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="安装时间" prop="installationTime">
<el-date-picker clearable size="small"
<el-date-picker
clearable
size="small"
v-model="form.installationTime"
type="datetime"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择安装时间">
placeholder="选择安装时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="22">
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
<el-input
type="textarea"
v-model="form.remarks"
placeholder="请输入备注"
/>
</el-form-item>
</el-col>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
......@@ -67,67 +125,69 @@
</template>
<script>
import {
getAllDeviceInfo,
addDeviceInfo,
updateDeviceInfo,
} from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
export default {
export default {
props: {
title: { type: String }
title: { type: String },
},
data () {
data() {
return {
form : {
deviceType : "4"
form: {
deviceType: "4",
},
dialogVisible : false,
dialogVisible: false,
fileList: [],
// 表单校验
rules: {
},
map : null,
obj : null,
gaoMap : null,
rules: {},
map: null,
obj: null,
gaoMap: null,
fileArr: [],
pipeList: []
}
pipeList: [],
};
},
components: {
MyFileUpload,
},
methods: {
show () {
show() {
this.dialogVisible = true;
},
hide () {
this.remove()
hide() {
this.remove();
},
getFileInfo(res){
getFileInfo(res) {
this.form.iconUrl = res.url;
},
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then(response => {
updateDeviceInfo(this.form).then((response) => {
this.dialogVisible = false;
this.map.remove(this.obj);
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
this.msgSuccess("修改成功");
});
} else {
addDeviceInfo(this.form).then(response => {
if(response.code == 200){
addDeviceInfo(this.form).then((response) => {
if (response.code == 200) {
this.remove();
this.map.remove(this.obj);
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
//this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功");
}else{
} else {
this.msgSuccess("新增失败");
}
});
......@@ -141,14 +201,21 @@
listRemove(e) {
this.form.url = "";
this.fileArr = [];
}
},
mounted(){
pipeAllInfoList({}).then(response => {
getPipeInfos(){
pipeAllInfoList({}).then((response) => {
this.pipeList = response.data;
});
}
},
watch:{
dialogVisible(val){
if(val){
this.getPipeInfos();
}
}
}
};
</script>
......@@ -2,37 +2,78 @@
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="80%"
:before-close="handleClose">
<el-row>
<el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row>
<el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode">
<el-select v-model="form.pipeCode" placeholder="请选择所属管道">
<el-select v-model="form.pipeCode" placeholder="请选择所属管道" style="width: 100%">
<el-option
v-for="item in pipeList"
:key="item.pipeCode"
:label="item.pipeName"
:value="item.pipeCode">
:value="item.pipeCode"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.deviceModel" placeholder="请输入设备型号" />
</el-form-item>
</el-col>
</el-row>
<el-col :span="11">
<el-form-item label="所在地址" prop="deviceAddr">
<el-input v-model="form.deviceAddr" placeholder="请输入所在地址" />
</el-form-item>
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.deviceModel" placeholder="请输入设备型号" />
</el-col>
<el-col :span="11">
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<el-col :span="22">
<el-form-item label="经纬度坐标" prop="">
<el-card class="box-card">
<div v-text="`[[${form.longitude},${form.latitude}]]`"></div>
</el-card>
</el-form-item>
</el-col>
<!-- <el-col>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</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="11">
<el-form-item label="联系电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系电话" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="设备图片上传" prop="iconUrl">
<MyFileUpload
listType="picture-card"
......@@ -40,25 +81,35 @@
@remove="listRemove"
:fileArr="fileArr"
/>
<el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="安装时间" prop="installationTime">
<el-date-picker clearable size="small"
<el-date-picker
clearable
size="small"
v-model="form.installationTime"
type="datetime"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择安装时间">
placeholder="选择安装时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="22">
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
<el-input
type="textarea"
v-model="form.remarks"
placeholder="请输入备注"
/>
</el-form-item>
</el-col>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
......@@ -84,14 +135,44 @@
},
dialogVisible : false,
fileList: [],
// 表单校验
rules: {
},
map : null,
obj : null,
gaoMap : null,
fileArr: [],
pipeList: []
pipeList: [],
rules: {
pipeCode: [
{ required: true, message: "请选择所属管道", trigger: "blur" },
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
],
deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" },
],
deviceModel: [
{ required: true, message: "请输入设备型号", trigger: "blur" },
],
deviceAddr: [
{ required: true, message: "请输入所在地址", trigger: "blur" },
],
iotNo: [
{ required: true, message: "请输入物联网编号", trigger: "blur" },
],
linkman: [
{ required: true, message: "请输入联系人", trigger: "blur" },
],
phone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
],
iconUrl: [{ required: true, message: "请上传图片", trigger: "change" }],
installationTime: [
{
// type: "date",
required: true,
message: "请选择日期",
trigger: "change",
},
],
},
}
},
components: {
......@@ -124,7 +205,6 @@
this.remove();
this.map.remove(this.obj);
this.form.deviceId = response.data;
console.log(this.gaoMap,"addgaoMap")
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
//this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
......@@ -143,13 +223,20 @@
},
handleClose(done) {
done();
}
},
mounted(){
pipeAllInfoList({}).then(response => {
getPipeInfos(){
pipeAllInfoList({}).then((response) => {
this.pipeList = response.data;
});
}
},
watch:{
dialogVisible(val){
if(val){
this.getPipeInfos();
}
}
}
}
</script>
......
......@@ -2,37 +2,77 @@
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="80%"
:before-close="handleClose">
<el-row>
<el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row>
<el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode">
<el-select v-model="form.pipeCode" placeholder="请选择所属管道">
<el-select v-model="form.pipeCode" placeholder="请选择所属管道" style="width: 100%">
<el-option
v-for="item in pipeList"
:key="item.pipeCode"
:label="item.pipeName"
:value="item.pipeCode">
:value="item.pipeCode"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.deviceModel" placeholder="请输入设备型号" />
</el-form-item>
</el-col>
</el-row>
<el-col :span="11">
<el-form-item label="所在地址" prop="deviceAddr">
<el-input v-model="form.deviceAddr" placeholder="请输入所在地址" />
</el-form-item>
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.deviceModel" placeholder="请输入设备型号" />
</el-col>
<el-col :span="11">
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<el-col :span="22">
<el-form-item label="经纬度坐标" prop="">
<el-card class="box-card">
<div v-text="`[[${form.longitude},${form.latitude}]]`"></div>
</el-card>
</el-form-item>
</el-col>
<!-- <el-col>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</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="11">
<el-form-item label="联系电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系电话" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="设备图片上传" prop="iconUrl">
<MyFileUpload
listType="picture-card"
......@@ -40,25 +80,35 @@
@remove="listRemove"
:fileArr="fileArr"
/>
<el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="安装时间" prop="installationTime">
<el-date-picker clearable size="small"
<el-date-picker
clearable
size="small"
v-model="form.installationTime"
type="datetime"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择安装时间">
placeholder="选择安装时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="22">
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
<el-input
type="textarea"
v-model="form.remarks"
placeholder="请输入备注"
/>
</el-form-item>
</el-col>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
......@@ -84,14 +134,44 @@
},
dialogVisible : false,
fileList: [],
// 表单校验
rules: {
},
map : null,
obj : null,
gaoMap : null,
fileArr: [],
pipeList: []
pipeList: [],
rules: {
pipeCode: [
{ required: true, message: "请选择所属管道", trigger: "blur" },
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
],
deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" },
],
deviceModel: [
{ required: true, message: "请输入设备型号", trigger: "blur" },
],
deviceAddr: [
{ required: true, message: "请输入所在地址", trigger: "blur" },
],
iotNo: [
{ required: true, message: "请输入物联网编号", trigger: "blur" },
],
linkman: [
{ required: true, message: "请输入联系人", trigger: "blur" },
],
phone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
],
iconUrl: [{ required: true, message: "请上传图片", trigger: "change" }],
installationTime: [
{
// type: "date",
required: true,
message: "请选择日期",
trigger: "change",
},
],
},
}
},
components: {
......@@ -141,13 +221,20 @@
listRemove(e) {
this.form.url = "";
this.fileArr = [];
}
},
mounted(){
pipeAllInfoList({}).then(response => {
getPipeInfos(){
pipeAllInfoList({}).then((response) => {
this.pipeList = response.data;
});
}
},
watch:{
dialogVisible(val){
if(val){
this.getPipeInfos();
}
}
}
}
</script>
......
......@@ -6,12 +6,17 @@
>
<template v-for="(item, index) in topMenus">
<!-- <el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber" -->
<el-menu-item :style="" :index="item.path" :key="index" v-if="index < visibleNumber">
<el-menu-item
:style=""
:index="item.path"
:key="index"
v-if="index < visibleNumber"
>
<!-- 导航栏左侧图标 -->
<!-- <svg-icon :icon-class="item.meta.icon" /> -->
{{ item.meta.title }}</el-menu-item>
<div class="menu-item-div"></div>
{{ item.meta.title }}
</el-menu-item>
<!-- <div class="menu-item-div"></div> -->
</template>
<!-- 顶部菜单超出数量折叠 -->
......@@ -32,7 +37,7 @@
<script>
import { constantRoutes } from "@/router";
import '../../common/font/font.css'
import "../../common/font/font.css";
export default {
data() {
return {
......@@ -41,7 +46,7 @@ export default {
// 是否为首次加载
isFrist: false,
// 当前激活菜单的 index
currentIndex: undefined
currentIndex: undefined,
};
},
computed: {
......@@ -73,11 +78,13 @@ export default {
this.routers.map((router) => {
for (var item in router.children) {
if (router.children[item].parentPath === undefined) {
if(router.path === "/") {
router.children[item].path = "/redirect/" + router.children[item].path;
if (router.path === "/") {
router.children[item].path =
"/redirect/" + router.children[item].path;
} else {
if(!this.ishttp(router.children[item].path)) {
router.children[item].path = router.path + "/" + router.children[item].path;
if (!this.ishttp(router.children[item].path)) {
router.children[item].path =
router.path + "/" + router.children[item].path;
}
}
router.children[item].parentPath = router.path;
......@@ -103,17 +110,17 @@ export default {
}
var routes = this.activeRoutes(activePath);
if (routes.length === 0) {
activePath = this.currentIndex || this.routers[0].path
activePath = this.currentIndex || this.routers[0].path;
this.activeRoutes(activePath);
}
return activePath;
},
},
beforeMount() {
window.addEventListener('resize', this.setVisibleNumber)
window.addEventListener("resize", this.setVisibleNumber);
},
beforeDestroy() {
window.removeEventListener('resize', this.setVisibleNumber)
window.removeEventListener("resize", this.setVisibleNumber);
},
mounted() {
this.setVisibleNumber();
......@@ -126,6 +133,7 @@ export default {
},
// 菜单选择事件
handleSelect(key, keyPath) {
console.log(key)
this.currentIndex = key;
if (this.ishttp(key)) {
// http(s):// 路径新窗口打开
......@@ -148,14 +156,14 @@ export default {
}
});
}
if(routes.length > 0) {
if (routes.length > 0) {
this.$store.commit("SET_SIDEBAR_ROUTERS", routes);
}
return routes;
},
ishttp(url) {
return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
}
return url.indexOf("http://") !== -1 || url.indexOf("https://") !== -1;
},
},
};
</script>
......@@ -176,9 +184,9 @@ export default {
}
.el-menu--horizontal > .el-menu-item.is-active {
border-bottom: 3px solid #{'var(--theme)'};
border-bottom: 3px solid #{"var(--theme)"};
/* box-shadow: inset 2px 2px 20px #5CD9D4; */
color: #5CD9D4;
color: #5cd9d4;
}
/* submenu item */
......@@ -186,19 +194,25 @@ export default {
height: 50px !important;
line-height: 50px !important;
}
.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover, .el-menu--horizontal > .el-menu-item:not(.is-disabled):focus{
.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
.el-menu--horizontal > .el-menu-item:not(.is-disabled):focus {
background-color: rgba(0, 0, 0, 0);
/* opacity: 0; */
/* box-shadow: inset 2px 2px 20px #5CD9D4; */
color: #fff;
}
.menu-item-div{
.menu-item-div {
width: 2px;
height: 30px;
margin-top: 25px;
background-color: rgb(190, 189, 189);
float: left;
background: linear-gradient(130deg, rgba(0, 0, 0, 0) 0%,rgba(255,255,255,0.7) 50%, rgba(0, 0, 0, 0) 100%);
background: linear-gradient(
130deg,
rgba(0, 0, 0, 0) 0%,
rgba(255, 255, 255, 0.7) 50%,
rgba(0, 0, 0, 0) 100%
);
&:last-child {
width: 0px;
......
......@@ -4,7 +4,8 @@
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)"/><br>
<item :title="onlyOneChild.meta.title" />
<!-- <item :title="onlyOneChild.meta.title" /> -->
{{onlyOneChild.meta.title}}
</el-menu-item>
</app-link>
</template>
......
<template>
<div :class="classObj" class="app-wrapper" :style="{'--current-color': theme}">
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
<sidebar class="sidebar-container" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg }" />
<Sidebar class="sidebar-container" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg }" />
<div :class="{hasTagsView:needTagsView}" class="main-container">
<div :class="{'fixed-header':fixedHeader}">
<navbar />
......
......@@ -142,6 +142,16 @@ class gaodeMap {
offset: new AMap.Pixel(24, -38),
anchor: "left-top"
});
infoWindow.on("mouseover",function () {
let options = map.getStatus();
options.scrollWheel = false;
map.setStatus(options);
});
infoWindow.on("mouseout",function () {
let options = map.getStatus();
options.scrollWheel = true;
map.setStatus(options);
});
let marker = new AMap.Marker({
position: [data.longitude, data.latitude],
map: map,
......@@ -154,7 +164,7 @@ class gaodeMap {
marker.on("mouseout", infoClose);
marker.setExtData(data);
that.deviceType = markerType;
let editWindow = that.createInfowindow();
let editWindow = that.createInfowindow("编辑");
editWindow.fileArr =
data.iconUrl != "" && data.iconUrl != undefined
? [{ url: data.iconUrl }]
......@@ -167,7 +177,8 @@ class gaodeMap {
editWindow.form = e.target.getExtData();
editWindow.show();
} else if ("delete" == that.mapOperateType) {
vue.$confirm("是否删除"+e.target.getExtData().deviceName, "提示", {
let diviceType = {"2":"调压箱","3":"阀门井","4":"流量计","7":"压力表",};
vue.$confirm('是否删除名称为"'+e.target.getExtData().deviceName+'"的'+diviceType[markerType]+" ?", "提示", {
type: "warning"
// center: true
}).then(() => {
......@@ -181,7 +192,7 @@ class gaodeMap {
message: "已取消删除"
});
});
} else {
} /*else {
//map.setZoomAndCenter(13, e.target.getPosition());
let infoWindow = new AMap.InfoWindow({
isCustom: true,
......@@ -190,7 +201,7 @@ class gaodeMap {
});
infoWindow.setContent(e.target.content);
infoWindow.open(map, e.target.getPosition());
}
}*/
});
marker.on("dragend", function(e) {
editWindow.form.longitude = e.lnglat.lng;
......@@ -203,12 +214,21 @@ class gaodeMap {
//map.setFitView();
function infoClose(e) {
infoWindow.close(map, e.target.getPosition());
let options = map.getStatus();
options.scrollWheel = true;
map.setStatus(options);
//infoWindow.close(map, e.target.getPosition());
}
function infoOpen(e) {
let options = map.getStatus();
options.scrollWheel = false;
map.setStatus(options);
infoWindow.setContent(e.target.content);
infoWindow.open(map, e.target.getPosition());
that.markerInfoWindow = infoWindow;
}
}
......@@ -371,7 +391,7 @@ class gaodeMap {
let polyline = new AMap.Polyline({
path,
strokeColor: "#F7FE38",
strokeWeight: 8,
strokeWeight: 4,
strokeOpacity: 0.9,
zIndex: 50,
bubble: true,
......@@ -477,9 +497,10 @@ class gaodeMap {
}
// 创建一条新的线
createNewLine() {
map.remove(this.markerOverlays);
this.mouseTool.polyline({
// bubbles:false,
strokeWeight: 9,
strokeWeight: 4,
strokeColor: "#80d8ff",
extData: {
type: "newLine",
......@@ -504,8 +525,9 @@ class gaodeMap {
}
}
// 新建line增加编辑以及右键菜单
closeLineInfoWindow() {
closeInfoWindow() {
this.showInfoWindow && this.showInfoWindow.close();
this.markerInfoWindow && this.markerInfoWindow.close();
}
// 新line与老line添加点击事件
newLineAddEvent(obj) {
......@@ -545,6 +567,7 @@ class gaodeMap {
const pipeLength = obj.getLength();
// 传回来的数据 如果是新管道就是空
const lineData = type == "newLine" ? {} : obj.getExtData().lineData;
// const lineData = obj.getExtData().lineData;
console.log("lineData===================>传入组件的数据", lineData);
this.infoWindowPipelineView({
target: obj,
......@@ -579,7 +602,7 @@ class gaodeMap {
lineData: { pipeName }
} = obj.getExtData();
vue
.$confirm(`是否删除${pipeName}`, "提示", {
.$confirm(`是否删除名称为"${pipeName}"的管道 ?`, "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
type: "warning"
......@@ -675,7 +698,7 @@ class gaodeMap {
this.mouseTool.on("draw", function(e) {
if (e.obj.getExtData().type != "newLine") {
map.remove(that.markerOverlays);
const device = that.createInfowindow();
const device = that.createInfowindow("新增");
device.map = map;
device.obj = e.obj;
device.gaoMap = that;
......@@ -692,16 +715,32 @@ class gaodeMap {
device.show();
});
e.obj.on("mouseover",function () {
that.mouseTool.close();
});
e.obj.on("mouseout",function () {
that.draw(that.deviceType);
})
that.markerOverlays.push(e.obj);
}
if (e.obj && e.obj.getExtData().type == "newLine") {
console.log("挂上事件");
that.newLineAddEvent(e.obj);
// 记录这条线
// console.log(e.obj.getPath().length)
// 如果只有一个点,并没有连成线的时候就不close 大于一个点的时候才执行clse
console.log(that.lineType)
if (e.obj.getPath().length > 1) {
that.newLineObj = e.obj;
// 关闭
that.mouseTool.close();
} else {
// that.newLineObj = null;
}
// 关闭
// 创建一条新线,然后在点地图的时候删除原来的旧线
// that.createNewLine();
......@@ -720,29 +759,29 @@ class gaodeMap {
/**
* 创建弹框事件
*/
createInfowindow() {
createInfowindow(val) {
switch (this.deviceType) {
case DEVICE_TYPE.PIPEPLINE: {
break;
}
case DEVICE_TYPE.REGEULATORBOX: {
return createPop(regulatorBox, {
title: "调压箱"
title: val+ "调压箱"
});
}
case DEVICE_TYPE.VALUEWELL: {
return createPop(valveWell, {
title: "阀门井"
title: val+ "阀门井"
});
}
case DEVICE_TYPE.FLOWMETER: {
return createPop(flowMeter, {
title: "流量计"
title: val+ "流量计"
});
}
case DEVICE_TYPE.PRESSUREGAGE: {
return createPop(flowMeter, {
title: "压力表"
title: val+ "压力表"
});
}
}
......@@ -811,18 +850,18 @@ class gaodeMap {
let that = this;
AMap.plugin(["AMap.AutoComplete", "AMap.PlaceSearch"], function() {
//输入提示
var autoOptions = {
input: inputId
};
let auto = new AMap.AutoComplete(autoOptions);
// var autoOptions = {
// input: inputId
// };
// let auto = new AMap.AutoComplete(autoOptions);
that.placeSearch = new AMap.PlaceSearch({
map: map
});
//构造地点查询类
auto.on("select", function(e) {
that.searchSelectAdcode = e.poi.adcode;
that.searchSelectName = e.poi.name;
});
// auto.on("select", function(e) {
// that.searchSelectAdcode = e.poi.adcode;
// that.searchSelectName = e.poi.name;
// });
});
}
......
......@@ -69,16 +69,10 @@
id="tipinput"
class="search-input"
/>
<el-button
icon="el-icon-search"
class="search-but"
@click="search()"
<el-button icon="el-icon-search" class="search-but" @click="search()"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
class="refresh-but"
@click="refreshMap()"
<el-button icon="el-icon-refresh" class="refresh-but" @click="refreshMap()"
>重置</el-button
>
......@@ -157,7 +151,7 @@ export default {
this.initMap();
},
methods: {
initMap(){
initMap() {
let gaoMap = new gaodeMap("石家庄");
this.gaoMap = gaoMap;
window.addEventListener("click", this.barClose);
......@@ -181,44 +175,37 @@ export default {
if (this.leftBarNum.includes(1)) {
this.gaoMap.lineShow(true);
}else{
} else {
this.gaoMap.lineShow(false);
}
// console.log("marks",this.gaoMap.markers)
// this.gaoMap.markerShow();
if (this.leftBarNum.includes(2)) {
this.gaoMap.markerShow(1,true)
}else{
this.gaoMap.markerShow(1,false)
this.gaoMap.markerShow(1, true);
} else {
this.gaoMap.markerShow(1, false);
}
if (this.leftBarNum.includes(3)) {
this.gaoMap.markerShow(2,true)
}else{
this.gaoMap.markerShow(2,false)
this.gaoMap.markerShow(2, true);
} else {
this.gaoMap.markerShow(2, false);
}
if (this.leftBarNum.includes(4)) {
this.gaoMap.markerShow(3,true)
}else{
this.gaoMap.markerShow(3,false)
this.gaoMap.markerShow(3, true);
} else {
this.gaoMap.markerShow(3, false);
}
if (this.leftBarNum.includes(7)) {
this.gaoMap.markerShow(4,true)
}else{
this.gaoMap.markerShow(4,false)
this.gaoMap.markerShow(4, true);
} else {
this.gaoMap.markerShow(4, false);
}
},
addDevice() {
if (this.iconClass == "icon-create") {
this.targetNum = this.targetNum != 1 ? 1 : 0;
} else {
......@@ -226,16 +213,16 @@ export default {
this.targetNum = 0;
this.createReset();
this.gaoMap.newLineReset();
}
}
if (this.targetNum == 1 && this.createValue == 1) {
this.gaoMap.lineType = 1;
} else {
this.gaoMap.lineType = 0;
this.gaoMap.mouseTool.close();
}
// 关闭当前线条的infowindow
this.gaoMap.closeLineInfoWindow();
// 关闭当前的infowindow
this.gaoMap.closeInfoWindow();
this.deviceType = !this.deviceType;
this.gaoMap.mapOperateType = "add";
......@@ -262,7 +249,6 @@ export default {
// 如果不是管道了,把之前的管道清空
this.gaoMap.newLineReset();
// this.createReset();
// 其他
this.gaoMap.draw(this.createValue.toString());
......@@ -284,7 +270,7 @@ export default {
this.gaoMap.linePolyEditorAllClose();
this.gaoMap.removeMarkerDragg();
this.gaoMap.mapOperateType = "normal";
}else{
} else {
// 如果正在新建线条,则清空
this.gaoMap.newLineReset();
this.deviceType = false;
......@@ -293,6 +279,8 @@ export default {
// this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
}
// 关闭当前的infowindow
this.gaoMap.closeInfoWindow();
this.createReset();
},
deleteDevice() {
......@@ -301,7 +289,7 @@ export default {
if (this.targetNum != 3) {
this.gaoMap.removeMarkerDragg();
this.gaoMap.mapOperateType = "normal";
}else{
} else {
// 如果正在新建线条,则清空
this.gaoMap.newLineReset();
// 清空所有正在编辑状态的线
......@@ -312,6 +300,8 @@ export default {
//this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
}
// 关闭当前的infowindow
this.gaoMap.closeInfoWindow();
this.createReset();
},
selectDeviceType(val) {
......@@ -359,31 +349,44 @@ export default {
}
});
},
searchClear() {
this.iconClass = "icon-create";
this.createValue = 0;
this.createLabel = "新建";
this.targetNum = 0;
this.gaoMap.lineType = 0;
this.gaoMap.newLineReset();
this.gaoMap.linePolyEditorAllClose();
this.gaoMap.closeAddMarker();
this.gaoMap.removeMarkerDragg();
this.gaoMap.mapOperateType = "normal";
// map.remove(this.gaodeMap.markerOverlays);
},
search() {
this.searchClear();
map.clearMap();
this.gaoMap.placeSearch.clear();
if(!(!this.gaoMap.searchSelectAdcode && !this.gaoMap.searchSelectName)){
if (!(!this.gaoMap.searchSelectAdcode && !this.gaoMap.searchSelectName)) {
this.gaoMap.placeSearch.setCity(this.gaoMap.searchSelectAdcode);
this.gaoMap.placeSearch.search(this.gaoMap.searchSelectName);
this.getDeviceInfo({"deviceName": this.gaoMap.searchSelectName});
this.getDeviceInfo({ deviceName: this.gaoMap.searchSelectName });
this.gaoMap.polyLines = [];
this.getPipeList({"pipeName": this.gaoMap.searchSelectName});
this.getPipeList({ pipeName: this.gaoMap.searchSelectName });
this.gaoMap.searchSelectAdcode = undefined;
this.gaoMap.searchSelectName = undefined;
}else{
} else {
this.gaoMap.placeSearch.search(this.keyWord);
this.getDeviceInfo({"deviceName": this.keyWord});
this.getDeviceInfo({ deviceName: this.keyWord });
this.gaoMap.polyLines = [];
this.getPipeList({"pipeName": this.keyWord});
this.getPipeList({ pipeName: this.keyWord });
}
},
// 新建下拉列表关闭 window点击事件
barClose() {
console.log("window");
this.deviceType = false;
// 关闭当前线条的infowindow
this.gaoMap.closeLineInfoWindow()
this.gaoMap.closeInfoWindow();
// 如果没有选择的时候点window 则高亮消失
if (this.targetNum == 1 && this.iconClass == "icon-create") {
this.targetNum = 0;
......@@ -394,10 +397,14 @@ export default {
this.gaoMap.lineFlag = false;
// this.gaoMap.createNewLine();
},
refreshMap(){
refreshMap() {
this.iconClass = "icon-create";
this.createValue = 0;
this.createLabel = "新建";
this.targetNum = 0;
map.clearMap();
this.initMap();
}
},
},
beforeDestroy() {
......@@ -642,7 +649,7 @@ input[type="radio"] {
background-color: #053b6a;
}
.refresh-but{
.refresh-but {
position: fixed;
top: 100px;
left: 28%;
......
......@@ -87,7 +87,7 @@
<span>{{ parseTime(scope.row.actualTime) }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="工单描述" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -141,10 +141,24 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工单描述" prop="remarks">
<el-input v-model="form.remarks" type="textarea" placeholder="请输入工单描述" />
</el-form-item>
</div>
<div v-if="this.title == '工单信息归档'">
<el-form-item label="归档信息" prop="remarks">
<el-input v-model="form.remarks" type="textarea" placeholder="请输入归档信息" />
<el-form-item label="工单名称" prop="orderName">
<font>{{form.orderName}}</font>
</el-form-item>
<el-form-item label="工单类型" prop="orderType">
<span type="primary" v-if="form.orderType == 1">巡检信息</span>
<span type="primary" v-if="form.orderType == 2">隐患信息</span>
<span type="primary" v-if="form.orderType == 3">报警信息</span>
</el-form-item>
<el-form-item label="工单编号" prop="orderId">
<font>{{form.orderId}}</font>
</el-form-item>
<el-form-item label="归档信息" prop="archiving">
<el-input v-model="form.archiving" type="textarea" placeholder="请输入归档信息" />
</el-form-item>
</div>
</el-form>
......
......@@ -85,7 +85,7 @@
<span>{{ parseTime(scope.row.actualTime) }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="工单描述" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -124,8 +124,19 @@
<!-- 工单反馈对话框 -->
<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="orderName">
<font>{{form.orderName}}</font>
</el-form-item>
<el-form-item label="工单类型" prop="orderType">
<span type="primary" v-if="form.orderType == 1">巡检信息</span>
<span type="primary" v-if="form.orderType == 2">隐患信息</span>
<span type="primary" v-if="form.orderType == 3">报警信息</span>
</el-form-item>
<el-form-item label="工单编号" prop="orderId">
<font>{{form.orderId}}</font>
</el-form-item>
<el-form-item label="设备列表" prop="deviceCode" v-if="form.orderType == '1'">
<el-select v-model="form.deviceCode" placeholder="请选择设备" clearable size="small" >
<el-select v-model="form.deviceCode" placeholder="请选择设备" clearable size="small" filterable >
<el-option
v-for="device in form.deviceInfoList"
:key="device.deviceCode"
......@@ -143,12 +154,18 @@
/>
</el-form-item>
<el-form-item label="是否存在隐患" prop="isHiddenDanger">
<el-radio-group v-model="form.isHiddenDanger">
<!--<el-radio-group v-model="form.isHiddenDanger">
<el-radio :label="1">是</el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
<el-radio :label="2">否</el-radio>
</el-radio-group>-->
<el-switch
v-model="isHiddenDanger"
active-text="是"
inactive-text="否">
</el-switch>
</el-form-item>
<el-form-item label="处理结果" prop="dealStatus">
<!-- <el-form-item label="处理结果" prop="dealStatus">-->
<el-form-item label="处理结果" prop="dealStatus" v-if="isHiddenDanger == true">
<el-radio-group v-model="form.dealStatus">
<el-radio :label="2">已处理完成</el-radio>
<el-radio :label="3">未处理完成</el-radio>
......@@ -180,6 +197,7 @@
},
data() {
return {
isHiddenDanger: false,
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -307,8 +325,9 @@
/** 接单按钮操作 */
handleReceive(row) {
if (row.orderStatus == '0') {
const orderIds = row.orderId;
this.$confirm('是否确认接收工单' + orderIds, "操作提示", {
const orderIds = row.orderId,
orderName = roe.orderName;
this.$confirm('是否确认接收工单(' + orderName + orderIds + ")", "操作提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......@@ -346,6 +365,11 @@
},
/** 提交按钮 */
submitForm() {
if(this.isHiddenDanger == false){
this.form.isHiddenDanger = "2";
} else {
this.form.isHiddenDanger = "1";
}
this.$refs["form"].validate(valid => {
if (valid) {
if(this.form.orderStatus == '1' || this.form.orderStatus == '2'){
......
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