chunk-05af1be2.82addcca.js
10.8 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-05af1be2"],{"163a":function(e,t,a){"use strict";a.r(t);var i=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)},l=[],n={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:this.$lan("設備故障分析")+" 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),i=this.$moment(this.form.endTime),l=i.diff(a,"months",!0);if(l>3)this.$alert(this.$lan("开始时间到结束时间不能超过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.$lan("設備故障分析")+this.$lan("(仓库故障/总故障时间)")+":"+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=[],i=[],l=0;this.sysData.listWeek.forEach((function(e){l=e.sumTime+l})),this.sysData.listWeek.forEach((function(e){a.push(e.name),t.push(e.sumTime),i.push("".concat(parseInt(e.sumTime/l*100)))})),window.faultReport_guZhangFengxi.title.text=this.$lan("設備故障分析")+this.$lan("(仓库故障/总故障时间)")+":"+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=i,n.clear(),n.setOption(window.faultReport_guZhangFengxi)}return window.faultReport_guZhangFengxi},initEchart:function(e){var t=this,a=this.$echarts.init(document.getElementById("faultFrequency")),i=a;i.getZr().on("click",(function(e){var l=[e.offsetX,e.offsetY];if(i.containPixel("grid",l)){var n=i.convertFromPixel({seriesIndex:0},[e.offsetX,e.offsetY])[0],s=a.getOption(),r=s.xAxis[0].data[n];if(!r)return;var o=s.series[0].data[n];0==e.event.cancelBubble&&(e.event.cancelBubble=!0,t.popupList(r,o)),console.log(r,"xValue")}})),null!=i&&i.setOption(e)},popupList:function(e,t){var a=this,i=[];this.eqCode.forEach((function(t){e==t.label&&(a.fix=t.label,i.push({area:"A",label:t.label,value:t.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(i));var n={urlSuffix:l,logTitle:this.sysTitle,isUrlALL:!0},s=function(e){a.dialogVisible=!0,a.$nextTick((function(){console.log(e,e.data.data,"res.data.data.table"),e.data.data.table="".ParseDataBefore(e.data.data.table),a.sysData.tableDataFixe=e.data.data.table,a.temporaryList=e.data.data.table;var i=[];e.data.data.table.forEach((function(e){var t=i.find((function(t){return t.name===e.Alarm}));t?t.key++:i.push({name:e.Alarm,key:1})})),i.sort((function(e,t){return t.key-e.key})),a.initLineChart(i,t)}))};"".ajaxGet(this,n,s)},initLineChart:function(e,t){var a=this,i=[],l=[],n=[],s=0;e.forEach((function(e){i.push(e.key),l.push(e.name),s+=e.key})),i.forEach((function(e){n.push((e/s*100).toFixed(2))}));var r=this.$echarts.init(document.getElementById("minaDialog")),o=r;o.getZr().on("click",(function(e){var t=[e.offsetX,e.offsetY];if(o.containPixel("grid",t)){var i=o.convertFromPixel({seriesIndex:0},[e.offsetX,e.offsetY])[0],l=r.getOption(),n=l.xAxis[0].data[i];if(!n)return;0==e.event.cancelBubble&&(e.event.cancelBubble=!0,a.dingTable(n))}}));var u=window.faultReport_guZhangFengxiMonth;u.title.text="info-("+this.fix+")"+t,u.xAxis[0].data=l,u.series[0].data=i,u.series[1].data=n,r.clear(),u&&r.setOption(u)},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("296d"),a("e48c"),a("2877")),o=Object(r["a"])(s,i,l,!1,null,"40a2b008",null);t["default"]=o.exports},"296d":function(e,t,a){"use strict";a("83e9")},"83e9":function(e,t,a){},bfff:function(e,t,a){},e48c:function(e,t,a){"use strict";a("bfff")}}]);
//# sourceMappingURL=chunk-05af1be2.82addcca.js.map