/* * lC区域控制模式 */ import Group from 'zrender/src/container/Group'; import EControl from '../element/EControl'; export default class LcControl extends Group { constructor({ _code, _type, zlevel, model, state }, style) { super(); this.z = 20; this._code = _code; this._type = _type; this.zlevel = zlevel; this.model = model; this.state = state; this.style = style; this._create(); } _create() { const model = this.model; const state = this.state; this.control = new EControl({ zlevel: this.zlevel, z: this.z, arc: { shape: { cx: model.position.x, cy: model.position.y, r: this.style.zcControlmodeR }, lineWidth: 0, fill: this.style.lcControlColor }, text: { position: [0, 0], x: model.position.x, y: model.position.y + this.style.zcControlmodeR + this.style.nameDistance, fontWeight: 'normal', fontSize: this.style.stationControlTextSize, fontFamily: this.style.textFontFormat, text: model.name, textFill: '#fff', textAlign: 'middle', textVerticalAlign: 'top' }, style: this.style }); this.add(this.control); this.setState(state); } // 设置状态 setState(state) {} getShapeTipPoint() { if (this.control) { var distance = 2; var rect = this.control.getBoundingRect(); return { x: rect.x + rect.width / 2, y: rect.y - distance }; } return null; } }