=e&&t.s<=e+n}},_findTargetItemIndex:function(n){var o,a,t=this.getContentGroup();return this._showController&&t.eachChild(function(t,e){var i=t.__legendDataIndex;null==a&&null!=i&&(a=e),i===n&&(o=e)}),null!=o?o:a}});gf("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(i)})});WA.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var zC=is,RC=kl,BC=Ol,VC=A,GC=E,FC="horizontal",WC="vertical",HC=["line","bar","candlestick","scatter"],ZC=UA.extend({type:"dataZoom.slider",init:function(t,e){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=e},render:function(t,e,i,n){ZC.superApply(this,"render",arguments),Tc(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=t.get("orient"),!1!==this.dataZoomModel.get("show")?(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){ZC.superApply(this,"remove",arguments),Ac(this,"_dispatchZoomAction")},dispose:function(){ZC.superApply(this,"dispose",arguments),Ac(this,"_dispatchZoomAction")},_buildView:function(){var t=this.group;t.removeAll(),this._resetLocation(),this._resetInterval();var e=this._displayables.barGroup=new Ii;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},_resetLocation:function(){var t=this.dataZoomModel,e=this.api,i=this._findCoordRect(),n={width:e.getWidth(),height:e.getHeight()},o=this._orient===FC?{right:n.width-i.x-i.width,top:n.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=_u(t.option);E(["right","top","width","height"],function(t){"ph"===a[t]&&(a[t]=o[t])});var r=vu(a,n,t.padding);this._location={x:r.x,y:r.y},this._size=[r.width,r.height],this._orient===WC&&this._size.reverse()},_positionGroup:function(){var t=this.group,e=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),o=n&&n.get("inverse"),a=this._displayables.barGroup,r=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(i!==FC||o?i===FC&&o?{scale:r?[-1,1]:[-1,-1]}:i!==WC||o?{scale:r?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:r?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:r?[1,1]:[1,-1]});var s=t.getBoundingRect([a]);t.attr("position",[e.x-s.x,e.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var t=this.dataZoomModel,e=this._size,i=this._displayables.barGroup;i.add(new zC({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40})),i.add(new zC({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:A(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(t){var e=this._size,i=t.series,n=i.getRawData(),o=i.getShadowDim?i.getShadowDim():t.otherDim;if(null!=o){var a=n.getDataExtent(o),r=.3*(a[1]-a[0]);a=[a[0]-r,a[1]+r];var s,l=[0,e[1]],u=[0,e[0]],h=[[e[0],0],[0,0]],c=[],d=u[1]/(n.count()-1),f=0,p=Math.round(n.count()/e[0]);n.each([o],function(t,e){if(0e[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,o=(n[0]+n[1])/2,a=this._updateInterval("all",i[0]-o);this._updateView(),a&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:t[0],end:t[1]})},_findCoordRect:function(){var i;if(GC(this.getTargetCoordInfo(),function(t){if(!i&&t.length){var e=t[0].model.coordinateSystem;i=e.getRect&&e.getRect()}}),!i){var t=this.api.getWidth(),e=this.api.getHeight();i={x:.2*t,y:.2*e,width:.6*t,height:.6*e}}return i}});function UC(t){return"vertical"===t?"ns-resize":"ew-resize"}WA.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var XC="\0_ec_dataZoom_roams";function YC(t,n){var e=qC(t),o=n.dataZoomId,a=n.coordId;E(e,function(t,e){var i=t.dataZoomInfos;i[o]&&_(n.allCoordIds,a)<0&&(delete i[o],t.count--)}),KC(e);var i=e[a];i||((i=e[a]={coordId:a,dataZoomInfos:{},count:0}).controller=function(t,r){var e=new Ly(t.getZr());return E(["pan","zoom","scrollMove"],function(a){e.on(a,function(n){var o=[];E(r.dataZoomInfos,function(t){if(n.isAvailableBehavior(t.dataZoomModel.option)){var e=(t.getRange||{})[a],i=e&&e(r.controller,n);!t.dataZoomModel.get("disabled",!0)&&i&&o.push({dataZoomId:t.dataZoomId,start:i[0],end:i[1]})}}),o.length&&r.dispatchAction(o)})}),e}(t,i),i.dispatchAction=T($C,t)),i.dataZoomInfos[o]||i.count++,i.dataZoomInfos[o]=n;var r=function(t){var n,o={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return E(t,function(t){var e=t.dataZoomModel,i=!e.get("disabled",!0)&&(!e.get("zoomLock",!0)||"move");o["type_"+n]"],k(t)&&(t=t.slice(),n=!0),o=e?t:n?[u(t[0]),u(t[1])]:u(t),z(l)?l.replace("{value}",n?o[0]:o).replace("{value2}",n?o[1]:o):O(l)?n?l(t[0],t[1]):l(t):n?t[0]===s[0]?i[0]+" "+o[1]:t[1]===s[1]?i[1]+" "+o[0]:o[0]+" - "+o[1]:o;function u(t){return t===s[0]?"min":t===s[1]?"max":(+t).toFixed(Math.min(r,20))}},resetExtent:function(){var t=this.option,e=pL([t.min,t.max]);this._dataExtent=e},getDataDimension:function(t){var e=this.option.dimension,i=t.dimensions;if(null!=e||i.length){if(null!=e)return t.getDimension(e);for(var n=t.dimensions,o=n.length-1;0<=o;o--){var a=n[o];if(!t.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var t=this.ecModel,e=this.option,i={inRange:e.inRange,outOfRange:e.outOfRange},n=e.target||(e.target={}),o=e.controller||(e.controller={});m(n,i),m(o,i);var u=this.isCategory();function a(n){dL(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")},fL(this.stateList,function(t){var e=n[t];if(z(e)){var i=lL(e,"active",u);i?(n[t]={},n[t][e]=i):delete n[t]}},this)}a.call(this,n),a.call(this,o),function(t,e,i){var n=t[e],o=t[i];n&&!o&&(o=t[i]={},fL(n,function(t,e){if(a_.isValidType(e)){var i=lL(e,"inactive",u);null!=i&&(o[e]=i,"color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}}))}.call(this,n,"inRange","outOfRange"),function(a){var r=(a.inRange||{}).symbol||(a.outOfRange||{}).symbol,s=(a.inRange||{}).symbolSize||(a.outOfRange||{}).symbolSize,l=this.get("inactiveColor");fL(this.stateList,function(t){var e=this.itemSize,i=a[t];null==(i=i||(a[t]={color:u?l:[l]})).symbol&&(i.symbol=r&&D(r)||(u?"roundRect":["roundRect"])),null==i.symbolSize&&(i.symbolSize=s&&D(s)||(u?e[0]:[e[0],e[0]])),i.symbol=hL(i.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var n=i.symbolSize;if(null!=n){var o=-1/0;cL(n,function(t){oe[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){mL.prototype.completeVisualOption.apply(this,arguments),E(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=0)},this)},setSelected:function(t){this.option.range=t.slice(),this._resetRange()},getSelected:function(){var t=this.getExtent(),e=Ol((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=i[1]||t<=e[1])?"inRange":"outOfRange"},findTargetDataIndices:function(n){var o=[];return this.eachTargetSeries(function(t){var i=[],e=t.getData();e.each(this.getDataDimension(e),function(t,e){n[0]<=t&&t<=n[1]&&i.push(e)},this),o.push({seriesId:t.id,dataIndex:i})},this),o},getVisualMeta:function(i){var t=xL(this,"outOfRange",this.getExtent()),e=xL(this,"inRange",this.option.range.slice()),n=[];function o(t,e){n.push({value:t,color:i(t,e)})}for(var a=0,r=0,s=e.length,l=t.length;rt[1])break;i.push({color:this.getControllerVisual(a,"color",e),offset:o/100})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},_createBarPoints:function(t,e){var i=this.visualMapModel.itemSize;return[[i[0]-e[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-e[1],t[1]]]},_createBarGroup:function(t){var e=this._orient,i=this.visualMapModel.get("inverse");return new Ii("horizontal"!==e||i?"horizontal"===e&&i?{scale:"bottom"===t?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==e||i?{scale:"left"===t?[1,1]:[-1,1]}:{scale:"left"===t?[1,-1]:[-1,-1]}:{scale:"bottom"===t?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(n,o){if(this._useHandle){var a=this._shapes,r=this.visualMapModel,s=a.handleThumbs,l=a.handleLabels;ML([0,1],function(t){var e=s[t];e.setStyle("fill",o.handlesColor[t]),e.position[1]=n[t];var i=hl(a.handleLabelPoints[t],ul(e,this.group));l[t].setStyle({x:i[0],y:i[1],text:r.formatValueText(this._dataInterval[t]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===t?"bottom":"top":"left",a.barGroup)})},this)}},_showIndicator:function(t,e,i,n){var o=this.visualMapModel,a=o.getExtent(),r=o.itemSize,s=[0,r[1]],l=SL(t,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",function(t,e,i,n){return t?[[0,-IL(e,TL(i,0))],[6,0],[0,IL(e,TL(n-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,n,l,r[1]));var c=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0});h.setStyle("fill",c);var d=hl(u.indicatorLabelPoint,ul(h,this.group)),f=u.indicatorLabel;f.attr("invisible",!1);var p=this._applyTransform("left",u.barGroup),g=this._orient;f.setStyle({text:(i||"")+o.formatValueText(e),textVerticalAlign:"horizontal"===g?p:"middle",textAlign:"horizontal"===g?"center":p,x:d[0],y:d[1]})}},_enableHoverLinkToSeries:function(){var n=this;this._shapes.barGroup.on("mousemove",function(t){if(n._hovering=!0,!n._dragging){var e=n.visualMapModel.itemSize,i=n._applyTransform([t.offsetX,t.offsetY],n._shapes.barGroup,!0,!0);i[1]=IL(TL(0,i[1]),e[1]),n._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=e[0])}}).on("mouseout",function(){n._hovering=!1,n._dragging||n._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(t,e){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var o=[0,n[1]],a=i.getExtent();t=IL(TL(o[0],t),o[1]);var r=function(t,e,i){var n=6,o=t.get("hoverLinkDataSize");o&&(n=SL(o,e,i,!0)/2);return n}(i,a,o),s=[t-r,t+r],l=SL(t,o,a,!0),u=[SL(s[0],o,a,!0),SL(s[1],o,a,!0)];s[0] ",r):this._showIndicator(l,l,"≈ ",r));var h=this._hoverLinkDataIndices,c=[];(e||CL(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=function(t,e){var i={},n={};return o(t||[],i),o(e||[],n,i),[a(i),a(n)];function o(t,e,i){for(var n=0,o=t.length;ni&&n([i,e[0]],"outOfRange"),n(e.slice()),i=e[1])},this),{stops:a,outerColors:r}}function n(t,e){var i=s.getRepresentValue({interval:t});e=e||s.getValueState(i);var n=o(i,e);t[0]===-1/0?r[0]=n:t[1]===1/0?r[1]=n:a.push({value:t[0],color:n},{value:t[1],color:n})}}}),PL={splitNumber:function(){var t=this.option,e=this._pieceList,i=Math.min(t.precision,20),n=this.getExtent(),o=t.splitNumber;o=Math.max(parseInt(o,10),1),t.splitNumber=o;for(var a=(n[1]-n[0])/o;+a.toFixed(i)!==a&&i<5;)i++;t.precision=i,a=+a.toFixed(i);var r=0;t.minOpen&&e.push({index:r++,interval:[-1/0,n[0]],close:[0,0]});for(var s=n[0],l=r+o;r","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,i)},this)}};function NL(t,e){var i=t.inverse;("vertical"===t.orient?!i:i)&&e.reverse()}_L.extend({type:"visualMap.piecewise",doRender:function(){var a=this.group;a.removeAll();var r=this.visualMapModel,s=r.get("textGap"),t=r.textStyleModel,l=t.getFont(),u=t.getTextColor(),h=this._getItemAlign(),c=r.itemSize,e=this._getViewData(),i=e.endsText,d=W(r.get("showLabel",!0),!i);i&&this._renderEndsText(a,i[0],c,d,h),E(e.viewPieceList,function(t){var e=t.piece,i=new Ii;i.onclick=A(this._onItemClick,this,e),this._enableHoverLink(i,t.indexInModelPieceList);var n=r.getRepresentValue(e);if(this._createItemSymbol(i,n,[0,0,c[0],c[1]]),d){var o=this.visualMapModel.getValueState(n);i.add(new Fr({style:{x:"right"===h?-s:c[0]+s,y:c[1]/2,text:e.text,textVerticalAlign:"middle",textAlign:h,textFont:l,textFill:u,opacity:"outOfRange"===o?.5:1}}))}a.add(i)},this),i&&this._renderEndsText(a,i[1],c,d,h),mu(r.get("orient"),a,r.get("itemGap")),this.renderBackground(a),this.positionGroup(a)},_enableHoverLink:function(t,i){function e(t){var e=this.visualMapModel;e.option.hoverLink&&this.api.dispatchAction({type:t,batch:bL(e.findTargetDataIndices(i),e)})}t.on("mouseover",A(e,this,"highlight")).on("mouseout",A(e,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return wL(t,this.api,t.itemSize);var i=e.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(t,e,i,n,o){if(e){var a=new Ii,r=this.visualMapModel.textStyleModel;a.add(new Fr({style:{x:n?"right"===o?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?o:"center",text:e,textFont:r.getFont(),textFill:r.getTextColor()}})),t.add(a)}},_getViewData:function(){var t=this.visualMapModel,e=N(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),i=t.get("text"),n=t.get("orient"),o=t.get("inverse");return("horizontal"===n?o:!o)?e.reverse():i=i&&i.slice().reverse(),{viewPieceList:e,endsText:i}},_createItemSymbol:function(t,e,i){t.add(mg(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,i=e.option,n=D(i.selected),o=e.getSelectedMapKey(t);"single"===i.selectedMode?(n[o]=!0,E(n,function(t,e){n[e]=e===o})):n[o]=!n[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}});ff(iL);var OL,EL="urn:schemas-microsoft-com:vml",zL="undefined"==typeof window?null:window,RL=!1,BL=zL&&zL.document;function VL(t){return OL(t)}if(BL&&!v.canvasSupported)try{BL.namespaces.zrvml||BL.namespaces.add("zrvml",EL),OL=function(t){return BL.createElement("')}}catch(t){OL=function(t){return BL.createElement("<"+t+' xmlns="'+EL+'" class="zrvml">')}}var GL,FL=ir.CMD,WL=Math.round,HL=Math.sqrt,ZL=Math.abs,UL=Math.cos,XL=Math.sin,YL=Math.max;if(!v.canvasSupported){var jL=",",qL="progid:DXImageTransform.Microsoft",KL=21600,$L=KL/2,JL=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=KL+","+KL,t.coordorigin="0,0"},QL=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},tk=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},ek=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},ik=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},nk=Hn,ok=function(t,e,i){var n=Re(e);i=+i,isNaN(i)&&(i=1),n&&(t.color=QL(n[0],n[1],n[2]),t.opacity=i*n[3])},ak=function(t,e,i,n){var o="fill"===e,a=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(o||!o&&i.lineWidth)?(t[o?"filled":"stroked"]="true",i[e]instanceof ss&&ek(t,a),a=a||VL(e),o?function(t,e,i){var n,o,a=e.fill;if(null!=a)if(a instanceof ss){var r,s=0,l=[0,0],u=0,h=1,c=i.getBoundingRect(),d=c.width,f=c.height;if("linear"===a.type){r="gradient";var p=i.transform,g=[a.x*d,a.y*f],m=[a.x2*d,a.y2*f];p&&(bt(g,g,p),bt(m,m,p));var v=m[0]-g[0],y=m[1]-g[1];(s=180*Math.atan2(v,y)/Math.PI)<0&&(s+=360),s<1e-6&&(s=0)}else{r="gradientradial";g=[a.x*d,a.y*f],p=i.transform;var x=i.scale,_=d,w=f;l=[(g[0]-c.x)/_,(g[1]-c.y)/w],p&&bt(g,g,p),_/=x[0]*KL,w/=x[1]*KL;var b=YL(_,w);u=0/b,h=2*a.r/b-u}var S=a.colorStops.slice();S.sort(function(t,e){return t.offset-e.offset});for(var M=S.length,I=[],T=[],A=0;A=c&&d<=i+1){for(var n=[],o=0;o=c&&d<=o+1)return jk(h,e.components,u,l);p[t]=e}else p[t]=void 0}var s;f++}for(;f<=e;){var r=a();if(r)return r}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i})},extractCommon:function(t,e,i,n){for(var o=e.length,a=i.length,r=t.newPos,s=r-n,l=0;r+1 {
+ 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/pages/index/index.wxml b/pages/index/index.wxml
index 3e18615..8ab4809 100644
--- a/pages/index/index.wxml
+++ b/pages/index/index.wxml
@@ -50,7 +50,6 @@
公告通知
- 4
@@ -64,7 +63,6 @@
问答机器人
- 8
详细信息
diff --git a/pages/student-grade-trend/student-grade-trend.js b/pages/student-grade-trend/student-grade-trend.js
new file mode 100644
index 0000000..fb1b8fe
--- /dev/null
+++ b/pages/student-grade-trend/student-grade-trend.js
@@ -0,0 +1,219 @@
+// pages/student-grade-trend/student-grade-trend.js
+import {searchStudents, getUserProfileSupervisor} from '../../api/document'
+import {getStudentWeightedAveragesSemesterValues} from '../../api/course'
+import * as echarts from '../../ec-canvas/echarts';
+
+var option = {
+ title: {
+ text: '各学期学分绩折线图',
+ left: 'center'
+ },
+ color: ["#37A2DA"],
+ legend: {
+ data: ['学分绩'],
+ top: 50,
+ left: 'center',
+ backgroundColor: 'red',
+ z: 100
+ },
+ grid: {
+ containLabel: true
+ },
+ tooltip: {
+ show: true,
+ trigger: 'axis'
+ },
+ xAxis: {
+ type: 'category',
+ boundaryGap: false,
+ data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
+ // show: false
+ },
+ yAxis: {
+ x: 'center',
+ type: 'value',
+ splitLine: {
+ lineStyle: {
+ type: 'dashed'
+ }
+ }
+ // show: false
+ },
+ series: [{
+ name: '学分绩',
+ type: 'line',
+ smooth: true,
+ data: [18, 36, 65, 30, 78, 40, 33]
+ }]
+};
+
+
+function initChart(canvas, width, height, dpr) {
+ const chart = echarts.init(canvas, null, {
+ width: width,
+ height: height,
+ devicePixelRatio: dpr // new
+ });
+ canvas.setChart(chart);
+
+ chart.setOption(option);
+ return chart;
+}
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ inputShowed: false,
+ inputVal: "",
+ searchStudentsList: [],
+ showGraph: false,
+ ec: {
+ onInit: initChart
+ },
+ realName: '',
+ numbering: ''
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ showInput: function () {
+ this.setData({
+ inputShowed: true
+ });
+ },
+
+ hideInput: function () {
+ this.setData({
+ inputVal: "",
+ inputShowed: false
+ });
+ },
+
+ clearInput: function () {
+ this.setData({
+ inputVal: ""
+ });
+ },
+
+ onClickShowDocument(e) {
+ let showIndex = e.currentTarget.dataset['index']
+ let userDocument = this.data.searchStudentsList[showIndex]
+ this.setData({
+ realName: userDocument.realName,
+ numbering: userDocument.numbering
+ })
+ getUserProfileSupervisor(userDocument.id).then(res => {
+ console.log(res)
+ return res.openid
+ }).then(res => {
+ return getStudentWeightedAveragesSemesterValues(res).then(res => {
+ console.log(res)
+ let values = []
+ let sems = []
+ res.forEach((v, i) => {
+ values.push(v.value)
+ const sem = v.semesterItem
+ sems.push(`${sem.startYear} ${sem.springAutumn ? '春' : '秋'}` )
+ })
+
+ console.log(values)
+ console.log(sems)
+
+ option.xAxis.data = sems
+ option.series.data = values
+
+ this.setData({
+ showGraph: true,
+ ec: {
+ onInit: initChart
+ }
+ })
+ })
+ })
+ },
+
+ inputTyping: function (e) {
+ let inputVal = e.detail.value
+ this.setData({
+ inputVal
+ });
+ searchStudents(inputVal).then(res => {
+ console.log(res)
+ this.setData({
+ searchStudentsList: res
+ })
+ })
+ },
+
+ onShareAppMessage: function (res) {
+ return {
+ title: 'ECharts 可以在微信小程序中使用啦!',
+ path: '/pages/index/index',
+ success: function () { },
+ fail: function () { }
+ }
+ },
+
+ onClickBack() {
+ this.setData({
+ showGraph: false
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/student-grade-trend/student-grade-trend.json b/pages/student-grade-trend/student-grade-trend.json
new file mode 100644
index 0000000..aa43594
--- /dev/null
+++ b/pages/student-grade-trend/student-grade-trend.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {
+ "ec-canvas": "../../ec-canvas/ec-canvas"
+ }
+}
\ No newline at end of file
diff --git a/pages/student-grade-trend/student-grade-trend.wxml b/pages/student-grade-trend/student-grade-trend.wxml
new file mode 100644
index 0000000..8d58699
--- /dev/null
+++ b/pages/student-grade-trend/student-grade-trend.wxml
@@ -0,0 +1,38 @@
+
+
+
+ 学生成绩波动趋势
+ 学生各学期成绩的变化
+
+
+ {{realName}}
+ 学号 {{numbering}}
+
+
+
+
+ 取消
+
+
+
+
+ [{{item.numbering}}] {{item.realName}}
+
+
+
+
+
+
+ 返回搜索
+
+
\ No newline at end of file
diff --git a/pages/student-grade-trend/student-grade-trend.wxss b/pages/student-grade-trend/student-grade-trend.wxss
new file mode 100644
index 0000000..d67701b
--- /dev/null
+++ b/pages/student-grade-trend/student-grade-trend.wxss
@@ -0,0 +1,10 @@
+/* pages/student-grade-trend/student-grade-trend.wxss */
+ec-canvas {
+ width: 100%;
+ height: 100%;
+}
+
+.graph {
+ width: 750rpx;
+ height: 300px;
+}
\ No newline at end of file
diff --git a/pages/student-need-concerning/student-need-concerning.js b/pages/student-need-concerning/student-need-concerning.js
new file mode 100644
index 0000000..bd477ff
--- /dev/null
+++ b/pages/student-need-concerning/student-need-concerning.js
@@ -0,0 +1,73 @@
+// pages/student-need-concerning/student-need-concerning.js
+import {getStudentMaybeInDanger} from '../../api/course'
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ studentsList: []
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ getStudentMaybeInDanger().then(res => {
+ console.log(res)
+ this.setData({
+ studentsList: res
+ })
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/student-need-concerning/student-need-concerning.json b/pages/student-need-concerning/student-need-concerning.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/student-need-concerning/student-need-concerning.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/student-need-concerning/student-need-concerning.wxml b/pages/student-need-concerning/student-need-concerning.wxml
new file mode 100644
index 0000000..f2c50e4
--- /dev/null
+++ b/pages/student-need-concerning/student-need-concerning.wxml
@@ -0,0 +1,24 @@
+
+
+ 需要关注的学生
+ 成绩波动幅度较大的学生
+
+
+
+ {{item.realName}} {{item.numbering}}
+
+
+
+ 学分绩较上学期的波动幅度为{{item.value}}
+
+
+
+
+ 查看更多
+
+
+
+
+
+
+
diff --git a/pages/student-need-concerning/student-need-concerning.wxss b/pages/student-need-concerning/student-need-concerning.wxss
new file mode 100644
index 0000000..b25eade
--- /dev/null
+++ b/pages/student-need-concerning/student-need-concerning.wxss
@@ -0,0 +1 @@
+/* pages/student-need-concerning/student-need-concerning.wxss */
\ No newline at end of file
diff --git a/pages/students-grade-analyse/students-grade-analyse.js b/pages/students-grade-analyse/students-grade-analyse.js
index d988581..06fdeb2 100644
--- a/pages/students-grade-analyse/students-grade-analyse.js
+++ b/pages/students-grade-analyse/students-grade-analyse.js
@@ -1,5 +1,5 @@
// pages/students-grade-analyse/students-grade-analyse.js
-import {getStudentsGrade} from '../../api/course'
+import {getStudentsGrade, getStudentsGradeBySemesterAndUser} from '../../api/course'
Page({
@@ -7,7 +7,9 @@ Page({
* 页面的初始数据
*/
data: {
- studentsGradeInfo: {}
+ studentsGradeInfo: {},
+ studentsGradeSemesterInfo: {},
+ showSemester: false
},
/**
@@ -69,5 +71,35 @@ Page({
*/
onShareAppMessage: function () {
+ },
+
+ onClickGradeTrend() {
+ wx.navigateTo({
+ url: '/pages/student-grade-trend/student-grade-trend'
+ })
+ },
+
+ onClickStudentConerning() {
+ wx.navigateTo({
+ url: '/pages/student-need-concerning/student-need-concerning'
+ })
+ },
+
+ onClickShowSemester(e) {
+ const targetIndex = e.currentTarget.dataset['index'];
+ console.log(targetIndex)
+ getStudentsGradeBySemesterAndUser(targetIndex).then(res => {
+ console.log(res)
+ this.setData({
+ studentsGradeSemesterInfo: res,
+ showSemester: true
+ })
+ })
+ },
+
+ onClickBack() {
+ this.setData({
+ showSemester: false
+ })
}
})
\ No newline at end of file
diff --git a/pages/students-grade-analyse/students-grade-analyse.wxml b/pages/students-grade-analyse/students-grade-analyse.wxml
index eec2fb3..d5ce445 100644
--- a/pages/students-grade-analyse/students-grade-analyse.wxml
+++ b/pages/students-grade-analyse/students-grade-analyse.wxml
@@ -1,10 +1,14 @@
-
+
学生成绩分析
我管理的学生的学业成绩情况
-
+
+ {{studentsGradeSemesterInfo.semester}}
+ 学生在这个学期的学业成绩情况
+
+
@@ -39,18 +43,24 @@
功能
-
+
需要关注的学生
+
+
+ 学生成绩波动趋势
+
+
+
学期概况
-
+
{{item}}
@@ -59,5 +69,39 @@
+
+
+
+
+
+
+ {{studentsGradeSemesterInfo.studentsNumber}}
+
+
+
+
+
+ {{studentsGradeSemesterInfo.weightedAverage}}
+
+
+
+ {{studentsGradeSemesterInfo.gpa}}
+
+
+
+ {{studentsGradeSemesterInfo.failedRecord}}
+
+
+
+ {{studentsGradeSemesterInfo.semesterListSize}}
+
+
+
+ 反映问题
+
+
+
+ 返回
+