/**
 * @fileoverview added by tsickle
 * Generated from: business-component/chart/toolbox/noise-analysis-toolbox/noise-analysis-toolbox.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, ViewChild, Input, Output, EventEmitter } from "@angular/core";
import { ENgxPrintComponent } from "e-ngx-print";
import { ChartMenuService } from '../../service/chart-menu.service';
export class NoiseAnalysisToolboxComponent {
    /**
     * @param {?} chartMenuService
     */
    constructor(chartMenuService) {
        this.chartMenuService = chartMenuService;
        this.bcacToolboxSingleChoiceChange = new EventEmitter();
        this.bcacToolboxMultipleChoiceChange = new EventEmitter();
        this.bcacToolboxIntervalChange = new EventEmitter();
    }
    /**
     * @return {?}
     */
    ngOnInit() {
    }
    // observer_singleChoiceData
    // observer_multipleChoiceData
    // observer_xIntervalData
    // observer_oldmultiple
    // observer_oldxInterval
    /**
     * @return {?}
     */
    ngOnDestroy() {
    }
    /**
     * @param {?} changes
     * @return {?}
     */
    ngOnChanges(changes) {
        if (changes.bcacNoiseDropToolboxData && this.bcacNoiseDropToolboxData) {
            if (this.bcacNoiseDropToolboxData.toolboxItem
                && this.bcacNoiseDropToolboxData.toolboxItem.includes('switchSingleChoice')
                && this.bcacNoiseDropToolboxData.singleChoiceData) {
                this._singleChoiceData = this.bcacNoiseDropToolboxData.singleChoiceData;
                for (const item of this.bcacNoiseDropToolboxData.singleChoiceData) {
                    if (item.ischecked) {
                        this.radioValue_singleChoice = item.value;
                    }
                }
            }
            if (this.bcacNoiseDropToolboxData.toolboxItem
                && (this.bcacNoiseDropToolboxData.toolboxItem.includes('switchMultipleChoice') || this.bcacNoiseDropToolboxData.toolboxItem.includes('switchValue'))
                && this.bcacNoiseDropToolboxData.multipleChoiceData
                && this.bcacNoiseDropToolboxData.multipleChoiceData.length) {
                this._multipleChoiceData = this.bcacNoiseDropToolboxData.multipleChoiceData;
            }
            if (this.bcacNoiseDropToolboxData.toolboxItem
                && this.bcacNoiseDropToolboxData.toolboxItem.includes('switchInterval')
                && this.bcacNoiseDropToolboxData.xIntervalData) {
                this._xIntervalData = this.bcacNoiseDropToolboxData.xIntervalData;
                for (const item of this.bcacNoiseDropToolboxData.xIntervalData) {
                    if (item.ischecked) {
                        this.radioValue_xInterval = item.value;
                    }
                }
            }
        }
    }
    /**
     * @param {?} event
     * @return {?}
     */
    closePanel(event) {
        /** @type {?} */
        let el = (/** @type {?} */ (event.target));
        if (el) {
            el.setAttribute("style", "display:none");
        }
    }
    /**
     * @param {?} imageType
     * @param {?} fileName
     * @return {?}
     */
    downloadImage(imageType, fileName) {
        this.chartMenuService.downloadEchartImage(this.chartInstance, fileName, imageType);
    }
    /**
     * @param {?} event
     * @return {?}
     */
    fullScreen(event) {
        /** @type {?} */
        const el = event.path[5];
        this.chartMenuService.fullScreen(el);
    }
    /**
     * @return {?}
     */
    customPrint() {
        this.chartMenuService.customPrint(this.chartInstance, this.print1Component);
    }
    /* //todo 显示值改变
      toolboxValueChange(item) {
        let checkedValue = []
        let checkbox = <HTMLCollection>document.getElementsByClassName('groupvaluebox')
        for (let i = 0, len = checkbox.length; i < len; i++) {
          if ((<HTMLInputElement>checkbox[i]).checked) {
            checkedValue.push((<HTMLInputElement>checkbox[i]).value)
          }
        }
        this.bcactoolboxValueChange.emit(checkedValue)
      } */
    /*  //todo 间隔改变
       toolboxIntervalChange(item) {
         this.bcactoolboxIntervalChange.emit(item.value)
       } */
    //todo 切换显示测量值
    /*   switchShowValue() {
          let checkbox = <HTMLCollection>document.getElementsByClassName('groupvaluebox')
          for (let i = 0, len = checkbox.length; i < len; i++) {
            if (this.bcacChartDefaultValueData.includes((<HTMLInputElement>checkbox[i]).value)) {
              (<HTMLInputElement>checkbox[i]).checked = true
            } else {
              (<HTMLInputElement>checkbox[i]).checked = false
            }
          }
        } */
    /* //todo 切换显示测量值
      showCheckedValue(value: string | string[] | number, node) {
        let res: boolean = false
        if (typeof (value) == 'string' || typeof (value) == 'number') { value = [value + ''] }
        let divbox = document.getElementById(node)
        let checkbox = <HTMLCollection>divbox.getElementsByClassName('groupvaluebox')
        for (let i = 0, len = checkbox.length; i < len; i++) {
          if (value.includes((<HTMLInputElement>checkbox[i]).value)) {
            (<HTMLInputElement>checkbox[i]).checked = true
            res = true
          } else {
            (<HTMLInputElement>checkbox[i]).checked = false
          }
        }
        return res
      } */
    /* //todo  x间隔改变
      xIntervalDataChange(value) {
        let checkedValue
        let divbox = document.getElementById('switchInterval')
        let checkbox = <HTMLCollection>divbox.getElementsByClassName('groupvaluebox')
        for (let i = 0, len = checkbox.length; i < len; i++) {
          if ((<HTMLInputElement>checkbox[i]).checked) {
            checkedValue = (<HTMLInputElement>checkbox[i]).value
          }
        }
        this.bcacToolboxIntervalChange.emit(checkedValue)
      } */
    //todo  x间隔改变
    /**
     * @param {?} value
     * @return {?}
     */
    xIntervalDataChange(value) {
        this.bcacToolboxIntervalChange.emit(value);
    }
    //todo 测量值改变
    /**
     * @param {?} e
     * @return {?}
     */
    singleChoiceChange(e) {
        /** @type {?} */
        let value;
        this._singleChoiceData.map((/**
         * @param {?} item
         * @return {?}
         */
        (item) => {
            if (item.value == e) {
                value = item;
            }
        }));
        this.bcacToolboxSingleChoiceChange.emit(value);
    }
    //todo 测量项改变
    /**
     * @param {?} e
     * @return {?}
     */
    multipleChoiceChange(e) {
        this.bcacToolboxMultipleChoiceChange.emit(e);
    }
}
NoiseAnalysisToolboxComponent.decorators = [
    { type: Component, args: [{
                selector: 'bcac-noise-analysis-toolbox',
                template: "<div class=\"echart-menu-panel\" style=\"display: none;\" (mouseleave)=\"closePanel($event)\">\r\n    <div class=\"echart-menu-panel-border\">\r\n        <div class=\"echart-menu-panel-box above\">\r\n            <div (click)=\"fullScreen($event)\">\u5168\u5C4F\u67E5\u770B</div>\r\n            <div (click)=\"customPrint()\">\u6253\u5370\u56FE\u8868</div>\r\n        </div>\r\n        <div class=\"echart-menu-panel-box bottom\">\r\n            <div (click)=\"downloadImage('.png', fileName)\">\u4E0B\u8F7DPNG\u6587\u4EF6</div>\r\n            <div (click)=\"downloadImage('.jpeg', fileName)\">\u4E0B\u8F7DJPEG\u6587\u4EF6</div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<ng-content></ng-content>\r\n<e-ngx-print class=\"print\" #print1 [showBtn]=\"false\">\r\n</e-ngx-print>\r\n\r\n<!-- <div\u00A0class=\"switchbox switchValue_analysis\" id=\"oldmultipleChoice\" style=\"display: none\"\r\n    (mouseleave)=\"closePanel($event)\">\r\n    <div class=\"selectbox\">\r\n        <div class=\"title\">\u663E\u793A\u56FE\u4F8B</div>\r\n        <div class=\"optionbox\">\r\n            <label class=\"dropdown-option\" *ngFor=\"let item of bcacChartToolboxSwitchValueData\">\r\n                <input type=\"checkbox\" value=\"{{item.value}}\" class=\"groupvaluebox\"\r\n                    (click)=\"toolboxValueChange(item)\" />\r\n                <span title=\"{{item.text}}\">&nbsp;&nbsp;{{item.text}}</span>\r\n            </label>\r\n            <nz-checkbox-wrapper style=\"width: 100%;\" (nzOnChange)=\"multipleChoiceChange($event)\">\r\n                <div nz-row>\r\n                    <label nz-checkbox *ngFor=\"let item of bcacChartToolboxSwitchValueData\" nzValue=\"{{item.value}}\"\r\n                        [ngModel]=\"item.ischecked\" nzTooltipTitle=\"{{item.text}}\" nzTooltipPlacement=\"top\"\r\n                        nz-tooltip>{{item.text}}</label>\r\n                </div>\r\n            </nz-checkbox-wrapper>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div\u00A0class=\"switchbox xInterval_analysis\" id=\"oldswitchInterval\" style=\"display: none\"\r\n    (mouseleave)=\"closePanel($event)\">\r\n    <div class=\"selectbox\">\r\n        <div class=\"title\">\u663E\u793A\u523B\u5EA6</div>\r\n        <div class=\"optionbox\">\r\n            <label class=\"dropdown-option\" *ngFor=\"let item of bcacChartToolboxSwitchIntervalData\">\r\n                <input type=\"radio\" value=\"{{item.value}}\" name=\"interval\"\r\n                    (click)=\"toolboxIntervalChange(item)\" class=\"groupvaluebox\" />\r\n                <span title=\"{{item.text}}\">&nbsp;&nbsp;{{item.text}}</span>\r\n            </label>\r\n            <nz-radio-group [(ngModel)]=\"radioValue_oldxInterval\" nzSize=\"small\"\r\n                (ngModelChange)=\"xIntervalDataChange($event)\">\r\n                <label nz-radio *ngFor=\"let item of bcacChartToolboxSwitchIntervalData\" nzValue=\"{{item.value}}\"\r\n                    class=\"radiolabel\">{{item.text}}</label>\r\n            </nz-radio-group>\r\n        </div>\r\n    </div>\r\n</div> -->\r\n\r\n\r\n<div\u00A0class=\"switchbox switchInterval\" id=\"switchInterval\" style=\"display: none\"\r\n    (mouseleave)=\"closePanel($event)\">\r\n    <div class=\"selectbox\">\r\n        <div class=\"title\">\u663E\u793A\u523B\u5EA6</div>\r\n        <div class=\"optionbox\">\r\n            <!-- <label class=\"dropdown-option\" *ngFor=\"let item of _xIntervalData\">\r\n                <input type=\"radio\" value=\"{{item.value}}\" name=\"newinterval\"\r\n                    (click)=\"xIntervalDataChange(item)\" class=\"groupvaluebox\" />\r\n                <span title=\"{{item.text}}\">&nbsp;&nbsp;{{item.text}}</span>\r\n            </label> -->\r\n            <nz-radio-group [(ngModel)]=\"radioValue_xInterval\" nzSize=\"small\" (ngModelChange)=\"xIntervalDataChange($event)\">\r\n                <label nz-radio *ngFor=\"let item of _xIntervalData\" nzValue=\"{{item.value}}\"\r\n                    class=\"radiolabel\" >{{item.text}}</label>\r\n            </nz-radio-group>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div\u00A0class=\"switchbox singleChoice\" id=\"singleChoice\" style=\"display: none\"\r\n    (mouseleave)=\"closePanel($event)\">\r\n    <div class=\"selectbox\">\r\n        <div class=\"title\">\u663E\u793A\u503C</div>\r\n        <div class=\"optionbox\">\r\n            <!-- <label class=\"dropdown-option\" *ngFor=\"let item of _singleChoiceData\">\r\n                <input type=\"radio\" value=\"{{item.value}}\" name=\"yvalue\" class=\"groupvaluebox\"\r\n                    (click)=\"singleChoiceChange(item)\" />\r\n                <span title=\"{{item.text}}\">&nbsp;&nbsp;{{item.text}}</span>\r\n            </label> -->\r\n            <nz-radio-group [(ngModel)]=\"radioValue_singleChoice\" nzSize=\"small\" (ngModelChange)=\"singleChoiceChange($event)\">\r\n                <label nz-radio *ngFor=\"let item of _singleChoiceData\" nzValue=\"{{item.value}}\" class=\"radiolabel\"\r\n                    nzTooltipTitle=\"{{item.text}}\" nzTooltipPlacement=\"top\" nz-tooltip>{{item.text}}</label>\r\n            </nz-radio-group>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div\u00A0class=\"switchbox multipleChoice\" id=\"multipleChoice\" style=\"display: none\"\r\n    (mouseleave)=\"closePanel($event)\">\r\n    <div class=\"selectbox\">\r\n        <div class=\"title\">\u663E\u793A\u56FE\u4F8B</div>\r\n        <div class=\"optionbox\">\r\n            <!-- <label class=\"dropdown-option \" *ngFor=\"let item of _multipleChoiceData\">\r\n                <input type=\"checkbox\" value=\"{{item.value}}\" class=\"groupvaluebox\"\r\n                    (click)=\"multipleChoiceChange(item)\" />\r\n                <span title=\"{{item.text}}\">&nbsp;&nbsp;{{item.text}}</span>\r\n            </label> -->\r\n            <nz-checkbox-wrapper style=\"width: 100%;\" (nzOnChange)=\"multipleChoiceChange($event)\" >\r\n                <div nz-row>\r\n                    <label nz-checkbox *ngFor=\"let item of _multipleChoiceData\" nzValue=\"{{item.value}}\"  class=\"radiolabel\"\r\n                        [ngModel]=\"item.ischecked\" nzTooltipTitle=\"{{item.text}}\" nzTooltipPlacement=\"top\"\r\n                        nz-tooltip>{{item.text}}</label>\r\n                </div>\r\n            </nz-checkbox-wrapper>\r\n        </div>\r\n    </div>\r\n</div>",
                styles: [".echart-menu-panel{position:absolute;z-index:10;top:0;right:0;width:14rem;padding:2rem 1.7rem 2rem 2rem;font-size:1.2rem;letter-spacing:.1rem;font-weight:450}.echart-menu-panel .echart-menu-panel-border{box-shadow:.2rem .2rem 1rem #888;border:.1rem solid #aaa4a4;background-color:#fff}.echart-menu-panel .echart-menu-panel-box{padding:.4rem 0;border-bottom:.1rem solid #aaa4a4}.echart-menu-panel .echart-menu-panel-box div{padding:.4rem .8rem}.echart-menu-panel .echart-menu-panel-box div:hover{background-color:#335cad;cursor:pointer;color:#fff}.switchbox{position:fixed;z-index:10;padding:2rem 0;font-size:1.2rem;letter-spacing:.1rem;font-weight:450}.switchbox .title{border-bottom:1px solid #aaa4a4;margin:.4rem}.switchbox .selectbox{width:10rem;background:#fff;padding:4px;border:.1rem solid #aaa4a4}.switchbox .selectbox .optionbox{max-height:30rem;overflow-y:auto;overflow-x:hidden;padding:0 .4rem}.switchbox .selectbox .optionbox .radiolabel{padding:.2rem 0;text-overflow:ellipsis;overflow:hidden;width:100%;white-space:nowrap}.switchbox .selectbox .dropdown-option{display:flex;align-items:center;padding:2px 4px}.switchbox .selectbox .dropdown-option input{width:1.2rem;height:1.2rem}.switchbox .selectbox .dropdown-option label{line-height:1}.dropdown-option span{text-overflow:ellipsis;overflow:hidden;width:100%;white-space:nowrap}.optionbox::-webkit-scrollbar{background-color:#e8e8e8;width:8px}.optionbox::-webkit-scrollbar-thumb{background-color:#aaa;border-radius:.5rem}:host ::ng-deep .optionbox .ant-checkbox-wrapper+.ant-checkbox-wrapper{margin-left:unset}"]
            }] }
];
/** @nocollapse */
NoiseAnalysisToolboxComponent.ctorParameters = () => [
    { type: ChartMenuService }
];
NoiseAnalysisToolboxComponent.propDecorators = {
    print1Component: [{ type: ViewChild, args: ["print1", { static: false },] }],
    chartInstance: [{ type: Input }],
    fileName: [{ type: Input }],
    bcacNoiseDropToolboxData: [{ type: Input }],
    bcacToolboxSingleChoiceChange: [{ type: Output }],
    bcacToolboxMultipleChoiceChange: [{ type: Output }],
    bcacToolboxIntervalChange: [{ type: Output }]
};
if (false) {
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype.print1Component;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype.chartInstance;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype.fileName;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype.bcacNoiseDropToolboxData;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype.bcacToolboxSingleChoiceChange;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype.bcacToolboxMultipleChoiceChange;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype.bcacToolboxIntervalChange;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype._singleChoiceData;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype._multipleChoiceData;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype._xIntervalData;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype.radioValue_singleChoice;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype.radioValue_xInterval;
    /** @type {?} */
    NoiseAnalysisToolboxComponent.prototype.radioValue_oldxInterval;
    /**
     * @type {?}
     * @private
     */
    NoiseAnalysisToolboxComponent.prototype.chartMenuService;
}
//# sourceMappingURL=data:application/json;base64, 