Initial commit: apps.supersamsev.ru
This commit is contained in:
commit
54475e7d3d
17284 files changed
+98268
No files matched your search
@@ -0,0 +1 @@
|
||||
"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var descriptor,i=0;i<props.length;i++)descriptor=props[i],descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}supersamApp.controller("CutStatisticsController",["$scope","$http","$timeout","config","$filter",function($scope,$http,$timeout,config,$filter){var cutStatistics;return cutStatistics=function(){var cutStatistics=/*#__PURE__*/function(){function cutStatistics(){_classCallCheck(this,cutStatistics);var i,len,ref,sheet;for(this.getStatisticsData=this.getStatisticsData.bind(this),this.getBorderDimensionLabel=this.getBorderDimensionLabel.bind(this),$scope.utilities.showContentOnLoad(),config.sortFields={statistics_sheets:{field:"label",direction:"asc"},statistics_borders:{field:"label",direction:"asc"},statistics_clients:{field:"name",direction:"asc"}},ref=config.sheets,(i=0,len=ref.length);i<len;i++)sheet=ref[i],sheet.total_decimal=config.statistics.data[sheet.id]&&config.statistics.data[sheet.id].total_decimal?angular.copy(config.statistics.data[sheet.id].total_decimal):0}return _createClass(cutStatistics,[{key:"getStatisticsData",value:function getStatisticsData(){var dataToSend,_this=this;if(!this.isLoading)return this.isLoading=!0,dataToSend={year:config.statistics.year,select:config.statistics.select,showEmptyRows:this.showEmptyRows},$http({method:"POST",url:config.urls.cutGetStatisticsData,data:dataToSend,timeout:3e4}).then(function(response){var border,data,i,j,len,len1,ref,ref1,results,sheet;if(_this.isLoading=!1,response.data)if(data=response.data,data.status&&"success"===data.status){if(config.statistics=data.statistics,"sheets"===config.statistics.select)for(ref=config.sheets,i=0,len=ref.length;i<len;i++)sheet=ref[i],sheet.total_decimal=config.statistics.data[sheet.id]&&config.statistics.data[sheet.id].total_decimal?angular.copy(config.statistics.data[sheet.id].total_decimal):0;if("borders"===config.statistics.select){for(ref1=config.borders,results=[],(j=0,len1=ref1.length);j<len1;j++)border=ref1[j],config.statistics.data[border.id]&&config.statistics.data[border.id].total_decimal?results.push(border.total_decimal=angular.copy(config.statistics.data[border.id].total_decimal)):results.push(border.total_decimal=0);return results}}else if(config.statistics.data=!1,data.warning&&toastr.warning(data.warning),data.error)return toastr.warning(data.error)})["catch"](function(){return config.statistics.data=!1,_this.isLoading=!1,toastr.error(config.global_labels.defaultErrorMessage.value)})}},{key:"getBorderDimensionLabel",value:function getBorderDimensionLabel(heightId){var i,label,len,ref,selectedHeight,v;for(label="",ref=config.borderDimensions,(i=0,len=ref.length);i<len;i++)v=ref[i],v.id===heightId&&(selectedHeight=v);return selectedHeight&&(label=selectedHeight.label),label}}]),cutStatistics}();return cutStatistics.prototype.isLoading=!1,cutStatistics.prototype.showEmptyRows=!0,cutStatistics}.call(this),$scope.config=config,$scope.utilities=new UtilitiesClass(config,$filter,$timeout),$scope.statistics=new cutStatistics}]);
|
||||
Reference in new issue
Block a user