webpackJsonp([21],{

/***/ 1516:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SummaryViewModule", function() { return SummaryViewModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_components_module__ = __webpack_require__(992);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__summary_view__ = __webpack_require__(1859);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(6);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/**
 * Created by dilshan on 5/21/18.
 */





var SummaryViewModule = /** @class */ (function () {
    function SummaryViewModule() {
    }
    SummaryViewModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_3__summary_view__["a" /* SummaryViewComponent */],
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist__["j" /* CoreModule */],
                __WEBPACK_IMPORTED_MODULE_2__components_components_module__["a" /* ComponentsModule */],
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_3__summary_view__["a" /* SummaryViewComponent */])
            ],
        })
    ], SummaryViewModule);
    return SummaryViewModule;
}());

//# sourceMappingURL=summary.view.module.js.map

/***/ }),

/***/ 1859:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SummaryViewComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ngx_logger__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__summary_view_template__ = __webpack_require__(1860);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__providers_recentevent_provider__ = __webpack_require__(153);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash__ = __webpack_require__(367);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash__);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
/**
 * Created by dilshan on 5/21/18.
 */






var SummaryViewComponent = /** @class */ (function () {
    /*
    view discriptor set
     */
    function SummaryViewComponent(logger, recentEventProvider, navParams) {
        this.logger = logger;
        this.recentEventProvider = recentEventProvider;
        this.navParams = navParams;
        this.pageheaders = [];
        this.summarydata = [];
        this.overallprc = [];
        this.operationsList = [];
        this.issueList = [];
        this.sub_header = true;
        /*
         listenForStateChanges view config and set in to current_view_conf param
         */
        this.current_view_conf = this.navParams.get('conf');
        if (this.current_view_conf) {
            this.sub_header = this.current_view_conf['order_heading'];
            this.setTableContent(this.current_view_conf);
            this.stationSummmary = 'summary';
            if (this.current_view_conf.summary_name === 'station_summary') {
                this.station_summary = true;
            }
            else if (this.current_view_conf.summary_name === 'qc_summary') {
                this.qc_summary = true;
            }
        }
        this.tools = this.tools = {
            line: false,
            menu: false,
            shift: false,
            user: false,
        };
        /*
        set overall percentage table values
         */
        var content_ovrl = { 'ftt-percentage': '88%', 'dhu-percentage': '8%', 'reject-percentage': '5%',
            'defect-percentage': '10%' };
        this.overallprc = this.updateOverallPercentage(content_ovrl);
    }
    SummaryViewComponent.prototype.ngOnInit = function () {
        this.pageheaders = this.hourly_table_content;
        this.summarydata = [
            [{ name: 'Prod Hour', value: 1 }, { name: 'DHU%', value: 23 }, { name: 'FTT%', value: 32 }, { name: 'DEFECTIVE%', value: 10 },
                { name: 'REJECTS%', value: 2 }],
            [{ name: 'Prod Hour', value: 2 }, { name: 'DHU%', value: 32 }, { name: 'FTT%', value: 32 }, { name: 'DEFECTIVE%', value: 10 },
                { name: 'REJECTS%', value: 3 }],
            [{ name: 'Prod Hour', value: 3 }, { name: 'DHU%', value: 45 }, { name: 'FTT%', value: 32 }, { name: 'DEFECTIVE%', value: 10 },
                { name: 'REJECTS%', value: 1 }],
            [{ name: 'Prod Hour', value: 4 }, { name: 'DHU%', value: 11 }, { name: 'FTT%', value: 32 }, { name: 'DEFECTIVE%', value: 10 },
                { name: 'REJECTS%', value: 5 }]
        ];
    };
    SummaryViewComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        this.operationsList = [];
        this.issueList = [];
        var class_one_list = [];
        var class_two_list = [];
        var class_one_Result = {};
        var class_two_Result = {};
        this.recentEventProvider.new_items_selected.forEach(function (itemMain, indexMain) {
            itemMain.result.forEach(function (item, index) {
                class_one_list.push(item.data.classOne_name);
                if (item.data.hasOwnProperty('classTwo_name')) {
                    class_two_list.push(item.data.classTwo_name);
                }
            });
        });
        for (var i = 0; i < class_one_list.length; ++i) {
            if (!class_one_Result[class_one_list[i]]) {
                class_one_Result[class_one_list[i]] = 0;
            }
            ++class_one_Result[class_one_list[i]];
        }
        var sortedClassOne = this.sortObject(class_one_Result);
        sortedClassOne.forEach(function (item, index) {
            var temp = {};
            temp['operation'] = item.key;
            temp['occurrence'] = item.value;
            _this.operationsList.push(temp);
        });
        this.operationsList = __WEBPACK_IMPORTED_MODULE_5_lodash__["takeRight"](this.operationsList, 5);
        // --------------------
        for (var i = 0; i < class_two_list.length; ++i) {
            if (!class_two_Result[class_two_list[i]]) {
                class_two_Result[class_two_list[i]] = 0;
            }
            ++class_two_Result[class_two_list[i]];
        }
        var sortedClassTwo = this.sortObject(class_two_Result);
        sortedClassTwo.forEach(function (item) {
            var temp = {};
            temp['issue'] = item.key;
            temp['occurrence'] = item.value;
            _this.issueList.push(temp);
        });
        this.issueList = __WEBPACK_IMPORTED_MODULE_5_lodash__["takeRight"](this.issueList, 5);
        if (this.operationsList.length === 0) {
            var temp = {};
            temp['operation'] = 'Data Not Found';
            temp['occurrence'] = '';
            this.operationsList.push(temp);
        }
        if (this.issueList.length === 0) {
            var temp = {};
            temp['issue'] = 'Data Not Found';
            temp['occurrence'] = '';
            this.issueList.push(temp);
        }
    };
    SummaryViewComponent.prototype.sortObject = function (obj) {
        var arr = [];
        for (var prop in obj) {
            if (obj.hasOwnProperty(prop)) {
                arr.push({
                    'key': prop,
                    'value': obj[prop]
                });
            }
        }
        arr.sort(function (a, b) { return a.value - b.value; });
        // arr.sort(function(a, b) { a.value.toLowerCase().localeCompare(b.value.toLowerCase()); }); //use this to sort as strings
        return arr; // returns array
    };
    /*
    set tables contents
     */
    SummaryViewComponent.prototype.setTableContent = function (conf) {
        this.logger.debug('conf', conf['ovrl_table_heading']);
        this.operation_View = conf['operation_table'];
        this.operation_heading = conf['operation_table_heading'];
        this.issue_View = conf['issue_table'];
        this.issue_heading = conf['issue_table_heading'];
        this.percentage_View = conf['ovrl_table_view'];
        this.percentage_heading = conf['ovrl_table_heading'];
        this.percentage_content = conf['overall_table_content'];
        this.hourly_table_view = conf['horly_table_view'];
        this.hourly_table_name = conf['hourly_table_name'];
        this.hourly_table_content = conf['hourly_prod_table'];
    };
    /*
    update overall percentage
     */
    SummaryViewComponent.prototype.updateOverallPercentage = function (dataset) {
        this.logger.debug('data set', dataset);
        for (var _i = 0, _a = this.percentage_content; _i < _a.length; _i++) {
            var data = _a[_i];
            this.logger.debug('data', data);
            data['value'] = dataset[data.id];
        }
        return this.percentage_content;
    };
    SummaryViewComponent = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'summary-view-page',
            template: __WEBPACK_IMPORTED_MODULE_3__summary_view_template__["a" /* SUMMARY_VIEW_HTML */]
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ngx_logger__["b" /* NGXLogger */], __WEBPACK_IMPORTED_MODULE_4__providers_recentevent_provider__["a" /* RecentEventProvider */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["p" /* NavParams */]])
    ], SummaryViewComponent);
    return SummaryViewComponent;
}());

