Files
water-management-system/frontend/node_modules/zrender/lib/graphic/shape/Trochoid.js
T
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

72 lines
1.9 KiB
JavaScript

import { __extends } from "tslib";
import Path from '../Path.js';
var cos = Math.cos;
var sin = Math.sin;
var TrochoidShape = (function () {
function TrochoidShape() {
this.cx = 0;
this.cy = 0;
this.r = 0;
this.r0 = 0;
this.d = 0;
this.location = 'out';
}
return TrochoidShape;
}());
export { TrochoidShape };
var Trochoid = (function (_super) {
__extends(Trochoid, _super);
function Trochoid(opts) {
return _super.call(this, opts) || this;
}
Trochoid.prototype.getDefaultStyle = function () {
return {
stroke: '#000',
fill: null
};
};
Trochoid.prototype.getDefaultShape = function () {
return new TrochoidShape();
};
Trochoid.prototype.buildPath = function (ctx, shape) {
var R = shape.r;
var r = shape.r0;
var d = shape.d;
var offsetX = shape.cx;
var offsetY = shape.cy;
var delta = shape.location === 'out' ? 1 : -1;
var x1;
var y1;
var x2;
var y2;
if (shape.location && R <= r) {
return;
}
var num = 0;
var i = 1;
var theta;
x1 = (R + delta * r) * cos(0)
- delta * d * cos(0) + offsetX;
y1 = (R + delta * r) * sin(0)
- d * sin(0) + offsetY;
ctx.moveTo(x1, y1);
do {
num++;
} while ((r * num) % (R + delta * r) !== 0);
do {
theta = Math.PI / 180 * i;
x2 = (R + delta * r) * cos(theta)
- delta * d * cos((R / r + delta) * theta)
+ offsetX;
y2 = (R + delta * r) * sin(theta)
- d * sin((R / r + delta) * theta)
+ offsetY;
ctx.lineTo(x2, y2);
i++;
} while (i <= (r * num) / (R + delta * r) * 360);
};
return Trochoid;
}(Path));
Trochoid.prototype.type = 'trochoid';
export default Trochoid;