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

隐患列表完成

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