| 1234567891011 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/component/topWarn"],{"148c":function(t,e,n){"use strict";(function(t){var a=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n("7eb4")),i=a(n("ee10")),r=n("0d60"),c=a(n("0ac6")),s=n("e34d"),l={data:function(){return{pageType:!1,buttonType:!1,text:"",buildId:"",floorId:"",subId:"",mtopic:"lab/risk/plan/change",client:{},planData:{}}},created:function(){},mounted:function(){this.offMQTT("on"),this.laboratoryBigViewSelectTriggerInfo()},methods:{sensorMQTT:function(){var e=this;this.client=c.default.connect("wxs://"+t.getStorageSync("mqttUrl"),{username:t.getStorageSync("mqttUser"),password:t.getStorageSync("mqttPassword")}),this.client.on("connect",(function(t){e.client.subscribe(e.mtopic,(function(t){}))})),this.client.on("message",(function(t,n){n&&t==e.mtopic&&e.laboratoryBigViewSelectTriggerInfo()}))},offMQTT:function(t){this.client.unsubscribe&&(this.client.unsubscribe(this.mtopic,(function(t){})),this.client.end(),this.$set(this,"client",{})),t&&this.sensorMQTT()},laboratoryBigViewSelectTriggerInfo:function(e){var n=this;return(0,i.default)(o.default.mark((function e(){var a,i,c,l,u,f;return o.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n,e.next=3,(0,s.laboratoryBigViewSelectTriggerInfo)();case 3:a=e.sent,i=a.data,200==i.code&&(i.data[0]?(c=[],l=[],i.data.forEach((function(t){(0,r.itoOrVideoLimits)(t.adminId)?c.push(t):l.push(t)})),c[0]?(n.$set(n,"planData",c),n.$set(n,"text",c[1]?"有多个实验室发生预案":"有实验室发生预案"),n.$set(n,"pageType",!0),n.$set(n,"buttonType",!0),u=[],c.forEach((function(t){var e=JSON.parse(t.triggerUploadData);e.forEach((function(t){u.push(t.deviceNo)}))})),t.setStorageSync("planSensorList",u)):(n.$set(n,"planData",l),n.$set(n,"text",l[1]?"有多个实验室发生预案":"有实验室发生预案"),n.$set(n,"pageType",!0),n.$set(n,"buttonType",!1),f=[],l.forEach((function(t){var e=JSON.parse(t.triggerUploadData);e.forEach((function(t){f.push(t.deviceNo)}))})),t.setStorageSync("planSensorList",f))):(n.$set(n,"pageType",!1),n.$set(n,"buttonType",!1),n.$set(n,"planData",[]),n.$set(n,"text",""),t.setStorageSync("planSensorList",[])));case 6:case"end":return e.stop()}}),e)})))()},buttonClick:function(){var e=this,n=[];n=(0,r.controlsRestrictVerify)("performEvacuation")?["查看","结束预案"]:["查看"],t.showActionSheet({itemList:n,success:function(t){0==t.tapIndex?e.goPage():1==t.tapIndex&&e.closePlan()},fail:function(t){console.log(t.errMsg)}})},closePlan:function(){var e=this;if(e.planData[1]){for(var n=[],a=0;a<e.planData.length;a++)n.push(e.planData[a].subName+"-"+e.planData[a].eventName);t.showActionSheet({itemList:n,success:function(n){t.showModal({content:"传感器数据监测异常,确定要强制结束预案?关闭报警后,3分钟内系统不再触发预案报警,请核实确认后再执行此操作?",cancelColor:"#999",confirmColor:"#0183FA",success:function(t){t.confirm?e.closeRiskPlan(n.tapIndex):t.cancel}})},fail:function(t){}})}else t.showModal({content:"传感器数据监测异常,确定要强制结束预案?关闭报警后,3分钟内系统不再触发预案报警,请核实确认后再执行此操作?",cancelColor:"#999",confirmColor:"#0183FA",success:function(t){t.confirm?e.closeRiskPlan(0):t.cancel}})},closeRiskPlan:function(e){var n=this;return(0,i.default)(o.default.mark((function a(){var i,r,c;return o.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return console.log("index",e),i=n,a.next=4,(0,s.laboratoryPlanCloseRiskPlan)({eventId:i.planData[e].eventId});case 4:r=a.sent,c=r.data,200==c.code&&(t.showToast({title:"操作成功",icon:"none",mask:!0,duration:2e3}),i.laboratoryBigViewSelectTriggerInfo());case 7:case"end":return a.stop()}}),a)})))()},laboratoryBigViewGetFloorByBigView:function(e){return(0,i.default)(o.default.mark((function n(){var a,i;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,(0,s.laboratoryBigViewGetFloorByBigView)({id:e.floorId});case 2:a=n.sent,i=a.data,200==i.code&&(i.data[0]&&i.data[0].buildLayoutVoList&&i.data[0].buildLayoutVoList[0]?t.navigateTo({url:"/pages_manage/views/emergencyEvacuationBig?item="+encodeURIComponent(JSON.stringify(e))}):t.showToast({title:"该实验室楼层未配置地图数据,请联系管理员.",icon:"none",mask:!0,duration:4e3}));case 5:case"end":return n.stop()}}),n)})))()},goPage:function(){var e=this;if(e.planData[1]){for(var n=[],a=0;a<e.planData.length;a++)n.push(e.planData[a].subName+"-"+e.planData[a].eventName);t.showActionSheet({itemList:n,success:function(t){var n={buildId:e.planData[t.tapIndex].buildId,floorId:e.planData[t.tapIndex].floorId,subId:e.planData[t.tapIndex].subId,adminId:e.planData[t.tapIndex].adminId,groupId:e.planData[t.tapIndex].eventId};e.laboratoryBigViewGetFloorByBigView(n)},fail:function(t){}})}else{var o={buildId:e.planData[0].buildId,floorId:e.planData[0].floorId,subId:e.planData[0].subId,adminId:e.planData[0].adminId,groupId:e.planData[0].eventId};e.laboratoryBigViewGetFloorByBigView(o)}}},onHide:function(){console.log("onHide"),this.offMQTT()},beforeDestroy:function(){console.log("beforeDestroy"),this.offMQTT()}};e.default=l}).call(this,n("df3c")["default"])},"3af9":function(t,e,n){"use strict";n.r(e);var a=n("8716"),o=n("4ccb");for(var i in o)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);n("c62a");var r=n("828b"),c=Object(r["a"])(o["default"],a["b"],a["c"],!1,null,"5f34f2d8",null,!1,a["a"],void 0);e["default"]=c.exports},"4ccb":function(t,e,n){"use strict";n.r(e);var a=n("148c"),o=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=o.a},8716:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){}));var a=function(){var t=this.$createElement;this._self._c},o=[]},c62a:function(t,e,n){"use strict";var a=n("f9d8"),o=n.n(a);o.a},f9d8:function(t,e,n){}}]);
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'pages/component/topWarn-create-component',
- {
- 'pages/component/topWarn-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('df3c')['createComponent'](__webpack_require__("3af9"))
- })
- },
- [['pages/component/topWarn-create-component']]
- ]);
|