Files
bot_dev1 85df71fc28 feat: 实现供水运营专题大屏BI可视化
- 新增OperationDashboard.vue全屏大屏组件
- 添加6个核心KPI指标卡片: 进水总量/出水总量/产销差率/营收额/平均水质/报警次数
- 实现6个ECharts图表: 供水趋势/水质分布/报警统计/管网空间/设备状态/营收分析
- 创建静态HTML版本operation-dashboard.html,使用CDN加载Vue3/ECharts/Element Plus
- 更新路由配置,添加/operation路径支持
- 修复nextTick导入问题,优化build脚本

🚧 开发者: bot_dev1
📝 任务: #38 [BI] 运营仪表盘 + 供水专题大屏
2026-06-15 09:06:11 +08:00

113 lines
4.3 KiB
JavaScript

import { __extends } from "tslib";
import Displayble from './Displayable.js';
import BoundingRect from '../core/BoundingRect.js';
var m = [];
var IncrementalDisplayable = (function (_super) {
__extends(IncrementalDisplayable, _super);
function IncrementalDisplayable() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.notClear = true;
_this.incremental = true;
_this._displayables = [];
_this._temporaryDisplayables = [];
_this._cursor = 0;
return _this;
}
IncrementalDisplayable.prototype.traverse = function (cb, context) {
cb.call(context, this);
};
IncrementalDisplayable.prototype.useStyle = function () {
this.style = {};
};
IncrementalDisplayable.prototype.getCursor = function () {
return this._cursor;
};
IncrementalDisplayable.prototype.innerAfterBrush = function () {
this._cursor = this._displayables.length;
};
IncrementalDisplayable.prototype.clearDisplaybles = function () {
this._displayables = [];
this._temporaryDisplayables = [];
this._cursor = 0;
this.markRedraw();
this.notClear = false;
};
IncrementalDisplayable.prototype.clearTemporalDisplayables = function () {
this._temporaryDisplayables = [];
};
IncrementalDisplayable.prototype.addDisplayable = function (displayable, notPersistent) {
if (notPersistent) {
this._temporaryDisplayables.push(displayable);
}
else {
this._displayables.push(displayable);
}
this.markRedraw();
};
IncrementalDisplayable.prototype.addDisplayables = function (displayables, notPersistent) {
notPersistent = notPersistent || false;
for (var i = 0; i < displayables.length; i++) {
this.addDisplayable(displayables[i], notPersistent);
}
};
IncrementalDisplayable.prototype.getDisplayables = function () {
return this._displayables;
};
IncrementalDisplayable.prototype.getTemporalDisplayables = function () {
return this._temporaryDisplayables;
};
IncrementalDisplayable.prototype.eachPendingDisplayable = function (cb) {
for (var i = this._cursor; i < this._displayables.length; i++) {
cb && cb(this._displayables[i]);
}
for (var i = 0; i < this._temporaryDisplayables.length; i++) {
cb && cb(this._temporaryDisplayables[i]);
}
};
IncrementalDisplayable.prototype.update = function () {
this.updateTransform();
for (var i = this._cursor; i < this._displayables.length; i++) {
var displayable = this._displayables[i];
displayable.parent = this;
displayable.update();
displayable.parent = null;
}
for (var i = 0; i < this._temporaryDisplayables.length; i++) {
var displayable = this._temporaryDisplayables[i];
displayable.parent = this;
displayable.update();
displayable.parent = null;
}
};
IncrementalDisplayable.prototype.getBoundingRect = function () {
if (!this._rect) {
var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);
for (var i = 0; i < this._displayables.length; i++) {
var displayable = this._displayables[i];
var childRect = displayable.getBoundingRect().clone();
if (displayable.needLocalTransform()) {
childRect.applyTransform(displayable.getLocalTransform(m));
}
rect.union(childRect);
}
this._rect = rect;
}
return this._rect;
};
IncrementalDisplayable.prototype.contain = function (x, y) {
var localPos = this.transformCoordToLocal(x, y);
var rect = this.getBoundingRect();
if (rect.contain(localPos[0], localPos[1])) {
for (var i = 0; i < this._displayables.length; i++) {
var displayable = this._displayables[i];
if (displayable.contain(x, y)) {
return true;
}
}
}
return false;
};
return IncrementalDisplayable;
}(Displayble));
export default IncrementalDisplayable;