"use strict";(self["webpackChunknewfront"]=self["webpackChunknewfront"]||[]).push([[7249],{54003:(e,t,a)=>{a.r(t),a.d(t,{default:()=>w});a(74916),a(64765),a(73210),a(68309);var l=function(){var e=this,t=e._self._c;return t("app-container",[t("search-area",{attrs:{size:"small"},on:{search:e.search}},[t("search-item",[t("el-input",{attrs:{size:"small",placeholder:"点位编号",clearable:""},model:{value:e.listQuery.keywords,callback:function(t){e.$set(e.listQuery,"keywords","string"===typeof t?t.trim():t)},expression:"listQuery.keywords"}})],1),e.showAlarmType?t("search-item",[t("el-select",{attrs:{size:"small",placeholder:"告警类型",clearable:""},model:{value:e.listQuery.alarmType,callback:function(t){e.$set(e.listQuery,"alarmType",t)},expression:"listQuery.alarmType"}},e._l(e.alarmTypeList,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1):e._e(),t("search-item",[t("el-select",{attrs:{disabled:!(e.alarmContentTypeList.length>0),placeholder:"告警内容",clearable:"",size:"small"},model:{value:e.listQuery.alarmContentType,callback:function(t){e.$set(e.listQuery,"alarmContentType",t)},expression:"listQuery.alarmContentType"}},e._l(e.alarmContentTypeList,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1),t("search-item",[t("el-date-picker",{attrs:{size:"small",type:"datetimerange","range-separator":"至","value-format":"yyyy-MM-dd HH:mm:ss","start-placeholder":"报警开始时间","end-placeholder":"报警结束时间"},model:{value:e.timeRange,callback:function(t){e.timeRange=t},expression:"timeRange"}})],1)],1),t("div",[t("el-row",{staticClass:"table-title"},[t("el-col",{attrs:{span:6}},[t("div",{staticClass:"title-header"},[t("i",{staticClass:"el-icon-menu"}),e._v("数据列表 ")])]),t("el-col",{staticClass:"edit_btns",attrs:{span:12,offset:6}},[e.hasPerm("/alarm/export")?t("el-button",{staticClass:"edit_btn",attrs:{size:"small"},on:{click:e.batchExport}},[e._v(" 导出记录 ")]):e._e(),e.hasPerm("/alarm/batchCancel")?t("el-button",{staticClass:"edit_btn",attrs:{size:"small"},on:{click:e.batchCancel}},[e._v(" 批量消警 ")]):e._e()],1)],1),t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticClass:"table",attrs:{data:e.list,"row-class-name":e.tableRowClassName,border:"",size:"small"}},[t("el-table-column",{attrs:{index:e.indexMethod,align:"center",type:"index",label:"序号",width:"55"}}),t("el-table-column",{attrs:{label:"点位编号",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e.showWellDetail(a.row)}}},[e._v(" "+e._s(a.row.wellCode)+" ")])]}}])}),e._l(e.columns,(function(a){return t("el-table-column",{key:a.value,attrs:{label:a.text,width:a.width,align:a.align,formatter:a.formatFun,"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(l){return[a.checkCell?t("span",{class:e.checkCell(l.row.cell)},[e._v(e._s(l.row[a.value]))]):a.level?t("span",[e._v(e._s(e.formatValue(l.row[a.value])))]):t("span",[e._v(e._s(l.row[a.value]))])]}}],null,!0)})})),e.hasPerm("/alarm/cancelAlarm")?t("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(t){return e.cancelAlarm(a.row.id)}}},[e._v(" 取消报警 ")])]}}],null,!1,455492240)}):e._e()],2)],1),t("div",{staticClass:"pagination-container"},[t("el-pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>e.listQuery.limit,expression:"total>listQuery.limit"}],attrs:{"current-page":e.listQuery.offset,"page-sizes":[20,30,50],"page-size":e.listQuery.limit,total:e.total,align:"center",layout:"total, sizes, prev, pager, next"},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1),t("info-well",{directives:[{name:"show",rawName:"v-show",value:e.wellShow,expression:"wellShow"}],ref:"wellInfo",attrs:{mapid:"alarm-now-map"}}),t("handle-prompt",{ref:"handlePrompt",on:{watchChild:e.fetchData}})],1)},n=[],i=a(66347),s=(a(41539),a(78783),a(33948),a(60285),a(41637),a(91058),a(82772),a(34553),a(87756)),r=a(67952),o=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{visible:e.dialogVisible,"append-to-body":"",title:"取消告警",width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[t("el-form",{ref:"form",attrs:{model:e.formData,rules:e.rules,"label-width":"120px"}},[t("el-form-item",{attrs:{label:"告警取消原因",prop:"jobStatus"}},[t("el-select",{attrs:{placeholder:"请选择"},model:{value:e.formData.jobStatus,callback:function(t){e.$set(e.formData,"jobStatus",t)},expression:"formData.jobStatus"}},e._l(e.closeReasons,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),t("el-form-item",{attrs:{label:"备注",prop:"handleMessage"}},[t("el-input",{attrs:{type:"textarea",placeholder:"请输入详细的告警取消原因"},model:{value:e.formData.handleMessage,callback:function(t){e.$set(e.formData,"handleMessage","string"===typeof t?t.trim():t)},expression:"formData.handleMessage"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeDialog}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.cancelAlarm}},[e._v("确 定")])],1)],1)},c=[];const u={name:"HandlePrompt",data:function(){return{formData:{keywords:"",alarmType:"",alarmContent:"",beginTime:"",endTime:"",id:"",jobStatus:"",handleMessage:""},isBatch:!1,dialogVisible:!1,closeReasons:[{value:"3",label:"已处理"},{value:"4",label:"无需处理"}],rules:{jobStatus:[{required:!0,message:"关闭原因必选",trigger:["blur","change"]}],handleMessage:[{required:!0,message:"备注不得为空",trigger:["blur","change"]},{min:1,max:30,message:"长度不得超过30字",trigger:"blur"}]},value:""}},methods:{initDialog:function(e,t,a,l){this.dialogVisible=e,this.isBatch=a,a?(this.formData.keywords=l.keywords,this.formData.alarmType=l.alarmType,this.formData.alarmContent=l.alarmContentType,this.formData.beginTime=l.beginTime,this.formData.endTime=l.endTime):this.formData.id=t},handleClose:function(e){var t=this;this.$confirm("确认关闭?").then((function(e){t.closeDialog()}))["catch"]((function(e){}))},cancelAlarm:function(){var e=this;this.$refs["form"].validate((function(t){t&&e.$confirm("确定要取消报警吗?","确认操作",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){if(e.isBatch)(0,r.vC)(e.formData).then((function(t){e.$message.success("批量消警成功"),e.closeDialog()}));else{var t={id:e.formData.id,jobStatus:e.formData.jobStatus,handleMessage:e.formData.handleMessage};(0,r.GH)(t).then((function(t){e.$message.success("取消报警成功"),e.closeDialog()}))}}))}))},closeDialog:function(){var e=this;this.dialogVisible=!1,this.$emit("watchChild"),this.formData.jobStatus="",this.formData.handleMessage="",this.$nextTick((function(){e.$refs["form"].clearValidate()}))}}},m=u;var h=a(1001),d=(0,h.Z)(m,o,c,!1,null,"572d0884",null);const f=d.exports;var p=a(16585),y=a(25108);const g={name:"ListAlarmNow",components:{HandlePrompt:f,infoWell:s.Z},data:function(){return{listQuery:{keywords:"",alarmType:"",alarmContentType:"",beginTime:"",endTime:"",status:"1",offset:1,limit:20,sort:"",order:""},timeRange:[],multipleSelection:[],columns:[{text:"设备编号",value:"devcode",align:"center"},{text:"详细地址",value:"position",align:"center"},{text:"告警类型",value:"alarmTypeName",align:"center"},{text:"告警原因",value:"alarmContentName",align:"center"},{text:"告警等级",value:"alarmLevel",align:"center",level:!0},{text:"告警数值",value:"alarmValue",width:90,align:"center",checkCell:!0},{text:"权属单位",value:"deptName",align:"center"},{text:"告警时间",value:"alarmTime",width:170,align:"center"}],list:[],total:0,deviceTypeList:[],deptProps:{parent:"pid",value:"id",label:"name",children:"children"},deptTreeList:null,showDeptTree:0,alarmTypeList:[],alarmContentTypeList:[],showAlarmType:!0,listLoading:!0,fullscreenLoading:!1,wellShow:!1,detailShow:!1,cancelShow:!1}},computed:{alarmType:function(){return this.listQuery.alarmType},operation:function(){return(0,p.lr)()}},watch:{alarmType:function(e){this.listQuery.alarmContentType="",e&&""!==e?this.fetchAlarmContentType():this.alarmContentTypeList=[]},timeRange:function(e){e&&e.length>0?(this.listQuery.beginTime=e[0],this.listQuery.endTime=e[1]):(this.listQuery.beginTime="",this.listQuery.endTime="")}},created:function(){y.log("now created"),this.fetchAlarmType(),this.fetchData()},activated:function(){y.log("now activated"),this.listQuery.keywords="",this.listQuery.alarmType="",this.listQuery.alarmContentType="",this.listQuery.beginTime="",this.listQuery.endTime="",this.timeRange=[],this.fetchData(!1)},methods:{handleSelectionChange:function(e){this.multipleSelection=e},batchCancel:function(){this.cancelShow=!0,this.$refs.handlePrompt.initDialog(!0,"",!0,this.listQuery)},cancelAlarm:function(e){this.cancelShow=!0,this.$refs.handlePrompt.initDialog(!0,e,!1)},formatValue:function(e){return 1===e?"一级告警":2===e?"二级告警":3===e?"三级告警":"--"},tableRowClassName:function(e){e.row,e.rowIndex;return""},showWellDetail:function(e){this.wellShow=!0,this.$refs.wellInfo.initDialog(e.wellId)},batchExport:function(){var e=this,t=this.$loading({lock:!0,text:"数据处理中,请稍后...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});(0,r.SY)(this.listQuery).then((function(e){t.close(),y.log("download===",e);var a=new Blob([e.data]),l=document.createElement("a"),n=window.URL.createObjectURL(a);l.href=n,l.download="当前告警列表.xlsx",document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(n)}))["catch"]((function(a){t.close(),e.$message.error(a.message)}))},checkCell:function(e){return"warning-state"},search:function(){this.fetchData(!1)},fetchData:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.listLoading=!0,t||(this.listQuery.offset=1),(0,r.Gt)(this.listQuery).then((function(t){e.list=t.data.rows,e.total=parseInt(t.data.total),e.listLoading=!1}))},fetchAlarmType:function(){var e=this;(0,r.Jc)().then((function(t){e.alarmTypeList=t.data,(0,p.lr)()||(e.showAlarmType=!1,e.listQuery.alarmType="1")}))},fetchAlarmContentType:function(){var e=this;this.alarmContentTypeList=[],(0,r.f5)(this.listQuery.alarmType).then((function(t){var a,l=e.$store.getters.deviceTypes,n=(0,i.Z)(t.data.list);try{var s=function(){var t=a.value,n=""+t.deviceType;-1!==l.indexOf(n)&&-1===e.alarmContentTypeList.findIndex((function(e){return e.name===t.name}))&&e.alarmContentTypeList.push(t)};for(n.s();!(a=n.n()).done;)s()}catch(r){n.e(r)}finally{n.f()}}))},indexMethod:function(e){return this.listQuery.limit*(this.listQuery.offset-1)+e+1},handleSizeChange:function(e){this.listQuery.limit=e,this.fetchData()},handleCurrentChange:function(e){this.listQuery.offset=e,this.fetchData()}}},v=g;var b=(0,h.Z)(v,l,n,!1,null,"0d60a61c",null);const w=b.exports},67952:(e,t,a)=>{a.d(t,{GH:()=>o,Gt:()=>n,Jc:()=>i,SY:()=>r,f5:()=>s,vC:()=>c});var l=a(84471);function n(e){return(0,l.Z)({url:"alarm/list",method:"get",params:e})}function i(e){return(0,l.Z)({url:"sys/dict/code/alarmType",method:"get",params:e})}function s(e){return(0,l.Z)({url:"alarm/contentType",method:"get",params:{alarmType:e}})}function r(e){return(0,l.Z)({url:"alarm/export",method:"get",timeout:12e4,params:e,responseType:"blob"})}function o(e){return(0,l.Z)({url:"alarm/cancelAlarm",method:"post",params:e})}function c(e){return(0,l.Z)({url:"alarm/batchCancel",method:"post",params:e})}}}]);