Commit e8b1b87c authored by 纪泽龙's avatar 纪泽龙

隐患列表完成

parent 15c9e30b
......@@ -23,7 +23,7 @@
</div>
<div class="eq-text">
处理状态:<span>{{
data.dealStatus ? dealStatus : "暂未处理"
data.dealStatus ? data.dealStatus : "暂未处理"
}}</span>
</div>
<div class="eq-text">
......@@ -69,10 +69,10 @@
<div class="warn-wrapper" v-if="true">
<div class="warn-content">
<div>
关联设备:<span>({{ data.deviceName ? data.deviceName : "-" }})</span>
关联设备:<span>{{ data.deviceName ? data.deviceName : "-" }}</span>
</div>
<div>
设备类型:<span>{{ data.deviceType ? data.deviceType : "-" }}</span>
设备类型:<span>{{ data.deviceType ? this.deviceType[data.deviceType] : "-" }}</span>
</div>
<div v-if="!orderId">
工单编号:<span>{{ data.orderId }}</span>
......@@ -80,11 +80,10 @@
</div>
<div class="btn">
<span @mousedown.stop="deviceMore">
<el-button class="elbtn" type="primary">设备详情</el-button>
<el-button class="elbtn" type="primary">隐患详情</el-button>
</span>
<span v-if="orderId" @mousedown.stop="createWork">
<el-button
v-if="title == '压力表' || title == '流量计'"
class="elbtn"
type="primary"
>生成工单</el-button
......@@ -111,6 +110,7 @@ export default {
data() {
return {
deviceType: {
0: "管道",
1: "调压箱",
2: "阀门井",
3: "流量计",
......@@ -121,7 +121,7 @@ export default {
computed: {
orderId() {
// 如果已经生成过工单,就不能再次生成了
console.log("orderId",this.data.orderId)
// return this.data.orderId ? false : true;
return this.data.orderId ? false : true;
},
......@@ -131,15 +131,15 @@ export default {
createWork() {
// 控制外层弹框
// console.log(this.data.view.$refs.CreateWork);
this.data.view.$refs.CreateWork.alarmId = this.data.alarmId;
this.data.view.$refs.CreateWork.open = true;
this.data.view.$refs.CreateWork.gaoMap = this.data.view.gaoMap;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleId = this.data.troubleId;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleName = this.data.troubleName;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleType = this.data.troubleType;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleLevel = this.data.troubleLevel;
this.data.class.view.$refs.CreateWorkTrouble.open = true;
this.data.class.view.$refs.CreateWorkTrouble.gaoMap = this.data.class.view.gaoMap;
// 改变外层回调
// this.data.view.CreateWorkCallBack = this.CreateWorkCallBack;
this.data.view.alarmObjChange({
alarmId: this.data.alarmId,
type: "device",
});
this.data.class.view.troubleObjChange({troubleId:this.data.troubleId});
},
// CreateWorkCallBack(e) {
// // console.log("生成工单后传过来的参数", e);
......@@ -154,17 +154,17 @@ export default {
// marker.setExtData(options);
// },
deviceMore() {
this.data.view.$router.push({
path: "/dataMonitoring/alarmdetail",
this.data.class.view.$router.push({
path: "/riskManagement/hiddenTroubleDetail",
query: {
alarmId: this.data.alarmId,
dcviceType: this.deviceType[this.data.deviceType],
troubleId: this.data.troubleId,
// dcviceType: this.deviceType[this.data.deviceType],
},
});
},
// 查看工单
checkWork() {
this.data.view.$router.push({
this.data.class.view.$router.push({
path: "/workOrder/detail",
query: {
orderId: this.data.orderId,
......@@ -189,7 +189,7 @@ export default {
.top {
width: 100%;
height: 51px;
background-color: #ff5a67;
background-color: #e6a23c;
.text {
font-weight: 600;
font-size: 16px;
......
......@@ -274,13 +274,13 @@ class gaodeMap {
this.workerManMarkArr.push(marker);
}
}
// 隐患
if (DEVICE_TYPE.TROUBLE == markerType) {
marker.markerType = markerType;
marker.data = data;
marker.infoWindow = infoWindow;
marker.on("mouseover", this.troubleOpen);
marker.setExtData(data);
this.troubles.push(marker);
}
......@@ -388,7 +388,14 @@ class gaodeMap {
this.workerManInfoWindow = e.target.infoWindow;
};
// 隐患
troubleOpen = e => {};
troubleOpen = e => {
this.markerType = e.target.markerType;
e.target.content = this.getMarketContent(e.target.data);
e.target.infoWindow.setContent(e.target.content);
e.target.infoWindow.open(map, e.target.getPosition());
this.boxCollision(e.target.infoWindow.dom);
this.workerManInfoWindow = e.target.infoWindow;
};
// 鼠标移入设备时候实行的函数
infoOpen = e => {
......@@ -631,7 +638,6 @@ class gaodeMap {
opacity: 0.1,
image: require("../assets/images/trouble.png")
});
marker.workerPoint = true;
marker.setIcon(icon);
break;
}
......@@ -705,7 +711,7 @@ class gaodeMap {
});
marker.infoWindow = new AMap.InfoWindow({
isCustom: true,
autoMove: false,
autoMove: true,
content: dom.$el,
//信息船体偏移量
// offset: new AMap.Pixel(20, 20),
......@@ -1079,8 +1085,11 @@ class gaodeMap {
}
markerShow(type, bool) {
this.markers.forEach(item => {
const { deviceType } = item.getExtData();
if (deviceType == type) {
const { deviceType, troubleId } = item.getExtData();
if (type == 8 && troubleId) {
bool ? item.show() : item.hide();
} else if (deviceType == type) {
// 如果是值班人员,还要隐藏身上的线条以及marker
if (type == 9) {
if (bool) {
......
......@@ -988,7 +988,7 @@ input[type="radio"] {
}
.upPic {
display: inline-block;
margin-left: 64px;
margin-left: 40px;
line-height: 48px;
font-size: 16px;
color: #053b6a;
......
......@@ -130,11 +130,11 @@ export default {
this.form.orderType = "3";
addBasicsInfo(this.form).then((response) => {
if (response.code == 200) {
console.log(response.msg);
this.msgSuccess("生成工单成功");
this.open = false;
console.log(response.msg);
this.$emit("callback", response.msg);
}
this.$emit("callback", 999);
});
}
});
......
......@@ -7,14 +7,14 @@
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-form-item label="隐患名称" prop="deviceName">
<font>{{ form.deviceName }}</font>
<el-form-item label="隐患名称" prop="troubleName">
<font>{{ form.troubleName }}</font>
</el-form-item>
<el-form-item label="隐患类型" prop="alarmType">
<font>{{ form.alarmType }}</font>
<el-form-item label="隐患类型" prop="troubleType">
<font>{{ form.troubleType }}</font>
</el-form-item>
<el-form-item label="隐患级别" prop="alarmValue">
<font>{{ form.alarmValue }}</font>
<el-form-item label="隐患级别" prop="troubleLevel">
<font>{{ form.troubleLevel }}</font>
</el-form-item>
<el-form-item label="工单名称" prop="orderName">
<el-input v-model="form.orderName" placeholder="请输入工单名称" />
......@@ -69,9 +69,9 @@ export default {
data() {
return {
form: {
deviceName: "",
alarmType: "",
alarmValue: "",
troubleName: "",
troubleType: "",
troubleLevel: "",
orderName: "",
appointInspector: "",
remarks: "",
......@@ -95,24 +95,28 @@ export default {
created() {
// this.alarmId && this.handleIssue(this.alarmId);
console.log("this.form");
},
watch: {
open(value, oldValue) {
if (value) {
console.log(this.alarmId);
this.handleIssue(this.alarmId);
this.getInspectorList()
console.log("this.form",this.form);
// console.log(this.alarmId);
// this.handleIssue(this.alarmId);
}
},
},
methods: {
handleIssue(alarmId) {
this.getInspectorList();
getDeviceAlarm(alarmId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "填写工单信息";
});
},
// handleIssue(alarmId) {
// this.getInspectorList();
// getDeviceAlarm(alarmId).then((response) => {
// this.form = response.data;
// this.open = true;
// this.title = "填写工单信息";
// });
// },
getInspectorList() {
this.loading = true;
......@@ -127,15 +131,15 @@ export default {
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.resourceId = this.form.alarmId;
this.form.orderType = "3";
this.form.resourceId = this.form.troubleId;
this.form.orderType = "2";
addBasicsInfo(this.form).then((response) => {
if (response.code == 200) {
console.log(response.msg);
this.msgSuccess("生成工单成功");
this.open = false;
console.log(response.msg);
this.$emit("callback", response.msg);
}
this.$emit("callback", 999);
});
}
});
......
......@@ -76,11 +76,11 @@
@callback="CreateWorkCallBack"
/>
<!-- 隐患工单 -->
<!-- <CreateWorkTrouble
<CreateWorkTrouble
ref="CreateWorkTrouble"
:open="createWorkTroubleOpen"
@callback="CreateWorkTroubleCallBack"
/> -->
/>
<div
ref="drawer"
......@@ -149,7 +149,7 @@
<!-- 有数据 -->
<template v-if="item.list.length > 0">
<!-- 设备以及管道 展示内容是一样的 -->
<template v-if="item.value != 9">
<template v-if="item.value != 8 && item.value != 9">
<div class="list-wrapper">
<div class="thead">
<div class="no">序号</div>
......@@ -173,6 +173,31 @@
</div>
</div>
</template>
<!-- 隐患的展示 -->
<template v-else-if="item.value == 8">
<div class="list-wrapper">
<div class="thead">
<div class="no">序号</div>
<div class="code">隐患等级</div>
<div class="name">隐患名称</div>
</div>
<div
class="deviceList"
:class="{ topActive: index == 0 }"
v-for="(iten, index) in item.list"
:key="iten.deviceId + `` + index"
@mousedown.stop="panToo(iten, item)"
>
<div class="no">{{ iten.no + 1 }}</div>
<div :title="iten.troubleLevel" class="code">
{{ iten.troubleLevel }}
</div>
<div :title="iten.troubleName" class="name">
{{ iten.troubleName }}
</div>
</div>
</div>
</template>
<!-- 值班人员 展示不太一样-->
<template v-else-if="item.value == 9">
<div class="list-wrapper">
......@@ -198,6 +223,7 @@
</div>
</div>
</template>
<!-- 翻页 -->
<div class="goback">
<div class="btn-w">
......@@ -245,12 +271,14 @@ import { getAllDeviceInfo, countDeviceByType } from "@/api/device/deviceInfo";
import { getMapHiddenTroublelist } from "@/api/riskManagement/hiddenTrouble";
import RightBototmData from "./components/RightBototmData.vue";
import CreateWork from "./components/CreateWork.vue";
import CreateWorkTrouble from "./components/CreateWorkTrouble.vue";
import { getInspectorLocations } from "@/api/inspectorLocation/location";
export default {
components: {
RightBototmData,
CreateWork,
CreateWorkTrouble,
},
data() {
return {
......@@ -342,8 +370,12 @@ export default {
bottomDataShow: true,
// 是否显示生成工单弹框
createWorkOpen: false,
//隐患工单
createWorkTroubleOpen: false,
// 查询用的
alarmObj: { alarmId: "", type: "" },
troubleObj: null,
// 左边抽屉 内嵌scroll盒子的高
boxHeight: "",
drawerOpacity: false,
......@@ -477,6 +509,7 @@ export default {
return getMapHiddenTroublelist().then((res) => {
console.log(res);
if (res.code == 200) {
this.troubleClassify(res.data);
res.data.forEach((item) => {
console.log("隐患", item);
this.gaoMap.addMarker(DEVICE_TYPE.TROUBLE, item);
......@@ -734,6 +767,13 @@ export default {
} else {
this.gaoMap.markerShow(4, false);
}
// 隐患
if (this.leftBarNum.includes(8)) {
this.gaoMap.markerShow(8, true);
// this.panTo(item);
} else {
this.gaoMap.markerShow(8, false);
}
if (this.leftBarNum.includes(9)) {
this.gaoMap.markerShow(9, true);
......@@ -769,6 +809,8 @@ export default {
} else if (item.value == 9) {
// 工作人员
this.workerManInfoWindowShow(iten, lat, lng);
} else if (item.value == 8) {
this.trouleInfoWindowShow(iten, lat, lng)
} else {
// 其他设备
this.diveceInfoWindowShow(iten, lat, lng);
......@@ -815,6 +857,26 @@ export default {
this.gaoMap.infoOpen(e);
};
},
// 隐患infowindow
trouleInfoWindowShow(iten, lat, lng) {
const target = this.gaoMap.markers.filter((item) => {
return item.getExtData().troubleId == iten.troubleId;
})[0];
console.log("target", target);
const e = {
target,
lnglat: iten.path,
};
// 如果是原地不动,就直接执行
if (iten.path[0] == lng && iten.path[1] == lat) {
this.gaoMap.troubleOpen(e);
return;
}
// 因为地图移动的时候infowindow无法显示
this.gaoMap.handleInfoWindowOpenFunc = () => {
this.gaoMap.troubleOpen(e);
};
},
// workerMan,值班人员飞过去后侠士infowindow
workerManInfoWindowShow(iten, lat, lng) {
// console.log("iten",iten.userId)
......@@ -932,6 +994,20 @@ export default {
this.allList[3] = lljArr;
this.allList[4] = ylbArr;
},
// 隐患存储
troubleClassify(troubleData) {
const workManArr = troubleData.map((item, index) => {
return {
path: [item.longitude, item.latitude],
no: index,
troubleId: item.troubleId,
troubleName: item.troubleName,
troubleLevel: item.troubleLevel,
};
});
console.log("值班人员", workManArr);
this.allList[5] = workManArr;
},
// 值班人员
workerManClassify(workManData) {
const workManArr = workManData.map((item, index) => {
......@@ -1174,10 +1250,13 @@ export default {
this.initMap();
this.leftBarNum = [1, 2, 3, 4, 7, 8, 9];
},
// 改变弹框状态
openChange(bool) {
this.createWorkOpen = bool;
},
// 改变工单弹框状态
// openChange(bool) {
// this.createWorkOpen = bool;
// },
// openTroubleChange(bool) {
// this.createWorkTroubleOpen = bool;
// },
// 生成工单的回调
CreateWorkCallBack(e) {
if (!this.alarmObj.alarmId) return;
......@@ -1205,6 +1284,24 @@ export default {
this.alarmObj = obj;
console.log(this.alarmObj);
},
// 隐患
// 手动加入orderId
CreateWorkTroubleCallBack(e) {
// console.log("隐患嘿嘿嘿")
const trouble = this.gaoMap.troubles.filter((item) => {
console.log(item, this.troubleObj.troubleId);
return item.data.troubleId == this.troubleObj.troubleId;
})[0];
console.log("找到隐患了,是", trouble);
let options = trouble.getExtData();
// 暂时传值,到时候回重新刷新
options.orderId = e;
trouble.setExtData(options);
trouble.data.orderId = e;
},
troubleObjChange(obj) {
this.troubleObj = obj;
},
},
beforeDestroy() {
......@@ -1518,7 +1615,7 @@ input[type="radio"] {
}
.upPic {
display: inline-block;
margin-left: 64px;
margin-left: 40px;
line-height: 48px;
font-size: 16px;
color: #053b6a;
......
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