//# sourceMappingURL=summary.view.js.map

/***/ }),

/***/ 1860:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SUMMARY_VIEW_HTML; });
/**
 * Created by dilshan on 5/21/18.
 */
var SUMMARY_VIEW_HTML = "\n<ion-header>\n <common-main-header [title]=\"current_view_conf.title\" [tools]=\"tools\"></common-main-header>\n</ion-header>\n<ion-content>\n   <ion-grid no-padding>\n      <ion-row class=\"summary-row\">\n         <ion-col *ngIf=\"sub_header\">\n            <core-domain-header></core-domain-header>\n         </ion-col>\n      </ion-row>\n   </ion-grid>\n<ion-grid no-padding *ngIf=\"qc_summary\">\n<ion-grid class=\"main-row-top content-overflow\" no-padding>\n<ion-row no-padding style=\"height: 50%;\">\n<ion-col *ngIf=\"operation_View\" class=\"table-col-padding\">\n<ion-row no-padding class=\"bottom-table table-btm-header\">\n<ion-col col-8 no-padding>\n<span>\n{{operation_heading.data}}\n</span>\n</ion-col>\n<ion-col col-4 no-padding>\n<span>\n{{operation_heading.value}}\n</span>\n</ion-col>\n</ion-row>\n<ion-row no-padding *ngFor=\"let operations of operationsList\" class=\"top-fv-tbl bottom-table-data table-btm-data\">\n<ion-col col-8 no-padding>{{operations.operation}}</ion-col>\n<ion-col col-4 no-padding class=\"font-increse\">{{operations.occurrence}}</ion-col>\n</ion-row>\n<ion-row *ngIf=\"operationsList.length == 0\">\n<ion-col>No Operations found yet</ion-col>\n</ion-row>\n</ion-col>\n<ion-col *ngIf=\"issue_View\" class=\"table-col-padding\">\n<ion-row no-padding class=\"bottom-table table-btm-header\">\n<ion-col col-8 no-padding>\n<span>\n{{issue_heading.data}}\n</span>\n</ion-col>\n<ion-col col-4 no-padding>\n<span>\n{{issue_heading.value}}\n</span>\n</ion-col>\n</ion-row>\n<ion-row no-padding *ngFor=\"let issues of issueList\" class=\"top-fv-tbl bottom-table-data table-btm-data\">\n<ion-col col-8 no-padding>{{issues.issue}}</ion-col>\n<ion-col col-4 no-padding class=\"font-increse\">{{issues.occurrence}}</ion-col>\n</ion-row>\n<ion-row *ngIf=\"issueList.length == 0\">\n<ion-col>No Issues found yet</ion-col>\n</ion-row>\n</ion-col>\n<ion-col *ngIf=\"percentage_View\" class=\"table-col-padding\">\n<ion-row no-padding class=\"bottom-table table-btm-header\">\n<ion-col col-8 no-padding>\n<span>\n{{percentage_heading.data}}\n</span>\n</ion-col>\n<ion-col col-4 no-padding>\n<span>\n{{percentage_heading.value}}\n</span>\n</ion-col>\n</ion-row>\n<ion-row no-padding *ngFor=\"let percentages of overallprc\" class=\"bottom-table-data table-btm-data prc-row-hgt\">\n<ion-col col-8 no-padding class=\"percentage-headings\" [ngClass]=\"percentages.id\" color=\"red\">{{percentages.name}}</ion-col>\n<ion-col col-4 no-padding class=\"font-increse\">{{percentages.value}}</ion-col>\n</ion-row>\n<ion-row *ngIf=\"overallprc.length == 0\">\n<ion-col>No Overall Data Percentage Set</ion-col>\n</ion-row>\n</ion-col>\n</ion-row>\n   <ion-row *ngIf=\"hourly_table_view\" style=\"padding: 1rem;\">\n   <ion-row no-padding class=\"topic-heading-top\">\n   <span class=\"tbl-hdr\">{{hourly_table_name}}</span>\n</ion-row>\n   <ion-row no-padding>\n   <ion-col *ngFor=\"let topics of pageheaders\" class=\"table-topics\">{{topics.name}}</ion-col>\n</ion-row>\n   <ion-row no-padding class=\"table-content\">\n   <ion-row no-padding *ngFor=\"let rowdata of summarydata\">\n   <ion-col no-padding class=\"col-data font-increse\" *ngFor=\"let coldata of rowdata\">{{coldata.value}}</ion-col>\n</ion-row>\n</ion-row>\n</ion-row>\n</ion-grid>\n</ion-grid>\n<ion-grid no-padding *ngIf=\"station_summary\">\n<ion-segment [(ngModel)]=\"stationSummmary\">\n <ion-segment-button value=\"summary\">\n   Summary\n </ion-segment-button>\n <ion-segment-button value=\"hourly\">\n   Hourly Input\n </ion-segment-button>\n</ion-segment>\n<ion-grid [ngSwitch]=\"stationSummmary\">\n   <ion-row class=filr-row>\n      <ion-searchbar></ion-searchbar>\n      <ion-item>\n         <ion-label>Start Date</ion-label>\n         <ion-datetime></ion-datetime>\n      </ion-item>\n      <ion-item>\n         <ion-label>End Date</ion-label>\n         <ion-datetime></ion-datetime>\n      </ion-item>\n   </ion-row>\n   <ion-row *ngSwitchCase=\"'summary'\">\n      <ion-col>\n      <ion-row class=\"sum-tbl-data-hdr\">\n         <ion-col col-2>Buyer </ion-col>\n         <ion-col col-2>PO</ion-col>\n         <ion-col col-2>Style</ion-col>\n         <ion-col col-2>Color</ion-col>\n         <ion-col col-2>Size</ion-col>\n         <ion-col col-2>Qty</ion-col>\n      </ion-row>\n      <ion-row class=\"tbl-data-row\">\n         <ion-col col-2>GAP</ion-col>\n         <ion-col col-2>GA112547</ion-col>\n         <ion-col col-2>STY2215487963358</ion-col>\n         <ion-col col-2>RED</ion-col>\n         <ion-col col-2>AL</ion-col>\n         <ion-col col-2>12</ion-col>\n      </ion-row>\n      <ion-row class=\"tbl-total\">\n         <ion-col col-2>Total</ion-col>\n         <ion-col col-2></ion-col>\n         <ion-col col-2></ion-col>\n         <ion-col col-2></ion-col>\n         <ion-col col-2></ion-col>\n         <ion-col col-2>24</ion-col>\n      </ion-row>\n      </ion-col>\n   </ion-row>\n   <ion-row *ngSwitchCase=\"'hourly'\">\n      <ion-col>\n      <ion-row class=\"sum-tbl-data-hdr\">\n         <ion-col col-2>Prod Hour</ion-col>\n         <ion-col col-8>Business Context</ion-col>\n         <ion-col col-2>Total</ion-col>\n      </ion-row>\n      <ion-row class=\"tbl-data-row\">\n         <ion-col col-2>Prod Hour</ion-col>\n         <ion-col no-padding col-8>\n            <ion-row class=\"prod-hr-item\">\n               <ion-col col-6>\n                  <ion-row class=\"sty-dta\">STY554879333658214</ion-row>\n                  <ion-row class=\"po-dta\">PO</ion-row>\n                  <ion-row class=\"inlin-dta\">\n                     <ion-col no-padding>Buyer</ion-col>\n                     <ion-col no-padding>Red</ion-col>\n                     <ion-col no-padding>XL</ion-col>\n                  </ion-row>\n               </ion-col>\n               <ion-col col-3>\n                  <ion-row>Size</ion-row>\n                  <ion-row><b>XL</b></ion-row>\n               </ion-col>\n               <ion-col col-3>\n                  <ion-row>QTY</ion-row>\n                  <ion-row><b>14</b></ion-row>\n               </ion-col>\n            </ion-row>\n            <ion-row>\n               <ion-col col-6>\n                  <ion-row class=\"sty-dta\">STY554879333658214</ion-row>\n                  <ion-row class=\"po-dta\">PO</ion-row>\n                  <ion-row class=\"inlin-dta\">\n                     <ion-col no-padding>Buyer</ion-col>\n                     <ion-col no-padding>Red</ion-col>\n                     <ion-col no-padding>XL</ion-col>\n                  </ion-row>\n               </ion-col>\n               <ion-col col-3>\n                  <ion-row>Size</ion-row>\n                  <ion-row>XL</ion-row>\n               </ion-col>\n               <ion-col col-3>\n                  <ion-row>QTY</ion-row>\n                  <ion-row>14</ion-row>\n               </ion-col>\n            </ion-row>\n         </ion-col>\n         <ion-col col-2>Total</ion-col>\n      </ion-row>\n      <ion-row class=\"tbl-total\">\n         <ion-col col-2>Total</ion-col>\n         <ion-col col-8></ion-col>\n         <ion-col col-2>21</ion-col>\n      </ion-row>\n      </ion-col>\n   </ion-row>\n</ion-grid>\n</ion-grid>\n</ion-content>\n";
//# sourceMappingURL=summary-view-template.js.map

/***/ })

});
//# sourceMappingURL=21.js.map