chunk-18897244.d3bc3a39.js 11 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-18897244"],{"05d3":function(t,e,a){"use strict";a("def2")},bd1a:function(t,e,a){},cba5:function(t,e,a){"use strict";a("bd1a")},d226: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",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:"(点击妥善率表格行查看项目对应故障柱状图)"}}),a("div",{staticClass:"time-select"},[a("bus-project",{ref:"childSelectProject",attrs:{isCallBackEmit:!0},on:{selectCallBackEmit:t.projectCallBackEmit}}),a("sys-year-month-week",{ref:"childSelectDate",on:{selectCallBackEmit:t.dateCallBackEmit}}),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.tableColumnAlarm40}})],1),a("div",{staticClass:"table2"},[a("div",{staticClass:"table2-one"},[a("el-table",{ref:"tableDataOne",attrs:{data:t.tableDataSource.rate,height:"350",stripe:"",border:"","element-loading-spinner":"el-icon-loading","header-cell-style":{background:"#008c8c",color:"#000000",height:"50px",lineHeight:"50px",overflow:"hidden",whiteSpace:"nowrap"}},on:{"row-click":t.tableRateRowClick}},[a("el-table-column",{attrs:{prop:"projectName",label:"项目(目标99%)",width:"280",fixed:"left"}}),a("el-table-column",{attrs:{label:t.tableRateColumnLabal.weekStr}},[a("el-table-column",{attrs:{prop:"sumTimeWeek",label:"故障时间(分)",width:"140"}}),a("el-table-column",{attrs:{prop:"weekTuoSanRate",label:"妥善率(%)",width:"120"}})],1),a("el-table-column",{attrs:{label:t.tableRateColumnLabal.monthStr}},[a("el-table-column",{attrs:{prop:"sumTimeMonth",label:"故障时间(分)",width:"140"}}),a("el-table-column",{attrs:{prop:"monthTuoSanRate",label:"妥善率(%)",width:"120"}})],1),a("el-table-column",{attrs:{label:t.tableRateColumnLabal.properly}},[a("el-table-column",{attrs:{prop:"weekDefault",label:"周开机(分)",width:"145"}}),a("el-table-column",{attrs:{prop:"monthDefault",label:"月开机(分)",width:"145"}})],1)],1)],1),t._m(0)]),a("div",{staticClass:"table1"},[a("div",{staticClass:"table1-one"},[a("sys-table",{ref:"childTableAlarm40",attrs:{tableHeight:"300",tableColumn:t.tableColumnAlarm40}})],1)]),a("el-dialog",{attrs:{title:t.dialogRateInfo.title,visible:t.dialogRateInfo.visible,width:"90%"},on:{"update:visible":function(e){return t.$set(t.dialogRateInfo,"visible",e)}}},[a("div",{staticClass:"dialog-dv"},[a("div",{staticClass:"dv-bottem"},[a("sys-table",{ref:"childTableRateInfo",attrs:{tableHeight:"400",tableColumn:t.dialogRateInfo.column}})],1)])])],1)},i=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{width:"45%",height:"300px"}},[a("div",{staticStyle:{display:"flex",width:"100px","margin-left":"36px"}}),a("div",{staticStyle:{width:"100%"},attrs:{id:"main"}})])}];function l(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function r(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?l(Object(a),!0).forEach((function(e){o(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function o(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var s={data:function(){return{baseUrl:window.baseOnLineOrOff?window.appConfig.baseUlrOnLine:"http://127.0.0.1:10099",sysTitle:"故障报告 ver:"+window.appConfig.appId,params:{nowSelectProjectVal:"",isFrist:!1,selectYear:"",selectMonth:"",selectWeekStart:"",selectWeekEnd:"",selectWeekValue:"",isCurrentMonth:""},sysData:{weekDiffDay:0,monthDiffDay:0,nowClickRowVal:{}},tableDataSource:{rate:[],alarmSum40:[]},tableRateColumnLabal:{weekStr:"",monthStr:"",projectName:""},tableColumnAlarm40:window.faultReportTable,dialogRateInfo:{column:window.faultReportTableDialog,visible:!1,data:[],title:""}}},methods:{btnAction:function(t){this.getData(t)},projectCallBackEmit:function(t){var e=this;this.params.nowSelectProjectVal=t["selectKey"],this.params.isFrist||setTimeout((function(){e.getData("query"),e.params.isFrist=!0}),500)},dateCallBackEmit:function(t){this.params=r(r({},this.params),t)},tableRateRowClick:function(t,e,a){var n=t.ProjectCode;if(n)if(""!=this.params.selectWeekStart&&null!=this.params.selectWeekStart){var i=this.params.selectWeekStart,l=this.params.selectWeekEnd;this.tableRateColumnLabal.projectName=t.projectName,this.sysData.nowClickRowVal=t;var r="".enumerateDaysBetweenDates(this,i,l),o=this.sysData.projectAlarmSum.filter((function(t){return t.ProjectCode==n}));this.initEchart(r,o)}else this.$alert("点击妥善率表格行的时候,请不要替换选择条件!","提示",{dangerouslyUseHTMLString:!0})},getData:function(t){var e=this;if(""!==this.params.selectYear&&""!==this.params.selectMonth&&""!==this.params.selectWeekEnd){var a={urlSuffix:"".concat(this.baseUrl,"/api/BulletinBoard/GetFaultReport?yyyyMonth=").concat(this.params.selectWeekValue,"&projectCode=").concat(this.params.nowSelectProjectVal),logTitle:this.sysTitle,isUrlALL:!0,isLoad:!0},n=function(a){e.ajaxSuccessDataBefore(a.data.data.listMonth)&&(e.initTableRateColumnLabal(a.data.data),e.initTableProperRate(a.data.data),e.initTableAlarm40(a.data.data.listAlarmSum40),"excel"==t&&e.exportExcel())};"".ajax(this,a,n)}else this.$alert("请选择年、月和周","提示",{dangerouslyUseHTMLString:!0})},initTableRateColumnLabal:function(t){var e=7;if(1==t.isInterval){var a=this.$moment(this.params.selectWeekStart),n=this.$moment((new Date).format("yyyy-MM-dd"));e=Math.floor(n.diff(a,"days"))+1}var i=t.diffDay;if(this.params.isCurrentMonth){var l=this.params.selectYear+"-"+this.params.selectMonth+"-01";i="".enumerateDaysBetweenDayCount(this,l,new Date)}this.sysData.weekDiffDay=e,this.sysData.monthDiffDay=i,this.tableRateColumnLabal.weekStr="本周".concat(t.weekStr,"(当前").concat(e,"天)"),this.tableRateColumnLabal.monthStr="本月".concat(t.monthStr,"(").concat(t.diffDay,",当前").concat(i,"天)"),this.tableRateColumnLabal.properly="妥善率目标(".concat(t.properlyTarget[0].dictValue,"%)")},initTableProperRate:function(t){var e=this,a=this,n=[],i=1440*this.sysData.weekDiffDay,l=1440*this.sysData.monthDiffDay;t.listMonth.forEach((function(a){var r=t.listWeek.find((function(t){return t.ProjectCode===a.ProjectCode}));null!=r&&(a["sumTimeWeek"]=r.sumTime,a["weekTuoSanRate"]=e.numberHandler(r.sumTime,i)),a["monthDefault"]=l,a["sumTimeMonth"]=a.sumTime,a["monthTuoSanRate"]=e.numberHandler(a.sumTimeMonth,a.monthDefault),a["weekDefault"]=i,n.push(a)})),n.forEach((function(t){t["sumTimeWeek"]||(t["sumTimeWeek"]=0),t["weekTuoSanRate"]||(t["weekTuoSanRate"]="100.00")})),this.tableDataSource.rate=n,n.length>1&&a.$nextTick((function(){document.querySelector(".el-table__row").click()}))},echartDataHandle:function(t,e){var a=this,n=window.faultReport_guZhangFengxi;n.title.text="".concat(this.tableRateColumnLabal.projectName,":")+this.sysData.nowClickRowVal.sumTimeWeek+"分(点击柱子查看明细)",n.xAxis[0].data=[],n.series[0].data=[],n.series[1].data=[],n.xAxis[0].data=t;for(var i=e.reduce((function(t,e){return t+e.sumVal}),0),l=function(l){var r=t[l],s=e.find((function(t){return t.xAxis==r}));null!=s?(n.series[0].data.push(s.sumVal),o=a.numberHandler(s.sumVal,i,!0),n.series[1].data.push(o)):(n.series[0].data.push(0),n.series[1].data.push(0))},r=0;r<t.length;r++){var o;l(r)}return n},initEchart:function(t,e){var a=this,n=this.echartDataHandle(t,e),i=this.$echarts.init(document.getElementById("main"));null!=i&&i.setOption(n),this.initEchartEvent(i,a,t)},initEchartEvent:function(t,e,a){var n=this;t.off("click"),t.on("click",(function(t){var a=0,i=n.sysData.nowClickRowVal.ProjectCode;n.dialogRateInfo.visible=!0;var l=[],o=t.name;n.sysData.projectAlarmSumInfo.forEach((function(t){var e=new Date(t.created).format("yyyy-MM-dd");if(t.ProjectCode===i&&e===o){var n=r(r({},t),{},{timeVal:t.timeVal});l.push(n),a+=n.timeVal}})),e.dialogRateInfo.title=n.sysData.nowClickRowVal.projectName+",故障时间(分):"+"".roundNumber(a),e.$nextTick((function(){e.$refs.childTableRateInfo.setDataSource(l)}))}))},initTableAlarm40:function(t){this.sysData.alarmSum40=t,this.$refs.childTableAlarm40.setDataSource(t)},ajaxSuccessDataBefore:function(t){return null!=t&&0!=t.length||(this.tableDataSource.rate=[],this.sysData.nowClickRowVal.title="",this.$echarts.init(document.getElementById("main")).clear(),this.$refs.childTableAlarm40.setDataSource([]),this.$alert("业务操作查询无数据!","提示",{dangerouslyUseHTMLString:!0}),!1)},numberHandler:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0===t||0===e)return 0;var n=t/e,i=0;return i=a?100*n:100*(1-t/e),i.toFixed(2)},initDate:function(){this.$refs.childSelectDate.initYearMonthWeek()},initFrom:function(){this.initDate()},exportExcel:function(){var t=this.handleExportOneData(),e=this.handleExportTwoData(),a=this.handleExportThreeData();this.$refs.childExport.exportExcel({"故障报告":t,"超40分钟故障":e,"故障明细信息":a},!1)},handleExportOneData:function(){var t=[];return t.push({projectName:"项目",sumTimeWeek:"周故障时间(分)",weekTuoSanRate:"周妥善率(%)",sumTimeMonth:"月故障时间(分)",monthTuoSanRate:"月妥善率(%)",weekDefault:"周开机(分)",monthDefault:"月开机(分)"}),this.tableDataSource.rate.forEach((function(e){t.push({projectName:e.projectName,sumTimeWeek:e.sumTimeWeek,weekTuoSanRate:e.weekTuoSanRate,sumTimeMonth:e.sumTimeMonth,monthTuoSanRate:e.monthTuoSanRate,weekDefault:e.weekDefault,monthDefault:e.monthDefault})})),t},handleExportTwoData:function(){for(var t=[],e={index:"序号"},a=this.tableColumnAlarm40,n=0;n<a.length;n++){var i=a[n];e[i.prop]=i.label}t.push(e);var l=1;return this.sysData.alarmSum40.forEach((function(e){t.push({index:l++,ProjectName:e.ProjectName,EquipmentName:e.EquipmentName,Alarm:e.Alarm,ErrorDuration:e.ErrorDuration,AlarmReason:e.AlarmReason,Reason:e.Reason,HandleInfo:e.HandleInfo,HandleUser:e.HandleUser})})),t},handleExportThreeData:function(){var t=[];t.push({index:"序号",EquipmentName:"设备名称",EquipmentPropName:"故障内容",timeVal:"故障时间(分)",created:"开始日期",updated:"结束日期"});var e=1;return this.sysData.projectAlarmSumInfo.forEach((function(a){t.push({index:e++,EquipmentName:a.EquipmentName,EquipmentPropName:a.EquipmentPropName,timeVal:a.timeVal,created:a.created,updated:a.updated})})),t}},mounted:function(){this.initFrom()}},c=s,u=(a("cba5"),a("05d3"),a("2877")),m=Object(u["a"])(c,n,i,!1,null,"d2b12050",null);e["default"]=m.exports},def2:function(t,e,a){}}]);
//# sourceMappingURL=chunk-18897244.d3bc3a39.js.map