import Group from 'zrender/src/container/Group'; import Line from 'zrender/src/graphic/shape/Line'; /** 延时释放*/ export default class ERelease extends Group { constructor(model) { super(); this.model = model; this.zlevel = model.zlevel; this.z = model.z; this._create(); } _create() { const model = this.model; this.Lines = new Line({ zlevel: model.zlevel, z: this.z, shape: model.shape, progressive: model.progressive, style: { lineWidth: model.lineWidth, stroke: model.stroke } }); this.add(this.Lines); } setStyle(model) { this.Lines.setStyle(model); } hide() { this.Lines.hide(); } show() { this.Lines.show(); } // 开始动画 animateStyle(loop, animates) { if (animates && animates.length) { this.eachChild((child) => { if (child.animateStyle && child.isLine) { let an = child.animateStyle(loop); animates.forEach(elem => { an = an.when(elem.time, elem.styles); }); an.start(); } }); } } // 结束动画 stopAnimation(flag) { this.eachChild((child) => { if (child.stopAnimation && child.isLine) { child.stopAnimation(flag); } }); } }