(this["webpackJsonpqq-delivery-ui"]=this["webpackJsonpqq-delivery-ui"]||[]).push([[161],{1435:function(e,t,a){"use strict";a.r(t);var r=a(0),s=a.n(r),i=a(36),o=a(41),n=a(48),l=a(355),h=a(317),c=a(311),d=a(367),g=a(1452),p=a(647),u=a(455);class b extends r.Component{constructor(e){super(e),this.state={message:!1,isDisable:!0,dialogMessage:"",loading:!1,errors:{error:!1,errorMessage:""},data:{labels:["Queue","Schedule","On Way","Completed","Canceled","Retry","Return"],datasets:[{label:"Way count",backgroundColor:["rgba(255, 99, 132, 0.2)","rgba(54, 162, 235, 0.2)","rgba(255, 206, 86, 0.2)","rgba(75, 192, 192, 0.2)","rgba(153, 102, 255, 0.2)","rgba(255, 159, 64, 0.2)"],borderColor:["rgba(255, 99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)","rgba(153, 102, 255, 1)","rgba(255, 159, 64, 1)"],borderWidth:1,data:[65,59,80,81,56,55,40]}]},completedPercent:50},this.resources=new i.a,this.config=new o.a,this.dataService=new n.a,this.t=this.props.lang,this.i18n=this.props.i18n}componentDidMount(){this.getChartData();var e=(this.props.completed/this.props.total*100).toFixed(0),t=Number(e);this.setState({completedPercent:t})}render(){this.props;return s.a.createElement("div",null,s.a.createElement(l.a,null,s.a.createElement(h.a,null,s.a.createElement(p.Bar,{data:this.state.data})),s.a.createElement(c.a,{value:this.state.completedPercent,variant:"determinate"})),s.a.createElement(d.a,{open:this.state.errors.error,autoHideDuration:6e3,anchorOrigin:{vertical:"top",horizontal:"center"},onClose:e=>{this.state.errors.error=!1,this.state.errors.errorMessage=null,this.setState({loading:!1})}},s.a.createElement(g.a,{severity:"error",elevation:6,variant:"filled",onClose:e=>{this.state.errors.error=!1,this.state.errors.errorMessage=null,this.setState({loading:!1})}},this.state.errors.errorMessage)))}getChartData(){this.dataService.retrievePOSTWithoutToken({},this.config.SERVICE_NAME_V2_DELIVERY+this.config.SERVICE_ACTION_COUNT_STATUS_BY_PICKUP+this.props.guid).then(e=>{if(e&&e.success){let t=[],a=[];t.push("Total ways"),a.push(this.props.total),e.data.map(e=>{t.push(e.status),a.push(e.total)}),this.state.data.labels=t,this.state.data.datasets[0].data=a,this.setState({loading:!1})}else this.state.errors.error=!0,this.state.errors.errorMessage=this.config.MESSAGE_REQUEST_TIMEOUT,this.setState({loading:!1})})}}t.default=e=>{const{t:t,i18n:a}=Object(u.a)();return s.a.createElement(b,Object.assign({lang:t,i18n:a,props:!0},e))}}}]);
//# sourceMappingURL=161.d5ae81e7.chunk.js.map