chunk-2bef0aab.4e3da125.js
7.07 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2bef0aab"],{"091e":function(t,e,a){},"36af":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"},[a("div",[a("sys-head",{attrs:{title:t.sysTitle}}),a("div",{staticClass:"time-select"},[a("el-col",{attrs:{span:56}},[a("el-date-picker",{staticStyle:{width:"210px"},attrs:{required:"","data-msg":"开始日期时间不能为空",type:"date",placeholder:"选择开始日期时间","value-format":"yyyy-MM-dd"},model:{value:t.form.startTime,callback:function(e){t.$set(t.form,"startTime",e)},expression:"form.startTime"}}),a("el-date-picker",{staticStyle:{width:"210px"},attrs:{required:"",type:"date",placeholder:"选择结束日期时间","value-format":"yyyy-MM-dd"},model:{value:t.form.endTime,callback:function(e){t.$set(t.form,"endTime",e)},expression:"form.endTime"}})],1),a("bus-project-eq",{attrs:{defaultSelectIndexProject:1,AGVSelectIndexEq:!0,isAGV:!0},on:{selectCallBackEmit:t.projectEqCallBackEmit}}),a("el-button",{ref:"seach",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}})],1)],1),a("sys-table",{ref:"childTable",attrs:{computeCls:t.computeObj,tableHeight:"420"}})],1)},r=[];function i(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 l(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?i(Object(a),!0).forEach((function(e){o(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):i(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",baseUrlOnLine:window.appConfig.webReportlOnLine,sysTitle:"AGV故障分析表(时间维度) ver:"+window.appConfig.appId,eleEchartObj:null,sysData:{tableData:[]},form:{startTime:new Date((new Date).setDate(new Date(1).getDate())).format("yyyy-MM-dd"),endTime:(new Date).format("yyyy-MM-dd")},params:{nowSelectProjectVal:"",nowSelectEqVal:"",timeFlag:"month",isFristSelectDate:!1},handleChangeCellStyle:"",totalData:"",computeObj:{func:function(t){var e=parseInt(t.dataColumn.row[t.dataColumn.column.property]);return NaN!=e&&e>1&&t.columnIndex==t.column.length&&t.dataColumn.row.Subtotal>2&&t.dataColumn.rowIndex!=t.sysData.length-1?"backgroundColor: rgb(0 176 240)":t.columnIndex==t.column.length&&t.dataColumn.rowIndex==t.sysData.length-1?"backgroundColor: yellow;":e>0&&t.columnIndex!=t.column.length&&0!=t.columnIndex&&t.dataColumn.rowIndex!=t.sysData.length-1?"backgroundColor: rgb(216 228 188)":void 0}}}},methods:{projectEqCallBackEmit:function(t){var e=this;this.params.nowSelectProjectVal=t.nowSelectProject["selectKey"],this.params.nowSelectEqVal=t.nowSelectEq["selectKey"],this.params.isFristSelectDate||""!=this.params.nowSelectProjectVal&&(this.params.isFristSelectDate=!0,setTimeout((function(){e.getData("query")}),500))},btnAction:function(t){this.getData(t)},getData:function(t){var e=this;if(!this.getDataBefore(t)){var a={urlSuffix:"".concat(this.baseUrl,"/api/BulletinBoard/GetAGVAbnormalRecord?startTime=").concat(this.form.startTime,"&endTime=").concat(this.form.endTime,"&projectCode=").concat(this.params.nowSelectProjectVal,"&equipmentCode=").concat(this.params.nowSelectEqVal),isUrlALL:!0,isLoad:!0,isLayout:!0,falg:t},n=function(a){return"excel"==t?(e.totalData=e.$refs.childTable.totalList(),e.exportExcel(a),e.getData("query"),!1):(e.sysData.tableData.length>0&&e.sysData.tableData.splice(0,e.sysData.tableData.length),e.initTableData(a),e.sysData.tableData)};this.$refs.childTable.initData(a,n)}},getDataBefore:function(t){if(""!=this.params.nowSelectProjectVal)if(null!=this.form.startTime&&null!=this.form.endTime){if(!(new Date(this.form.startTime)>=new Date(this.form.endTime))){var e=this.initTableColumn(this.params.timeFlag);return"excel"!=t&&this.$refs.childTable.setDynamicColumn(e),!1}this.$alert("开始时间不能大于等于结束时间","提示",{dangerouslyUseHTMLString:!0})}else this.$alert("请选择开始时间-结束时间","提示",{dangerouslyUseHTMLString:!0});else this.$alert("项目号不能为空,请选择项目号","提示",{dangerouslyUseHTMLString:!0})},initTableColumn:function(t){var e=this,a=[];a.push({prop:"EquipmentName",label:"AGV设备",fixed:"left",width:300});var n=0;switch(t){case"month":this.dayBetween="".enumerateDaysBetweenDates(this,this.form.startTime,this.form.endTime),this.dayBetween.forEach((function(t){a.push({prop:"data"+n++,label:t,width:105})}));break;case"year":this.dayBetween=[],this.params.monthOptions.forEach((function(t){var a=t.label.replace("月","").replace("(当月)",""),n=e.params.startTime+"-"+a.padStart(2,"0");e.dayBetween.push(n)})),this.dayBetween.forEach((function(t){a.push({prop:"data"+n++,label:t,width:105})}));break;case"day":this.dayBetween=new Array(this.params.startTime),a.push({prop:"data0",label:this.params.startTime,width:105});break;default:break}return a.push({prop:"Subtotal",label:"小计",width:110}),a},initTableData:function(t){this.maxVal=t.getMaxPropertyValue("sumTime");var e=this.initTableDataHandle(t);this.sysData.tableData=e},initTableDataHandle:function(t){var e=this,a=[],n=t.uniqueFunc("EquipmentName"),r=0,i=!1,l=0;"day"!=this.params.timeFlag&&this.params.timeFlag;for(var o=function(o){c={index:o+1,EquipmentName:n[o].EquipmentName},r=0;var s=0;e.dayBetween.forEach((function(e){for(var a=0;a<t.length;a++)if(n[o].EquipmentName==t[a].EquipmentName&&t[a].date==e){i=!0,l=t[a].count,s+=t[a].count;break}i?(c["data"+r++]=l,c["Subtotal"]=s,i=!1):(c["data"+r++]="0",c["Subtotal"]=s)})),a.push(c)},s=0;s<n.length;s++){var c;o(s)}for(var u=Object.keys(a[0]),m={},d=0;d<a.length;d++)for(var p=0;p<u.length;p++){var h=u[p];"EquipmentName"!==h&&(m[h]||(m[h]=0),m[h]+=parseInt(a[d][h]))}var f={EquipmentName:"合计"};for(var b in m)f[b]=m[b].toString();return a.push(f),this.tableTemp=a,a},exportExcel:function(t){var e=this.initTableDataHandle(t),a=this.exportDataAndColumnHandle(e).slice(0,-1);this.$refs.childExport.exportExcel(a,!1)},exportDataAndColumnHandle:function(t){var e={index:"序号",EquipmentName:"AGV设备"},a={Subtotal:"小计"},n=0;this.dayBetween.forEach((function(t){e["data"+n++]=t}));var r=l(l({},e),a);return t.unshift(r),t.push(this.totalData),t}},mounted:function(){},created:function(){}},c=s,u=(a("9b34"),a("e3c0"),a("2877")),m=Object(u["a"])(c,n,r,!1,null,"1912599a",null);e["default"]=m.exports},"5e9b":function(t,e,a){},"9b34":function(t,e,a){"use strict";a("091e")},e3c0:function(t,e,a){"use strict";a("5e9b")}}]);
//# sourceMappingURL=chunk-2bef0aab.4e3da125.js.map