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

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

parent 09639534
......@@ -146,12 +146,31 @@ export default {
},
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.CreateWorkCallBack =
this.CreateWorkCallBack;
},
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>
......
......@@ -102,6 +102,7 @@ export default {
orderId() {
// 如果已经生成过工单,就不能再次生成了
// return this.data.orderId ? false : true;
return this.data.orderId ? false : true;
},
},
......@@ -109,9 +110,24 @@ export default {
moment,
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.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() {
......
......@@ -76,6 +76,7 @@ export default {
appointInspector: "",
remarks: "",
},
gaoMap:"",
open: false,
title: "",
inspector: [],
......
......@@ -100,7 +100,11 @@
ref="RightBototmData"
:list="rightBototmData"
/>
<CreateWork ref="CreateWork" :open="createWorkOpen" />
<CreateWork
ref="CreateWork"
:open="createWorkOpen"
@callback="CreateWorkCallBack"
/>
</div>
</template>
<script>
......@@ -371,7 +375,8 @@ export default {
if (polyLineArr.length > 0) {
polyLineArr.forEach((item) => {
// 获取循报警设备的id
const { deviceId, orderId,alarmId,alarmType, alarmValue, endTime } = item;
const { deviceId, orderId, alarmId, alarmType, alarmValue, endTime } =
item;
console.log("endTime", endTime);
// 获取polyLine
const polyline = this.gaoMap.polyLines.filter((item) => {
......@@ -381,7 +386,7 @@ export default {
let options = polyline.getExtData();
// 增加一个报警状态
// 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来
options.lineData.view =this;
options.lineData.view = this;
options.lineData.alarmId = alarmId;
options.lineData.orderId = orderId;
if (endTime) {
......@@ -410,7 +415,8 @@ export default {
if (deviceArr.length > 0) {
deviceArr.forEach((item) => {
// 获取循报警设备的id
const { deviceId,alarmId, alarmType, alarmValue, endTime,orderId } = item;
const { deviceId, alarmId, alarmType, alarmValue, endTime, orderId } =
item;
console.log("endTime", endTime);
// 获取polyLine
const device = this.gaoMap.markers.filter((item) => {
......@@ -422,7 +428,7 @@ export default {
// 增加一个报警状态
// 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来
options.view=this;
options.view = this;
options.alarmId = alarmId;
options.orderId = orderId;
if (endTime) {
......@@ -478,12 +484,12 @@ export default {
},
socket() {
console.log("socket执行");
this.ws = new WebSocket(
"ws://36.148.23.59:8901/gassafety/websocketServer"
);
// 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) => {
console.log("WebSockets=======gogogog");
// this.ws.send("WebSockets!=========================");
......@@ -706,9 +712,25 @@ export default {
this.leftBarNum = [1, 2, 3, 4, 7, 8, 9];
},
// 改变弹框状态
openChange(bool){
this.createWorkOpen=bool;
}
openChange(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() {
......
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