"use strict";(self["webpackChunknewfront"]=self["webpackChunknewfront"]||[]).push([[1028],{47278:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});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:{disabled:0===e.total,size:"small"},on:{click:e.batchExport}},[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,border:"",size:"small"},on:{"selection-change":e.handleSelectionChange}},[t("el-table-column",{attrs:{index:e.indexMethod,align:"center",type:"index"}}),e._l(e.columns,(function(a){return t("el-table-column",{key:a.value,attrs:{label:a.text,width:a.width,align:a.align,"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(l){return["Button"==a.type||a.level?e._e():t("span",{class:a["class"]},[e._v(e._s(l.row[a.value]))]),"Button"!=a.type&&a.level?t("span",{class:a["class"]},[e._v(e._s(e.formatValue(l.row[a.value])))]):e._e(),"Button"==a.type?t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e.showWellDetail(l.row)}}},[e._v(" "+e._s(l.row[a.value])+" ")]):e._e()]}}],null,!0)})})),t("el-table-column",{attrs:{label:"操作",align:"center",width:"80"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e.showJob(a.row)}}},[e._v(" 查看工单 ")])]}}])})],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-records-map"}})],1)},n=[],i=a(66347),r=(a(82772),a(41539),a(78783),a(33948),a(60285),a(41637),a(91058),a(34553),a(87756)),s=a(67952),o=a(16585),u=a(25108),c=!1;const h={name:"ListAlarmRecords",components:{infoWell:r.Z},beforeRouteEnter:function(e,t,a){c=!!t.name&&-1!==t.name.indexOf("DetailJob"),a()},data:function(){return{listQuery:{keywords:"",alarmType:"",alarmContentType:"",beginTime:"",endTime:"",offset:1,limit:20,sort:"",order:""},timeRange:[],columns:[{text:"点位编号",value:"wellCode",align:"center",type:"Button"},{text:"设备编号",value:"devcode",align:"center"},{text:"详细地址",value:"position",align:"center"},{text:"告警类型",value:"alarmTypeName",align:"center"},{text:"告警等级",value:"alarmLevel",align:"center",level:!0},{text:"告警原因",value:"alarmContentName",align:"center"},{text:"告警数值",value:"alarmValue",width:90,align:"center",class:"warning"},{text:"权属单位",value:"deptName",align:"center"},{text:"告警时间",value:"alarmTime",width:170,align:"center"}],multipleSelection:[],list:[],total:0,alarmTypeList:[],alarmContentTypeList:[],showAlarmType:!0,listLoading:!0,fullscreenLoading:!1,wellShow:!1,detailShow:!1}},computed:{alarmType:function(){return this.listQuery.alarmType},operation:function(){return(0,o.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(){this.fetchAlarmType(),!1===(0,o.lr)()&&(this.listQuery.alarmType="1"),u.log("records created")},mounted:function(){this.$route.query&&this.$route.query.wellCode?(this.listQuery.keywords=this.$route.query.wellCode,this.fetchData(!1)):(this.listQuery.keywords="",this.listQuery.alarmType="",this.listQuery.alarmContentType="",this.listQuery.beginTime="",this.listQuery.endTime="",this.timeRange=[],this.fetchData(!1))},activated:function(){c||(this.$route.query&&this.$route.query.wellCode?(this.listQuery.keywords=this.$route.query.wellCode,this.fetchData(!1)):(this.listQuery.keywords="",this.listQuery.alarmType="",this.listQuery.alarmContentType="",this.listQuery.beginTime="",this.listQuery.endTime="",this.timeRange=[],(0,o.lr)()||(this.listQuery.alarmType="1"),this.fetchData(!1)))},methods:{showWellDetail:function(e){this.wellShow=!0,this.$refs.wellInfo.initDialog(e.wellId)},formatValue:function(e){return 1===e?"一级告警":2===e?"二级告警":3===e?"三级告警":"--"},showJob:function(e){var t=e.jobId;this.$router.push({path:"/detailJob/"+t,query:{jobId:t}})},batchExport:function(){var e=this,t=this.$loading({lock:!0,text:"数据处理中,请稍后...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});(0,s.SY)(this.listQuery).then((function(e){t.close(),u.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)}))},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,s.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,s.Jc)().then((function(t){e.alarmTypeList=t.data,(0,o.lr)()||(e.showAlarmType=!1,e.listQuery.alarmType="1")}))},fetchAlarmContentType:function(){var e=this;this.alarmContentTypeList=[],(0,s.f5)(this.listQuery.alarmType).then((function(t){var a,l=e.$store.getters.deviceTypes,n=(0,i.Z)(t.data.list);try{var r=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;)r()}catch(s){n.e(s)}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()},handleSelectionChange:function(e){this.multipleSelection=e}}},m=h;var d=a(1001),y=(0,d.Z)(m,l,n,!1,null,"4e396bba",null);const p=y.exports},67952:(e,t,a)=>{a.d(t,{GH:()=>o,Gt:()=>n,Jc:()=>i,SY:()=>s,f5:()=>r,vC:()=>u});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 r(e){return(0,l.Z)({url:"alarm/contentType",method:"get",params:{alarmType:e}})}function s(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 u(e){return(0,l.Z)({url:"alarm/batchCancel",method:"post",params:e})}}}]);