chunk-04f14bc9.ba6e8439.js 7.46 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-04f14bc9"],{"0965":function(t,e,a){},"9ae6":function(t,e,a){"use strict";a("0965")},d3d6:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"dv-body",on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.btnAction("query")}}},[a("sys-head",{attrs:{title:t.sysTitle,remark:"选择日期月份自动往前对比2个,点击柱状图查看故障明细"}}),a("div",{staticClass:"time-select"},[a("bus-project",{ref:"childSelectProject",attrs:{defaultSelectIndex:1},on:{selectCallBackEmit:t.projectCallBackEmit}}),a("el-col",{attrs:{span:56}},[a("el-date-picker",{staticStyle:{width:"210px"},attrs:{"value-format":"yyyy-MM",type:"month",placeholder:"选择月"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.btnAction("query")}},model:{value:t.form.startTime,callback:function(e){t.$set(t.form,"startTime",e)},expression:"form.startTime"}})],1),a("el-button",{staticStyle:{margin:"0.2vw"},attrs:{icon:"el-icon-search"},on:{click:function(e){return t.btnAction("query")}}},[t._v("搜索")]),a("el-button",{staticStyle:{margin:"0.2vw"},on:{click:function(e){return t.btnAction("excel")}}},[t._v("Excel")]),a("sys-export",{ref:"childExport",attrs:{fileName:t.sysTitle,excelColumn:t.column}})],1),t._m(0),a("div",{staticClass:"dv-body-bottom"},[a("div",{staticClass:"dv-body-bottom-content"},[a("div",{staticClass:"dv-body-bottom-tableMTTR"},[a("sys-table",{ref:"childTable",attrs:{tableHeight:"300",tableColumn:t.column}})],1)])])],1)},i=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"dv-body-top"},[a("div",{staticClass:"dv-body-top-echartOne",attrs:{id:"MTTR"}})])}];function r(t,e){return l(t)||s(t,e)||u(t,e)||o()}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(t,e){var a=t&&("undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=a){var n,i,r=[],o=!0,s=!1;try{for(a=a.call(t);!(o=(n=a.next()).done);o=!0)if(r.push(n.value),e&&r.length===e)break}catch(l){s=!0,i=l}finally{try{o||null==a["return"]||a["return"]()}finally{if(s)throw i}}return r}}function l(t){if(Array.isArray(t))return t}function c(t,e){var a="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=u(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==a.return||a.return()}finally{if(s)throw r}}}}function u(t,e){if(t){if("string"===typeof t)return f(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}var d={data:function(){return{baseUrl:window.baseOnLineOrOff?window.appConfig.baseUlrOnLine:"http://127.0.0.1:10099",sysTitle:"故障月份对比 ver:"+window.appConfig.appId,form:{startTime:(new Date).format("yyyy-MM")},sysData:{sysIntotal:[],sysTable:[]},params:{nowSelectProjectVal:"",isFrist:!1},column:window.faultStatisti}},methods:{projectCallBackEmit:function(t){var e=this;this.params.nowSelectProjectVal=t.selectKey,this.params.isFrist||(this.params.isFrist=!0,setTimeout((function(){e.getData("query")}),500))},btnAction:function(t){this.getData(t)},getData:function(t){var e=this;if(""!=this.params.nowSelectProjectVal)if(null!=this.form.startTime){var a=this.$moment(this.form.startTime).format("YYYY"),n=this.$moment(this.form.startTime).format("MM"),i={urlSuffix:"".concat(this.baseUrl,"/api/BulletinBoard/FailureMonthCompare?year=").concat(a,"&month=").concat(n,"&projectCode=").concat(this.params.nowSelectProjectVal,"&equipmentTypeCode="),logTitle:"表格数据",isUrlALL:!0,isLoad:!0,falg:t},r=function(a){if(e.ajaxSuccessDataBefore(a.data)){e.sysData.sysIntotal=a.data.data.data,e.sysData.sysTable=a.data.data.allAlarm;var n=e.getTempSoer(a.data.data.data),i=e.initEchartMttr(n);e.initEchart(i),"excel"!=t?e.popupList(e.sysData.sysIntotal[0].Alarm):e.$refs.childExport.exportExcel(a.data.data.allAlarm)}};"".ajax(this,i,r)}else this.$alert("请选择月份","提示",{dangerouslyUseHTMLString:!0});else this.$alert("请选择项目号","提示",{dangerouslyUseHTMLString:!0})},getTempSoer:function(t){var e,a=this,n=[],i=[],o=c(t);try{for(o.s();!(e=o.n()).done;){var s=e.value,l=s.Alarm;n.includes(l)||n.push(l)}}catch(k){o.e(k)}finally{o.f()}var u,f=c(t);try{for(f.s();!(u=f.n()).done;){var d=u.value,m=d.YearMonth;i.includes(m)||i.push(m)}}catch(k){f.e(k)}finally{f.f()}var p=[],y=[];n.forEach((function(t){a.sysData.sysIntotal.forEach((function(e){t==e.Alarm&&(y.push(e),3==y.length&&(p.push(y),y=[]))}))}));for(var h=new Map,v=0;v<p.length;v++)for(var b=0;b<p[v].length;b++){var g=p[v][b].YearMonth,S=p[v][b].SumTime;h.has(g)||h.set(g,[]),h.get(g).push(S)}var T,w={name:n,vale:[],Date:i},x=c(h);try{for(x.s();!(T=x.n()).done;){var O=r(T.value,2),M=O[1];w.vale.push("[".concat(M.join(", "),"]"))}}catch(k){x.e(k)}finally{x.f()}return w},initEchartMttr:function(t){console.log(t,"111");var e=t.vale[0].slice(1,-1).split(", "),a=t.vale[1].slice(1,-1).split(", "),n=t.vale[2].slice(1,-1).split(", "),i=document.getElementById("MTTR"),r=this.$echarts.init(i);return faultStatistiOption.legend.data=t.Date,faultStatistiOption.xAxis[0].data=t.name,faultStatistiOption.series[0].data=e,faultStatistiOption.series[1].data=a,faultStatistiOption.series[2].data=n,faultStatistiOption.series[0].name=t.Date[0],faultStatistiOption.series[1].name=t.Date[1],faultStatistiOption.series[2].name=t.Date[2],t.name.length<=15?faultStatistiOption.dataZoom[0].end=99:t.name.length<=100?faultStatistiOption.dataZoom[0].end=30:faultStatistiOption.dataZoom[0].end=20,faultStatistiOption.title.text=this.sysData.sumMsgInfo,faultStatistiOption&&r.setOption(faultStatistiOption),faultStatistiOption},initEchart:function(t){var e=this,a=this.$echarts.init(document.getElementById("MTTR")),n=a;n.getZr().on("click",(function(t){var i=[t.offsetX,t.offsetY];if(n.containPixel("grid",i)){var r=n.convertFromPixel({seriesIndex:0},[t.offsetX,t.offsetY])[0],o=a.getOption(),s=o.xAxis[0].data[r];0==t.event.cancelBubble&&(t.event.cancelBubble=!0,e.popupList(s))}})),null!=n&&n.setOption(t)},popupList:function(t){var e=[];this.sysData.sysTable.forEach((function(a){a.AlarmMessage==t&&e.push(a)})),this.$refs.childTable.setDataSource(e)},ajaxSuccessDataBefore:function(t,e){return null!=t.data&&0!=t.data.data.length||(this.$refs.childTable.setDataSource([]),this.$echarts.init(document.getElementById("MTTR")).clear(),this.sysData.sumMsgInfo="",this.$alert("业务操作查询无数据!","提示",{dangerouslyUseHTMLString:!0}),!1)}},mounted:function(){}},m=d,p=(a("f079"),a("9ae6"),a("2877")),y=Object(p["a"])(m,n,i,!1,null,"4716ac3a",null);e["default"]=y.exports},f079:function(t,e,a){"use strict";a("f41f")},f41f:function(t,e,a){}}]);
//# sourceMappingURL=chunk-04f14bc9.ba6e8439.js.map