p[1]||h[1]0?100:20}},n.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");y([["start","startValue"],["end","endValue"]],function(i,r){var o=null!=t[i[0]],a=null!=t[i[1]];o&&!a?e[r]="percent":!o&&a?e[r]="value":n?e[r]=n[r]:o&&(e[r]="percent")})},n.prototype.noTarget=function(){return this._noTarget},n.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(e,n){null==t&&(t=this.ecModel.getComponent(Sm(e),n))},this),t},n.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each(function(n,i){y(n.indexList,function(n){t.call(e,i,n)})})},n.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);return n?n.__dzAxisProxy:void 0},n.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);return n&&n.indexMap[e]?this.ecModel.getComponent(Sm(t),e):void 0},n.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;y([["start","startValue"],["end","endValue"]],function(i){(null!=t[i[0]]||null!=t[i[1]])&&(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])},this),this._updateRangeUse(t)},n.prototype.setCalculatedRange=function(t){var e=this.option;y(["start","startValue","end","endValue"],function(n){e[n]=t[n]})},n.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();return t?t.getDataPercentWindow():void 0},n.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},n.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;i3?1.4:r>1?1.2:1.1,l=i>0?s:1/s;Lm(this,"zoom","zoomOnMouseWheel",t,{scale:l,originX:o,originY:a,isAvailableBehavior:null})}if(n){var u=Math.abs(i),h=(i>0?1:-1)*(u>3?.4:u>1?.15:.05);Lm(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:h,originX:o,originY:a,isAvailableBehavior:null})}}},n.prototype._pinchHandler=function(t){if(!km(this._zr,"globalPan")){var e=t.pinchScale>1?1.1:1/1.1;Lm(this,"zoom",null,t,{scale:e,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},n}(D_),_O=sr(),xO=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return e(n,t),n.prototype.render=function(e,n,i){return t.prototype.render.apply(this,arguments),e.noTarget()?void this._clear():(this.range=e.getPercentRange(),void zm(i,e,{pan:v_(bO.pan,this),zoom:v_(bO.zoom,this),scrollMove:v_(bO.scrollMove,this)}))},n.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},n.prototype._clear=function(){Em(this.api,this.dataZoomModel),this.range=null},n.type="dataZoom.inside",n}(yO),bO={zoom:function(t,e,n,i){var r=this.range,o=r.slice(),a=t.axisModels[0];if(a){var s=wO[e](null,[i.originX,i.originY],a,n,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/i.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return Cm(0,o,[0,100],0,h.minSpan,h.maxSpan),this.range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}},pan:Wm(function(t,e,n,i,r,o){var a=wO[i]([o.oldX,o.oldY],[o.newX,o.newY],e,r,n);return a.signal*(t[1]-t[0])*a.pixel/a.pixelLength}),scrollMove:Wm(function(t,e,n,i,r,o){var a=wO[i]([0,0],[o.scrollDelta,o.scrollDelta],e,r,n);return a.signal*(t[1]-t[0])*o.scrollDelta})},wO={grid:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(t,e,n,i,r){var o=n.axis,a=r.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===o.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}},SO=y,MO=wi,TO=function(){function t(t,e,n,i){this._dimName=t,this._axisIndex=e,this.ecModel=i,this._dataZoomModel=n}return t.prototype.hostedBy=function(t){return this._dataZoomModel===t},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var t=[];return this.ecModel.eachSeries(function(e){if(wm(e)){var n=Sm(this._dimName),i=e.getReferringComponents(n,wb).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}},this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return s(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){function e(t,e,n,i,r){var a=r?"Span":"ValueSpan";Cm(0,t,n,"all",h["min"+a],h["max"+a]);for(var s=0;2>s;s++)e[s]=_i(t[s],n,i,!0),r&&(e[s]=o.parse(e[s]))}var n,i=this._dataExtent,r=this.getAxisModel(),o=r.axis.scale,a=this._dataZoomModel.getRangePropMode(),s=[0,100],l=[],u=[];SO(["start","end"],function(e,r){var h=t[e],c=t[e+"Value"];"percent"===a[r]?(null==h&&(h=s[r]),c=o.parse(_i(h,s,i))):(n=!0,c=null==c?i[r]:o.parse(c),h=_i(c,i,s)),u[r]=c,l[r]=h}),MO(u),MO(l);var h=this._minMaxSpan;return n?e(u,l,i,s,!1):e(l,u,s,i,!0),{valueWindow:u,percentWindow:l}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=Um(this,this._dimName,e),this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t){function e(t){return t>=o[0]&&t<=o[1]}if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),r=t.get("filterMode"),o=this._valueWindow;"none"!==r&&SO(i,function(t){var i=t.getData(),a=i.mapDimensionsAll(n);if(a.length){if("weakFilter"===r){var s=i.getStore(),l=v(a,function(t){return i.getDimensionIndex(t)},i);i.filterSelf(function(t){for(var e,n,i,r=0;ro[1];if(h&&!c&&!p)return!0;h&&(i=!0),c&&(e=!0),p&&(n=!0)}return i&&e&&n})}else SO(a,function(n){if("empty"===r)t.setData(i=i.map(n,function(t){return e(t)?t:0/0}));else{var a={};a[n]=o,i.selectRange(a)}});SO(a,function(t){i.setApproximateExtent(o,t)})}})}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;SO(["min","max"],function(i){var r=e.get(i+"Span"),o=e.get(i+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?r=_i(n[0]+o,n,[0,100],!0):null!=r&&(o=_i(r,[0,100],n,!0)-n[0]),t[i+"Span"]=r,t[i+"ValueSpan"]=o},this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=Ti(n,[0,500]);i=Math.min(i,20);var r=t.axis.scale.rawExtentInfo;0!==e[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},t}(),IO={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(i,r){var o=t.getComponent(Sm(i),r);e(i,r,o,n)})})}e(function(t,e,n){n.__dzAxisProxy=null});var n=[];e(function(e,i,r,o){r.__dzAxisProxy||(r.__dzAxisProxy=new TO(e,i,o,t),n.push(r.__dzAxisProxy))});var i=Y();return y(n,function(t){y(t.getTargetSeriesModels(),function(t){i.set(t.uid,t)})}),i},overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(e,n){t.getAxisProxy(e,n).reset(t)}),t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).filterData(t,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}})}},CO=!1,DO=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="dataZoom.slider",n.layoutMode="box",n.defaultOption=Gs(fO.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),n}(fO),AO=Zw,kO=7,PO=1,LO=30,OO=7,RO="horizontal",zO="vertical",EO=5,BO=["line","bar","candlestick","scatter"],NO={easing:"cubicOut",duration:100,delay:0},FO=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._displayables={},e}return e(n,t),n.prototype.init=function(t,e){this.api=e,this._onBrush=v_(this._onBrush,this),this._onBrushEnd=v_(this._onBrushEnd,this)},n.prototype.render=function(e,n,i,r){return t.prototype.render.apply(this,arguments),Ah(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),e.get("show")===!1?void this.group.removeAll():e.noTarget()?(this._clear(),void this.group.removeAll()):(r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),void this._updateView())},n.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},n.prototype._clear=function(){kh(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},n.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();
+var e=this._displayables.sliderGroup=new sb;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},n.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect"),i=n?OO:0,r=this._findCoordRect(),o={width:e.getWidth(),height:e.getHeight()},a=this._orient===RO?{right:o.width-r.x-r.width,top:o.height-LO-kO-i,width:r.width,height:LO}:{right:kO,top:r.y,width:LO,height:r.height},s=kl(t.option);y(["right","top","width","height"],function(t){"ph"===s[t]&&(s[t]=a[t])});var l=Cl(s,o);this._location={x:l.x,y:l.y},this._size=[l.width,l.height],this._orient===zO&&this._size.reverse()},n.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==RO||r?n===RO&&r?{scaleY:a?1:-1,scaleX:-1}:n!==zO||r?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=t.getBoundingRect([o]);t.x=e.x-s.x,t.y=e.y-s.y,t.markRedraw()},n.prototype._getViewExtent=function(){return[0,this._size[0]]},n.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,i=t.get("brushSelect");n.add(new AO({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var r=new AO({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:v_(this._onClickPanel,this)}),o=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(r)},n.prototype._renderDataShadow=function(){function t(t){var e=y.getModel(t?"selectedDataBackground":"dataBackground"),n=new sb,i=new $S({shape:{points:c},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new QS({shape:{points:p},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var n=this._size,i=e.series,r=i.getRawData(),o=i.getShadowDim?i.getShadowDim():e.otherDim;if(null!=o){var a=r.getDataExtent(o),s=.3*(a[1]-a[0]);a=[a[0]-s,a[1]+s];var l,u=[0,n[1]],h=[0,n[0]],c=[[n[0],0],[0,0]],p=[],d=h[1]/(r.count()-1),f=0,g=Math.round(r.count()/n[0]);r.each([o],function(t,e){if(g>0&&e%g)return void(f+=d);var n=null==t||isNaN(t)||""===t,i=n?0:_i(t,a,u,!0);n&&!l&&e?(c.push([c[c.length-1][0],0]),p.push([p[p.length-1][0],0])):!n&&l&&(c.push([f,0]),p.push([f,0])),c.push([f,i]),p.push([f,i]),f+=d,l=n});for(var y=this.dataZoomModel,v=0;3>v;v++){var m=t(1===v);this._displayables.sliderGroup.add(m),this._displayables.dataShadowSegs.push(m)}}}},n.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(e!==!1){var n,i=this.ecModel;return t.eachTargetAxis(function(r,o){var a=t.getAxisProxy(r,o).getTargetSeriesModels();y(a,function(t){if(!(n||e!==!0&&p(BO,t.get("type"))<0)){var a,s=i.getComponent(Sm(r),o).axis,l=jm(r),u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),n={thisAxis:s,series:t,thisDim:r,otherDim:l,otherAxisInverse:a}}},this)},this),n}},n.prototype._renderHandle=function(){var t=this.group,e=this._displayables,n=e.handles=[null,null],i=e.handleLabels=[null,null],r=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),h=e.filler=new AO({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});r.add(h),r.add(new AO({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:PO,fill:"rgba(0,0,0,0)"}})),y([0,1],function(e){var o=a.get("handleIcon");!wC[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o);var s=$h(o,-1,0,2,2,null,!0);s.attr({cursor:qm(this._orient),draggable:!0,drift:v_(this._onDragMove,this,e),ondragend:v_(this._onDragEnd,this),onmouseover:v_(this._showDataInfo,this,!0),onmouseout:v_(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=xi(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),xa(s);var h=a.get("handleColor");null!=h&&(s.style.fill=h),r.add(n[e]=s);var c=a.getModel("textStyle");t.add(i[e]=new $w({silent:!0,invisible:!0,style:Ps(c,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:c.getTextColor(),font:c.getFont()}),z2:10}))},this);var c=h;if(u){var p=xi(a.get("moveHandleSize"),o[1]),d=e.moveHandle=new Zw({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:p}}),f=.8*p,g=e.moveHandleIcon=$h(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+p/2-.5,d.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var v=Math.min(o[1]/2,Math.max(p,10));c=e.moveZone=new Zw({invisible:!0,shape:{y:o[1]-v,height:p+v}}),c.on("mouseover",function(){s.enterEmphasis(d)}).on("mouseout",function(){s.leaveEmphasis(d)}),r.add(d),r.add(g),r.add(c)}c.attr({draggable:!0,cursor:qm(this._orient),drift:v_(this._onDragMove,this,"all"),ondragstart:v_(this._showDataInfo,this,!0),ondragend:v_(this._onDragEnd,this),onmouseover:v_(this._showDataInfo,this,!0),onmouseout:v_(this._showDataInfo,this,!1)})},n.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[_i(t[0],[0,100],e,!0),_i(t[1],[0,100],e,!0)]},n.prototype._updateInterval=function(t,e){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];Cm(e,i,r,n.get("zoomLock")?"all":t,null!=o.minSpan?_i(o.minSpan,a,r,!0):null,null!=o.maxSpan?_i(o.maxSpan,a,r,!0):null);var s=this._range,l=this._range=wi([_i(i[0],r,a,!0),_i(i[1],r,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},n.prototype._updateView=function(t){var e=this._displayables,n=this._handleEnds,i=wi(n.slice()),r=this._size;y([0,1],function(t){var i=e.handles[t],o=this._handleHeight;i.attr({scaleX:o/2,scaleY:o/2,x:n[t]+(t?-1:1),y:r[1]/2-o/2})},this),e.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var o={x:i[0],width:i[1]-i[0]};e.moveHandle&&(e.moveHandle.setShape(o),e.moveZone.setShape(o),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=e.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;le[0]||n[1]<0||n[1]>e[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,o=this._updateInterval("all",n[0]-r);this._updateView(),o&&this._dispatchZoomAction(!1)}},n.prototype._onBrushStart=function(t){var e=t.offsetX,n=t.offsetY;this._brushStart=new Gx(e,n),this._brushing=!0,this._brushStartTime=+new Date},n.prototype._onBrushEnd=function(){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var e=t.shape,n=+new Date;if(!(n-this._brushStartTime<200&&Math.abs(e.width)<5)){var i=this._getViewExtent(),r=[0,100];this._range=wi([_i(e.x,i,r,!0),_i(e.x+e.width,i,r,!0)]),this._handleEnds=[e.x,e.x+e.width],this._updateView(),this._dispatchZoomAction(!1)}}}},n.prototype._onBrush=function(t){this._brushing&&(z_(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},n.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new AO({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(t,e),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),r.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},n.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?NO:null,start:e[0],end:e[1]})},n.prototype._findCoordRect=function(){var t,e=Tm(this.dataZoomModel).infoList;if(!t&&e.length){var n=e[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var i=this.api.getWidth(),r=this.api.getHeight();t={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return t},n.type="dataZoom.slider",n}(yO);$d($m),t.version=dD,t.dependencies=fD,t.PRIORITY=PD,t.init=hp,t.connect=cp,t.disConnect=pp,t.disconnect=wA,t.dispose=dp,t.getInstanceByDom=fp,t.getInstanceById=gp,t.registerTheme=yp,t.registerPreprocessor=vp,t.registerProcessor=mp,t.registerPostInit=_p,t.registerPostUpdate=xp,t.registerUpdateLifecycle=bp,t.registerAction=wp,t.registerCoordinateSystem=Sp,t.getCoordinateSystemDimensions=Mp,t.registerLayout=Tp,t.registerVisual=Ip,t.registerLoading=Dp,t.setCanvasCreator=Ap,t.registerMap=kp,t.getMap=Pp,t.registerTransform=MA,t.dataTool=LA,t.registerLocale=Ws,t.zrender=db,t.matrix=Ox,t.vector=T_,t.zrUtil=x_,t.color=lx,t.helper=Sk,t.number=Ik,t.time=Ck,t.graphic=Dk,t.format=Ak,t.util=kk,t.List=YA,t.ComponentModel=vT,t.ComponentView=EI,t.SeriesModel=zI,t.ChartView=FI,t.extendComponentModel=gf,t.extendComponentView=yf,t.extendSeriesModel=vf,t.extendChartView=mf,t.throttle=Dh,t.use=$d,t.parseGeoJSON=tp,t.parseGeoJson=tp,t.env=n_,t.Model=HM,t.Axis=Ok,t.innerDrawElementOnCanvas=Sc});
\ No newline at end of file
diff --git a/ec-canvas/wx-canvas.js b/ec-canvas/wx-canvas.js
new file mode 100644
index 0000000..422b807
--- /dev/null
+++ b/ec-canvas/wx-canvas.js
@@ -0,0 +1,121 @@
+export default class WxCanvas {
+ constructor(ctx, canvasId, isNew, canvasNode) {
+ this.ctx = ctx;
+ this.canvasId = canvasId;
+ this.chart = null;
+ this.isNew = isNew
+ if (isNew) {
+ this.canvasNode = canvasNode;
+ }
+ else {
+ this._initStyle(ctx);
+ }
+
+ // this._initCanvas(zrender, ctx);
+
+ this._initEvent();
+ }
+
+ getContext(contextType) {
+ if (contextType === '2d') {
+ return this.ctx;
+ }
+ }
+
+ // canvasToTempFilePath(opt) {
+ // if (!opt.canvasId) {
+ // opt.canvasId = this.canvasId;
+ // }
+ // return wx.canvasToTempFilePath(opt, this);
+ // }
+
+ setChart(chart) {
+ this.chart = chart;
+ }
+
+ attachEvent() {
+ // noop
+ }
+
+ detachEvent() {
+ // noop
+ }
+
+ _initCanvas(zrender, ctx) {
+ zrender.util.getContext = function () {
+ return ctx;
+ };
+
+ zrender.util.$override('measureText', function (text, font) {
+ ctx.font = font || '12px sans-serif';
+ return ctx.measureText(text);
+ });
+ }
+
+ _initStyle(ctx) {
+ var styles = ['fillStyle', 'strokeStyle', 'globalAlpha',
+ 'textAlign', 'textBaseAlign', 'shadow', 'lineWidth',
+ 'lineCap', 'lineJoin', 'lineDash', 'miterLimit', 'fontSize'];
+
+ styles.forEach(style => {
+ Object.defineProperty(ctx, style, {
+ set: value => {
+ if (style !== 'fillStyle' && style !== 'strokeStyle'
+ || value !== 'none' && value !== null
+ ) {
+ ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value);
+ }
+ }
+ });
+ });
+
+ ctx.createRadialGradient = () => {
+ return ctx.createCircularGradient(arguments);
+ };
+ }
+
+ _initEvent() {
+ this.event = {};
+ const eventNames = [{
+ wxName: 'touchStart',
+ ecName: 'mousedown'
+ }, {
+ wxName: 'touchMove',
+ ecName: 'mousemove'
+ }, {
+ wxName: 'touchEnd',
+ ecName: 'mouseup'
+ }, {
+ wxName: 'touchEnd',
+ ecName: 'click'
+ }];
+
+ eventNames.forEach(name => {
+ this.event[name.wxName] = e => {
+ const touch = e.touches[0];
+ this.chart.getZr().handler.dispatch(name.ecName, {
+ zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
+ zrY: name.wxName === 'tap' ? touch.clientY : touch.y
+ });
+ };
+ });
+ }
+
+ set width(w) {
+ if (this.canvasNode) this.canvasNode.width = w
+ }
+ set height(h) {
+ if (this.canvasNode) this.canvasNode.height = h
+ }
+
+ get width() {
+ if (this.canvasNode)
+ return this.canvasNode.width
+ return 0
+ }
+ get height() {
+ if (this.canvasNode)
+ return this.canvasNode.height
+ return 0
+ }
+}
diff --git a/project.config.json b/project.config.json
index 6fc3856..e3fbba3 100644
--- a/project.config.json
+++ b/project.config.json
@@ -21,23 +21,25 @@
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
+ "lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
- "useApiHostProcess": false,
+ "useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
- "bundle": false,
- "useIsolateContext": true,
- "useCompilerModule": true,
- "userConfirmedUseCompilerModuleSwitch": false,
+ "useIsolateContext": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
- "minifyWXSS": true
+ "minifyWXSS": true,
+ "disableUseStrict": false,
+ "showES6CompileOption": false,
+ "useCompilerPlugins": false,
+ "minifyWXML": true
},
"compileType": "miniprogram",
"libVersion": "2.16.0",
diff --git a/utils/filter/filter.wxs b/utils/filter/filter.wxs
new file mode 100644
index 0000000..dfaac3d
--- /dev/null
+++ b/utils/filter/filter.wxs
@@ -0,0 +1,9 @@
+var common = {
+ strSlice: function (_num) {
+ return _num.slice(0,10)
+ }
+}
+
+module.exports = {
+ str: common.strSlice,
+}
\ No newline at end of file
diff --git a/utils/js/locales.js b/utils/js/locales.js
index fd42240..e9ad8b1 100644
--- a/utils/js/locales.js
+++ b/utils/js/locales.js
@@ -2,6 +2,7 @@ import { getRequest, postRequest } from './request.js'
// 查询用户信息
function queryInfo(app) {
+ let that = this;
getRequest('/v1/m/info',{}).then(res => {
let user_info = {};
user_info.name = ''
@@ -23,21 +24,23 @@ function queryInfo(app) {
app.globalData.member_info = res.data.member_info ? res.data.member_info : member_info
app.globalData.operator_info = res.data.operator_info ? res.data.operator_info : operator_info
}).catch(err => {
- console.log(err,'03')
+ that.signIn(err)
})
}
// 查询平台信息
function platformInfo(app) {
+ let that = this;
getRequest('/v1/m/platform/info',{}).then(res => {
app.globalData.platformInfo = res.data
}).catch(err => {
- console.log(err,'03')
+ that.signIn(err)
})
}
// 重新登录
function queryLogin(app) {
+ let that = this;
wx.login({
success: function (loginRes) {
if (loginRes.errMsg === 'login:ok') {
@@ -47,7 +50,7 @@ function queryLogin(app) {
app.globalData.actor = res.data.info.actor
app.globalData.info = res.data.info
}).catch(err => {
- console.log(err,'03')
+ that.signIn(err)
})
}
}
@@ -55,20 +58,28 @@ function queryLogin(app) {
}
// 登录过期处理
-function signIn(err) {
- if (err.statusCode === 401) {
- wx.showToast({ title: '登录过期,重新加载小程序', icon: 'none', duration: 3000 })
- setTimeout(function () {
- // 获取缓存里的扫码内容 登录
- let bind = wx.getStorageSync('bind')
- app.loginCloudBird(bind);
- }, 2000)
- return
- }
- let errMsg = err.data ? err.data.error_message : '';
- if (errMsg !== '') {
- wx.showToast({ title: errMsg, icon: 'none', duration: 2000 })
- }
+function signIn(err,app) {
+ switch (err.statusCode) {
+ case 401:
+ wx.showToast({ title: '登录过期,重新加载小程序', icon: 'none', duration: 3000 })
+ setTimeout(function () {
+ let bind = wx.getStorageSync('bind') // 获取缓存里的扫码内容 登录
+ app.loginCloudBird(bind);
+ }, 2000)
+ break
+ case 404:
+ case 500:
+ case 501:
+ case 502:
+ wx.showToast({ title: '服务器正在维护,请稍后访问', icon: 'none', duration: 3000 })
+ break
+ default:
+ let errMsg = err.data ? err.data.error_message : '';
+ if (errMsg !== '') {
+ wx.showToast({ title: errMsg, icon: 'none', duration: 2000 })
+ }
+ break
+ }
}
module.exports = {