chunk-2daf6458.e087762f.js
10.7 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2daf6458"],{"163a":function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"dv"},[a("div",{staticClass:"dv-herdr"},[e._v(e._s(e.sysTitle))]),a("div",{staticClass:"time-select"},[a("el-select",{attrs:{clearable:"",placeholder:e.$lan("請選擇 區域")},on:{change:e.areaSelectChanged},model:{value:e.areaSelectValue,callback:function(t){e.areaSelectValue=t},expression:"areaSelectValue"}},[a("el-option",{attrs:{label:"立體倉庫",value:"L"}}),a("el-option",{attrs:{label:"AGV",value:"A"}})],1),a("el-select",{staticStyle:{"margin-left":"7px"},attrs:{clearable:"",placeholder:e.$lan("請選擇 庫別")},on:{change:e.librarySelectChanged},model:{value:e.librarySelectValue,callback:function(t){e.librarySelectValue=t},expression:"librarySelectValue"}},e._l(e.libraryOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:{value:e.value,label:e.label}}})})),1),a("el-col",{attrs:{span:56}},[a("el-date-picker",{attrs:{type:"date",placeholder:e.$lan("选择开始日期时间"),"value-format":"yyyy-MM-dd"},model:{value:e.form.startTime,callback:function(t){e.$set(e.form,"startTime",t)},expression:"form.startTime"}}),a("el-date-picker",{attrs:{type:"date",placeholder:e.$lan("选择结束日期时间"),"value-format":"yyyy-MM-dd"},model:{value:e.form.endTime,callback:function(t){e.$set(e.form,"endTime",t)},expression:"form.endTime"}})],1),a("el-button",{staticStyle:{margin:"0.2vw"},attrs:{icon:"el-icon-search"},on:{click:e.btnQuery}},[e._v(e._s(e.$lan("搜索")))])],1),a("div",{staticClass:"faultFrequencyStyle",staticStyle:{width:"100vw",height:"400px"},attrs:{id:"faultFrequency"}}),a("el-dialog",{attrs:{title:"",visible:e.dialogVisible,width:"87%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("div",{staticClass:"dialog-dv"},[1==e.dialogVisible?a("div",{attrs:{id:"minaDialog"}}):e._e()])]),a("el-dialog",{attrs:{title:"",visible:e.dialogVisibleTable,width:"90%"},on:{"update:visible":function(t){e.dialogVisibleTable=t}}},[a("div",{staticClass:"dialog-dv"},[a("div",{staticClass:"dv-bottem"},[a("el-table",{attrs:{res:"tableData",border:"","header-cell-style":{background:"#008c8c",color:"#000000"},data:e.sysData.tableDataFixe,height:"500px"}},[a("el-table-column",{attrs:{type:"index",label:e.$lan("序號"),width:"50"}}),a("el-table-column",{attrs:{prop:"EquipmentName",label:e.$lan("設備名稱"),width:"155"}}),a("el-table-column",{attrs:{prop:"Alarm",label:e.$lan("故障內容"),width:"250"}}),a("el-table-column",{attrs:{prop:"sumtime",label:e.$lan("故障時間(分)"),width:"115"}}),a("el-table-column",{attrs:{prop:"Alarm",label:e.$lan("故障原因"),width:"250"}}),a("el-table-column",{attrs:{prop:"Reason",label:e.$lan("故障原因方"),width:"100"}}),a("el-table-column",{attrs:{prop:"HandleInfo",label:e.$lan("防範對策"),width:"485"}}),a("el-table-column",{attrs:{prop:"HandleUser",label:e.$lan("負責人"),width:"170"}}),a("el-table-column",{attrs:{prop:"Id",label:"故障id",width:"90"}}),a("el-table-column",{attrs:{prop:"Created",label:e.$lan("开始日期"),width:"170"}}),a("el-table-column",{attrs:{prop:"Updated",label:e.$lan("结束日期"),width:"170"}})],1)],1)])])],1)},i=[],n=(a("4a15"),{data:function(){return{baseUrlOff:"http://127.0.0.1:9088/api/Dashboard/GetEquipmentFaultReport",baseUrlOffTwo:"http://127.0.0.1:9088/api/Dashboard/GetEquipmentWeekDayFaultInfo",baseUrlOnLine:window.appConfig.webReportlOnLine,sysData:{listWeek:[],tableData:[],tableDataColumn:null,tableDataFixe:[]},temporaryList:[],sysTitle:"設備故障分析 ver:"+window.appConfig.appId,loading:!1,areaSelectValue:"",librarySelectValue:"",libraryOptions:[],eqSelectValue:"",eqSelectLable:"",form:{startTime:new Date((new Date).setDate(new Date(1).getDate())).format("yyyy-MM-dd"),endTime:(new Date).format("yyyy-MM-dd")},activeName:"first",sumTimeWeek:0,dialogVisible:!1,dialogVisibleTable:!1}},methods:{areaSelectChanged:function(e){var t=this;this.libraryOptions="A"==e?window.libraryAGVOptionsTwo:window.libraryOptions,this.librarySelectValue="",setTimeout((function(){var e=t.$lan("請選擇 區域");""==document.querySelector("input[placeholder='".concat(e,"']")).value?t.libraryOptions=[]:t.eqSelectValue=t.libraryOptions.map((function(e){return e.value})).join()}),400)},librarySelectChanged:function(e){var t=e.value,a=e.label;this.eqSelectValue=t,this.eqSelectLable=a},btnQuery:function(){this.getData()},getData:function(e){var t=this,a=this.$moment(this.form.startTime),l=this.$moment(this.form.endTime),i=l.diff(a,"months",!0);if(i>3)this.$alert("开始时间到结束时间不能超过3个月",this.$lan("提示"),{dangerouslyUseHTMLString:!0});else if(null!=this.form.startTime)if(null!=this.form.endTime)if(new Date(this.form.startTime)>=new Date(this.form.endTime))this.$alert(this.$lan("开始时间不能大于等于结束时间"),this.$lan("提示"),{dangerouslyUseHTMLString:!0});else{var n=[];if(""==this.areaSelectValue){for(var s=0;s<window.libraryAGVOptionsTwo.length;s++)n.push({area:"A",label:window.libraryAGVOptionsTwo[s].label,value:window.libraryAGVOptionsTwo[s].value});for(var r=0;r<window.libraryOptions.length;r++)n.push({area:"L",label:window.libraryOptions[r].label,value:window.libraryOptions[r].value})}if("A"==this.areaSelectValue)if(""!=this.librarySelectValue)n.push({area:"A",label:this.eqSelectLable,value:this.librarySelectValue.value});else for(var o=0;o<window.libraryAGVOptionsTwo.length;o++)n.push({area:"A",label:window.libraryAGVOptionsTwo[o].label,value:window.libraryAGVOptionsTwo[o].value});else if("L"==this.areaSelectValue)if(""!=this.librarySelectValue)n.push({area:"L",label:this.eqSelectLable,value:this.librarySelectValue.value});else for(var u=0;u<window.libraryOptions.length;u++)n.push({area:"L",label:window.libraryOptions[u].label,value:window.libraryOptions[u].value});this.sumTimeWeek=0,this.eqCode=n;var c=this.baseUrlOff;c=this.baseUrlOnLine+"/api/Dashboard/GetEquipmentFaultReport",c="".concat(c,"?startTime=").concat(this.form.startTime,"&endTime=").concat(this.form.endTime,"&eqCode=").concat(JSON.stringify(n));var d={urlSuffix:c,logTitle:this.sysTitle,isUrlALL:!0},h=function(e){t.loading=!1,t.sysData.listWeek=e.data.data,t.sysData.tableData=e.data.data,t.sysData.listWeek.forEach((function(e){t.sumTimeWeek+=e.sumTime}));var a=t.getListData();console.log(a,"echartData"),t.initEchart(a),t.ajaxSuccessDataBefore(t.sysData.listWeek,d.logTitle)};this.loading=!0,"".ajaxGet(this,d,h)}else this.$alert(this.$lan("请选择开始时间-结束时间"),this.$lan("提示"),{dangerouslyUseHTMLString:!0});else this.$alert(this.$lan("请选择开始时间-结束时间"),this.$lan("提示"),{dangerouslyUseHTMLString:!0})},getListData:function(){if("first"===this.activeName)if(0==this.sysData.listWeek.length){this.$message.warning("暂无本周数据");var e=this.$echarts.init(document.getElementById("faultFrequency"));window.faultReport_guZhangFengxi.title.text="設備故障分析(仓库故障/总故障时间):"+this.sumTimeWeek,window.faultReport_guZhangFengxi.xAxis[0].data=[],window.faultReport_guZhangFengxi.series[0].data=[],window.faultReport_guZhangFengxi.series[1].data=[],e.clear(),e.setOption(window.faultReport_guZhangFengxi)}else{var t=[],a=[],l=[],i=0;this.sysData.listWeek.forEach((function(e){i=e.sumTime+i})),this.sysData.listWeek.forEach((function(e){a.push(e.name),t.push(e.sumTime),l.push("".concat(parseInt(e.sumTime/i*100)))})),window.faultReport_guZhangFengxi.title.text="設備故障分析(仓库故障/总故障时间):"+this.sumTimeWeek;var n=this.$echarts.init(document.getElementById("faultFrequency"));window.faultReport_guZhangFengxi.xAxis[0].data=a,window.faultReport_guZhangFengxi.series[0].data=t,window.faultReport_guZhangFengxi.series[1].data=l,n.clear(),n.setOption(window.faultReport_guZhangFengxi)}return window.faultReport_guZhangFengxi},initEchart:function(e){var t=this,a=this.$echarts.init(document.getElementById("faultFrequency")),l=a;l.getZr().on("click",(function(e){var i=[e.offsetX,e.offsetY];if(l.containPixel("grid",i)){var n=l.convertFromPixel({seriesIndex:0},[e.offsetX,e.offsetY])[0],s=a.getOption(),r=s.xAxis[0].data[n];0==e.event.cancelBubble&&(e.event.cancelBubble=!0,t.popupList(r)),console.log(r,"xValue")}})),null!=l&&l.setOption(e)},popupList:function(e){var t=this,a=[];this.eqCode.forEach((function(l){e==l.label&&(t.fix=l.label,a.push({area:"A",label:l.label,value:l.value}))}));var l=this.baseUrlOffTwo;l=this.baseUrlOnLine+"/api/Dashboard/GetEquipmentWeekDayFaultInfo",l="".concat(l,"?startTime=").concat(decodeURIComponent(this.form.startTime),"\n\t\t\t &endTime=").concat(decodeURIComponent(this.form.endTime),"\n\t\t\t &eqCode=").concat(JSON.stringify(a));var i={urlSuffix:l,logTitle:this.sysTitle,isUrlALL:!0},n=function(e){t.dialogVisible=!0,t.$nextTick((function(){console.log(e,e.data.data,"res.data.data.table"),t.sysData.tableDataFixe=e.data.data.table,t.temporaryList=e.data.data.table;var a=[];e.data.data.table.forEach((function(e){var t=a.find((function(t){return t.name===e.Alarm}));t?t.key++:a.push({name:e.Alarm,key:1})})),a.sort((function(e,t){return t.key-e.key})),t.initLineChart(a)}))};"".ajaxGet(this,i,n)},initLineChart:function(e){var t=this,a=[],l=[],i=[],n=0;e.forEach((function(e){a.push(e.key),l.push(e.name),n+=e.key})),a.forEach((function(e){i.push((e/n*100).toFixed(2))}));var s=this.$echarts.init(document.getElementById("minaDialog")),r=s;r.getZr().on("click",(function(e){var a=[e.offsetX,e.offsetY];if(r.containPixel("grid",a)){var l=r.convertFromPixel({seriesIndex:0},[e.offsetX,e.offsetY])[0],i=s.getOption(),n=i.xAxis[0].data[l];0==e.event.cancelBubble&&(e.event.cancelBubble=!0,t.dingTable(n))}}));var o=window.faultReport_guZhangFengxiMonth;o.title.text="本周設備故障分析明细-("+this.fix+")",o.xAxis[0].data=l,o.series[0].data=a,o.series[1].data=i,s.clear(),o&&s.setOption(o)},dingTable:function(e){var t=[];this.temporaryList.forEach((function(a){e==a.Alarm&&t.push(a)})),this.dialogVisibleTable=!0,this.sysData.tableDataFixe=t},ajaxSuccessDataBefore:function(e,t){return null!=e&&0!=e.length||(this.sysData.tableData=[],this.$alert(this.$lan("业务操作查询无数据!"),this.$lan("提示"),{dangerouslyUseHTMLString:!0}),!1)},tableRowClassName:function(e){e.row;var t=e.rowIndex;return 1===t?"warning-row":3===t?"success-row":""},handleClick:function(e,t){console.log(e,t)}},mounted:function(){document.querySelector("#headTitle").innerHTML=this.sysTitle,this.btnQuery()}}),s=n,r=(a("3c87"),a("e48c"),a("2877")),o=Object(r["a"])(s,l,i,!1,null,"f72862cc",null);t["default"]=o.exports},"3c87":function(e,t,a){"use strict";a("5b1b")},"5b1b":function(e,t,a){},bfff:function(e,t,a){},e48c:function(e,t,a){"use strict";a("bfff")}}]);
//# sourceMappingURL=chunk-2daf6458.e087762f.js.map