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

工单优化,优化了gid地图生成工单之后,就不能在传工单,除非再次推送报警

parent 09639534
...@@ -146,12 +146,31 @@ export default { ...@@ -146,12 +146,31 @@ export default {
}, },
createWork() { createWork() {
// 控制外层弹框 可能有点长 // 控制外层弹框 可能有点长
this.obj.polyline.getExtData().lineData.view.$refs.CreateWork.alarmId =this.data.alarmId;
this.obj.polyline.getExtData().lineData.view.$refs.CreateWork.alarmId =
this.obj.polyline.getExtData().lineData.alarmId;
this.obj.polyline.getExtData().lineData.view.$refs.CreateWork.open = true; this.obj.polyline.getExtData().lineData.view.$refs.CreateWork.open = true;
// 改变外层回调
this.obj.polyline.getExtData().lineData.view.CreateWorkCallBack =
this.CreateWorkCallBack;
}, },
close() { close() {
this.obj.polyline.infoWindow.close(); this.obj.polyline.infoWindow.close();
}, },
CreateWorkCallBack() {
console.log("polylineCallBack");
const polyline = this.obj.polyline.getExtData().lineData.view.gaoMap.polyLines.filter(
(item) => {
return item.getExtData().lineData.alarmId == this.obj.polyline.getExtData().lineData.alarmId;
}
)[0];
console.log("polyline.getExtData()", polyline.getExtData().lineData);
let options = polyline.getExtData();
// 暂时传值,到时候回重新刷新
options.lineData.orderId = "1";
polyline.setExtData(options);
},
}, },
}; };
</script> </script>
......
...@@ -102,6 +102,7 @@ export default { ...@@ -102,6 +102,7 @@ export default {
orderId() { orderId() {
// 如果已经生成过工单,就不能再次生成了 // 如果已经生成过工单,就不能再次生成了
// return this.data.orderId ? false : true;
return this.data.orderId ? false : true; return this.data.orderId ? false : true;
}, },
}, },
...@@ -109,9 +110,24 @@ export default { ...@@ -109,9 +110,24 @@ export default {
moment, moment,
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.view.$refs.CreateWork.alarmId = this.data.alarmId;
this.data.view.$refs.CreateWork.open = true; this.data.view.$refs.CreateWork.open = true;
this.data.view.$refs.CreateWork.gaoMap = this.data.view.gaoMap;
// 改变外层回调
this.data.view.CreateWorkCallBack=this.CreateWorkCallBack;
},
CreateWorkCallBack() {
// console.log("markerCallBack")
const marker = this.data.view.gaoMap.markers.filter((item) => {
return item.getExtData().alarmId == this.data.alarmId;
})[0];
// console.log("marer.getExtData()", marker.getExtData());
let options = marker.getExtData();
// 暂时传值,到时候回重新刷新
options.orderId = "1";
marker.setExtData(options);
}, },
}, },
beforeDestroy() { beforeDestroy() {
......
...@@ -76,6 +76,7 @@ export default { ...@@ -76,6 +76,7 @@ export default {
appointInspector: "", appointInspector: "",
remarks: "", remarks: "",
}, },
gaoMap:"",
open: false, open: false,
title: "", title: "",
inspector: [], inspector: [],
......
...@@ -100,7 +100,11 @@ ...@@ -100,7 +100,11 @@
ref="RightBototmData" ref="RightBototmData"
:list="rightBototmData" :list="rightBototmData"
/> />
<CreateWork ref="CreateWork" :open="createWorkOpen" /> <CreateWork
ref="CreateWork"
:open="createWorkOpen"
@callback="CreateWorkCallBack"
/>
</div> </div>
</template> </template>
<script> <script>
...@@ -371,7 +375,8 @@ export default { ...@@ -371,7 +375,8 @@ export default {
if (polyLineArr.length > 0) { if (polyLineArr.length > 0) {
polyLineArr.forEach((item) => { polyLineArr.forEach((item) => {
// 获取循报警设备的id // 获取循报警设备的id
const { deviceId, orderId,alarmId,alarmType, alarmValue, endTime } = item; const { deviceId, orderId, alarmId, alarmType, alarmValue, endTime } =
item;
console.log("endTime", endTime); console.log("endTime", endTime);
// 获取polyLine // 获取polyLine
const polyline = this.gaoMap.polyLines.filter((item) => { const polyline = this.gaoMap.polyLines.filter((item) => {
...@@ -381,7 +386,7 @@ export default { ...@@ -381,7 +386,7 @@ export default {
let options = polyline.getExtData(); let options = polyline.getExtData();
// 增加一个报警状态 // 增加一个报警状态
// 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来 // 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来
options.lineData.view =this; options.lineData.view = this;
options.lineData.alarmId = alarmId; options.lineData.alarmId = alarmId;
options.lineData.orderId = orderId; options.lineData.orderId = orderId;
if (endTime) { if (endTime) {
...@@ -410,7 +415,8 @@ export default { ...@@ -410,7 +415,8 @@ export default {
if (deviceArr.length > 0) { if (deviceArr.length > 0) {
deviceArr.forEach((item) => { deviceArr.forEach((item) => {
// 获取循报警设备的id // 获取循报警设备的id
const { deviceId,alarmId, alarmType, alarmValue, endTime,orderId } = item; const { deviceId, alarmId, alarmType, alarmValue, endTime, orderId } =
item;
console.log("endTime", endTime); console.log("endTime", endTime);
// 获取polyLine // 获取polyLine
const device = this.gaoMap.markers.filter((item) => { const device = this.gaoMap.markers.filter((item) => {
...@@ -422,7 +428,7 @@ export default { ...@@ -422,7 +428,7 @@ export default {
// 增加一个报警状态 // 增加一个报警状态
// 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来 // 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来
options.view=this; options.view = this;
options.alarmId = alarmId; options.alarmId = alarmId;
options.orderId = orderId; options.orderId = orderId;
if (endTime) { if (endTime) {
...@@ -478,12 +484,12 @@ export default { ...@@ -478,12 +484,12 @@ export default {
}, },
socket() { socket() {
console.log("socket执行"); console.log("socket执行");
this.ws = new WebSocket(
"ws://36.148.23.59:8901/gassafety/websocketServer"
);
// this.ws = new WebSocket( // this.ws = new WebSocket(
// "ws://192.168.2.23:8903/gassafety/websocketServer" // "ws://36.148.23.59:8901/gassafety/websocketServer"
// ); // );
this.ws = new WebSocket(
"ws://192.168.2.23:8903/gassafety/websocketServer"
);
this.ws.onopen = (evt) => { this.ws.onopen = (evt) => {
console.log("WebSockets=======gogogog"); console.log("WebSockets=======gogogog");
// this.ws.send("WebSockets!========================="); // this.ws.send("WebSockets!=========================");
...@@ -706,9 +712,25 @@ export default { ...@@ -706,9 +712,25 @@ export default {
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;
} },
CreateWorkCallBack() {
if (!this.alarmId) return;
// 工单弹框生成之后执行的方法
const marker = this.gaoMap.markers.filter((item) => {
return item.getExtData().alarmId == this.alarmId;
})[0];
console.log("marer.getExtData()", marker.getExtData());
let options = marker.getExtData();
// 暂时传值,到时候回重新刷新
options.orderId = "1";
marker.setExtData(options);
},
alarmIdChange(alarmId) {
this.alarmId = alarmId;
console.log(alarmId);
},
}, },
beforeDestroy() { beforeDestroy() {
......
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