houzhongjian
2024-07-23 8501060c4f921d1e744c477e4dc08eb47b52693c
1、升级框架
2、迁移柠条塔数据平台和模型管理代码
已添加369个文件
63853 ■■■■■ 文件已修改
src/assets/img/abnormal.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/automatic.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/avatar.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/celogo.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/cv_variable_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/gf_head.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/gf_machine_1_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/gf_machine_2_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/log_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/plan_detail.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/plan_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/pressure_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/running.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/stopping.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/title_gf.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/gf/washing_line_state.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/login.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/login_bg.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/login_bg.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/manual.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/normal.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/cv_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/log_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/mv_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/one_long_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/qc_cv_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/qc_mv_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/qcns_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/qcns_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/three_short_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/title_nsyl.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/two_long_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/two_short_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/xl_cv_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/xl_mv_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/xlns_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/xlns_title_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/xlyl_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/xlyl_title_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/nsyl/yl_period_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/cv_variable_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/little_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/mv_variable_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/pc_head.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/pc_log_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/pc_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/pm_head.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/pm_log_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/pm_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/running_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/stopping_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/title_pmpc.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/zb_running_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc/zb_stopping_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/pmpc_checked.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/bucket_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/cv_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/cv_variable_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/data_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/density_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/little_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/log_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/magnetic_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/mv_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/qcfx_head.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx/title_qcfx.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/qcfx_checked.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ses.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/left_open.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/left_retract.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/right_open.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/right_retract.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/title_ylyf.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/上.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/下.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/中.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/压滤排产周期图.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/压风机压力图.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/压风背景.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/压风被控变量跟踪.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/控制变量.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/旋流压滤背景.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/旋流控制变量(MV).png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/旋流浓缩.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/旋流浓缩背景.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/旋流被控变量(CV).png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/日志短背景.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/日志背景.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/日志长背景.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/浅槽控制变量(MV).png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/浅槽浓缩.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/浅槽浓缩背景.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/浅槽被控变量(CV).png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf/被控变量.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/ylyf_checked.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/bucket_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/cv_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/cv_variable_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/data_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/density_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/little_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/log_bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/magnetic_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/mv_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/pressure_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/title_zjfx.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx/zjfx_head.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/zjfx_checked.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/json/customed.json 392 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/json/macarons.json 419 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/json/walden.json 391 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chart/bar-line.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/dict/dict-select-tag.vue 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tag/tag-select.vue 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/i18n/index.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/i18n/zh-CN.js 959 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mixins/view-module.js 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/exportUtil.js 266 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/hostUtil.js 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/jsonUtils.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/mathUtils.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/meta2d.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/numUtil.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/coal-trend-analysis.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/components/analysis-history.vue 208 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/components/product-evaluate.vue 1696 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/components/product-overview.vue 1969 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/img/bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/img/产品煤趋势分析.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/img/仓储可靠性分析.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/img/指标评价体系.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/img/煤质趋势分析.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/img/煤质趋势分析_可选性曲线.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/img/生产指标评价.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/img/生产综合分析.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/index-evaluate-system-add-or-update.vue 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/index-evaluate-system-bak.vue 617 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/index-evaluate-system.vue 333 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/index-evaluate.vue 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/index.vue 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/performance/index.vue 1759 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/process/components/report-view.vue 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/process/components/report.vue 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/process/index.vue 1261 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/prod-index-evaluate-bak.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/prod-index-evaluate.vue 880 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/product-coal-trend-analysis.vue 369 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/product-comprehensive-analysis.vue 579 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/quality/index.vue 1312 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/raw-coal-trend-analysis.vue 349 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/store-dependable-analysis-add-or-update.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/store-dependable-analysis.vue 272 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/update-system-weight.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/analysis/update-weight.vue 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/app/device/main-device-add-or-update.vue 180 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/app/device/main-device.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/app/device/relation-device-add-or-update.vue 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/app/device/relation-device.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/app/electric/send-electric-history-list.vue 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/app/electric/stop-electric-history-list.vue 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/app/until/app-view-module.js 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/components/gf-right-status.vue 363 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/components/nsyl-right-status.vue 495 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/components/pmpc-right-status.vue 358 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/components/qcfx-right-status.vue 496 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/components/run-log.vue 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/components/zjfx-right-status.vue 489 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/gf.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/img/bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/img/gf.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/img/nsyl.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/img/pmpc.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/img/qcfx.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/img/zjfx.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/index.vue 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/nsyl.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/pmpc.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/qcfx.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/control/zjfx.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-app-add-or-update.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-app-grant-api.vue 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-app-limit-setting.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-app-view.vue 220 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-app.vue 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-group-add-or-update.vue 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-group.vue 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-info-add-or-update.vue 176 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-info.vue 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-server-add-or-update.vue 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/apigateway/api-server.vue 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/components/data-tag-chart.vue 382 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/components/data-tag-current.vue 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/kingio-add-or-update.vue 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/kingio-tag-add-or-update.vue 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/kingio-tag.vue 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/kingio.vue 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/modbus-add-or-update.vue 273 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/modbus-tag-add-or-update.vue 231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/modbus-tag.vue 334 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/modbus.vue 327 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/opcda-add-or-update.vue 233 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/opcda-tag-add-or-update.vue 210 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/opcda-tag.vue 284 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/opcda.vue 296 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/opcua-add-or-update.vue 323 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/opcua-tag-add-or-update.vue 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/opcua-tag.vue 304 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/channel/opcua.vue 310 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/out-quality.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/preventive-plan-add-or-update.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/preventive-plan.vue 234 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/prod-plan-month-add-or-update.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/prod-plan-month.vue 199 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/prod-plan-year-add-or-update.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/prod-plan-year.vue 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/prod-quality-bc-add-or-update.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/prod-quality-bc.vue 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/zcxt-plan-month.vue 192 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/coal/zcxt-plan-year.vue 192 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/da/point-add-or-update.vue 611 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/da/point-chart.vue 300 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/da/point-set.vue 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/da/point-view.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/da/point.vue 214 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/http/api-add-or-update.vue 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/http/api.vue 285 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/http/components/data-tag-chart.vue 374 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/http/tags/tag-add-or-update.vue 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/http/tags/tag-current.vue 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/http/tags/tag.vue 311 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/http/token-add-or-update.vue 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/http/token-view.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/http/token.vue 231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/indexdata/clock-add-or-update.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/indexdata/clock.vue 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/indexdata/item-add-or-update.vue 313 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/indexdata/item.vue 266 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/indexdata/value.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/job/schedule-add-or-update.vue 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/job/schedule-log.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/job/schedule.vue 196 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/components/data-tag-chart.vue 382 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/components/data-tag-current.vue 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/modbus-add-or-update.vue 274 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/modbus-tag-add-or-update.vue 231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/modbus-tag.vue 334 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/modbus.vue 319 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/opcda-add-or-update.vue 233 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/opcda-tag-add-or-update.vue 210 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/opcda-tag.vue 284 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/opcda.vue 296 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/opcua-add-or-update.vue 326 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/opcua-tag-add-or-update.vue 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/opcua-tag.vue 304 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/configinfo/opcua.vue 310 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/tags/tag-value.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/oadp/tags/tag.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-data-point-add-or-update.vue 799 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-data-point-chart.vue 284 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-data-point-view.vue 546 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-data-point.vue 507 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-data-source-add-or-update.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-data-source.vue 180 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-data-type-add-or-update.vue 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-data-type.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-min-freq-add-or-update.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-min-freq.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-point-type-add-or-update.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-point-type.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-store-type-add-or-update.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/da-store-type.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/data-device-add-or-update.vue 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/data-device.vue 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/data-jkxt-add-or-update.vue 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/data-jkxt.vue 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/data-point-add-or-update.vue 1114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/data-point-chart.vue 380 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/data-point-view.vue 870 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/point/data-point.vue 435 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/pointrelation/data-point-relation-add-or-update.vue 930 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/pointrelation/data-point-relation-chart.vue 380 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/pointrelation/data-point-relation-view.vue 818 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/data/pointrelation/data-point-relation.vue 434 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/components/decision-evaluate.vue 1024 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-account-add-or-update.vue 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-account-history-add-or-update.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-account-history.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-account.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-breakdown.vue 152 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-fault-add-or-update.vue 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-fault.vue 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-health-alarm-info.vue 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-health-alarm.vue 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-health-evaluate-setting.vue 197 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-health-evaluate.vue 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-monitor.vue 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-plan-time-setting.vue 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/device-trend.vue 276 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/img/bg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/img/设备健康监控.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/img/设备故障库.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/img/设备评价.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/decision/index.vue 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/device/health-evaluate-add-or-update.vue 364 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/device/health-evaluate.vue 214 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/device/health-report-view.vue 267 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/device/health-report.vue 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/home/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/ind/item-add-or-update.vue 218 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/ind/item.vue 191 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/job/schedule-add-or-update.vue 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/job/schedule-log.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/job/schedule.vue 196 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/distribution-curves-chart.vue 226 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/document-add-or-update.vue 243 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/document.vue 578 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/document_bak.vue 581 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/img/model.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/img/model_1.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/img/model_2.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/img/model_all.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/img/文档库.png 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/model-api.vue 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/model-log.vue 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/model.vue 462 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/knowledge/wash-curves-chart.vue 398 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/schedule-add-or-update.vue 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/schedule-log.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/schedule.vue 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-model-add-or-update.vue 539 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-model-doc-add-or-update.vue 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-model-log.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-model.vue 212 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-add-or-update.vue 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-energy-type-add-or-update.vue 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-energy-type.vue 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-model-add-or-update.vue 750 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-model-user-param-chart.vue 225 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-model-user-param.vue 235 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-model.vue 237 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-object-add-or-update.vue 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-object.vue 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-predict-item-add-or-update.vue 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-predict-item.vue 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-user-add-or-update.vue 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule-user.vue 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/mcs/st-schedule.vue 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/components/control-index.vue 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/components/gf.vue 787 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/components/nsyl.vue 1292 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/components/pmpc.vue 1069 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/components/qcfx.vue 1107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/components/run-log.vue 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/components/ylyf-left.vue 617 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/components/ylyf-right.vue 839 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/components/ylyf.vue 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/components/zjfx.vue 1285 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/index.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/meta2d/scada-gf.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/meta2d/scada-nsyl.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/meta2d/scada-pmpc.vue 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/meta2d/scada-qcfx.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/meta2d/scada-ylyf.vue 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/modules/scada/meta2d/scada-zjfx.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/abnormal.png
src/assets/img/automatic.png
src/assets/img/avatar.png
src/assets/img/bg.png
src/assets/img/celogo.png
src/assets/img/gf/cv_variable_title.png
src/assets/img/gf/gf_head.png
src/assets/img/gf/gf_machine_1_title.png
src/assets/img/gf/gf_machine_2_title.png
src/assets/img/gf/log_bg.png
src/assets/img/gf/plan_detail.png
src/assets/img/gf/plan_title.png
src/assets/img/gf/pressure_icon.png
src/assets/img/gf/running.png
src/assets/img/gf/stopping.png
src/assets/img/gf/title_gf.png
src/assets/img/gf/washing_line_state.png
src/assets/img/login.jpg
src/assets/img/login_bg.jpg
src/assets/img/login_bg.svg
对比新文件
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="6395" height="1079"><defs><clipPath id="clip-path"><rect width="6395" height="1079" transform="translate(-5391)" fill="#fff"/></clipPath><linearGradient id="linear-gradient" x1="0.747" y1="0.222" x2="0.973" y2="0.807" gradientUnits="objectBoundingBox"><stop offset="0" stop-color="#2c41b4"/><stop offset="1" stop-color="#1b4fab"/></linearGradient></defs><g id="Mask_Group_1" data-name="Mask Group 1" transform="translate(5391)" clip-path="url(#clip-path)"><g id="Group_118" data-name="Group 118" transform="translate(-419.333 -1.126)"><path id="Path_142" data-name="Path 142" d="M6271.734-6.176s-222.478,187.809-55.349,583.254c44.957,106.375,81.514,205.964,84.521,277,8.164,192.764-156.046,268.564-156.046,268.564l-653.53-26.8L5475.065-21.625Z" transform="translate(-4876.383 0)" fill="#f1f5f8"/><path id="Union_6" data-name="Union 6" d="M-2631.1,1081.8v-1.6H-8230.9V.022H-2631.1V0H-1871.4s-187.845,197.448-91.626,488.844c49.167,148.9,96.309,256.289,104.683,362.118,7.979,100.852-57.98,201.711-168.644,254.286-65.858,31.29-144.552,42.382-223.028,42.383C-2441.2,1147.632-2631.1,1081.8-2631.1,1081.8Z" transform="translate(3259.524 0.803)" fill="url(#linear-gradient)"/></g></g></svg>
src/assets/img/manual.png
src/assets/img/normal.png
src/assets/img/nsyl/cv_title.png
src/assets/img/nsyl/log_bg.png
src/assets/img/nsyl/mv_title.png
src/assets/img/nsyl/one_long_bg.png
src/assets/img/nsyl/qc_cv_title.png
src/assets/img/nsyl/qc_mv_title.png
src/assets/img/nsyl/qcns_bg.png
src/assets/img/nsyl/qcns_title.png
src/assets/img/nsyl/three_short_bg.png
src/assets/img/nsyl/title_nsyl.png
src/assets/img/nsyl/two_long_bg.png
src/assets/img/nsyl/two_short_bg.png
src/assets/img/nsyl/xl_cv_title.png
src/assets/img/nsyl/xl_mv_title.png
src/assets/img/nsyl/xlns_title.png
src/assets/img/nsyl/xlns_title_bg.png
src/assets/img/nsyl/xlyl_title.png
src/assets/img/nsyl/xlyl_title_bg.png
src/assets/img/nsyl/yl_period_title.png
src/assets/img/pmpc.png
src/assets/img/pmpc/cv_variable_bg.png
src/assets/img/pmpc/little_title.png
src/assets/img/pmpc/mv_variable_bg.png
src/assets/img/pmpc/pc_head.png
src/assets/img/pmpc/pc_log_bg.png
src/assets/img/pmpc/pc_title.png
src/assets/img/pmpc/pm_head.png
src/assets/img/pmpc/pm_log_bg.png
src/assets/img/pmpc/pm_title.png
src/assets/img/pmpc/running_bg.png
src/assets/img/pmpc/stopping_bg.png
src/assets/img/pmpc/title_pmpc.png
src/assets/img/pmpc/zb_running_bg.png
src/assets/img/pmpc/zb_stopping_bg.png
src/assets/img/pmpc_checked.png
src/assets/img/qcfx.png
src/assets/img/qcfx/bucket_icon.png
src/assets/img/qcfx/cv_title.png
src/assets/img/qcfx/cv_variable_title.png
src/assets/img/qcfx/data_bg.png
src/assets/img/qcfx/density_icon.png
src/assets/img/qcfx/little_title.png
src/assets/img/qcfx/log_bg.png
src/assets/img/qcfx/magnetic_icon.png
src/assets/img/qcfx/mv_title.png
src/assets/img/qcfx/qcfx_head.png
src/assets/img/qcfx/title_qcfx.png
src/assets/img/qcfx_checked.png
src/assets/img/ses.png
src/assets/img/ylyf.png
src/assets/img/ylyf/left_open.png
src/assets/img/ylyf/left_retract.png
src/assets/img/ylyf/right_open.png
src/assets/img/ylyf/right_retract.png
src/assets/img/ylyf/title_ylyf.png
src/assets/img/ylyf/上.png
src/assets/img/ylyf/下.png
src/assets/img/ylyf/中.png
src/assets/img/ylyf/压滤排产周期图.png
src/assets/img/ylyf/压风机压力图.png
src/assets/img/ylyf/压风背景.png
src/assets/img/ylyf/压风被控变量跟踪.png
src/assets/img/ylyf/控制变量.png
src/assets/img/ylyf/旋流压滤背景.png
src/assets/img/ylyf/旋流控制变量(MV).png
src/assets/img/ylyf/旋流浓缩.png
src/assets/img/ylyf/旋流浓缩背景.png
src/assets/img/ylyf/旋流被控变量(CV).png
src/assets/img/ylyf/日志短背景.png
src/assets/img/ylyf/日志背景.png
src/assets/img/ylyf/日志长背景.png
src/assets/img/ylyf/浅槽控制变量(MV).png
src/assets/img/ylyf/浅槽浓缩.png
src/assets/img/ylyf/浅槽浓缩背景.png
src/assets/img/ylyf/浅槽被控变量(CV).png
src/assets/img/ylyf/被控变量.png
src/assets/img/ylyf_checked.png
src/assets/img/zjfx.png
src/assets/img/zjfx/bucket_icon.png
src/assets/img/zjfx/cv_title.png
src/assets/img/zjfx/cv_variable_title.png
src/assets/img/zjfx/data_bg.png
src/assets/img/zjfx/density_icon.png
src/assets/img/zjfx/little_title.png
src/assets/img/zjfx/log_bg.png
src/assets/img/zjfx/magnetic_icon.png
src/assets/img/zjfx/mv_title.png
src/assets/img/zjfx/pressure_icon.png
src/assets/img/zjfx/title_zjfx.png
src/assets/img/zjfx/zjfx_head.png
src/assets/img/zjfx_checked.png
src/assets/json/customed.json
对比新文件
@@ -0,0 +1,392 @@
{
    "color": [
      "#5470c6",
      "#91cc75",
      "#fac858",
      "#ee6666",
      "#73c0de",
      "#3ba272",
      "#fc8452",
      "#ea7ccc",
      "#9a60b4"
    ],
    "backgroundColor": "rgba(0, 0, 0, 0)",
    "textStyle": {},
    "title": {
        "textStyle": {
            "color": "#464646"
        },
        "subtextStyle": {
            "color": "#6E7079"
        }
    },
    "line": {
        "itemStyle": {
            "borderWidth": 1
        },
        "lineStyle": {
            "width": 2
        },
        "symbolSize": 4,
        "symbol": "emptyCircle",
        "smooth": false
    },
    "radar": {
        "itemStyle": {
            "borderWidth": 1
        },
        "lineStyle": {
            "width": 2
        },
        "symbolSize": 4,
        "symbol": "emptyCircle",
        "smooth": false
    },
    "bar": {
        "itemStyle": {
            "barBorderWidth": 0,
            "barBorderColor": "#ccc"
        }
    },
    "pie": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "scatter": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "boxplot": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "parallel": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "sankey": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "funnel": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "gauge": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "candlestick": {
        "itemStyle": {
            "color": "#eb5454",
            "color0": "#47b262",
            "borderColor": "#eb5454",
            "borderColor0": "#47b262",
            "borderWidth": 1
        }
    },
    "graph": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        },
        "lineStyle": {
            "width": 1,
            "color": "#aaa"
        },
        "symbolSize": 4,
        "symbol": "emptyCircle",
        "smooth": false,
        "color": [
            "#5470c6",
            "#91cc75",
            "#fac858",
            "#ee6666",
            "#73c0de",
            "#3ba272",
            "#fc8452",
            "#9a60b4",
            "#ea7ccc"
        ],
        "label": {
            "color": "#eee"
        }
    },
    "map": {
        "itemStyle": {
            "areaColor": "#eee",
            "borderColor": "#444",
            "borderWidth": 0.5
        },
        "label": {
            "color": "#000"
        },
        "emphasis": {
            "itemStyle": {
                "areaColor": "rgba(255,215,0,0.8)",
                "borderColor": "#444",
                "borderWidth": 1
            },
            "label": {
                "color": "rgb(100,0,0)"
            }
        }
    },
    "geo": {
        "itemStyle": {
            "areaColor": "#eee",
            "borderColor": "#444",
            "borderWidth": 0.5
        },
        "label": {
            "color": "#000"
        },
        "emphasis": {
            "itemStyle": {
                "areaColor": "rgba(255,215,0,0.8)",
                "borderColor": "#444",
                "borderWidth": 1
            },
            "label": {
                "color": "rgb(100,0,0)"
            }
        }
    },
    "categoryAxis": {
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#6E7079"
            }
        },
        "axisTick": {
            "show": true,
            "lineStyle": {
                "color": "#6E7079"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#6E7079"
        },
        "splitLine": {
            "show": false,
            "lineStyle": {
                "color": [
                    "#E0E6F1"
                ]
            }
        },
        "splitArea": {
            "show": false,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.2)",
                    "rgba(210,219,238,0.2)"
                ]
            }
        }
    },
    "valueAxis": {
        "axisLine": {
            "show": false,
            "lineStyle": {
                "color": "#6E7079"
            }
        },
        "axisTick": {
            "show": false,
            "lineStyle": {
                "color": "#6E7079"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#6E7079"
        },
        "splitLine": {
            "show": true,
            "lineStyle": {
                "color": [
                    "#E0E6F1"
                ]
            }
        },
        "splitArea": {
            "show": false,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.2)",
                    "rgba(210,219,238,0.2)"
                ]
            }
        }
    },
    "logAxis": {
        "axisLine": {
            "show": false,
            "lineStyle": {
                "color": "#6E7079"
            }
        },
        "axisTick": {
            "show": false,
            "lineStyle": {
                "color": "#6E7079"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#6E7079"
        },
        "splitLine": {
            "show": true,
            "lineStyle": {
                "color": [
                    "#E0E6F1"
                ]
            }
        },
        "splitArea": {
            "show": false,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.2)",
                    "rgba(210,219,238,0.2)"
                ]
            }
        }
    },
    "timeAxis": {
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#6E7079"
            }
        },
        "axisTick": {
            "show": true,
            "lineStyle": {
                "color": "#6E7079"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#6E7079"
        },
        "splitLine": {
            "show": false,
            "lineStyle": {
                "color": [
                    "#E0E6F1"
                ]
            }
        },
        "splitArea": {
            "show": false,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.2)",
                    "rgba(210,219,238,0.2)"
                ]
            }
        }
    },
    "toolbox": {
        "iconStyle": {
            "borderColor": "#999"
        },
        "emphasis": {
            "iconStyle": {
                "borderColor": "#666"
            }
        }
    },
    "legend": {
        "textStyle": {
            "color": "#333"
        }
    },
    "tooltip": {
        "axisPointer": {
            "lineStyle": {
                "color": "#ccc",
                "width": 1
            },
            "crossStyle": {
                "color": "#ccc",
                "width": 1
            }
        }
    },
    "timeline": {
        "lineStyle": {
            "color": "#DAE1F5",
            "width": 2
        },
        "itemStyle": {
            "color": "#A4B1D7",
            "borderWidth": 1
        },
        "controlStyle": {
            "color": "#A4B1D7",
            "borderColor": "#A4B1D7",
            "borderWidth": 1
        },
        "checkpointStyle": {
            "color": "#316bf3",
            "borderColor": "fff"
        },
        "label": {
            "color": "#A4B1D7"
        },
        "emphasis": {
            "itemStyle": {
                "color": "#FFF"
            },
            "controlStyle": {
                "color": "#A4B1D7",
                "borderColor": "#A4B1D7",
                "borderWidth": 1
            },
            "label": {
                "color": "#A4B1D7"
            }
        }
    },
    "visualMap": {
        "color": [
            "#bf444c",
            "#d88273",
            "#f6efa6"
        ]
    },
    "dataZoom": {
        "handleSize": "undefined%",
        "textStyle": {}
    },
    "markPoint": {
        "label": {
            "color": "#eee"
        },
        "emphasis": {
            "label": {
                "color": "#eee"
            }
        }
    }
}
src/assets/json/macarons.json
对比新文件
@@ -0,0 +1,419 @@
{
    "color": [
        "#2ec7c9",
        "#b6a2de",
        "#5ab1ef",
        "#ffb980",
        "#d87a80",
        "#8d98b3",
        "#e5cf0d",
        "#97b552",
        "#95706d",
        "#dc69aa",
        "#07a2a4",
        "#9a7fd1",
        "#588dd5",
        "#f5994e",
        "#c05050",
        "#59678c",
        "#c9ab00",
        "#7eb00a",
        "#6f5553",
        "#c14089"
    ],
    "backgroundColor": "rgba(0,0,0,0)",
    "textStyle": {},
    "title": {
        "textStyle": {
            "color": "#008acd"
        },
        "subtextStyle": {
            "color": "#aaaaaa"
        }
    },
    "line": {
        "itemStyle": {
            "borderWidth": 1
        },
        "lineStyle": {
            "width": 2
        },
        "symbolSize": 3,
        "symbol": "emptyCircle",
        "smooth": true
    },
    "radar": {
        "itemStyle": {
            "borderWidth": 1
        },
        "lineStyle": {
            "width": 2
        },
        "symbolSize": 3,
        "symbol": "emptyCircle",
        "smooth": true
    },
    "bar": {
        "itemStyle": {
            "barBorderWidth": 0,
            "barBorderColor": "#ccc"
        }
    },
    "pie": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "scatter": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "boxplot": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "parallel": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "sankey": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "funnel": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "gauge": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "candlestick": {
        "itemStyle": {
            "color": "#d87a80",
            "color0": "#2ec7c9",
            "borderColor": "#d87a80",
            "borderColor0": "#2ec7c9",
            "borderWidth": 1
        }
    },
    "graph": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        },
        "lineStyle": {
            "width": 1,
            "color": "#aaaaaa"
        },
        "symbolSize": 3,
        "symbol": "emptyCircle",
        "smooth": true,
        "color": [
            "#2ec7c9",
            "#b6a2de",
            "#5ab1ef",
            "#ffb980",
            "#d87a80",
            "#8d98b3",
            "#e5cf0d",
            "#97b552",
            "#95706d",
            "#dc69aa",
            "#07a2a4",
            "#9a7fd1",
            "#588dd5",
            "#f5994e",
            "#c05050",
            "#59678c",
            "#c9ab00",
            "#7eb00a",
            "#6f5553",
            "#c14089"
        ],
        "label": {
            "color": "#eeeeee"
        }
    },
    "map": {
        "itemStyle": {
            "areaColor": "#dddddd",
            "borderColor": "#eeeeee",
            "borderWidth": 0.5
        },
        "label": {
            "color": "#d87a80"
        },
        "emphasis": {
            "itemStyle": {
                "areaColor": "rgba(254,153,78,1)",
                "borderColor": "#444",
                "borderWidth": 1
            },
            "label": {
                "color": "rgb(100,0,0)"
            }
        }
    },
    "geo": {
        "itemStyle": {
            "areaColor": "#dddddd",
            "borderColor": "#eeeeee",
            "borderWidth": 0.5
        },
        "label": {
            "color": "#d87a80"
        },
        "emphasis": {
            "itemStyle": {
                "areaColor": "rgba(254,153,78,1)",
                "borderColor": "#444",
                "borderWidth": 1
            },
            "label": {
                "color": "rgb(100,0,0)"
            }
        }
    },
    "categoryAxis": {
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#008acd"
            }
        },
        "axisTick": {
            "show": true,
            "lineStyle": {
                "color": "#333"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#333"
        },
        "splitLine": {
            "show": false,
            "lineStyle": {
                "color": [
                    "#eee"
                ]
            }
        },
        "splitArea": {
            "show": false,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.3)",
                    "rgba(200,200,200,0.3)"
                ]
            }
        }
    },
    "valueAxis": {
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#008acd"
            }
        },
        "axisTick": {
            "show": true,
            "lineStyle": {
                "color": "#333"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#333"
        },
        "splitLine": {
            "show": true,
            "lineStyle": {
                "color": [
                    "#eee"
                ]
            }
        },
        "splitArea": {
            "show": true,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.3)",
                    "rgba(200,200,200,0.3)"
                ]
            }
        }
    },
    "logAxis": {
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#008acd"
            }
        },
        "axisTick": {
            "show": true,
            "lineStyle": {
                "color": "#333"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#333"
        },
        "splitLine": {
            "show": true,
            "lineStyle": {
                "color": [
                    "#eee"
                ]
            }
        },
        "splitArea": {
            "show": true,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.3)",
                    "rgba(200,200,200,0.3)"
                ]
            }
        }
    },
    "timeAxis": {
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#008acd"
            }
        },
        "axisTick": {
            "show": true,
            "lineStyle": {
                "color": "#333"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#333"
        },
        "splitLine": {
            "show": true,
            "lineStyle": {
                "color": [
                    "#eee"
                ]
            }
        },
        "splitArea": {
            "show": false,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.3)",
                    "rgba(200,200,200,0.3)"
                ]
            }
        }
    },
    "toolbox": {
        "iconStyle": {
            "borderColor": "#2ec7c9"
        },
        "emphasis": {
            "iconStyle": {
                "borderColor": "#18a4a6"
            }
        }
    },
    "legend": {
        "textStyle": {
            "color": "#333333"
        }
    },
    "tooltip": {
        "axisPointer": {
            "lineStyle": {
                "color": "#008acd",
                "width": "1"
            },
            "crossStyle": {
                "color": "#008acd",
                "width": "1"
            }
        }
    },
    "timeline": {
        "lineStyle": {
            "color": "#008acd",
            "width": 1
        },
        "itemStyle": {
            "color": "#008acd",
            "borderWidth": 1
        },
        "controlStyle": {
            "color": "#008acd",
            "borderColor": "#008acd",
            "borderWidth": 0.5
        },
        "checkpointStyle": {
            "color": "#2ec7c9",
            "borderColor": "#2ec7c9"
        },
        "label": {
            "color": "#008acd"
        },
        "emphasis": {
            "itemStyle": {
                "color": "#a9334c"
            },
            "controlStyle": {
                "color": "#008acd",
                "borderColor": "#008acd",
                "borderWidth": 0.5
            },
            "label": {
                "color": "#008acd"
            }
        }
    },
    "visualMap": {
        "color": [
            "#5ab1ef",
            "#e0ffff"
        ]
    },
    "dataZoom": {
        "backgroundColor": "rgba(47,69,84,0)",
        "dataBackgroundColor": "#efefff",
        "fillerColor": "rgba(182,162,222,0.2)",
        "handleColor": "#008acd",
        "handleSize": "100%",
        "textStyle": {
            "color": "#333333"
        }
    },
    "markPoint": {
        "label": {
            "color": "#eeeeee"
        },
        "emphasis": {
            "label": {
                "color": "#eeeeee"
            }
        }
    }
}
src/assets/json/walden.json
对比新文件
@@ -0,0 +1,391 @@
{
    "color": [
        "#3fb1e3",
        "#6be6c1",
        "#626c91",
        "#a0a7e6",
        "#c4ebad",
        "#96dee8"
    ],
    "backgroundColor": "rgba(252,252,252,0)",
    "textStyle": {},
    "title": {
        "textStyle": {
            "color": "#666666"
        },
        "subtextStyle": {
            "color": "#999999"
        }
    },
    "line": {
        "itemStyle": {
            "borderWidth": "2"
        },
        "lineStyle": {
            "width": "3"
        },
        "symbolSize": "8",
        "symbol": "emptyCircle",
        "smooth": false
    },
    "radar": {
        "itemStyle": {
            "borderWidth": "2"
        },
        "lineStyle": {
            "width": "3"
        },
        "symbolSize": "8",
        "symbol": "emptyCircle",
        "smooth": false
    },
    "bar": {
        "itemStyle": {
            "barBorderWidth": 0,
            "barBorderColor": "#ccc"
        }
    },
    "pie": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "scatter": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "boxplot": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "parallel": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "sankey": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "funnel": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "gauge": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        }
    },
    "candlestick": {
        "itemStyle": {
            "color": "#e6a0d2",
            "color0": "transparent",
            "borderColor": "#e6a0d2",
            "borderColor0": "#3fb1e3",
            "borderWidth": "2"
        }
    },
    "graph": {
        "itemStyle": {
            "borderWidth": 0,
            "borderColor": "#ccc"
        },
        "lineStyle": {
            "width": "1",
            "color": "#cccccc"
        },
        "symbolSize": "8",
        "symbol": "emptyCircle",
        "smooth": false,
        "color": [
            "#3fb1e3",
            "#6be6c1",
            "#626c91",
            "#a0a7e6",
            "#c4ebad",
            "#96dee8"
        ],
        "label": {
            "color": "#ffffff"
        }
    },
    "map": {
        "itemStyle": {
            "areaColor": "#eeeeee",
            "borderColor": "#aaaaaa",
            "borderWidth": 0.5
        },
        "label": {
            "color": "#ffffff"
        },
        "emphasis": {
            "itemStyle": {
                "areaColor": "rgba(63,177,227,0.25)",
                "borderColor": "#3fb1e3",
                "borderWidth": 1
            },
            "label": {
                "color": "#3fb1e3"
            }
        }
    },
    "geo": {
        "itemStyle": {
            "areaColor": "#eeeeee",
            "borderColor": "#aaaaaa",
            "borderWidth": 0.5
        },
        "label": {
            "color": "#ffffff"
        },
        "emphasis": {
            "itemStyle": {
                "areaColor": "rgba(63,177,227,0.25)",
                "borderColor": "#3fb1e3",
                "borderWidth": 1
            },
            "label": {
                "color": "#3fb1e3"
            }
        }
    },
    "categoryAxis": {
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#cccccc"
            }
        },
        "axisTick": {
            "show": false,
            "lineStyle": {
                "color": "#333"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#999999"
        },
        "splitLine": {
            "show": true,
            "lineStyle": {
                "color": [
                    "#eeeeee"
                ]
            }
        },
        "splitArea": {
            "show": false,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.05)",
                    "rgba(200,200,200,0.02)"
                ]
            }
        }
    },
    "valueAxis": {
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#cccccc"
            }
        },
        "axisTick": {
            "show": false,
            "lineStyle": {
                "color": "#333"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#999999"
        },
        "splitLine": {
            "show": true,
            "lineStyle": {
                "color": [
                    "#eeeeee"
                ]
            }
        },
        "splitArea": {
            "show": false,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.05)",
                    "rgba(200,200,200,0.02)"
                ]
            }
        }
    },
    "logAxis": {
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#cccccc"
            }
        },
        "axisTick": {
            "show": false,
            "lineStyle": {
                "color": "#333"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#999999"
        },
        "splitLine": {
            "show": true,
            "lineStyle": {
                "color": [
                    "#eeeeee"
                ]
            }
        },
        "splitArea": {
            "show": false,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.05)",
                    "rgba(200,200,200,0.02)"
                ]
            }
        }
    },
    "timeAxis": {
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#cccccc"
            }
        },
        "axisTick": {
            "show": false,
            "lineStyle": {
                "color": "#333"
            }
        },
        "axisLabel": {
            "show": true,
            "color": "#999999"
        },
        "splitLine": {
            "show": true,
            "lineStyle": {
                "color": [
                    "#eeeeee"
                ]
            }
        },
        "splitArea": {
            "show": false,
            "areaStyle": {
                "color": [
                    "rgba(250,250,250,0.05)",
                    "rgba(200,200,200,0.02)"
                ]
            }
        }
    },
    "toolbox": {
        "iconStyle": {
            "borderColor": "#999999"
        },
        "emphasis": {
            "iconStyle": {
                "borderColor": "#666666"
            }
        }
    },
    "legend": {
        "textStyle": {
            "color": "#999999"
        }
    },
    "tooltip": {
        "axisPointer": {
            "lineStyle": {
                "color": "#cccccc",
                "width": 1
            },
            "crossStyle": {
                "color": "#cccccc",
                "width": 1
            }
        }
    },
    "timeline": {
        "lineStyle": {
            "color": "#626c91",
            "width": 1
        },
        "itemStyle": {
            "color": "#626c91",
            "borderWidth": 1
        },
        "controlStyle": {
            "color": "#626c91",
            "borderColor": "#626c91",
            "borderWidth": 0.5
        },
        "checkpointStyle": {
            "color": "#3fb1e3",
            "borderColor": "#3fb1e3"
        },
        "label": {
            "color": "#626c91"
        },
        "emphasis": {
            "itemStyle": {
                "color": "#626c91"
            },
            "controlStyle": {
                "color": "#626c91",
                "borderColor": "#626c91",
                "borderWidth": 0.5
            },
            "label": {
                "color": "#626c91"
            }
        }
    },
    "visualMap": {
        "color": [
            "#2a99c9",
            "#afe8ff"
        ]
    },
    "dataZoom": {
        "backgroundColor": "rgba(255,255,255,0)",
        "dataBackgroundColor": "rgba(222,222,222,1)",
        "fillerColor": "rgba(114,230,212,0.25)",
        "handleColor": "#cccccc",
        "handleSize": "100%",
        "textStyle": {
            "color": "#999999"
        }
    },
    "markPoint": {
        "label": {
            "color": "#ffffff"
        },
        "emphasis": {
            "label": {
                "color": "#ffffff"
            }
        }
    }
}
src/components/chart/bar-line.vue
对比新文件
@@ -0,0 +1,50 @@
<template>
  <div id="chart" class="chart"></div>
</template>
<script>
  export default {
    name: 'BarLine',
    props: {
      option: Object
    },
    data() {
      return {
        myChart: {}
      }
    },
    mounted() {
      this.myChart = this.$echarts.init(this.$el, 'customed');
      window.addEventListener('resize', this.handleResize);
    },
    watch: {
      option: {
        immediate: true,
        handler() {
          this.initData()
        }
      }
    },
    methods: {
      initData() {
        if (this.option.series) {
          this.myChart.clear()
          this.myChart.setOption(this.option);
        }
      },
      handleResize() {
        if (!this.myChart) return;
        setTimeout(() => {
          this.myChart.resize();
        }, 100)
      },
    }
  }
</script>
<style scoped>
  .chart {
    width: 100%;
    height: 100%;
    min-width: 200px;
    min-height: 200px;
  }
</style>
src/components/dict/dict-select-tag.vue
对比新文件
@@ -0,0 +1,95 @@
<template>
  <el-select :placeholder="getPlaceholder"
             :size="getSize"
             :value="getValueSting"
             @change="handleInput"
             :disabled="getDisabled"
             :clearable="getClearable"
             :multiple="getMultiple">
    <el-option
      v-for="item in dictOptions"
      :key="item.id"
      :label="item.itemText"
      :value="item.itemValue">
    </el-option>
  </el-select>
</template>
<script>
  export default {
    name: 'DictSelectTag',
    props: {
      dictCode: String,
      placeholder: String,
      size: String,
      clearable: Boolean,
      disabled: Boolean,
      multiple: Boolean,
      value: [String, Number, Array]
    },
    data () {
      return {
        dictOptions: []
      }
    },
    watch: {
      dictCode: {
        immediate: true,
        handler () {
          this.initDictData()
        }
      }
    },
    computed: {
      getPlaceholder () {
        return this.placeholder
      },
      getSize () {
        return this.size
      },
      getClearable () {
        return this.clearable
      },
      getDisabled () {
        return this.disabled
      },
      getMultiple () {
        return this.multiple
      },
      getValueSting () {
        let valueString = "";
        valueString = this.value != null ? this.value : undefined
        if (typeof (valueString) === "number") {
          valueString = valueString.toString()
        }
        return valueString;
      }
    },
    methods: {
      initDictData () {
        let allDictItems = JSON.parse(window.localStorage.getItem('DICT_ITEM_MAP'))
        this.dictOptions = []
        let codes = this.dictCode.split(',')
        for (let i = 0; i < codes.length; i ++) {
          if (allDictItems && allDictItems[codes[i]]) {
            this.dictOptions.push(...allDictItems[codes[i]])
          }
        }
      },
      handleInput (e = '') {
        let val
        if (Object.keys(e).includes('target')) {
          val = e.target.value
        } else {
          val = e
        }
        this.$emit('change', val)
        this.$emit('input', val)
      }
    },
    model: {
      prop: 'value',
      event: 'change'
    }
  }
</script>
src/components/tag/tag-select.vue
对比新文件
@@ -0,0 +1,107 @@
<template>
  <el-cascader
      :options="options"
      :value="getValue"
      filterable
      @change="handleInput"
      @active-item-change="handleChange"></el-cascader>
</template>
<script>
  export default {
    name: 'TagSelect',
    props: ['value'],
    data() {
      return {
        options: [],
        path: "",
        newpath: "",
        browseNameMap: {}
      };
    },
    computed: {
      getValue() {
        return this.value != null ? this.value : undefined
      }
    },
    mounted() {
      this.initData(this.path);
    },
    methods: {
      initData(path) {
        this.$http
          .get("/iailab-ntt-data/oadp/tag/list", {params: {path}})
          .then(({data: res}) => {
            if (res.data && res.data.length > 0) {
              res.data.forEach(function (item) {
                this.browseNameMap[item.id] = item.browseName
              }, this)
            }
            const data = res.data.map((data) => {
              return {
                label: data.name,
                value: data.id,
                leaf: !data.isFolder,
                children: [],
              };
            });
            this.options = data;
          });
      },
      handleChange(value) {
        let newpath;
        for (let i = 0; i < value.length; i++) { // 当选中某一级时,重新加载数据,以防path重复拼接
          if (i === 0) {
            newpath = this.browseNameMap[value[0]];
          } else {
            newpath = this.path + "/" + this.browseNameMap[value[i]];
          }
        }
        (this.path = newpath), this.lastLoad(newpath, value);
      },
      lastLoad(path, value) {
        let browseName = this.browseNameMap[value]
        this.$http
          .get("/iailab-ntt-data/oadp/tag/list", {params: {path}})
          .then(({data: res}) => {
            if (res.data && res.data.length > 0) {
              res.data.forEach(function (item) {
                this.browseNameMap[item.id] = item.browseName
              }, this)
            }
            const data = res.data.map((data) => {
              return {
                label: data.name,
                value: data.id,
                leaf: !data.isFolder,
                children: !data.isFolder ? null : [],
              };
            });
            let currentOption = this.options;
            for (let i = 0; i < value.length - 1; i++) {
              currentOption = currentOption.find(
                (option) => option.value === value[i]
              ).children;
            }
            currentOption.find(
              (option) => option.value === value[value.length - 1]
            ).children = data;
          });
      },
      handleInput(e) {
        let val = []
        if (Object.keys(e).includes('target')) {
          val = e.target.value
        } else {
          val = e
        }
        this.$emit('change', val)
        this.$emit('input', val)
      }
    },
    model: {
      prop: 'value',
      event: 'change'
    }
  };
</script>
src/i18n/index.js
对比新文件
@@ -0,0 +1,20 @@
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import Cookies from 'js-cookie'
import zhCNLocale from 'element-ui/lib/locale/lang/zh-CN'
import zhCN from './zh-CN'
Vue.use(VueI18n)
export const messages = {
  'zh-CN': {
    '_lang': '简体中文',
    ...zhCN,
    ...zhCNLocale
  }
}
export default new VueI18n({
  locale: Cookies.get('language') || 'zh-CN',
  messages
})
src/i18n/zh-CN.js
对比新文件
@@ -0,0 +1,959 @@
const t = {}
t.loading = '加载中...'
t.brand = {}
t.brand.lg = ''
t.brand.mini = ''
t.brand.alg = '柠条塔选煤厂生产管理平台'
t.add = '新增'
t.delete = '删除'
t.view = '详情'
t.deleteBatch = '删除'
t.update = '修改'
t.query = '查询'
t.export = '导出'
t.handle = '操作'
t.confirm = '确定'
t.cancel = '取消'
t.clear = '清除'
t.logout = '退出'
t.manage = '处理'
t.createDate = '创建时间'
t.keyword = '关键字:'
t.choose = '请选择'
t.info = '详情'
t.edit = '编辑'
t.refresh = '刷新'
t.save = '保存'
t.index = '序号'
t.read = '标为已读'
t.cheack = '确认'
t.downloadTemplate = '下载模板'
t.prompt = {}
t.prompt.title = '提示'
t.prompt.info = '确定进行[{handle}]操作?'
t.prompt.success = '操作成功'
t.prompt.failed = '操作失败'
t.prompt.deleteBatch = '请选择删除项'
t.validate = {}
t.validate.required = '必填项不能为空'
t.validate.format = '{attr}格式错误'
t.upload = {}
t.upload.text = '将文件拖到此处,或<em>点击上传</em>'
t.upload.tip = '只支持{format}格式文件!'
t.upload.button = '点击上传'
t.datePicker = {}
t.datePicker.range = '至'
t.datePicker.start = '开始日期'
t.datePicker.end = '结束日期'
t.datePicker.date = '日期'
t.fullscreen = {}
t.fullscreen.prompt = '您的浏览器不支持此操作'
t.updatePassword = {}
t.updatePassword.title = '修改密码'
t.updatePassword.username = '账号'
t.updatePassword.password = '原密码'
t.updatePassword.newPassword = '新密码'
t.updatePassword.confirmPassword = '确认密码'
t.updatePassword.validate = {}
t.updatePassword.validate.confirmPassword = '确认密码与新密码输入不一致'
t.contentTabs = {}
t.contentTabs.closeCurrent = '关闭当前标签页'
t.contentTabs.closeOther = '关闭其它标签页'
t.contentTabs.closeAll = '关闭全部标签页'
t.enableStatus1 = '启用'
t.enableStatus0 = '禁用'
t.enableBatch = '批量启用'
t.disableBatch = '批量禁用'
/* 页面 */
t.notFound = {}
t.notFound.desc = '抱歉!您访问的页面<em>失联</em>啦...'
t.notFound.back = '上一页'
t.notFound.home = '首页'
t.login = {}
t.login.title = '登录'
t.login.username = '用户名'
t.login.password = '密码'
t.login.captcha = '验证码'
t.login.demo = ''
t.login.copyright = ''
t.schedule = {}
t.schedule.beanName = 'bean名称'
t.schedule.beanNameTips = 'spring bean名称, 如: testTask'
t.schedule.pauseBatch = '暂停'
t.schedule.resumeBatch = '恢复'
t.schedule.runBatch = '执行'
t.schedule.log = '日志列表'
t.schedule.params = '参数'
t.schedule.cronExpression = 'cron表达式'
t.schedule.cronExpressionTips = '如: 0 0 12 * * ?'
t.schedule.remark = '备注'
t.schedule.status = '状态'
t.schedule.status0 = '暂停'
t.schedule.status1 = '正常'
t.schedule.statusLog0 = '失败'
t.schedule.statusLog1 = '成功'
t.schedule.pause = '暂停'
t.schedule.resume = '恢复'
t.schedule.run = '执行'
t.schedule.jobId = '任务ID'
t.schedule.times = '耗时(单位: 毫秒)'
t.schedule.createDate = '执行时间'
t.oss = {}
t.oss.config = '云存储配置'
t.oss.upload = '上传文件'
t.oss.url = 'URL地址'
t.oss.createDate = '创建时间'
t.oss.type = '类型'
t.oss.type1 = '七牛'
t.oss.type2 = '阿里云'
t.oss.type3 = '腾讯云'
t.oss.qiniuDomain = '域名'
t.oss.qiniuDomainTips = '七牛绑定的域名'
t.oss.qiniuPrefix = '路径前缀'
t.oss.qiniuPrefixTips = '不设置默认为空'
t.oss.qiniuAccessKey = 'AccessKey'
t.oss.qiniuAccessKeyTips = '七牛AccessKey'
t.oss.qiniuSecretKey = 'SecretKey'
t.oss.qiniuSecretKeyTips = '七牛SecretKey'
t.oss.qiniuBucketName = '空间名'
t.oss.qiniuBucketNameTips = '七牛存储空间名'
t.oss.aliyunDomain = '域名'
t.oss.aliyunDomainTips = '阿里云绑定的域名,如:http://cdn.renren.io'
t.oss.aliyunPrefix = '路径前缀'
t.oss.aliyunPrefixTips = '不设置默认为空'
t.oss.aliyunEndPoint = 'EndPoint'
t.oss.aliyunEndPointTips = '阿里云EndPoint'
t.oss.aliyunAccessKeyId = 'AccessKeyId'
t.oss.aliyunAccessKeyIdTips = '阿里云AccessKeyId'
t.oss.aliyunAccessKeySecret = 'AccessKeySecret'
t.oss.aliyunAccessKeySecretTips = '阿里云AccessKeySecret'
t.oss.aliyunBucketName = 'BucketName'
t.oss.aliyunBucketNameTips = '阿里云BucketName'
t.oss.qcloudDomain = '域名'
t.oss.qcloudDomainTips = '腾讯云绑定的域名'
t.oss.qcloudPrefix = '路径前缀'
t.oss.qcloudPrefixTips = '不设置默认为空'
t.oss.qcloudAppId = 'AppId'
t.oss.qcloudAppIdTips = '腾讯云AppId'
t.oss.qcloudSecretId = 'SecretId'
t.oss.qcloudSecretIdTips = '腾讯云SecretId'
t.oss.qcloudSecretKey = 'SecretKey'
t.oss.qcloudSecretKeyTips = '腾讯云SecretKey'
t.oss.qcloudBucketName = 'BucketName'
t.oss.qcloudBucketNameTips = '腾讯云BucketName'
t.oss.qcloudRegion = '所属地区'
t.oss.qcloudRegionTips = '请选择'
t.oss.qcloudRegionBeijing1 = '北京一区(华北)'
t.oss.qcloudRegionBeijing = '北京'
t.oss.qcloudRegionShanghai = '上海(华东)'
t.oss.qcloudRegionGuangzhou = '广州(华南)'
t.oss.qcloudRegionChengdu = '成都(西南)'
t.oss.qcloudRegionChongqing = '重庆'
t.oss.qcloudRegionSingapore = '新加坡'
t.oss.qcloudRegionHongkong = '香港'
t.oss.qcloudRegionToronto = '多伦多'
t.oss.qcloudRegionFrankfurt = '法兰克福'
t.dept = {}
t.dept.name = '名称'
t.dept.parentName = '上级部门'
t.dept.sort = '排序'
t.dept.parentNameDefault = '一级部门'
t.dept.chooseerror = '请选择部门'
t.dept.title = '选择部门'
t.dict = {}
t.dict.dictName = '字典名称'
t.dict.dictType = '字典类型'
t.dict.dictLabel = '字典标签'
t.dict.dictValue = '字典值'
t.dict.sort = '排序'
t.dict.remark = '备注'
t.dict.createDate = '创建时间'
t.logError = {}
t.logError.requestUri = '请求URI'
t.logError.requestMethod = '请求方式'
t.logError.requestParams = '请求参数'
t.logError.ip = '操作IP'
t.logError.userAgent = '用户代理'
t.logError.createDate = '创建时间'
t.logError.errorInfo = '异常信息'
t.logLogin = {}
t.logLogin.creatorName = '用户名'
t.logLogin.status = '状态'
t.logLogin.status0 = '失败'
t.logLogin.status1 = '成功'
t.logLogin.status2 = '账号已锁定'
t.logLogin.operation = '操作类型'
t.logLogin.operation0 = '登录'
t.logLogin.operation1 = '退出'
t.logLogin.ip = '操作IP'
t.logLogin.userAgent = 'User-Agent'
t.logLogin.createDate = '创建时间'
t.logOperation = {}
t.logOperation.status = '状态'
t.logOperation.status0 = '失败'
t.logOperation.status1 = '成功'
t.logOperation.creatorName = '用户名'
t.logOperation.operation = '用户操作'
t.logOperation.requestUri = '请求URI'
t.logOperation.requestMethod = '请求方式'
t.logOperation.requestParams = '请求参数'
t.logOperation.requestTime = '请求时长'
t.logOperation.ip = '操作IP'
t.logOperation.userAgent = 'User-Agent'
t.logOperation.createDate = '创建时间'
t.menu = {}
t.menu.name = '名称'
t.menu.icon = '图标'
t.menu.type = '类型'
t.menu.type0 = '菜单'
t.menu.type1 = '按钮'
t.menu.sort = '排序'
t.menu.url = '路由'
t.menu.permissions = '授权标识'
t.menu.permissionsTips = '多个用逗号分隔,如:sys:menu:save,sys:menu:update'
t.menu.parentName = '上级菜单'
t.menu.parentNameDefault = '一级菜单'
t.menu.resource = '授权资源'
t.menu.resourceUrl = '资源URL'
t.menu.resourceMethod = '请求方式'
t.menu.resourceAddItem = '添加一项'
t.params = {}
t.params.paramCode = '编码'
t.params.paramValue = '值'
t.params.remark = '备注'
t.role = {}
t.role.name = '名称'
t.role.remark = '备注'
t.role.createDate = '创建时间'
t.role.appList = '应用授权'
t.role.menuList = '菜单授权'
t.role.deptList = '数据授权'
t.user = {}
t.user.username = '账号'
t.user.deptName = '所属部门'
t.user.email = '邮箱'
t.user.mobile = '手机号'
t.user.status = '状态'
t.user.status0 = '停用'
t.user.status1 = '正常'
t.user.createDate = '创建时间'
t.user.password = '密码'
t.user.confirmPassword = '确认密码'
t.user.realName = '姓名'
t.user.gender = '性别'
t.user.gender0 = '男'
t.user.gender1 = '女'
t.user.gender2 = '保密'
t.user.roleIdList = '角色配置'
t.user.validate = {}
t.user.validate.confirmPassword = '确认密码与密码输入不一致'
t.user.select = '选择用户'
t.user.selecterror = '请选择一条记录'
t.sysApp = {}
t.sysApp.appCode = '应用代码'
t.sysApp.appName = '应用名称'
t.sysApp.appType = '应用类型'
t.sysApp.trusteeshipType = '托管类型'
t.sysApp.entryUrl = '入口地址'
t.sysApp.insideUrl = '内部地址'
t.sysApp.authType = '认证方式'
t.sysApp.loadType = '加载类型'
t.sysApp.appIntroduction = '应用简介'
t.sysApp.icon = '应用图标'
t.sysApp.orderNum = '排序'
t.sysApp.isShow = '是否显示'
t.sysDict = {}
t.sysDict.type = '字典类型'
t.sysDict.dictName = '字典名称'
t.sysDict.dictCode = '字典编码'
t.sysDict.description = '描述'
t.sysDict.delFlag = '删除状态'
t.sysDictItem = {}
t.sysDictItem.itemText = '字典项文本'
t.sysDictItem.itemValue = '字典项值'
t.sysDictItem.description = '描述'
t.sysDictItem.sortOrder = '排序'
t.sysDictItem.status = '状态'
t.sysDictItem.shortName = '简称'
t.sysDictItem.ext1 = '拓展字段1'
t.sysDictItem.ext2 = '拓展字段2'
t.sysDictItem.ext3 = '拓展字段3'
t.sysDictItem.ext4 = '拓展字段4'
t.sysDictItem.ext5 = '拓展字段5'
t.sysDictItem.ext6 = '拓展字段6'
t.sysDictItem.ext7 = '拓展字段7'
t.sysDictItem.ext8 = '拓展字段8'
t.sysDictItem.ext9 = '拓展字段9'
t.sysDictItem.ext10 = '拓展字段10'
t.taskassig = {}
t.taskassig.startTime = '选择开始时间'
t.taskassig.endTime = '选择结束时间'
t.taskassig.productionAcceptAmount = '待办理生产工单'
t.taskassig.checkFixAcceptAmount = '待办理检修工单'
t.taskassig.tempAcceptAmount = '待办理临时工单'
t.taskassig.allAmount = '全部工单数量'
t.taskassig.completeRate = '完成率'
t.taskassig.orderType = '工单类型'
t.taskassig.orderAmount = '工单数量'
t.taskassig.completeAmount = '完成数量'
t.taskassig.orderTypePlace = '工单类型分布'
t.taskassig.orderRatio = '工单占比'
t.taskassig.configItem = '工单配置项目'
t.taskassig.config = '配置'
t.taskassig.index = '序号'
t.taskassig.equipmentNumber = '设备编号'
t.taskassig.equipmentName = '设备名称'
t.taskassig.alarmPlace = '报警场所'
t.taskassig.alarmContent = '报警内容'
t.taskassig.alarmTime = '报警时间'
t.taskassig.acceptBy = '推送对象'
t.taskassig.orderCreateType = '工单创建方式'
t.taskassig.orderCreateStatus = '工单创建状态'
t.taskassig.equipment = '项目'
t.taskassig.safeItem = '安全注意事项'
t.taskassig.sortOrder = '排序'
t.taskassig.description = '描述'
t.taskassig.status = '状态'
t.taskassig.tools = '所需工器具'
t.taskassig.connectEquipment = '相关设备'
t.taskassig.material = '所需材料'
t.taskassig.urgentLevel = '紧急程度'
t.taskassig.sendTo = '推送部门'
t.taskassig.dept = '部门'
t.taskassig.defaultPerson = '负责人(技术人员)'
t.taskassig.defaultAccept = '默认办理人'
t.taskassig.defaultCopy = '默认抄送人'
t.analysis = {}
t.analysis.index = '序号'
t.analysis.code = '流水号'
t.analysis.ny = '年月'
t.analysis.type = '实验类别'
t.analysis.mc = '煤层'
t.analysis.mz = '煤种'
t.analysis.syyp = '实验样品'
t.analysis.fcfa = '浮沉方案'
t.analysis.syrq = '实验日期'
t.analysis.sybz = '实验班组'
t.analysis.syfzr = '实验负责人'
t.analysis.hyy = '化验员'
t.analysis.myzz = '煤样总重'
t.analysis.myzh = '煤样总灰'
t.analysis.myzl = '煤样总硫'
t.analysis.bz = '备注'
t.analysis.creator = '创建人'
t.analysis.createDate = '创建时间'
t.analysis.updater = '修改人'
t.analysis.updateDate = '修改时间'
t.analysis.mdj = '密度级'
t.analysis.zl = '重量(kg)'
t.analysis.cl = '产率(%)'
t.analysis.lf = '硫分(%)'
t.analysis.hf = '灰分(%)'
t.analysis.fwlj = '浮物累计'
t.analysis.cwlj = '沉物累计'
t.analysis.fwljcl = '浮物累计产率'
t.analysis.fwljhf = '浮物累计灰分'
t.analysis.cwljcl = '沉物累计产率'
t.analysis.cwljhf = '沉物累计灰分'
t.washCurves = {}
t.washCurves.bt = '可选性曲线'
t.washCurves.code = '流水号'
t.washCurves.ny = '年月'
t.washCurves.scxt = '生产系统'
t.washCurves.mz = '煤种'
t.washCurves.syyp = '实验样品'
t.washCurves.fcfa = '浮沉方案'
t.washCurves.bz = '备注'
t.washCurves.mdj = '密度级'
t.washCurves.zhlj = '综合累计'
t.washCurves.fwlj = '浮物累计'
t.washCurves.cwlj = '沉物累计'
t.washCurves.cl = '产率(%)'
t.washCurves.hf = '灰分(%)'
t.washCurves.md = '密度'
t.washCurves.hl = '±0.1含量'
t.washCurves.lf = '硫分(%)'
t.washCurves.draw = '开始绘图'
t.washCurves.curvesType = '绘图方法'
t.machine = {}
t.machine.code = '流水号'
t.machine.bz = '备注'
t.machine.creator = '创建人'
t.machine.createDate = '创建时间'
t.machine.updater = '修改人'
t.machine.updateDate = '修改时间'
t.machine.nssb = '浓缩设备'
t.machine.cyrq = '采样日期'
t.machine.jcrq = '检查日期'
t.machine.syry = '试验人员'
t.machine.rlbf = '分浓度%'
t.machine.rlhf = '入料灰分'
t.machine.dl = '底流'
t.machine.dlnd = '浓度g/L'
t.machine.dlbf = '百分浓度%'
t.machine.dlhf = '底流灰分'
t.machine.gyzb = '工艺指标'
t.machine.nsxl = '浓缩效率%'
t.machine.cqxs = '澄清系数Δ'
t.machine.yl = '溢流'
t.machine.ylnd = '浓度g/L'
t.machine.ylbf = '百分浓度%'
t.machine.tssb = '脱水设备'
t.machine.cpwzsf = '产品外在水分%'
t.machine.gtcl = '固体产率%'
t.machine.tsl = '脱水率%'
t.machine.jl = '结论'
t.machine.fuxuan = '浮选'
t.machine.fxsb = '浮选设备'
t.machine.rl = '入料'
t.machine.jm = '精煤'
t.machine.jk = '精矿'
t.machine.wk = '尾矿'
t.machine.fbsfzl = '分步释放资料'
t.machine.fbsfzl05 = '-0.5mm'
t.machine.fxrl = '浮选入料'
t.machine.hf = '灰分%'
t.machine.cl = '产率%'
t.machine.xsfzl = '小筛分资料'
t.machine.fxjm = '浮选精煤'
t.machine.fxwk = '浮选尾矿'
t.machine.sjsc = '实际生产'
t.machine.fjcl = '浮精产率%'
t.machine.pssb = '破碎设备'
t.machine.ggxh = '型号规格'
t.machine.clnl = '处理能力t/h'
t.machine.shej = '设计'
t.machine.shij = '实际'
t.machine.sfzl = '筛分资料'
t.machine.pl = '排料'
t.machine.psld = '破碎粒度d,mm'
t.machine.psldu = '破碎粒度'
t.machine.ldsx = '细粒级粒度上限f,mm'
t.machine.ldsxian = '细粒级粒度上限'
t.machine.rlhl = '入料中含量%'
t.machine.rlhlfdu = 'F+d'
t.machine.rlhlfdl = 'F-d'
t.machine.rlhlffl = 'F-f'
t.machine.plhl = '排料中含量%'
t.machine.plhludu = 'U+d'
t.machine.plhludl = 'U-d'
t.machine.plhlufl = 'U-f'
t.machine.zxsb = '重选设备'
t.machine.ydcp = '一段产品'
t.machine.sybh = '试验编号'
t.machine.sydd = '试验地点'
t.machine.rlhf = '入料灰分%'
t.machine.kxxjs = '可选性计算'
t.machine.llcl = '理论产率%'
t.machine.fxmd = '分选密度kg/L'
t.machine.hl = '±0.1含量%'
t.machine.slxl = '数量效率%'
t.machine.fxxg = '分选效果'
t.machine.jfc = '均方差'
t.machine.knpc = '可能偏差E'
t.machine.cpw = '错配物'
t.machine.dwmd = '等误密度'
t.machine.cxsb = '磁选设备'
t.machine.lx = '类型'
t.machine.rlnd = '入料浓度g/L'
t.machine.dyd = '第一段磁性物含量'
t.machine.ded = '第二段磁性物含量'
t.machine.cxwhsl = '磁性物回收率'
t.machine.cxwhsldy = '第一段'
t.machine.cxwhslde = '第二段'
t.machine.cxwhslzh = '综合'
t.machine.mntcl = '煤泥脱除率%'
t.machine.sfsb = '筛分设备'
t.coalQuality = {}
t.coalQuality.index = '煤质指标'
t.coalQuality.mz = '煤种'
t.qualityPlan = {}
t.qualityPlan.code = '流水号'
t.qualityPlan.sj = '时间'
t.qualityPlan.name = '名称'
t.qualityPlan.createDate = '创建时间'
t.qualityPlan.bz = '备注'
t.qualityPlan.dw = '单位'
t.qualityPlan.mz = '煤种'
t.qualityPlan.cpl = '产品量'
t.qualityPlan.danj = '单价'
t.qualityPlan.hf = '灰分Ad%'
t.qualityPlan.sf = '水分Mt%'
t.qualityPlan.lf = '硫份St,d%'
t.qualityPlan.hff = '挥发分Vdaf%'
t.qualityPlan.nj = '粘结GR.I'
t.qualityPlan.jzc = '胶质层Y(㎜)GR.I'
t.qualityPlan.frl = '发热量(cal/g)'
t.qualityPlan.zs = '中损'
t.qualityPlan.gs = '矸损'
t.qualityPlan.ylmnHf = '压滤煤泥灰分Ad%'
t.qualityPlan.cyd = '采样点'
t.qualityPlan.khzb = '考核指标'
t.qualityPlan.zljh = '质量计划'
t.detection = {}
t.detection.code = '流水号'
t.detection.rq = '日期'
t.detection.bc = '班次'
t.detection.cysj = '采样时间'
t.detection.cyd = '采样点'
t.detection.cysl = '采样数量'
t.detection.cl = '产量'
t.detection.hysj = '化验时间'
t.detection.mz = '煤种'
t.detection.drly = '调入来源'
t.detection.hf = '灰分Ad%'
t.detection.sf = '水分Mt%'
t.detection.lf = '硫份St,d%'
t.detection.hff = '挥发分Vdaf%'
t.detection.nj = '粘结GR.I'
t.detection.jzc = '胶质层Y(㎜)GR.I'
t.detection.frl = '发热量(cal/g)'
t.detection.zs = '中损'
t.detection.gs = '矸损'
t.detection.ylmnHf = '压滤煤泥灰分Ad%'
t.detection.bz = '备注'
t.detection.cxwhl = '磁性物含量'
t.detection.mc = '名称'
t.tailing = {}
t.tailing.code = '流水号'
t.tailing.rq = '日期'
t.tailing.cyd = '采样点'
t.blending = {}
t.blending.code = '流水号'
t.blending.creator = '创建人'
t.blending.createDate = '创建时间'
t.blending.updater = '修改人'
t.blending.updateDate = '修改时间'
t.blending.rq = '日期'
t.blending.pmcs = '配煤参数'
t.blending.pmmb = '配煤目标'
t.blending.pmfa = '配煤方案'
t.blending.yjxg = '预计效果'
t.blending.mz = '煤种'
t.blending.hf = '灰分Ad%'
t.blending.sf = '水分Mt%'
t.blending.lf = '硫份St%'
t.blending.frl = '发热量(cal/g)'
t.blending.pmzj = '配煤总量(t)'
t.blending.jmxqhf = '精煤需求灰分Ad%'
t.blending.kcl = '库存量(t)'
t.blending.clv = '产率%'
t.blending.fxmd = '分选密度(kg/L)'
t.blending.pml = '配煤量(t)'
t.blending.pmbl = '配煤比例(%)'
t.blending.fcsj = '浮沉数据'
t.blending.danj = '单价'
t.blending.saveAndDo = '保存并计算'
t.deviceStopElectric = {}
t.deviceStopElectric.deptName = '申请部门'
t.deviceStopElectric.applyDate = '申请日期'
t.deviceStopElectric.orderId = '停电单号'
// t.startTime = '申请时间'
t.deviceStopElectric.repairName = '检修项目名称'
t.deviceStopElectric.planHour = '计划用时'
t.deviceStopElectric.stopElectricDevice = '主停电设备'
t.deviceStopElectric.stopElectricOtherDevice = '关联停电设备'
t.deviceStopElectric.influenceRange = '影响范围'
t.deviceStopElectric.applyPreson = '停电申请'
t.deviceStopElectric.createDate = '停电申请时间'
t.deviceStopElectric.applyConfirmPreson = '停电申请确认'
t.deviceStopElectric.carryoutPreson = '执行停电'
t.deviceStopElectric.carryoutPresonDate = '执行停电时间'
t.deviceStopElectric.carryoutConfirmPreson = '执行确认人'
t.deviceStopElectric.carryoutCPDate = '执行确认人时间'
t.deviceStopElectric.finishPreson = '完成人'
t.deviceStopElectric.finishPresonDate = '完成人时间'
t.deviceStopElectric.finishConfirmPreson = '完成确认人'
t.deviceStopElectric.finishCPDate = '完成确认人时间'
t.deviceSendElectric = {}
t.deviceSendElectric.deptName = '申请部门'
t.deviceSendElectric.applyDate = '申请日期'
t.deviceSendElectric.orderId = '送电单号'
// t.startTime = '申请时间'
t.deviceSendElectric.repairName = '检修项目名称'
t.deviceSendElectric.planHour = '计划用时'
t.deviceSendElectric.sendElectricDevice = '主送电设备'
t.deviceSendElectric.sendElectricOtherDevice = '关联送电设备'
t.deviceSendElectric.influenceRange = '影响范围'
t.deviceSendElectric.applyPreson = '送电申请'
t.deviceSendElectric.createDate = '送电申请时间'
t.deviceSendElectric.applyConfirmPreson = '送电申请确认'
t.deviceSendElectric.carryoutPreson = '执行送电'
t.deviceSendElectric.carryoutPresonDate = '执行送电时间'
t.deviceSendElectric.carryoutConfirmPreson = '执行确认人'
t.deviceSendElectric.carryoutCPDate = '执行确认人时间'
t.deviceSendElectric.finishPreson = '完成人'
t.deviceSendElectric.finishPresonDate = '完成人时间'
t.deviceSendElectric.finishConfirmPreson = '完成确认人'
t.deviceSendElectric.finishCPDate = '完成确认人时间'
t.deviceMsg = {}
t.deviceMsg.deviceNo = '设备编号'
t.deviceMsg.deviceName = '设备名称'
t.deviceMsg.deptName = '部门名称'
t.deviceMsg.productModel = '产品型号'
t.deviceMsg.deviceArea = '区域'
t.deviceMsg.deviceType = '设备类型'
t.deviceMsg.deviceState = '设备状态'
t.deviceMsg.electricState = '带电状态'
t.deviceMsg.createDate = '创建时间'
t.deviceMsg.remarks = '备注'
t.deviceMsg.deviceState0 = '停用'
t.deviceMsg.deviceState1 = '使用'
t.deviceMsg.electricState0 = '停电'
t.deviceMsg.electricState1 = '送电'
t.deviceMsg.errMessage = '禁止输入中文'
t.relatedDeviceMsg = {}
t.relatedDeviceMsg.deptName = '部门名称'
t.relatedDeviceMsg.hostDevice = '主设备'
t.relatedDeviceMsg.repeatDevice = '子设备'
t.relatedDeviceMsg.createDate = '创建时间'
t.prodDisp = {}
t.prodDisp.index = '调度指标'
t.msgInfo = {}
t.msgInfo.msgType = '类型'
t.msgInfo.title = '标题'
t.msgInfo.content = '消息内容'
t.msgInfo.receiverName = '接收人'
t.msgInfo.senderName = '发送人'
t.msgInfo.sendNum = '发送次数'
t.msgInfo.sendStatus = '状态'
t.msgInfo.sendTime = '发送时间'
t.msgInfo.sendWay = '发送方式'
t.msgInfo.readStatus = '读取状态'
t.msgInfo.businessKey = '业务ID'
t.msgInfo.businessUrl = '业务链接'
t.msgInfo.processInstanceId = '流程ID'
t.msgInfo.appName = '系统名称'
t.alarmInfo = {}
t.alarmInfo.eventTime = '报警时间'
t.alarmInfo.eventType = '类型'
t.alarmInfo.eventLevel = '级别'
t.alarmInfo.content = '警报内容'
t.alarmInfo.srcArea = '区域'
t.alarmInfo.srcDevice = '设备'
t.alarmInfo.srcPerson = '人员'
t.alarmInfo.srcTag = '测点'
t.alarmInfo.ruleId = '规则ID'
t.alarmInfo.isMsg = '消息状态'
t.alarmInfo.isTask = '工单状态'
t.alarmInfo.appKey = '应用Key'
t.alarmInfo.appName = '系统名称'
t.alarmInfo.ruleName = '规则名称'
t.alarmInfo.taskMode = '创建工单方式'
t.alarmInfo.taskReceivers = '工单接收人'
t.alarmInfo.receiverName = '接收人姓名'
t.alarmInfo.receiverDuty = '接收人岗位'
t.alarmInfo.receiverDept = '接收人部门'
t.alarmInfo.pointCode = '测点编码'
t.alarmInfo.pointName = '测点名称'
t.alarmInfo.almLastTime = '报警时间'
t.alarmInfo.almLevel = '报警级别'
t.alarmInfo.almLevelStr = '报警级别名称'
t.alarmInfo.almValue = '报警值'
t.alarmInfo.almCount = '报警次数'
t.alarmInfo.equipmentName = '设备名称'
t.alarmInfo.equipmentCode = '设备编码'
t.appInfo = {}
t.appInfo.appName = '子系统名称'
t.appInfo.appKey = 'AppKey'
t.appInfo.appSecret = 'AppSecret'
t.appInfo.appDesc = '应用描述'
t.appInfo.status = '状态'
t.appInfo.rate = '令牌生成速度'
t.appInfo.capacity = '令牌桶大小'
t.alarmRule = {}
t.alarmRule.ruleName = '规则名称'
t.alarmRule.appKey = 'AppKey'
t.alarmRule.appName = '子系统'
t.alarmRule.eventType = '类型'
t.alarmRule.eventLevel = '级别'
t.alarmRule.srcArea = '区域'
t.alarmRule.srcDevice = '设备'
t.alarmRule.srcPerson = '人员'
t.alarmRule.srcTag = '测点'
t.alarmRule.status = '状态'
t.alarmRule.remark = '备注'
t.taskReceiver = {}
t.taskReceiver.receiverName = '工单接收人'
t.taskReceiver.receiverDuty = '接收人岗位'
t.taskReceiver.receiverDept = '接收人部门'
t.prodParamMc = {}
t.prodParamMc.dictName = '类型'
t.prodParamMc.dictCode = '编号'
t.prodParamMc.description = '描述'
t.prodParamMc.itemText = '名称'
t.prodParamMc.itemValue = '编号'
t.prodParamMc.sortOrder = '排序'
t.prodParamMc.ext1 = '单位'
t.prodParamMc.ext2 = '容量'
t.prodParamMc.ext3 = '煤种'
t.prodParamMz = {}
t.prodParamMz.dictName = '类型'
t.prodParamMz.dictCode = '编号'
t.prodParamMz.description = '描述'
t.prodParamMz.itemText = '名称'
t.prodParamMz.itemValue = '编号'
t.prodParamMz.sortOrder = '排序'
t.power = {}
t.power.applyNo = '申请单编号'
t.power.applyDate = '申请日期'
t.power.applyDept = '申请部门'
t.power.applicant = '申请人'
t.power.planStartTime = '计划开始时间'
t.power.planEndTime = '计划结束时间'
t.power.planUseTime = '计划用时'
t.power.execMode = '执行模式'
t.power.reason = '申请原因'
t.power.influence = '影响范围'
t.power.mainDeviceNo = '停电设备编号'
t.power.mainDeviceName = '停电设备名称'
t.power.fixItemNo = '检修项目编号'
t.power.fixItemName = '检修项目名称'
t.power.lastOperation = '最新操作'
t.power.lastOperationTime = '最新操作时间'
t.power.lastOperator = '最新操作人'
t.power.propTime = '发起时间'
t.power.finishTime = '结束时间'
t.power.status = '状态'
t.power.remark = '备注'
t.power.DeviceNo = '送电设备编号'
t.power.DeviceName = '送电设备名称'
t.pass = '通过'
t.startReview = '开始审核'
t.notPass = '不通过'
t.withdraw = '撤回操作'
t.startTask = '开始作业'
t.taskFinished = '完成作业'
t.procDef = {}
t.procDef.defNo = '编号'
t.procDef.defName = '名称'
t.procDef.taskType = '任务类型'
t.procDef.taskName = '任务名称'
t.procDef.taskRole = '办理人角色'
t.procDef.taskSort = '办理顺序'
t.procDef.assigner = '操作人'
t.procDef.assignTime = '办理时间'
t.hikDevice = {}
t.hikDevice.codeNum = '编号'
t.hikDevice.deviceType = '设备类型'
t.hikDevice.activationStatus = '激活状态'
t.hikDevice.location = '具体位置'
t.hikDevice.ability = '功能'
t.hikDevice.ipAddress = 'IP地址'
t.hikDevice.port = '端口'
t.hikDevice.enhancementPort = '增强型端口'
t.hikDevice.softwareVersion = '软件版本'
t.hikDevice.ipv4Gateway = 'IPv4网关'
t.hikDevice.httpPort = 'HTTP端口'
t.hikDevice.serialNumber = '设备序列号'
t.hikDevice.subnetMask = '子网掩码'
t.hikDevice.physicalAddress = '物理地址'
t.hikDevice.channelNumber = '编码通道数'
t.hikDevice.dspVersion = 'DSP版本'
t.hikDevice.menuRoute = '所属菜单'
t.hikDevice.deviceUsername = '设备用户名'
t.hikDevice.devicePassword = '设备密码'
t.hikDevice.isShow = '是否展示'
t.hikDevice.sort = '排序'
t.outDetection = {}
t.outDetection.jczd = '检查站点'
t.outDetection.cysj = '采样时间'
t.outDetection.sccj = '生产厂家'
t.outDetection.daoz = '到站'
t.outDetection.yongh = '用户'
t.outDetection.pz = '品种'
t.outDetection.ysfs = '运输方式'
t.outDetection.ches = '车数'
t.outDetection.wyl = '外运量(t)'
t.outDetection.qsf = '全水分Mt%'
t.outDetection.hf = '灰分Ad%'
t.outDetection.hff = '挥发分Vdaf%'
t.outDetection.lf = '硫份St,d%'
t.outDetection.nj = '粘结GR.I'
t.outDetection.jzc = '胶质层'
t.outDetection.bz = '备注'
t.outDetection.creator = '创建人'
t.outDetection.createDate = '创建时间'
t.outDetection.updater = '修改人'
t.outDetection.updateDate = '修改时间'
t.washTarget = {}
t.washTarget.ny = '年月'
t.washTarget.mz = '煤种'
t.washTarget.ymdw = '用煤单位'
t.washTarget.cpl = '产品量'
t.model = {}
t.model.modelCode = '模型编码'
t.model.modelName = '模型名称'
t.model.modelType = '模型类型'
t.model.modelParent = '模型父级'
t.model.modelPath = '模型路径'
t.model.className = '类名'
t.model.methodName = '方法名'
t.model.paramsStructure = '参数结构'
t.model.modelLoop = '回路'
t.model.runSort = '执行顺序'
t.model.runTime = '最新运行时间'
t.model.remark = '备注'
t.model.log = '运行日志'
t.model.isEnable = '是否启用'
t.model.modelVersion = '模型版本'
t.model.doc = '模型文档'
t.alarmCamera = {}
t.alarmCamera.cameraId = '摄像头'
t.alarmCamera.cameraCode = '摄像头编码'
t.alarmCamera.point = '监控点位'
t.alarmCamera.location = '监控区域'
t.alarmCamera.alarmStatus = '预警状态'
t.alarmCamera.alarmTime = '预警时间'
t.alarmCamera.alarmMsg = '内容'
t.alarmCamera.alarmTotal = '预警次数统计'
t.device = {}
t.device.runState = '是否健康'
t.device.deviceName = '设备名称'
t.device.deviceCode = '设备代码'
t.device.workShop = '所属车间'
t.device.updateDate = '评价时间'
t.evaluateIndex = {}
t.evaluateIndex.code = '指标编码'
t.evaluateIndex.name = '指标名称'
t.evaluateIndex.weight = '权重'
t.evaluateIndex.isEnable = '是否启用'
t.point = {}
t.point.pointNo = '测点编号'
t.point.pointName = '测点名称'
t.point.pointType = '测点类型'
t.point.dataType = '数据类型'
t.point.unit = '单位'
t.point.unittransfactor = '单位转换'
t.point.defaultValue = '默认值'
t.point.maxValue = '最大值'
t.point.minValue = '最小值'
t.point.sourceType = '数据源类型'
t.point.sourceName = '数据源名称'
t.point.tagNo = 'Tag编号'
t.point.minfreqid = '采集频率'
t.point.remark = '测点描述'
t.point.sourceOption = '数据源'
t.runLog = {}
t.runLog.runTime = '时间'
t.runLog.runType = '类型'
t.runLog.runResult = '结果'
t.indItem = {}
t.indItem.itemNo = '指标编码'
t.indItem.itemName = '指标名称'
t.indItem.itemType = '指标类型'
t.indItem.coefficient = '系数'
t.indItem.precision = '指标精度'
t.indItem.businessType = '业务类型'
t.indItem.timeRange = '时间范围'
t.indItem.timeGranularity = '时间粒度'
t.indItem.remark = '备注'
t.indItem.isEnable = '是否启用'
t.indItem.creator = '创建人'
t.indItem.dataSource = '数据源'
t.indItem.querySql = '查询语句'
t.indItem.expression = 'cron表达式'
t.anyProcReport = {}
t.anyProcReport.procName = '系统名称'
t.anyProcReport.reportName = '报告名称'
t.anyProcReport.reportDate = '报告日期'
t.healthEvaluate = {}
t.healthEvaluate.devId = '设备ID'
t.healthEvaluate.devNo = '设备编号'
t.healthEvaluate.devName = '设备名称'
t.healthEvaluate.modelCode = '评价模型编码'
t.healthEvaluate.modelUrl = '评价模型接口'
t.healthEvaluate.healthLevel = '健康等级'
t.healthEvaluate.healthScore = '健康分数'
t.healthEvaluate.abnormalCount = '异常项目数量'
t.healthEvaluate.reportId = '评价报告ID'
t.healthEvaluate.reportDate = '评价日期'
t.healthEvaluate.isPushed = '自动推送工单'
t.healthEvaluate.isEnable = '是否启用'
t.healthReport = {}
t.healthReport.devNo = '设备编号'
t.healthReport.devName = '设备名称'
t.healthReport.classNo = '分类编号'
t.healthReport.className = '分类名称'
t.healthReport.workshop = '所属车间'
t.healthReport.model = '规格型号'
t.healthReport.reportNo = '报告编号'
t.healthReport.reportName = '报告名称'
t.healthReport.reportDate = '报告日期'
t.healthReport.healthLevel = '健康等级'
t.healthReport.healthScore = '健康分数'
t.healthReport.abnormalCount = '异常项目数量'
t.healthReport.content = '内容'
t.healthReport.modelCode = '评价模型编码'
export default t
src/mixins/view-module.js
对比新文件
@@ -0,0 +1,182 @@
import Cookies from 'js-cookie'
import qs from 'qs'
export default {
  data () {
    /* eslint-disable */
    return {
      // 设置属性
      mixinViewModuleOptions: {
        createdIsNeed: true,       // 此页面是否在创建时,调用查询数据列表接口?
        activatedIsNeed: false,    // 此页面是否在激活(进入)时,调用查询数据列表接口?
        getDataListURL: '',       // 数据列表接口,API地址
        getDataListIsPage: false, // 数据列表接口,是否需要分页?
        deleteURL: '',            // 删除接口,API地址
        deleteIsBatch: false,     // 删除接口,是否需要批量?
        deleteIsBatchKey: 'id',   // 删除接口,批量状态下由那个key进行标记操作?比如:pid,uid...
        exportURL: ''             // 导出接口,API地址
      },
      // 默认属性
      dataForm: {},               // 查询条件
      dataList: [],               // 数据列表
      order: '',                  // 排序,asc/desc
      orderField: '',             // 排序,字段
      page: 1,                    // 当前页码
      limit: 10,                  // 每页数
      total: 0,                   // 总条数
      dataListLoading: false,     // 数据列表,loading状态
      dataListSelections: [],     // 数据列表,多选项
      addOrUpdateVisible: false   // 新增/更新,弹窗visible状态
    }
    /* eslint-enable */
  },
  created () {
    if (this.mixinViewModuleOptions.createdIsNeed) {
      this.query()
    }
  },
  activated () {
    if (this.mixinViewModuleOptions.activatedIsNeed) {
      this.query()
    }
  },
  methods: {
    // 获取数据列表
    query () {
      this.dataListLoading = true
      this.$http.get(
        this.mixinViewModuleOptions.getDataListURL,
        {
          params: {
            order: this.order,
            orderField: this.orderField,
            page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null,
            limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null,
            ...this.dataForm
          }
        }
      ).then(({ code, data, msg }) => {
        this.dataListLoading = false
        if (code !== 0) {
          this.dataList = []
          this.total = 0
          return this.$message.error(msg)
        }
        this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? data.list : data
        this.total = this.mixinViewModuleOptions.getDataListIsPage ? data.total : 0
      }).catch(() => {
        this.dataListLoading = false
      })
    },
    async getInitData () {
      let result = await new Promise((resolve, reject) => {
        this.$http.get(
            this.mixinViewModuleOptions.getDataListURL,
            {
              params: {
                order: this.order,
                orderField: this.orderField,
                page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null,
                limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null,
                ...this.dataForm
              }
            }
        ).then(({ data: res }) => {
          resolve(res)
        })
      })
      return result
    },
    // 多选
    dataListSelectionChangeHandle (val) {
      this.dataListSelections = val
    },
    // 排序
    dataListSortChangeHandle (data) {
      if (!data.order || !data.prop) {
        this.order = ''
        this.orderField = ''
        return false
      }
      this.order = data.order.replace(/ending$/, '')
      this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase()
      this.query()
    },
    // 分页, 每页条数
    pageSizeChangeHandle (val) {
      this.page = 1
      this.limit = val
      this.query()
    },
    // 分页, 当前页
    pageCurrentChangeHandle (val) {
      this.page = val
      this.query()
    },
    getDataList: function () {
      this.page = 1
      this.query()
    },
    // 新增 / 修改
    addOrUpdateHandle (id) {
      this.addOrUpdateVisible = true
      this.$nextTick(() => {
        this.$refs.addOrUpdate.dataForm.id = id
        this.$refs.addOrUpdate.init()
      })
    },
    // 关闭当前窗口
    closeCurrentTab (data) {
      var tabName = this.$store.state.contentTabsActiveName
      this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
      if (this.$store.state.contentTabs.length <= 0) {
        this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'
        return false
      }
      if (tabName === this.$store.state.contentTabsActiveName) {
        this.$router.push({ name: this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1].name })
      }
    },
    // 删除
    deleteHandle (id) {
      if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {
        return this.$message({
          message: this.$t('prompt.deleteBatch'),
          type: 'warning',
          duration: 500
        })
      }
      this.$confirm(this.$t('prompt.info', { 'handle': this.$t('delete') }), this.$t('prompt.title'), {
        confirmButtonText: this.$t('confirm'),
        cancelButtonText: this.$t('cancel'),
        type: 'warning'
      }).then(() => {
        this.$http.delete(
          `${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id}`,
          this.mixinViewModuleOptions.deleteIsBatch ? {
            'data': id ? [id] : this.dataListSelections.map(item => item[this.mixinViewModuleOptions.deleteIsBatchKey])
          } : {}
        ).then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.$message({
            message: this.$t('prompt.success'),
            type: 'success',
            duration: 500,
            onClose: () => {
              this.query()
            }
          })
        }).catch(() => {})
      }).catch(() => {})
    },
    // 导出
    exportHandle () {
      var params = qs.stringify({
        'token': Cookies.get('token'),
        ...this.dataForm
      })
      window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}`
    }
  }
}
src/utils/exportUtil.js
对比新文件
@@ -0,0 +1,266 @@
import XLSX from 'xlsx-style'
// 默认工作簿配置
const defaultWorkBook = {
    bookType: 'xlsx',
    bookSST: false,
    type: 'binary',
}
// 默认样式配置
const borderAll = {
    top: {
        style: 'thin',
    },
    bottom: {
        style: 'thin',
    },
    left: {
        style: 'thin',
    },
    right: {
        style: 'thin',
    },
}
const defaultCellStyle = {
    // 表头区域样式配置
    headerStyle: {
        border: borderAll,
        font: { name: '宋体', sz: 11, italic: false, underline: false, bold: true },
        alignment: { vertical: 'center', horizontal: 'center' },
        fill: { fgColor: { rgb: 'FFFFFF' } },
    },
    // 内容区域样式配置
    dataStyle: {
        border: borderAll,
        font: { name: '宋体', sz: 11, italic: false, underline: false },
        alignment: { vertical: 'center', horizontal: 'left', wrapText: true },
        fill: { fgColor: { rgb: 'FFFFFF' } },
    },
}
function exportByDom(dom, workBookConfig = defaultWorkBook, fileName = '未命名') {
    // 设置头部
    let header = []
    let workSheetConfig = {
        merges: []
    }
    dom.$children.forEach(obj => {
        let dataIndex = obj.type === 'index' ? 'index' : obj.prop
        if (dataIndex && obj.label) {
            header.push({line: 1, title: obj.label, dataIndex: dataIndex, width: obj.realWidth})
        } else if (obj.label && obj.$children.length > 0) {
            obj.$children.forEach(childObj => {
                header.push({line: 1, title: obj.label, dataIndex: childObj.prop, width: childObj.realWidth})
            })
        } else if (obj.type === 'expand') {
            header.push({line: 1, title: obj.className, dataIndex: dataIndex, width: 150, type: 'expand'})
        }
    })
    let expandDataIndex = ''
    if (dom.$children.filter(item => item.label && item.$children.length > 0).length > 0) {
        let temp = 0
        dom.$children.forEach(obj => {
            let dataIndex = obj.type === 'index' ? 'index' : obj.prop
            if (dataIndex && obj.label) {
                workSheetConfig.merges.push({ s: { c: temp, r: 0 },e: { c: temp, r: 1 } })
                header.push({line: 2, title: obj.label, dataIndex: dataIndex, width: obj.realWidth})
                temp++
            } else if (obj.label && obj.$children.length > 0) {
                workSheetConfig.merges.push({ s: { c: temp, r: 0 },e: { c: temp + obj.$children.length - 1, r: 0 } })
                temp = temp + obj.$children.length
                obj.$children.forEach(childObj => {
                    header.push({line: 2, title: childObj.label, dataIndex: childObj.prop, width: childObj.realWidth})
                })
            } else if (obj.type === 'expand') {
                workSheetConfig.merges.push({ s: { c: temp, r: 0 },e: { c: temp, r: 1 } })
                header.push({line: 2, title: obj.className, dataIndex: dataIndex, width: 150, type: 'expand'})
                expandDataIndex = dataIndex
                temp++
            }
        })
    }
    // 设置正文
    let dataSource = []
    let tableRowList = Array.from(dom.$el.getElementsByClassName('el-table__row'))
    let size = Array.from(dom.$children).filter(x => x.fixed).length > 0 ? (tableRowList.length / 2) : tableRowList.length
    let tempValue = ''
    for (let i = 0; i < size; i++) {
        let rowItems = Array.from(tableRowList[i].getElementsByClassName('cell'))
        let row = {}
        let tempDataIndex = ''
        header.filter(x => x.line === 1).forEach((obj, index) => {
            if (rowItems.filter(x => x.getElementsByClassName('el-table__expand-icon').length > 0).length > 0) {
                if (index === 0 && obj.type) {
                    let str = rowItems[index + 1].textContent
                    tempValue = str.substring(str.indexOf(':') + 1)
                    row[obj.dataIndex] = ''
                    tempDataIndex = header.filter(x => x.line === 1)[index + 1].dataIndex
                } else {
                    if (tempDataIndex === obj.dataIndex) {
                        row[obj.dataIndex] = ''
                    } else {
                        row[obj.dataIndex] = rowItems[index].textContent
                    }
                }
            } else {
                if (obj.type) {
                    row[obj.dataIndex] = tempValue
                } else {
                    row[obj.dataIndex] = rowItems[index].textContent
                }
            }
        })
        for (let key in row) {
            if (row[key] !== '') {
                dataSource.push(row)
                break
            }
        }
    }
    // 导出结果
    let exportData = [{
        header: header,
        dataSource: dataSource,
        workSheetConfig: workSheetConfig
    }]
    exportExcel(exportData, workBookConfig, fileName)
}
function exportExcel(exportData, workBookConfig = defaultWorkBook, fileName = '未命名') {
    if (!(exportData && exportData.length)) {
        return
    }
    // 定义工作簿对象
    const wb = { SheetNames: [], Sheets: {} }
    exportData.forEach((data, index) => {
        // 处理sheet表头
        let size = data.header.length
        let ifMerge = data.header.filter(x => x.line === 2).length > 0
        const _header = data.header.map((item, i) =>
            Object.assign({}, {
                key: item.dataIndex,
                title: item.title,
                // 定位单元格
                position: item.line === 1 ? getCharCol(i) + 1 : getCharCol(i - size / 2) + 2,
                // 设置表头样式
                s: data.cellConfig && data.cellConfig.headerStyle ? data.cellConfig.headerStyle : defaultCellStyle.headerStyle,
            })
        ).reduce((prev, next) =>
            Object.assign({}, prev, {
                [next.position]: { v: next.title, key: next.key, s: next.s },
            }), {}
        )
        // 处理sheet内容
        const _data = {}
        data.dataSource.forEach((item, i) => {
            data.header.filter(x => x.line === 1).forEach((obj, index) => {
                const key = ifMerge ? getCharCol(index) + (i + 3) : getCharCol(index) + (i + 2)
                const key_t = obj.dataIndex
                _data[key] = {
                    v: item[key_t],
                    s: data.cellConfig && data.cellConfig.dataStyle ? data.cellConfig.dataStyle : defaultCellStyle.dataStyle,
                }
            })
        })
        const output = Object.assign({}, _header, _data)
        const outputPos = Object.keys(output)
        // 设置单元格宽度
        const colWidth = data.header.map(item => { return { wpx: item.width || 80 } })
        const merges = data.workSheetConfig && data.workSheetConfig.merges
        const freeze = data.workSheetConfig && data.workSheetConfig.freeze
        // 处理sheet名
        wb.SheetNames[index] = data.sheetName ? data.sheetName : 'Sheet' + (index + 1)
        // 处理sheet数据
        wb.Sheets[wb.SheetNames[index]] = Object.assign({},
            output, // 导出的内容
            {
                '!ref': `${outputPos[0]}:${outputPos[outputPos.length - 1]}`,
                '!cols': [...colWidth],
                '!merges': merges ? [...merges] : undefined,
                '!freeze': freeze ? [...freeze] : undefined,
            }
        )
    })
    // 转成二进制对象
    const tmpDown = new Blob(
        [s2ab(XLSX.write(wb, workBookConfig))],
        { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }
    )
    let timeStamp = (new Date()).Format('yyyyMMddhhmmss')
    // 下载表格
    downExcel(tmpDown, `${fileName + timeStamp + '.'}${workBookConfig.bookType === 'biff2' ? 'xls' : workBookConfig.bookType}`)
}
/**
 * 生成ASCll值 从A开始
 * @param {*} n
 */
function getCharCol(n) {
    if (n > 25) {
        let s = ''
        let m = 0
        while (n > 0) {
            m = n % 26 + 1
            s = String.fromCharCode(m + 64) + s
            n = (n - m) / 26
        }
        return s
    }
    return String.fromCharCode(65 + n)
}
// 字符串转字符流---转化为二进制的数据流
function s2ab(s) {
    if (typeof ArrayBuffer !== 'undefined') {
        const buf = new ArrayBuffer(s.length)
        const view = new Uint8Array(buf)
        for (let i = 0; i !== s.length; ++i) { view[i] = s.charCodeAt(i) & 0xff }
        return buf
    } else {
        const buf = new Array(s.length)
        for (let i = 0; i !== s.length; ++i) { buf[i] = s.charCodeAt(i) & 0xff }
        return buf
    }
}
function downExcel(obj, fileName) {
    const a_node = document.createElement('a')
    a_node.download = fileName
    // 兼容ie
    if ('msSaveOrOpenBlob' in navigator) {
        window.navigator.msSaveOrOpenBlob(obj, fileName)
    } else {
        // 新的对象URL指向执行的File对象或者是Blob对象.
        a_node.href = URL.createObjectURL(obj)
    }
    a_node.click()
    setTimeout(() => {
        URL.revokeObjectURL(obj)
    }, 100)
}
export {
    exportExcel,
    exportByDom
}
src/utils/hostUtil.js
对比新文件
@@ -0,0 +1,65 @@
export function getHost () {
  let result = 'http://localhost:8999/'
  let host = document.location.host
  if (host && (host.indexOf('localhost') !== -1 || host.indexOf('127.0.0.1') !== -1)) {
    result = `http://${host.substring(0, host.indexOf(':'))}:8999/`
  } else if (host && host.indexOf('192.168.55.179') !== -1) {
    result = `http://${host.substring(0, host.indexOf(':'))}:8999/`
  } else {
    result = `http://${host.substring(0, host.indexOf(':'))}:8999/`
  }
  return result
}
export function getDomin () {
  let result = 'http://localhost:9081/'
  let host = document.location.host
  if (host && (host.indexOf('localhost') !== -1 || host.indexOf('127.0.0.1') !== -1)) {
    result = `http://${host.substring(0, host.indexOf(':'))}:9081/`
  } else if (host && host.indexOf('192.168.55.179') !== -1) {
    result = `http://${host.substring(0, host.indexOf(':'))}:9081/`
  } else {
    result = `http://${host.substring(0, host.indexOf(':'))}:9081/`
  }
  return result
}
export function getPreviewUrl () {
  let result = 'http://localhost:8999/'
  let host = document.location.host
  if (host && (host.indexOf('localhost') !== -1 || host.indexOf('127.0.0.1') !== -1)) {
    result = `http://${host.substring(0, host.indexOf(':'))}:8012/picturesPreview?urls=`
  } else if (host && host.indexOf('192.168.55.179') !== -1) {
    result = `http://${host.substring(0, host.indexOf(':'))}:8012/picturesPreview?urls=`
  } else {
    result = `http://${host.substring(0, host.indexOf(':'))}:8007/picturesPreview?urls=`
  }
  return result
}
export function getFilePreviewUrl () {
  let host = document.location.host
  //let result = `http://${host.substring(0, host.indexOf(':'))}:8012/onlinePreview?url=`
  let result = `http://192.168.55.180:8012/onlinePreview?url=`
  return result
}
export function reWriteUrl (url) {
  let host = document.location.host
  return `http://${host.substring(0, host.indexOf(':'))}:8999/knowledge` + url
}
export function reWriteUrlSVG (url) {
  let host = document.location.host
  return `http://${host.substring(0, host.indexOf(':'))}:8999/svg/` + url
}
export function reWriteUrlStatic (url) {
  let host = document.location.host
  return `http://${host.substring(0, host.indexOf(':'))}:8999/` + url
}
export function reWriteUrlBack (url) {
  let host = document.location.host
  let port = document.location.port
  return `http://${host.substring(0, host.indexOf(':'))}:8001` + url
}
src/utils/jsonUtils.js
对比新文件
@@ -0,0 +1,16 @@
export function stringToJSON (str) {
  if (str == null || str === '') {
    return ''
  }
  let regex0 = /'/g
  let regex1 = /\r\n/g
  let regex3 = /None/g
  let newStr = str.toString()
    .replace(regex3, 'null')
    .replace(regex1, '')
    .replace(regex0, '"')
  // console.log('newStr=' + newStr)
  let jsonObj = JSON.parse(newStr)
  // console.log('jsonObj=' + JSON.stringify(jsonObj))
  return jsonObj
}
src/utils/mathUtils.js
对比新文件
@@ -0,0 +1,7 @@
export function getSeriesData(a = 1, b = 0, length = 0) {
  let result = []
  for (let i = 0; i < length; i++) {
    result.push(Number(a) * i + Number(b))
  }
  return result
}
src/utils/meta2d.js
对比新文件
@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Le5le=t():e.Le5le=t()}(self,(()=>(()=>{var e={176:(e,t,i)=>{var n=i(52);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},540:(e,t,i)=>{var n=i(905),r=i(237),o=i(357),s=function(e){return function(t,i,s){var a,c=n(t),l=r(c.length),h=o(s,l);if(e&&i!=i){for(;l>h;)if((a=c[h++])!=a)return!0}else for(;l>h;h++)if((e||h in c)&&c[h]===i)return e||h||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},79:e=>{var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},81:(e,t,i)=>{var n=i(816),r=i(826),o=i(933),s=i(787);e.exports=function(e,t){for(var i=r(t),a=s.f,c=o.f,l=0;l<i.length;l++){var h=i[l];n(e,h)||a(e,h,c(t,h))}}},762:(e,t,i)=>{var n=i(400),r=i(787),o=i(358);e.exports=n?function(e,t,i){return r.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},358:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},400:(e,t,i)=>{var n=i(229);e.exports=!n((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},635:(e,t,i)=>{var n=i(859),r=i(52),o=n.document,s=r(o)&&r(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},837:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},103:(e,t,i)=>{var n=i(859),r=i(933).f,o=i(762),s=i(487),a=i(333),c=i(81),l=i(541);e.exports=function(e,t){var i,h,d,u,f,p=e.target,v=e.global,x=e.stat;if(i=v?n:x?n[p]||a(p,{}):(n[p]||{}).prototype)for(h in t){if(u=t[h],d=e.noTargetGet?(f=r(i,h))&&f.value:i[h],!l(v?h:p+(x?".":"#")+h,e.forced)&&void 0!==d){if(typeof u==typeof d)continue;c(u,d)}(e.sham||d&&d.sham)&&o(u,"sham",!0),s(i,h,u,e)}}},229:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},379:(e,t,i)=>{var n=i(36);e.exports=n("native-function-to-string",Function.toString)},230:(e,t,i)=>{var n=i(276),r=i(859),o=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e])||o(r[e]):n[e]&&n[e][t]||r[e]&&r[e][t]}},859:(e,t,i)=>{var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||Function("return this")()},816:e=>{var t={}.hasOwnProperty;e.exports=function(e,i){return t.call(e,i)}},977:e=>{e.exports={}},394:(e,t,i)=>{var n=i(400),r=i(229),o=i(635);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},337:(e,t,i)=>{var n=i(229),r=i(79),o="".split;e.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==r(e)?o.call(e,""):Object(e)}:Object},407:(e,t,i)=>{var n,r,o,s=i(694),a=i(859),c=i(52),l=i(762),h=i(816),d=i(399),u=i(977),f=a.WeakMap;if(s){var p=new f,v=p.get,x=p.has,g=p.set;n=function(e,t){return g.call(p,e,t),t},r=function(e){return v.call(p,e)||{}},o=function(e){return x.call(p,e)}}else{var y=d("state");u[y]=!0,n=function(e,t){return l(e,y,t),t},r=function(e){return h(e,y)?e[y]:{}},o=function(e){return h(e,y)}}e.exports={set:n,get:r,has:o,enforce:function(e){return o(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!c(t)||(i=r(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return i}}}},541:(e,t,i)=>{var n=i(229),r=/#|\.prototype\./,o=function(e,t){var i=a[s(e)];return i==l||i!=c&&("function"==typeof t?n(t):!!t)},s=o.normalize=function(e){return String(e).replace(r,".").toLowerCase()},a=o.data={},c=o.NATIVE="N",l=o.POLYFILL="P";e.exports=o},52:e=>{e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},231:e=>{e.exports=!1},694:(e,t,i)=>{var n=i(859),r=i(379),o=n.WeakMap;e.exports="function"==typeof o&&/native code/.test(r.call(o))},787:(e,t,i)=>{var n=i(400),r=i(394),o=i(176),s=i(66),a=Object.defineProperty;t.f=n?a:function(e,t,i){if(o(e),t=s(t,!0),o(i),r)try{return a(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},933:(e,t,i)=>{var n=i(400),r=i(195),o=i(358),s=i(905),a=i(66),c=i(816),l=i(394),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=s(e),t=a(t,!0),l)try{return h(e,t)}catch(e){}if(c(e,t))return o(!r.f.call(e,t),e[t])}},151:(e,t,i)=>{var n=i(140),r=i(837).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},894:(e,t)=>{t.f=Object.getOwnPropertySymbols},140:(e,t,i)=>{var n=i(816),r=i(905),o=i(540).indexOf,s=i(977);e.exports=function(e,t){var i,a=r(e),c=0,l=[];for(i in a)!n(s,i)&&n(a,i)&&l.push(i);for(;t.length>c;)n(a,i=t[c++])&&(~o(l,i)||l.push(i));return l}},195:(e,t)=>{"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},826:(e,t,i)=>{var n=i(230),r=i(151),o=i(894),s=i(176);e.exports=n("Reflect","ownKeys")||function(e){var t=r.f(s(e)),i=o.f;return i?t.concat(i(e)):t}},276:(e,t,i)=>{e.exports=i(859)},487:(e,t,i)=>{var n=i(859),r=i(36),o=i(762),s=i(816),a=i(333),c=i(379),l=i(407),h=l.get,d=l.enforce,u=String(c).split("toString");r("inspectSource",(function(e){return c.call(e)})),(e.exports=function(e,t,i,r){var c=!!r&&!!r.unsafe,l=!!r&&!!r.enumerable,h=!!r&&!!r.noTargetGet;"function"==typeof i&&("string"!=typeof t||s(i,"name")||o(i,"name",t),d(i).source=u.join("string"==typeof t?t:"")),e!==n?(c?!h&&e[t]&&(l=!0):delete e[t],l?e[t]=i:o(e,t,i)):l?e[t]=i:a(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&h(this).source||c.call(this)}))},885:e=>{e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},333:(e,t,i)=>{var n=i(859),r=i(762);e.exports=function(e,t){try{r(n,e,t)}catch(i){n[e]=t}return t}},399:(e,t,i)=>{var n=i(36),r=i(441),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},353:(e,t,i)=>{var n=i(859),r=i(333),o="__core-js_shared__",s=n[o]||r(o,{});e.exports=s},36:(e,t,i)=>{var n=i(231),r=i(353);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.3.5",mode:n?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},357:(e,t,i)=>{var n=i(51),r=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):o(i,t)}},905:(e,t,i)=>{var n=i(337),r=i(885);e.exports=function(e){return n(r(e))}},51:e=>{var t=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:t)(e)}},237:(e,t,i)=>{var n=i(51),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},66:(e,t,i)=>{var n=i(52);e.exports=function(e,t){if(!n(e))return e;var i,r;if(t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!n(r=i.call(e)))return r;if(!t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},441:e=>{var t=0,i=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+i).toString(36)}},173:(e,t,i)=>{i(103)({global:!0},{globalThis:i(859)})},421:(e,t,i)=>{e.exports=function e(t,i,n){function r(s,a){if(!i[s]){if(!t[s]){if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[s]={exports:{}};t[s][0].call(l.exports,(function(e){return r(t[s][1][e]||e)}),l,l.exports,e,t,i,n)}return i[s].exports}for(var o=void 0,s=0;s<n.length;s++)r(n[s]);return r}({1:[function(e,t,n){(function(i,n){(function(){"use strict";const r=e("events").EventEmitter,o=e("./store"),s=e("./topic-alias-recv"),a=e("./topic-alias-send"),c=e("mqtt-packet"),l=e("./default-message-id-provider"),h=e("readable-stream").Writable,d=e("inherits"),u=e("reinterval"),f=e("rfdc/default"),p=e("./validations"),v=e("xtend"),x=e("debug")("mqttjs:client"),g=i?i.nextTick:function(e){setTimeout(e,0)},y=n.setImmediate||function(e){g(e)},m={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0},b=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],w={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function _(e,t){let i;t.properties&&(i=t.properties.topicAlias);let n=t.topic.toString();if(0===n.length){if(void 0===i)return new Error("Unregistered Topic Alias");if(void 0===(n=e.topicAliasSend.getTopicByAlias(i)))return new Error("Unregistered Topic Alias");t.topic=n}i&&delete t.properties.topicAlias}function k(e,t,i){x("sendPacket :: packet: %O",t),x("sendPacket :: emitting `packetsend`"),e.emit("packetsend",t),x("sendPacket :: writing to stream");const n=c.writeToStream(t,e.stream,e.options);x("sendPacket :: writeToStream result %s",n),!n&&i&&i!==A?(x("sendPacket :: handle events on `drain` once through callback."),e.stream.once("drain",i)):i&&(x("sendPacket :: invoking cb"),i())}function T(e,t,i,n){x("storeAndSend :: store packet with cmd %s to outgoingStore",t.cmd);let r,o=t;if("publish"===o.cmd&&(o=f(t),r=_(e,o)))return i&&i(r);e.outgoingStore.put(o,(function(r){if(r)return i&&i(r);n(),k(e,t,i)}))}function A(e){x("nop ::",e)}function S(e,t){let i;const n=this;if(!(this instanceof S))return new S(e,t);for(i in this.options=t||{},m)void 0===this.options[i]?this.options[i]=m[i]:this.options[i]=t[i];x("MqttClient :: options.protocol",t.protocol),x("MqttClient :: options.protocolVersion",t.protocolVersion),x("MqttClient :: options.username",t.username),x("MqttClient :: options.keepalive",t.keepalive),x("MqttClient :: options.reconnectPeriod",t.reconnectPeriod),x("MqttClient :: options.rejectUnauthorized",t.rejectUnauthorized),x("MqttClient :: options.topicAliasMaximum",t.topicAliasMaximum),this.options.clientId="string"==typeof t.clientId?t.clientId:"mqttjs_"+Math.random().toString(16).substr(2,8),x("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===t.protocolVersion&&t.customHandleAcks?t.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=e,this.messageIdProvider=void 0===this.options.messageIdProvider?new l:this.options.messageIdProvider,this.outgoingStore=t.outgoingStore||new o,this.incomingStore=t.incomingStore||new o,this.queueQoSZero=void 0===t.queueQoSZero||t.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,t.topicAliasMaximum>0&&(t.topicAliasMaximum>65535?x("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new s(t.topicAliasMaximum)),this.on("connect",(function(){const e=this.queue;x("connect :: sending queued packets"),function t(){const i=e.shift();x("deliver :: entry %o",i);let r=null;if(!i)return void n._resubscribe();r=i.packet,x("deliver :: call _sendPacket for %o",r);let o=!0;r.messageId&&0!==r.messageId&&(n.messageIdProvider.register(r.messageId)||(o=!1)),o?n._sendPacket(r,(function(e){i.cb&&i.cb(e),t()})):(x("messageId: %d has already used. The message is skipped and removed.",r.messageId),t())}()})),this.on("close",(function(){x("close :: connected set to `false`"),this.connected=!1,x("close :: clearing connackTimer"),clearTimeout(this.connackTimer),x("close :: clearing ping timer"),null!==n.pingTimer&&(n.pingTimer.clear(),n.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),x("close :: calling _setupReconnect"),this._setupReconnect()})),r.call(this),x("MqttClient :: setting up stream"),this._setupStream()}d(S,r),S.prototype._setupStream=function(){const e=this,t=new h,i=c.parser(this.options);let n=null;const r=[];function o(){if(r.length)g(s);else{const e=n;n=null,e()}}function s(){x("work :: getting next packet in queue");const t=r.shift();if(t)x("work :: packet pulled from queue"),e._handlePacket(t,o);else{x("work :: no packets in queue");const e=n;n=null,x("work :: done flag is %s",!!e),e&&e()}}x("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),x("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),i.on("packet",(function(e){x("parser :: on packet push to packets array."),r.push(e)})),t._write=function(e,t,r){n=r,x("writable stream :: parsing buffer"),i.parse(e),s()},x("_setupStream :: pipe stream to writable stream"),this.stream.pipe(t),this.stream.on("error",(function(t){x("streamErrorHandler :: error",t.message),b.includes(t.code)?(x("streamErrorHandler :: emitting error"),e.emit("error",t)):A(t)})),this.stream.on("close",(function(){var t;x("(%s)stream :: on close",e.options.clientId),(t=e.outgoing)&&(x("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(t).forEach((function(e){t[e].volatile&&"function"==typeof t[e].cb&&(t[e].cb(new Error("Connection closed")),delete t[e])}))),x("stream: emit close to MqttClient"),e.emit("close")})),x("_setupStream: sending packet `connect`");const a=Object.create(this.options);if(a.cmd="connect",this.topicAliasRecv&&(a.properties||(a.properties={}),this.topicAliasRecv&&(a.properties.topicAliasMaximum=this.topicAliasRecv.max)),k(this,a),i.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return e.end((()=>this.emit("error",new Error("Packet has no Authentication Method")))),this;this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket&&k(this,v({cmd:"auth",reasonCode:0},this.options.authPacket))}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((function(){x("!!connectTimeout hit!! Calling _cleanUp with force `true`"),e._cleanUp(!0)}),this.options.connectTimeout)},S.prototype._handlePacket=function(e,t){const i=this.options;if(5===i.protocolVersion&&i.properties&&i.properties.maximumPacketSize&&i.properties.maximumPacketSize<e.length)return this.emit("error",new Error("exceeding packets size "+e.cmd)),this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),this;switch(x("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",e),e.cmd){case"publish":this._handlePublish(e,t);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(e),t();break;case"pubrel":this._handlePubrel(e,t);break;case"connack":this._handleConnack(e),t();break;case"auth":this._handleAuth(e),t();break;case"pingresp":this._handlePingresp(e),t();break;case"disconnect":this._handleDisconnect(e),t()}},S.prototype._checkDisconnecting=function(e){return this.disconnecting&&(e&&e!==A?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},S.prototype.publish=function(e,t,i,n){x("publish :: message `%s` to topic `%s`",t,e);const r=this.options;if("function"==typeof i&&(n=i,i=null),i=v({qos:0,retain:!1,dup:!1},i),this._checkDisconnecting(n))return this;const o=this,s=function(){let s=0;if((1===i.qos||2===i.qos)&&null===(s=o._nextId()))return x("No messageId left"),!1;const a={cmd:"publish",topic:e,payload:t,qos:i.qos,retain:i.retain,messageId:s,dup:i.dup};switch(5===r.protocolVersion&&(a.properties=i.properties),x("publish :: qos",i.qos),i.qos){case 1:case 2:o.outgoing[a.messageId]={volatile:!1,cb:n||A},x("MqttClient:publish: packet cmd: %s",a.cmd),o._sendPacket(a,void 0,i.cbStorePut);break;default:x("MqttClient:publish: packet cmd: %s",a.cmd),o._sendPacket(a,n,i.cbStorePut)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,cbStorePut:i.cbStorePut,callback:n}),this},S.prototype.subscribe=function(){const e=this,t=new Array(arguments.length);for(let e=0;e<arguments.length;e++)t[e]=arguments[e];const i=[];let n=t.shift();const r=n.resubscribe;let o=t.pop()||A,s=t.pop();const a=this.options.protocolVersion;delete n.resubscribe,"string"==typeof n&&(n=[n]),"function"!=typeof o&&(s=o,o=A);const c=p.validateTopics(n);if(null!==c)return y(o,new Error("Invalid topic "+c)),this;if(this._checkDisconnecting(o))return x("subscribe: discconecting true"),this;const l={qos:0};if(5===a&&(l.nl=!1,l.rap=!1,l.rh=0),s=v(l,s),Array.isArray(n)?n.forEach((function(t){if(x("subscribe: array topic %s",t),!Object.prototype.hasOwnProperty.call(e._resubscribeTopics,t)||e._resubscribeTopics[t].qos<s.qos||r){const e={topic:t,qos:s.qos};5===a&&(e.nl=s.nl,e.rap=s.rap,e.rh=s.rh,e.properties=s.properties),x("subscribe: pushing topic `%s` and qos `%s` to subs list",e.topic,e.qos),i.push(e)}})):Object.keys(n).forEach((function(t){if(x("subscribe: object topic %s",t),!Object.prototype.hasOwnProperty.call(e._resubscribeTopics,t)||e._resubscribeTopics[t].qos<n[t].qos||r){const e={topic:t,qos:n[t].qos};5===a&&(e.nl=n[t].nl,e.rap=n[t].rap,e.rh=n[t].rh,e.properties=s.properties),x("subscribe: pushing `%s` to subs list",e),i.push(e)}})),!i.length)return o(null,[]),this;const h=function(){const t=e._nextId();if(null===t)return x("No messageId left"),!1;const n={cmd:"subscribe",subscriptions:i,qos:1,retain:!1,dup:!1,messageId:t};if(s.properties&&(n.properties=s.properties),e.options.resubscribe){x("subscribe :: resubscribe true");const t=[];i.forEach((function(i){if(e.options.reconnectPeriod>0){const n={qos:i.qos};5===a&&(n.nl=i.nl||!1,n.rap=i.rap||!1,n.rh=i.rh||0,n.properties=i.properties),e._resubscribeTopics[i.topic]=n,t.push(i.topic)}})),e.messageIdToTopic[n.messageId]=t}return e.outgoing[n.messageId]={volatile:!0,cb:function(e,t){if(!e){const e=t.granted;for(let t=0;t<e.length;t+=1)i[t].qos=e[t]}o(e,i)}},x("subscribe :: call _sendPacket"),e._sendPacket(n),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!h())&&this._storeProcessingQueue.push({invoke:h,callback:o}),this},S.prototype.unsubscribe=function(){const e=this,t=new Array(arguments.length);for(let e=0;e<arguments.length;e++)t[e]=arguments[e];let i=t.shift(),n=t.pop()||A,r=t.pop();"string"==typeof i&&(i=[i]),"function"!=typeof n&&(r=n,n=A);const o=p.validateTopics(i);if(null!==o)return y(n,new Error("Invalid topic "+o)),this;if(e._checkDisconnecting(n))return this;const s=function(){const t=e._nextId();if(null===t)return x("No messageId left"),!1;const o={cmd:"unsubscribe",qos:1,messageId:t};return"string"==typeof i?o.unsubscriptions=[i]:Array.isArray(i)&&(o.unsubscriptions=i),e.options.resubscribe&&o.unsubscriptions.forEach((function(t){delete e._resubscribeTopics[t]})),"object"==typeof r&&r.properties&&(o.properties=r.properties),e.outgoing[o.messageId]={volatile:!0,cb:n},x("unsubscribe: call _sendPacket"),e._sendPacket(o),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,callback:n}),this},S.prototype.end=function(e,t,i){const n=this;function r(){x("end :: (%s) :: finish :: calling _cleanUp with force %s",n.options.clientId,e),n._cleanUp(e,(()=>{x("end :: finish :: calling process.nextTick on closeStores"),g(function(){x("end :: closeStores: closing incoming and outgoing stores"),n.disconnected=!0,n.incomingStore.close((function(e){n.outgoingStore.close((function(t){if(x("end :: closeStores: emitting end"),n.emit("end"),i){const n=e||t;x("end :: closeStores: invoking callback with args"),i(n)}}))})),n._deferredReconnect&&n._deferredReconnect()}.bind(n))}),t)}return x("end :: (%s)",this.options.clientId),null!=e&&"boolean"==typeof e||(i=t||A,t=e,e=!1,"object"!=typeof t&&(i=t,t=null,"function"!=typeof i&&(i=A))),"object"!=typeof t&&(i=t,t=null),x("end :: cb? %s",!!i),i=i||A,this.disconnecting?(i(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(x("end :: (%s) :: calling finish in 10ms once outgoing is empty",n.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,r,10))):(x("end :: (%s) :: immediately calling finish",n.options.clientId),r()),this)},S.prototype.removeOutgoingMessage=function(e){const t=this.outgoing[e]?this.outgoing[e].cb:null;return delete this.outgoing[e],this.outgoingStore.del({messageId:e},(function(){t(new Error("Message removed"))})),this},S.prototype.reconnect=function(e){x("client reconnect");const t=this,i=function(){e?(t.options.incomingStore=e.incomingStore,t.options.outgoingStore=e.outgoingStore):(t.options.incomingStore=null,t.options.outgoingStore=null),t.incomingStore=t.options.incomingStore||new o,t.outgoingStore=t.options.outgoingStore||new o,t.disconnecting=!1,t.disconnected=!1,t._deferredReconnect=null,t._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=i:i(),this},S.prototype._reconnect=function(){x("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end((()=>{this._setupStream()})),x("client already connected. disconnecting first.")):(x("_reconnect: calling _setupStream"),this._setupStream())},S.prototype._setupReconnect=function(){const e=this;!e.disconnecting&&!e.reconnectTimer&&e.options.reconnectPeriod>0?(this.reconnecting||(x("_setupReconnect :: emit `offline` state"),this.emit("offline"),x("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),x("_setupReconnect :: setting reconnectTimer for %d ms",e.options.reconnectPeriod),e.reconnectTimer=setInterval((function(){x("reconnectTimer :: reconnect triggered!"),e._reconnect()}),e.options.reconnectPeriod)):x("_setupReconnect :: doing nothing...")},S.prototype._clearReconnect=function(){x("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},S.prototype._cleanUp=function(e,t){const i=arguments[2];if(t&&(x("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),x("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&(n=this.outgoing)&&(x("flush: queue exists? %b",!!n),Object.keys(n).forEach((function(e){"function"==typeof n[e].cb&&(n[e].cb(new Error("Connection closed")),delete n[e])}))),x("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const e=v({cmd:"disconnect"},i);x("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,y.bind(null,this.stream.end.bind(this.stream)))}var n;this.disconnecting||(x("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(x("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),t&&!this.connected&&(x("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())},S.prototype._sendPacket=function(e,t,i){x("_sendPacket :: (%s) ::  start",this.options.clientId),i=i||A,t=t||A;const n=function(e,t){if(5===e.options.protocolVersion&&"publish"===t.cmd){let i;t.properties&&(i=t.properties.topicAlias);const n=t.topic.toString();if(e.topicAliasSend)if(i){if(0!==n.length&&(x("applyTopicAlias :: register topic: %s - alias: %d",n,i),!e.topicAliasSend.put(n,i)))return x("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,i),new Error("Sending Topic Alias out of range")}else 0!==n.length&&(e.options.autoAssignTopicAlias?(i=e.topicAliasSend.getAliasByTopic(n))?(t.topic="",t.properties={...t.properties,topicAlias:i},x("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",n,i)):(i=e.topicAliasSend.getLruAlias(),e.topicAliasSend.put(n,i),t.properties={...t.properties,topicAlias:i},x("applyTopicAlias :: auto assign topic: %s - alias: %d",n,i)):e.options.autoUseTopicAlias&&(i=e.topicAliasSend.getAliasByTopic(n))&&(t.topic="",t.properties={...t.properties,topicAlias:i},x("applyTopicAlias :: auto use topic: %s - alias: %d",n,i)));else if(i)return x("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,i),new Error("Sending Topic Alias out of range")}}(this,e);if(n)t(n);else{if(!this.connected)return"auth"===e.cmd?(this._shiftPingInterval(),void k(this,e,t)):(x("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,i));switch(this._shiftPingInterval(),e.cmd){case"publish":break;case"pubrel":return void T(this,e,t,i);default:return void k(this,e,t)}switch(e.qos){case 2:case 1:T(this,e,t,i);break;default:k(this,e,t)}x("_sendPacket :: (%s) ::  end",this.options.clientId)}},S.prototype._storePacket=function(e,t,i){x("_storePacket :: packet: %o",e),x("_storePacket :: cb? %s",!!t),i=i||A;let n=e;if("publish"===n.cmd){const i=_(this,n=f(e));if(i)return t&&t(i)}0===(n.qos||0)&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):n.qos>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,(function(e){if(e)return t&&t(e);i()}))):t&&t(new Error("No connection to broker"))},S.prototype._setupPingTimer=function(){x("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);const e=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=u((function(){e._checkPing()}),1e3*this.options.keepalive))},S.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},S.prototype._checkPing=function(){x("_checkPing :: checking ping..."),this.pingResp?(x("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(x("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},S.prototype._handlePingresp=function(){this.pingResp=!0},S.prototype._handleConnack=function(e){x("_handleConnack");const t=this.options,i=5===t.protocolVersion?e.reasonCode:e.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,e.properties){if(e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535)return void this.emit("error",new Error("topicAliasMaximum from broker is out of range"));e.properties.topicAliasMaximum>0&&(this.topicAliasSend=new a(e.properties.topicAliasMaximum))}e.properties.serverKeepAlive&&t.keepalive&&(t.keepalive=e.properties.serverKeepAlive,this._shiftPingInterval()),e.properties.maximumPacketSize&&(t.properties||(t.properties={}),t.properties.maximumPacketSize=e.properties.maximumPacketSize)}if(0===i)this.reconnecting=!1,this._onConnect(e);else if(i>0){const e=new Error("Connection refused: "+w[i]);e.code=i,this.emit("error",e)}},S.prototype._handleAuth=function(e){const t=this.options.protocolVersion,i=5===t?e.reasonCode:e.returnCode;if(5!==t){const e=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+t);return e.code=i,void this.emit("error",e)}const n=this;this.handleAuth(e,(function(e,t){if(e)n.emit("error",e);else if(24===i)n.reconnecting=!1,n._sendPacket(t);else{const t=new Error("Connection refused: "+w[i]);e.code=i,n.emit("error",t)}}))},S.prototype.handleAuth=function(e,t){t()},S.prototype._handlePublish=function(e,t){x("_handlePublish: packet %o",e),t=void 0!==t?t:A;let i=e.topic.toString();const n=e.payload,r=e.qos,o=e.messageId,s=this,a=this.options,c=[0,16,128,131,135,144,145,151,153];if(5===this.options.protocolVersion){let t;if(e.properties&&(t=e.properties.topicAlias),void 0!==t)if(0===i.length){if(!(t>0&&t<=65535))return x("_handlePublish :: topic alias out of range. alias: %d",t),void this.emit("error",new Error("Received Topic Alias is out of range"));{const e=this.topicAliasRecv.getTopicByAlias(t);if(!e)return x("_handlePublish :: unregistered topic alias. alias: %d",t),void this.emit("error",new Error("Received unregistered Topic Alias"));x("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",i=e,t)}}else{if(!this.topicAliasRecv.put(i,t))return x("_handlePublish :: topic alias out of range. alias: %d",t),void this.emit("error",new Error("Received Topic Alias is out of range"));x("_handlePublish :: registered topic: %s - alias: %d",i,t)}}switch(x("_handlePublish: qos %d",r),r){case 2:a.customHandleAcks(i,n,e,(function(i,n){return i instanceof Error||(n=i,i=null),i?s.emit("error",i):-1===c.indexOf(n)?s.emit("error",new Error("Wrong reason code for pubrec")):void(n?s._sendPacket({cmd:"pubrec",messageId:o,reasonCode:n},t):s.incomingStore.put(e,(function(){s._sendPacket({cmd:"pubrec",messageId:o},t)})))}));break;case 1:a.customHandleAcks(i,n,e,(function(r,a){return r instanceof Error||(a=r,r=null),r?s.emit("error",r):-1===c.indexOf(a)?s.emit("error",new Error("Wrong reason code for puback")):(a||s.emit("message",i,n,e),void s.handleMessage(e,(function(e){if(e)return t&&t(e);s._sendPacket({cmd:"puback",messageId:o,reasonCode:a},t)})))}));break;case 0:this.emit("message",i,n,e),this.handleMessage(e,t);break;default:x("_handlePublish: unknown QoS. Doing nothing.")}},S.prototype.handleMessage=function(e,t){t()},S.prototype._handleAck=function(e){const t=e.messageId,i=e.cmd;let n=null;const r=this.outgoing[t]?this.outgoing[t].cb:null,o=this;let s;if(r){switch(x("_handleAck :: packet type",i),i){case"pubcomp":case"puback":{const i=e.reasonCode;i&&i>0&&16!==i&&((s=new Error("Publish error: "+w[i])).code=i,r(s,e)),delete this.outgoing[t],this.outgoingStore.del(e,r),this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue();break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:t};const i=e.reasonCode;i&&i>0&&16!==i?((s=new Error("Publish error: "+w[i])).code=i,r(s,e)):this._sendPacket(n);break}case"suback":delete this.outgoing[t],this.messageIdProvider.deallocate(t);for(let i=0;i<e.granted.length;i++)if(0!=(128&e.granted[i])){const e=this.messageIdToTopic[t];e&&e.forEach((function(e){delete o._resubscribeTopics[e]}))}this._invokeStoreProcessingQueue(),r(null,e);break;case"unsuback":delete this.outgoing[t],this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue(),r(null);break;default:o.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit("outgoingEmpty")}else x("_handleAck :: Server sent an ack in error. Ignoring.")},S.prototype._handlePubrel=function(e,t){x("handling pubrel packet"),t=void 0!==t?t:A;const i=this,n={cmd:"pubcomp",messageId:e.messageId};i.incomingStore.get(e,(function(e,r){e?i._sendPacket(n,t):(i.emit("message",r.topic,r.payload,r),i.handleMessage(r,(function(e){if(e)return t(e);i.incomingStore.del(r,A),i._sendPacket(n,t)})))}))},S.prototype._handleDisconnect=function(e){this.emit("disconnect",e)},S.prototype._nextId=function(){return this.messageIdProvider.allocate()},S.prototype.getLastMessageId=function(){return this.messageIdProvider.getLastAllocated()},S.prototype._resubscribe=function(){x("_resubscribe");const e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||5===this.options.protocolVersion&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){x("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){const i={};i[e[t]]=this._resubscribeTopics[e[t]],i.resubscribe=!0,this.subscribe(i,{properties:i[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1},S.prototype._onConnect=function(e){if(this.disconnected)return void this.emit("connect",e);const t=this;this.connackPacket=e,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0,function i(){let n=t.outgoingStore.createStream();function r(){t._storeProcessing=!1,t._packetIdsDuringStoreProcessing={}}function o(){n.destroy(),n=null,t._flushStoreProcessingQueue(),r()}t.once("close",o),n.on("error",(function(e){r(),t._flushStoreProcessingQueue(),t.removeListener("close",o),t.emit("error",e)})),n.on("end",(function(){let n=!0;for(const e in t._packetIdsDuringStoreProcessing)if(!t._packetIdsDuringStoreProcessing[e]){n=!1;break}n?(r(),t.removeListener("close",o),t._invokeAllStoreProcessingQueue(),t.emit("connect",e)):i()})),function e(){if(!n)return;t._storeProcessing=!0;const i=n.read(1);let r;i?t._packetIdsDuringStoreProcessing[i.messageId]?e():t.disconnecting||t.reconnectTimer?n.destroy&&n.destroy():(r=t.outgoing[i.messageId]?t.outgoing[i.messageId].cb:null,t.outgoing[i.messageId]={volatile:!1,cb:function(t,i){r&&r(t,i),e()}},t._packetIdsDuringStoreProcessing[i.messageId]=!0,t.messageIdProvider.register(i.messageId)?t._sendPacket(i):x("messageId: %d has already used.",i.messageId)):n.once("readable",e)}()}()},S.prototype._invokeStoreProcessingQueue=function(){if(this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1},S.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},S.prototype._flushStoreProcessingQueue=function(){for(const e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},t.exports=S}).call(this)}).call(this,e("_process"),void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-message-id-provider":7,"./store":8,"./topic-alias-recv":9,"./topic-alias-send":10,"./validations":11,_process:50,debug:18,events:22,inherits:24,"mqtt-packet":40,"readable-stream":69,reinterval:70,"rfdc/default":71,xtend:81}],2:[function(e,t,i){"use strict";const{Buffer:n}=e("buffer"),r=e("readable-stream").Transform,o=e("duplexify");let s,a,c,l=!1;t.exports=function(e,t){if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const i="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const h=function(e,t){const i="alis"===e.protocol?"wss":"ws";let n=i+"://"+e.hostname+e.path;return e.port&&80!==e.port&&443!==e.port&&(n=i+"://"+e.hostname+":"+e.port+e.path),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);return(s=t.my).connectSocket({url:h,protocols:i}),a=function(){const e=new r;return e._write=function(e,t,i){s.sendSocketMessage({data:e.buffer,success:function(){i()},fail:function(){i(new Error)}})},e._flush=function(e){s.closeSocket({success:function(){e()}})},e}(),c=o.obj(),l||(l=!0,s.onSocketOpen((function(){c.setReadable(a),c.setWritable(a),c.emit("connect")})),s.onSocketMessage((function(e){if("string"==typeof e.data){const t=n.from(e.data,"base64");a.push(t)}else{const t=new FileReader;t.addEventListener("load",(function(){let e=t.result;e=e instanceof ArrayBuffer?n.from(e):n.from(e,"utf8"),a.push(e)})),t.readAsArrayBuffer(e.data)}})),s.onSocketClose((function(){c.end(),c.destroy()})),s.onSocketError((function(e){c.destroy(e)}))),c}},{buffer:17,duplexify:20,"readable-stream":69}],3:[function(e,t,i){"use strict";const n=e("net"),r=e("debug")("mqttjs:tcp");t.exports=function(e,t){t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost";const i=t.port,o=t.hostname;return r("port %d and host %s",i,o),n.createConnection(i,o)}},{debug:18,net:16}],4:[function(e,t,i){"use strict";const n=e("tls"),r=e("net"),o=e("debug")("mqttjs:tls");t.exports=function(e,t){t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===r.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,o("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);const i=n.connect(t);function s(n){t.rejectUnauthorized&&e.emit("error",n),i.end()}return i.on("secureConnect",(function(){t.rejectUnauthorized&&!i.authorized?i.emit("error",new Error("TLS not authorized")):i.removeListener("error",s)})),i.on("error",s),i}},{debug:18,net:16,tls:16}],5:[function(e,t,n){(function(n){(function(){"use strict";const{Buffer:r}=e("buffer"),o=e("ws"),s=e("debug")("mqttjs:ws"),a=e("duplexify"),c=e("readable-stream").Transform,l=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],h=void 0!==n&&"browser"===n.title||"function"==typeof i;function d(e,t){let i=e.protocol+"://"+e.hostname+":"+e.port+e.path;return"function"==typeof e.transformWsUrl&&(i=e.transformWsUrl(i,e,t)),i}function u(e){const t=e;return e.hostname||(t.hostname="localhost"),e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),h||"wss"!==e.protocol||l.forEach((function(i){Object.prototype.hasOwnProperty.call(e,i)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,i)&&(t.wsOptions[i]=e[i])})),t}t.exports=h?function(e,t){let i;s("browserStreamBuilder");const n=function(e){const t=u(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");const e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=e.port)}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t).browserBufferSize||524288,o=t.browserBufferTimeout||1e3,l=!t.objectMode,h=function(e,t){const i="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",n=d(t,e),r=new WebSocket(n,[i]);return r.binaryType="arraybuffer",r}(e,t),f=function(e,t,i){const n=new c({objectModeMode:e.objectMode});return n._write=t,n._flush=function(e){h.close(),e()},n}(t,(function e(t,i,s){h.bufferedAmount>n&&setTimeout(e,o,t,i,s),l&&"string"==typeof t&&(t=r.from(t,"utf8"));try{h.send(t)}catch(e){return s(e)}s()}));t.objectMode||(f._writev=m),f.on("close",(()=>{h.close()}));const p=void 0!==h.addEventListener;function v(){i.setReadable(f),i.setWritable(f),i.emit("connect")}function x(){i.end(),i.destroy()}function g(e){i.destroy(e)}function y(e){let t=e.data;t=t instanceof ArrayBuffer?r.from(t):r.from(t,"utf8"),f.push(t)}function m(e,t){const i=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?i[t]=r.from(e[t],"utf8"):i[t]=e[t].chunk;this._write(r.concat(i),"binary",t)}return h.readyState===h.OPEN?i=f:(i=i=a(void 0,void 0,t),t.objectMode||(i._writev=m),p?h.addEventListener("open",v):h.onopen=v),i.socket=h,p?(h.addEventListener("close",x),h.addEventListener("error",g),h.addEventListener("message",y)):(h.onclose=x,h.onerror=g,h.onmessage=y),i}:function(e,t){s("streamBuilder");const i=u(t),n=d(i,e),r=function(e,t,i){s("createWebSocket"),s("protocol: "+i.protocolId+" "+i.protocolVersion);const n="MQIsdp"===i.protocolId&&3===i.protocolVersion?"mqttv3.1":"mqtt";return s("creating new Websocket for url: "+t+" and protocol: "+n),new o(t,[n],i.wsOptions)}(0,n,i),a=o.createWebSocketStream(r,i.wsOptions);return a.url=n,r.on("close",(()=>{a.destroy()})),a}}).call(this)}).call(this,e("_process"))},{_process:50,buffer:17,debug:18,duplexify:20,"readable-stream":69,ws:80}],6:[function(e,t,i){"use strict";const{Buffer:n}=e("buffer"),r=e("readable-stream").Transform,o=e("duplexify");let s,a,c;t.exports=function(e,t){if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const i="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const l=function(e,t){const i="wxs"===e.protocol?"wss":"ws";let n=i+"://"+e.hostname+e.path;return e.port&&80!==e.port&&443!==e.port&&(n=i+"://"+e.hostname+":"+e.port+e.path),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);s=wx.connectSocket({url:l,protocols:[i]}),a=function(){const e=new r;return e._write=function(e,t,i){s.send({data:e.buffer,success:function(){i()},fail:function(e){i(new Error(e))}})},e._flush=function(e){s.close({success:function(){e()}})},e}(),(c=o.obj())._destroy=function(e,t){s.close({success:function(){t&&t(e)}})};const h=c.destroy;return c.destroy=function(){c.destroy=h;const e=this;setTimeout((function(){s.close({fail:function(){e._destroy(new Error)}})}),0)}.bind(c),s.onOpen((function(){c.setReadable(a),c.setWritable(a),c.emit("connect")})),s.onMessage((function(e){let t=e.data;t=t instanceof ArrayBuffer?n.from(t):n.from(t,"utf8"),a.push(t)})),s.onClose((function(){c.end(),c.destroy()})),s.onError((function(e){c.destroy(new Error(e.errMsg))})),c}},{buffer:17,duplexify:20,"readable-stream":69}],7:[function(e,t,i){"use strict";function n(){if(!(this instanceof n))return new n;this.nextId=Math.max(1,Math.floor(65535*Math.random()))}n.prototype.allocate=function(){const e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e},n.prototype.getLastAllocated=function(){return 1===this.nextId?65535:this.nextId-1},n.prototype.register=function(e){return!0},n.prototype.deallocate=function(e){},n.prototype.clear=function(){},t.exports=n},{}],8:[function(e,t,i){"use strict";const n=e("xtend"),r=e("readable-stream").Readable,o={objectMode:!0},s={clean:!0};function a(e){if(!(this instanceof a))return new a(e);this.options=e||{},this.options=n(s,e),this._inflights=new Map}a.prototype.put=function(e,t){return this._inflights.set(e.messageId,e),t&&t(),this},a.prototype.createStream=function(){const e=new r(o),t=[];let i=!1,n=0;return this._inflights.forEach((function(e,i){t.push(e)})),e._read=function(){!i&&n<t.length?this.push(t[n++]):this.push(null)},e.destroy=function(){if(i)return;const e=this;i=!0,setTimeout((function(){e.emit("close")}),0)},e},a.prototype.del=function(e,t){return(e=this._inflights.get(e.messageId))?(this._inflights.delete(e.messageId),t(null,e)):t&&t(new Error("missing packet")),this},a.prototype.get=function(e,t){return(e=this._inflights.get(e.messageId))?t(null,e):t&&t(new Error("missing packet")),this},a.prototype.close=function(e){this.options.clean&&(this._inflights=null),e&&e()},t.exports=a},{"readable-stream":69,xtend:81}],9:[function(e,t,i){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.aliasToTopic={},this.max=e}n.prototype.put=function(e,t){return!(0===t||t>this.max||(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,0))},n.prototype.getTopicByAlias=function(e){return this.aliasToTopic[e]},n.prototype.clear=function(){this.aliasToTopic={}},t.exports=n},{}],10:[function(e,t,i){"use strict";const n=e("lru-cache"),r=e("number-allocator").NumberAllocator;function o(e){if(!(this instanceof o))return new o(e);e>0&&(this.aliasToTopic=new n({max:e}),this.topicToAlias={},this.numberAllocator=new r(1,e),this.max=e,this.length=0)}o.prototype.put=function(e,t){if(0===t||t>this.max)return!1;const i=this.aliasToTopic.get(t);return i&&delete this.topicToAlias[i],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.length,!0},o.prototype.getTopicByAlias=function(e){return this.aliasToTopic.get(e)},o.prototype.getAliasByTopic=function(e){const t=this.topicToAlias[e];return void 0!==t&&this.aliasToTopic.get(t),t},o.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},o.prototype.getLruAlias=function(){return this.numberAllocator.firstVacant()||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},t.exports=o},{"lru-cache":37,"number-allocator":46}],11:[function(e,t,i){"use strict";function n(e){const t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}t.exports={validateTopics:function(e){if(0===e.length)return"empty_topic_list";for(let t=0;t<e.length;t++)if(!n(e[t]))return e[t];return null}}},{}],12:[function(e,t,n){(function(n){(function(){"use strict";const r=e("../client"),o=e("../store"),s=e("url"),a=e("xtend"),c=e("debug")("mqttjs"),l={};function h(e,t){if(c("connecting to an MQTT broker..."),"object"!=typeof e||t||(t=e,e=null),t=t||{},e){const i=s.parse(e,!0);if(null!=i.port&&(i.port=Number(i.port)),null===(t=a(i,t)).protocol)throw new Error("Missing protocol");t.protocol=t.protocol.replace(/:$/,"")}if(function(e){let t;e.auth&&((t=e.auth.match(/^(.+):(.+)$/))?(e.username=t[1],e.password=t[2]):e.username=e.auth)}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+t.protocol+'"!')}}if(!l[t.protocol]){const e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((function(t,i){return(!e||i%2!=0)&&"function"==typeof l[t]}))[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);const i=new r((function(e){return t.servers&&(e._reconnectCount&&e._reconnectCount!==t.servers.length||(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),c("calling streambuilder for",t.protocol),l[t.protocol](e,t)}),t);return i.on("error",(function(){})),i}void 0!==n&&"browser"!==n.title||"function"!=typeof i?(l.mqtt=e("./tcp"),l.tcp=e("./tcp"),l.ssl=e("./tls"),l.tls=e("./tls"),l.mqtts=e("./tls")):(l.wx=e("./wx"),l.wxs=e("./wx"),l.ali=e("./ali"),l.alis=e("./ali")),l.ws=e("./ws"),l.wss=e("./ws"),t.exports=h,t.exports.connect=h,t.exports.MqttClient=r,t.exports.Store=o}).call(this)}).call(this,e("_process"))},{"../client":1,"../store":8,"./ali":2,"./tcp":3,"./tls":4,"./ws":5,"./wx":6,_process:50,debug:18,url:76,xtend:81}],13:[function(e,t,i){"use strict";i.byteLength=function(e){var t=l(e),i=t[0],n=t[1];return 3*(i+n)/4-n},i.toByteArray=function(e){var t,i,n=l(e),s=n[0],a=n[1],c=new o(function(e,t,i){return 3*(t+i)/4-i}(0,s,a)),h=0,d=a>0?s-4:s;for(i=0;i<d;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;return 2===a&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,c[h++]=255&t),1===a&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t),c},i.fromByteArray=function(e){for(var t,i=e.length,r=i%3,o=[],s=0,a=i-r;s<a;s+=16383)o.push(h(e,s,s+16383>a?a:s+16383));return 1===r?(t=e[i-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)n[a]=s[a],r[s.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function h(e,t,i){for(var r,o,s=[],a=t;a<i;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=r)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},{}],14:[function(e,t,i){"use strict";const{Buffer:n}=e("buffer"),r=Symbol.for("BufferList");function o(e){if(!(this instanceof o))return new o(e);o._init.call(this,e)}o._init=function(e){Object.defineProperty(this,r,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},o.prototype._new=function(e){return new o(e)},o.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let i=0;i<this._bufs.length;i++){const n=t+this._bufs[i].length;if(e<n||i===this._bufs.length-1)return[i,e-t];t=n}},o.prototype._reverseOffset=function(e){const t=e[0];let i=e[1];for(let e=0;e<t;e++)i+=this._bufs[e].length;return i},o.prototype.get=function(e){if(e>this.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},o.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},o.prototype.copy=function(e,t,i,r){if(("number"!=typeof i||i<0)&&(i=0),("number"!=typeof r||r>this.length)&&(r=this.length),i>=this.length)return e||n.alloc(0);if(r<=0)return e||n.alloc(0);const o=!!e,s=this._offset(i),a=r-i;let c=a,l=o&&t||0,h=s[1];if(0===i&&r===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,l),l+=this._bufs[t].length;return e}if(c<=this._bufs[s[0]].length-h)return o?this._bufs[s[0]].copy(e,t,h,h+c):this._bufs[s[0]].slice(h,h+c);o||(e=n.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){const i=this._bufs[t].length-h;if(!(c>i)){this._bufs[t].copy(e,l,h,h+c),l+=i;break}this._bufs[t].copy(e,l,h),l+=i,c-=i,h&&(h=0)}return e.length>l?e.slice(0,l):e},o.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();const i=this._offset(e),n=this._offset(t),r=this._bufs.slice(i[0],n[0]+1);return 0===n[1]?r.pop():r[r.length-1]=r[r.length-1].slice(0,n[1]),0!==i[1]&&(r[0]=r[0].slice(i[1])),this._new(r)},o.prototype.toString=function(e,t,i){return this.slice(t,i).toString(e)},o.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},o.prototype.duplicate=function(){const e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},o.prototype.append=function(e){if(null==e)return this;if(e.buffer)this._appendBuffer(n.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let t=0;t<e.length;t++)this.append(e[t]);else if(this._isBufferList(e))for(let t=0;t<e._bufs.length;t++)this.append(e._bufs[t]);else"number"==typeof e&&(e=e.toString()),this._appendBuffer(n.from(e));return this},o.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},o.prototype.indexOf=function(e,t,i){if(void 0===i&&"string"==typeof t&&(i=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=n.from([e]):"string"==typeof e?e=n.from(e,i):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=n.from(e.buffer,e.byteOffset,e.byteLength):n.isBuffer(e)||(e=n.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;const r=this._offset(t);let o=r[0],s=r[1];for(;o<this._bufs.length;o++){const t=this._bufs[o];for(;s<t.length;)if(t.length-s>=e.length){const i=t.indexOf(e,s);if(-1!==i)return this._reverseOffset([o,i]);s=t.length-e.length+1}else{const t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}s=0}return-1},o.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let i=0;i<t.length;i++)if(this.get(e+i)!==t[i])return!1;return!0},function(){const e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const t in e)!function(t){o.prototype[t]=null===e[t]?function(e,i){return this.slice(e,e+i)[t](0,i)}:function(i=0){return this.slice(i,i+e[t])[t](0)}}(t)}(),o.prototype._isBufferList=function(e){return e instanceof o||o.isBufferList(e)},o.isBufferList=function(e){return null!=e&&e[r]},t.exports=o},{buffer:17}],15:[function(e,t,i){"use strict";const n=e("readable-stream").Duplex,r=e("inherits"),o=e("./BufferList");function s(e){if(!(this instanceof s))return new s(e);if("function"==typeof e){this._callback=e;const t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",(function(e){e.on("error",t)})),this.on("unpipe",(function(e){e.removeListener("error",t)})),e=null}o._init.call(this,e),n.call(this)}r(s,n),Object.assign(s.prototype,o.prototype),s.prototype._new=function(e){return new s(e)},s.prototype._write=function(e,t,i){this._appendBuffer(e),"function"==typeof i&&i()},s.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},s.prototype.end=function(e){n.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},s.prototype._isBufferList=function(e){return e instanceof s||e instanceof o||s.isBufferList(e)},s.isBufferList=o.isBufferList,t.exports=s,t.exports.BufferListStream=s,t.exports.BufferList=o},{"./BufferList":14,inherits:24,"readable-stream":69}],16:[function(e,t,i){},{}],17:[function(e,t,i){(function(t){(function(){"use strict";var t=e("base64-js"),n=e("ieee754");i.Buffer=s,i.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},i.INSPECT_MAX_BYTES=50;var r=2147483647;function o(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=s.prototype,t}function s(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return a(e,t,i)}function a(e,t,i){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var i=0|u(e,t),n=o(i),r=n.write(e,t);return r!==i&&(n=n.slice(0,r)),n}(e,t);if(ArrayBuffer.isView(e))return h(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer))return function(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i)).__proto__=s.prototype,n}(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return s.from(n,t,i);var r=function(e){if(s.isBuffer(e)){var t=0|d(e.length),i=o(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?"number"!=typeof e.length||j(e.length)?o(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return c(e),o(e<0?0:0|d(e))}function h(e){for(var t=e.length<0?0:0|d(e.length),i=o(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function d(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function u(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return O(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return B(e).length;default:if(r)return n?-1:O(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function p(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),j(i=+i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:v(e,t,i,n,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):v(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function v(e,t,i,n,r){var o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,i/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(r){var h=-1;for(o=i;o<a;o++)if(l(e,o)===l(t,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===c)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(i+c>a&&(i=a-c),o=i;o>=0;o--){for(var d=!0,u=0;u<c;u++)if(l(e,o+u)!==l(t,u)){d=!1;break}if(d)return o}return-1}function x(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(j(a))return s;e[i+s]=a}return s}function g(e,t,i,n){return F(O(t,e.length-i),e,i,n)}function y(e,t,i,n){return F(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function m(e,t,i,n){return y(e,t,i,n)}function b(e,t,i,n){return F(B(t),e,i,n)}function w(e,t,i,n){return F(function(e,t){for(var i,n,r,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(i=e.charCodeAt(s))>>8,r=i%256,o.push(r),o.push(n);return o}(t,e.length-i),e,i,n)}function _(e,i,n){return 0===i&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(i,n))}function k(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var o,s,a,c,l=e[r],h=null,d=l>239?4:l>223?3:l>191?2:1;if(r+d<=i)switch(d){case 1:l<128&&(h=l);break;case 2:128==(192&(o=e[r+1]))&&(c=(31&l)<<6|63&o)>127&&(h=c);break;case 3:o=e[r+1],s=e[r+2],128==(192&o)&&128==(192&s)&&(c=(15&l)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:o=e[r+1],s=e[r+2],a=e[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(h=c)}null===h?(h=65533,d=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),r+=d}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=T));return i}(n)}i.kMaxLength=r,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(e,t,i){return a(e,t,i)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(e,t,i){return function(e,t,i){return c(e),e<=0?o(e):void 0!==t?"string"==typeof i?o(e).fill(t,i):o(e).fill(t):o(e)}(e,t,i)},s.allocUnsafe=function(e){return l(e)},s.allocUnsafeSlow=function(e){return l(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(z(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),z(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,n=t.length,r=0,o=Math.min(i,n);r<o;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=s.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var o=e[i];if(z(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},s.byteLength=u,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):function(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,i);case"utf8":case"utf-8":return k(this,t,i);case"ascii":return A(this,t,i);case"latin1":case"binary":return S(this,t,i);case"base64":return _(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",t=i.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},s.prototype.compare=function(e,t,i,n,r){if(z(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var o=(r>>>=0)-(n>>>=0),a=(i>>>=0)-(t>>>=0),c=Math.min(o,a),l=this.slice(n,r),h=e.slice(t,i),d=0;d<c;++d)if(l[d]!==h[d]){o=l[d],a=h[d];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},s.prototype.indexOf=function(e,t,i){return p(this,e,t,i,!0)},s.prototype.lastIndexOf=function(e,t,i){return p(this,e,t,i,!1)},s.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return x(this,e,t,i);case"utf8":case"utf-8":return g(this,e,t,i);case"ascii":return y(this,e,t,i);case"latin1":case"binary":return m(this,e,t,i);case"base64":return b(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function A(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}function S(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}function P(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=t;o<i;++o)r+=N(e[o]);return r}function C(e,t,i){for(var n=e.slice(t,i),r="",o=0;o<n.length;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}function E(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,i,n,r,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function I(e,t,i,n,r,o){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function L(e,t,i,r,o){return t=+t,i>>>=0,o||I(e,0,i,4),n.write(e,t,i,r,23,4),i+4}function M(e,t,i,r,o){return t=+t,i>>>=0,o||I(e,0,i,8),n.write(e,t,i,r,52,8),i+8}s.prototype.slice=function(e,t){var i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=s.prototype,n},s.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||E(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n},s.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||E(e,t,this.length);for(var n=this[e+--t],r=1;t>0&&(r*=256);)n+=this[e+--t]*r;return n},s.prototype.readUInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||E(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||E(e,t,this.length);for(var n=t,r=1,o=this[e+--n];n>0&&(r*=256);)o+=this[e+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||E(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},s.prototype.readInt16BE=function(e,t){e>>>=0,t||E(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||E(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||E(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||E(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||E(e,8,this.length),n.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,i,n){e=+e,t>>>=0,i>>>=0,n||R(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,o=0;for(this[t]=255&e;++o<i&&(r*=256);)this[t+o]=e/r&255;return t+i},s.prototype.writeUIntBE=function(e,t,i,n){e=+e,t>>>=0,i>>>=0,n||R(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,o=1;for(this[t+r]=255&e;--r>=0&&(o*=256);)this[t+r]=e/o&255;return t+i},s.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var r=Math.pow(2,8*i-1);R(this,e,t,i,r-1,-r)}var o=0,s=1,a=0;for(this[t]=255&e;++o<i&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+i},s.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var r=Math.pow(2,8*i-1);R(this,e,t,i,r-1,-r)}var o=i-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+i},s.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,i){return L(this,e,t,!0,i)},s.prototype.writeFloatBE=function(e,t,i){return L(this,e,t,!1,i)},s.prototype.writeDoubleLE=function(e,t,i){return M(this,e,t,!0,i)},s.prototype.writeDoubleBE=function(e,t,i){return M(this,e,t,!1,i)},s.prototype.copy=function(e,t,i,n){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var r=n-i;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,i,n);else if(this===e&&i<t&&t<n)for(var o=r-1;o>=0;--o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,n),t);return r},s.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var r=e.charCodeAt(0);("utf8"===n&&r<128||"latin1"===n)&&(e=r)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var o;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(o=t;o<i;++o)this[o]=e;else{var a=s.isBuffer(e)?e:s.from(e,n),c=a.length;if(0===c)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-t;++o)this[o+t]=a[o%c]}return this};var D=/[^+/0-9A-Za-z-_]/g;function N(e){return e<16?"0"+e.toString(16):e.toString(16)}function O(e,t){var i;t=t||1/0;for(var n=e.length,r=null,o=[],s=0;s<n;++s){if((i=e.charCodeAt(s))>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function B(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function j(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":13,buffer:17,ieee754:23}],18:[function(e,t,i){(function(n){(function(){i.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;e.splice(1,0,i,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&"%c"===e&&(r=++n)})),e.splice(r,0,i)},i.save=function(e){try{e?i.storage.setItem("debug",e):i.storage.removeItem("debug")}catch(e){}},i.load=function(){let e;try{e=i.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},i.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},i.storage=function(){try{return localStorage}catch(e){}}(),i.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),i.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],i.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(i);const{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":19,_process:50}],19:[function(e,t,i){t.exports=function(t){function i(e){let t,r,o,s=null;function a(...e){if(!a.enabled)return;const n=a,r=Number(new Date),o=r-(t||r);n.diff=o,n.prev=t,n.curr=r,t=r,e[0]=i.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,r)=>{if("%%"===t)return"%";s++;const o=i.formatters[r];if("function"==typeof o){const i=e[s];t=o.call(n,i),e.splice(s,1),s--}return t})),i.formatArgs.call(n,e),(n.log||i.log).apply(n,e)}return a.namespace=e,a.useColors=i.useColors(),a.color=i.selectColor(e),a.extend=n,a.destroy=i.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(r!==i.namespaces&&(r=i.namespaces,o=i.enabled(e)),o),set:e=>{s=e}}),"function"==typeof i.init&&i.init(a),a}function n(e,t){const n=i(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return i.debug=i,i.default=i,i.coerce=function(e){return e instanceof Error?e.stack||e.message:e},i.disable=function(){const e=[...i.names.map(r),...i.skips.map(r).map((e=>"-"+e))].join(",");return i.enable(""),e},i.enable=function(e){let t;i.save(e),i.namespaces=e,i.names=[],i.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(t=0;t<r;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?i.skips.push(new RegExp("^"+e.substr(1)+"$")):i.names.push(new RegExp("^"+e+"$")))},i.enabled=function(e){if("*"===e[e.length-1])return!0;let t,n;for(t=0,n=i.skips.length;t<n;t++)if(i.skips[t].test(e))return!1;for(t=0,n=i.names.length;t<n;t++)if(i.names[t].test(e))return!0;return!1},i.humanize=e("ms"),i.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((e=>{i[e]=t[e]})),i.names=[],i.skips=[],i.formatters={},i.selectColor=function(e){let t=0;for(let i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t|=0;return i.colors[Math.abs(t)%i.colors.length]},i.enable(i.load()),i}},{ms:45}],20:[function(e,t,i){(function(i,n){(function(){var r=e("readable-stream"),o=e("end-of-stream"),s=e("inherits"),a=e("stream-shift"),c=n.from&&n.from!==Uint8Array.from?n.from([0]):new n([0]),l=function(e,t){e._corked?e.once("uncork",t):t()},h=function(e,t){return function(i){i?function(e,t){e._autoDestroy&&e.destroy(t)}(e,"premature close"===i.message?null:i):t&&!e._ended&&e.end()}},d=function(){},u=function(e,t,i){if(!(this instanceof u))return new u(e,t,i);r.Duplex.call(this,i),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!i||!1!==i.autoDestroy,this._forwardDestroy=!i||!1!==i.destroy,this._forwardEnd=!i||!1!==i.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,e&&this.setWritable(e),t&&this.setReadable(t)};s(u,r.Duplex),u.obj=function(e,t,i){return i||(i={}),i.objectMode=!0,i.highWaterMark=16,new u(e,t,i)},u.prototype.cork=function(){1==++this._corked&&this.emit("cork")},u.prototype.uncork=function(){this._corked&&0==--this._corked&&this.emit("uncork")},u.prototype.setWritable=function(e){if(this._unwrite&&this._unwrite(),this.destroyed)e&&e.destroy&&e.destroy();else if(null!==e&&!1!==e){var t=this,n=o(e,{writable:!0,readable:!1},h(this,this._forwardEnd)),r=function(){var e=t._ondrain;t._ondrain=null,e&&e()};this._unwrite&&i.nextTick(r),this._writable=e,this._writable.on("drain",r),this._unwrite=function(){t._writable.removeListener("drain",r),n()},this.uncork()}else this.end()},u.prototype.setReadable=function(e){if(this._unread&&this._unread(),this.destroyed)e&&e.destroy&&e.destroy();else{if(null===e||!1===e)return this.push(null),void this.resume();var t,i=this,n=o(e,{writable:!1,readable:!0},h(this)),s=function(){i._forward()},a=function(){i.push(null)};this._drained=!0,this._readable=e,this._readable2=e._readableState?e:(t=e,new r.Readable({objectMode:!0,highWaterMark:16}).wrap(t)),this._readable2.on("readable",s),this._readable2.on("end",a),this._unread=function(){i._readable2.removeListener("readable",s),i._readable2.removeListener("end",a),n()},this._forward()}},u.prototype._read=function(){this._drained=!0,this._forward()},u.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var e;for(this._forwarding=!0;this._drained&&null!==(e=a(this._readable2));)this.destroyed||(this._drained=this.push(e));this._forwarding=!1}},u.prototype.destroy=function(e,t){if(t||(t=d),this.destroyed)return t(null);this.destroyed=!0;var n=this;i.nextTick((function(){n._destroy(e),t(null)}))},u.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null,t?t(e):this.emit("error",e)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},u.prototype._write=function(e,t,i){if(!this.destroyed)return this._corked?l(this,this._write.bind(this,e,t,i)):e===c?this._finish(i):this._writable?void(!1===this._writable.write(e)?this._ondrain=i:this.destroyed||i()):i()},u.prototype._finish=function(e){var t=this;this.emit("preend"),l(this,(function(){var i,n;n=function(){!1===t._writableState.prefinished&&(t._writableState.prefinished=!0),t.emit("prefinish"),l(t,e)},(i=t._forwardEnd&&t._writable)?i._writableState&&i._writableState.finished?n():i._writableState?i.end(n):(i.end(),n()):n()}))},u.prototype.end=function(e,t,i){return"function"==typeof e?this.end(null,null,e):"function"==typeof t?this.end(e,null,t):(this._ended=!0,e&&this.write(e),this._writableState.ending||this._writableState.destroyed||this.write(c),r.Writable.prototype.end.call(this,i))},t.exports=u}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:50,buffer:17,"end-of-stream":21,inherits:24,"readable-stream":69,"stream-shift":74}],21:[function(e,t,i){(function(i){(function(){var n=e("once"),r=function(){},o=function(e,t,s){if("function"==typeof t)return o(e,null,t);t||(t={}),s=n(s||r);var a=e._writableState,c=e._readableState,l=t.readable||!1!==t.readable&&e.readable,h=t.writable||!1!==t.writable&&e.writable,d=!1,u=function(){e.writable||f()},f=function(){h=!1,l||s.call(e)},p=function(){l=!1,h||s.call(e)},v=function(t){s.call(e,t?new Error("exited with error code: "+t):null)},x=function(t){s.call(e,t)},g=function(){i.nextTick(y)},y=function(){if(!d)return(!l||c&&c.ended&&!c.destroyed)&&(!h||a&&a.ended&&!a.destroyed)?void 0:s.call(e,new Error("premature close"))},m=function(){e.req.on("finish",f)};return function(e){return e.setHeader&&"function"==typeof e.abort}(e)?(e.on("complete",f),e.on("abort",g),e.req?m():e.on("request",m)):h&&!a&&(e.on("end",u),e.on("close",u)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",v),e.on("end",p),e.on("finish",f),!1!==t.error&&e.on("error",x),e.on("close",g),function(){d=!0,e.removeListener("complete",f),e.removeListener("abort",g),e.removeListener("request",m),e.req&&e.req.removeListener("finish",f),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",f),e.removeListener("exit",v),e.removeListener("end",p),e.removeListener("error",x),e.removeListener("close",g)}};t.exports=o}).call(this)}).call(this,e("_process"))},{_process:50,once:48}],22:[function(e,t,i){var n=Object.create||function(e){var t=function(){};return t.prototype=e,new t},r=Object.keys||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return i},o=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function s(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0;var a,c=10;try{var l={};Object.defineProperty&&Object.defineProperty(l,"x",{value:0}),a=0===l.x}catch(e){a=!1}function h(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,i,r){var o,s,a;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(s.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),s=e._events),a=s[t]):(s=e._events=n(null),e._eventsCount=0),a){if("function"==typeof a?a=s[t]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),!a.warned&&(o=h(e))&&o>0&&a.length>o){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",c.name,c.message)}}else a=s[t]=i,++e._eventsCount;return e}function u(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function f(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=o.call(u,n);return r.listener=i,n.wrapFn=r,r}function p(e,t,i){var n=e._events;if(!n)return[];var r=n[t];return r?"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(r):x(r,r.length):[]}function v(e){var t=this._events;if(t){var i=t[e];if("function"==typeof i)return 1;if(i)return i.length}return 0}function x(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}a?Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');c=e}}):s.defaultMaxListeners=c,s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return h(this)},s.prototype.emit=function(e){var t,i,n,r,o,s,a="error"===e;if(s=this._events)a=a&&null==s.error;else if(!a)return!1;if(a){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;var c=new Error('Unhandled "error" event. ('+t+")");throw c.context=t,c}if(!(i=s[e]))return!1;var l="function"==typeof i;switch(n=arguments.length){case 1:!function(e,t,i){if(t)e.call(i);else for(var n=e.length,r=x(e,n),o=0;o<n;++o)r[o].call(i)}(i,l,this);break;case 2:!function(e,t,i,n){if(t)e.call(i,n);else for(var r=e.length,o=x(e,r),s=0;s<r;++s)o[s].call(i,n)}(i,l,this,arguments[1]);break;case 3:!function(e,t,i,n,r){if(t)e.call(i,n,r);else for(var o=e.length,s=x(e,o),a=0;a<o;++a)s[a].call(i,n,r)}(i,l,this,arguments[1],arguments[2]);break;case 4:!function(e,t,i,n,r,o){if(t)e.call(i,n,r,o);else for(var s=e.length,a=x(e,s),c=0;c<s;++c)a[c].call(i,n,r,o)}(i,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=new Array(n-1),o=1;o<n;o++)r[o-1]=arguments[o];!function(e,t,i,n){if(t)e.apply(i,n);else for(var r=e.length,o=x(e,r),s=0;s<r;++s)o[s].apply(i,n)}(i,l,this,r)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,f(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,f(this,e,t)),this},s.prototype.removeListener=function(e,t){var i,r,o,s,a;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(i=r[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=n(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(o=-1,s=i.length-1;s>=0;s--)if(i[s]===t||i[s].listener===t){a=i[s].listener,o=s;break}if(o<0)return this;0===o?i.shift():function(e,t){for(var i=t,n=i+1,r=e.length;n<r;i+=1,n+=1)e[i]=e[n];e.pop()}(i,o),1===i.length&&(r[e]=i[0]),r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.removeAllListeners=function(e){var t,i,o;if(!(i=this._events))return this;if(!i.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):i[e]&&(0==--this._eventsCount?this._events=n(null):delete i[e]),this;if(0===arguments.length){var s,a=r(i);for(o=0;o<a.length;++o)"removeListener"!==(s=a[o])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(t)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},s.prototype.listenerCount=v,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],23:[function(e,t,i){i.read=function(e,t,i,n,r){var o,s,a=8*r-n-1,c=(1<<a)-1,l=c>>1,h=-7,d=i?r-1:0,u=i?-1:1,f=e[t+d];for(d+=u,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+e[t+d],d+=u,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+e[t+d],d+=u,h-=8);if(0===o)o=1-l;else{if(o===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=l}return(f?-1:1)*s*Math.pow(2,o-n)},i.write=function(e,t,i,n,r,o){var s,a,c,l=8*o-r-1,h=(1<<l)-1,d=h>>1,u=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+d>=1?u/c:u*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=h?(a=0,s=h):s+d>=1?(a=(t*c-1)*Math.pow(2,r),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),s=0));r>=8;e[i+f]=255&a,f+=p,a/=256,r-=8);for(s=s<<r|a,l+=r;l>0;e[i+f]=255&s,f+=p,s/=256,l-=8);e[i+f-p]|=128*v}},{}],24:[function(e,t,i){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},{}],25:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=function(){function e(e,t){this.color=!0,this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0,this.leftChild=void 0,this.rightChild=void 0,this.key=e,this.value=t}return e.prototype.rotateLeft=function(){var e=this.parent,t=this.brother,i=this.leftChild,n=this.rightChild;if(!n)throw new Error("unknown error");var r=n.leftChild,o=n.rightChild;return e&&(e.leftChild===this?e.leftChild=n:e.rightChild===this&&(e.rightChild=n)),n.parent=e,n.brother=t,n.leftChild=this,n.rightChild=o,t&&(t.brother=n),this.parent=n,this.brother=o,this.leftChild=i,this.rightChild=r,o&&(o.parent=n,o.brother=this),i&&(i.parent=this,i.brother=r),r&&(r.parent=this,r.brother=i),n},e.prototype.rotateRight=function(){var e=this.parent,t=this.brother,i=this.leftChild;if(!i)throw new Error("unknown error");var n=this.rightChild,r=i.leftChild,o=i.rightChild;return e&&(e.leftChild===this?e.leftChild=i:e.rightChild===this&&(e.rightChild=i)),i.parent=e,i.brother=t,i.leftChild=r,i.rightChild=this,t&&(t.brother=i),r&&(r.parent=i,r.brother=this),this.parent=i,this.brother=r,this.leftChild=o,this.rightChild=n,o&&(o.parent=this,o.brother=n),n&&(n.parent=this,n.brother=o),i},e.prototype.remove=function(){if(this.leftChild||this.rightChild)throw new Error("can only remove leaf node");this.parent&&(this===this.parent.leftChild?this.parent.leftChild=void 0:this===this.parent.rightChild&&(this.parent.rightChild=void 0)),this.brother&&(this.brother.brother=void 0),this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0},e.TreeNodeColorType={red:!0,black:!1},e}();Object.freeze(n),i.default=n},{}],26:[function(e,t,i){"use strict";var n=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};function r(e){var t=this;void 0===e&&(e=[]);var i=[],o=0,s=0,a=0,c=0,l=0,h=0;this.size=function(){return h},this.empty=function(){return 0===h},this.clear=function(){o=a=s=c=l=h=0,u.call(this,r.bucketSize),h=0},this.front=function(){return i[o][s]},this.back=function(){return i[a][c]},this.forEach=function(e){if(!this.empty()){var t=0;if(o!==a){for(l=s;l<r.bucketSize;++l)e(i[o][l],t++);for(l=o+1;l<a;++l)for(var n=0;n<r.bucketSize;++n)e(i[l][n],t++);for(l=0;l<=c;++l)e(i[a][l],t++)}else for(var l=s;l<=c;++l)e(i[o][l],t++)}};var d=function(e){var t=o*r.bucketSize+s,i=t+e,n=a*r.bucketSize+c;if(i<t||i>n)throw new Error("pos should more than 0 and less than queue's size");return{curNodeBucketIndex:Math.floor(i/r.bucketSize),curNodePointerIndex:i%r.bucketSize}};this.getElementByPos=function(e){var t=d(e),n=t.curNodeBucketIndex,r=t.curNodePointerIndex;return i[n][r]},this.eraseElementByPos=function(e){var t=this;if(e<0||e>h)throw new Error("pos should more than 0 and less than queue's size");if(0===e)this.popFront();else if(e===this.size())this.popBack();else{for(var i=[],n=e+1;n<h;++n)i.push(this.getElementByPos(n));this.cut(e),this.popBack(),i.forEach((function(e){return t.pushBack(e)}))}},this.eraseElementByValue=function(e){if(!this.empty()){var t=[];this.forEach((function(i){i!==e&&t.push(i)}));for(var i=t.length,n=0;n<i;++n)this.setElementByPos(n,t[n]);this.cut(i-1)}};var u=function(e){for(var t=[],n=e*r.sigma,d=Math.max(Math.ceil(n/r.bucketSize),2),u=0;u<d;++u)t.push(new Array(r.bucketSize));var f=Math.ceil(e/r.bucketSize),p=Math.floor(d/2)-Math.floor(f/2),v=p,x=0;if(this.size())for(u=0;u<f;++u){for(var g=0;g<r.bucketSize;++g)if(t[p+u][g]=this.front(),this.popFront(),this.empty()){v=p+u,x=g;break}if(this.empty())break}i=t,o=p,s=0,a=v,c=x,l=d,h=e};this.pushBack=function(e){this.empty()||(a===l-1&&c===r.bucketSize-1&&u.call(this,this.size()),c<r.bucketSize-1?++c:a<l-1&&(++a,c=0)),++h,i[a][c]=e},this.popBack=function(){this.empty()||(1!==this.size()&&(c>0?--c:o<a&&(--a,c=r.bucketSize-1)),h>0&&--h)},this.setElementByPos=function(e,t){var n=d(e),r=n.curNodeBucketIndex,o=n.curNodePointerIndex;i[r][o]=t},this.insert=function(e,t,i){var n=this;if(void 0===i&&(i=1),0===e)for(;i--;)this.pushFront(t);else if(e===this.size())for(;i--;)this.pushBack(t);else{for(var r=[],o=e;o<h;++o)r.push(this.getElementByPos(o));for(this.cut(e-1),o=0;o<i;++o)this.pushBack(t);r.forEach((function(e){return n.pushBack(e)}))}},this.find=function(e){if(o===a){for(var t=s;t<=c;++t)if(i[o][t]===e)return!0;return!1}for(t=s;t<r.bucketSize;++t)if(i[o][t]===e)return!0;for(t=o+1;t<a;++t)for(var n=0;n<r.bucketSize;++n)if(i[t][n]===e)return!0;for(t=0;t<=c;++t)if(i[a][t]===e)return!0;return!1},this.reverse=function(){for(var e=0,t=h-1;e<t;){var i=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(t)),this.setElementByPos(t,i),++e,--t}},this.unique=function(){if(!this.empty()){var e=[],t=this.front();this.forEach((function(i,n){0!==n&&i===t||(e.push(i),t=i)}));for(var i=0;i<h;++i)this.setElementByPos(i,e[i]);this.cut(e.length-1)}},this.sort=function(e){var t=[];this.forEach((function(e){t.push(e)})),t.sort(e);for(var i=0;i<h;++i)this.setElementByPos(i,t[i])},this.pushFront=function(e){this.empty()||(0===o&&0===s&&u.call(this,this.size()),s>0?--s:o>0&&(--o,s=r.bucketSize-1)),++h,i[o][s]=e},this.popFront=function(){this.empty()||(1!==this.size()&&(s<r.bucketSize-1?++s:o<a&&(++o,s=0)),h>0&&--h)},this.shrinkToFit=function(){var e=this,t=[];this.forEach((function(e){t.push(e)}));var n=t.length;i=[];for(var o=Math.ceil(n/r.bucketSize),s=0;s<o;++s)i.push(new Array(r.bucketSize));this.clear(),t.forEach((function(t){return e.pushBack(t)}))},this.cut=function(e){if(e<0)this.clear();else{var t=d(e),i=t.curNodeBucketIndex,n=t.curNodePointerIndex;a=i,c=n,h=e+1}},this[Symbol.iterator]=function(){return function(){var e,t;return n(this,(function(n){switch(n.label){case 0:if(0===h)return[2];if(o!==a)return[3,5];t=s,n.label=1;case 1:return t<=c?[4,i[o][t]]:[3,4];case 2:n.sent(),n.label=3;case 3:return++t,[3,1];case 4:return[2];case 5:t=s,n.label=6;case 6:return t<r.bucketSize?[4,i[o][t]]:[3,9];case 7:n.sent(),n.label=8;case 8:return++t,[3,6];case 9:t=o+1,n.label=10;case 10:if(!(t<a))return[3,15];e=0,n.label=11;case 11:return e<r.bucketSize?[4,i[t][e]]:[3,14];case 12:n.sent(),n.label=13;case 13:return++e,[3,11];case 14:return++t,[3,10];case 15:t=0,n.label=16;case 16:return t<=c?[4,i[a][t]]:[3,19];case 17:n.sent(),n.label=18;case 18:return++t,[3,16];case 19:return[2]}}))}()},function(){var n=r.bucketSize;e.size?n=e.size():e.length&&(n=e.length);var s=n*r.sigma;l=Math.ceil(s/r.bucketSize),l=Math.max(l,3);for(var c=0;c<l;++c)i.push(new Array(r.bucketSize));var h=Math.ceil(n/r.bucketSize);o=Math.floor(l/2)-Math.floor(h/2),a=o,e.forEach((function(e){return t.pushBack(e)}))}(),Object.freeze(this)}Object.defineProperty(i,"__esModule",{value:!0}),r.sigma=3,r.bucketSize=5e3,Object.freeze(r),i.default=r},{}],27:[function(e,t,i){"use strict";var n=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(i,"__esModule",{value:!0});var o=e("../LinkList/LinkList"),s=e("../Map/Map");function a(e,t,i){var c=this;if(void 0===e&&(e=[]),void 0===t&&(t=a.initSize),i=i||function(e){var t,i,n=0,o="";if("number"==typeof e)n=((n=Math.floor(e))<<5)-n,n&=n;else{o="string"!=typeof e?JSON.stringify(e):e;try{for(var s=r(o),a=s.next();!a.done;a=s.next())n=(n<<5)-n+a.value.charCodeAt(0),n&=n}catch(e){t={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}return n^n>>>16},0!=(t&t-1))throw new Error("initBucketNum must be 2 to the power of n");var l=0,h=[],d=Math.max(a.initSize,Math.min(a.maxSize,t));this.size=function(){return l},this.empty=function(){return 0===l},this.clear=function(){l=0,d=t,h=[]},this.forEach=function(e){var t=0;h.forEach((function(i){i.forEach((function(i){e(i,t++)}))}))},this.setElement=function(e,t){var n,c;if(null==e)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(null!=t){var u=i(e)&d-1;if(h[u]){var f=h[u].size();if(h[u]instanceof o.default){try{for(var p=r(h[u]),v=p.next();!v.done;v=p.next()){var x=v.value;if(x.key===e)return void(x.value=t)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(c=p.return)&&c.call(p)}finally{if(n)throw n.error}}h[u].pushBack({key:e,value:t}),h[u].size()>=a.treeifyThreshold&&(h[u]=new s.default(h[u]))}else h[u].setElement(e,t);var g=h[u].size();l+=g-f}else++l,h[u]=new o.default([{key:e,value:t}]);l>d*a.sigma&&function(e){if(!(e>=a.maxSize)){d=2*e;var t=[];h.forEach((function(n,r){if(!n.empty()){if(n instanceof o.default&&1===n.size()){var c=n.front(),l=c.key,u=c.value;t[i(l)&d-1]=new o.default([{key:l,value:u}])}else if(n instanceof s.default){var f=new o.default,p=new o.default;n.forEach((function(t){0==(i(t.key)&e)?f.pushBack(t):p.pushBack(t)})),f.size()>a.untreeifyThreshold?t[r]=new s.default(f):f.size()&&(t[r]=f),p.size()>a.untreeifyThreshold?t[r+e]=new s.default(p):p.size()&&(t[r+e]=p)}else{var v=new o.default,x=new o.default;n.forEach((function(t){0==(i(t.key)&e)?v.pushBack(t):x.pushBack(t)})),v.size()&&(t[r]=v),x.size()&&(t[r+e]=x)}h[r].clear()}})),h=t}}.call(this,d)}else this.eraseElementByKey(e)},this.getElementByKey=function(e){var t,n,o=i(e)&d-1;if(h[o]){if(h[o]instanceof s.default)return h[o].getElementByKey(e);try{for(var a=r(h[o]),c=a.next();!c.done;c=a.next()){var l=c.value;if(l.key===e)return l.value}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}},this.eraseElementByKey=function(e){var t,n,c=i(e)&d-1;if(h[c]){var u=h[c].size();if(h[c]instanceof s.default)h[c].eraseElementByKey(e),h[c].size()<=a.untreeifyThreshold&&(h[c]=new o.default(h[c]));else{var f=-1;try{for(var p=r(h[c]),v=p.next();!v.done;v=p.next())if(++f,v.value.key===e){h[c].eraseElementByPos(f);break}}catch(e){t={error:e}}finally{try{v&&!v.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}}var x=h[c].size();l+=x-u}},this.find=function(e){var t,n,o=i(e)&d-1;if(!h[o])return!1;if(h[o]instanceof s.default)return h[o].find(e);try{for(var a=r(h[o]),c=a.next();!c.done;c=a.next())if(c.value.key===e)return!0}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return!1},this[Symbol.iterator]=function(){return function(){var e,t,i,o,s,a;return n(this,(function(n){switch(n.label){case 0:e=0,n.label=1;case 1:if(!(e<d))return[3,10];for(;e<d&&!h[e];)++e;if(e>=d)return[3,10];n.label=2;case 2:n.trys.push([2,7,8,9]),s=void 0,t=r(h[e]),i=t.next(),n.label=3;case 3:return i.done?[3,6]:[4,i.value];case 4:n.sent(),n.label=5;case 5:return i=t.next(),[3,3];case 6:return[3,9];case 7:return o=n.sent(),s={error:o},[3,9];case 8:try{i&&!i.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return++e,[3,1];case 10:return[2]}}))}()},e.forEach((function(e){var t=e.key,i=e.value;return c.setElement(t,i)})),Object.freeze(this)}a.initSize=16,a.maxSize=1<<30,a.sigma=.75,a.treeifyThreshold=8,a.untreeifyThreshold=6,a.minTreeifySize=64,Object.freeze(a),i.default=a},{"../LinkList/LinkList":29,"../Map/Map":30}],28:[function(e,t,i){"use strict";var n=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(i,"__esModule",{value:!0});var o=e("../Set/Set"),s=e("../LinkList/LinkList");function a(e,t,i){var c=this;if(void 0===e&&(e=[]),void 0===t&&(t=a.initSize),i=i||function(e){var t=0,i="";if("number"==typeof e)t=((t=Math.floor(e))<<5)-t,t&=t;else{i="string"!=typeof e?JSON.stringify(e):e;for(var n=0;n<i.length;n++)t=(t<<5)-t+i.charCodeAt(n),t&=t}return t^t>>>16},0!=(t&t-1))throw new Error("initBucketNum must be 2 to the power of n");var l=0,h=[],d=Math.max(a.initSize,Math.min(a.maxSize,t));this.size=function(){return l},this.empty=function(){return 0===l},this.clear=function(){l=0,d=t,h=[]},this.forEach=function(e){var t=0;h.forEach((function(i){i.forEach((function(i){e(i,t++)}))}))},this.insert=function(e){if(null==e)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");var t=i(e)&d-1;if(h[t]){var n=h[t].size();if(h[t]instanceof s.default){if(h[t].find(e))return;h[t].pushBack(e),h[t].size()>=a.treeifyThreshold&&(h[t]=new o.default(h[t]))}else h[t].insert(e);var r=h[t].size();l+=r-n}else h[t]=new s.default([e]),++l;l>d*a.sigma&&function(e){if(!(e>=a.maxSize)){d=2*e;var t=[];h.forEach((function(n,r){if(!n.empty()){if(n instanceof s.default&&1===n.size()){var c=n.front();if(void 0===c)throw new Error("unknown error");t[i(c)&d-1]=new s.default([c])}else if(n instanceof o.default){var l=new s.default,u=new s.default;n.forEach((function(t){0==(i(t)&e)?l.pushBack(t):u.pushBack(t)})),l.size()>a.untreeifyThreshold?t[r]=new o.default(l):l.size()&&(t[r]=l),u.size()>a.untreeifyThreshold?t[r+e]=new o.default(u):u.size()&&(t[r+e]=u)}else{var f=new s.default,p=new s.default;n.forEach((function(t){0==(i(t)&e)?f.pushBack(t):p.pushBack(t)})),f.size()&&(t[r]=f),p.size()&&(t[r+e]=p)}h[r].clear()}})),h=t}}.call(this,d)},this.eraseElementByValue=function(e){var t=i(e)&d-1;if(h[t]){var n=h[t].size();h[t].eraseElementByValue(e),h[t]instanceof o.default&&h[t].size()<=a.untreeifyThreshold&&(h[t]=new s.default(h[t]));var r=h[t].size();l+=r-n}},this.find=function(e){var t=i(e)&d-1;return!!h[t]&&h[t].find(e)},this[Symbol.iterator]=function(){return function(){var e,t,i,o,s,a;return n(this,(function(n){switch(n.label){case 0:e=0,n.label=1;case 1:if(!(e<d))return[3,10];for(;e<d&&!h[e];)++e;if(e>=d)return[3,10];n.label=2;case 2:n.trys.push([2,7,8,9]),s=void 0,t=r(h[e]),i=t.next(),n.label=3;case 3:return i.done?[3,6]:[4,i.value];case 4:n.sent(),n.label=5;case 5:return i=t.next(),[3,3];case 6:return[3,9];case 7:return o=n.sent(),s={error:o},[3,9];case 8:try{i&&!i.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return++e,[3,1];case 10:return[2]}}))}()},e.forEach((function(e){return c.insert(e)})),Object.freeze(this)}a.initSize=16,a.maxSize=1<<30,a.sigma=.75,a.treeifyThreshold=8,a.untreeifyThreshold=6,a.minTreeifySize=64,Object.freeze(a),i.default=a},{"../LinkList/LinkList":29,"../Set/Set":33}],29:[function(e,t,i){"use strict";var n=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(i,"__esModule",{value:!0});var r=function(e){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=e};function o(e){var t=this;void 0===e&&(e=[]);var i=0,o=void 0,s=void 0;this.size=function(){return i},this.empty=function(){return 0===i},this.clear=function(){o=s=void 0,i=0},this.front=function(){return null==o?void 0:o.value},this.back=function(){return null==s?void 0:s.value},this.forEach=function(e){for(var t=o,i=0;t;){if(void 0===t.value)throw new Error("unknown error");e(t.value,i++),t=t.next}},this.getElementByPos=function(e){if(e<0||e>=i)throw new Error("pos must more then 0 and less then the list length");for(var t=o;e--&&t;)t=t.next;if(!t||void 0===t.value)throw new Error("unknown error");return t.value},this.eraseElementByPos=function(e){if(e<0||e>=i)throw new Error("erase pos must more then 0 and less then the list length");if(0===e)this.popFront();else if(e===i-1)this.popBack();else{for(var t=o;e--;){if(!(null==t?void 0:t.next))throw new Error("unknown error");t=t.next}if(!t||!t.pre||!t.next)throw new Error("unknown error");var n=t.pre,r=t.next;r.pre=n,n.next=r,i>0&&--i}},this.eraseElementByValue=function(e){for(;o&&o.value===e;)this.popFront();for(;s&&s.value===e;)this.popBack();if(o)for(var t=o;t;){if(t.value===e){var n=t.pre,r=t.next;r&&(r.pre=n),n&&(n.next=r),i>0&&--i}t=t.next}},this.pushBack=function(e){if(null==e)throw new Error("you can't push null or undefined here");++i;var t=new r(e);s?(s.next=t,t.pre=s,s=t):o=s=t},this.popBack=function(){s&&(i>0&&--i,s&&(o===s?o=s=void 0:(s=s.pre)&&(s.next=void 0)))},this.setElementByPos=function(e,t){if(null==t)throw new Error("you can't set null or undefined here");if(e<0||e>=i)throw new Error("pos must more then 0 and less then the list length");for(var n=o;e--;){if(!n)throw new Error("unknown error");n=n.next}n&&(n.value=t)},this.insert=function(e,t,n){if(void 0===n&&(n=1),null==t)throw new Error("you can't insert null or undefined here");if(e<0||e>i)throw new Error("insert pos must more then 0 and less then or equal to the list length");if(n<0)throw new Error("insert size must more than 0");if(0===e)for(;n--;)this.pushFront(t);else if(e===i)for(;n--;)this.pushBack(t);else{for(var s=o,a=1;a<e;++a){if(!(null==s?void 0:s.next))throw new Error("unknown error");s=null==s?void 0:s.next}if(!s)throw new Error("unknown error");var c=s.next;for(i+=n;n--;)s.next=new r(t),s.next.pre=s,s=s.next;s.next=c,c&&(c.pre=s)}},this.find=function(e){for(var t=o;t;){if(t.value===e)return!0;t=t.next}return!1},this.reverse=function(){for(var e=o,t=s,n=0;e&&t&&2*n<i;){var r=e.value;e.value=t.value,t.value=r,e=e.next,t=t.pre,++n}},this.unique=function(){for(var e=o;e;){for(var t=e;t&&t.next&&t.value===t.next.value;)t=t.next,i>0&&--i;e.next=t.next,e.next&&(e.next.pre=e),e=e.next}},this.sort=function(e){var t=[];this.forEach((function(e){t.push(e)})),t.sort(e);var i=o;t.forEach((function(e){i&&(i.value=e,i=i.next)}))},this.pushFront=function(e){if(null==e)throw new Error("you can't push null or undefined here");++i;var t=new r(e);o?(t.next=o,o.pre=t,o=t):o=s=t},this.popFront=function(){o&&(i>0&&--i,o&&(o===s?o=s=void 0:(o=o.next)&&(o.pre=void 0)))},this.merge=function(e){var t=this,n=o;e.forEach((function(e){for(;n&&void 0!==n.value&&n.value<=e;)n=n.next;if(void 0===n)t.pushBack(e),n=s;else if(n===o)t.pushFront(e),n=o;else{++i;var a=n.pre;a&&(a.next=new r(e),a.next.pre=a,a.next.next=n,n&&(n.pre=a.next))}}))},this[Symbol.iterator]=function(){return function(){var e;return n(this,(function(t){switch(t.label){case 0:e=o,t.label=1;case 1:if(void 0===e)return[3,3];if(!e.value)throw new Error("unknown error");return[4,e.value];case 2:return t.sent(),e=e.next,[3,1];case 3:return[2]}}))}()},e.forEach((function(e){return t.pushBack(e)})),Object.freeze(this)}Object.freeze(o),i.default=o},{}],30:[function(e,t,i){"use strict";var n=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(i,"__esModule",{value:!0});var o=e("../Base/TreeNode");function s(e,t){var i=this;void 0===e&&(e=[]),t=t||function(e,t){return e<t?-1:e>t?1:0};var s=0,a=new o.default;a.color=o.default.TreeNodeColorType.black,this.size=function(){return s},this.empty=function(){return 0===s},this.clear=function(){s=0,a.key=a.value=void 0,a.leftChild=a.rightChild=a.brother=void 0};var c=function(e){if(!e||void 0===e.key)throw new Error("unknown error");return e.leftChild?c(e.leftChild):e},l=function(e){if(!e||void 0===e.key)throw new Error("unknown error");return e.rightChild?l(e.rightChild):e};this.front=function(){if(!this.empty()){var e=c(a);if(void 0===e.key||void 0===e.value)throw new Error("unknown error");return{key:e.key,value:e.value}}},this.back=function(){if(!this.empty()){var e=l(a);if(void 0===e.key||void 0===e.value)throw new Error("unknown error");return{key:e.key,value:e.value}}},this.forEach=function(e){var t,i,n=0;try{for(var o=r(this),s=o.next();!s.done;s=o.next())e(s.value,n++)}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}},this.getElementByPos=function(e){var t,i;if(e<0||e>=this.size())throw new Error("pos must more than 0 and less than set's size");var n=0;try{for(var o=r(this),s=o.next();!s.done;s=o.next()){var a=s.value;if(n===e)return a;++n}}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}throw new Error("unknown Error")};var h=function(e,i){if(e&&void 0!==e.key&&void 0!==e.value){var n=t(e.key,i);return 0===n?{key:e.key,value:e.value}:n<0?h(e.rightChild,i):h(e.leftChild,i)||{key:e.key,value:e.value}}};this.lowerBound=function(e){return h(a,e)};var d=function(e,i){if(e&&void 0!==e.key&&void 0!==e.value)return t(e.key,i)<=0?d(e.rightChild,i):d(e.leftChild,i)||{key:e.key,value:e.value}};this.upperBound=function(e){return d(a,e)};var u=function(e,i){if(e&&void 0!==e.key&&void 0!==e.value){var n=t(e.key,i);return 0===n?{key:e.key,value:e.value}:n>0?u(e.leftChild,i):u(e.rightChild,i)||{key:e.key,value:e.value}}};this.reverseLowerBound=function(e){return u(a,e)};var f=function(e,i){if(e&&void 0!==e.key&&void 0!==e.value)return t(e.key,i)>=0?f(e.leftChild,i):f(e.rightChild,i)||{key:e.key,value:e.value}};this.reverseUpperBound=function(e){return f(a,e)};var p=function(e){var t=e.parent;if(!t){if(e===a)return;throw new Error("unknown error")}if(e.color!==o.default.TreeNodeColorType.red){var i=e.brother;if(!i)throw new Error("unknown error");if(e===t.leftChild)if(i.color===o.default.TreeNodeColorType.red){i.color=o.default.TreeNodeColorType.black,t.color=o.default.TreeNodeColorType.red;var n=t.rotateLeft();a===t&&(a=n),p(e)}else i.color===o.default.TreeNodeColorType.black&&(i.rightChild&&i.rightChild.color===o.default.TreeNodeColorType.red?(i.color=t.color,t.color=o.default.TreeNodeColorType.black,i.rightChild&&(i.rightChild.color=o.default.TreeNodeColorType.black),n=t.rotateLeft(),a===t&&(a=n),e.color=o.default.TreeNodeColorType.black):i.rightChild&&i.rightChild.color!==o.default.TreeNodeColorType.black||!i.leftChild||i.leftChild.color!==o.default.TreeNodeColorType.red?i.leftChild&&i.leftChild.color!==o.default.TreeNodeColorType.black||i.rightChild&&i.rightChild.color!==o.default.TreeNodeColorType.black||(i.color=o.default.TreeNodeColorType.red,p(t)):(i.color=o.default.TreeNodeColorType.red,i.leftChild&&(i.leftChild.color=o.default.TreeNodeColorType.black),n=i.rotateRight(),a===i&&(a=n),p(e)));else e===t.rightChild&&(i.color===o.default.TreeNodeColorType.red?(i.color=o.default.TreeNodeColorType.black,t.color=o.default.TreeNodeColorType.red,n=t.rotateRight(),a===t&&(a=n),p(e)):i.color===o.default.TreeNodeColorType.black&&(i.leftChild&&i.leftChild.color===o.default.TreeNodeColorType.red?(i.color=t.color,t.color=o.default.TreeNodeColorType.black,i.leftChild&&(i.leftChild.color=o.default.TreeNodeColorType.black),n=t.rotateRight(),a===t&&(a=n),e.color=o.default.TreeNodeColorType.black):i.leftChild&&i.leftChild.color!==o.default.TreeNodeColorType.black||!i.rightChild||i.rightChild.color!==o.default.TreeNodeColorType.red?i.leftChild&&i.leftChild.color!==o.default.TreeNodeColorType.black||i.rightChild&&i.rightChild.color!==o.default.TreeNodeColorType.black||(i.color=o.default.TreeNodeColorType.red,p(t)):(i.color=o.default.TreeNodeColorType.red,i.rightChild&&(i.rightChild.color=o.default.TreeNodeColorType.black),n=i.rotateLeft(),a===i&&(a=n),p(e))))}else e.color=o.default.TreeNodeColorType.black},v=function(e){for(var t=e;t.leftChild||t.rightChild;){if(t.rightChild){t=c(t.rightChild);var i=e.key;e.key=t.key,t.key=i;var n=e.value;e.value=t.value,t.value=n,e=t}t.leftChild&&(t=l(t.leftChild),i=e.key,e.key=t.key,t.key=i,n=e.value,e.value=t.value,t.value=n,e=t)}p(t),t&&t.remove(),--s,a.color=o.default.TreeNodeColorType.black},x=function(e,t){return!(!e||void 0===e.key)&&(!!x(e.leftChild,t)||!!t(e)||x(e.rightChild,t))};this.eraseElementByPos=function(e){if(e<0||e>=s)throw new Error("pos must more than 0 and less than set's size");var t=0;x(a,(function(i){return e===t?(v(i),!0):(++t,!1)}))},this.eraseElementByKey=function(e){if(!this.empty()){var i=m(a,e);void 0!==i&&void 0!==i.key&&0===t(i.key,e)&&v(i)}};var g=function(e,i){if(!e||void 0===e.key)throw new Error("unknown error");var n=t(i,e.key);return n<0?e.leftChild?g(e.leftChild,i):(e.leftChild=new o.default,e.leftChild.parent=e,e.leftChild.brother=e.rightChild,e.rightChild&&(e.rightChild.brother=e.leftChild),e.leftChild):n>0?e.rightChild?g(e.rightChild,i):(e.rightChild=new o.default,e.rightChild.parent=e,e.rightChild.brother=e.leftChild,e.leftChild&&(e.leftChild.brother=e.rightChild),e.rightChild):e},y=function(e){var t=e.parent;if(!t){if(e===a)return;throw new Error("unknown error")}if(t.color!==o.default.TreeNodeColorType.black&&t.color===o.default.TreeNodeColorType.red){var i=t.brother,n=t.parent;if(!n)throw new Error("unknown error");if(i&&i.color===o.default.TreeNodeColorType.red)i.color=t.color=o.default.TreeNodeColorType.black,n.color=o.default.TreeNodeColorType.red,y(n);else if(!i||i.color===o.default.TreeNodeColorType.black)if(t===n.leftChild)if(e===t.leftChild){t.color=o.default.TreeNodeColorType.black,n.color=o.default.TreeNodeColorType.red;var r=n.rotateRight();n===a&&(a=r)}else e===t.rightChild&&(r=t.rotateLeft(),n===a&&(a=r),y(t));else t===n.rightChild&&(e===t.leftChild?(r=t.rotateRight(),n===a&&(a=r),y(t)):e===t.rightChild&&(t.color=o.default.TreeNodeColorType.black,n.color=o.default.TreeNodeColorType.red,r=n.rotateLeft(),n===a&&(a=r)))}};this.setElement=function(e,i){if(null==e)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(null!=i){if(this.empty())return++s,a.key=e,a.value=i,void(a.color=o.default.TreeNodeColorType.black);var n=g(a,e);void 0===n.key||0!==t(n.key,e)?(++s,n.key=e,n.value=i,y(n),a.color=o.default.TreeNodeColorType.black):n.value=i}else this.eraseElementByKey(e)};var m=function(e,i){if(e&&void 0!==e.key){var n=t(i,e.key);return n<0?m(e.leftChild,i):n>0?m(e.rightChild,i):e}};this.find=function(e){return!!m(a,e)},this.getElementByKey=function(e){var t=m(a,e);if(void 0===(null==t?void 0:t.key)||void 0===(null==t?void 0:t.value))throw new Error("unknown error");return t.value},this.union=function(e){var t=this;e.forEach((function(e){var i=e.key,n=e.value;return t.setElement(i,n)}))},this.getHeight=function(){if(this.empty())return 0;var e=function(t){return t?Math.max(e(t.leftChild),e(t.rightChild))+1:1};return e(a)};var b=function(e){return n(this,(function(t){switch(t.label){case 0:return e&&void 0!==e.key&&void 0!==e.value?[5,r(b(e.leftChild))]:[2];case 1:return t.sent(),[4,{key:e.key,value:e.value}];case 2:return t.sent(),[5,r(b(e.rightChild))];case 3:return t.sent(),[2]}}))};this[Symbol.iterator]=function(){return b(a)},e.forEach((function(e){var t=e.key,n=e.value;return i.setElement(t,n)})),Object.freeze(this)}Object.freeze(s),i.default=s},{"../Base/TreeNode":25}],31:[function(e,t,i){"use strict";function n(e,t){void 0===e&&(e=[]),t=t||function(e,t){return e>t?-1:e<t?1:0};var i=[];e.forEach((function(e){return i.push(e)}));var n=i.length,r=function(e,t){if(e<0||e>=n)throw new Error("unknown error");if(t<0||t>=n)throw new Error("unknown error");var r=i[e];i[e]=i[t],i[t]=r},o=function(e){if(e<0||e>=n)throw new Error("unknown error");var o=2*e+1,s=2*e+2;o<n&&t(i[e],i[o])>0&&r(e,o),s<n&&t(i[e],i[s])>0&&r(e,s)};!function(){for(var e=Math.floor((n-1)/2);e>=0;--e)for(var o=e,s=2*o+1;s<n;){var a=s+1,c=s;if(a<n&&t(i[s],i[a])>0&&(c=a),t(i[o],i[c])<=0)break;r(o,c),s=2*(o=c)+1}}(),this.size=function(){return n},this.empty=function(){return 0===n},this.clear=function(){n=0,i.length=0},this.push=function(e){if(i.push(e),1!=++n)for(var r=n-1;r>0;){var s=Math.floor((r-1)/2);if(t(i[s],e)<=0)break;o(s),r=s}},this.pop=function(){if(!this.empty())if(1!==this.size()){var e=i[n-1];--n;for(var r=0;r<this.size();){var o=2*r+1,s=2*r+2;if(o>=this.size())break;var a=o;if(s<this.size()&&t(i[o],i[s])>0&&(a=s),t(i[a],e)>=0)break;i[r]=i[a],r=a}i[r]=e}else--n},this.top=function(){return i[0]},Object.freeze(this)}Object.defineProperty(i,"__esModule",{value:!0}),Object.freeze(n),i.default=n},{}],32:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=e("../LinkList/LinkList");function r(e){void 0===e&&(e=[]);var t=new n.default(e);this.size=function(){return t.size()},this.empty=function(){return t.empty()},this.clear=function(){t.clear()},this.push=function(e){t.pushBack(e)},this.pop=function(){t.popFront()},this.front=function(){return t.front()},Object.freeze(this)}Object.freeze(r),i.default=r},{"../LinkList/LinkList":29}],33:[function(e,t,i){"use strict";var n=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(i,"__esModule",{value:!0});var o=e("../Base/TreeNode");function s(e,t){var i=this;void 0===e&&(e=[]),t=t||function(e,t){return e<t?-1:e>t?1:0};var s=0,a=new o.default;a.color=o.default.TreeNodeColorType.black,this.size=function(){return s},this.empty=function(){return 0===s},this.clear=function(){s=0,a.key=void 0,a.leftChild=a.rightChild=a.brother=a.parent=void 0,a.color=o.default.TreeNodeColorType.black};var c=function(e){if(!e||void 0===e.key)throw new Error("unknown error");return e.leftChild?c(e.leftChild):e},l=function(e){if(!e||void 0===e.key)throw new Error("unknown error");return e.rightChild?l(e.rightChild):e};this.front=function(){if(!this.empty())return c(a).key},this.back=function(){if(!this.empty())return l(a).key},this.forEach=function(e){var t,i,n=0;try{for(var o=r(this),s=o.next();!s.done;s=o.next())e(s.value,n++)}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}},this.getElementByPos=function(e){var t,i;if(e<0||e>=this.size())throw new Error("pos must more than 0 and less than set's size");var n=0;try{for(var o=r(this),s=o.next();!s.done;s=o.next()){var a=s.value;if(n===e)return a;++n}}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}throw new Error("unknown error")};var h=function(e){var t=e.parent;if(!t){if(e===a)return;throw new Error("unknown error")}if(e.color!==o.default.TreeNodeColorType.red){var i=e.brother;if(!i)throw new Error("unknown error");if(e===t.leftChild)if(i.color===o.default.TreeNodeColorType.red){i.color=o.default.TreeNodeColorType.black,t.color=o.default.TreeNodeColorType.red;var n=t.rotateLeft();a===t&&(a=n),h(e)}else i.color===o.default.TreeNodeColorType.black&&(i.rightChild&&i.rightChild.color===o.default.TreeNodeColorType.red?(i.color=t.color,t.color=o.default.TreeNodeColorType.black,i.rightChild&&(i.rightChild.color=o.default.TreeNodeColorType.black),n=t.rotateLeft(),a===t&&(a=n),e.color=o.default.TreeNodeColorType.black):i.rightChild&&i.rightChild.color!==o.default.TreeNodeColorType.black||!i.leftChild||i.leftChild.color!==o.default.TreeNodeColorType.red?i.leftChild&&i.leftChild.color!==o.default.TreeNodeColorType.black||i.rightChild&&i.rightChild.color!==o.default.TreeNodeColorType.black||(i.color=o.default.TreeNodeColorType.red,h(t)):(i.color=o.default.TreeNodeColorType.red,i.leftChild&&(i.leftChild.color=o.default.TreeNodeColorType.black),n=i.rotateRight(),a===i&&(a=n),h(e)));else e===t.rightChild&&(i.color===o.default.TreeNodeColorType.red?(i.color=o.default.TreeNodeColorType.black,t.color=o.default.TreeNodeColorType.red,n=t.rotateRight(),a===t&&(a=n),h(e)):i.color===o.default.TreeNodeColorType.black&&(i.leftChild&&i.leftChild.color===o.default.TreeNodeColorType.red?(i.color=t.color,t.color=o.default.TreeNodeColorType.black,i.leftChild&&(i.leftChild.color=o.default.TreeNodeColorType.black),n=t.rotateRight(),a===t&&(a=n),e.color=o.default.TreeNodeColorType.black):i.leftChild&&i.leftChild.color!==o.default.TreeNodeColorType.black||!i.rightChild||i.rightChild.color!==o.default.TreeNodeColorType.red?i.leftChild&&i.leftChild.color!==o.default.TreeNodeColorType.black||i.rightChild&&i.rightChild.color!==o.default.TreeNodeColorType.black||(i.color=o.default.TreeNodeColorType.red,h(t)):(i.color=o.default.TreeNodeColorType.red,i.rightChild&&(i.rightChild.color=o.default.TreeNodeColorType.black),n=i.rotateLeft(),a===i&&(a=n),h(e))))}else e.color=o.default.TreeNodeColorType.black},d=function(e){for(var t=e;t.leftChild||t.rightChild;){if(t.rightChild){t=c(t.rightChild);var i=e.key;e.key=t.key,t.key=i,e=t}t.leftChild&&(t=l(t.leftChild),i=e.key,e.key=t.key,t.key=i,e=t)}h(t),t&&t.remove(),--s,a.color=o.default.TreeNodeColorType.black},u=function(e,t){return!(!e||void 0===e.key)&&(!!u(e.leftChild,t)||!!t(e)||u(e.rightChild,t))};this.eraseElementByPos=function(e){if(e<0||e>=s)throw new Error("pos must more than 0 and less than set's size");var t=0;u(a,(function(i){return e===t?(d(i),!0):(++t,!1)}))},this.eraseElementByValue=function(e){if(!this.empty()){var i=v(a,e);void 0!==i&&void 0!==i.key&&0===t(i.key,e)&&d(i)}};var f=function(e,i){if(!e||void 0===e.key)throw new Error("unknown error");var n=t(i,e.key);return n<0?e.leftChild?f(e.leftChild,i):(e.leftChild=new o.default,e.leftChild.parent=e,e.leftChild.brother=e.rightChild,e.rightChild&&(e.rightChild.brother=e.leftChild),e.leftChild):n>0?e.rightChild?f(e.rightChild,i):(e.rightChild=new o.default,e.rightChild.parent=e,e.rightChild.brother=e.leftChild,e.leftChild&&(e.leftChild.brother=e.rightChild),e.rightChild):e},p=function(e){var t=e.parent;if(!t){if(e===a)return;throw new Error("unknown error")}if(t.color!==o.default.TreeNodeColorType.black&&t.color===o.default.TreeNodeColorType.red){var i=t.brother,n=t.parent;if(!n)throw new Error("unknown error");if(i&&i.color===o.default.TreeNodeColorType.red)i.color=t.color=o.default.TreeNodeColorType.black,n.color=o.default.TreeNodeColorType.red,p(n);else if(!i||i.color===o.default.TreeNodeColorType.black)if(t===n.leftChild)if(e===t.leftChild){t.color=o.default.TreeNodeColorType.black,n.color=o.default.TreeNodeColorType.red;var r=n.rotateRight();n===a&&(a=r)}else e===t.rightChild&&(r=t.rotateLeft(),n===a&&(a=r),p(t));else t===n.rightChild&&(e===t.leftChild?(r=t.rotateRight(),n===a&&(a=r),p(t)):e===t.rightChild&&(t.color=o.default.TreeNodeColorType.black,n.color=o.default.TreeNodeColorType.red,r=n.rotateLeft(),n===a&&(a=r)))}};this.insert=function(e){if(null==e)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(this.empty())return++s,a.key=e,void(a.color=o.default.TreeNodeColorType.black);var i=f(a,e);void 0!==i.key&&0===t(i.key,e)||(++s,i.key=e,p(i),a.color=o.default.TreeNodeColorType.black)};var v=function(e,i){if(e&&void 0!==e.key){var n=t(i,e.key);return n<0?v(e.leftChild,i):n>0?v(e.rightChild,i):e}};this.find=function(e){var i=v(a,e);return void 0!==i&&void 0!==i.key&&0===t(i.key,e)};var x=function(e,i){if(e&&void 0!==e.key){var n=t(e.key,i);if(0===n)return e.key;if(n<0)return x(e.rightChild,i);var r=x(e.leftChild,i);return void 0!==r?r:e.key}};this.lowerBound=function(e){return x(a,e)};var g=function(e,i){if(e&&void 0!==e.key){if(t(e.key,i)<=0)return g(e.rightChild,i);var n=g(e.leftChild,i);return void 0!==n?n:e.key}};this.upperBound=function(e){return g(a,e)};var y=function(e,i){if(e&&void 0!==e.key){var n=t(e.key,i);if(0===n)return e.key;if(n>0)return y(e.leftChild,i);var r=y(e.rightChild,i);return void 0!==r?r:e.key}};this.reverseLowerBound=function(e){return y(a,e)};var m=function(e,i){if(e&&void 0!==e.key){if(t(e.key,i)>=0)return m(e.leftChild,i);var n=m(e.rightChild,i);return void 0!==n?n:e.key}};this.reverseUpperBound=function(e){return m(a,e)},this.union=function(e){var t=this;e.forEach((function(e){return t.insert(e)}))},this.getHeight=function(){if(this.empty())return 0;var e=function(t){return t?Math.max(e(t.leftChild),e(t.rightChild))+1:1};return e(a)};var b=function(e){return n(this,(function(t){switch(t.label){case 0:return e&&void 0!==e.key?[5,r(b(e.leftChild))]:[2];case 1:return t.sent(),[4,e.key];case 2:return t.sent(),[5,r(b(e.rightChild))];case 3:return t.sent(),[2]}}))};this[Symbol.iterator]=function(){return b(a)},e.forEach((function(e){return i.insert(e)})),Object.freeze(this)}Object.freeze(s),i.default=s},{"../Base/TreeNode":25}],34:[function(e,t,i){"use strict";function n(e){var t=this;void 0===e&&(e=[]);var i=0,n=[];this.size=function(){return i},this.empty=function(){return 0===i},this.clear=function(){i=0,n.length=0},this.push=function(e){n.push(e),++i},this.pop=function(){n.pop(),i>0&&--i},this.top=function(){return n[i-1]},e.forEach((function(e){return t.push(e)})),Object.freeze(this)}Object.defineProperty(i,"__esModule",{value:!0}),Object.freeze(n),i.default=n},{}],35:[function(e,t,i){"use strict";var n=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},r=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s},o=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function a(e){var t=this;void 0===e&&(e=[]);var i=0,a=[];this.size=function(){return i},this.empty=function(){return 0===i},this.clear=function(){i=0,a.length=0},this.front=function(){if(!this.empty())return a[0]},this.back=function(){if(!this.empty())return a[i-1]},this.forEach=function(e){a.forEach(e)},this.getElementByPos=function(e){if(e<0||e>=i)throw new Error("pos must more than 0 and less than vector's size");return a[e]},this.eraseElementByPos=function(e){if(e<0||e>=i)throw new Error("pos must more than 0 and less than vector's size");for(var t=e;t<i-1;++t)a[t]=a[t+1];this.popBack()},this.eraseElementByValue=function(e){var t=[];this.forEach((function(i){i!==e&&t.push(i)})),t.forEach((function(e,t){a[t]=e}));for(var n=t.length;i>n;)this.popBack()},this.pushBack=function(e){a.push(e),++i},this.popBack=function(){a.pop(),i>0&&--i},this.setElementByPos=function(e,t){if(e<0||e>=i)throw new Error("pos must more than 0 and less than vector's size");a[e]=t},this.insert=function(e,t,n){if(void 0===n&&(n=1),e<0||e>i)throw new Error("pos must more than 0 and less than or equal to vector's size");a.splice.apply(a,o([e,0],r(new Array(n).fill(t)),!1)),i+=n},this.find=function(e){return a.includes(e)},this.reverse=function(){a.reverse()},this.unique=function(){var e,t=[];this.forEach((function(i,n){0!==n&&i===e||(t.push(i),e=i)})),t.forEach((function(e,t){a[t]=e}));for(var n=t.length;i>n;)this.popBack()},this.sort=function(e){a.sort(e)},this[Symbol.iterator]=function(){return function(){return n(this,(function(e){switch(e.label){case 0:return[5,s(a)];case 1:return[2,e.sent()]}}))}()},e.forEach((function(e){return t.pushBack(e)})),Object.freeze(this)}Object.defineProperty(i,"__esModule",{value:!0}),Object.freeze(a),i.default=a},{}],36:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.HashMap=i.HashSet=i.Map=i.Set=i.PriorityQueue=i.Deque=i.LinkList=i.Queue=i.Stack=i.Vector=void 0;var n=e("./Vector/Vector");i.Vector=n.default;var r=e("./Stack/Stack");i.Stack=r.default;var o=e("./Queue/Queue");i.Queue=o.default;var s=e("./LinkList/LinkList");i.LinkList=s.default;var a=e("./Deque/Deque");i.Deque=a.default;var c=e("./PriorityQueue/PriorityQueue");i.PriorityQueue=c.default;var l=e("./Set/Set");i.Set=l.default;var h=e("./Map/Map");i.Map=h.default;var d=e("./HashSet/HashSet");i.HashSet=d.default;var u=e("./HashMap/HashMap");i.HashMap=u.default},{"./Deque/Deque":26,"./HashMap/HashMap":27,"./HashSet/HashSet":28,"./LinkList/LinkList":29,"./Map/Map":30,"./PriorityQueue/PriorityQueue":31,"./Queue/Queue":32,"./Set/Set":33,"./Stack/Stack":34,"./Vector/Vector":35}],37:[function(e,t,i){"use strict";const n=e("yallist"),r=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),l=Symbol("dispose"),h=Symbol("noDisposeOnSet"),d=Symbol("lruList"),u=Symbol("cache"),f=Symbol("updateAgeOnGet"),p=()=>1,v=(e,t,i)=>{const n=e[u].get(t);if(n){const t=n.value;if(x(e,t)){if(y(e,n),!e[a])return}else i&&(e[f]&&(n.value.now=Date.now()),e[d].unshiftNode(n));return t.value}},x=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const i=Date.now()-t.now;return t.maxAge?i>t.maxAge:e[c]&&i>e[c]},g=e=>{if(e[o]>e[r])for(let t=e[d].tail;e[o]>e[r]&&null!==t;){const i=t.prev;y(e,t),t=i}},y=(e,t)=>{if(t){const i=t.value;e[l]&&e[l](i.key,i.value),e[o]-=i.length,e[u].delete(i.key),e[d].removeNode(t)}};class m{constructor(e,t,i,n,r){this.key=e,this.value=t,this.length=i,this.now=n,this.maxAge=r||0}}const b=(e,t,i,n)=>{let r=i.value;x(e,r)&&(y(e,i),e[a]||(r=void 0)),r&&t.call(n,r.value,r.key,e)};t.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[r]=e.max||1/0;const t=e.length||p;if(this[s]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[l]=e.dispose,this[h]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[r]=e||1/0,g(this)}get max(){return this[r]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,g(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[s]&&(this[s]=e,this[o]=0,this[d].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),g(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let i=this[d].tail;null!==i;){const n=i.prev;b(this,e,i,t),i=n}}forEach(e,t){t=t||this;for(let i=this[d].head;null!==i;){const n=i.next;b(this,e,i,t),i=n}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[l]&&this[d]&&this[d].length&&this[d].forEach((e=>this[l](e.key,e.value))),this[u]=new Map,this[d]=new n,this[o]=0}dump(){return this[d].map((e=>!x(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,i){if((i=i||this[c])&&"number"!=typeof i)throw new TypeError("maxAge must be a number");const n=i?Date.now():0,a=this[s](t,e);if(this[u].has(e)){if(a>this[r])return y(this,this[u].get(e)),!1;const s=this[u].get(e).value;return this[l]&&(this[h]||this[l](e,s.value)),s.now=n,s.maxAge=i,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),g(this),!0}const f=new m(e,t,a,n,i);return f.length>this[r]?(this[l]&&this[l](e,t),!1):(this[o]+=f.length,this[d].unshift(f),this[u].set(e,this[d].head),g(this),!0)}has(e){if(!this[u].has(e))return!1;const t=this[u].get(e).value;return!x(this,t)}get(e){return v(this,e,!0)}peek(e){return v(this,e,!1)}pop(){const e=this[d].tail;return e?(y(this,e),e.value):null}del(e){y(this,this[u].get(e))}load(e){this.reset();const t=Date.now();for(let i=e.length-1;i>=0;i--){const n=e[i],r=n.e||0;if(0===r)this.set(n.k,n.v);else{const e=r-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[u].forEach(((e,t)=>v(this,t,!1)))}}},{yallist:83}],38:[function(e,t,i){(function(e){(function(){const i=t.exports;i.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},i.codes={};for(const e in i.types){const t=i.types[e];i.codes[t]=e}i.CMD_SHIFT=4,i.CMD_MASK=240,i.DUP_MASK=8,i.QOS_MASK=3,i.QOS_SHIFT=1,i.RETAIN_MASK=1,i.VARBYTEINT_MASK=127,i.VARBYTEINT_FIN_MASK=128,i.VARBYTEINT_MAX=268435455,i.SESSIONPRESENT_MASK=1,i.SESSIONPRESENT_HEADER=e.from([i.SESSIONPRESENT_MASK]),i.CONNACK_HEADER=e.from([i.codes.connack<<i.CMD_SHIFT]),i.USERNAME_MASK=128,i.PASSWORD_MASK=64,i.WILL_RETAIN_MASK=32,i.WILL_QOS_MASK=24,i.WILL_QOS_SHIFT=3,i.WILL_FLAG_MASK=4,i.CLEAN_SESSION_MASK=2,i.CONNECT_HEADER=e.from([i.codes.connect<<i.CMD_SHIFT]),i.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},i.propertiesCodes={};for(const e in i.properties){const t=i.properties[e];i.propertiesCodes[t]=e}function n(t){return[0,1,2].map((n=>[0,1].map((r=>[0,1].map((o=>{const s=e.alloc(1);return s.writeUInt8(i.codes[t]<<i.CMD_SHIFT|(r?i.DUP_MASK:0)|n<<i.QOS_SHIFT|o,0,!0),s}))))))}i.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},i.PUBLISH_HEADER=n("publish"),i.SUBSCRIBE_HEADER=n("subscribe"),i.SUBSCRIBE_OPTIONS_QOS_MASK=3,i.SUBSCRIBE_OPTIONS_NL_MASK=1,i.SUBSCRIBE_OPTIONS_NL_SHIFT=2,i.SUBSCRIBE_OPTIONS_RAP_MASK=1,i.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,i.SUBSCRIBE_OPTIONS_RH_MASK=3,i.SUBSCRIBE_OPTIONS_RH_SHIFT=4,i.SUBSCRIBE_OPTIONS_RH=[0,16,32],i.SUBSCRIBE_OPTIONS_NL=4,i.SUBSCRIBE_OPTIONS_RAP=8,i.SUBSCRIBE_OPTIONS_QOS=[0,1,2],i.UNSUBSCRIBE_HEADER=n("unsubscribe"),i.ACKS={unsuback:n("unsuback"),puback:n("puback"),pubcomp:n("pubcomp"),pubrel:n("pubrel"),pubrec:n("pubrec")},i.SUBACK_HEADER=e.from([i.codes.suback<<i.CMD_SHIFT]),i.VERSION3=e.from([3]),i.VERSION4=e.from([4]),i.VERSION5=e.from([5]),i.VERSION131=e.from([131]),i.VERSION132=e.from([132]),i.QOS=[0,1,2].map((t=>e.from([t]))),i.EMPTY={pingreq:e.from([i.codes.pingreq<<4,0]),pingresp:e.from([i.codes.pingresp<<4,0]),disconnect:e.from([i.codes.disconnect<<4,0])}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:17}],39:[function(e,t,i){(function(i){(function(){const n=e("./writeToStream"),r=e("events");class o extends r{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0;const t=new Array(this._array.length),n=this._array;let r,o=0;for(r=0;r<n.length&&void 0!==n[r];r++)"string"!=typeof n[r]?t[r]=n[r].length:t[r]=i.byteLength(n[r]),e+=t[r];const s=i.allocUnsafe(e);for(r=0;r<n.length&&void 0!==n[r];r++)"string"!=typeof n[r]?(n[r].copy(s,o),o+=t[r]):(s.write(n[r],o),o+=t[r]);return s}}t.exports=function(e,t){const i=new o;return n(e,i,t),i.concat()}}).call(this)}).call(this,e("buffer").Buffer)},{"./writeToStream":44,buffer:17,events:22}],40:[function(e,t,i){i.parser=e("./parser").parser,i.generate=e("./generate"),i.writeToStream=e("./writeToStream")},{"./generate":39,"./parser":43,"./writeToStream":44}],41:[function(e,t,i){(function(e){(function(){const i={},n=e.isBuffer(e.from([1,2]).subarray(0,1));function r(t){const i=e.allocUnsafe(2);return i.writeUInt8(t>>8,0),i.writeUInt8(255&t,1),i}t.exports={cache:i,generateCache:function(){for(let e=0;e<65536;e++)i[e]=r(e)},generateNumber:r,genBufVariableByteInt:function(t){let i=0,r=0;const o=e.allocUnsafe(4);do{i=t%128|0,(t=t/128|0)>0&&(i|=128),o.writeUInt8(i,r++)}while(t>0&&r<4);return t>0&&(r=0),n?o.subarray(0,r):o.slice(0,r)},generate4ByteBuffer:function(t){const i=e.allocUnsafe(4);return i.writeUInt32BE(t,0),i}}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:17}],42:[function(e,t,i){t.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}},{}],43:[function(e,t,i){const n=e("bl"),r=e("events"),o=e("./packet"),s=e("./constants"),a=e("debug")("mqtt-packet:parser");class c extends r{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof c?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new c).parser(e)}_resetState(){a("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new o,this.error=null,this._list=n(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),a("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,a("parse: state complete. _stateCounter is now: %d",this._stateCounter),a("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return a("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const e=this._list.readUInt8(0);return this.packet.cmd=s.types[e>>s.CMD_SHIFT],this.packet.retain=0!=(e&s.RETAIN_MASK),this.packet.qos=e>>s.QOS_SHIFT&s.QOS_MASK,this.packet.dup=0!=(e&s.DUP_MASK),a("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){const e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),a("_parseLength %d",e.value),!!e}_parsePayload(){a("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return a("_parsePayload complete result: %s",e),e}_parseConnect(){let e,t,i,n;a("_parseConnect");const r={},o=this.packet,c=this._parseString();if(null===c)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==c&&"MQIsdp"!==c)return this._emitError(new Error("Invalid protocolId"));if(o.protocolId=c,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(o.protocolVersion=this._list.readUInt8(this._pos),o.protocolVersion>=128&&(o.bridgeMode=!0,o.protocolVersion=o.protocolVersion-128),3!==o.protocolVersion&&4!==o.protocolVersion&&5!==o.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(r.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,r.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,r.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK,r.will&&(o.will={},o.will.retain=0!=(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),o.will.qos=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT),o.clean=0!=(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK),this._pos++,o.keepalive=this._parseNum(),-1===o.keepalive)return this._emitError(new Error("Packet too short"));if(5===o.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(o.properties=e)}const l=this._parseString();if(null===l)return this._emitError(new Error("Packet too short"));if(o.clientId=l,a("_parseConnect: packet.clientId: %s",o.clientId),r.will){if(5===o.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(o.will.properties=e)}if(null===(e=this._parseString()))return this._emitError(new Error("Cannot parse will topic"));if(o.will.topic=e,a("_parseConnect: packet.will.topic: %s",o.will.topic),null===(t=this._parseBuffer()))return this._emitError(new Error("Cannot parse will payload"));o.will.payload=t,a("_parseConnect: packet.will.paylaod: %s",o.will.payload)}if(r.username){if(null===(n=this._parseString()))return this._emitError(new Error("Cannot parse username"));o.username=n,a("_parseConnect: packet.username: %s",o.username)}if(r.password){if(null===(i=this._parseBuffer()))return this._emitError(new Error("Cannot parse password"));o.password=i}return this.settings=o,a("_parseConnect: complete"),o}_parseConnack(){a("_parseConnack");const e=this.packet;if(this._list.length<1)return null;if(e.sessionPresent=!!(this._list.readUInt8(this._pos++)&s.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}a("_parseConnack: complete")}_parsePublish(){a("_parsePublish");const e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),a("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){a("_parseSubscribe");const e=this.packet;let t,i,n,r,o,c,l;if(1!==e.qos)return this._emitError(new Error("Wrong subscribe header"));if(e.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<e.length;){if(null===(t=this._parseString()))return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));n=(i=this._parseByte())&s.SUBSCRIBE_OPTIONS_QOS_MASK,c=0!=(i>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK),o=0!=(i>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK),r=i>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,l={topic:t,qos:n},5===this.settings.protocolVersion?(l.nl=c,l.rap=o,l.rh=r):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),a("_parseSubscribe: push subscription `%s` to subscription",l),e.subscriptions.push(l)}}}_parseSuback(){a("_parseSuback");const e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseUnsubscribe(){a("_parseUnsubscribe");const e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<e.length;){const t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));a("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){a("_parseUnsuback");const e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(5===this.settings.protocolVersion){const t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseConfirmation(){a("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion&&(e.length>2?(e.reasonCode=this._parseByte(),a("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)):e.reasonCode=0,e.length>3)){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return!0}_parseDisconnect(){const e=this.packet;if(a("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?e.reasonCode=this._parseByte():e.reasonCode=0;const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return a("_parseDisconnect result: true"),!0}_parseAuth(){a("_parseAuth");const e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));e.reasonCode=this._parseByte();const t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),a("_parseAuth: result: true"),!0}_parseMessageId(){const e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(a("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){const t=this._parseNum(),i=t+this._pos;if(-1===t||i>this._list.length||i>this.packet.length)return null;const n=this._list.toString("utf8",this._pos,i);return this._pos+=t,a("_parseString: result: %s",n),n}_parseStringPair(){return a("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;const i=this._list.slice(this._pos,t);return this._pos+=e,a("_parseBuffer: result: %o",i),i}_parseNum(){if(this._list.length-this._pos<2)return-1;const e=this._list.readUInt16BE(this._pos);return this._pos+=2,a("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const e=this._list.readUInt32BE(this._pos);return this._pos+=4,a("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){a("_parseVarByteNum");let t,i=0,n=1,r=0,o=!1;const c=this._pos?this._pos:0;for(;i<4&&c+i<this._list.length;){if(r+=n*((t=this._list.readUInt8(c+i++))&s.VARBYTEINT_MASK),n*=128,0==(t&s.VARBYTEINT_FIN_MASK)){o=!0;break}if(this._list.length<=i)break}return!o&&4===i&&this._list.length>=i&&this._emitError(new Error("Invalid variable byte integer")),c&&(this._pos+=i),a("_parseVarByteNum: result: %o",o=!!o&&(e?{bytes:i,value:r}:r)),o}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),a("_parseByte: result: %o",e),e}_parseByType(e){switch(a("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){a("_parseProperties");const e=this._parseVarByteNum(),t=this._pos+e,i={};for(;this._pos<t;){const e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;const t=s.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"!==t)i[t]?(Array.isArray(i[t])||(i[t]=[i[t]]),i[t].push(this._parseByType(s.propertiesTypes[t]))):i[t]=this._parseByType(s.propertiesTypes[t]);else{i[t]||(i[t]=Object.create(null));const e=this._parseByType(s.propertiesTypes[t]);if(i[t][e.name])if(Array.isArray(i[t][e.name]))i[t][e.name].push(e.value);else{const n=i[t][e.name];i[t][e.name]=[n],i[t][e.name].push(e.value)}else i[t][e.name]=e.value}}return i}_newPacket(){return a("_newPacket"),this.packet&&(this._list.consume(this.packet.length),a("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),a("_newPacket: new packet"),this.packet=new o,this._pos=0,!0}_emitError(e){a("_emitError"),this.error=e,this.emit("error",e)}}t.exports=c},{"./constants":38,"./packet":42,bl:15,debug:18,events:22}],44:[function(e,t,i){(function(i){(function(){const n=e("./constants"),r=i.allocUnsafe(0),o=i.from([0]),s=e("./numbers"),a=e("process-nextick-args").nextTick,c=e("debug")("mqtt-packet:writeToStream"),l=s.cache,h=s.generateNumber,d=s.generateCache,u=s.genBufVariableByteInt,f=s.generate4ByteBuffer;let p=_,v=!0;function x(e,t,s){switch(c("generate called"),t.cork&&(t.cork(),a(g,t)),v&&(v=!1,d()),c("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t,r){const o=e||{},s=o.protocolId||"MQTT";let a=o.protocolVersion||4;const c=o.will;let l=o.clean;const h=o.keepalive||0,d=o.clientId||"",u=o.username,f=o.password,v=o.properties;void 0===l&&(l=!0);let x=0;if(!s||"string"!=typeof s&&!i.isBuffer(s))return t.emit("error",new Error("Invalid protocolId")),!1;if(x+=s.length+2,3!==a&&4!==a&&5!==a)return t.emit("error",new Error("Invalid protocol version")),!1;if(x+=1,("string"==typeof d||i.isBuffer(d))&&(d||a>=4)&&(d||l))x+=i.byteLength(d)+2;else{if(a<4)return t.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*l==0)return t.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof h||h<0||h>65535||h%1!=0)return t.emit("error",new Error("Invalid keepalive")),!1;if(x+=2,x+=1,5===a){var g=A(t,v);if(!g)return!1;x+=g.length}if(c){if("object"!=typeof c)return t.emit("error",new Error("Invalid will")),!1;if(!c.topic||"string"!=typeof c.topic)return t.emit("error",new Error("Invalid will topic")),!1;if(x+=i.byteLength(c.topic)+2,x+=2,c.payload){if(!(c.payload.length>=0))return t.emit("error",new Error("Invalid will payload")),!1;"string"==typeof c.payload?x+=i.byteLength(c.payload):x+=c.payload.length}var y={};if(5===a){if(!(y=A(t,c.properties)))return!1;x+=y.length}}let w=!1;if(null!=u){if(!R(u))return t.emit("error",new Error("Invalid username")),!1;w=!0,x+=i.byteLength(u)+2}if(null!=f){if(!w)return t.emit("error",new Error("Username is required to use password")),!1;if(!R(f))return t.emit("error",new Error("Invalid password")),!1;x+=E(f)+2}t.write(n.CONNECT_HEADER),m(t,x),T(t,s),o.bridgeMode&&(a+=128),t.write(131===a?n.VERSION131:132===a?n.VERSION132:4===a?n.VERSION4:5===a?n.VERSION5:n.VERSION3);let _=0;return _|=null!=u?n.USERNAME_MASK:0,_|=null!=f?n.PASSWORD_MASK:0,_|=c&&c.retain?n.WILL_RETAIN_MASK:0,_|=c&&c.qos?c.qos<<n.WILL_QOS_SHIFT:0,_|=c?n.WILL_FLAG_MASK:0,_|=l?n.CLEAN_SESSION_MASK:0,t.write(i.from([_])),p(t,h),5===a&&g.write(),T(t,d),c&&(5===a&&y.write(),b(t,c.topic),T(t,c.payload)),null!=u&&T(t,u),null!=f&&T(t,f),!0}(e,t);case"connack":return function(e,t,r){const s=r?r.protocolVersion:4,a=e||{},c=5===s?a.reasonCode:a.returnCode,l=a.properties;let h=2;if("number"!=typeof c)return t.emit("error",new Error("Invalid return code")),!1;let d=null;if(5===s){if(!(d=A(t,l)))return!1;h+=d.length}return t.write(n.CONNACK_HEADER),m(t,h),t.write(a.sessionPresent?n.SESSIONPRESENT_HEADER:o),t.write(i.from([c])),null!=d&&d.write(),!0}(e,t,s);case"publish":return function(e,t,o){c("publish: packet: %o",e);const s=o?o.protocolVersion:4,a=e||{},l=a.qos||0,h=a.retain?n.RETAIN_MASK:0,d=a.topic,u=a.payload||r,f=a.messageId,v=a.properties;let x=0;if("string"==typeof d)x+=i.byteLength(d)+2;else{if(!i.isBuffer(d))return t.emit("error",new Error("Invalid topic")),!1;x+=d.length+2}if(i.isBuffer(u)?x+=u.length:x+=i.byteLength(u),l&&"number"!=typeof f)return t.emit("error",new Error("Invalid messageId")),!1;l&&(x+=2);let g=null;if(5===s){if(!(g=A(t,v)))return!1;x+=g.length}return t.write(n.PUBLISH_HEADER[l][a.dup?1:0][h?1:0]),m(t,x),p(t,E(d)),t.write(d),l>0&&p(t,f),null!=g&&g.write(),c("publish: payload: %o",u),t.write(u)}(e,t,s);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.cmd||"puback",c=s.messageId,l=s.dup&&"pubrel"===a?n.DUP_MASK:0;let h=0;const d=s.reasonCode,u=s.properties;let f=5===o?3:2;if("pubrel"===a&&(h=1),"number"!=typeof c)return t.emit("error",new Error("Invalid messageId")),!1;let v=null;if(5===o&&"object"==typeof u){if(!(v=S(t,u,r,f)))return!1;f+=v.length}return t.write(n.ACKS[a][h][l][0]),m(t,f),p(t,c),5===o&&t.write(i.from([d])),null!==v&&v.write(),!0}(e,t,s);case"subscribe":return function(e,t,r){c("subscribe: packet: ");const o=r?r.protocolVersion:4,s=e||{},a=s.dup?n.DUP_MASK:0,l=s.messageId,h=s.subscriptions,d=s.properties;let u=0;if("number"!=typeof l)return t.emit("error",new Error("Invalid messageId")),!1;u+=2;let f=null;if(5===o){if(!(f=A(t,d)))return!1;u+=f.length}if("object"!=typeof h||!h.length)return t.emit("error",new Error("Invalid subscriptions")),!1;for(let e=0;e<h.length;e+=1){const n=h[e].topic,r=h[e].qos;if("string"!=typeof n)return t.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof r)return t.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(5===o){if("boolean"!=typeof(h[e].nl||!1))return t.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(h[e].rap||!1))return t.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;const i=h[e].rh||0;if("number"!=typeof i||i>2)return t.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}u+=i.byteLength(n)+2+1}c("subscribe: writing to stream: %o",n.SUBSCRIBE_HEADER),t.write(n.SUBSCRIBE_HEADER[1][a?1:0][0]),m(t,u),p(t,l),null!==f&&f.write();let v=!0;for(const e of h){const r=e.topic,s=e.qos,a=+e.nl,c=+e.rap,l=e.rh;let h;b(t,r),h=n.SUBSCRIBE_OPTIONS_QOS[s],5===o&&(h|=a?n.SUBSCRIBE_OPTIONS_NL:0,h|=c?n.SUBSCRIBE_OPTIONS_RAP:0,h|=l?n.SUBSCRIBE_OPTIONS_RH[l]:0),v=t.write(i.from([h]))}return v}(e,t,s);case"suback":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,c=s.granted,l=s.properties;let h=0;if("number"!=typeof a)return t.emit("error",new Error("Invalid messageId")),!1;if(h+=2,"object"!=typeof c||!c.length)return t.emit("error",new Error("Invalid qos vector")),!1;for(let e=0;e<c.length;e+=1){if("number"!=typeof c[e])return t.emit("error",new Error("Invalid qos vector")),!1;h+=1}let d=null;if(5===o){if(!(d=S(t,l,r,h)))return!1;h+=d.length}return t.write(n.SUBACK_HEADER),m(t,h),p(t,a),null!==d&&d.write(),t.write(i.from(c))}(e,t,s);case"unsubscribe":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,c=s.dup?n.DUP_MASK:0,l=s.unsubscriptions,h=s.properties;let d=0;if("number"!=typeof a)return t.emit("error",new Error("Invalid messageId")),!1;if(d+=2,"object"!=typeof l||!l.length)return t.emit("error",new Error("Invalid unsubscriptions")),!1;for(let e=0;e<l.length;e+=1){if("string"!=typeof l[e])return t.emit("error",new Error("Invalid unsubscriptions")),!1;d+=i.byteLength(l[e])+2}let u=null;if(5===o){if(!(u=A(t,h)))return!1;d+=u.length}t.write(n.UNSUBSCRIBE_HEADER[1][c?1:0][0]),m(t,d),p(t,a),null!==u&&u.write();let f=!0;for(let e=0;e<l.length;e++)f=b(t,l[e]);return f}(e,t,s);case"unsuback":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,c=s.dup?n.DUP_MASK:0,l=s.granted,h=s.properties,d=s.cmd;let u=2;if("number"!=typeof a)return t.emit("error",new Error("Invalid messageId")),!1;if(5===o){if("object"!=typeof l||!l.length)return t.emit("error",new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.emit("error",new Error("Invalid qos vector")),!1;u+=1}}let f=null;if(5===o){if(!(f=S(t,h,r,u)))return!1;u+=f.length}return t.write(n.ACKS[d][0][c][0]),m(t,u),p(t,a),null!==f&&f.write(),5===o&&t.write(i.from(l)),!0}(e,t,s);case"pingreq":case"pingresp":return function(e,t,i){return t.write(n.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,c=s.properties;let l=5===o?1:0,h=null;if(5===o){if(!(h=S(t,c,r,l)))return!1;l+=h.length}return t.write(i.from([n.codes.disconnect<<4])),m(t,l),5===o&&t.write(i.from([a])),null!==h&&h.write(),!0}(e,t,s);case"auth":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,c=s.properties;let l=5===o?1:0;5!==o&&t.emit("error",new Error("Invalid mqtt version for auth packet"));const h=S(t,c,r,l);return!!h&&(l+=h.length,t.write(i.from([n.codes.auth<<4])),m(t,l),t.write(i.from([a])),null!==h&&h.write(),!0)}(e,t,s);default:return t.emit("error",new Error("Unknown command")),!1}}function g(e){e.uncork()}Object.defineProperty(x,"cacheNumbers",{get:()=>p===_,set(e){e?(l&&0!==Object.keys(l).length||(v=!0),p=_):(v=!1,p=k)}});const y={};function m(e,t){if(t>n.VARBYTEINT_MAX)return e.emit("error",new Error(`Invalid variable byte integer: ${t}`)),!1;let i=y[t];return i||(i=u(t),t<16384&&(y[t]=i)),c("writeVarByteInt: writing to stream: %o",i),e.write(i)}function b(e,t){const n=i.byteLength(t);return p(e,n),c("writeString: %s",t),e.write(t,"utf8")}function w(e,t,i){b(e,t),b(e,i)}function _(e,t){return c("writeNumberCached: number: %d",t),c("writeNumberCached: %o",l[t]),e.write(l[t])}function k(e,t){const i=h(t);return c("writeNumberGenerated: %o",i),e.write(i)}function T(e,t){"string"==typeof t?b(e,t):t?(p(e,t.length),e.write(t)):p(e,0)}function A(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){C(e,{},0)}};let r=0;function o(t,r){let o=0;switch(n.propertiesTypes[t]){case"byte":if("boolean"!=typeof r)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=2;break;case"int8":if("number"!=typeof r||r<0||r>255)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=2;break;case"binary":if(r&&null===r)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=1+i.byteLength(r)+2;break;case"int16":if("number"!=typeof r||r<0||r>65535)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=3;break;case"int32":if("number"!=typeof r||r<0||r>4294967295)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=5;break;case"var":if("number"!=typeof r||r<0||r>268435455)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=1+i.byteLength(u(r));break;case"string":if("string"!=typeof r)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=3+i.byteLength(r.toString());break;case"pair":if("object"!=typeof r)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=Object.getOwnPropertyNames(r).reduce(((e,t)=>{const n=r[t];return Array.isArray(n)?e+=n.reduce(((e,n)=>e+(3+i.byteLength(t.toString())+2+i.byteLength(n.toString()))),0):e+=3+i.byteLength(t.toString())+2+i.byteLength(r[t].toString()),e}),0);break;default:return e.emit("error",new Error(`Invalid property ${t}: ${r}`)),!1}return o}if(t)for(const e in t){let i=0,n=0;const s=t[e];if(Array.isArray(s))for(let t=0;t<s.length;t++){if(!(n=o(e,s[t])))return!1;i+=n}else{if(!(n=o(e,s)))return!1;i=n}if(!i)return!1;r+=i}return{length:i.byteLength(u(r))+r,write(){C(e,t,r)}}}function S(e,t,i,n){const r=["reasonString","userProperties"],o=i&&i.properties&&i.properties.maximumPacketSize?i.properties.maximumPacketSize:0;let s=A(e,t);if(o)for(;n+s.length>o;){const i=r.shift();if(!i||!t[i])return!1;delete t[i],s=A(e,t)}return s}function P(e,t,r){switch(n.propertiesTypes[t]){case"byte":e.write(i.from([n.properties[t]])),e.write(i.from([+r]));break;case"int8":e.write(i.from([n.properties[t]])),e.write(i.from([r]));break;case"binary":e.write(i.from([n.properties[t]])),T(e,r);break;case"int16":e.write(i.from([n.properties[t]])),p(e,r);break;case"int32":e.write(i.from([n.properties[t]])),function(e,t){const i=f(t);c("write4ByteNumber: %o",i),e.write(i)}(e,r);break;case"var":e.write(i.from([n.properties[t]])),m(e,r);break;case"string":e.write(i.from([n.properties[t]])),b(e,r);break;case"pair":Object.getOwnPropertyNames(r).forEach((o=>{const s=r[o];Array.isArray(s)?s.forEach((r=>{e.write(i.from([n.properties[t]])),w(e,o.toString(),r.toString())})):(e.write(i.from([n.properties[t]])),w(e,o.toString(),s.toString()))}));break;default:return e.emit("error",new Error(`Invalid property ${t} value: ${r}`)),!1}}function C(e,t,i){m(e,i);for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&null!==t[i]){const n=t[i];if(Array.isArray(n))for(let t=0;t<n.length;t++)P(e,i,n[t]);else P(e,i,n)}}function E(e){return e?e instanceof i?e.length:i.byteLength(e):0}function R(e){return"string"==typeof e||e instanceof i}t.exports=x}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":38,"./numbers":41,buffer:17,debug:18,"process-nextick-args":49}],45:[function(e,t,i){var n=1e3,r=60*n,o=60*r,s=24*o;function a(e,t,i,n){var r=t>=1.5*i;return Math.round(e/i)+" "+n+(r?"s":"")}t.exports=function(e,t){t=t||{};var i=typeof e;if("string"===i&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var i=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"weeks":case"week":case"w":return 6048e5*i;case"days":case"day":case"d":return i*s;case"hours":case"hour":case"hrs":case"hr":case"h":return i*o;case"minutes":case"minute":case"mins":case"min":case"m":return i*r;case"seconds":case"second":case"secs":case"sec":case"s":return i*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}(e);if("number"===i&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=s?a(e,t,s,"day"):t>=o?a(e,t,o,"hour"):t>=r?a(e,t,r,"minute"):t>=n?a(e,t,n,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=s?Math.round(e/s)+"d":t>=o?Math.round(e/o)+"h":t>=r?Math.round(e/r)+"m":t>=n?Math.round(e/n)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],46:[function(e,t,i){const n=e("./lib/number-allocator.js");t.exports.NumberAllocator=n},{"./lib/number-allocator.js":47}],47:[function(e,t,i){"use strict";const n=e("js-sdsl").Set,r=e("debug")("number-allocator:trace"),o=e("debug")("number-allocator:error");function s(e,t){this.low=e,this.high=t}function a(e,t){if(!(this instanceof a))return new a(e,t);this.min=e,this.max=t,this.ss=new n([],((e,t)=>e.compare(t))),r("Create"),this.clear()}s.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},s.prototype.compare=function(e){return this.low<e.low&&this.high<e.low?-1:e.low<this.low&&e.high<this.low?1:0},a.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},a.prototype.alloc=function(){if(0===this.ss.size())return r("alloc():empty"),null;const e=this.ss.front(),t=e.low;return t+1<=e.high?++e.low:this.ss.eraseElementByPos(0),r("alloc():"+t),t},a.prototype.use=function(e){const t=new s(e,e),i=this.ss.lowerBound(t);if(i){if(i.equals(t))return this.ss.eraseElementByValue(i),r("use():"+e),!0;if(i.low>e)return!1;if(i.low===e)return++i.low,r("use():"+e),!0;if(i.high===e)return--i.high,r("use():"+e),!0;const n=i.low;return i.low=e+1,this.ss.insert(new s(n,e-1)),r("use():"+e),!0}return r("use():failed"),!1},a.prototype.free=function(e){if(e<this.min||e>this.max)return void o("free():"+e+" is out of range");const t=new s(e,e),i=this.ss.lowerBound(t);if(i){if(i.low<=e&&e<=i.high)return void o("free():"+e+" has already been vacant");if(i===this.ss.front())e+1===i.low?--i.low:this.ss.insert(t);else{const n=this.ss.reverseLowerBound(t);n.high+1===e?e+1===i.low?(this.ss.eraseElementByValue(n),i.low=n.low):n.high=e:e+1===i.low?i.low=e:this.ss.insert(t)}}else{if(i===this.ss.front())return void this.ss.insert(t);const n=this.ss.reverseLowerBound(t);n.high+1===e?n.high=e:this.ss.insert(t)}r("free():"+e)},a.prototype.clear=function(){r("clear()"),this.ss.clear(),this.ss.insert(new s(this.min,this.max))},a.prototype.intervalCount=function(){return this.ss.size()},a.prototype.dump=function(){console.log("length:"+this.ss.size());for(const e of this.ss)console.log(e)},t.exports=a},{debug:18,"js-sdsl":36}],48:[function(e,t,i){var n=e("wrappy");function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function o(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},i=e.name||"Function wrapped with `once`";return t.onceError=i+" shouldn't be called more than once",t.called=!1,t}t.exports=n(r),t.exports.strict=n(o),r.proto=r((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},{wrappy:79}],49:[function(e,t,i){(function(e){(function(){"use strict";void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,i,n,r){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,i)}));case 3:return e.nextTick((function(){t.call(null,i,n)}));case 4:return e.nextTick((function(){t.call(null,i,n,r)}));default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return e.nextTick((function(){t.apply(null,o)}))}}}:t.exports=e}).call(this)}).call(this,e("_process"))},{_process:50}],50:[function(e,t,i){var n,r,o=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,h=[],d=!1,u=-1;function f(){d&&l&&(d=!1,l.length?h=l.concat(h):u=-1,h.length&&p())}function p(){if(!d){var e=c(f);d=!0;for(var t=h.length;t;){for(l=h,h=[];++u<t;)l&&l[u].run();u=-1,t=h.length}l=null,d=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function v(e,t){this.fun=e,this.array=t}function x(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];h.push(new v(e,t)),1!==h.length||d||c(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=x,o.addListener=x,o.once=x,o.off=x,o.removeListener=x,o.removeAllListeners=x,o.emit=x,o.prependListener=x,o.prependOnceListener=x,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],51:[function(e,t,n){(function(e){(function(){!function(i){var r="object"==typeof n&&n&&!n.nodeType&&n,o="object"==typeof t&&t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,c,l=2147483647,h=36,d=26,u=38,f=700,p=/^xn--/,v=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=h-1,m=Math.floor,b=String.fromCharCode;function w(e){throw new RangeError(g[e])}function _(e,t){for(var i=e.length,n=[];i--;)n[i]=t(e[i]);return n}function k(e,t){var i=e.split("@"),n="";return i.length>1&&(n=i[0]+"@",e=i[1]),n+_((e=e.replace(x,".")).split("."),t).join(".")}function T(e){for(var t,i,n=[],r=0,o=e.length;r<o;)(t=e.charCodeAt(r++))>=55296&&t<=56319&&r<o?56320==(64512&(i=e.charCodeAt(r++)))?n.push(((1023&t)<<10)+(1023&i)+65536):(n.push(t),r--):n.push(t);return n}function A(e){return _(e,(function(e){var t="";return e>65535&&(t+=b((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+b(e)})).join("")}function S(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function P(e,t,i){var n=0;for(e=i?m(e/f):e>>1,e+=m(e/t);e>y*d>>1;n+=h)e=m(e/y);return m(n+(y+1)*e/(e+u))}function C(e){var t,i,n,r,o,s,a,c,u,f,p,v=[],x=e.length,g=0,y=128,b=72;for((i=e.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)e.charCodeAt(n)>=128&&w("not-basic"),v.push(e.charCodeAt(n));for(r=i>0?i+1:0;r<x;){for(o=g,s=1,a=h;r>=x&&w("invalid-input"),((c=(p=e.charCodeAt(r++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:h)>=h||c>m((l-g)/s))&&w("overflow"),g+=c*s,!(c<(u=a<=b?1:a>=b+d?d:a-b));a+=h)s>m(l/(f=h-u))&&w("overflow"),s*=f;b=P(g-o,t=v.length+1,0==o),m(g/t)>l-y&&w("overflow"),y+=m(g/t),g%=t,v.splice(g++,0,y)}return A(v)}function E(e){var t,i,n,r,o,s,a,c,u,f,p,v,x,g,y,_=[];for(v=(e=T(e)).length,t=128,i=0,o=72,s=0;s<v;++s)(p=e[s])<128&&_.push(b(p));for(n=r=_.length,r&&_.push("-");n<v;){for(a=l,s=0;s<v;++s)(p=e[s])>=t&&p<a&&(a=p);for(a-t>m((l-i)/(x=n+1))&&w("overflow"),i+=(a-t)*x,t=a,s=0;s<v;++s)if((p=e[s])<t&&++i>l&&w("overflow"),p==t){for(c=i,u=h;!(c<(f=u<=o?1:u>=o+d?d:u-o));u+=h)y=c-f,g=h-f,_.push(b(S(f+y%g,0))),c=m(y/g);_.push(b(S(c,0))),o=P(i,x,n==r),i=0,++n}++i,++t}return _.join("")}if(a={version:"1.4.1",ucs2:{decode:T,encode:A},decode:C,encode:E,toASCII:function(e){return k(e,(function(e){return v.test(e)?"xn--"+E(e):e}))},toUnicode:function(e){return k(e,(function(e){return p.test(e)?C(e.slice(4).toLowerCase()):e}))}},r&&o)if(t.exports==r)o.exports=a;else for(c in a)a.hasOwnProperty(c)&&(r[c]=a[c]);else i.punycode=a}(this)}).call(this)}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],52:[function(e,t,i){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,i,o){t=t||"&",i=i||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var l=e.length;c>0&&l>c&&(l=c);for(var h=0;h<l;++h){var d,u,f,p,v=e[h].replace(a,"%20"),x=v.indexOf(i);x>=0?(d=v.substr(0,x),u=v.substr(x+1)):(d=v,u=""),f=decodeURIComponent(d),p=decodeURIComponent(u),n(s,f)?r(s[f])?s[f].push(p):s[f]=[s[f],p]:s[f]=p}return s};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],53:[function(e,t,i){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,i,a){return t=t||"&",i=i||"=",null===e&&(e=void 0),"object"==typeof e?o(s(e),(function(s){var a=encodeURIComponent(n(s))+i;return r(e[s])?o(e[s],(function(e){return a+encodeURIComponent(n(e))})).join(t):a+encodeURIComponent(n(e[s]))})).join(t):a?encodeURIComponent(n(a))+i+encodeURIComponent(n(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var i=[],n=0;n<e.length;n++)i.push(t(e[n],n));return i}var s=Object.keys||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t}},{}],54:[function(e,t,i){"use strict";i.decode=i.parse=e("./decode"),i.encode=i.stringify=e("./encode")},{"./decode":52,"./encode":53}],55:[function(e,t,i){"use strict";var n={};function r(e,t,i){i||(i=Error);var r=function(e){var i,n;function r(i,n,r){return e.call(this,function(e,i,n){return"string"==typeof t?t:t(e,i,n)}(i,n,r))||this}return n=e,(i=r).prototype=Object.create(n.prototype),i.prototype.constructor=i,i.__proto__=n,r}(i);r.prototype.name=i.name,r.prototype.code=e,n[e]=r}function o(e,t){if(Array.isArray(e)){var i=e.length;return e=e.map((function(e){return String(e)})),i>2?"one of ".concat(t," ").concat(e.slice(0,i-1).join(", "),", or ")+e[i-1]:2===i?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,i){var n,r,s;if("string"==typeof t&&(r="not ",t.substr(0,r.length)===r)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,i){return(void 0===i||i>e.length)&&(i=e.length),e.substring(i-t.length,i)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var a=function(e,t,i){return"number"!=typeof i&&(i=0),!(i+".".length>e.length)&&-1!==e.indexOf(".",i)}(e)?"property":"argument";s='The "'.concat(e,'" ').concat(a," ").concat(n," ").concat(o(t,"type"))}return s+". Received type ".concat(typeof i)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],56:[function(e,t,i){(function(i){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};t.exports=l;var r=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(l,r);for(var s=n(o.prototype),a=0;a<s.length;a++){var c=s[a];l.prototype[c]||(l.prototype[c]=o.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);r.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||i.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":58,"./_stream_writable":60,_process:50,inherits:24}],57:[function(e,t,i){"use strict";t.exports=r;var n=e("./_stream_transform");function r(e){if(!(this instanceof r))return new r(e);n.call(this,e)}e("inherits")(r,n),r.prototype._transform=function(e,t,i){i(null,e)}},{"./_stream_transform":59,inherits:24}],58:[function(e,t,n){(function(i,n){(function(){"use strict";var r;t.exports=A,A.ReadableState=T,e("events").EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=e("./internal/streams/stream"),c=e("buffer").Buffer,l=n.Uint8Array||function(){},h=e("util");o=h&&h.debuglog?h.debuglog("stream"):function(){};var d,u,f,p=e("./internal/streams/buffer_list"),v=e("./internal/streams/destroy"),x=e("./internal/streams/state").getHighWaterMark,g=e("../errors").codes,y=g.ERR_INVALID_ARG_TYPE,m=g.ERR_STREAM_PUSH_AFTER_EOF,b=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(A,a);var _=v.errorOrDestroy,k=["error","close","destroy","pause","resume"];function T(t,i,n){r=r||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=i instanceof r),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=x(this,t,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=e("string_decoder/").StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function A(t){if(r=r||e("./_stream_duplex"),!(this instanceof A))return new A(t);var i=this instanceof r;this._readableState=new T(t,this,i),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function S(e,t,i,n,r){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?R(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}}(e,a);else if(r||(s=function(e,t){var i,n;return n=t,c.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(i=new y("chunk",["string","Buffer","Uint8Array"],t)),i}(a,t)),s)_(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n)a.endEmitted?_(e,new w):P(e,a,t,!0);else if(a.ended)_(e,new m);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!i?(t=a.decoder.write(t),a.objectMode||0!==t.length?P(e,a,t,!1):L(e,a)):P(e,a,t,!1)}else n||(a.reading=!1,L(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function P(e,t,i,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&R(e)),L(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=v.destroy,A.prototype._undestroy=v.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var i,n=this._readableState;return n.objectMode?i=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),i=!0),S(this,e,t,!1,i)},A.prototype.unshift=function(e){return S(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){d||(d=e("string_decoder/").StringDecoder);var i=new d(t);this._readableState.decoder=i,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=i.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var C=1073741824;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(I,e))}function I(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function L(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(M,e,t))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var i=t.length;if(o("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}function D(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){o("readable nexttick read 0"),e.read(0)}function O(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i);var i}function z(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(j,t,e))}function j(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var i=t._writableState;(!i||i.autoDestroy&&i.finished)&&t.destroy()}}function H(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}A.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,i=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?z(this):R(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&z(this),null;var n,r=t.needReadable;return o("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",r=!0),t.ended||t.reading?o("reading or ended",r=!1):r&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(i,t))),null===(n=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&z(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){_(this,new b("_read()"))},A.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,o("pipe count=%d opts=%j",r.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?v:c;function c(){o("onend"),e.end()}r.endEmitted?i.nextTick(a):n.once("end",a),e.on("unpipe",(function t(i,s){o("onunpipe"),i===n&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",l),e.removeListener("error",u),e.removeListener("unpipe",t),n.removeListener("end",c),n.removeListener("end",v),n.removeListener("data",d),h=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,B(e))}}(n);e.on("drain",l);var h=!1;function d(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==H(r.pipes,e))&&!h&&(o("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function u(t){o("onerror",t),v(),e.removeListener("error",u),0===s(e,"error")&&_(e,t)}function f(){e.removeListener("finish",p),v()}function p(){o("onfinish"),e.removeListener("close",f),v()}function v(){o("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",u),e.once("close",f),e.once("finish",p),e.emit("pipe",n),r.flowing||(o("pipe resume"),n.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<r;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=H(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,i)),this},A.prototype.on=function(e,t){var n=a.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,o("on readable",r.length,r.reading),r.length?R(this):r.reading||i.nextTick(N,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(D,this),n},A.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(D,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(O,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;for(var r in e.on("end",(function(){if(o("wrapped end"),i.decoder&&!i.ended){var e=i.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(r){o("wrapped data"),i.decoder&&(r=i.decoder.write(r)),(!i.objectMode||null!=r)&&(i.objectMode||r&&r.length)&&(t.push(r)||(n=!0,e.pause()))})),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var s=0;s<k.length;s++)e.on(k[s],this.emit.bind(this,k[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===u&&(u=e("./internal/streams/async_iterator")),u(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,i){return void 0===f&&(f=e("./internal/streams/from")),f(A,t,i)})}).call(this)}).call(this,e("_process"),void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/async_iterator":61,"./internal/streams/buffer_list":62,"./internal/streams/destroy":63,"./internal/streams/from":65,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,events:22,inherits:24,"string_decoder/":75,util:16}],59:[function(e,t,i){"use strict";t.exports=l;var n=e("../errors").codes,r=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=e("./_stream_duplex");function l(e){if(!(this instanceof l))return new l(e);c.call(this,e),this._transformState={afterTransform:function(e,t){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(null===n)return this.emit("error",new o);i.writechunk=null,i.writecb=null,null!=t&&this.push(t),n(e);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function h(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,i){d(e,t,i)}))}function d(e,t,i){if(t)return e.emit("error",t);if(null!=i&&e.push(i),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}e("inherits")(l,c),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,i){i(new r("_transform()"))},l.prototype._write=function(e,t,i){var n=this._transformState;if(n.writecb=i,n.writechunk=e,n.writeencoding=t,!n.transforming){var r=this._readableState;(n.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,(function(e){t(e)}))}},{"../errors":55,"./_stream_duplex":56,inherits:24}],60:[function(e,t,n){(function(i,n){(function(){"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,i){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;t.exports=A,A.WritableState=T;var s,a={deprecate:e("util-deprecate")},c=e("./internal/streams/stream"),l=e("buffer").Buffer,h=n.Uint8Array||function(){},d=e("./internal/streams/destroy"),u=e("./internal/streams/state").getHighWaterMark,f=e("../errors").codes,p=f.ERR_INVALID_ARG_TYPE,v=f.ERR_METHOD_NOT_IMPLEMENTED,x=f.ERR_MULTIPLE_CALLBACK,g=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,m=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,w=f.ERR_UNKNOWN_ENCODING,_=d.errorOrDestroy;function k(){}function T(t,n,s){o=o||e("./_stream_duplex"),t=t||{},"boolean"!=typeof s&&(s=n instanceof o),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=u(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if("function"!=typeof o)throw new x;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(I,e,t),e._writableState.errorEmitted=!0,_(e,r)):(o(r),e._writableState.errorEmitted=!0,_(e,r),I(e,t))}(e,n,r,t,o);else{var s=E(n)||e.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||C(e,n),r?i.nextTick(P,e,n,s,o):P(e,n,s,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function A(t){var i=this instanceof(o=o||e("./_stream_duplex"));if(!i&&!s.call(A,this))return new A(t);this._writableState=new T(t,this,i),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function S(e,t,i,n,r,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}function P(e,t,i,n){i||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),I(e,t)}function C(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=t.bufferedRequestCount,o=new Array(n),s=t.corkedRequestsFree;s.entry=i;for(var a=0,c=!0;i;)o[a]=i,i.isBuf||(c=!1),i=i.next,a+=1;o.allBuffers=c,S(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;i;){var l=i.chunk,h=i.encoding,d=i.callback;if(S(e,t,!1,t.objectMode?1:l.length,l,h,d),i=i.next,t.bufferedRequestCount--,t.writing)break}null===i&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function R(e,t){e._final((function(i){t.pendingcb--,i&&_(e,i),t.prefinished=!0,e.emit("prefinish"),I(e,t)}))}function I(e,t){var n=E(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(R,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}e("inherits")(A,c),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===A&&e&&e._writableState instanceof T}})):s=function(e){return e instanceof this},A.prototype.pipe=function(){_(this,new g)},A.prototype.write=function(e,t,n){var r,o=this._writableState,s=!1,a=!o.objectMode&&(r=e,l.isBuffer(r)||r instanceof h);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=k),o.ending?function(e,t){var n=new b;_(e,n),i.nextTick(t,n)}(this,n):(a||function(e,t,n,r){var o;return null===n?o=new m:"string"==typeof n||t.objectMode||(o=new p("chunk",["string","Buffer"],n)),!o||(_(e,o),i.nextTick(r,o),!1)}(this,o,e,n))&&(o.pendingcb++,s=function(e,t,i,n,r,o){if(!i){var s=function(e,t,i){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,i)),t}(t,n,r);n!==s&&(i=!0,r="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var h=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:o,next:null},h?h.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else S(e,t,!1,a,n,r,o);return c}(this,o,a,e,t,n)),s},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||C(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,i){i(new v("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,I(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=d.destroy,A.prototype._undestroy=d.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/destroy":63,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,inherits:24,"util-deprecate":78}],61:[function(e,t,i){(function(i){(function(){"use strict";var n;function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var o=e("./end-of-stream"),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),h=Symbol("lastPromise"),d=Symbol("handlePromise"),u=Symbol("stream");function f(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var i=e[u].read();null!==i&&(e[h]=null,e[s]=null,e[a]=null,t(f(i,!1)))}}var v=Object.getPrototypeOf((function(){})),x=Object.setPrototypeOf((r(n={get stream(){return this[u]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(f(void 0,!0));if(this[u].destroyed)return new Promise((function(t,n){i.nextTick((function(){e[c]?n(e[c]):t(f(void 0,!0))}))}));var n,r=this[h];if(r)n=new Promise(function(e,t){return function(i,n){e.then((function(){t[l]?i(f(void 0,!0)):t[d](i,n)}),n)}}(r,this));else{var o=this[u].read();if(null!==o)return Promise.resolve(f(o,!1));n=new Promise(this[d])}return this[h]=n,n}},Symbol.asyncIterator,(function(){return this})),r(n,"return",(function(){var e=this;return new Promise((function(t,i){e[u].destroy(null,(function(e){e?i(e):t(f(void 0,!0))}))}))})),n),v);t.exports=function(e){var t,n=Object.create(x,(r(t={},u,{value:e,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,l,{value:e._readableState.endEmitted,writable:!0}),r(t,d,{value:function(e,t){var i=n[u].read();i?(n[h]=null,n[s]=null,n[a]=null,e(f(i,!1))):(n[s]=e,n[a]=t)},writable:!0}),t));return n[h]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[a];return null!==t&&(n[h]=null,n[s]=null,n[a]=null,t(e)),void(n[c]=e)}var i=n[s];null!==i&&(n[h]=null,n[s]=null,n[a]=null,i(f(void 0,!0))),n[l]=!0})),e.on("readable",function(e){i.nextTick(p,e)}.bind(null,n)),n}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":64,_process:50}],62:[function(e,t,i){"use strict";function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=e("buffer").Buffer,a=e("util").inspect,c=a&&a.custom||"inspect";t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,i;return t=e,(i=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,i=""+t.data;t=t.next;)i+=e+t.data;return i}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,i,n,r=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,i=r,n=a,s.prototype.copy.call(t,i,n),a+=o.data.length,o=o.next;return r}},{key:"consume",value:function(e,t){var i;return e<this.head.data.length?(i=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):i=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,i=1,n=t.data;for(e-=n.length;t=t.next;){var r=t.data,o=e>r.length?r.length:e;if(o===r.length?n+=r:n+=r.slice(0,e),0==(e-=o)){o===r.length?(++i,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=r.slice(o));break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),i=this.head,n=1;for(i.data.copy(t),e-=i.data.length;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(r.copy(t,t.length-e,0,o),0==(e-=o)){o===r.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=r.slice(o));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&o(t.prototype,i),e}()},{buffer:17,util:16}],63:[function(e,t,i){(function(e){(function(){"use strict";function i(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}t.exports={destroy:function(t,o){var s=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(r,this,t)):e.nextTick(r,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!o&&t?s._writableState?s._writableState.errorEmitted?e.nextTick(n,s):(s._writableState.errorEmitted=!0,e.nextTick(i,s,t)):e.nextTick(i,s,t):o?(e.nextTick(n,s),o(t)):e.nextTick(n,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var i=e._readableState,n=e._writableState;i&&i.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:50}],64:[function(e,t,i){"use strict";var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function r(){}t.exports=function e(t,i,o){if("function"==typeof i)return e(t,null,i);i||(i={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];e.apply(this,n)}}}(o||r);var s=i.readable||!1!==i.readable&&t.readable,a=i.writable||!1!==i.writable&&t.writable,c=function(){t.writable||h()},l=t._writableState&&t._writableState.finished,h=function(){a=!1,l=!0,s||o.call(t)},d=t._readableState&&t._readableState.endEmitted,u=function(){s=!1,d=!0,a||o.call(t)},f=function(e){o.call(t,e)},p=function(){var e;return s&&!d?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!l?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},v=function(){t.req.on("finish",h)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",h),t.on("abort",p),t.req?v():t.on("request",v)):a&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",u),t.on("finish",h),!1!==i.error&&t.on("error",f),t.on("close",p),function(){t.removeListener("complete",h),t.removeListener("abort",p),t.removeListener("request",v),t.req&&t.req.removeListener("finish",h),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",h),t.removeListener("end",u),t.removeListener("error",f),t.removeListener("close",p)}}},{"../../../errors":55}],65:[function(e,t,i){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],66:[function(e,t,i){"use strict";var n,r=e("../../../errors").codes,o=r.ERR_MISSING_ARGS,s=r.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function c(e){e()}function l(e,t){return e.pipe(t)}t.exports=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var h,d=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(i);if(Array.isArray(i[0])&&(i=i[0]),i.length<2)throw new o("streams");var u=i.map((function(t,r){var o=r<i.length-1;return function(t,i,r,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:i,writable:r},(function(e){if(e)return o(e);a=!0,o()}));var c=!1;return function(e){if(!a&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}(t,o,r>0,(function(e){h||(h=e),e&&u.forEach(c),o||(u.forEach(c),d(h))}))}));return i.reduce(l)}},{"../../../errors":55,"./end-of-stream":64}],67:[function(e,t,i){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,i,r){var o=function(e,t,i){return null!=e.highWaterMark?e.highWaterMark:t?e[i]:null}(t,r,i);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(r?i:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":55}],68:[function(e,t,i){t.exports=e("events").EventEmitter},{events:22}],69:[function(e,t,i){(i=t.exports=e("./lib/_stream_readable.js")).Stream=i,i.Readable=i,i.Writable=e("./lib/_stream_writable.js"),i.Duplex=e("./lib/_stream_duplex.js"),i.Transform=e("./lib/_stream_transform.js"),i.PassThrough=e("./lib/_stream_passthrough.js"),i.finished=e("./lib/internal/streams/end-of-stream.js"),i.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":56,"./lib/_stream_passthrough.js":57,"./lib/_stream_readable.js":58,"./lib/_stream_transform.js":59,"./lib/_stream_writable.js":60,"./lib/internal/streams/end-of-stream.js":64,"./lib/internal/streams/pipeline.js":66}],70:[function(e,t,i){"use strict";t.exports=function(){if("function"!=typeof arguments[0])throw new Error("callback needed");if("number"!=typeof arguments[1])throw new Error("interval needed");var e;if(arguments.length>0){e=new Array(arguments.length-2);for(var t=0;t<e.length;t++)e[t]=arguments[t+2]}return new function(e,t,i){var n=this;this._callback=e,this._args=i,this._interval=setInterval(e,t,this._args),this.reschedule=function(e){e||(e=n._interval),n._interval&&clearInterval(n._interval),n._interval=setInterval(n._callback,e,n._args)},this.clear=function(){n._interval&&(clearInterval(n._interval),n._interval=void 0)},this.destroy=function(){n._interval&&clearInterval(n._interval),n._callback=void 0,n._interval=void 0,n._args=void 0}}(arguments[0],arguments[1],e)}},{}],71:[function(e,t,i){"use strict";t.exports=e("./index.js")()},{"./index.js":72}],72:[function(e,t,i){(function(e){(function(){"use strict";function i(t){return t instanceof e?e.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}t.exports=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(o){if("object"!=typeof o||null===o)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return r(o,e);if(o instanceof Map)return new Map(r(Array.from(o),e));if(o instanceof Set)return new Set(r(Array.from(o),e));var s={};for(var a in t.push(o),n.push(s),o){var c=o[a];if("object"!=typeof c||null===c)s[a]=c;else if(c instanceof Date)s[a]=new Date(c);else if(c instanceof Map)s[a]=new Map(r(Array.from(c),e));else if(c instanceof Set)s[a]=new Set(r(Array.from(c),e));else if(ArrayBuffer.isView(c))s[a]=i(c);else{var l=t.indexOf(c);s[a]=-1!==l?n[l]:e(c)}}return t.pop(),n.pop(),s}:function e(o){if("object"!=typeof o||null===o)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return r(o,e);if(o instanceof Map)return new Map(r(Array.from(o),e));if(o instanceof Set)return new Set(r(Array.from(o),e));var s={};for(var a in t.push(o),n.push(s),o)if(!1!==Object.hasOwnProperty.call(o,a)){var c=o[a];if("object"!=typeof c||null===c)s[a]=c;else if(c instanceof Date)s[a]=new Date(c);else if(c instanceof Map)s[a]=new Map(r(Array.from(c),e));else if(c instanceof Set)s[a]=new Set(r(Array.from(c),e));else if(ArrayBuffer.isView(c))s[a]=i(c);else{var l=t.indexOf(c);s[a]=-1!==l?n[l]:e(c)}}return t.pop(),n.pop(),s};function r(e,r){for(var o=Object.keys(e),s=new Array(o.length),a=0;a<o.length;a++){var c=o[a],l=e[c];if("object"!=typeof l||null===l)s[c]=l;else if(l instanceof Date)s[c]=new Date(l);else if(ArrayBuffer.isView(l))s[c]=i(l);else{var h=t.indexOf(l);s[c]=-1!==h?n[h]:r(l)}}return s}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var o in n){var s=n[o];"object"!=typeof s||null===s?r[o]=s:s instanceof Date?r[o]=new Date(s):s instanceof Map?r[o]=new Map(t(Array.from(s),e)):s instanceof Set?r[o]=new Set(t(Array.from(s),e)):ArrayBuffer.isView(s)?r[o]=i(s):r[o]=e(s)}return r}:function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var o in n)if(!1!==Object.hasOwnProperty.call(n,o)){var s=n[o];"object"!=typeof s||null===s?r[o]=s:s instanceof Date?r[o]=new Date(s):s instanceof Map?r[o]=new Map(t(Array.from(s),e)):s instanceof Set?r[o]=new Set(t(Array.from(s),e)):ArrayBuffer.isView(s)?r[o]=i(s):r[o]=e(s)}return r};function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),o=0;o<n.length;o++){var s=n[o],a=e[s];"object"!=typeof a||null===a?r[s]=a:a instanceof Date?r[s]=new Date(a):ArrayBuffer.isView(a)?r[s]=i(a):r[s]=t(a)}return r}}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:17}],73:[function(e,t,i){var n=e("buffer"),r=n.Buffer;function o(e,t){for(var i in e)t[i]=e[i]}function s(e,t,i){return r(e,t,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(o(n,i),i.Buffer=s),s.prototype=Object.create(r.prototype),o(r,s),s.from=function(e,t,i){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,i)},s.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=r(e);return void 0!==t?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:17}],74:[function(e,t,i){t.exports=function(e){var t,i=e._readableState;return i?i.objectMode||"number"==typeof e._duplexState?e.read():e.read((t=i).buffer.length?t.buffer.head?t.buffer.head.data.length:t.buffer[0].length:t.length):null}},{}],75:[function(e,t,i){"use strict";var n=e("safe-buffer").Buffer,r=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=h,this.end=d,t=3;break;default:return this.write=u,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,i=function(e,t,i){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==i?i:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function h(e,t){var i=(e.length-t)%3;return 0===i?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}i.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,i;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var i=function(e,t,i){var n=t.length-1;if(n<i)return 0;var r=s(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||-2===r?0:(r=s(t[n]))>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||-2===r?0:(r=s(t[n]))>=0?(r>0&&(2===r?r=0:e.lastNeed=r-3),r):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":73}],76:[function(e,t,i){"use strict";var n=e("punycode"),r=e("./util");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}i.parse=m,i.resolve=function(e,t){return m(e,!1,!0).resolve(t)},i.resolveObject=function(e,t){return e?m(e,!1,!0).resolveObject(t):t},i.format=function(e){return r.isString(e)&&(e=m(e)),e instanceof o?e.format():o.prototype.format.call(e)},i.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(l),d=["%","/","?",";","#"].concat(h),u=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=e("querystring");function m(e,t,i){if(e&&r.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,i),n}o.prototype.parse=function(e,t,i){if(!r.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(a);l[0]=l[0].replace(/\\/g,"/");var m=e=l.join(a);if(m=m.trim(),!i&&1===e.split("#").length){var b=c.exec(m);if(b)return this.path=m,this.href=m,this.pathname=b[1],b[2]?(this.search=b[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=s.exec(m);if(w){var _=(w=w[0]).toLowerCase();this.protocol=_,m=m.substr(w.length)}if(i||w||m.match(/^\/\/[^@\/]+@[^@\/]+/)){var k="//"===m.substr(0,2);!k||w&&x[w]||(m=m.substr(2),this.slashes=!0)}if(!x[w]&&(k||w&&!g[w])){for(var T,A,S=-1,P=0;P<u.length;P++)-1!==(C=m.indexOf(u[P]))&&(-1===S||C<S)&&(S=C);for(-1!==(A=-1===S?m.lastIndexOf("@"):m.lastIndexOf("@",S))&&(T=m.slice(0,A),m=m.slice(A+1),this.auth=decodeURIComponent(T)),S=-1,P=0;P<d.length;P++){var C;-1!==(C=m.indexOf(d[P]))&&(-1===S||C<S)&&(S=C)}-1===S&&(S=m.length),this.host=m.slice(0,S),m=m.slice(S),this.parseHost(),this.hostname=this.hostname||"";var E="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!E)for(var R=this.hostname.split(/\./),I=(P=0,R.length);P<I;P++){var L=R[P];if(L&&!L.match(f)){for(var M="",D=0,N=L.length;D<N;D++)L.charCodeAt(D)>127?M+="x":M+=L[D];if(!M.match(f)){var O=R.slice(0,P),B=R.slice(P+1),F=L.match(p);F&&(O.push(F[1]),B.unshift(F[2])),B.length&&(m="/"+B.join(".")+m),this.hostname=O.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),E||(this.hostname=n.toASCII(this.hostname));var z=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+z,this.href+=this.host,E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==m[0]&&(m="/"+m))}if(!v[_])for(P=0,I=h.length;P<I;P++){var H=h[P];if(-1!==m.indexOf(H)){var U=encodeURIComponent(H);U===H&&(U=escape(H)),m=m.split(H).join(U)}}var W=m.indexOf("#");-1!==W&&(this.hash=m.substr(W),m=m.slice(0,W));var V=m.indexOf("?");if(-1!==V?(this.search=m.substr(V),this.query=m.substr(V+1),t&&(this.query=y.parse(this.query)),m=m.slice(0,V)):t&&(this.search="",this.query={}),m&&(this.pathname=m),g[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){z=this.pathname||"";var q=this.search||"";this.path=z+q}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",i=this.pathname||"",n=this.hash||"",o=!1,s="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&r.isObject(this.query)&&Object.keys(this.query).length&&(s=y.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(i=i.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(m(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(r.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var i=new o,n=Object.keys(this),s=0;s<n.length;s++){var a=n[s];i[a]=this[a]}if(i.hash=e.hash,""===e.href)return i.href=i.format(),i;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),l=0;l<c.length;l++){var h=c[l];"protocol"!==h&&(i[h]=e[h])}return g[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(e.protocol&&e.protocol!==i.protocol){if(!g[e.protocol]){for(var d=Object.keys(e),u=0;u<d.length;u++){var f=d[u];i[f]=e[f]}return i.href=i.format(),i}if(i.protocol=e.protocol,e.host||x[e.protocol])i.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),i.pathname=p.join("/")}if(i.search=e.search,i.query=e.query,i.host=e.host||"",i.auth=e.auth,i.hostname=e.hostname||e.host,i.port=e.port,i.pathname||i.search){var v=i.pathname||"",y=i.search||"";i.path=v+y}return i.slashes=i.slashes||e.slashes,i.href=i.format(),i}var m=i.pathname&&"/"===i.pathname.charAt(0),b=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=b||m||i.host&&e.pathname,_=w,k=i.pathname&&i.pathname.split("/")||[],T=(p=e.pathname&&e.pathname.split("/")||[],i.protocol&&!g[i.protocol]);if(T&&(i.hostname="",i.port=null,i.host&&(""===k[0]?k[0]=i.host:k.unshift(i.host)),i.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),w=w&&(""===p[0]||""===k[0])),b)i.host=e.host||""===e.host?e.host:i.host,i.hostname=e.hostname||""===e.hostname?e.hostname:i.hostname,i.search=e.search,i.query=e.query,k=p;else if(p.length)k||(k=[]),k.pop(),k=k.concat(p),i.search=e.search,i.query=e.query;else if(!r.isNullOrUndefined(e.search))return T&&(i.hostname=i.host=k.shift(),(E=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=E.shift(),i.host=i.hostname=E.shift())),i.search=e.search,i.query=e.query,r.isNull(i.pathname)&&r.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i;if(!k.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var A=k.slice(-1)[0],S=(i.host||e.host||k.length>1)&&("."===A||".."===A)||""===A,P=0,C=k.length;C>=0;C--)"."===(A=k[C])?k.splice(C,1):".."===A?(k.splice(C,1),P++):P&&(k.splice(C,1),P--);if(!w&&!_)for(;P--;P)k.unshift("..");!w||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),S&&"/"!==k.join("/").substr(-1)&&k.push("");var E,R=""===k[0]||k[0]&&"/"===k[0].charAt(0);return T&&(i.hostname=i.host=R?"":k.length?k.shift():"",(E=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=E.shift(),i.host=i.hostname=E.shift())),(w=w||i.host&&k.length)&&!R&&k.unshift(""),k.length?i.pathname=k.join("/"):(i.pathname=null,i.path=null),r.isNull(i.pathname)&&r.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":77,punycode:51,querystring:54}],77:[function(e,t,i){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],78:[function(e,t,n){(function(e){(function(){function i(t){try{if(!e.localStorage)return!1}catch(e){return!1}var i=e.localStorage[t];return null!=i&&"true"===String(i).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var n=!1;return function(){if(!n){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],79:[function(e,t,i){t.exports=function e(t,i){if(t&&i)return e(t)(i);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),i=0;i<e.length;i++)e[i]=arguments[i];var n=t.apply(this,e),r=e[e.length-1];return"function"==typeof n&&n!==r&&Object.keys(r).forEach((function(e){n[e]=r[e]})),n}}},{}],80:[function(e,t,i){"use strict";t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},{}],81:[function(e,t,i){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var i=arguments[t];for(var r in i)n.call(i,r)&&(e[r]=i[r])}return e};var n=Object.prototype.hasOwnProperty},{}],82:[function(e,t,i){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},{}],83:[function(e,t,i){"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var i=0,r=arguments.length;i<r;i++)t.push(arguments[i]);return t}function r(e,t,i){var n=t===e.head?new a(i,null,t,e):new a(i,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,i,n){if(!(this instanceof a))return new a(e,t,i,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,i?(i.prev=this,this.next=i):this.next=null}t.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,i=e.prev;return t&&(t.prev=i),i&&(i.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=i),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var i=this.head,n=0;null!==i;n++)e.call(t,i.value,n,this),i=i.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var i=this.tail,n=this.length-1;null!==i;n--)e.call(t,i.value,n,this),i=i.prev},n.prototype.get=function(e){for(var t=0,i=this.head;null!==i&&t<e;t++)i=i.next;if(t===e&&null!==i)return i.value},n.prototype.getReverse=function(e){for(var t=0,i=this.tail;null!==i&&t<e;t++)i=i.prev;if(t===e&&null!==i)return i.value},n.prototype.map=function(e,t){t=t||this;for(var i=new n,r=this.head;null!==r;)i.push(e.call(t,r.value,this)),r=r.next;return i},n.prototype.mapReverse=function(e,t){t=t||this;for(var i=new n,r=this.tail;null!==r;)i.push(e.call(t,r.value,this)),r=r.prev;return i},n.prototype.reduce=function(e,t){var i,n=this.head;if(arguments.length>1)i=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,i=this.head.value}for(var r=0;null!==n;r++)i=e(i,n.value,r),n=n.next;return i},n.prototype.reduceReverse=function(e,t){var i,n=this.tail;if(arguments.length>1)i=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,i=this.tail.value}for(var r=this.length-1;null!==n;r--)i=e(i,n.value,r),n=n.prev;return i},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,i=this.head;null!==i;t++)e[t]=i.value,i=i.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,i=this.tail;null!==i;t++)e[t]=i.value,i=i.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var i=new n;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,o=this.head;null!==o&&r<e;r++)o=o.next;for(;null!==o&&r<t;r++,o=o.next)i.push(o.value);return i},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var i=new n;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,o=this.tail;null!==o&&r>t;r--)o=o.prev;for(;null!==o&&r>e;r--,o=o.prev)i.push(o.value);return i},n.prototype.splice=function(e,t,...i){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var s=[];for(n=0;o&&n<t;n++)s.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),n=0;n<i.length;n++)o=r(this,o,i[n]);return s},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,i=e;null!==i;i=i.prev){var n=i.prev;i.prev=i.next,i.next=n}return this.head=t,this.tail=e,this};try{e("./iterator.js")(n)}catch(e){}},{"./iterator.js":82}]},{},[12])(12)}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function e(e,t){const i=t||new Path2D;let n=e.calculative.borderRadius||0,r=n;const{x:o,y:s,width:a,height:c,ex:l,ey:h}=e.calculative.worldRect;n<1&&(n*=a,r*=c);let d=n<r?n:r;if(a<2*d&&(d=a/2),c<2*d&&(d=c/2),i.moveTo(o+d,s),i.arcTo(l,s,l,h,d),i.arcTo(l,h,o,h,d),i.arcTo(o,h,o,s,d),i.arcTo(o,s,l,s,d),i instanceof Path2D)return i}i.r(n),i.d(n,{Meta2d:()=>Sn,activityDiagram:()=>Hn,activityDiagramByCtx:()=>Un,chartsPens:()=>hs,classPens:()=>Mn,flowAnchors:()=>or,flowPens:()=>rr,formPens:()=>So,ftaAnchors:()=>$o,ftaPens:()=>Ko,ftaPensbyCtx:()=>Yo,registerEcharts:()=>Rr,registerHighcharts:()=>Ir,registerLightningChart:()=>Lr,sequencePens:()=>On,sequencePensbyCtx:()=>Bn}),i(173);const t=e;var r,o,s,a;!function(e){e[e.Node=0]="Node",e[e.Line=1]="Line"}(r||(r={})),function(e){e[e.None=0]="None",e[e.DisableEdit=1]="DisableEdit",e[e.DisableMove=2]="DisableMove",e[e.DisableScale=3]="DisableScale",e[e.DisableMoveScale=4]="DisableMoveScale",e[e.Disable=10]="Disable"}(o||(o={})),function(e){e[e.Default=0]="Default",e[e.In=1]="In",e[e.Out=2]="Out"}(s||(s={})),function(e){e[e.None=0]="None",e[e.Linear=1]="Linear",e[e.Radial=2]="Radial"}(a||(a={}));const c=["text","textWidth","textHeight","textLeft","textTop","fontFamily","fontSize","lineHeight","fontStyle","fontWeight","textAlign","textBaseline","whiteSpace","ellipsis","keepDecimal"],l=["x","y","width","height","flipX","flipY"],h=["paddingTop","paddingRight","paddingBottom","paddingLeft","flipX","flipY","visible","showChild"],d=["iconLeft","iconTop","iconRotate"];var u;!function(e){e[e.Normal=0]="Normal",e[e.Beads=1]="Beads",e[e.Dot=2]="Dot"}(u||(u={}));const f=["gif","iframe","video","echarts","highcharts","lightningCharts","leInput","leSelect","leMenu","leHeadMenu","leSliderVerify","leDropDown","leFlvPlayer","leDatePicker","leSwiper"],p=new Set(["borderRadius","rotate","paddingLeft","paddingRight","paddingTop","paddingBottom","progress","progressColor","verticalProgress","flipX","flipY","input","lineDash","lineCap","lineJoin","strokeType","lineGradientFromColor","lineGradientToColor","lineGradientAngle","color","hoverColor","activeColor","lineWidth","bkType","gradientFromColor","gradientToColor","gradientAngle","gradientRadius","hoverBackground","activeBackground","globalAlpha","anchorColor","anchorRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textHasShadow","fontFamily","fontSize","textColor","hoverTextColor","activeTextColor","textBackground","fontStyle","fontWeight","textAlign","textBaseline","lineHeight","whiteSpace","textWidth","textHeight","textLeft","textTop","ellipsis","hiddenText","keepDecimal","borderWidth","borderColor","animateLineWidth","lineAnimateType","frames","animateColor","animateType","animateReverse","background","gradientColors","lineGradientColors","animateLineWidth","gradientSmooth"]);var v,x,g,y;!function(e){e[e.None=0]="None",e[e.LineAnchor=1]="LineAnchor",e[e.NodeAnchor=2]="NodeAnchor",e[e.Line=3]="Line",e[e.Node=4]="Node",e[e.Resize=5]="Resize",e[e.Rotate=6]="Rotate",e[e.LineAnchorPrev=7]="LineAnchorPrev",e[e.LineAnchorNext=8]="LineAnchorNext"}(v||(v={})),function(e){e[e.None=0]="None",e[e.Translate=1]="Translate",e[e.Select=2]="Select",e[e.Resize=3]="Resize",e[e.AddAnchor=4]="AddAnchor"}(x||(x={})),function(e){e[e.None=0]="None",e[e.Down=1]="Down",e[e.Translate=2]="Translate"}(g||(g={})),function(e){e[e.None=-1]="None",e[e.Up=0]="Up",e[e.Right=1]="Right",e[e.Bottom=2]="Bottom",e[e.Left=3]="Left"}(y||(y={}));const m=["nw-resize","ne-resize","se-resize","sw-resize"],b=["n-resize","e-resize","s-resize","w-resize"],w=["curve","polyline","line"],_=["dash","lineWidth","lineCap","lineJoin","strokeType","color","lineGradientFromColor","lineGradientToColor","lineGradientAngle","globalAlpha","bkType","background","gradientFromColor","gradientToColor","gradientAngle","gradientRadius","fontFamily","fontSize","textColor","hoverTextColor","activeTextColor","textBackground","fontStyle","fontWeight","textAlign","textBaseline","lineHeight","whiteSpace","textLeft","textTop","flipX","flipY","lineDash"];var k,T,A;function S(e,t,i){if(!t||t%360==0)return;const n=t*Math.PI/180,r=(e.x-i.x)*Math.cos(n)-(e.y-i.y)*Math.sin(n)+i.x,o=(e.x-i.x)*Math.sin(n)+(e.y-i.y)*Math.cos(n)+i.y;e.x=r,e.y=o,e.prev&&S(e.prev,t,i),e.next&&S(e.next,t,i)}function P(e,t,i=5,n){if(t.type===A.Line){let r=n.rotate;n.flipX&&(r*=-1),n.flipY&&(r*=-1);let o=t.rotate+r;return n.flipX&&(o*=-1),n.flipY&&(o*=-1),_t(e,{x:t.x-t.length*n.calculative.canvas.store.data.scale/2,y:t.y-i,width:t.length*n.calculative.canvas.store.data.scale,height:2*i,rotate:o})}return e.x>t.x-i&&e.x<t.x+i&&e.y>t.y-i&&e.y<t.y+i}function C(e,t,i){e.x=i.x-(i.x-e.x)*t,e.y=i.y-(i.y-e.y)*t}function E(e,t){if(e.x===t.x)return e.y<=t.y?0:180;if(e.y===t.y)return e.x<t.x?270:90;const i=e.x-t.x,n=e.y-t.y;let r=Math.atan(Math.abs(i/n))/(2*Math.PI)*360;return i>0&&n>0?r=180-r:i<0&&n>0?r+=180:i<0&&n<0&&(r=360-r),r}function R(e,t){const i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}function I(e,t,i){e&&(e.x+=t,e.y+=i,e.next&&(e.next.x+=t,e.next.y+=i),e.prev&&(e.prev.x+=t,e.prev.y+=i))}function L(e,t){return e.anchorId===t.anchorId&&e.connectTo===t.connectTo}function M(e,t,i){let n=Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))/i.data.scale;0===t.rotate?e.x<t.x?i.pens[t.penId].flipX||(n*=-1):i.pens[t.penId].flipX&&(n*=-1):e.y<t.y?i.pens[t.penId].flipY||(n*=-1):i.pens[t.penId].flipY&&(n*=-1),e.distance=n}!function(e){e[e.Mirror=0]="Mirror",e[e.Bilateral=1]="Bilateral",e[e.Free=2]="Free"}(k||(k={})),function(e){e[e.Default=0]="Default",e[e.In=1]="In",e[e.Out=2]="Out",e[e.DisableConnected=3]="DisableConnected",e[e.DisableConnectTo=4]="DisableConnectTo",e[e.Disable=10]="Disable"}(T||(T={})),function(e){e[e.Default=0]="Default",e[e.Line=1]="Line"}(A||(A={}));const D="1.0.13",N={version:D,path2dDraws:{},canvasDraws:{},anchors:{},htmlElements:{}};function O(e){Object.assign(N.path2dDraws,e)}function B(e){Object.assign(N.canvasDraws,e)}function F(e){Object.assign(N.anchors,e)}var z;!function(e){e[e.None=-1]="None",e[e.Document=0]="Document",e[e.Canvas=1]="Canvas"}(z||(z={}));const j={fontFamily:'"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial',fontSize:12,lineHeight:1.5,textAlign:"center",textBaseline:"middle",color:"#222222",activeColor:"#278df8",hoverColor:"rgba(39,141,248,0.50)",anchorColor:"#278DF8",hoverAnchorColor:"#FF4101",anchorRadius:4,anchorBackground:"#fff",dockColor:"rgba(39,141,248,0.50)",dockPenColor:"#1890FF",dragColor:"#1890ff",rotateCursor:"rotate.cur",hoverCursor:"pointer",minScale:.1,maxScale:10,keydown:z.Document,gridSize:20,gridColor:"#e2e2e2",ruleColor:"#888888",drawingLineName:"curve",interval:30,animateInterval:30,autoPolyline:!0,autoAnchor:!0,animateColor:"#ff4d4f",ruleLineColor:"#FF4101",defaultAnchors:[{x:.5,y:0},{x:1,y:.5},{x:.5,y:1},{x:0,y:.5}],measureTextWidth:!0,moveConnectedLine:!0,mouseRightActive:!0,disableClipboard:!1,drawingLineLength:0,disableTouchPadScale:!1,cdn:"",polylineSpace:10,domShapes:[],textFlip:!0,textRotate:!0};var H;!function(e){e[e.Add=0]="Add",e[e.Update=1]="Update",e[e.Delete=2]="Delete"}(H||(H={}));function U(e){const{paddingTop:t,paddingBottom:i,paddingLeft:n,paddingRight:r,worldRect:o,canvas:s}=e.calculative;let{textLeft:a,textTop:c,textWidth:l,textHeight:h}=e.calculative,d=n,u=t;a&&Math.abs(a)<1&&(a*=o.width),c&&Math.abs(c)<1&&(c*=o.height);const f=o.width-n-r-(("right"===e.textAlign?-a:a)||0),p=o.height-t-i-(("bottom"===e.textBaseline?-c:c)||0);l&&l<1&&(l*=o.width),h&&h<1&&(h*=o.height),l<e.calculative.fontSize&&(l=e.calculative.fontSize),d+=(a||0)+o.x,u+=(c||0)+o.y;const v=e.textAlign||s.store.options.textAlign,x=e.textBaseline||s.store.options.textBaseline;switch(v){case"center":d+=(f-(l||f))/2;break;case"right":d+=f-(l||f)}switch(x){case"middle":u+=(p-(h||p))/2;break;case"bottom":u+=p-(h||p)}const g={x:d,y:u,width:l||f,height:h||p};At(g),e.calculative.worldTextRect=g,V(e),e.calculative.textDrawRect=void 0}function W(e,t){const i=t.calculative.fontSize*t.calculative.lineHeight,n=t.calculative.textLines.length*i,r=function(e,t){let i=0;return t.calculative.textLineWidths=[],t.calculative.textLines.forEach((n=>{const r=e.measureText(n).width;t.calculative.textLineWidths.push(r),i<r&&(i=r)})),i}(e,t),o=t.calculative.worldTextRect;let s=o.x+(o.width-r)/2,a=o.y+(o.height-n)/2;const c=t.calculative.canvas.store.options;switch(t.textAlign||c.textAlign){case"left":s=o.x;break;case"right":s=o.x+o.width-r}switch(t.textBaseline||c.textBaseline){case"top":a=o.y;break;case"bottom":a=o.ey-n}t.calculative.textDrawRect={x:s,y:a,width:r,height:n},At(t.calculative.textDrawRect)}function V(e,t=e.calculative.text){if(null==t)return void(e.calculative.textLines=[]);t=t.toString();let i=[];const n=e.calculative.fontSize*e.calculative.lineHeight,r=e.calculative.worldTextRect.height,o=Math.floor(r/n),s=o>1?o:1;switch(e.whiteSpace){case"nowrap":if(!1!==e.ellipsis){const n=K(t.split(""),e);n[0]&&(i.push(n[0]),n.length>1&&Y(i))}else i.push(t);break;case"pre-line":i=t.split(/[\n]/g),!1!==e.ellipsis&&i.length>s&&(i=i.slice(0,s),Y(i));break;default:const n=t.split(/[\n]/g);let r=0;e:for(const t of n){let n=K("break-all"===e.whiteSpace?t.split(""):q(t),e);if(0===n.length&&(n=[""]),0!=e.ellipsis)for(const e of n){if(r++,r>s){Y(i);break e}i.push(e)}else i.push(...n)}}const a=e.calculative.keepDecimal;return null!=a&&i.forEach(((e,t)=>{const n=Number(e);isNaN(n)||(i[t]=n.toFixed(a))})),e.calculative.textLines=i,i}function q(e=""){const t=[];let i="";for(let n=0;n<e.length;++n){const r=e.charCodeAt(n);r<33||r>126?(i&&(t.push(i),i=""),t.push(e[n])):i+=e[n]}return i&&t.push(i),t}function K(e,t){const i=t.calculative.canvas,n=i.offscreen.getContext("2d"),{fontStyle:r,fontWeight:o,fontSize:s,fontFamily:a,lineHeight:c}=t.calculative;n.save();const l=[];let h=e[0]||"";for(let d=1;d<e.length;++d){const u=e[d]||"",f=h+u;let p=0;if(i.store.options.measureTextWidth)n.font=Ae({fontStyle:r,fontWeight:o,fontFamily:a||i.store.options.fontFamily,fontSize:s,lineHeight:c}),p=n.measureText(f).width;else{const e=f.match(/[^\x00-\xff]/g)||"",t=e.length*s,i=f.match(/\s/g)||"";p=t+i.length*s*.3+(f.length-e.length-i.length)*s*.6}p<=t.calculative.worldTextRect.width?h+=u:(h.length&&l.push(h),h=u)}return h.length&&l.push(h),n.restore(),l}function Y(e){e[e.length-1]=e[e.length-1].slice(0,-3)+"..."}function $(e,t=!1){if(Array.isArray(e)){const i=[];return e.forEach((e=>{i.push($(e,t))})),i}if("object"==typeof e){if(null===e)return null;if(e.constructor===RegExp)return e;const i={};for(const n in e)["canvas","lastFrame"].includes(n)||e[n]instanceof HTMLImageElement||e[n]instanceof HTMLMediaElement||("calculative"!==n||t)&&(i[n]="singleton"!==n?$(e[n],t):t?{}:e[n]);return i}return e}function X(e,t,i){if(Array.isArray(e)){const n=[];return e.forEach((e=>{n.push(X(e,t,i))})),n}if("object"==typeof e){if(null===e)return null;for(const n in e)e[n]=n===t?Number(e[n])*i:X(e[n],t,i);return e}return e}const G={};function Q(e,t,i){if(!G[t.fromArrow])return;const n=$e(t),{x:r,y:o}=n,s={x:r,y:o};if(s.step=(t.fromArrowSize||10)*i.data.scale,n.next)s.rotate=E(n.next,n)+90;else{const e=t.calculative.worldAnchors[1];if(!e)return;e.prev?s.rotate=E(e.prev,n)+90:s.rotate=E(e,n)+90}e.save(),e.beginPath();const a=t.fromArrowColor||t.calculative.color;a&&(e.strokeStyle=a),G[t.fromArrow](e,t,i,s),e.restore()}function J(e,t,i){if(!G[t.toArrow]||t.calculative.worldAnchors.length<2)return;e.save();const n=Xe(t),{x:r,y:o}=n,s={x:r,y:o};if(s.step=(t.toArrowSize||10)*i.data.scale,n.prev)s.rotate=E(n.prev,n)+90;else{const e=t.calculative.worldAnchors[t.calculative.worldAnchors.length-2];e.next?s.rotate=E(e.next,n)+90:s.rotate=E(e,n)+90}e.beginPath();const a=t.toArrowColor||t.calculative.color;a&&(e.strokeStyle=a),G[t.toArrow](e,t,i,s),e.restore()}function Z(e){const t=parseInt,i=Math.round;let n=e.length,r={};if(n>9){const[i,o,s,a]=e=e.split(",");if(n=e.length,n<3||n>4)return null;r.r=t("a"==i[3]?i.slice(5):i.slice(4)),r.g=t(o),r.b=t(s),r.a=a?parseFloat(a):-1}else{if(8==n||6==n||n<4)return null;n<6&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+(n>4?e[4]+e[4]:"")),e=t(e.slice(1),16),9==n||5==n?(r.r=e>>24&255,r.g=e>>16&255,r.b=e>>8&255,r.a=i((255&e)/.255)/1e3):(r.r=e>>16,r.g=e>>8&255,r.b=255&e,r.a=-1)}return r}function ee(e,t){const i=Z(e)||{r:0,g:0,b:0};return i.a<0?`rgba(${i.r},${i.g},${i.b},${t})`:`rgba(${i.r},${i.g},${i.b},${t+i.a})`}function te(e,t){if(isNaN(e))return void console.warn("realValue not number");if("string"!=typeof t)return void console.warn("collection must be string");const[i,n]=[t[0],t[t.length-1]];if(!["[","("].includes(i))return void console.warn('collection must start with "[" or "("');if(!["]",")"].includes(n))return void console.warn('collection must end with "]" or ")"');const r=t.substring(1,t.length-1).split(",");if(2!==r.length)return void console.warn("collection must have 2 numbers");const[o,s]=[+r[0],+r[1]];if(!(o>=s))return(e>o||"["===i&&e===o)&&(e<s||"]"===n&&e===s);console.warn("startNum must less than endNum")}function ie(e,t){if(isNaN(e))return void console.warn("realValue not number");if("string"!=typeof t)return void console.warn("collection must be string");const[i,n]=[t[0],t[t.length-1]];if("["!==i||"]"!==n)return void console.warn('collection must start with "[" and end with "]"');const r=t.substring(1,t.length-1).split(",");for(const t of r)if(t.includes("..")){const[i,n]=t.split(".."),[r,o]=[+i,+n];if(r>=o)return void console.warn("startNum must less than endNum");if(e>=r&&e<=o)return!0}else if(e===+t)return!0;return!1}function ne(){return(4294967296*(1+Math.random())|0).toString(16).substring(1)}G.triangleSolid=(e,t,i,n)=>{e.save(),e.translate(n.x,n.y),e.rotate(n.rotate*Math.PI/180),e.translate(-n.x,-n.y);const r=n.x-n.step;e.moveTo(r,n.y-n.step/4),e.lineTo(n.x,n.y),e.lineTo(r,n.y+n.step/4),e.closePath(),e.stroke(),e.fillStyle=e.strokeStyle,e.fill(),e.restore()},G.triangle=(e,t,i,n)=>{e.save(),e.lineWidth<2&&(e.lineWidth=2),e.translate(n.x,n.y),e.rotate(n.rotate*Math.PI/180),e.translate(-n.x,-n.y);const r=n.x-n.step;e.moveTo(r,n.y-n.step/4),e.lineTo(n.x,n.y),e.lineTo(r,n.y+n.step/4),e.closePath(),e.stroke(),e.fillStyle=i.data.background||"#ffffff",e.fill(),e.restore()},G.circleSolid=(e,t,i,n)=>{e.save(),e.translate(n.x,n.y),e.rotate(n.rotate*Math.PI/180),e.translate(-n.x,-n.y);const r=n.step/2;e.arc(n.x-r,n.y,r,0,2*Math.PI),e.stroke(),e.fillStyle=e.strokeStyle,e.fill(),e.restore()},G.circle=(e,t,i,n)=>{e.save(),e.translate(n.x,n.y),e.rotate(n.rotate*Math.PI/180),e.translate(-n.x,-n.y);const r=n.step/2;e.arc(n.x-r,n.y,r,0,2*Math.PI),e.stroke(),e.fillStyle=i.data.background||"#ffffff",e.fill(),e.restore()},G.diamondSolid=(e,t,i,n)=>{e.save(),e.translate(n.x,n.y),e.rotate(n.rotate*Math.PI/180),e.translate(-n.x,-n.y);const r=n.x-n.step,o=n.step/2;e.moveTo(r,n.y),e.lineTo(r+o,n.y-o/2),e.lineTo(n.x,n.y),e.lineTo(r+o,n.y+o/2),e.closePath(),e.stroke(),e.fillStyle=e.strokeStyle,e.fill(),e.restore()},G.diamond=(e,t,i,n)=>{e.save(),e.translate(n.x,n.y),e.rotate(n.rotate*Math.PI/180),e.translate(-n.x,-n.y);const r=n.x-n.step,o=n.step/2;e.moveTo(r,n.y),e.lineTo(r+o,n.y-o/2),e.lineTo(n.x,n.y),e.lineTo(r+o,n.y+o/2),e.closePath(),e.stroke(),e.fillStyle=i.data.background||"#ffffff",e.fill(),e.restore()},G.line=(e,t,i,n)=>{e.save(),e.translate(n.x,n.y),e.rotate(n.rotate*Math.PI/180),e.translate(-n.x,-n.y);const r=n.x-n.step;e.moveTo(r,n.y-n.step/3),e.lineTo(n.x,n.y),e.lineTo(r,n.y+n.step/3),e.stroke(),e.restore()},G.lineUp=(e,t,i,n)=>{e.save(),e.translate(n.x,n.y),e.rotate(n.rotate*Math.PI/180),e.translate(-n.x,-n.y);const r=n.x-n.step;e.moveTo(r,n.y-n.step/3),e.lineTo(n.x,n.y),e.stroke(),e.restore()},G.lineDown=(e,t,i,n)=>{e.save(),e.translate(n.x,n.y),e.rotate(n.rotate*Math.PI/180),e.translate(-n.x,-n.y);const r=n.x-n.step;e.moveTo(r,n.y+n.step/3),e.lineTo(n.x,n.y),e.stroke(),e.restore()},globalThis.pSBC=function(e,t,i,n){let r,o,s,a,c,l,h,d=Math.round,u="string"==typeof i;return"number"!=typeof e||e<-1||e>1||"string"!=typeof t||"r"!=t[0]&&"#"!=t[0]||i&&!u?null:(h=t.length>9,h=u?i.length>9||"c"==i&&!h:h,c=Z(t),a=e<0,l=i&&"c"!=i?Z(i):a?{r:0,g:0,b:0,a:-1}:{r:255,g:255,b:255,a:-1},a=1-(e=a?-1*e:e),c&&l?(n?(r=d(a*c.r+e*l.r),o=d(a*c.g+e*l.g),s=d(a*c.b+e*l.b)):(r=d((a*c.r**2+e*l.r**2)**.5),o=d((a*c.g**2+e*l.g**2)**.5),s=d((a*c.b**2+e*l.b**2)**.5)),u=c.a,l=l.a,c=u>=0||l>=0,u=c?u<0?l:l<0?u:u*a+l*e:0,h?"rgb"+(c?"a(":"(")+r+","+o+","+s+(c?","+d(1e3*u)/1e3:"")+")":"#"+(4294967296+16777216*r+65536*o+256*s+(c?d(255*u):0)).toString(16).slice(1,c?void 0:-2)):null)};const re=e=>{let t=0,i=0,n=0,r=0;return"number"==typeof e?t=i=n=r=e:"string"==typeof e?t=i=n=r=parseInt(e,10):Array.isArray(e)&&(t=e[0],n=oe(e[1])?e[0]:e[1],r=oe(e[2])?e[0]:e[2],i=oe(e[3])?n:e[3]),[t,n,r,i]};function oe(e){return null==e}function se(e,t){if(!e||!e.parentId||!e.calculative)return;const i=e.calculative.canvas.store.pens[e.parentId];return t&&se(i,t)||i}function ae(e,t){if(!e||!e.children)return[];const i=[];return e.children.forEach((e=>{const n=t.pens[e];n&&(i.push(n),i.push(...ae(n,t)))})),i}function ce(e,t,i){const n=Math.atan(i/t)/Math.PI*180;let r=(e-90)%360,o=0;return r>n&&r<180-n||r>180+n&&r<360-n||r<0?(r>270?r=360-r:r>180?r-=180:r>90&&(r=180-r),o=Math.abs(i/Math.sin(r/180*Math.PI)/2)):(r>270?r=360-r:r>180?r-=180:r>90&&(r=180-r),o=Math.abs(t/Math.cos(r/180*Math.PI)/2)),o}function le(e){if("string"==typeof e&&e.startsWith("linear-gradient")){let t=e.slice(16,-2).split("deg,");if(t.length>1){let e=t[1].split("%,");const i=[];return e.forEach((e=>{if(/rgba?/.test(e)){let t=e.split(") ");i.push({color:he(t[0]+")"),i:parseFloat(t[1])/100})}else{let t=e.split(" ");t.length>2?i.push({color:t[1],i:parseFloat(t[2])/100}):i.push({color:t[0],i:parseFloat(t[1])/100})}})),{angle:parseFloat(t[0]),colors:i}}return{angle:parseFloat(t[0]),colors:[]}}return{angle:0,colors:[]}}function he(e){if(/rgba?/.test(e)){let t=e.split(",");if(t.length<3)return"";e="#";for(let i,n=0;i=t[n++];)n<4?(i=parseInt(i.replace(/[^\d]/gi,""),10).toString(16),e+=1==i.length?"0"+i:i):(i=i.replace(")",""),e+=parseInt(255*i+"").toString(16));e=e.toUpperCase()}return e}function de(e,t,i,n){let r=function(e,t,i,n,r){let o=0;o=Math.PI/2-Math.atan2(n-t,i-e);const s=(e+i)/2,a=(t+n)/2;return[s+r*Math.sin(90*Math.PI/180-o),a+r*-Math.cos(90*Math.PI/180-o),s+r*Math.sin(270*Math.PI/180-o),a+r*-Math.cos(270*Math.PI/180-o)]}(t[0].x,t[0].y,t[1].x,t[1].y,n),o=e.createLinearGradient(r[0],r[1],r[2],r[3]);return i.forEach((e=>{o.addColorStop(e.i,e.color)})),o}function ue(e,t,i){let n=[];t.calculative.gradientColorStop?n=t.calculative.gradientColorStop:(n=le(t.calculative.lineGradientColors).colors,t.calculative.gradientColorStop=n),e.strokeStyle=de(e,i,n,t.calculative.lineWidth/2),e.beginPath(),e.moveTo(i[0].x,i[0].y),e.lineTo(i[1].x,i[1].y),e.stroke()}function fe(e,t,i){let n=Math.sqrt((i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y));return 0===n?{x:t.x,y:t.y}:e<n?{x:t.x+(i.x-t.x)*e/n,y:t.y+(i.y-t.y)*e/n}:{x:t.x+(i.x-t.x)/n/2,y:t.y+(i.y-t.y)/n/2}}function pe(e,t,i,n,r,o){let s=fe(i,r,n),a=fe(i,r,o),c=function(e=100,t,i,n,r){let o=null;const s=[];n||r?n&&!r?o=ge:n&&r&&(o=ye):o=xe;for(let a=0;a<e;a++)s.push(o(a/e,t,i,n,r));return r?s.push(r):n&&s.push(n),s}(100,s,{x:r.x,y:r.y},a);for(let i=0;i<c.length-1;i++)ue(e,t,[{x:c[i].x,y:c[i].y},{x:c[i+1].x,y:c[i+1].y}])}function ve(e,t,i,n){let r=fe(t,i,n),o={x:i.x,y:i.y};e.quadraticCurveTo(o.x,o.y,r.x,r.y)}function xe(e,t,i){const{x:n,y:r}=t,{x:o,y:s}=i;return{x:n+(o-n)*e,y:r+(s-r)*e}}function ge(e,t,i,n){const{x:r,y:o}=t,{x:s,y:a}=i,{x:c,y:l}=n;return{x:(1-e)*(1-e)*r+2*e*(1-e)*s+e*e*c,y:(1-e)*(1-e)*o+2*e*(1-e)*a+e*e*l}}function ye(e,t,i,n,r){const{x:o,y:s}=t,{x:a,y:c}=r,{x:l,y:h}=i,{x:d,y:u}=n;return{x:o*(1-e)*(1-e)*(1-e)+3*l*e*(1-e)*(1-e)+3*d*e*e*(1-e)+a*e*e*e,y:s*(1-e)*(1-e)*(1-e)+3*h*e*(1-e)*(1-e)+3*u*e*e*(1-e)+c*e*e*e}}function me(e,t,i,n,r){if(!i||!n)return;const{x:o,y:s,center:a,ex:c,ey:l}=t,h={x:o,y:a.y},d={x:c,y:a.y};r%90==0&&r%180?(h.x=a.x,d.x=a.x,r%270?(h.y=s,d.y=l):(h.y=l,d.y=s)):r&&(S(h,r,t.center),S(d,r,t.center));const u=e.createLinearGradient(h.x,h.y,d.x,d.y);return u.addColorStop(0,i),u.addColorStop(1,n),u}function be(e,t){const{x:i,y:n,width:r,height:o}=function(e){const{worldIconRect:t,iconWidth:i,iconHeight:n,imgNaturalWidth:r,imgNaturalHeight:o}=e.calculative;let{x:s,y:a,width:c,height:l}=t;if(i&&(c=i),n&&(l=n),r&&o&&e.imageRatio){const e=t.width/r,s=t.height/o,a=Math.min(e,s),h=r/o;i?l=i/h:n?c=n*h:(c=a*r,l=a*o)}switch(s+=(t.width-c)/2,a+=(t.height-l)/2,e.iconAlign){case"top":a=t.y;break;case"bottom":a=t.ey-l;break;case"left":s=t.x;break;case"right":s=t.ex-c;break;case"left-top":s=t.x,a=t.y;break;case"right-top":s=t.ex-c,a=t.y;break;case"left-bottom":s=t.x,a=t.ey-l;break;case"right-bottom":s=t.ex-c,a=t.ey-l}return{x:s,y:a,width:c,height:l}}(t),{worldIconRect:s,iconRotate:a,img:c}=t.calculative;if(a){const{x:t,y:i}=s.center;e.translate(t,i),e.rotate(a*Math.PI/180),e.translate(-t,-i)}if(t.imageRadius){e.save();let s=t.calculative.imageRadius||0,a=s;const{x:l,y:h,width:d,height:u,ex:f,ey:p}=t.calculative.worldRect;s<1&&(s*=d,a*=u);let v=s<a?s:a;d<2*v&&(v=d/2),u<2*v&&(v=u/2),e.beginPath(),e.moveTo(l+v,h),e.arcTo(f,h,f,p,v),e.arcTo(f,p,l,p,v),e.arcTo(l,p,l,h,v),e.arcTo(l,h,f,h,v),e.clip(),e.drawImage(c,i,n,r,o),e.restore()}else e.drawImage(c,i,n,r,o)}function we(e,t){const{textColor:i,color:n}=e.calculative,{data:r,options:o}=t;return i||n||r.textColor||r.color||o.textColor||o.color}function _e(e,t){const{fontStyle:i,fontWeight:n,fontSize:r,fontFamily:o,lineHeight:s,text:a,hiddenText:c,canvas:l,textHasShadow:h,textBackground:d}=t.calculative;if(null==a||c)return;const u=l.store;let f;e.save(),h||(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),t.calculative.hover?f=t.hoverTextColor||t.hoverColor||u.options.hoverColor:t.calculative.active&&(f=t.activeTextColor||t.activeColor||u.options.activeColor),e.fillStyle=f||we(t,u),e.font=Ae({fontStyle:i,fontWeight:n,fontFamily:o||u.options.fontFamily,fontSize:r,lineHeight:s}),!t.calculative.textDrawRect&&W(e,t);const{x:p,y:v,width:x,height:g}=t.calculative.textDrawRect;d&&(e.save(),e.fillStyle=d,e.fillRect(p,v,x,g),e.restore());const y=t.textAlign||u.options.textAlign,m=r*s;t.calculative.textLines.forEach(((i,n)=>{const r=t.calculative.textLineWidths[n];let o=0;"center"===y?o=(x-r)/2:"right"===y&&(o=x-r),e.fillText(i,p+o,v+(n+.55)*m)})),e.restore()}function ke(e,t,i){if(null==i)return;const{fontStyle:n,fontWeight:r,fontSize:o,fontFamily:s,lineHeight:a,canvas:c}=t.calculative,l=c.store;let h;e.save(),t.calculative.hover?h=t.hoverTextColor||t.hoverColor||l.options.hoverColor:t.calculative.active&&(h=t.activeTextColor||t.activeColor||l.options.activeColor),e.fillStyle=h||we(t,l),e.font=Ae({fontStyle:n,fontWeight:r,fontFamily:s||l.options.fontFamily,fontSize:o,lineHeight:a});const d=e.measureText(i).width;let u,f;for(const n of t.calculative.worldAnchors){if(!f){f=n;continue}const t=R(f,n),r=Math.floor(t/d);u="";for(let e=0;e<r;e++)u+=i;const o=E(f,n)-270;if(e.save(),o%360!=0){const{x:t,y:i}=f;e.translate(t,i);let n=o*Math.PI/180;e.rotate(n),e.translate(-t,-i)}e.fillText(u,f.x,f.y+a/2),e.restore(),f=n}e.restore()}function Te(e,t){const i=t.calculative.canvas.store;e.save(),e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0,e.textAlign="center",e.textBaseline="middle";const n=t.calculative.worldIconRect;let r=n.x+n.width/2,o=n.y+n.height/2;switch(t.iconAlign){case"top":o=n.y,e.textBaseline="top";break;case"bottom":o=n.ey,e.textBaseline="bottom";break;case"left":r=n.x,e.textAlign="left";break;case"right":r=n.ex,e.textAlign="right";break;case"left-top":r=n.x,o=n.y,e.textAlign="left",e.textBaseline="top";break;case"right-top":r=n.ex,o=n.y,e.textAlign="right",e.textBaseline="top";break;case"left-bottom":r=n.x,o=n.ey,e.textAlign="left",e.textBaseline="bottom";break;case"right-bottom":r=n.ex,o=n.ey,e.textAlign="right",e.textBaseline="bottom"}const s=t.calculative.iconWeight;let a;const c=t.calculative.iconFamily;a=t.calculative.iconSize>0?t.calculative.iconSize:n.width>n.height?n.height:n.width,e.font=Ae({fontSize:a,fontWeight:s,fontFamily:c}),e.fillStyle=t.calculative.iconColor||we(t,i),t.calculative.iconRotate&&(e.translate(n.center.x,n.center.y),e.rotate(t.calculative.iconRotate*Math.PI/180),e.translate(-n.center.x,-n.center.y)),e.beginPath(),e.fillText(t.calculative.icon,r,o),e.restore()}function Ae({fontStyle:e="normal",textDecoration:t="normal",fontWeight:i="normal",fontSize:n=12,fontFamily:r="Arial",lineHeight:o=1}={}){return`${e} ${t} ${i} ${n}px/${o} ${r}`}function Se(e,t){const{x:i,ex:n,y:r,ey:o}=t.calculative.worldRect||{};t.calculative.flipX&&(e.translate(i+n+.5,.5),e.scale(-1,1)),t.calculative.flipY&&(e.translate(.5,r+o+.5),e.scale(1,-1))}function Pe(e,t,i=!1){const{x:n,y:r}=t.calculative.worldRect.center;e.translate(n,r);let o=t.calculative.rotate*Math.PI/180;i||(t.calculative.flipX&&(o*=-1),t.calculative.flipY&&(o*=-1)),e.rotate(o),e.translate(-n,-r)}function Ce(e,t){e.save(),e.translate(.5,.5),e.beginPath();const i=t.calculative.canvas.store,n=t.textFlip||i.options.textFlip,o=t.textRotate||i.options.textRotate;let s;n&&o||e.save(),Se(e,t),t.calculative.rotate&&"line"!==t.name&&Pe(e,t),t.calculative.lineWidth>1&&(e.lineWidth=t.calculative.lineWidth),function(e,t,i){if(t.fillWorldTextRect){e.save(),e.fillStyle="#c3deb7";const{x:t,y:n,width:r,height:o}=i.calculative.worldTextRect;e.fillRect(t,n,r,o),e.restore()}}(e,i,t);let c,l=!1;t.calculative.hover?(c=t.hoverColor||i.options.hoverColor,s=t.hoverBackground||i.options.hoverBackground):t.calculative.active?(c=t.activeColor||i.options.activeColor,s=t.activeBackground||i.options.activeBackground):t.calculative.isDock&&(t.type===r.Line?c=i.options.dockPenColor:s=ee(i.options.dockPenColor,.2));const h=t.calculative.strokeImg;if(t.calculative.strokeImage&&h)e.strokeStyle=c||e.createPattern(h,"repeat");else{let n;t.calculative.strokeType?t.calculative.lineGradientColors?"line"===t.name?l=!0:t.calculative.lineGradient?n=t.calculative.lineGradient:(n=function(e,t){const{x:i,y:n,ex:r,width:o,height:s,center:a}=t.calculative.worldRect;let c=[{x:r,y:n+s/2},{x:i,y:n+s/2}];const{angle:l,colors:h}=le(t.calculative.lineGradientColors);let d=ce(l,o,s);return c.forEach((e=>{S(e,l,a)})),de(e,c,h,d)}(e,t),t.calculative.lineGradient=n):n=function(e,t){const{worldRect:i,lineGradientFromColor:n,lineGradientToColor:r,lineGradientAngle:o}=t.calculative;return me(e,i,n,r,o)}(e,t):n=t.calculative.color||De(i),e.strokeStyle=c||n}const d=t.calculative.backgroundImg;if(t.calculative.backgroundImage&&d)e.fillStyle=s||e.createPattern(d,"repeat"),s=!0;else{let n;t.calculative.bkType===a.Linear?t.calculative.gradientColors?"line"!==t.name&&(t.calculative.gradient?n=t.calculative.gradient:(n=function(e,t){const{x:i,y:n,ex:r,width:o,height:s,center:a}=t.calculative.worldRect;let c=[{x:r,y:n+s/2},{x:i,y:n+s/2}];const{angle:l,colors:h}=le(t.calculative.gradientColors);let d=ce(l,o,s);return c.forEach((e=>{S(e,l,a)})),de(e,c,h,d)}(e,t),t.calculative.gradient=n)):n=function(e,t){const{worldRect:i,gradientFromColor:n,gradientToColor:r,gradientAngle:o}=t.calculative;return me(e,i,n,r,o)}(e,t):t.calculative.bkType===a.Radial?t.calculative.gradientColors?t.calculative.radialGradient?n=t.calculative.radialGradient:(n=function(e,t){const{worldRect:i,gradientColors:n,gradientRadius:r}=t.calculative;if(!n)return;const{width:o,height:s,center:a}=i,{x:c,y:l}=a;let h=o;h<s&&(h=s),h*=.5;const{colors:d}=le(n),u=e.createRadialGradient(c,l,h*(r||0),c,l,h);return d.forEach((e=>{u.addColorStop(e.i,e.color)})),u}(e,t),t.calculative.radialGradient=n):n=function(e,t){const{worldRect:i,gradientFromColor:n,gradientToColor:r,gradientRadius:o}=t.calculative;if(!n||!r)return;const{width:s,height:a,center:c}=i,{x:l,y:h}=c;let d=s;d<a&&(d=a),d*=.5;const u=e.createRadialGradient(l,h,d*(o||0),l,h,d);return u.addColorStop(0,n),u.addColorStop(1,r),u}(e,t):n=t.calculative.background||i.data.penBackground,e.fillStyle=s||n,s=!!n}if(Ee(e,t),Re(e,t),dt(e,t),t.calculative.lineDash&&e.setLineDash(t.calculative.lineDash),t.calculative.lineDashOffset&&(e.lineDashOffset=t.calculative.lineDashOffset),t.calculative.shadowColor&&(e.shadowColor=t.calculative.shadowColor,e.shadowOffsetX=t.calculative.shadowOffsetX,e.shadowOffsetY=t.calculative.shadowOffsetY,e.shadowBlur=t.calculative.shadowBlur),l?(function(e,t){const i=t.calculative.worldAnchors;let n=t.calculative.lineWidth*(t.calculative.gradientSmooth||0);for(let r=0;r<i.length-1;r++)if("curve"!==t.lineName&&"mind"!==t.lineName||!i[r].curvePoints){let o=i[r],s=i[r+1];if(r>0&&r<i.length-1){let o=i[r-1].curvePoints;pe(e,t,n,o?o[o.length-1]:i[r-1],i[r],i[r+1])}r>0&&r<i.length-1&&(o=fe(n,i[r],i[r+1])),r<i.length-2&&(s=fe(n,i[r+1],i[r])),ue(e,t,[o,s])}else{if(r>0){let o=i[r-1].curvePoints;pe(e,t,n,o?o[o.length-1]:i[r-1],i[r],i[r].curvePoints[0]),ue(e,t,[fe(n,i[r],i[r].curvePoints[0]),i[r].curvePoints[1]])}else ue(e,t,[i[r],i[r].curvePoints[0]]),ue(e,t,[i[r].curvePoints[0],i[r].curvePoints[1]]);let o=i[r].curvePoints.length-1;for(let n=1;n<o;n++)ue(e,t,[i[r].curvePoints[n],i[r].curvePoints[n+1]]);let s=fe(n,i[r+1],i[r].curvePoints[o]);ue(e,t,[i[r].curvePoints[o],s])}}(e,t),function(e=!0,t,i,n){const r=e?n.path2dMap.get(i):N.path2dDraws[i.name];r&&i.type&&(i.calculative.animatePos&&(t.save(),Me(t,i,n),t.beginPath(),r instanceof Path2D?!i.calculative.gradientSmooth||"polyline"!==i.lineName&&"line"!==i.lineName?t.stroke(r):(i.calculative.gradientAnimatePath||(i.calculative.gradientAnimatePath=function(e){const t=e.calculative.worldAnchors;let i=e.calculative.lineWidth*(e.calculative.gradientSmooth||0);const n=new Path2D;for(let e=0;e<t.length-1;e++){let r=t[e],o=t[e+1];0==e&&n.moveTo(t[e].x,t[e].y),e>0&&e<t.length-1&&(t[e-1].curvePoints,ve(n,i,t[e],t[e+1])),e>0&&e<t.length-1&&(r=fe(i,t[e],t[e+1])),e<t.length-2&&(o=fe(i,t[e+1],t[e])),n.lineTo(o.x,o.y)}return n}(i)),i.calculative.gradientAnimatePath instanceof Path2D&&t.stroke(i.calculative.gradientAnimatePath)):(r(i,t),t.stroke()),t.restore()),i.fromArrow&&Q(t,i,n),i.toArrow&&J(t,i,n),i.calculative.active&&!i.calculative.pencil&&Ne(t,i))}(!0,e,t,i)):(Le(!0,e,t,i,s),ut(e,t)),t.image&&t.calculative.img||!t.calculative.icon||Te(e,t),n&&o||e.restore(),n&&!o&&Se(e,t),!n&&o&&t.calculative.rotate&&"line"!==t.name&&Pe(e,t,!0),_e(e,t),t.type===r.Line&&t.fillTexts)for(const i of t.fillTexts)ke(e,t,i);e.restore()}function Ee(e,t){const i=t.lineCap||(t.type?"round":"square");i?e.lineCap=i:t.type&&(e.lineCap="round")}function Re(e,t){const i=t.lineJoin;i?e.lineJoin=i:t.type&&(e.lineJoin="round")}function Ie(e,t,i){e.save(),i&&e.translate(-i.x,-i.y),e.setAttrs?.(t);const n=t.calculative.canvas.store,o=t.textFlip||n.options.textFlip,s=t.textRotate||n.options.textRotate;let a;if(e.beginPath(),o&&s||e.save(),t.calculative.flipX&&(e.translate(t.calculative.worldRect.x+t.calculative.worldRect.ex,0),e.scale(-1,1)),t.calculative.flipY&&(e.translate(0,t.calculative.worldRect.y+t.calculative.worldRect.ey),e.scale(1,-1)),t.calculative.rotate&&"line"!==t.name&&Pe(e,t),t.calculative.lineWidth>1&&(e.lineWidth=t.calculative.lineWidth),t.calculative.hover?(e.strokeStyle=t.hoverColor||n.options.hoverColor,e.fillStyle=t.hoverBackground||n.options.hoverBackground,a=t.hoverBackground||n.options.hoverBackground):t.calculative.active?(e.strokeStyle=t.activeColor||n.options.activeColor,e.fillStyle=t.activeBackground||n.options.activeBackground,a=t.activeBackground||n.options.activeBackground):(t.strokeImage?t.calculative.strokeImg&&(e.strokeStyle=e.createPattern(t.calculative.strokeImg,"repeat"),a=!0):e.strokeStyle=t.calculative.color||De(n),t.backgroundImage?t.calculative.backgroundImg&&(e.fillStyle=e.createPattern(t.calculative.backgroundImg,"repeat"),a=!0):(e.fillStyle=t.background,a=!!t.background)),Ee(e,t),Re(e,t),dt(e,t),t.calculative.lineDash&&e.setLineDash(t.calculative.lineDash),t.calculative.lineDashOffset&&(e.lineDashOffset=t.calculative.lineDashOffset),t.calculative.shadowColor&&(e.shadowColor=t.calculative.shadowColor,e.shadowOffsetX=t.calculative.shadowOffsetX,e.shadowOffsetY=t.calculative.shadowOffsetY,e.shadowBlur=t.calculative.shadowBlur),Le(!1,e,t,n,a),ut(e,t),t.calculative.img?(e.save(),e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0,be(e,t),e.restore()):t.calculative.icon&&Te(e,t),o&&s||e.restore(),o&&!s&&(t.calculative.flipX&&(e.translate(t.calculative.worldRect.x+t.calculative.worldRect.ex,0),e.scale(-1,1)),t.calculative.flipY&&(e.translate(0,t.calculative.worldRect.y+t.calculative.worldRect.ey),e.scale(1,-1))),!o&&s&&t.calculative.rotate&&"line"!==t.name&&Pe(e,t,!0),_e(e,t),t.type===r.Line&&t.fillTexts)for(const i of t.fillTexts)ke(e,t,i);e.restore()}function Le(e=!0,t,i,n,o){const s=e?n.path2dMap.get(i):N.path2dDraws[i.name];if(s){if(i.type===r.Line&&i.borderWidth){t.save(),t.beginPath();const e=i.calculative.lineWidth+i.calculative.borderWidth;t.lineWidth=e,t.strokeStyle=i.borderColor,s instanceof Path2D?(o&&t.fill(s),e&&t.stroke(s)):(s(i,t),o&&t.fill(),e&&t.stroke()),t.restore()}s instanceof Path2D?o&&t.fill(s):(t.save(),s(i,t),o&&t.fill(),t.restore());const e=i.calculative.progress;if(null!=e){t.save();const{x:r,y:o,width:a,height:c,ey:l}=i.calculative.worldRect,h=i.verticalProgress?t.createLinearGradient(r,l,r,o+c*(1-e)):t.createLinearGradient(r,o,r+a*e,o),d=i.calculative.progressColor||i.calculative.color||n.options.activeColor;h.addColorStop(0,d),h.addColorStop(1,d),h.addColorStop(1,"transparent"),t.fillStyle=h,s instanceof Path2D?t.fill(s):(s(i,t),t.fill()),t.restore()}i.calculative.lineWidth&&(s instanceof Path2D?t.stroke(s):(s(i,t),t.stroke())),i.type&&(i.calculative.animatePos&&(t.save(),Me(t,i,n),s instanceof Path2D?t.stroke(s):(s(i,t),t.stroke()),t.restore()),i.fromArrow&&Q(t,i,n),i.toArrow&&J(t,i,n),i.calculative.active&&!i.calculative.pencil&&Ne(t,i))}}function Me(e,t,i){e.strokeStyle=t.animateColor||i.options.animateColor,t.calculative.animateLineWidth&&(e.lineWidth=t.calculative.animateLineWidth*i.data.scale);let n=0;switch(t.lineAnimateType){case u.Beads:t.animateReverse?e.lineDashOffset=t.calculative.animatePos:e.lineDashOffset=t.length-t.calculative.animatePos,n=t.calculative.lineWidth||5,n<5&&(n=5);const r=t.animateLineDash&&t.animateLineDash.map((e=>e*n/5));e.setLineDash(r||[n,2*n]);break;case u.Dot:t.animateReverse?e.lineDashOffset=t.calculative.animatePos:e.lineDashOffset=t.length-t.calculative.animatePos,n=t.calculative.animateDotSize||2*t.calculative.lineWidth||6,n<6&&(n=6),e.lineWidth=(t.calculative.animateLineWidth||n)*i.data.scale,e.setLineDash([.1,t.length]);break;default:t.animateReverse?e.setLineDash([0,t.length-t.calculative.animatePos+1,t.calculative.animatePos]):e.setLineDash([t.calculative.animatePos,t.length-t.calculative.animatePos])}}function De(e){const{data:t,options:i}=e;return t.color||i.color}function Ne(e,t){const i=t.calculative.canvas.store;e.save(),e.lineWidth=1,e.fillStyle=t.activeColor||i.options.activeColor,t.calculative.worldAnchors.forEach((i=>{!i.hidden&&!i.isTemp&&function(e,t,i){if(!t)return;const n=i.calculative.canvas.store.activeAnchor===i.calculative.activeAnchor&&i.calculative.activeAnchor===t;let r=3;i.calculative.lineWidth>3&&(r=i.calculative.lineWidth),i.anchorRadius&&(r=i.anchorRadius),t.radius&&(r=t.radius),n?(t.prev&&(e.save(),e.strokeStyle="#4dffff",e.beginPath(),e.moveTo(t.prev.x,t.prev.y),e.lineTo(t.x,t.y),e.stroke(),e.restore(),e.save(),e.fillStyle="#ffffff",e.beginPath(),e.arc(t.prev.x,t.prev.y,r,0,2*Math.PI),e.fill(),e.stroke(),e.restore()),t.next&&(e.save(),e.strokeStyle="#4dffff",e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(t.next.x,t.next.y),e.stroke(),e.restore(),e.save(),e.fillStyle="#ffffff",e.beginPath(),e.arc(t.next.x,t.next.y,r,0,2*Math.PI),e.fill(),e.stroke(),e.restore(),e.beginPath(),e.arc(t.x,t.y,r,0,2*Math.PI),e.fill(),e.stroke()),e.beginPath(),e.arc(t.x,t.y,r,0,2*Math.PI),e.fill(),e.stroke()):(e.save(),e.fillStyle="#ffffff",e.beginPath(),e.arc(t.x,t.y,r,0,2*Math.PI),e.fill(),e.stroke(),e.restore())}(e,i,t)})),e.restore()}function Oe(e){const t=e.calculative.canvas.store;let i={x:e.x,y:e.y};if(!e.parentId||e.parentId&&!t.pens[e.parentId])e.parentId=void 0,i.width=e.width,i.height=e.height,i.rotate=e.rotate,At(i),Tt(i);else{const n=t.pens[e.parentId];let r=n.calculative.worldRect;r||(r=Oe(n)),i.x=r.x+r.width*e.x,i.y=r.y+r.height*e.y,i.width=r.width*e.width,i.height=r.height*e.height,n.flipX&&(i.x=r.width-(i.x-r.x+i.width)+r.x),n.flipY&&(i.y=r.height-(i.y-r.y+i.height)+r.y),At(i),i.rotate=r.rotate+e.rotate,Tt(i)}return e.calculative.worldRect=i,Be(e,i),i}function Be(e,t){!e.paddingTop&&(e.calculative.paddingTop=0),!e.paddingBottom&&(e.calculative.paddingBottom=0),!e.paddingLeft&&(e.calculative.paddingLeft=0),!e.paddingRight&&(e.calculative.paddingRight=0),e.calculative.paddingTop<1&&(e.calculative.paddingTop*=t.height),e.calculative.paddingBottom<1&&(e.calculative.paddingBottom*=t.height),e.calculative.paddingLeft<1&&(e.calculative.paddingLeft*=t.width),e.calculative.paddingRight<1&&(e.calculative.paddingRight*=t.width)}function Fe(e){const t=e.calculative.worldRect;if(!e.parentId)return void Object.assign(e,t);const i=e.calculative.canvas.store.pens[e.parentId].calculative.worldRect;Object.assign(e,Dt(t,i))}function ze(e){const t=e.calculative.canvas.store;let i=[];if(e.anchors){let t=$(e.anchors);e.flipX&&t.forEach((e=>{e.x=.5-(e.x-.5)})),e.flipY&&t.forEach((e=>{e.y=.5-(e.y-.5)})),t.forEach((t=>{i.push(function(e,t){const i={...t},{x:n,y:r,width:o,height:s}=e.calculative.worldRect;return i.x=n+o*t.x,i.y=r+s*t.y,t.prev&&(i.prev={penId:e.id,connectTo:t.prev.connectTo,x:n+o*t.prev.x,y:r+s*t.prev.y}),t.next&&(i.next={penId:e.id,connectTo:t.next.connectTo,x:n+o*t.next.x,y:r+s*t.next.y}),i}(e,t))}))}if(!i.length&&!e.type&&!e.calculative.canvas.parent.isCombine(e)){const{x:n,y:r,width:o,height:s}=e.calculative.worldRect;i=t.options.defaultAnchors.map(((t,i)=>({id:`${i}`,penId:e.id,x:n+o*t.x,y:r+s*t.y})))}e.calculative.rotate&&i.forEach((t=>{S(t,e.calculative.rotate,e.calculative.worldRect.center)})),e.type&&!e.anchors||(e.calculative.worldAnchors=i),e.calculative.activeAnchor&&i.length&&(e.calculative.activeAnchor=i.find((t=>{t.id,e.calculative.activeAnchor.id}))),e.calculative.gradientAnimatePath=void 0}function je(e,t){const{paddingTop:i,paddingBottom:n,paddingLeft:r,paddingRight:o}=t.calculative;let s=r,a=i,c=t.calculative.worldRect.width-r-o,l=t.calculative.worldRect.height-i-n,h=t.calculative.iconLeft,d=t.calculative.iconTop;h&&Math.abs(h)<1&&(h=t.calculative.worldRect.width*h),d&&Math.abs(d)<1&&(d=t.calculative.worldRect.height*d),s+=h||0,a+=d||0,c-=h||0,l-=d||0;let u=t.calculative.iconRotate||0;if(t.parentId){const i=e[t.parentId].calculative;i&&(u+=i.rotate,u%=360)}s=t.calculative.worldRect.x+s,a=t.calculative.worldRect.y+a,t.calculative.worldIconRect={x:s,y:a,width:c,height:l,rotate:u},At(t.calculative.worldIconRect),Tt(t.calculative.worldIconRect)}function He(e,t,i){Mt(e.calculative.worldRect,t,i),e.calculative.initRect&&Mt(e.calculative.initRect,t,i),e.calculative.x&&C(e.calculative,t,i),e.type&&ze(e)}function Ue(e,t){if(!t||!t.calculative||!t.calculative.worldRect.center)return y.None;if(e.anchorId){let i=t.anchors.filter((t=>t.id===e.anchorId));if(i.length&&i[0].direction>-1)return i[0].direction}return function(e,t){let i=y.None;if(!t)return i;const n=e.x-t.x,r=e.y-t.y;return i=Math.abs(n)>Math.abs(r)?n>0?y.Right:y.Left:r>0?y.Bottom:y.Up,i}(e,t.calculative.worldRect.center)}function We(e,t){let i,n=1/0;return e.calculative.worldAnchors.forEach((e=>{const r=R(t,e);n>r&&(n=r,i=e)})),i}function Ve(e){if(e&&e.calculative&&e.calculative.worldAnchors.length){let t=Xe(e);if(e.anchors&&e.anchors.length)t===e.calculative.activeAnchor?e.calculative.worldAnchors=[e.calculative.worldAnchors[0]]:e.calculative.worldAnchors[0]===e.calculative.activeAnchor&&(e.calculative.worldAnchors=[e.calculative.worldAnchors[e.calculative.worldAnchors.length-1]]);else for(;e.calculative.worldAnchors.length&&t!==e.calculative.activeAnchor;)e.calculative.worldAnchors.pop(),t=Xe(e)}}function qe(e,t,i,n){if(e&&t&&i&&n&&t.twoWay!==T.DisableConnected&&t.twoWay!==T.Disable&&n.twoWay!==T.DisableConnectTo&&n.twoWay!==T.Disable){if(t.twoWay===T.In){if(1===i.calculative.worldAnchors.length)return;const e=Xe(i);if(n.id!==e.id)return}if(t.twoWay===T.Out){const e=$e(i);if(n.id!==e.id)return}if(n.connectTo!==e.id||n.anchorId!==t.id){if(n.connectTo){const t=e.calculative.canvas.store.pens[n.connectTo];Ke(t,Ye(t,n.anchorId),i,n)}return e.connectedLines||(e.connectedLines=[]),e.connectedLines.findIndex((e=>e.lineId===i.id&&e.lineAnchor===n.id&&e.anchor===t.id))<0&&e.connectedLines.push({lineId:i.id,lineAnchor:n.id,anchor:t.id}),n.connectTo=e.id,n.anchorId=t.id,e.type&&qe(i,n,e,t),e.calculative.canvas.store.emitter.emit("connectLine",{line:i,lineAnchor:n,pen:e,anchor:t}),!0}}}function Ke(e,t,i,n){if(e&&t&&i&&n&&e.connectedLines&&e.connectedLines.length)return e.connectedLines.forEach(((e,r,o)=>{e.lineId!==i.id&&e.lineId!==i.id||e.lineAnchor!==n.id||e.anchor!==t.id||o.splice(r,1)})),n.connectTo=void 0,n.anchorId=void 0,e.type&&t.connectTo===i.id&&t.anchorId===n.id&&Ke(i,n,e,t),e.calculative.canvas.store.emitter.emit("disconnectLine",{line:i,lineAnchor:n,pen:e,anchor:t}),!0}function Ye(e,t){if(e&&t)return e.calculative.worldAnchors?.find((e=>e.id===t))}function $e(e){if(e&&e.calculative.worldAnchors)return e.calculative.worldAnchors[0]}function Xe(e){if(e&&e.calculative.worldAnchors)return e.calculative.worldAnchors[e.calculative.worldAnchors.length-1]}function Ge(e,t){if(0===e.calculative.start||!e.frames||!e.frames.length)return e.calculative.start=void 0,0;if(!e.calculative.duration){e.calculative.duration=0;for(const t of e.frames){e.calculative.duration+=t.duration;for(const i in t)"duration"===i||e[i]||"scale"===i&&(e[i]=1)}}if(e.animateCycle||(e.animateCycle=1/0),e.calculative.start){let i=0;const n=Math.ceil((t-e.calculative.start)/e.calculative.duration);if(n>e.animateCycle)return e.currentAnimation=void 0,e.calculative.start=void 0,Je(e,1),0;const r=(t-e.calculative.start)%e.calculative.duration;let o=0;for(const t of e.frames){if(o+=t.duration,!(r>o))break;++i}if(!e.frames[i])return!0;e.calculative.frameDuration=e.frames[i].duration,e.calculative.frameStart=e.calculative.start+e.calculative.duration*(n-1),e.calculative.frameEnd=e.calculative.frameStart+e.calculative.frameDuration;const s=i!==e.calculative.frameIndex,a=n>e.calculative.cycleIndex;if(s&&(e.calculative.frameIndex=i),a&&(e.calculative.cycleIndex=n),s||a)if(e.calculative.x=e.calculative.initRect.x,e.calculative.y=e.calculative.initRect.y,e.calculative.rotate=e.calculative.initRect.rotate||0,i>0){e.prevFrame={};const t=e.frames[i-1];for(const i in t)e.prevFrame[i]=t[i];Object.assign(e.prevFrame,{rotate:t.rotate||0,x:t.x||0,y:t.y||0,scale:t.scale||1})}else Qe(e)}else e.calculative.start=t,e.calculative.frameIndex=0,e.calculative.frameStart=e.calculative.start,e.calculative.frameDuration=e.frames[0].duration,e.calculative.frameEnd=e.calculative.frameStart+e.calculative.frameDuration,e.calculative.cycleIndex=1,e.calculative.x=e.calculative.worldRect.x,e.calculative.y=e.calculative.worldRect.y,e.calculative.initRect=$(e.calculative.worldRect),e.calculative.initRect.rotate=e.calculative.rotate||0,Qe(e);return Je(e,(t-e.calculative.frameStart)/e.calculative.frameDuration%1),!0}function Qe(e){e.prevFrame={};for(const t in e)"object"==typeof e[t]&&"lineDash"!==t||(e.prevFrame[t]=e[t]);e.prevFrame.rotate=0,e.prevFrame.x=0,e.prevFrame.y=0,e.prevFrame.scale=1}function Je(e,t){if(t<0)return;t>1&&(t=1);const i=e.frames[e.calculative.frameIndex];for(const n in i)if("duration"!==n){if("scale"===n){e.calculative.worldRect=$(e.calculative.initRect),Mt(e.calculative.worldRect,e.prevFrame.scale,e.calculative.worldRect.center);const r=e.prevFrame.scale+(i[n]-e.prevFrame.scale)*t;Mt(e.calculative.worldRect,r/e.prevFrame.scale,e.calculative.worldRect.center),e.calculative.patchFlags=!0}else if("x"===n){const r=ct(e,n,e.calculative.frameIndex);e.calculative.worldRect.x=e.calculative.initRect.x+r,e.calculative.worldRect.ex=e.calculative.initRect.ex+r,Rt(e.calculative.worldRect,i[n]*t*e.calculative.canvas.store.data.scale,0),e.calculative.patchFlags=!0}else if("y"===n){const r=ct(e,n,e.calculative.frameIndex);e.calculative.worldRect.y=e.calculative.initRect.y+r,e.calculative.worldRect.ey=e.calculative.initRect.ey+r,Rt(e.calculative.worldRect,0,i[n]*t*e.calculative.canvas.store.data.scale),e.calculative.patchFlags=!0}else if("rotate"===n){e.prevFrame[n]>=360&&(e.prevFrame[n]%=360);const r=ct(e,n,e.calculative.frameIndex),o=(e.calculative.initRect.rotate+r+i[n]*t)%360-e.calculative.rotate;e.children?.length?e.calculative.canvas.rotatePen(e,o,e.calculative.initRect):e.calculative.rotate=(e.calculative.initRect.rotate+r+i[n]*t)%360,e.calculative.patchFlags=!0}else if("image"===n)e.image=i.image,e.calculative.image=void 0,e.calculative.canvas.loadImage(e),e.isBottom?e.calculative.canvas.canvasImageBottom.init():e.calculative.canvas.canvasImage.init();else if(Ze(i[n],n,e)){null==e.prevFrame[n]&&(e.prevFrame[n]="globalAlpha"===n?1:0);const r=e.prevFrame[n]+(i[n]-e.prevFrame[n])*t;e.calculative[n]=Math.round(100*r)/100}else{"visible"===n&&e.calculative.image&&(e.isBottom?e.calculative.canvas.canvasImageBottom.init():e.calculative.canvas.canvasImage.init()),e.calculative[n]=i[n];const t={};t[n]=i[n],ft(e,t)}"text"===n&&V(e)}}function Ze(e,t,i){return"number"==typeof e&&!1!==i.linear&&!["strokeType","bkType","showChild"].includes(t)}function et(e,t){if(0===e.calculative.start)return e.calculative.start=void 0,0;if(e.animateCycle||(e.animateCycle=1/0),e.animateSpan||(e.animateSpan=1),e.calculative.animatePos+=e.animateSpan*(e.calculative.canvas.store.data.scale||1),e.calculative.start){if(e.calculative.animatePos>e.length){if(++e.calculative.cycleIndex,e.calculative.cycleIndex>e.animateCycle)return e.currentAnimation=void 0,e.calculative.start=void 0,0;e.calculative.animatePos=e.animateSpan}}else e.calculative.start=Date.now(),e.calculative.animatePos=e.animateSpan*(e.calculative.canvas.store.data.scale||1),e.calculative.cycleIndex=1;return!0}function tt(e,t=!0){if(!e.children)return;const i=e.calculative.canvas.store;e.children.forEach((e=>{const n=i.pens[e];n&&(n.calculative.active=t,tt(n,t))}))}function it(e,t=!0){if(!e)return;const i=e.calculative.canvas.store;e.calculative.hover=t,e.children&&e.children.forEach((e=>{null==i.pens[e]?.hoverColor&&null==i.pens[e]?.hoverBackground&&it(i.pens[e],t)}))}function nt(e,t){if(!t)return;const i=e.calculative.canvas.store,n=e.calculative.worldRect;t.style.opacity=e.globalAlpha+"",t.style.position="absolute",t.style.outline="none",t.style.left=n.x+i.data.x+"px",t.style.top=n.y+i.data.y+"px",t.style.width=n.width+"px",t.style.height=n.height+"px",t.style.display=0!=e.calculative.inView?e.calculative.cssDisplay||"inline":"none",!e.calculative.rotate&&(e.calculative.rotate=0),t.style.transform=`rotate(${e.calculative.rotate}deg)`,e.calculative.rotate||(e.calculative.flipX&&(t.style.transform="rotateY(180deg)"),e.calculative.flipY&&(t.style.transform="rotateX(180deg)"),e.calculative.flipX&&e.calculative.flipY&&(t.style.transform="rotateZ(180deg)")),t.style.zIndex=void 0!==e.calculative.zIndex?e.calculative.zIndex+"":"4",e.calculative.zIndex>e.calculative.canvas.maxZindex&&(e.calculative.canvas.maxZindex=e.calculative.zIndex),e.locked===o.DisableEdit||e.locked===o.DisableMove||i.data.locked?(t.style.userSelect="initial",t.style.pointerEvents="initial","gif"===e.name&&(t.style.userSelect="none",t.style.pointerEvents="none")):(t.style.userSelect="none",t.style.pointerEvents="none")}function rt(e){return e.every((e=>e.locked))}function ot(e){return e.every((e=>e.disableRotate))}function st(e,t,i){e.type?(e.calculative.worldAnchors.forEach((e=>{S(e,t,i.center)})),function(e){if(!e.calculative.worldAnchors?.length)return;if(!isFinite(e.x)||!isFinite(e.x))return;if(null==e.x||null==e.y)return;const t=ti(e);e.parentId||Object.assign(e,t);const{fontSize:i,lineHeight:n}=e.calculative.canvas.store.options;e.fontSize||(e.fontSize=i,e.calculative.fontSize=e.fontSize*e.calculative.canvas.store.data.scale),e.lineHeight||(e.lineHeight=n,e.calculative.lineHeight=e.lineHeight),Tt(t),e.calculative.worldRect=t,Be(e,t),U(e),e.calculative.worldAnchors&&(e.anchors=e.calculative.worldAnchors.map((t=>Nt(t,e.calculative.worldRect))))}(e),Fe(e)):(e.calculative.rotate?e.calculative.rotate+=t:e.calculative.rotate=t,S(e.calculative.worldRect.center,t,i.center),e.parentId&&(e.calculative.worldRect.x=e.calculative.worldRect.center.x-e.calculative.worldRect.width/2,e.calculative.worldRect.y=e.calculative.worldRect.center.y-e.calculative.worldRect.height/2,e.x=(e.calculative.worldRect.x-i.x)/i.width,e.y=(e.calculative.worldRect.y-i.y)/i.height)),e.children?.forEach((n=>{st(e.calculative.canvas.store.pens[n],t,i)}))}function at(e){return e.every((e=>e.disableSize))}function ct(e,t,i){if(!e.frames||!t)return 0;let n=0;for(let r=0;r<i;r++)e.frames[r]&&(n+=e.frames[r][t]||0);return n}function lt(e,t){let i=e;for(;i&&i.parentId;){const e=i;i=t.pens[i.parentId];const n=i?.calculative?.showChild;if(null!=n&&i.children[n]!==e.id)return!1}return!0}function ht(e,t=!1){const{store:i,canvasRect:n}=e.calculative.canvas;if(t&&e.children?.forEach((e=>{const t=i.pens[e];t&&ht(t,!0)})),e.calculative.inView=!0,lt(e,i)&&0!=e.visible&&0!=e.calculative.visible){const{x:t,y:r,width:o,height:s,rotate:a}=e.calculative.worldRect,c={x:t+i.data.x,y:r+i.data.y,width:o,height:s,rotate:a};At(c),Et(c,n)||(e.calculative.inView=!1)}else e.calculative.inView=!1;e.onMove?.(e)}function dt(e,t){const i=t.calculative.globalAlpha;(i<1||""!==i)&&(e.globalAlpha=i)}function ut(e,t){const i=N.canvasDraws[t.name];i&&(e.save(),i(e,t),e.restore())}function ft(e,t){for(const i in t)_.includes(i)&&(e[i]=t[i],"fontSize"===i?(e.calculative[i]=t[i]*e.calculative.canvas.store.data.scale,U(e)):e.calculative[i]=t[i]);if(e.calculative.canvas.parent.isCombine(e)&&void 0===e.showChild){const i=e.children;i?.forEach((i=>{const n=e.calculative.canvas.store.pens[i];n&&ft(n,t)}))}}function pt(e,t,i){let n,r,o=1/0,s=1/0;for(const a of e.data.pens)!1!==a.calculative.inView&&xt(a).forEach((e=>{if(e===t||e===i)return;let c=(a.calculative.worldRect.center.x-t.x)*(a.calculative.worldRect.center.x-t.x)+(a.calculative.worldRect.center.y-t.y)*(a.calculative.worldRect.center.y-t.y);const l=Math.abs(e.x-t.x);l>0&&l<8&&c<o&&(n={x:Math.round(e.x)+.5,y:Math.round(e.y)+.5,prev:{x:Math.round(t.x)+.5,y:Math.round(t.y)+.5},step:e.x-t.x},o=c);const h=Math.abs(e.y-t.y);h>0&&h<8&&c<s&&(r={x:Math.round(e.x)+.5,y:Math.round(e.y)+.5,prev:{x:Math.round(t.x)+.5,y:Math.round(t.y)+.5},step:e.y-t.y},s=c)}));return{xDock:n,yDock:r}}function vt(e,t,i,n){let r=[];return 1===i.length?(r=$(xt(i[0])),r.forEach((e=>{e.x+=n.x,e.y+=n.y}))):(Tt(t),r=[t.center,...Pt(t)]),yt(e,r,t,!0)}function xt(e){if(!e.type){const t=Pt(e.calculative.worldRect);return Tt(e.calculative.worldRect),[...e.calculative.worldAnchors,...t,e.calculative.worldRect.center]}if(e.type===r.Line)return e.calculative.worldAnchors}function gt(e,t,i,n){return yt(e,Pt(t),t)}function yt(e,t,i,n=!1){let r,o,s=1/0,a=1/0;const c=function(e,t){const i=re(10),n={x:e.x-i[3],y:e.y-i[0],width:e.width+i[1]+i[3],height:e.height+i[0]+i[2]};return At(n),n}(i);return e.data.pens.forEach((l=>{const{inView:h,worldRect:d,active:u}=l.calculative;if(!1===h||!n&&u||(f=c,((p=d).x>f.ex||p.ex<f.x)&&(p.y>f.ey||p.ey<f.y))||l.type&&e.active.some((t=>mt(e,t,l))))return;var f,p;const v=xt(l);if(v)for(const e of v)for(const n of t){const t=e.x-n.x,c=e.y-n.y,h=Math.abs(t),d=Math.abs(c);i.center||(i.center={x:i.x+i.width/2,y:i.y+i.height/2}),h<10&&h<s&&(r={x:Math.round(e.x)+.5,y:Math.round(e.y)+.5,step:t,prev:{x:Math.round(n.x)+.5,y:Math.round(n.y)+.5},penId:l.id,anchorId:n.id,dockAnchorId:e.id},s=h),d<10&&d<a&&(o={x:Math.round(e.x)+.5,y:Math.round(e.y)+.5,step:c,prev:{x:Math.round(n.x)+.5,y:Math.round(n.y)+.5},penId:l.id,anchorId:n.id,dockAnchorId:e.id},a=d)}})),{xDock:r,yDock:o}}function mt(e,t,i){if(!i.type)return!1;if(Array.isArray(t?.connectedLines))for(const e of t?.connectedLines)if(e.lineId===i.id)return!0;if(Array.isArray(t?.children))for(const n of t.children)if(mt(e,e.pens[n],i))return!0;return!1}function bt(e,t){return e.toFixed(12)==t}function wt(e){if(e.id=ne(),Array.isArray(e.anchors))for(const t of e.anchors)e.type&&(t.id=ne()),t.penId=e.id,t.prev&&(e.type&&(t.prev.id=ne()),t.prev.penId=e.id),t.next&&(e.type&&(t.next.id=ne()),t.next.penId=e.id)}function _t(e,t){if(!t)return;if(null==t.ex&&At(t),!t.rotate||t.rotate%360==0)return e.x>t.x&&e.x<t.ex&&e.y>t.y&&e.y<t.ey;t.center||Tt(t);const i=[{x:t.x,y:t.y},{x:t.ex,y:t.y},{x:t.ex,y:t.ey},{x:t.x,y:t.ey}];return i.forEach((e=>{S(e,t.rotate,t.center)})),function(e,t){if(t.length<3)return!1;let i=!1,n=t[t.length-1];for(const r of t)n.y>e.y!=r.y>e.y&&r.x+(e.y-r.y)*(n.x-r.x)/(n.y-r.y)>e.x&&(i=!i),n=r;return i}(e,i)}function kt(e,t,i=0){const{x:n,y:r,ex:o,ey:s}=t;return e.x>=n-i&&e.x<=o+i&&e.y>=r-i&&e.y<=s+i}function Tt(e){e.center||(e.center={}),e.center.x=e.x+e.width/2,e.center.y=e.y+e.height/2}function At(e){e.ex=e.x+e.width,e.ey=e.y+e.height}function St(e){const t=[];e.forEach((e=>{if(e.isRuleLine)return;const i=e.calculative.worldRect;if(i){const e=Pt(i);t.push(...e)}}));const i=Ct(t);return Tt(i),i}function Pt(e){const t=[{x:e.x,y:e.y},{x:e.ex,y:e.y},{x:e.ex,y:e.ey},{x:e.x,y:e.ey}];return e.rotate&&(e.center||Tt(e),t.forEach((t=>{S(t,e.rotate,e.center)}))),t}function Ct(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;return e?.forEach((e=>{isFinite(e.x)&&isFinite(e.y)&&(t=Math.min(t,e.x),i=Math.min(i,e.y),n=Math.max(n,e.x),r=Math.max(r,e.y))})),{x:t,y:i,ex:n,ey:r,width:n-t,height:r-i}}function Et(e,t,i){return e.rotate&&(e=Ct(Pt(e))),i?e.x>t.x&&e.ex<t.ex&&e.y>t.y&&e.ey<t.ey:!(e.x>t.ex||e.ex<t.x||e.ey<t.y||e.y>t.ey)}function Rt(e,t,i){e.x+=t,e.y+=i,e.ex+=t,e.ey+=i,e.center&&(e.center.x+=t,e.center.y+=i)}function It(e,t){if(bt(e.k,0))return{x:t.point.x,y:e.point.y};if(bt(t.k,0))return{x:e.point.x,y:t.point.y};const i=e.point.y-e.k*e.point.x,n=(t.point.y-t.k*t.point.x-i)/(e.k-t.k);return{x:n,y:e.k*n+i}}function Lt(e,t,i,n){if(e.rotate&&e.rotate%360){const r=Pt(e),o=(r[0].y-r[1].y)/(r[0].x-r[1].x),s=(r[1].y-r[2].y)/(r[1].x-r[2].x);if(n<4){r[n].x+=t,r[n].y+=i;const e=r[(n+2)%4];r[(n+1)%4]=It({k:n%2?s:o,point:r[n]},{k:n%2?o:s,point:e}),r[(n+4-1)%4]=It({k:n%2?o:s,point:r[n]},{k:n%2?s:o,point:e})}else{const e=[4,6].includes(n)?s:o;bt(e,0)?(r[n%4].x+=t,r[(n+1)%4].x+=t):(r[n%4].y+=i,r[n%4].x+=i/e,r[(n+1)%4].y+=i,r[(n+1)%4].x+=i/e)}if((r[0].x-r[1].x)**2+(r[0].y-r[1].y)**2<25||(r[1].x-r[2].x)**2+(r[1].y-r[2].y)**2<25)return;const a=function(e,t){const i=function(e,t){const i=(e.to.y-e.from.y)/(e.to.x-e.from.x),n=(t.to.y-t.from.y)/(t.to.x-t.from.x);return It({k:i,point:e.from},{k:n,point:t.from})}({from:e[0],to:e[2]},{from:e[1],to:e[3]});for(const n of e)S(n,-t,i);return Ct(e)}(r,e.rotate);return Tt(a),void Object.assign(e,a)}switch(n){case 0:if(e.width-t<5||e.height-i<5)break;e.x+=t,e.y+=i,e.width-=t,e.height-=i;break;case 1:if(e.width+t<5||e.height-i<5)break;e.ex+=t,e.y+=i,e.width+=t,e.height-=i;break;case 2:if(e.width+t<5||e.height+i<5)break;e.ex+=t,e.ey+=i,e.width+=t,e.height+=i;break;case 3:if(e.width-t<5||e.height+i<5)break;e.x+=t,e.ey+=i,e.width-=t,e.height+=i;break;case 4:if(e.height-i<5)break;e.y+=i,e.height-=i;break;case 5:if(e.width+t<5)break;e.ex+=t,e.width+=t;break;case 6:if(e.height+i<5)break;e.ey+=i,e.height+=i;break;case 7:if(e.width-t<5)break;e.x+=t,e.width-=t}}function Mt(e,t,i){e&&(e.width*=t,e.height*=t,C(e,t,i),At(e),Tt(e))}function Dt(e,t){const i={x:(e.x-t.x)/t.width,y:(e.y-t.y)/t.height,width:e.width/t.width,height:e.height/t.height};return At(i),i}function Nt(e,t){const{x:i,y:n,width:r,height:o}=t,{penId:s,connectTo:a}=e,c=Object.assign({},e,{x:r?(e.x-i)/r:0,y:o?(e.y-n)/o:0});return e.prev&&(c.prev={penId:s,connectTo:a,x:r?(e.prev.x-i)/r:0,y:o?(e.prev.y-n)/o:0}),e.next&&(c.next={penId:s,connectTo:a,x:r?(e.next.x-i)/r:0,y:o?(e.next.y-n)/o:0}),c}const Ot=/^[\t\n\f\r ]*([MLHVZCSQTAmlhvzcsqta])[\t\n\f\r ]*/,Bt=/^[01]/,Ft=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,zt=/^(([\t\n\f\r ]+,?[\t\n\f\r ]*)|(,[\t\n\f\r ]*))/,jt={M:[Ft,Ft],L:[Ft,Ft],H:[Ft],V:[Ft],Z:[],C:[Ft,Ft,Ft,Ft,Ft,Ft],S:[Ft,Ft,Ft,Ft],Q:[Ft,Ft,Ft,Ft],T:[Ft,Ft],A:[Ft,Ft,Ft,Bt,Bt,Ft,Ft]};function Ht(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;return function(e){let t,i=0,n=0;e.commands.forEach((e=>{switch(e.key){case"Z":case"z":e.worldPoints=[i,n];break;case"H":e.worldPoints=[e.values[0],t.worldPoints[t.worldPoints.length-1]];break;case"h":e.worldPoints=[e.values[0]+t.worldPoints[t.worldPoints.length-2],t.worldPoints[t.worldPoints.length-1]];break;case"V":e.worldPoints=[t.worldPoints[t.worldPoints.length-2],e.values[0]];break;case"v":case"A":e.worldPoints=[t.worldPoints[t.worldPoints.length-2],e.values[0]+t.worldPoints[t.worldPoints.length-1]];break;default:!function(e,t){const i=[];let n=e.relative&&t?{x:t.worldPoints[t.worldPoints.length-2],y:t.worldPoints[t.worldPoints.length-1]}:{x:0,y:0};for(let t=0;t<e.values.length-1;t+=2)i.push(n.x+e.values[t]),i.push(n.y+e.values[t+1]);e.worldPoints=i}(e,t)}"M"!==e.key&&"m"!==e.key&&"Z"!==e.key&&"z"!==e.key||(i=e.worldPoints[e.worldPoints.length-2],n=e.worldPoints[e.worldPoints.length-1]),t=e}))}(e),e.commands.forEach((e=>{e.worldPoints.forEach(((e,o)=>{o%2==0?(e<t&&(t=e),e>n&&(n=e)):(e<i&&(i=e),e>r&&(r=e))}))})),--t,--i,{x:t,y:i,ex:n,ey:r,width:n-t+1,height:r-i+1}}function Ut(e,t,i){const n=jt[e.toUpperCase()],r=[];for(;i<=t.length;){const o={key:e,values:[]};for(const e of n){const n=t.slice(i).match(e);if(null===n){if(0===o.values.length)return{cursor:i,commands:r};throw new Error("malformed path (first error at "+i+")")}{o.values.push(+n[0]),i+=n[0].length;const e=t.slice(i).match(zt);null!==e&&(i+=e[0].length)}}if(o.relative=o.key.toUpperCase()!==o.key,r.push(o),0===n.length)return{cursor:i,commands:r};"m"===e&&(e="l"),"M"===e&&(e="L")}throw new Error("malformed path (first error at "+i+")")}function Wt(e,t){const i=e.calculative.canvas.store.data.paths[e.pathId];if(!i)return new Path2D;const n=function(e){let t=0;const i=[];for(;t<e.length;){const n=e.slice(t).match(Ot);if(null===n)throw new Error("malformed path (first error at "+t+")");{const r=n[1];t+=n[0].length;const o=Ut(r,e,t);t=o.cursor,i.push(...o.commands)}}return{commands:i}}(i);e.calculative.svgRect=Ht(n),Tt(e.calculative.svgRect),e.calculative.svgRect.width===e.calculative.worldRect.width&&e.calculative.svgRect.height===e.calculative.worldRect.height||function(e,t,i){null==i&&(i=t),e.commands.forEach((e=>{switch(e.key){case"A":case"a":const n=e.values[0],r=e.values[1],o=Math.PI*e.values[2]/180,s=Math.cos(o),a=Math.sin(o),c=r*r*i*i*s*s+n*n*i*i*a*a,l=2*t*i*s*a*(r*r-n*n),h=n*n*t*t*s*s+r*r*t*t*a*a,d=-n*n*r*r*t*t*i*i,u=l*l-4*c*h,f=Math.sqrt((c-h)*(c-h)+l*l);e.values[2]=0!==l?180*Math.atan((h-c-f)/l)/Math.PI:c<h?0:90,e.values[0]=-Math.sqrt(2*u*d*(c+h+f))/u,e.values[1]=-Math.sqrt(2*u*d*(c+h-f))/u,e.values[5]*=t,e.values[6]*=i,e.values[4]=t*i>=0?e.values[4]:1-e.values[4];break;case"V":case"v":e.values[0]*=i;break;default:e.values.forEach(((n,r)=>{e.values[r]=n*(r%2==0?t:i)}))}}))}(n,e.calculative.worldRect.width/e.calculative.svgRect.width,e.calculative.worldRect.height/e.calculative.svgRect.height);const r=Ht(n);Tt(r),function(e,t,i){null==i&&(i=t),e.commands.forEach(((e,n)=>{if(!e.relative||!n)switch(e.key){case"A":case"a":e.values[5]+=t,e.values[6]+=i;break;case"V":case"v":e.values[0]+=i;break;default:e.values.forEach(((n,r)=>{e.values[r]=n+(r%2==0?t:i)}))}}))}(n,e.calculative.worldRect.x-r.x,e.calculative.worldRect.y-r.y);const o=function(e){let t="";return e.commands.forEach((e=>{t+=e.key+" ",e.values.forEach((e=>{t+=e+" "}))})),t}(n);if(!t)return new Path2D(o);t.svgPath?.(o)}function Vt(e,t){const{x:i,y:n,width:r,ex:o,ey:s}=t.calculative.worldRect;let a=.25*r;const c=t.z;c>1?a=c:c>0&&(a=r*c);const l={x:i,y:n+a},h={x:o-a,y:n+a},d={x:o-a,y:s};qt(e,[l,h,d,{x:i,y:s}],t.backgroundFront||t.background,t.color),qt(e,[l,{x:i+a,y:n},{x:o,y:n},h],t.backgroundUp||t.background,t.color),qt(e,[h,{x:o,y:n},{x:o,y:s-a},d],t.backgroundRight||t.background,t.color)}function qt(e,t,i="",n=""){e.save(),i&&(e.fillStyle=i),n&&(e.strokeStyle=n),e.beginPath();for(let i=0;i<t.length;++i)i?e.lineTo(t[i].x,t[i].y):e.moveTo(t[i].x,t[i].y);e.closePath(),i&&e.fill(),e.stroke(),e.restore()}function Kt(e,t,i){if(t.calculative.worldAnchors||(t.calculative.worldAnchors=[]),i)t.calculative.activeAnchor&&(t.calculative.activeAnchor.next={penId:t.id,x:i.x,y:i.y},R(t.calculative.activeAnchor.next,t.calculative.activeAnchor)<5?t.calculative.activeAnchor.next=void 0:(t.calculative.activeAnchor.prev={...t.calculative.activeAnchor.next},S(t.calculative.activeAnchor.prev,180,t.calculative.activeAnchor)));else{const i=t.calculative.worldAnchors[0];i.next||(Yt(i,Ue(i,e.pens[i.connectTo]),50),i.prev=void 0);const n=t.calculative.worldAnchors[t.calculative.worldAnchors.length-1];n&&n!==i&&!n.prev&&(Yt(n,Ue(n,e.pens[n.connectTo]),-50),n.next=void 0)}}function Yt(e,t,i){switch(t){case y.Up:e.prev={penId:e.penId,x:e.x,y:e.y+i},e.next={penId:e.penId,x:e.x,y:e.y-i};break;case y.Right:e.prev={penId:e.penId,x:e.x-i,y:e.y},e.next={penId:e.penId,x:e.x+i,y:e.y};break;case y.Bottom:e.prev={penId:e.penId,x:e.x,y:e.y-i},e.next={penId:e.penId,x:e.x,y:e.y+i};break;case y.Left:e.prev={penId:e.penId,x:e.x+i,y:e.y},e.next={penId:e.penId,x:e.x-i,y:e.y}}}function $t(e,t,i,n){const r=1-e;return{x:r*r*t.x+2*r*e*i.x+e*e*n.x,y:r*r*t.y+2*r*e*i.y+e*e*n.y,step:e}}function Xt(e,t,i,n,r){const{x:o,y:s}=t,{x:a,y:c}=r,{x:l,y:h}=i,{x:d,y:u}=n,f=1-e;return{x:o*f*f*f+3*l*e*f*f+3*d*e*e*f+a*e*e*e,y:s*f*f*f+3*h*e*f*f+3*u*e*e*f+c*e*e*e,step:e}}function Gt(e,t,i){return{x:e.x+i*(t.x-e.x),y:e.y+i*(t.y-e.y)}}function Qt(e,t,i){if(t.calculative.worldAnchors||(t.calculative.worldAnchors=[]),t.calculative.worldAnchors.length<2)return;let n=t.calculative.activeAnchor,r=i||Xe(t);if(!n||!r)return;let o=Ue(n,e.pens[n.connectTo]);switch(o===y.None&&(o=r.x>n.x?y.Right:y.Left),n.next={id:ne(),penId:t.id,x:n.x,y:n.y,prevNextType:2},r.prev={id:ne(),penId:t.id,x:r.x,y:r.y,prevNextType:2},o){case y.Up:n.next.y-=20,r.prev.y=n.y;break;case y.Bottom:n.next.y+=20,r.prev.y=n.y;break;case y.Left:n.next.x-=20,r.prev.x=n.x;break;default:n.next.x+=20,r.prev.x=n.x}}function Jt(e,t){const i=t||new Path2D,n=e.calculative.worldAnchors;if(n.length>1){let t;n.forEach((e=>{t?ei(i,t,e):e.start=!0,t=e})),e.close&&ei(i,t,n[0])}if(i instanceof Path2D)return i}function Zt(e,t,i){if(t.calculative.worldAnchors||(t.calculative.worldAnchors=[]),t.calculative.worldAnchors.length<2||t.anchors?.length>1)return;const n=$e(t),r=Xe(t);n&&r&&r.id&&n!==r&&(n.next=void 0,Ve(t),r.prev=void 0,t.calculative.worldAnchors.push(r))}function ei(e,t,i){i&&!i.isTemp&&(t.start&&e.moveTo(t.x,t.y),t.next?i.prev?e.bezierCurveTo(t.next.x,t.next.y,i.prev.x,i.prev.y,i.x,i.y):e.quadraticCurveTo(t.next.x,t.next.y,i.x,i.y):i.prev?e.quadraticCurveTo(i.prev.x,i.prev.y,i.x,i.y):e.lineTo(i.x,i.y))}function ti(e){return ai(e),Ct(function(e){const t=[];let i;return e.calculative.worldAnchors.forEach((n=>{t.push(n),i&&t.push(...ni(i,n,e)),i=n})),e.close&&e.calculative.worldAnchors.length>1&&t.push(...ni(i,e.calculative.worldAnchors[0],e)),t}(e))}function ii(e){return e?.lineWidth?e.lineWidth/2+4:4}function ni(e,t,i){const n=[];if(!t)return n;let r=.02;if(e.lineLength&&(r=ii(i)/e.lineLength),e.next)if(t.prev)for(let i=r;i<1;i+=r)n.push(Xt(i,e,e.next,t.prev,t));else for(let i=r;i<1;i+=r)n.push($t(i,e,e.next,t));else if(t.prev)for(let i=r;i<1;i+=r)n.push($t(i,e,t.prev,t));else n.push({x:t.x,y:t.y});return n.length>1&&(e.curvePoints=n),n}function ri(e,t){const i=ii(t);let n,r,o=0;for(const s of t.calculative.worldAnchors){if(n){if(r=oi(e,n,s,i),r)return{i:o,point:r};++o}n=s}if(t.close&&t.calculative.worldAnchors.length>1&&(r=oi(e,n,t.calculative.worldAnchors[0],i)))return{i:o,point:r}}function oi(e,t,i,n=4){if(!t.next&&!i.prev){const{x:r,y:o}=t,{x:s,y:a}=i,c=Math.min(r,s),l=Math.max(r,s),h=Math.min(o,a),d=Math.max(o,a);if(!(e.x>=c-n&&e.x<=l+n&&e.y>=h-n&&e.y<=d+n))return;return function(e,t,i,n=4){if(t.x===i.x){if(Math.abs(e.x-t.x)<=n)return{x:t.x,y:e.y}}else{const r=(t.y-i.y)/(t.x-i.x),o=t.y-r*t.x;if(Math.abs((r*e.x+o-e.y)/Math.sqrt(r*r+1))<=n){const t=(e.x+r*e.y-r*o)/(r*r+1);return{x:t,y:r*t+o}}}}(e,t,i,n)}if(t.curvePoints)for(const i of t.curvePoints)if(P(e,i,n))return i}function si(e,t,i,n){if(!t&&!i)return Math.sqrt(Math.pow(Math.abs(e.x-n.x),2)+Math.pow(Math.abs(e.y-n.y),2))||0;const r=document.createElementNS("http://www.w3.org/2000/svg","path");return t&&i?r.setAttribute("d",`M${e.x} ${e.y} C${t.x} ${t.y} ${i.x} ${i.y} ${n.x} ${n.y}`):t?r.setAttribute("d",`M${e.x} ${e.y} Q${t.x} ${t.y} ${n.x} ${n.y}`):r.setAttribute("d",`M${e.x} ${e.y} Q${i.x} ${i.y} ${n.x} ${n.y}`),r.getTotalLength()||0}function ai(e){if(e.calculative.worldAnchors.length<2)return 0;let t,i=0;if(e.calculative.worldAnchors.forEach((e=>{t&&(t.lineLength=si(t,t.next,e.prev,e),i+=t.lineLength),t=e})),e.close){const n=$e(e);t.lineLength=si(t,t.next,n.prev,n),i+=t.lineLength}return e.length=i,i}function ci(e,t,i){if(kt(e,i)||kt(t,i))return!0;const n=e.x,r=e.y,o=t.x,s=t.y;let a=i.x,c=i.y,l=i.ex,h=i.ey;const d=r-s,u=o-n,f=n*s-o*r;if(d*a+u*c+f>=0&&d*l+u*h+f<=0||d*a+u*c+f<=0&&d*l+u*h+f>=0||d*a+u*h+f>=0&&d*l+u*c+f<=0||d*a+u*h+f<=0&&d*l+u*c+f>=0){if(a>l){const e=a;a=l,l=e}if(c<h){const e=c;c=h,h=e}return!(n<a&&o<a||n>l&&o>l||r>c&&s>c||r<h&&s<h)}return!1}function li(e,t,i){const n=.02;if(!e.next&&!t.prev)return ci(e,t,i);if(e.next&&t.prev){for(let r=n;r<1;r+=n)if(kt(Xt(r,e,e.next,t.prev,t),i))return!0}else if(e.next||t.prev)for(let r=n;r<1;r+=n)if(kt($t(r,e,e.next||t.prev,t),i))return!0;return!1}let hi=10;function di(e,t,i){if(t.calculative.worldAnchors||(t.calculative.worldAnchors=[]),hi=e.options.polylineSpace||10,t.calculative.worldAnchors.length<2)return;let n,r=$e(t),o=Xe(t);if(!r||!o)return;if(t.anchors?.length&&r===t.calculative.activeAnchor?(n=!0,r=o,o=$e(t)):t.anchors&&t.anchors.length||r===t.calculative.activeAnchor||(r=t.calculative.activeAnchor),!r||!o)return;r.next=void 0,o.prev=void 0;const s=o.connectTo;Ve(t);const a=[],c=e.pens[r.connectTo],l=e.pens[o.connectTo],h=Ue(r,c),d=Ue(o,l);let u=ui(r,h,hi);u&&(r=u,a.push(u)),u=ui(o,d,hi);const f=o;switch(u&&(o=u),h){case y.Up:a.push(...function(e,t,i){if(e.x===t.x||e.y===t.y)return[];const n=[];let r,o;switch(i){case y.Up:e.y<t.y?(r=t.x,o=e.y):(r=e.x,o=t.y),n.push({x:r,y:o});break;case y.Bottom:if(r=t.x,o=e.y,t.y>e.y)r=e.x+(t.x-e.x)/2,n.push({x:r,y:e.y},{x:r,y:t.y});else{const i=(e.y+t.y)/2;n.push({x:e.x,y:i},{x:t.x,y:i})}break;case y.Right:r=t.x,o=e.y,t.x<e.x&&t.y<e.y&&(r=e.x,o=t.y),n.push({x:r,y:o});break;case y.Left:r=t.x,o=e.y,t.x>e.x&&t.y<e.y&&(r=e.x,o=t.y),n.push({x:r,y:o});break;default:if(t.y>e.y-hi)r=e.x+(t.x-e.x)/2,n.push({x:r,y:e.y},{x:r,y:t.y});else{const i=(e.y+t.y+hi)/2;n.push({x:e.x,y:i},{x:t.x,y:i})}}return n}(r,o,d));break;case y.Right:a.push(...function(e,t,i){if(e.x===t.x||e.y===t.y)return[];const n=[];let r,o;switch(i){case y.Up:r=e.x,o=t.y,t.x>e.x&&t.y>e.y&&(r=t.x,o=e.y),n.push({x:r,y:o});break;case y.Bottom:r=e.x,o=t.y,t.x>e.x&&t.y<e.y&&(r=t.x,o=e.y),n.push({x:r,y:o});break;case y.Left:if(r=t.x,o=e.y,t.x<e.x)o=e.y+(t.y-e.y)/2,n.push({x:e.x,y:o},{x:t.x,y:o});else{const i=(e.x+t.x)/2;n.push({x:i,y:o},{x:i,y:t.y})}break;case y.Right:t.x<e.x?n.push({x:e.x,y:t.y}):n.push({x:t.x,y:e.y});break;default:if(r=t.x,o=t.y,t.x<e.x+hi)n.push({x:e.x,y:o});else{const i=(e.x+t.x-hi)/2;n.push({x:i,y:e.y},{x:i,y:o})}}return n}(r,o,d));break;case y.Bottom:a.push(...function(e,t,i){if(e.x===t.x||e.y===t.y)return[];const n=[];let r,o;switch(i){case y.Up:if(r=e.x,o=t.y,t.y<e.y)r=e.x+(t.x-e.x)/2,n.push({x:r,y:e.y},{x:r,y:t.y});else{const i=(e.y+t.y)/2;n.push({x:r,y:i},{x:t.x,y:i})}break;case y.Right:r=t.x,o=e.y,t.x<e.x&&t.y>e.y&&(r=e.x,o=t.y),n.push({x:r,y:o});break;case y.Bottom:e.y>t.y?(r=t.x,o=e.y):(r=e.x,o=t.y),n.push({x:r,y:o});break;case y.Left:r=t.x,o=e.y,t.x>e.x&&t.y>e.y&&(r=e.x,o=t.y),n.push({x:r,y:o});break;default:if(r=e.x,t.y<e.y+hi)r=e.x+(t.x-e.x)/2,n.push({x:r,y:e.y},{x:r,y:t.y});else{const i=(e.y+t.y-hi)/2;n.push({x:r,y:i},{x:t.x,y:i})}}return n}(r,o,d));break;case y.Left:a.push(...function(e,t,i){if(e.x===t.x||e.y===t.y)return[];const n=[];let r,o;switch(i){case y.Up:r=e.x,o=t.y,t.x<e.x&&t.y>e.y&&(r=t.x,o=e.y),n.push({x:r,y:o});break;case y.Bottom:r=e.x,o=t.y,t.x<e.x&&t.y<e.y&&(r=t.x,o=e.y),n.push({x:r,y:o});break;case y.Right:if(r=e.x,o=t.y,t.x>e.x)r=t.x,o=e.y+(t.y-e.y)/2,n.push({x:e.x,y:o},{x:t.x,y:o});else{const i=(e.x+t.x)/2;n.push({x:i,y:e.y},{x:i,y:t.y})}break;case y.Left:t.x>e.x?n.push({x:e.x,y:t.y}):n.push({x:t.x,y:e.y});break;default:if(r=e.x,o=t.y,t.x<e.x-hi){const i=(e.x+t.x+hi)/2;n.push({x:i,y:e.y},{x:i,y:o})}else n.push({x:e.x,y:o})}return n}(r,o,d));break;default:a.push(...function(e,t,i){const n=[];return null==e.calculative.drawlineH&&(e.calculative.drawlineH=Math.abs(i.x-t.x)>Math.abs(i.y-t.y)),e.calculative.worldAnchors.length&&(i.isTemp=void 0,e.calculative.drawlineH?(n.push({x:i.x,y:t.y}),Math.abs(i.y-t.y)<hi&&(i.isTemp=!0)):(n.push({x:t.x,y:i.y}),Math.abs(i.x-t.x)<hi&&(i.isTemp=!0))),n}(t,r,o))}if(a.forEach((e=>{e.id=ne(),e.penId=t.id,t.calculative.worldAnchors.push(e)})),t.calculative.worldAnchors.push(o),u&&t.calculative.worldAnchors.push(f),n&&t.calculative.worldAnchors.reverse(),s){const e=t.calculative.worldAnchors.length-2;t.calculative.worldAnchors[e].isTemp=!1}}function ui(e,t,i){const n={x:e.x,y:e.y,id:ne()};switch(t){case y.Up:n.y-=i;break;case y.Right:n.x+=i;break;case y.Bottom:n.y+=i;break;case y.Left:n.x-=i;break;default:return}return n}function fi(e,t,i=!0){let n=e.calculative.worldAnchors;i||(n=[],e.calculative.worldAnchors.forEach((e=>{n.unshift(e)})));for(let e=0;e<n.length&&n[e].id!==t.id;e++){if(n[e].y!==t.y)return!1;if(n[e].x===n[e+1]?.x&&n[e].y!==n[e+1]?.y)return!1}return!0}function pi(e,t,i=!0){let n=e.calculative.worldAnchors;i||(n=[],e.calculative.worldAnchors.forEach((e=>{n.unshift(e)})));for(let e=0;e<n.length&&n[e].id!==t.id;e++){if(n[e].x!==t.x)return!1;if(n[e].y===n[e+1]?.y&&n[e].x!==n[e+1]?.x)return!1}return!0}function vi(e,t,i,n){const r=[];let o,s,a,c,l,h,d,u,f,p,v,x,g,y;f=e[i],p=e[n],a=f.x,c=f.y,d=p.x-a,u=p.y-c,y=d*d+u*u,o=t;for(let t=i+1;t<n;t++)v=e[t],0!==d||0!==u?(x=((v.x-a)*d+(v.y-c)*u)/y,x>1?(l=v.x-p.x,h=v.y-p.y):x>0?(l=v.x-(a+d*x),h=v.y-(c+u*x)):(l=v.x-a,h=v.y-c)):(l=v.x-a,h=v.y-c),g=l*l+h*h,g>o&&(s=t,o=g);return o>t&&(s-i>1&&r.push(...vi(e,t,i,s)),r.push({id:e[s].id,penId:e[s].penId,x:e[s].x,y:e[s].y}),n-s>1&&r.push(...vi(e,t,s,n))),r}const xi={};function gi(e){if(e.onDestroy||(e.onDestroy=yi,e.onMove=mi,e.onResize=mi,e.onRotate=mi,e.onValue=mi,e.onChangeId=bi),xi[e.id])xi[e.id].getAttribute("src")!==e.iframe&&(xi[e.id].src=e.iframe,e.calculative.iframe=e.iframe);else{const t=document.createElement("iframe");t.scrolling=e.scrolling||"no",t.frameBorder="0",t.src=e.iframe,xi[e.id]=t,e.calculative.iframe=e.iframe,e.calculative.canvas.externalElements?.parentElement.appendChild(t),nt(e,t)}return e.calculative.patchFlags&&nt(e,xi[e.id]),new Path2D}function yi(e){xi[e.id].remove(),xi[e.id]=void 0}function mi(e){xi[e.id]&&(nt(e,xi[e.id]),xi[e.id].getAttribute("src")!==e.iframe&&(xi[e.id].src=e.iframe))}function bi(e,t,i){xi[t]&&(xi[i]=xi[t],delete xi[t])}const wi={};function _i(e){if(e.onDestroy||(e.onDestroy=ki,e.onMove=Ti,e.onResize=Ti,e.onRotate=Ti,e.onClick=Ai,e.onValue=Ci,e.onChangeId=Pi),wi[e.id])e.video&&e.calculative.media&&e.video!==e.calculative.video?(console.warn("video 更改, 此处是否执行?"),e.calculative.media.src=e.video,e.autoPlay&&(e.calculative.media.muted=!0,e.calculative.media.autoplay=!0),e.calculative.media.loop=e.playLoop,e.calculative.video=e.video):e.audio&&e.calculative.media&&e.audio!==e.calculative.audio&&(e.calculative.media.src=e.audio,e.autoPlay&&(e.calculative.media.muted=!0,e.calculative.media.autoplay=!0),e.calculative.media.loop=e.playLoop,e.calculative.audio=e.audio);else{const t=document.createElement("div"),i=document.createElement("div");let n;i.style.position="absolute",i.style.outline="none",i.style.left="0",i.style.bottom="0",i.style.width="0",i.style.height="2px",i.style.background="#52c41a",i.style.zIndex="1",t.appendChild(i),e.video?(n=document.createElement("video"),n.src=e.video):e.audio&&(n=document.createElement("audio"),n.src=e.audio),n.loop=e.playLoop,n.ontimeupdate=()=>{Si(i,n,e.calculative.worldRect.width)},n.onended=()=>{e.calculative.onended&&e.calculative.onended(e)},e.calculative.media=n,n.style.position="absolute",n.style.outline="none",n.style.left="0",n.style.top="0",n.style.width="100%",n.style.height="100%",t.appendChild(n),wi[e.id]=t,e.calculative.canvas.externalElements?.parentElement.appendChild(t),nt(e,t),e.autoPlay&&(n.autoplay=!0,n.muted=!0)}return e.calculative.patchFlags&&nt(e,wi[e.id]),new Path2D}function ki(e){wi[e.id].remove(),wi[e.id]=void 0}function Ti(e){nt(e,wi[e.id]),Si(wi[e.id].children[0],wi[e.id].children[1],e.calculative.worldRect.width)}function Ai(e){e.calculative.media&&(e.calculative.media.muted=!1,e.calculative.media.paused?e.calculative.media.play():e.calculative.media.pause())}function Si(e,t,i){e.style.width=t.currentTime/t.duration*i+"px"}function Pi(e,t,i){wi[t]&&(wi[i]=wi[t],delete wi[t])}function Ci(e){const t=wi[e.id];if(!t)return;nt(e,t);const i=e.calculative.media.getAttribute("src");e.video?i!==e.video&&(e.calculative.media.src=e.video):e.audio&&i!==e.audio&&(e.calculative.media.src=e.audio),e.autoPlay&&(e.calculative.media.muted=!0,e.calculative.media.autoplay=!0),e.calculative.media.loop=e.playLoop}function Ei(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.ellipse(n+o/2,r+s/2,o/2,s/2,0,0,2*Math.PI),i instanceof Path2D)return i}function Ri(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.moveTo(n+o/2,r),i.lineTo(n+o,r+s/2),i.lineTo(n+o/2,r+s),i.lineTo(n,r+s/2),i.lineTo(n+o/2,r),i.closePath(),i instanceof Path2D)return i}function Ii(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.moveTo(n+o/2,r),i.lineTo(n+o,r+s),i.lineTo(n,r+s),i.lineTo(n+o/2,r),i.closePath(),i instanceof Path2D)return i}function Li(e){e.anchors=[{x:.5,y:0},{x:.75,y:.5},{x:.5,y:1},{x:.25,y:.5}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function Mi(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.moveTo(n+o/2,r),i.lineTo(n+o,r+2*s/5),i.lineTo(n+4*o/5,r+s),i.lineTo(n+o/5,r+s),i.lineTo(n,r+2*s/5),i.closePath(),i instanceof Path2D)return i}function Di(e){e.anchors=[{x:.5,y:0},{x:1,y:.4},{x:.8,y:1},{x:.2,y:1},{x:0,y:.4}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function Ni(e,t){e.onResize||(e.onResize=Bi);const i=t||new Path2D,{width:n,height:r,center:o}=e.calculative.worldRect,s=n>r?r:n,a=o.x,c=o.y,l=c-s/2,h=c-s/4,d=-(h-c)*Math.sin(Math.PI/180*324)+a,u=(h-c)*Math.cos(Math.PI/180*324)+c;i.moveTo(d,u);for(let e=0;e<5;++e)i.lineTo(-(l-c)*Math.sin(Math.PI/180*72*e)+a,(l-c)*Math.cos(Math.PI/180*72*e)+c),i.lineTo((d-a)*Math.cos(Math.PI/180*72*(e+1))-(u-c)*Math.sin(Math.PI/180*72*(e+1))+a,(d-a)*Math.sin(Math.PI/180*72*(e+1))+(u-c)*Math.cos(Math.PI/180*72*(e+1))+c);if(i.closePath(),i instanceof Path2D)return i}function Oi(e){const{width:t,height:i}=e,n=t>i?i:t,r=[];for(let o=0;o<5;++o)r.push({flag:1,id:String(o),penId:e.id,x:.5+n/2*Math.sin(Math.PI/180*72*o)/t,y:-n/2*Math.cos(Math.PI/180*72*o)/i+.5});e.anchors=r}function Bi(e){const t=e.anchors.filter((e=>1!==e.flag));Oi(e),e.anchors=e.anchors.concat(...t)}function Fi(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.moveTo(n+o/4,r),i.lineTo(n+3*o/4,r),i.lineTo(n+o,r+s/2),i.lineTo(n+3*o/4,r+s),i.lineTo(n+1*o/4,r+s),i.lineTo(n,r+s/2),i.lineTo(n+o/4,r),i.closePath(),i instanceof Path2D)return i}function zi(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.moveTo(n,r+s/2),i.lineTo(n+s/2,r),i.lineTo(n+s/2,r+s/3),i.lineTo(n+o,r+s/3),i.lineTo(n+o,r+2*s/3),i.lineTo(n+s/2,r+2*s/3),i.lineTo(n+s/2,r+2*s/3),i.lineTo(n+s/2,r+s),i.closePath(),i instanceof Path2D)return i}function ji(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.moveTo(n,r+s/3),i.lineTo(n+(o-s/2),r+s/3),i.lineTo(n+(o-s/2),r),i.lineTo(n+o,r+s/2),i.lineTo(n+(o-s/2),r+s),i.lineTo(n+(o-s/2),r+2*s/3),i.lineTo(n,r+2*s/3),i.closePath(),i instanceof Path2D)return i}function Hi(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.moveTo(n,r+s/2),i.lineTo(n+s/2,r),i.lineTo(n+s/2,r+s/3),i.lineTo(n+(o-s/2),r+s/3),i.lineTo(n+(o-s/2),r),i.lineTo(n+o,r+s/2),i.lineTo(n+(o-s/2),r+s),i.lineTo(n+(o-s/2),r+2*s/3),i.lineTo(n+s/2,r+2*s/3),i.lineTo(n+s/2,r+s),i.closePath(),i instanceof Path2D)return i}function Ui(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s,ey:a}=e.calculative.worldRect;if(i.moveTo(n,r),i.lineTo(n+o,r),i.lineTo(n+o,r+3*s/4),i.lineTo(n+8*o/16,r+3*s/4),i.lineTo(n+o/4,a),i.lineTo(n+5*o/16,r+3*s/4),i.lineTo(n,r+3*s/4),i.closePath(),i instanceof Path2D)return i}function Wi(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.moveTo(n+o/5,r+13*s/16),i.bezierCurveTo(n-o/15,r+13*s/16,n-o/15,r+7*s/16,n+o/5,r+7*s/16),i.bezierCurveTo(n+o/5,r,n+4*o/5,r,n+4*o/5,r+7*s/16),i.bezierCurveTo(n+16*o/15,r+7*s/16,n+16*o/15,r+13*s/16,n+4*o/5,r+13*s/16),i.closePath(),i instanceof Path2D)return i}function Vi(e,t){const i=t||new Path2D,{x:n,y:r,width:o,ex:s,ey:a}=e.calculative.worldRect,c=o/6;if(i.moveTo(n,r),i.lineTo(s-c,r),i.lineTo(s,r+c),i.lineTo(s,a),i.lineTo(n,a),i.closePath(),i.moveTo(s-c,r),i.lineTo(s-c,r+c),i.lineTo(s,r+c),i.closePath(),i instanceof Path2D)return i}function qi(e,t){const i=t||new Path2D,{x:n,y:r,width:o,ex:s,ey:a}=e.calculative.worldRect,c=o/4,l=n+o/2;if(i.arc(l,r+c,c,0,2*Math.PI),i.moveTo(n,r+3*c),i.lineTo(s,r+3*c),i.moveTo(l,r+2*c),i.lineTo(l,r+4*c),i.moveTo(l,r+4*c),i.lineTo(n,a),i.moveTo(l,r+4*c),i.lineTo(s,a),i.closePath(),i instanceof Path2D)return i}const Ki={};function Yi(e){e.onDestroy||(e.onDestroy=$i,e.onMove=Xi,e.onResize=Gi,e.onRotate=Xi,e.onValue=Qi,e.onChangeId=Ji);const t=new Path2D;if(e.image){if(!Ki[e.id]){const t=new Image;t.crossOrigin="anonymous",t.src=e.image,e.calculative.canvas.parent.store.options.cdn&&!(e.image.startsWith("http")||e.image.startsWith("//")||e.image.startsWith("data:image"))&&(t.src=e.calculative.canvas.parent.store.options.cdn+e.image),Ki[e.id]=t,t.onload=()=>{Ki[e.id]===t&&(e.calculative.img=t,e.calculative.imgNaturalWidth=t.naturalWidth||e.iconWidth,e.calculative.imgNaturalHeight=t.naturalHeight||e.iconHeight,e.calculative.canvas.externalElements?.parentElement.appendChild(t),Zi(e,t))}}return e.calculative.patchFlags&&Ki[e.id]&&Zi(e,Ki[e.id]),t}}function $i(e){Ki[e.id]&&(Ki[e.id].remove(),Ki[e.id]=void 0)}function Xi(e){Ki[e.id]&&Zi(e,Ki[e.id])}function Gi(e){Ki[e.id]&&Zi(e,Ki[e.id])}function Qi(e){Ki[e.id]&&(Zi(e,Ki[e.id]),Ki[e.id].getAttribute("src")!==e.image&&(Ki[e.id].src=e.image))}function Ji(e,t,i){Ki[t]&&(Ki[i]=Ki[t],delete Ki[t])}function Zi(e,t){t.style.objectFit=e.imageRatio?"contain":"fill",nt(e,t)}function en(t,i){return t.onResize||(t.onResize=tn,t.onValue=nn),e(t,i)}function tn(e){const t=e.anchors.filter((e=>1!==e.flag));rn(e),e.anchors=e.anchors.concat(...t)}function nn(e){tn(e),ze(e)}function rn(e){const t=[],{x:i,y:n,width:r,height:o}=e,s=function(e){let t=e.calculative.borderRadius||0,i=e.calculative.borderRadius||0;const{width:n,height:r}=e;e.calculative.borderRadius<1&&(t=n*e.calculative.borderRadius,i=r*e.calculative.borderRadius);let o=t<i?t:i;return n<2*o&&(o=n/2),r<2*o&&(o=r/2),o}(e);for(let a=0;a<5;a++){if(2===a)continue;let c=i+r*(a+1)/6,l=n;c<i+s?l=sn(i+s,l+s,c,s,-1):c>i+r-s&&(l=sn(i+r-s,l+s,c,s,-1)),t.push({id:String(t.length),flag:1,penId:e.id,x:(c-i)/r,y:(l-n)/o})}for(let a=0;a<3;a++){let c=n+o*(a+1)/4,l=i+r;c<n+s?l=on(l-s,n+s,c,s):c>n+o-s&&(l=on(l-s,n+o-s,c,s)),t.push({id:String(t.length),flag:1,penId:e.id,x:(l-i)/r,y:(c-n)/o})}for(let a=0;a<5;a++){if(2===a)continue;let c=i+r*(a+1)/6,l=n+o;c<i+s?l=sn(i+s,l-s,c,s):c>i+r-s&&(l=sn(i+r-s,l-s,c,s)),t.push({id:String(t.length),flag:1,penId:e.id,x:(c-i)/r,y:(l-n)/o})}for(let a=0;a<3;a++){let c=n+o*(a+1)/4,l=i;c<n+s?l=on(l+s,n+s,c,s,-1):c>n+o-s&&(l=on(l+s,n+o-s,c,s,-1)),t.push({id:String(t.length),flag:1,penId:e.id,x:(l-i)/r,y:(c-n)/o})}e.anchors=t}function on(e,t,i,n,r=1){return r*Math.sqrt(n**2-(i-t)**2)+e}function sn(e,t,i,n,r=1){return r*Math.sqrt(n**2-(i-e)**2)+t}function an(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.moveTo(n,r+s),i.lineTo(n+o,r+s),i.closePath(),i instanceof Path2D)return i}function cn(e){e.anchors=[{x:0,y:1},{x:1,y:1}].map((({x:t,y:i},n)=>({id:n+"",x:t,y:i,penId:e.id})))}function ln(){try{const e=new OffscreenCanvas(0,0),t=e.getContext("2d");return t&&t.arc?e:document.createElement("canvas")}catch(e){return document.createElement("canvas")}}class hn{constructor(e,t){let i;this.parentElement=e,this.store=t,this.box=document.createElement("div"),this.text=document.createElement("div"),this.arrowUp=document.createElement("div"),this.arrowDown=document.createElement("div"),this.box.className="meta2d-tooltip",this.text.className="text",this.arrowUp.className="arrow",this.arrowDown.className="arrow down",this.box.appendChild(this.text),this.box.appendChild(this.arrowUp),this.box.appendChild(this.arrowDown),e.appendChild(this.box),this.box.onmouseleave=()=>{this.hide(),this.store.lastHover=void 0};for(let e=0;e<document.styleSheets.length;e++)"le5le.com/tooltip"===document.styleSheets[e].title&&(i=document.styleSheets[e]);if(!i){let e=document.createElement("style");e.type="text/css",e.title="le5le.com/tooltip",document.head.appendChild(e),e=document.createElement("style"),e.type="text/css",document.head.appendChild(e),i=e.sheet,i.insertRule(".meta2d-tooltip{position:absolute;padding:8px 0;z-index:10;left: -9999px;top: -9999px;}"),i.insertRule(".meta2d-tooltip .text{max-width:320px;min-height:30px;max-height:400px;outline:none;padding:8px 16px;border-radius:4px;background:#777777;color:#ffffff;line-height:1.8;overflow-y:auto;}"),i.insertRule(".meta2d-tooltip .arrow{position:absolute;border:10px solid transparent;background:transparent;top:-5px;left:50%;transform:translateX(-50%)}"),i.insertRule(".meta2d-tooltip .arrow.down{top:initial;bottom: -1px;}")}}static getTitle(e){if(e.titleFnJs&&!e.titleFn)try{e.titleFn=new Function("pen",e.titleFnJs)}catch(e){console.log(...function(e,...t){try{(function(){try{return(0,eval)("globalThis._console_ninja")||(0,eval)("/* https://github.com/wallabyjs/console-ninja#how-does-it-work */'use strict';function _0x3128(_0x33fef2,_0x1623a6){var _0x302bd2=_0x302b();return _0x3128=function(_0x31282f,_0x9ad0a5){_0x31282f=_0x31282f-0x175;var _0x1afa95=_0x302bd2[_0x31282f];return _0x1afa95;},_0x3128(_0x33fef2,_0x1623a6);}var _0x198da5=_0x3128;function _0x302b(){var _0x135ced=['console','send','_undefined','NEGATIVE_INFINITY','allStrLength','_additionalMetadata','_getOwnPropertySymbols','POSITIVE_INFINITY','perf_hooks','timeStamp','_isSet','_setNodeExpressionPath','totalStrLength','_objectToString','call','string','_console_ninja_session','message','array','_socket','location','_quotedRegExp','autoExpandPreviousObjects','method','index','_regExpToString','_treeNodePropertiesBeforeFullValue','_sendErrorMessage','timeEnd','time','_connectAttemptCount','18CdQSUp','onerror','parse','_getOwnPropertyNames','127.0.0.1','now','path','current','type','Number','test','ws://','date','_propertyAccessor','count','_cleanNode','undefined','426590zioQOr','set','root_exp_id','unref','elements','_capIfString','_isUndefined','getOwnPropertySymbols','indexOf','symbol','negativeZero','1.0.0','_numberRegExp','object','number','port','onmessage','3878680GyuBbs','_setNodeQueryPath','parent',\"c:\\\\Users\\\\Administrator\\\\.vscode\\\\extensions\\\\wallabyjs.console-ninja-0.0.188\\\\node_modules\",'pop','versions','_consoleNinjaAllowedToStart','function','_hasSetOnItsPath','disabledLog','valueOf','substr','strLength','trace','null','hasOwnProperty','_isMap','concat','length','push','[object\\x20BigInt]','autoExpandMaxDepth','process','props','_console_ninja','rootExpression','_isPrimitiveType','cappedElements','Map','warn','[object\\x20Map]','cappedProps','_allowedToSend','_addLoadNode','_connecting','nan','[object\\x20Array]','_addObjectProperty','482881RQSLnM','_maxConnectAttemptCount','failed\\x20to\\x20find\\x20and\\x20load\\x20WebSocket','_type','log','[object\\x20Date]','constructor','165VGgJoX','disabledTrace','name','WebSocket','global','_disposeWebsocket','_WebSocketClass','url','replace','autoExpandPropertyCount','resolveGetters','_setNodeId','getter','_isNegativeZero','564422lkNsDr','error','logger\\x20websocket\\x20error','root_exp','_setNodePermissions','_blacklistedProperty','stringify','_Symbol','default','_dateToString','toString','1690539194318','_addFunctionsNode','reduceLimits','_getOwnPropertyDescriptor','noFunctions','nuxt','_setNodeLabel','split','_propertyName','host','close','getWebSocketClass','node','onclose','Symbol','failed\\x20to\\x20connect\\x20to\\x20host:\\x20','nodeModules','expressionsToEvaluate','get','prototype','38392jsGBHv','_webSocketErrorDocsLink','isExpressionToEvaluate','_p_name','stackTraceLimit','then','_treeNodePropertiesAfterFullValue','forEach','_WebSocket','elapsed','logger\\x20failed\\x20to\\x20connect\\x20to\\x20host','logger\\x20failed\\x20to\\x20connect\\x20to\\x20host,\\x20see\\x20','Buffer','level','reload','sort','_processTreeNodeResult','slice','match','_attemptToReconnectShortly','HTMLAllCollection','_p_','sortProps','_sortProps','6DHihzs','performance','getPrototypeOf','_hasMapOnItsPath','capped','_reconnectTimeout','webpack','autoExpand','join','autoExpandLimit','serialize','bind','_hasSymbolPropertyOnItsPath','_ws','_addProperty','_HTMLAllCollection','hits','9486180ryGLtY','[object\\x20Set]','Error','stack','value','getOwnPropertyNames','unknown','_allowedToConnectOnSend','_keyStrRegExp','bigint','_inBrowser','_connectToHostNow','1962RXGvBI','hrtime','_connected','1twePuv','catch','funcName','data','depth','992pkXnTe','String','remix','_property','RegExp','hostname','Set','Console\\x20Ninja\\x20failed\\x20to\\x20send\\x20logs,\\x20restarting\\x20the\\x20process\\x20may\\x20help;\\x20also\\x20see\\x20','ws/index.js','_setNodeExpandableState',[\"localhost\",\"127.0.0.1\",\"example.cypress.io\",\"LAPTOP-UKGGNDEF\",\"2.0.0.1\",\"192.168.5.248\"]];_0x302b=function(){return _0x135ced;};return _0x302b();}(function(_0x242d46,_0x590dd8){var _0x24d20e=_0x3128,_0x15d973=_0x242d46();while(!![]){try{var _0x128a33=parseInt(_0x24d20e(0x1e3))/0x1*(-parseInt(_0x24d20e(0x18c))/0x2)+parseInt(_0x24d20e(0x1c3))/0x3*(-parseInt(_0x24d20e(0x1ab))/0x4)+parseInt(_0x24d20e(0x234))/0x5+-parseInt(_0x24d20e(0x212))/0x6*(parseInt(_0x24d20e(0x177))/0x7)+parseInt(_0x24d20e(0x1e8))/0x8*(-parseInt(_0x24d20e(0x1e0))/0x9)+-parseInt(_0x24d20e(0x223))/0xa*(parseInt(_0x24d20e(0x17e))/0xb)+parseInt(_0x24d20e(0x1d4))/0xc;if(_0x128a33===_0x590dd8)break;else _0x15d973['push'](_0x15d973['shift']());}catch(_0xbd4646){_0x15d973['push'](_0x15d973['shift']());}}}(_0x302b,0x5f742));var ue=Object['create'],te=Object['defineProperty'],he=Object['getOwnPropertyDescriptor'],le=Object[_0x198da5(0x1d9)],fe=Object[_0x198da5(0x1c5)],_e=Object[_0x198da5(0x1aa)][_0x198da5(0x243)],pe=(_0x5b0b2d,_0x296852,_0x566f5f,_0x5f33f5)=>{var _0x4c2b30=_0x198da5;if(_0x296852&&typeof _0x296852==_0x4c2b30(0x230)||typeof _0x296852==_0x4c2b30(0x23b)){for(let _0x320383 of le(_0x296852))!_e[_0x4c2b30(0x201)](_0x5b0b2d,_0x320383)&&_0x320383!==_0x566f5f&&te(_0x5b0b2d,_0x320383,{'get':()=>_0x296852[_0x320383],'enumerable':!(_0x5f33f5=he(_0x296852,_0x320383))||_0x5f33f5['enumerable']});}return _0x5b0b2d;},ne=(_0x312bef,_0x5ac06f,_0x314004)=>(_0x314004=_0x312bef!=null?ue(fe(_0x312bef)):{},pe(_0x5ac06f||!_0x312bef||!_0x312bef['__es'+'Module']?te(_0x314004,_0x198da5(0x194),{'value':_0x312bef,'enumerable':!0x0}):_0x314004,_0x312bef)),Q=class{constructor(_0x421446,_0x4aafd6,_0x380d86,_0x26cdc2){var _0x45cb36=_0x198da5;this[_0x45cb36(0x182)]=_0x421446,this['host']=_0x4aafd6,this[_0x45cb36(0x232)]=_0x380d86,this['nodeModules']=_0x26cdc2,this['_allowedToSend']=!0x0,this[_0x45cb36(0x1db)]=!0x0,this[_0x45cb36(0x1e2)]=!0x1,this['_connecting']=!0x1,this[_0x45cb36(0x1de)]=!!this['global'][_0x45cb36(0x181)],this[_0x45cb36(0x184)]=null,this['_connectAttemptCount']=0x0,this[_0x45cb36(0x178)]=0x14,this[_0x45cb36(0x1ac)]='https://tinyurl.com/37x8b79t',this['_sendErrorMessage']=(this[_0x45cb36(0x1de)]?'Console\\x20Ninja\\x20failed\\x20to\\x20send\\x20logs,\\x20refreshing\\x20the\\x20page\\x20may\\x20help;\\x20also\\x20see\\x20':_0x45cb36(0x1ef))+this[_0x45cb36(0x1ac)];}async[_0x198da5(0x1a2)](){var _0x291a32=_0x198da5;if(this[_0x291a32(0x184)])return this[_0x291a32(0x184)];let _0x32bb49;if(this[_0x291a32(0x1de)])_0x32bb49=this['global'][_0x291a32(0x181)];else{if(this[_0x291a32(0x182)]['process']?.[_0x291a32(0x1b3)])_0x32bb49=this[_0x291a32(0x182)][_0x291a32(0x24a)]?.[_0x291a32(0x1b3)];else try{let _0x376ac6=await import('path');_0x32bb49=(await import((await import(_0x291a32(0x185)))['pathToFileURL'](_0x376ac6[_0x291a32(0x1cb)](this[_0x291a32(0x1a7)],_0x291a32(0x1f0)))['toString']()))['default'];}catch{try{_0x32bb49=require(require(_0x291a32(0x218))[_0x291a32(0x1cb)](this['nodeModules'],'ws'));}catch{throw new Error(_0x291a32(0x179));}}}return this['_WebSocketClass']=_0x32bb49,_0x32bb49;}[_0x198da5(0x1df)](){var _0x149ff7=_0x198da5;this[_0x149ff7(0x256)]||this['_connected']||this[_0x149ff7(0x211)]>=this[_0x149ff7(0x178)]||(this['_allowedToConnectOnSend']=!0x1,this[_0x149ff7(0x256)]=!0x0,this[_0x149ff7(0x211)]++,this[_0x149ff7(0x1d0)]=new Promise((_0x1a382c,_0xa23aa6)=>{var _0xb7d940=_0x149ff7;this['getWebSocketClass']()['then'](_0x2c48ee=>{var _0x57951f=_0x3128;let _0x9d1ac9=new _0x2c48ee(_0x57951f(0x21d)+this[_0x57951f(0x1a0)]+':'+this['port']);_0x9d1ac9[_0x57951f(0x213)]=()=>{var _0x5bbd7c=_0x57951f;this[_0x5bbd7c(0x254)]=!0x1,this[_0x5bbd7c(0x183)](_0x9d1ac9),this[_0x5bbd7c(0x1be)](),_0xa23aa6(new Error(_0x5bbd7c(0x18e)));},_0x9d1ac9['onopen']=()=>{var _0x105076=_0x57951f;this[_0x105076(0x1de)]||_0x9d1ac9[_0x105076(0x206)]&&_0x9d1ac9[_0x105076(0x206)][_0x105076(0x226)]&&_0x9d1ac9['_socket']['unref'](),_0x1a382c(_0x9d1ac9);},_0x9d1ac9['onclose']=()=>{var _0x5d0a12=_0x57951f;this[_0x5d0a12(0x1db)]=!0x0,this[_0x5d0a12(0x183)](_0x9d1ac9),this[_0x5d0a12(0x1be)]();},_0x9d1ac9[_0x57951f(0x233)]=_0x303762=>{var _0x32a9d5=_0x57951f;try{_0x303762&&_0x303762[_0x32a9d5(0x1e6)]&&this['_inBrowser']&&JSON[_0x32a9d5(0x214)](_0x303762[_0x32a9d5(0x1e6)])[_0x32a9d5(0x20a)]==='reload'&&this[_0x32a9d5(0x182)][_0x32a9d5(0x207)][_0x32a9d5(0x1b9)]();}catch{}};})[_0xb7d940(0x1b0)](_0x1815fe=>(this['_connected']=!0x0,this[_0xb7d940(0x256)]=!0x1,this[_0xb7d940(0x1db)]=!0x1,this[_0xb7d940(0x254)]=!0x0,this[_0xb7d940(0x211)]=0x0,_0x1815fe))[_0xb7d940(0x1e4)](_0x1341c2=>(this['_connected']=!0x1,this[_0xb7d940(0x256)]=!0x1,console[_0xb7d940(0x251)](_0xb7d940(0x1b6)+this[_0xb7d940(0x1ac)]),_0xa23aa6(new Error(_0xb7d940(0x1a6)+(_0x1341c2&&_0x1341c2[_0xb7d940(0x204)])))));}));}['_disposeWebsocket'](_0x2a7b41){var _0x41fbe4=_0x198da5;this[_0x41fbe4(0x1e2)]=!0x1,this[_0x41fbe4(0x256)]=!0x1;try{_0x2a7b41[_0x41fbe4(0x1a4)]=null,_0x2a7b41[_0x41fbe4(0x213)]=null,_0x2a7b41['onopen']=null;}catch{}try{_0x2a7b41['readyState']<0x2&&_0x2a7b41[_0x41fbe4(0x1a1)]();}catch{}}['_attemptToReconnectShortly'](){var _0x459436=_0x198da5;clearTimeout(this['_reconnectTimeout']),!(this['_connectAttemptCount']>=this[_0x459436(0x178)])&&(this[_0x459436(0x1c8)]=setTimeout(()=>{var _0x4f9e33=_0x459436;this[_0x4f9e33(0x1e2)]||this[_0x4f9e33(0x256)]||(this[_0x4f9e33(0x1df)](),this[_0x4f9e33(0x1d0)]?.[_0x4f9e33(0x1e4)](()=>this[_0x4f9e33(0x1be)]()));},0x1f4),this[_0x459436(0x1c8)]['unref']&&this[_0x459436(0x1c8)]['unref']());}async[_0x198da5(0x1f4)](_0x4d6fa2){var _0x406f0=_0x198da5;try{if(!this[_0x406f0(0x254)])return;this[_0x406f0(0x1db)]&&this['_connectToHostNow'](),(await this[_0x406f0(0x1d0)])[_0x406f0(0x1f4)](JSON[_0x406f0(0x192)](_0x4d6fa2));}catch(_0x28ff2f){console[_0x406f0(0x251)](this[_0x406f0(0x20e)]+':\\x20'+(_0x28ff2f&&_0x28ff2f[_0x406f0(0x204)])),this[_0x406f0(0x254)]=!0x1,this[_0x406f0(0x1be)]();}}};function V(_0x59b09b,_0x12630e,_0x1fde10,_0x24c076,_0x4bbb9d){var _0x429ab9=_0x198da5;let _0x2d1a43=_0x1fde10[_0x429ab9(0x19e)](',')['map'](_0x527209=>{var _0x50ce5a=_0x429ab9;try{_0x59b09b[_0x50ce5a(0x203)]||((_0x4bbb9d==='next.js'||_0x4bbb9d===_0x50ce5a(0x1ea)||_0x4bbb9d==='astro')&&(_0x4bbb9d+=_0x59b09b['process']?.[_0x50ce5a(0x239)]?.[_0x50ce5a(0x1a3)]?'\\x20server':'\\x20browser'),_0x59b09b[_0x50ce5a(0x203)]={'id':+new Date(),'tool':_0x4bbb9d});let _0x3b3646=new Q(_0x59b09b,_0x12630e,_0x527209,_0x24c076);return _0x3b3646[_0x50ce5a(0x1f4)][_0x50ce5a(0x1ce)](_0x3b3646);}catch(_0x7328f5){return console[_0x50ce5a(0x251)](_0x50ce5a(0x1b5),_0x7328f5&&_0x7328f5[_0x50ce5a(0x204)]),()=>{};}});return _0x3df3d4=>_0x2d1a43[_0x429ab9(0x1b2)](_0x2d7488=>_0x2d7488(_0x3df3d4));}function H(_0x244f9e){var _0x4c26b1=_0x198da5;let _0x441b73=function(_0xa17b1e,_0x2cc956){return _0x2cc956-_0xa17b1e;},_0x1629e2;if(_0x244f9e['performance'])_0x1629e2=function(){var _0x6a7ebb=_0x3128;return _0x244f9e[_0x6a7ebb(0x1c4)]['now']();};else{if(_0x244f9e['process']&&_0x244f9e[_0x4c26b1(0x24a)][_0x4c26b1(0x1e1)])_0x1629e2=function(){var _0x1c3b5b=_0x4c26b1;return _0x244f9e[_0x1c3b5b(0x24a)][_0x1c3b5b(0x1e1)]();},_0x441b73=function(_0x567aa4,_0x8c3a06){return 0x3e8*(_0x8c3a06[0x0]-_0x567aa4[0x0])+(_0x8c3a06[0x1]-_0x567aa4[0x1])/0xf4240;};else try{let {performance:_0x2cc570}=require(_0x4c26b1(0x1fb));_0x1629e2=function(){var _0x121f00=_0x4c26b1;return _0x2cc570[_0x121f00(0x217)]();};}catch{_0x1629e2=function(){return+new Date();};}}return{'elapsed':_0x441b73,'timeStamp':_0x1629e2,'now':()=>Date[_0x4c26b1(0x217)]()};}function X(_0x164790,_0x39d933,_0x5b3582){var _0x10f823=_0x198da5;if(_0x164790[_0x10f823(0x23a)]!==void 0x0)return _0x164790[_0x10f823(0x23a)];let _0x408c0b=_0x164790[_0x10f823(0x24a)]?.[_0x10f823(0x239)]?.[_0x10f823(0x1a3)];return _0x408c0b&&_0x5b3582===_0x10f823(0x19c)?_0x164790['_consoleNinjaAllowedToStart']=!0x1:_0x164790[_0x10f823(0x23a)]=_0x408c0b||!_0x39d933||_0x164790[_0x10f823(0x207)]?.[_0x10f823(0x1ed)]&&_0x39d933['includes'](_0x164790['location']['hostname']),_0x164790[_0x10f823(0x23a)];}((_0x215b52,_0x38d7e7,_0x9b4512,_0x5bbb24,_0x272fdb,_0x12d5de,_0x10fa0b,_0x4aae4f,_0x33c390)=>{var _0x401f13=_0x198da5;if(_0x215b52[_0x401f13(0x24c)])return _0x215b52[_0x401f13(0x24c)];if(!X(_0x215b52,_0x4aae4f,_0x272fdb))return _0x215b52[_0x401f13(0x24c)]={'consoleLog':()=>{},'consoleTrace':()=>{},'consoleTime':()=>{},'consoleTimeEnd':()=>{},'autoLog':()=>{},'autoLogMany':()=>{},'autoTraceMany':()=>{},'autoTrace':()=>{},'autoTime':()=>{},'autoTimeEnd':()=>{}},_0x215b52['_console_ninja'];let _0x4c74f6={'props':0x64,'elements':0x64,'strLength':0x400*0x32,'totalStrLength':0x400*0x32,'autoExpandLimit':0x1388,'autoExpandMaxDepth':0xa},_0x571eca={'props':0x5,'elements':0x5,'strLength':0x100,'totalStrLength':0x100*0x3,'autoExpandLimit':0x1e,'autoExpandMaxDepth':0x2},_0x2a2f2b=H(_0x215b52),_0xa9ec19=_0x2a2f2b[_0x401f13(0x1b4)],_0x5c2a75=_0x2a2f2b[_0x401f13(0x1fc)],_0x5ec0a2=_0x2a2f2b['now'],_0x386186={'hits':{},'ts':{}},_0x5ce2cb=_0x23f022=>{_0x386186['ts'][_0x23f022]=_0x5c2a75();},_0x5d952d=(_0x291e68,_0x1bcbad)=>{var _0x1dee1c=_0x401f13;let _0x554733=_0x386186['ts'][_0x1bcbad];if(delete _0x386186['ts'][_0x1bcbad],_0x554733){let _0x6ba052=_0xa9ec19(_0x554733,_0x5c2a75());_0xc209bd(_0x5361a1(_0x1dee1c(0x210),_0x291e68,_0x5ec0a2(),_0x5ec4b3,[_0x6ba052],_0x1bcbad));}},_0x4f88c8=_0x404b79=>_0x2d7c2f=>{var _0x3a1b67=_0x401f13;try{_0x5ce2cb(_0x2d7c2f),_0x404b79(_0x2d7c2f);}finally{_0x215b52[_0x3a1b67(0x1f3)]['time']=_0x404b79;}},_0x1a5e03=_0x5894be=>_0x524f60=>{var _0x21c5dc=_0x401f13;try{let [_0x31ea49,_0x21de7a]=_0x524f60[_0x21c5dc(0x19e)](':logPointId:');_0x5d952d(_0x21de7a,_0x31ea49),_0x5894be(_0x31ea49);}finally{_0x215b52[_0x21c5dc(0x1f3)]['timeEnd']=_0x5894be;}};_0x215b52[_0x401f13(0x24c)]={'consoleLog':(_0x190129,_0x4fa1b1)=>{var _0x302a32=_0x401f13;_0x215b52['console'][_0x302a32(0x17b)][_0x302a32(0x180)]!==_0x302a32(0x23d)&&_0xc209bd(_0x5361a1(_0x302a32(0x17b),_0x190129,_0x5ec0a2(),_0x5ec4b3,_0x4fa1b1));},'consoleTrace':(_0x56f265,_0x41b90f)=>{var _0x422d4c=_0x401f13;_0x215b52[_0x422d4c(0x1f3)][_0x422d4c(0x17b)][_0x422d4c(0x180)]!==_0x422d4c(0x17f)&&_0xc209bd(_0x5361a1('trace',_0x56f265,_0x5ec0a2(),_0x5ec4b3,_0x41b90f));},'consoleTime':()=>{var _0x145cb1=_0x401f13;_0x215b52['console'][_0x145cb1(0x210)]=_0x4f88c8(_0x215b52[_0x145cb1(0x1f3)][_0x145cb1(0x210)]);},'consoleTimeEnd':()=>{var _0x2c5ebf=_0x401f13;_0x215b52[_0x2c5ebf(0x1f3)][_0x2c5ebf(0x20f)]=_0x1a5e03(_0x215b52['console'][_0x2c5ebf(0x20f)]);},'autoLog':(_0x31a8b8,_0x15f803)=>{var _0x11cb61=_0x401f13;_0xc209bd(_0x5361a1(_0x11cb61(0x17b),_0x15f803,_0x5ec0a2(),_0x5ec4b3,[_0x31a8b8]));},'autoLogMany':(_0x503fdb,_0x15cff4)=>{var _0xb66d23=_0x401f13;_0xc209bd(_0x5361a1(_0xb66d23(0x17b),_0x503fdb,_0x5ec0a2(),_0x5ec4b3,_0x15cff4));},'autoTrace':(_0x1dfe09,_0x1d6b94)=>{_0xc209bd(_0x5361a1('trace',_0x1d6b94,_0x5ec0a2(),_0x5ec4b3,[_0x1dfe09]));},'autoTraceMany':(_0x570e6d,_0x268758)=>{var _0x50bebd=_0x401f13;_0xc209bd(_0x5361a1(_0x50bebd(0x241),_0x570e6d,_0x5ec0a2(),_0x5ec4b3,_0x268758));},'autoTime':(_0x246eb2,_0x485c2f,_0x4bc456)=>{_0x5ce2cb(_0x4bc456);},'autoTimeEnd':(_0x3c391c,_0x56055a,_0x43789d)=>{_0x5d952d(_0x56055a,_0x43789d);}};let _0xc209bd=V(_0x215b52,_0x38d7e7,_0x9b4512,_0x5bbb24,_0x272fdb),_0x5ec4b3=_0x215b52[_0x401f13(0x203)];class _0x43c10b{constructor(){var _0xaca562=_0x401f13;this['_keyStrRegExp']=/^(?!(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$)[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*$/,this['_numberRegExp']=/^(0|[1-9][0-9]*)$/,this[_0xaca562(0x208)]=/'([^\\\\']|\\\\')*'/,this[_0xaca562(0x1f5)]=_0x215b52['undefined'],this[_0xaca562(0x1d2)]=_0x215b52[_0xaca562(0x1bf)],this[_0xaca562(0x19a)]=Object['getOwnPropertyDescriptor'],this[_0xaca562(0x215)]=Object['getOwnPropertyNames'],this[_0xaca562(0x193)]=_0x215b52[_0xaca562(0x1a5)],this[_0xaca562(0x20c)]=RegExp[_0xaca562(0x1aa)][_0xaca562(0x196)],this[_0xaca562(0x195)]=Date[_0xaca562(0x1aa)][_0xaca562(0x196)];}['serialize'](_0x522423,_0x4659fa,_0x198ca4,_0x503fbd){var _0x12361b=_0x401f13,_0xab73a9=this,_0x23a15a=_0x198ca4[_0x12361b(0x1ca)];function _0x5cfd53(_0x4790bf,_0x4d002a,_0x3f08f4){var _0x2812eb=_0x12361b;_0x4d002a['type']=_0x2812eb(0x1da),_0x4d002a['error']=_0x4790bf[_0x2812eb(0x204)],_0x46b0ad=_0x3f08f4[_0x2812eb(0x1a3)]['current'],_0x3f08f4[_0x2812eb(0x1a3)][_0x2812eb(0x219)]=_0x4d002a,_0xab73a9['_treeNodePropertiesBeforeFullValue'](_0x4d002a,_0x3f08f4);}try{_0x198ca4[_0x12361b(0x1b8)]++,_0x198ca4[_0x12361b(0x1ca)]&&_0x198ca4['autoExpandPreviousObjects'][_0x12361b(0x247)](_0x4659fa);var _0x4127ff,_0x2f5980,_0x5969f3,_0x33c4d2,_0x50b9e2=[],_0x3f47ed=[],_0x46c7da,_0x2f8d31=this['_type'](_0x4659fa),_0x210641=_0x2f8d31==='array',_0x5e41c0=!0x1,_0x22321f=_0x2f8d31===_0x12361b(0x23b),_0x4ed8b2=this['_isPrimitiveType'](_0x2f8d31),_0x466869=this['_isPrimitiveWrapperType'](_0x2f8d31),_0x926583=_0x4ed8b2||_0x466869,_0xd631b4={},_0x38d82d=0x0,_0x2bcff8=!0x1,_0x46b0ad,_0x583ff2=/^(([1-9]{1}[0-9]*)|0)$/;if(_0x198ca4['depth']){if(_0x210641){if(_0x2f5980=_0x4659fa['length'],_0x2f5980>_0x198ca4['elements']){for(_0x5969f3=0x0,_0x33c4d2=_0x198ca4[_0x12361b(0x227)],_0x4127ff=_0x5969f3;_0x4127ff<_0x33c4d2;_0x4127ff++)_0x3f47ed[_0x12361b(0x247)](_0xab73a9['_addProperty'](_0x50b9e2,_0x4659fa,_0x2f8d31,_0x4127ff,_0x198ca4));_0x522423[_0x12361b(0x24f)]=!0x0;}else{for(_0x5969f3=0x0,_0x33c4d2=_0x2f5980,_0x4127ff=_0x5969f3;_0x4127ff<_0x33c4d2;_0x4127ff++)_0x3f47ed['push'](_0xab73a9[_0x12361b(0x1d1)](_0x50b9e2,_0x4659fa,_0x2f8d31,_0x4127ff,_0x198ca4));}_0x198ca4[_0x12361b(0x187)]+=_0x3f47ed[_0x12361b(0x246)];}if(!(_0x2f8d31===_0x12361b(0x242)||_0x2f8d31===_0x12361b(0x222))&&!_0x4ed8b2&&_0x2f8d31!==_0x12361b(0x1e9)&&_0x2f8d31!==_0x12361b(0x1b7)&&_0x2f8d31!==_0x12361b(0x1dd)){var _0x122b94=_0x503fbd['props']||_0x198ca4[_0x12361b(0x24b)];if(this[_0x12361b(0x1fd)](_0x4659fa)?(_0x4127ff=0x0,_0x4659fa[_0x12361b(0x1b2)](function(_0x3ffd37){var _0x488e51=_0x12361b;if(_0x38d82d++,_0x198ca4[_0x488e51(0x187)]++,_0x38d82d>_0x122b94){_0x2bcff8=!0x0;return;}if(!_0x198ca4[_0x488e51(0x1ad)]&&_0x198ca4['autoExpand']&&_0x198ca4[_0x488e51(0x187)]>_0x198ca4[_0x488e51(0x1cc)]){_0x2bcff8=!0x0;return;}_0x3f47ed['push'](_0xab73a9[_0x488e51(0x1d1)](_0x50b9e2,_0x4659fa,_0x488e51(0x1ee),_0x4127ff++,_0x198ca4,function(_0x34ffd3){return function(){return _0x34ffd3;};}(_0x3ffd37)));})):this[_0x12361b(0x244)](_0x4659fa)&&_0x4659fa[_0x12361b(0x1b2)](function(_0x1882fb,_0x227bda){var _0x386232=_0x12361b;if(_0x38d82d++,_0x198ca4[_0x386232(0x187)]++,_0x38d82d>_0x122b94){_0x2bcff8=!0x0;return;}if(!_0x198ca4['isExpressionToEvaluate']&&_0x198ca4[_0x386232(0x1ca)]&&_0x198ca4[_0x386232(0x187)]>_0x198ca4[_0x386232(0x1cc)]){_0x2bcff8=!0x0;return;}var _0xdeca49=_0x227bda[_0x386232(0x196)]();_0xdeca49['length']>0x64&&(_0xdeca49=_0xdeca49[_0x386232(0x1bc)](0x0,0x64)+'...'),_0x3f47ed[_0x386232(0x247)](_0xab73a9[_0x386232(0x1d1)](_0x50b9e2,_0x4659fa,_0x386232(0x250),_0xdeca49,_0x198ca4,function(_0x32e351){return function(){return _0x32e351;};}(_0x1882fb)));}),!_0x5e41c0){try{for(_0x46c7da in _0x4659fa)if(!(_0x210641&&_0x583ff2['test'](_0x46c7da))&&!this[_0x12361b(0x191)](_0x4659fa,_0x46c7da,_0x198ca4)){if(_0x38d82d++,_0x198ca4[_0x12361b(0x187)]++,_0x38d82d>_0x122b94){_0x2bcff8=!0x0;break;}if(!_0x198ca4['isExpressionToEvaluate']&&_0x198ca4[_0x12361b(0x1ca)]&&_0x198ca4[_0x12361b(0x187)]>_0x198ca4[_0x12361b(0x1cc)]){_0x2bcff8=!0x0;break;}_0x3f47ed['push'](_0xab73a9[_0x12361b(0x176)](_0x50b9e2,_0xd631b4,_0x4659fa,_0x2f8d31,_0x46c7da,_0x198ca4));}}catch{}if(_0xd631b4['_p_length']=!0x0,_0x22321f&&(_0xd631b4[_0x12361b(0x1ae)]=!0x0),!_0x2bcff8){var _0x51e875=[][_0x12361b(0x245)](this[_0x12361b(0x215)](_0x4659fa))[_0x12361b(0x245)](this[_0x12361b(0x1f9)](_0x4659fa));for(_0x4127ff=0x0,_0x2f5980=_0x51e875['length'];_0x4127ff<_0x2f5980;_0x4127ff++)if(_0x46c7da=_0x51e875[_0x4127ff],!(_0x210641&&_0x583ff2[_0x12361b(0x21c)](_0x46c7da[_0x12361b(0x196)]()))&&!this[_0x12361b(0x191)](_0x4659fa,_0x46c7da,_0x198ca4)&&!_0xd631b4[_0x12361b(0x1c0)+_0x46c7da[_0x12361b(0x196)]()]){if(_0x38d82d++,_0x198ca4[_0x12361b(0x187)]++,_0x38d82d>_0x122b94){_0x2bcff8=!0x0;break;}if(!_0x198ca4[_0x12361b(0x1ad)]&&_0x198ca4['autoExpand']&&_0x198ca4[_0x12361b(0x187)]>_0x198ca4[_0x12361b(0x1cc)]){_0x2bcff8=!0x0;break;}_0x3f47ed[_0x12361b(0x247)](_0xab73a9[_0x12361b(0x176)](_0x50b9e2,_0xd631b4,_0x4659fa,_0x2f8d31,_0x46c7da,_0x198ca4));}}}}}if(_0x522423[_0x12361b(0x21a)]=_0x2f8d31,_0x926583?(_0x522423['value']=_0x4659fa['valueOf'](),this[_0x12361b(0x228)](_0x2f8d31,_0x522423,_0x198ca4,_0x503fbd)):_0x2f8d31===_0x12361b(0x21e)?_0x522423[_0x12361b(0x1d8)]=this[_0x12361b(0x195)][_0x12361b(0x201)](_0x4659fa):_0x2f8d31===_0x12361b(0x1dd)?_0x522423[_0x12361b(0x1d8)]=_0x4659fa[_0x12361b(0x196)]():_0x2f8d31===_0x12361b(0x1ec)?_0x522423[_0x12361b(0x1d8)]=this[_0x12361b(0x20c)][_0x12361b(0x201)](_0x4659fa):_0x2f8d31==='symbol'&&this[_0x12361b(0x193)]?_0x522423[_0x12361b(0x1d8)]=this[_0x12361b(0x193)]['prototype'][_0x12361b(0x196)][_0x12361b(0x201)](_0x4659fa):!_0x198ca4[_0x12361b(0x1e7)]&&!(_0x2f8d31==='null'||_0x2f8d31===_0x12361b(0x222))&&(delete _0x522423[_0x12361b(0x1d8)],_0x522423['capped']=!0x0),_0x2bcff8&&(_0x522423[_0x12361b(0x253)]=!0x0),_0x46b0ad=_0x198ca4[_0x12361b(0x1a3)][_0x12361b(0x219)],_0x198ca4[_0x12361b(0x1a3)][_0x12361b(0x219)]=_0x522423,this[_0x12361b(0x20d)](_0x522423,_0x198ca4),_0x3f47ed[_0x12361b(0x246)]){for(_0x4127ff=0x0,_0x2f5980=_0x3f47ed[_0x12361b(0x246)];_0x4127ff<_0x2f5980;_0x4127ff++)_0x3f47ed[_0x4127ff](_0x4127ff);}_0x50b9e2['length']&&(_0x522423[_0x12361b(0x24b)]=_0x50b9e2);}catch(_0x347450){_0x5cfd53(_0x347450,_0x522423,_0x198ca4);}return this[_0x12361b(0x1f8)](_0x4659fa,_0x522423),this[_0x12361b(0x1b1)](_0x522423,_0x198ca4),_0x198ca4[_0x12361b(0x1a3)]['current']=_0x46b0ad,_0x198ca4[_0x12361b(0x1b8)]--,_0x198ca4[_0x12361b(0x1ca)]=_0x23a15a,_0x198ca4[_0x12361b(0x1ca)]&&_0x198ca4[_0x12361b(0x209)][_0x12361b(0x238)](),_0x522423;}[_0x401f13(0x1f9)](_0x33c1ba){var _0xab1e32=_0x401f13;return Object[_0xab1e32(0x22a)]?Object[_0xab1e32(0x22a)](_0x33c1ba):[];}['_isSet'](_0x1110fa){var _0x39f2ae=_0x401f13;return!!(_0x1110fa&&_0x215b52[_0x39f2ae(0x1ee)]&&this[_0x39f2ae(0x200)](_0x1110fa)===_0x39f2ae(0x1d5)&&_0x1110fa[_0x39f2ae(0x1b2)]);}[_0x401f13(0x191)](_0x4fb04b,_0x44d532,_0x44d596){var _0x473ca7=_0x401f13;return _0x44d596['noFunctions']?typeof _0x4fb04b[_0x44d532]==_0x473ca7(0x23b):!0x1;}[_0x401f13(0x17a)](_0x206dda){var _0x528152=_0x401f13,_0x55368e='';return _0x55368e=typeof _0x206dda,_0x55368e===_0x528152(0x230)?this[_0x528152(0x200)](_0x206dda)===_0x528152(0x175)?_0x55368e=_0x528152(0x205):this[_0x528152(0x200)](_0x206dda)===_0x528152(0x17c)?_0x55368e=_0x528152(0x21e):this[_0x528152(0x200)](_0x206dda)===_0x528152(0x248)?_0x55368e='bigint':_0x206dda===null?_0x55368e=_0x528152(0x242):_0x206dda['constructor']&&(_0x55368e=_0x206dda[_0x528152(0x17d)][_0x528152(0x180)]||_0x55368e):_0x55368e===_0x528152(0x222)&&this['_HTMLAllCollection']&&_0x206dda instanceof this[_0x528152(0x1d2)]&&(_0x55368e='HTMLAllCollection'),_0x55368e;}[_0x401f13(0x200)](_0xd0180a){var _0x189acc=_0x401f13;return Object[_0x189acc(0x1aa)][_0x189acc(0x196)]['call'](_0xd0180a);}[_0x401f13(0x24e)](_0x7816d0){var _0x17096c=_0x401f13;return _0x7816d0==='boolean'||_0x7816d0==='string'||_0x7816d0===_0x17096c(0x231);}['_isPrimitiveWrapperType'](_0x10b36e){var _0x25eabe=_0x401f13;return _0x10b36e==='Boolean'||_0x10b36e==='String'||_0x10b36e===_0x25eabe(0x21b);}[_0x401f13(0x1d1)](_0x4e0237,_0x34fc05,_0x51b86d,_0x1c749a,_0x5e9ff1,_0x32679f){var _0x260053=this;return function(_0x57486f){var _0x3de0a8=_0x3128,_0x263fe3=_0x5e9ff1[_0x3de0a8(0x1a3)][_0x3de0a8(0x219)],_0x3cc506=_0x5e9ff1[_0x3de0a8(0x1a3)][_0x3de0a8(0x20b)],_0x5a7843=_0x5e9ff1['node'][_0x3de0a8(0x236)];_0x5e9ff1['node'][_0x3de0a8(0x236)]=_0x263fe3,_0x5e9ff1[_0x3de0a8(0x1a3)][_0x3de0a8(0x20b)]=typeof _0x1c749a=='number'?_0x1c749a:_0x57486f,_0x4e0237[_0x3de0a8(0x247)](_0x260053['_property'](_0x34fc05,_0x51b86d,_0x1c749a,_0x5e9ff1,_0x32679f)),_0x5e9ff1[_0x3de0a8(0x1a3)][_0x3de0a8(0x236)]=_0x5a7843,_0x5e9ff1[_0x3de0a8(0x1a3)][_0x3de0a8(0x20b)]=_0x3cc506;};}[_0x401f13(0x176)](_0x1b13b5,_0x3bd0ee,_0x19fdc7,_0x3e0e6b,_0xa58106,_0x241e51,_0x372c52){var _0x13c9ad=_0x401f13,_0x6cfe43=this;return _0x3bd0ee[_0x13c9ad(0x1c0)+_0xa58106[_0x13c9ad(0x196)]()]=!0x0,function(_0x213b6f){var _0x48a74=_0x13c9ad,_0x589603=_0x241e51[_0x48a74(0x1a3)][_0x48a74(0x219)],_0x2a56e7=_0x241e51[_0x48a74(0x1a3)][_0x48a74(0x20b)],_0x44af41=_0x241e51[_0x48a74(0x1a3)][_0x48a74(0x236)];_0x241e51[_0x48a74(0x1a3)][_0x48a74(0x236)]=_0x589603,_0x241e51[_0x48a74(0x1a3)][_0x48a74(0x20b)]=_0x213b6f,_0x1b13b5[_0x48a74(0x247)](_0x6cfe43[_0x48a74(0x1eb)](_0x19fdc7,_0x3e0e6b,_0xa58106,_0x241e51,_0x372c52)),_0x241e51['node'][_0x48a74(0x236)]=_0x44af41,_0x241e51[_0x48a74(0x1a3)][_0x48a74(0x20b)]=_0x2a56e7;};}[_0x401f13(0x1eb)](_0x4290c6,_0x56967d,_0x299d84,_0x5a331d,_0xeb248f){var _0x16afc1=_0x401f13,_0x13a705=this;_0xeb248f||(_0xeb248f=function(_0x541f68,_0x16f881){return _0x541f68[_0x16f881];});var _0x341cd5=_0x299d84[_0x16afc1(0x196)](),_0x27ef97=_0x5a331d[_0x16afc1(0x1a8)]||{},_0x429173=_0x5a331d['depth'],_0x32cdfe=_0x5a331d[_0x16afc1(0x1ad)];try{var _0x433856=this[_0x16afc1(0x244)](_0x4290c6),_0x1865d2=_0x341cd5;_0x433856&&_0x1865d2[0x0]==='\\x27'&&(_0x1865d2=_0x1865d2[_0x16afc1(0x23f)](0x1,_0x1865d2[_0x16afc1(0x246)]-0x2));var _0x524185=_0x5a331d[_0x16afc1(0x1a8)]=_0x27ef97[_0x16afc1(0x1c0)+_0x1865d2];_0x524185&&(_0x5a331d[_0x16afc1(0x1e7)]=_0x5a331d[_0x16afc1(0x1e7)]+0x1),_0x5a331d[_0x16afc1(0x1ad)]=!!_0x524185;var _0x268757=typeof _0x299d84==_0x16afc1(0x22c),_0x3d0f8d={'name':_0x268757||_0x433856?_0x341cd5:this[_0x16afc1(0x19f)](_0x341cd5)};if(_0x268757&&(_0x3d0f8d['symbol']=!0x0),!(_0x56967d===_0x16afc1(0x205)||_0x56967d===_0x16afc1(0x1d6))){var _0xedf1f9=this['_getOwnPropertyDescriptor'](_0x4290c6,_0x299d84);if(_0xedf1f9&&(_0xedf1f9[_0x16afc1(0x224)]&&(_0x3d0f8d['setter']=!0x0),_0xedf1f9[_0x16afc1(0x1a9)]&&!_0x524185&&!_0x5a331d[_0x16afc1(0x188)]))return _0x3d0f8d[_0x16afc1(0x18a)]=!0x0,this[_0x16afc1(0x1bb)](_0x3d0f8d,_0x5a331d),_0x3d0f8d;}var _0x1021aa;try{_0x1021aa=_0xeb248f(_0x4290c6,_0x299d84);}catch(_0x345384){return _0x3d0f8d={'name':_0x341cd5,'type':_0x16afc1(0x1da),'error':_0x345384[_0x16afc1(0x204)]},this[_0x16afc1(0x1bb)](_0x3d0f8d,_0x5a331d),_0x3d0f8d;}var _0x448f0e=this[_0x16afc1(0x17a)](_0x1021aa),_0x433812=this['_isPrimitiveType'](_0x448f0e);if(_0x3d0f8d[_0x16afc1(0x21a)]=_0x448f0e,_0x433812)this[_0x16afc1(0x1bb)](_0x3d0f8d,_0x5a331d,_0x1021aa,function(){var _0x310481=_0x16afc1;_0x3d0f8d[_0x310481(0x1d8)]=_0x1021aa[_0x310481(0x23e)](),!_0x524185&&_0x13a705[_0x310481(0x228)](_0x448f0e,_0x3d0f8d,_0x5a331d,{});});else{var _0x25efc9=_0x5a331d[_0x16afc1(0x1ca)]&&_0x5a331d[_0x16afc1(0x1b8)]<_0x5a331d[_0x16afc1(0x249)]&&_0x5a331d[_0x16afc1(0x209)][_0x16afc1(0x22b)](_0x1021aa)<0x0&&_0x448f0e!==_0x16afc1(0x23b)&&_0x5a331d['autoExpandPropertyCount']<_0x5a331d['autoExpandLimit'];_0x25efc9||_0x5a331d[_0x16afc1(0x1b8)]<_0x429173||_0x524185?(this[_0x16afc1(0x1cd)](_0x3d0f8d,_0x1021aa,_0x5a331d,_0x524185||{}),this[_0x16afc1(0x1f8)](_0x1021aa,_0x3d0f8d)):this[_0x16afc1(0x1bb)](_0x3d0f8d,_0x5a331d,_0x1021aa,function(){var _0x4e04c6=_0x16afc1;_0x448f0e==='null'||_0x448f0e===_0x4e04c6(0x222)||(delete _0x3d0f8d[_0x4e04c6(0x1d8)],_0x3d0f8d[_0x4e04c6(0x1c7)]=!0x0);});}return _0x3d0f8d;}finally{_0x5a331d[_0x16afc1(0x1a8)]=_0x27ef97,_0x5a331d[_0x16afc1(0x1e7)]=_0x429173,_0x5a331d[_0x16afc1(0x1ad)]=_0x32cdfe;}}[_0x401f13(0x228)](_0x5505d5,_0x4cb10c,_0x417122,_0x2e32c9){var _0x4b0bb6=_0x401f13,_0x1019e1=_0x2e32c9[_0x4b0bb6(0x240)]||_0x417122['strLength'];if((_0x5505d5===_0x4b0bb6(0x202)||_0x5505d5===_0x4b0bb6(0x1e9))&&_0x4cb10c['value']){let _0x2d3817=_0x4cb10c['value']['length'];_0x417122[_0x4b0bb6(0x1f7)]+=_0x2d3817,_0x417122[_0x4b0bb6(0x1f7)]>_0x417122[_0x4b0bb6(0x1ff)]?(_0x4cb10c[_0x4b0bb6(0x1c7)]='',delete _0x4cb10c[_0x4b0bb6(0x1d8)]):_0x2d3817>_0x1019e1&&(_0x4cb10c[_0x4b0bb6(0x1c7)]=_0x4cb10c[_0x4b0bb6(0x1d8)]['substr'](0x0,_0x1019e1),delete _0x4cb10c[_0x4b0bb6(0x1d8)]);}}[_0x401f13(0x244)](_0x49bef9){var _0x114f60=_0x401f13;return!!(_0x49bef9&&_0x215b52[_0x114f60(0x250)]&&this[_0x114f60(0x200)](_0x49bef9)===_0x114f60(0x252)&&_0x49bef9[_0x114f60(0x1b2)]);}['_propertyName'](_0x52f5d3){var _0x444795=_0x401f13;if(_0x52f5d3[_0x444795(0x1bd)](/^\\d+$/))return _0x52f5d3;var _0x2fc14d;try{_0x2fc14d=JSON[_0x444795(0x192)](''+_0x52f5d3);}catch{_0x2fc14d='\\x22'+this[_0x444795(0x200)](_0x52f5d3)+'\\x22';}return _0x2fc14d['match'](/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?_0x2fc14d=_0x2fc14d[_0x444795(0x23f)](0x1,_0x2fc14d[_0x444795(0x246)]-0x2):_0x2fc14d=_0x2fc14d['replace'](/'/g,'\\x5c\\x27')[_0x444795(0x186)](/\\\\\"/g,'\\x22')[_0x444795(0x186)](/(^\"|\"$)/g,'\\x27'),_0x2fc14d;}['_processTreeNodeResult'](_0x1ebba4,_0x80c0c8,_0x18a7ac,_0x4699bd){var _0x5ddf2b=_0x401f13;this[_0x5ddf2b(0x20d)](_0x1ebba4,_0x80c0c8),_0x4699bd&&_0x4699bd(),this['_additionalMetadata'](_0x18a7ac,_0x1ebba4),this[_0x5ddf2b(0x1b1)](_0x1ebba4,_0x80c0c8);}[_0x401f13(0x20d)](_0x348e29,_0x391689){var _0xad02de=_0x401f13;this[_0xad02de(0x189)](_0x348e29,_0x391689),this[_0xad02de(0x235)](_0x348e29,_0x391689),this[_0xad02de(0x1fe)](_0x348e29,_0x391689),this[_0xad02de(0x190)](_0x348e29,_0x391689);}[_0x401f13(0x189)](_0x166c40,_0x4feb87){}[_0x401f13(0x235)](_0x5ba2e3,_0x425cb1){}[_0x401f13(0x19d)](_0x212222,_0xedda1a){}[_0x401f13(0x229)](_0x2a57e7){var _0x49ede9=_0x401f13;return _0x2a57e7===this[_0x49ede9(0x1f5)];}[_0x401f13(0x1b1)](_0x12f89f,_0x36acc6){var _0x25d99b=_0x401f13;this[_0x25d99b(0x19d)](_0x12f89f,_0x36acc6),this[_0x25d99b(0x1f1)](_0x12f89f),_0x36acc6[_0x25d99b(0x1c1)]&&this[_0x25d99b(0x1c2)](_0x12f89f),this['_addFunctionsNode'](_0x12f89f,_0x36acc6),this[_0x25d99b(0x255)](_0x12f89f,_0x36acc6),this['_cleanNode'](_0x12f89f);}[_0x401f13(0x1f8)](_0x7b96b8,_0x2d717e){var _0x711e0b=_0x401f13;let _0x339ff0;try{_0x215b52[_0x711e0b(0x1f3)]&&(_0x339ff0=_0x215b52[_0x711e0b(0x1f3)][_0x711e0b(0x18d)],_0x215b52[_0x711e0b(0x1f3)][_0x711e0b(0x18d)]=function(){}),_0x7b96b8&&typeof _0x7b96b8[_0x711e0b(0x246)]==_0x711e0b(0x231)&&(_0x2d717e[_0x711e0b(0x246)]=_0x7b96b8[_0x711e0b(0x246)]);}catch{}finally{_0x339ff0&&(_0x215b52[_0x711e0b(0x1f3)]['error']=_0x339ff0);}if(_0x2d717e[_0x711e0b(0x21a)]==='number'||_0x2d717e['type']===_0x711e0b(0x21b)){if(isNaN(_0x2d717e[_0x711e0b(0x1d8)]))_0x2d717e[_0x711e0b(0x257)]=!0x0,delete _0x2d717e[_0x711e0b(0x1d8)];else switch(_0x2d717e[_0x711e0b(0x1d8)]){case Number[_0x711e0b(0x1fa)]:_0x2d717e['positiveInfinity']=!0x0,delete _0x2d717e[_0x711e0b(0x1d8)];break;case Number[_0x711e0b(0x1f6)]:_0x2d717e['negativeInfinity']=!0x0,delete _0x2d717e[_0x711e0b(0x1d8)];break;case 0x0:this[_0x711e0b(0x18b)](_0x2d717e[_0x711e0b(0x1d8)])&&(_0x2d717e[_0x711e0b(0x22d)]=!0x0);break;}}else _0x2d717e[_0x711e0b(0x21a)]===_0x711e0b(0x23b)&&typeof _0x7b96b8[_0x711e0b(0x180)]==_0x711e0b(0x202)&&_0x7b96b8[_0x711e0b(0x180)]&&_0x2d717e['name']&&_0x7b96b8[_0x711e0b(0x180)]!==_0x2d717e['name']&&(_0x2d717e[_0x711e0b(0x1e5)]=_0x7b96b8[_0x711e0b(0x180)]);}[_0x401f13(0x18b)](_0x5e5525){return 0x1/_0x5e5525===Number['NEGATIVE_INFINITY'];}[_0x401f13(0x1c2)](_0x2ef586){var _0x18f502=_0x401f13;!_0x2ef586['props']||!_0x2ef586[_0x18f502(0x24b)][_0x18f502(0x246)]||_0x2ef586[_0x18f502(0x21a)]===_0x18f502(0x205)||_0x2ef586['type']===_0x18f502(0x250)||_0x2ef586[_0x18f502(0x21a)]===_0x18f502(0x1ee)||_0x2ef586['props'][_0x18f502(0x1ba)](function(_0x120298,_0x1f1bab){var _0x188272=_0x18f502,_0x2f2b82=_0x120298[_0x188272(0x180)]['toLowerCase'](),_0x4e0350=_0x1f1bab[_0x188272(0x180)]['toLowerCase']();return _0x2f2b82<_0x4e0350?-0x1:_0x2f2b82>_0x4e0350?0x1:0x0;});}[_0x401f13(0x198)](_0x43e64a,_0x10179f){var _0x194c72=_0x401f13;if(!(_0x10179f[_0x194c72(0x19b)]||!_0x43e64a[_0x194c72(0x24b)]||!_0x43e64a[_0x194c72(0x24b)][_0x194c72(0x246)])){for(var _0x581102=[],_0x275966=[],_0x31441e=0x0,_0x37c72f=_0x43e64a[_0x194c72(0x24b)]['length'];_0x31441e<_0x37c72f;_0x31441e++){var _0x2bd0ad=_0x43e64a[_0x194c72(0x24b)][_0x31441e];_0x2bd0ad[_0x194c72(0x21a)]===_0x194c72(0x23b)?_0x581102[_0x194c72(0x247)](_0x2bd0ad):_0x275966[_0x194c72(0x247)](_0x2bd0ad);}if(!(!_0x275966[_0x194c72(0x246)]||_0x581102[_0x194c72(0x246)]<=0x1)){_0x43e64a[_0x194c72(0x24b)]=_0x275966;var _0x28dfc9={'functionsNode':!0x0,'props':_0x581102};this[_0x194c72(0x189)](_0x28dfc9,_0x10179f),this[_0x194c72(0x19d)](_0x28dfc9,_0x10179f),this[_0x194c72(0x1f1)](_0x28dfc9),this['_setNodePermissions'](_0x28dfc9,_0x10179f),_0x28dfc9['id']+='\\x20f',_0x43e64a[_0x194c72(0x24b)]['unshift'](_0x28dfc9);}}}[_0x401f13(0x255)](_0x41b5d5,_0x1058e3){}[_0x401f13(0x1f1)](_0x559418){}['_isArray'](_0x1f44eb){var _0x1ca4f6=_0x401f13;return Array['isArray'](_0x1f44eb)||typeof _0x1f44eb==_0x1ca4f6(0x230)&&this[_0x1ca4f6(0x200)](_0x1f44eb)===_0x1ca4f6(0x175);}[_0x401f13(0x190)](_0x1c3189,_0x110f78){}[_0x401f13(0x221)](_0x1d8acc){var _0x3f2e2e=_0x401f13;delete _0x1d8acc[_0x3f2e2e(0x1cf)],delete _0x1d8acc[_0x3f2e2e(0x23c)],delete _0x1d8acc[_0x3f2e2e(0x1c6)];}[_0x401f13(0x1fe)](_0x35bbe5,_0x336079){}[_0x401f13(0x21f)](_0x30b8d8){var _0x3deac4=_0x401f13;return _0x30b8d8?_0x30b8d8['match'](this[_0x3deac4(0x22f)])?'['+_0x30b8d8+']':_0x30b8d8[_0x3deac4(0x1bd)](this[_0x3deac4(0x1dc)])?'.'+_0x30b8d8:_0x30b8d8[_0x3deac4(0x1bd)](this[_0x3deac4(0x208)])?'['+_0x30b8d8+']':'[\\x27'+_0x30b8d8+'\\x27]':'';}}let _0x35007d=new _0x43c10b();function _0x5361a1(_0x44c395,_0x563346,_0x2f5ec2,_0x17c82c,_0x1fbd61,_0x5ca88c){var _0x377fd4=_0x401f13;let _0x4e85c2,_0x233b34;try{_0x233b34=_0x5c2a75(),_0x4e85c2=_0x386186[_0x563346],!_0x4e85c2||_0x233b34-_0x4e85c2['ts']>0x1f4&&_0x4e85c2[_0x377fd4(0x220)]&&_0x4e85c2[_0x377fd4(0x210)]/_0x4e85c2[_0x377fd4(0x220)]<0x64?(_0x386186[_0x563346]=_0x4e85c2={'count':0x0,'time':0x0,'ts':_0x233b34},_0x386186[_0x377fd4(0x1d3)]={}):_0x233b34-_0x386186['hits']['ts']>0x32&&_0x386186[_0x377fd4(0x1d3)][_0x377fd4(0x220)]&&_0x386186[_0x377fd4(0x1d3)][_0x377fd4(0x210)]/_0x386186[_0x377fd4(0x1d3)][_0x377fd4(0x220)]<0x64&&(_0x386186[_0x377fd4(0x1d3)]={});let _0x40e198=[],_0x4e9017=_0x4e85c2['reduceLimits']||_0x386186[_0x377fd4(0x1d3)][_0x377fd4(0x199)]?_0x571eca:_0x4c74f6,_0x417b97=_0x5a157c=>{var _0x1323c2=_0x377fd4;let _0x59d612={};return _0x59d612['props']=_0x5a157c[_0x1323c2(0x24b)],_0x59d612[_0x1323c2(0x227)]=_0x5a157c[_0x1323c2(0x227)],_0x59d612[_0x1323c2(0x240)]=_0x5a157c[_0x1323c2(0x240)],_0x59d612[_0x1323c2(0x1ff)]=_0x5a157c[_0x1323c2(0x1ff)],_0x59d612[_0x1323c2(0x1cc)]=_0x5a157c[_0x1323c2(0x1cc)],_0x59d612[_0x1323c2(0x249)]=_0x5a157c['autoExpandMaxDepth'],_0x59d612[_0x1323c2(0x1c1)]=!0x1,_0x59d612['noFunctions']=!_0x33c390,_0x59d612['depth']=0x1,_0x59d612[_0x1323c2(0x1b8)]=0x0,_0x59d612['expId']=_0x1323c2(0x225),_0x59d612[_0x1323c2(0x24d)]=_0x1323c2(0x18f),_0x59d612[_0x1323c2(0x1ca)]=!0x0,_0x59d612[_0x1323c2(0x209)]=[],_0x59d612[_0x1323c2(0x187)]=0x0,_0x59d612[_0x1323c2(0x188)]=!0x0,_0x59d612['allStrLength']=0x0,_0x59d612[_0x1323c2(0x1a3)]={'current':void 0x0,'parent':void 0x0,'index':0x0},_0x59d612;};for(var _0x274761=0x0;_0x274761<_0x1fbd61[_0x377fd4(0x246)];_0x274761++)_0x40e198['push'](_0x35007d[_0x377fd4(0x1cd)]({'timeNode':_0x44c395==='time'||void 0x0},_0x1fbd61[_0x274761],_0x417b97(_0x4e9017),{}));if(_0x44c395===_0x377fd4(0x241)){let _0x55385c=Error[_0x377fd4(0x1af)];try{Error[_0x377fd4(0x1af)]=0x1/0x0,_0x40e198[_0x377fd4(0x247)](_0x35007d['serialize']({'stackNode':!0x0},new Error()[_0x377fd4(0x1d7)],_0x417b97(_0x4e9017),{'strLength':0x1/0x0}));}finally{Error[_0x377fd4(0x1af)]=_0x55385c;}}return{'method':_0x377fd4(0x17b),'version':_0x12d5de,'args':[{'ts':_0x2f5ec2,'session':_0x17c82c,'args':_0x40e198,'id':_0x563346,'context':_0x5ca88c}]};}catch(_0xe16010){return{'method':_0x377fd4(0x17b),'version':_0x12d5de,'args':[{'ts':_0x2f5ec2,'session':_0x17c82c,'args':[{'type':_0x377fd4(0x1da),'error':_0xe16010&&_0xe16010[_0x377fd4(0x204)]}],'id':_0x563346,'context':_0x5ca88c}]};}finally{try{if(_0x4e85c2&&_0x233b34){let _0x11081a=_0x5c2a75();_0x4e85c2[_0x377fd4(0x220)]++,_0x4e85c2[_0x377fd4(0x210)]+=_0xa9ec19(_0x233b34,_0x11081a),_0x4e85c2['ts']=_0x11081a,_0x386186[_0x377fd4(0x1d3)][_0x377fd4(0x220)]++,_0x386186[_0x377fd4(0x1d3)][_0x377fd4(0x210)]+=_0xa9ec19(_0x233b34,_0x11081a),_0x386186[_0x377fd4(0x1d3)]['ts']=_0x11081a,(_0x4e85c2[_0x377fd4(0x220)]>0x32||_0x4e85c2[_0x377fd4(0x210)]>0x64)&&(_0x4e85c2[_0x377fd4(0x199)]=!0x0),(_0x386186['hits'][_0x377fd4(0x220)]>0x3e8||_0x386186[_0x377fd4(0x1d3)]['time']>0x12c)&&(_0x386186[_0x377fd4(0x1d3)]['reduceLimits']=!0x0);}}catch{}}}return _0x215b52['_console_ninja'];})(globalThis,_0x198da5(0x216),'54272',_0x198da5(0x237),_0x198da5(0x1c9),_0x198da5(0x22e),_0x198da5(0x197),_0x198da5(0x1f2),'');")}catch(e){}})().consoleLog(e,t)}catch(e){}return t}("163540c6_0","titleFnJs",e))}return e.titleFn?e.titleFn(e):String(e.title)}setText(e){const t=this.box.getBoundingClientRect();let i=globalThis.marked;const n=hn.getTitle(e);if(i){this.text.innerHTML=i(n);const e=this.text.getElementsByTagName("A");for(let t=0;t<e.length;++t)e[t].setAttribute("target","_blank")}else this.text.innerHTML=n;return t}updateText(e){if(this.currentPen?.id!==e.id)return;if(hn.titleEmpty(e))return;const t=this.setText(e),i=this.box.getBoundingClientRect();this.changePositionByText(t,i)}changePositionByText(e,t){this.x-=(t.width-e.width)/2,this.y-=t.height-e.height,this.box.style.left=this.x+"px",this.box.style.top=this.y+"px"}static titleEmpty(e){return!e.title&&!e.titleFn&&!e.titleFnJs}show(e,t){if(this.currentPen=e,hn.titleEmpty(e)){let i=se(e,!0);return void(i&&this.show(i,t))}this.setText(e);const i=this.box.getBoundingClientRect(),n=e.calculative.worldRect;let r=e.calculative.canvas.store.data.x+t.x-i.width/2,o=e.calculative.canvas.store.data.y+t.y-i.height;e.type||(r=e.calculative.canvas.store.data.x+n.x-(i.width-n.width)/2,o=e.calculative.canvas.store.data.y+n.ey-i.height-n.height),o>0?(this.arrowUp.style.borderBottomColor="transparent",this.arrowDown.style.borderTopColor="#777777"):(o+=i.height+n.height+5,this.arrowUp.style.borderBottomColor="#777777",this.arrowDown.style.borderTopColor="transparent"),this.x=r,this.y=o,this.box.style.left=this.x+"px",this.box.style.top=this.y+"px"}hide(){this.currentPen=null,this.x=-9999,this.box.style.left="-9999px"}translate(e,t){this.x<-1e3||(this.x+=e,this.y+=t,this.box.style.left=this.x+"px",this.box.style.top=this.y+"px")}destroy(){this.box.onmouseleave=null}}class dn{constructor(e){let t;this.parent=e,this.onMouseDownH=e=>{e.preventDefault(),e.stopPropagation(),this.isDownH=e.x,this.x=this.parent.store.data.x||0,this.lastScrollX=this.scrollX},this.onMouseDownV=e=>{e.preventDefault(),e.stopPropagation(),this.isDownV=e.y,this.y=this.parent.store.data.y||0,this.lastScrollY=this.scrollY},this.onMouseMove=e=>{if(this.isDownH){const t=e.x-this.isDownH;this.scrollX=this.lastScrollX+t,this.h.style.left=`${this.scrollX}px`,this.parent.store.data.x=this.x-t*this.rect.width/this.parent.parentElement.clientWidth}if(this.isDownV){const t=e.y-this.isDownV;if(this.pageMode&&this.canMouseMove(t))return;this.scrollY=this.lastScrollY+t,this.v.style.top=`${this.scrollY}px`,this.parent.store.data.y=this.y-t*this.rect.height/this.parent.parentElement.clientHeight}(this.isDownH||this.isDownV)&&(this.parent.onMovePens(),this.parent.canvasImage.init(),this.parent.canvasImageBottom.init(),this.parent.render())},this.onMouseUp=e=>{(this.isDownH||this.isDownV)&&(this.isDownH=void 0,this.isDownV=void 0,this.scrollX<20?(this.scrollX=20,this.h.style.left=`${this.scrollX}px`):this.scrollX>this.parent.parentElement.clientWidth-this.hSize-20&&(this.scrollX=this.parent.parentElement.clientWidth-this.hSize-20,this.h.style.left=`${this.scrollX}px`),this.scrollY<20?(this.scrollY=20,this.v.style.top=`${this.scrollY}px`):this.scrollY>this.parent.parentElement.clientHeight-this.vSize-20&&(this.scrollY=this.parent.parentElement.clientHeight-this.vSize-20,this.v.style.top=`${this.scrollY}px`),this.resize())},this.h=document.createElement("div"),this.v=document.createElement("div"),this.parent.externalElements.appendChild(this.h),this.parent.externalElements.appendChild(this.v),this.h.className="meta2d-scroll h",this.h.onmousedown=this.onMouseDownH,this.v.className="meta2d-scroll v",this.v.onmousedown=this.onMouseDownV,document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp);for(let e=0;e<document.styleSheets.length;e++)"le5le/scroll"===document.styleSheets[e].title&&(t=document.styleSheets[e]);if(!t){let e=document.createElement("style");e.type="text/css",e.title="le5le.com/scroll",document.head.appendChild(e),e=document.createElement("style"),e.type="text/css",document.head.appendChild(e),t=e.sheet,t.insertRule(".meta2d-scroll{position:absolute;width:8px;height:200px;background:#dddddd;border-radius:10px;z-index:20;cursor:default;}"),t.insertRule(".meta2d-scroll:hover{background:#cccccc;cursor:pointer}"),t.insertRule(".meta2d-scroll.v{right:0;top:calc(50% - 100px);}"),t.insertRule(".meta2d-scroll.h{bottom:2px;left:calc(50% - 100px);width:200px;height:8px;}")}this.init()}init(){this.isShow=!0,this.resize(),this.initPos()}canMouseMove(e){const t=this.parent.parent.getRect();return e<0&&t.y+this.parent.store.data.y>=0||e>0&&t.ey-this.parent.height+this.parent.store.data.y<=0}changeMode(){this.pageMode=!0,this.h.style.display="none",this.parent.parent.getRect().height<this.parent.height&&(this.v.style.display="none")}initPos(){this.scrollX=(this.parent.parentElement.clientWidth-this.hSize)/2,this.scrollY=(this.parent.parentElement.clientHeight-this.vSize)/2,this.h.style.left=`${this.scrollX}px`,this.v.style.top=`${this.scrollY}px`}resize(){this.rect=St(this.parent.store.data.pens),this.rect.width<1400&&(this.rect.width=1400),this.rect.height<900&&(this.rect.height=900),this.parent.store.data.x>0?this.rect.width+=this.parent.store.data.x+(this.rect.x>0?0:this.rect.x):this.rect.width-=this.parent.store.data.x+(this.rect.x>0?0:this.rect.x),this.parent.store.data.y>0?this.rect.height+=this.parent.store.data.y+(this.rect.y>0?0:this.rect.y):this.rect.height-=this.parent.store.data.y+(this.rect.y>0?0:this.rect.y),this.rect.width<1400&&(this.rect.width=1400),this.rect.height<900&&(this.rect.height=900),this.hSize=1e3*this.parent.parentElement.clientWidth/this.rect.width/3,this.vSize=1e3*this.parent.parentElement.clientHeight/this.rect.height/3,this.h.style.width=this.hSize+"px",this.v.style.height=this.vSize+"px"}show(){this.isShow=!0,this.h.style.display="block",this.v.style.display="block",document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp)}hide(){this.isShow=!1,this.h.style.display="none",this.v.style.display="none",this.destroy()}translate(e,t){e&&(this.scrollX-=e*this.parent.parentElement.clientWidth/this.rect.width,this.h.style.left=`${this.scrollX}px`),t&&(this.scrollY-=t*this.parent.parentElement.clientHeight/this.rect.height,this.v.style.top=`${this.scrollY}px`)}wheel(e){let t=10;e&&(t=-10),this.pageMode&&this.canMouseMove(t)||(this.scrollY+=t,this.v.style.top=`${this.scrollY}px`,this.parent.store.data.y-=t*this.rect.height/this.parent.parentElement.clientHeight,this.parent.onMovePens(),this.parent.canvasImage.init(),this.parent.canvasImageBottom.init(),this.parent.render())}destroy(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp)}}class un{constructor(e,t,i){this.parentElement=e,this.store=t,this.isBottom=i,this.canvas=document.createElement("canvas"),this.otherOffsreen=ln(),this.offscreen=ln(),this.animateOffsScreen=ln(),e.appendChild(this.canvas),this.canvas.style.backgroundRepeat="no-repeat",this.canvas.style.backgroundSize="100% 100%",this.canvas.style.position="absolute",this.canvas.style.top="0",this.canvas.style.left="0"}resize(e,t){this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",e=e*this.store.dpiRatio|0,t=t*this.store.dpiRatio|0,this.canvas.width=e,this.canvas.height=t,this.otherOffsreen.width=e,this.otherOffsreen.height=t,this.offscreen.width=e,this.offscreen.height=t,this.animateOffsScreen.width=e,this.animateOffsScreen.height=t,this.otherOffsreen.getContext("2d").scale(this.store.dpiRatio,this.store.dpiRatio),this.otherOffsreen.getContext("2d").textBaseline="middle",this.offscreen.getContext("2d").scale(this.store.dpiRatio,this.store.dpiRatio),this.offscreen.getContext("2d").textBaseline="middle",this.animateOffsScreen.getContext("2d").scale(this.store.dpiRatio,this.store.dpiRatio),this.animateOffsScreen.getContext("2d").textBaseline="middle",this.init()}init(){this.offscreen.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height),this.animateOffsScreen.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height);for(const e of this.store.data.pens)this.hasImage(e)&&(e.calculative.imageDrawed=!1);this.store.patchFlagsBackground=!0,this.store.patchFlagsTop=!0}clear(){this.otherOffsreen.getContext("2d").clearRect(0,0,this.otherOffsreen.width,this.otherOffsreen.height),this.offscreen.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height),this.animateOffsScreen.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height),this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height)}hasImage(e){return e.calculative.hasImage=e.calculative&&e.calculative.inView&&!e.isBottom==!this.isBottom&&e.image&&e.calculative.img&&"gif"!==e.name,e.calculative.hasImage}render(){let e=!1,t=!1;for(const i of this.store.data.pens)this.hasImage(i)&&(this.store.animates.has(i)?t=!0:i.calculative.imageDrawed||(e=!0),i.parentId&&this.store.animates.has(se(i,!0))&&(t=!0));const i=this.store.patchFlagsBackground;if(i&&this.isBottom){const e=this.otherOffsreen.getContext("2d");e.clearRect(0,0,this.canvas.width,this.canvas.height);const t=this.store.data.width||this.store.options.width,i=this.store.data.height||this.store.options.height;t&&i&&this.store.bkImg&&(e.save(),e.drawImage(this.store.bkImg,this.store.data.origin.x+this.store.data.x,this.store.data.origin.y+this.store.data.y,this.store.data.width*this.store.data.scale,this.store.data.height*this.store.data.scale),e.restore());const n=this.store.data.background||this.store.options.background;if(n){e.save(),e.fillStyle=n;const t=this.store.data.width||this.store.options.width,i=this.store.data.height||this.store.options.height;if(t&&i){const n=this.store.data.x||this.store.options.x,r=this.store.data.y||this.store.options.y;e.fillRect(this.store.data.origin.x+n,this.store.data.origin.y+r,t*this.store.data.scale,i*this.store.data.scale)}else e.fillRect(0,0,this.canvas.width,this.canvas.height);e.restore()}this.renderGrid(e)}const n=this.store.patchFlagsTop;if(n&&!this.isBottom){const e=this.otherOffsreen.getContext("2d");e.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderRule(e)}if(this.store.patchFlagsLast&&this.offscreen.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height),e){const e=this.offscreen.getContext("2d");e.save(),e.clearRect(0,0,this.canvas.width,this.canvas.height),e.translate(this.store.data.x,this.store.data.y);for(const t of this.store.data.pens)!t.calculative.hasImage||this.store.animates.has(t)||this.store.animates.has(se(t,!0))||(t.calculative.imageDrawed=!0,e.save(),Se(e,t),t.calculative.rotate&&Pe(e,t),dt(e,t),be(e,t),e.restore());e.restore()}if(t){const e=this.animateOffsScreen.getContext("2d");e.save(),e.clearRect(0,0,this.canvas.width,this.canvas.height),e.translate(this.store.data.x,this.store.data.y);for(const t of this.store.animates)t.calculative.hasImage&&(t.calculative.imageDrawed=!0,e.save(),Se(e,t),t.calculative.rotate&&Pe(e,t),dt(e,t),be(e,t),e.restore());for(const t of this.store.data.pens)t.calculative.hasImage&&t.parentId&&this.store.animates.has(se(t,!0))&&(t.calculative.imageDrawed=!0,e.save(),Se(e,t),t.calculative.rotate&&Pe(e,t),dt(e,t),be(e,t),e.restore());e.restore()}if(e||t||i&&this.isBottom||n&&!this.isBottom){const e=this.canvas.getContext("2d");e.clearRect(0,0,this.canvas.width,this.canvas.height),this.isBottom&&(e.drawImage(this.otherOffsreen,0,0,this.canvas.width,this.canvas.height),this.store.patchFlagsBackground=!1),e.drawImage(this.offscreen,0,0,this.canvas.width,this.canvas.height),e.drawImage(this.animateOffsScreen,0,0,this.canvas.width,this.canvas.height),this.isBottom||(e.drawImage(this.otherOffsreen,0,0,this.canvas.width,this.canvas.height),this.store.patchFlagsTop=!1)}}renderGrid(e){const{data:t,options:i}=this.store,{grid:n,gridRotate:r,gridColor:o,gridSize:s,scale:a}=t;if(!(n??i.grid))return;e.save();const{width:c,height:l}=this.canvas;r&&(e.translate(c/2,l/2),e.rotate(r*Math.PI/180),e.translate(-c/2,-l/2)),e.lineWidth=1,e.strokeStyle=o||i.gridColor,e.beginPath();const h=(s||i.gridSize)*a,d=Math.max(c,l),u=Math.ceil(d/h);for(let t=-h*u;t<2*d;t+=h)e.moveTo(t,-d),e.lineTo(t,2*d);for(let t=-h*u;t<2*d;t+=h)e.moveTo(-d,t),e.lineTo(2*d,t);e.stroke(),e.restore()}renderRule(e){const{data:t,options:i}=this.store,{rule:n,ruleColor:r,scale:o,origin:s}=t;if(!(n??i.rule))return;const a=10*o;e.save();const c=r||i.ruleColor;e.strokeStyle=ee(c,.7);const l=s.x+t.x,h=s.y+t.y,{width:d,height:u}=this.canvas;e.beginPath(),e.lineWidth=12,e.lineDashOffset=-l%a,e.setLineDash([1,a-1]),e.moveTo(0,0),e.lineTo(d,0),e.stroke(),e.beginPath(),e.lineDashOffset=-h%a,e.moveTo(0,0),e.lineTo(0,u),e.stroke(),e.strokeStyle=c,e.beginPath(),e.lineWidth=24,e.lineDashOffset=-l%(10*a),e.setLineDash([1,10*a-1]),e.moveTo(0,0),e.lineTo(d,0),e.stroke(),e.beginPath(),e.lineDashOffset=-h%(10*a),e.moveTo(0,0),e.lineTo(0,u),e.stroke(),e.beginPath(),e.fillStyle=e.strokeStyle;let f=0-100*Math.floor(l/a/10);l<0&&(f-=100);for(let t=l%(10*a);t<d;t+=10*a,f+=100)a<3&&f%500||e.fillText(f.toString(),t+4,16);f=0-100*Math.floor(h/a/10),h<0&&(f-=100);for(let t=h%(10*a);t<u;t+=10*a,f+=100)a<3&&f%500||(e.save(),e.beginPath(),e.translate(16,t-4),e.rotate(270*Math.PI/180),e.fillText(f.toString(),0,0),e.restore());e.restore()}}class fn{constructor(e,t,i){this.parentCanvas=e,this.parentElement=t,this.store=i,this.canvas=document.createElement("canvas"),this.magnifierScreen=ln(),this.offscreen=ln(),this.magnifierSize=300,t.appendChild(this.canvas),this.canvas.style.backgroundRepeat="no-repeat",this.canvas.style.backgroundSize="100% 100%",this.canvas.style.position="absolute",this.canvas.style.top="0",this.canvas.style.left="0"}resize(e,t){this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",e=e*this.store.dpiRatio|0,t=t*this.store.dpiRatio|0,this.canvas.width=e,this.canvas.height=t,this.offscreen.width=e,this.offscreen.height=t,this.offscreen.getContext("2d").scale(this.store.dpiRatio,this.store.dpiRatio),this.offscreen.getContext("2d").textBaseline="middle",this.magnifierScreen.width=this.magnifierSize+5,this.magnifierScreen.height=this.magnifierSize+5}renderMagnifier(){if(!this.magnifier)return;const e=this.magnifierSize/2,t=this.magnifierSize+5,i=this.magnifierScreen.getContext("2d");i.clearRect(0,0,t,t),i.lineWidth=5,i.save(),i.translate(2.5,2.5),i.save(),i.arc(e,e,e,0,2*Math.PI,!1),i.clip(),i.fillStyle=this.store.data.background||this.store.options.background||"#f4f4f4",i.fillRect(0,0,t,t),i.translate(-e,-e),i.scale(2,2);const n=(this.parentCanvas.mousePos.x+this.store.data.x)*this.store.dpiRatio,r=(this.parentCanvas.mousePos.y+this.store.data.y)*this.store.dpiRatio;[this.parentCanvas.canvasImageBottom.offscreen,this.parentCanvas.canvasImageBottom.animateOffsScreen,this.parentCanvas.offscreen,this.parentCanvas.canvasImage.offscreen,this.parentCanvas.canvasImage.animateOffsScreen].forEach((t=>{i.drawImage(t,n-e,r-e,this.magnifierSize,this.magnifierSize,0,0,this.magnifierSize,this.magnifierSize)})),i.restore(),i.beginPath();const o=i.createRadialGradient(e,e,e-5,e,e,e);o.addColorStop(0,"rgba(0,0,0,0.2)"),o.addColorStop(.8,"rgb(200,200,200)"),o.addColorStop(.9,"rgb(200,200,200)"),o.addColorStop(1,"rgba(200,200,200,0.9)"),i.strokeStyle=o,i.arc(e,e,e,0,2*Math.PI,!1),i.stroke(),i.restore(),this.offscreen.getContext("2d").drawImage(this.magnifierScreen,0,0,this.magnifierSize+5,this.magnifierSize+5,(n-e-2.5)/this.store.dpiRatio,(r-e-2.5)/this.store.dpiRatio,(this.magnifierSize+5)/this.store.dpiRatio,(this.magnifierSize+5)/this.store.dpiRatio)}render(){this.offscreen.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height),this.renderMagnifier();const e=this.canvas.getContext("2d");e.clearRect(0,0,this.canvas.width,this.canvas.height),e.drawImage(this.offscreen,0,0,this.canvas.width,this.canvas.height)}}function pn(e){if(e.data.locked)throw new Error("canvas is locked")}class vn{constructor(e){this.parentElement=e,this.box=document.createElement("div"),this.dialog=document.createElement("div");let t=document.createElement("div");this.title=document.createElement("div"),this.close=document.createElement("span"),this.close.innerHTML='\n      <svg fill="none" viewBox="0 0 16 16" width="1em" height="1em">\n      <path\n        fill="currentColor"\n        d="M8 8.92L11.08 12l.92-.92L8.92 8 12 4.92 11.08 4 8 7.08 4.92 4 4 4.92 7.08 8 4 11.08l.92.92L8 8.92z"\n        fill-opacity="0.9"\n      ></path>\n    </svg>';let i,n=document.createElement("div");this.iframe=document.createElement("iframe"),this.iframe.setAttribute("frameborder","0"),this.box.className="meta2d-dialog_mask",this.dialog.className="meta2d-dialog",n.className="meta2d-dialog_body",t.className="meta2d-dialog_header",this.title.className="meta2d-dialog-content",this.close.className="meta2d-dialog-close",t.appendChild(this.title),t.appendChild(this.close),n.appendChild(this.iframe),this.dialog.appendChild(t),this.dialog.appendChild(n),this.box.appendChild(this.dialog),e.appendChild(this.box),this.dialog.onclick=e=>{e.stopPropagation()},this.box.onclick=()=>{this.hide()},this.close.onclick=()=>{this.hide()};for(let e=0;e<document.styleSheets.length;e++)"le5le.com/dialog"===document.styleSheets[e].title&&(i=document.styleSheets[e]);if(!i){let e=document.createElement("style");e.type="text/css",e.title="le5le.com/dialog",document.head.appendChild(e),e=document.createElement("style"),e.type="text/css",document.head.appendChild(e),i=e.sheet,i.insertRule(".meta2d-dialog_mask {\n        display: none;\n        position: absolute;\n        top: 0%;\n        left: 0%;\n        width: 100%;\n        height: 100%;\n        background-color: #0000006f;\n        z-index: 9999;"),i.insertRule(".meta2d-dialog_mask .meta2d-dialog {\n            position: absolute;\n            top: 15vh;\n            left: 10%;\n            width: 80%;\n            padding: 16px 20px;\n            border-radius: 9px;\n            background-color: #1e2430;\n            z-index: 19999;\n            overflow: auto;\n        }"),i.insertRule(".meta2d-dialog_header {\n            display: flex;\n        }"),i.insertRule(".meta2d-dialog-content {\n            width: calc(100% - 20px);\n            font-weight: 600;\n            font-size: 14px;\n            color: #bdc7db;\n        }"),i.insertRule(".meta2d-dialog-close {\n            width: 20px;\n            height: 20px;\n            line-height: 20px;\n            text-align: center;\n            color: #617b91;\n        }"),i.insertRule(".meta2d-dialog-close :hover{\n            cursor: pointer;\n        }"),i.insertRule(".meta2d-dialog_body{\n            margin-top: 4px;\n        } "),i.insertRule(".meta2d-dialog_body iframe{\n            width: 100%;\n            height: 400px;\n        }")}}show(e,t){this.box.style.display="block",t&&this.iframe.setAttribute("src",t),e&&(this.title.innerText=e)}hide(){this.box.style.display="none"}destroy(){this.dialog.onclick=void 0,this.box.onclick=void 0,this.close.onclick=void 0}}function xn(e,t){if(null==t)return e;const i=t.split(".");for(;i.length&&(e=e[i.shift()]););return e}function gn(e,t,i){null!=t&&t.split(".").reduce(((e,n,r)=>e[n]=t.split(".").length===++r?i:e[n]||{}),e)}class yn{constructor(e){let t;this.parentElement=e,this.box=document.createElement("div"),this.box.className="meta2d-title",e.appendChild(this.box),this.box.onmouseleave=()=>{this.hide()};for(let e=0;e<document.styleSheets.length;e++)"le5le.com/title"===document.styleSheets[e].title&&(t=document.styleSheets[e]);if(!t){let e=document.createElement("style");e.type="text/css",e.title="le5le.com/title",document.head.appendChild(e),e=document.createElement("style"),e.type="text/css",document.head.appendChild(e),t=e.sheet,t.insertRule(".meta2d-title{position:absolute;padding:0;z-index:10;left: -9999px;top: -9999px;width:8px;height:8px;cursor: crosshair;}")}}static getTitle(e){}setText(e){this.box.title=e.title}updateText(e){this.currentAnchor?.id===e.id&&(yn.titleEmpty(e)||(this.setText(e),this.changePositionByAnchor(e)))}changePositionByAnchor(e){this.box.style.left=e.x-4+"px",this.box.style.top=e.y-4+"px"}static titleEmpty(e){return!e.title}show(e){yn.titleEmpty(e)||(this.currentAnchor=e,this.setText(e),this.changePositionByAnchor(e))}hide(){this.box.style.left="-9999px",this.box.title="",this.currentAnchor=null}destroy(){this.box.onmouseleave=null}}const mn="-moving";class bn{constructor(e,t,i){this.parent=e,this.parentElement=t,this.store=i,this.canvas=document.createElement("canvas"),this.offscreen=ln(),this.externalElements=document.createElement("div"),this.lastRotate=0,this.hoverType=v.None,this.resizeIndex=0,this.lastOffsetX=0,this.lastOffsetY=0,this.drawLineFns=[...w],this.patchFlagsLines=new Set,this.lastMouseTime=0,this.hoverTimer=0,this.patchFlags=!1,this.lastRender=0,this.touchStart=0,this.lastAnimateRender=0,this.animateRendering=!1,this.pointSize=8,this.pasteOffset=!0,this.opening=!1,this.maxZindex=4,this.canMoveLine=!1,this.inputParent=document.createElement("div"),this.inputDiv=document.createElement("div"),this.inputRight=document.createElement("div"),this.dropdown=document.createElement("ul"),this.mousePos={x:0,y:0},this.autoPolylineFlag=!1,this.stopPropagation=e=>{e.stopPropagation()},this.curve=Kt,this.polyline=di,this.mind=Qt,this.line=Zt,this.onCopy=e=>{this.store.options.disableClipboard||e.target!==this.externalElements&&e.target!==document.body&&e.target.offsetParent!==this.externalElements||this.copy()},this.onCut=e=>{this.store.options.disableClipboard||e.target!==this.externalElements&&e.target!==document.body&&e.target.offsetParent!==this.externalElements||this.cut()},this.onPaste=e=>{if(this.store.options.disableClipboard)return;if(e.target!==this.externalElements&&e.target!==document.body&&e.target.offsetParent!==this.externalElements)return;let t;if(navigator.clipboard&&e.clipboardData){const i=e.clipboardData.items;if(i)for(let e=0;e<i.length;e++)if(-1!==i[e].type.indexOf("image")&&i[e].getAsFile()){t=!0;break}}if(t){const t=e.clipboardData.items;if(t)for(let e=0;e<t.length;e++)if(-1!==t[e].type.indexOf("image")&&t[e].getAsFile()){const{x:i,y:n}=this.mousePos,r=t[e].getAsFile();let o="gif"===t[e].type.slice(6)?"gif":"image";if(null!==r){let e;const t=new FileReader;t.onload=t=>{e=t.target.result;const r=new Image;r.src=e,r.onload=()=>{const{width:t,height:s}=r,a={name:o,x:i-25,y:n-s/t*50,externElement:"gif"===o,width:100,height:s/t*100,image:e};this.addPens([a]),this.active([a]),this.copy([a])}},t.readAsDataURL(r)}}}else this.paste()},this.onwheel=e=>{if("true"===this.inputDiv.contentEditable)return;if(this.drawingLine)return;if(this.pencil)return;if(this.store.options.disableScale)return;if(e.preventDefault(),e.stopPropagation(),this.mouseDown&&(this.hoverType===v.Node||this.hoverType===v.Line))return;if(this.store.data.locked===o.Disable)return;if(this.store.data.locked===o.DisableScale)return;if(this.store.data.locked===o.DisableMoveScale)return;if(!e.ctrlKey&&Math.abs(e.wheelDelta)<100)return this.store.options.scroll&&!e.metaKey&&this.scroll?void this.scroll.wheel(e.deltaY<0):void this.translate(-e.deltaX,-e.deltaY);if(this.store.options.disableTouchPadScale)return;let t=.015;/mac os /i.test(navigator.userAgent)?e.ctrlKey?e.deltaY>0&&(t*=-1):t*=e.wheelDeltaY/240:t=e.deltaY>0?-.2:.2;const{offsetX:i,offsetY:n}=e;this.scale(this.store.data.scale+t,{x:i,y:n}),this.externalElements.focus()},this.onkeydown=e=>{if(this.store.data.locked>=o.DisableEdit&&"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&this.store.active.forEach((t=>{t.onKeyDown?.(t,e.key)})),this.store.data.locked>=o.DisableEdit||"INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName)return;let t=10,i=10;switch(e.key){case" ":this.hotkeyType=x.Translate;break;case"Control":this.drawingLine?this.drawingLine.calculative.drawlineH=!this.drawingLine.calculative.drawlineH:this.hotkeyType||(this.patchFlags=!0,this.hotkeyType=x.Select);break;case"Meta":break;case"Shift":1===this.store.active.length&&this.store.active[0].type&&this.store.activeAnchor?this.toggleAnchorHand():this.hotkeyType||(this.patchFlags=!0,this.hotkeyType=x.Resize);break;case"Alt":if(!e.ctrlKey&&!e.shiftKey&&this.drawingLine){const e=Xe(this.drawingLine);e!==this.drawingLine.calculative.activeAnchor?(Ve(this.drawingLine),this.drawingLine.calculative.worldAnchors.push(e)):this.drawingLine.calculative.worldAnchors.push({x:e.x,y:e.y});const t=this.drawLineFns.indexOf(this.drawingLineName);this.drawingLineName=this.drawLineFns[(t+1)%this.drawLineFns.length],this.drawingLine.lineName=this.drawingLineName,this.drawline(),this.patchFlags=!0}e.preventDefault();break;case"a":case"A":e.ctrlKey||e.metaKey?(this.active(this.store.data.pens.filter((e=>!e.parentId&&e.locked!==o.Disable))),e.preventDefault()):this.toggleAnchorMode();break;case"Delete":case"Backspace":!this.store.data.locked&&this.delete();break;case"ArrowLeft":if(this.movingAnchor){this.translateAnchor(-1,0);break}t=-10,e.shiftKey&&(t=-5),(e.ctrlKey||e.metaKey)&&(t=-1),this.translatePens(this.store.active,t,0);break;case"ArrowUp":if(this.movingAnchor){this.translateAnchor(0,-1);break}i=-10,e.shiftKey&&(i=-5),(e.ctrlKey||e.metaKey)&&(i=-1),this.translatePens(this.store.active,0,i);break;case"ArrowRight":if(this.movingAnchor){this.translateAnchor(1,0);break}e.shiftKey&&(t=5),(e.ctrlKey||e.metaKey)&&(t=1),this.translatePens(this.store.active,t,0);break;case"ArrowDown":if(this.movingAnchor){this.translateAnchor(0,1);break}e.shiftKey&&(i=5),(e.ctrlKey||e.metaKey)&&(i=1),this.translatePens(this.store.active,0,i);break;case"d":case"D":this.store.active[0]?.locked||this.removeAnchorHand();break;case"h":case"H":this.store.active[0]?.locked||this.addAnchorHand();break;case"m":case"M":this.toggleMagnifier();break;case"g":case"G":this.hoverType===v.NodeAnchor&&(this.movingAnchor=this.store.hoverAnchor,this.externalElements.style.cursor="move");break;case"s":case"S":this.store.data.locked||this.hoverType!==v.LineAnchor||this.store.hover!==this.store.active[0]||this.splitLine(this.store.active[0],this.store.hoverAnchor),(e.ctrlKey||e.metaKey)&&this.store.emitter.emit("save",{event:e});break;case"c":case"C":(e.ctrlKey||e.metaKey)&&this.store.options.disableClipboard&&this.copy();break;case"x":case"X":(e.ctrlKey||e.metaKey)&&this.store.options.disableClipboard&&this.cut();break;case"v":case"V":e.ctrlKey||e.metaKey||(this.drawingLineName?(this.finishDrawline(),this.drawingLineName=""):this.drawingLineName=this.store.options.drawingLineName),(e.ctrlKey||e.metaKey)&&this.store.options.disableClipboard&&this.paste();break;case"b":case"B":this.drawingPencil();break;case"y":case"Y":(e.ctrlKey||e.metaKey)&&this.redo();break;case"z":case"Z":e.ctrlKey||e.metaKey?this.undo():e.shiftKey&&this.redo();break;case"Enter":this.drawingLineName&&(this.finishDrawline(!0),this.store.active[0].anchors[0].connectTo?this.drawingLineName="":this.drawingLineName=this.store.options.drawingLineName),this.store.active&&(this.store.active.forEach((e=>{e.type&&(e.close=!e.close,this.store.path2dMap.set(e,N.path2dDraws.line(e)),ai(e))})),this.render());break;case"Escape":this.drawingLineName&&this.finishDrawline(),this.drawingLineName=void 0,this.stopPencil(),this.movingPens&&(this.getAllByPens(this.movingPens).forEach((e=>{this.store.pens[e.id]=void 0})),this.movingPens=void 0,this.mouseDown=void 0,this.clearDock(),this.store.active?.forEach((e=>{this.updateLines(e)})),this.calcActiveRect(),this.patchFlags=!0),this.hotkeyType=x.None,this.movingAnchor=void 0,this.magnifierCanvas.magnifier&&(this.magnifierCanvas.magnifier=!1,this.patchFlags=!0);break;case"E":case"e":this.store.options.disableAnchor=!this.store.options.disableAnchor,this.store.emitter.emit("disableAnchor",this.store.options.disableAnchor);break;case"=":(e.ctrlKey||e.metaKey)&&(this.scale(this.store.data.scale+.1),e.preventDefault(),e.stopPropagation());break;case"-":(e.ctrlKey||e.metaKey)&&(this.scale(this.store.data.scale-.1),e.preventDefault(),e.stopPropagation());break;case"l":case"L":this.canMoveLine=!0}this.render(!1)},this.onkeyup=e=>{switch(e.key){case"l":case"L":this.canMoveLine=!1}this.hotkeyType&&this.render(),this.hotkeyType<x.AddAnchor&&(this.hotkeyType=x.None)},this.ondrop=async e=>{if(this.store.data.locked)return void console.warn("canvas is locked, can not drop");e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.getData("Meta2d")||e.dataTransfer.getData("Text");let i=null;try{t&&(i=JSON.parse(t))}catch(e){}if(!i){const{files:t}=e.dataTransfer;if(t.length&&t[0].type.match("image.*")){const e="image/gif"===t[0].type;i=await this.fileToPen(t[0],e)}else{if(!this.addCaches||!this.addCaches.length)return void this.store.emitter.emit("drop",void 0);i=this.addCaches,this.addCaches=[]}}if(i&&!1!==i.draggable){i=Array.isArray(i)?i:[i];const t={x:e.offsetX,y:e.offsetY};this.calibrateMouse(t),this.dropPens(i,t),this.addCaches=[]}this.store.emitter.emit("drop",i||t)},this.ontouchstart=e=>{this.store.data.locked!==o.Disable&&(this.touchStartTimer&&clearTimeout(this.touchStartTimer),this.touchStartTimer=setTimeout((()=>{this.touchStart=performance.now();const t=e.touches[0].pageX-this.clientRect.x,i=e.touches[0].pageY-this.clientRect.y,n={x:t,y:i};if(this.calibrateMouse(n),this.getHover(n),this.onMouseDown({x:t,y:i,clientX:e.touches[0].clientX,clientY:e.touches[0].clientY,pageX:e.touches[0].pageX,pageY:e.touches[0].pageY,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,buttons:1}),2===e.touches.length)return this.initTouchDis=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY),this.initScale=this.store.data.scale,this.startTouches=e.touches,void(this.touchCenter={x:e.touches[0].pageX+(e.touches[1].pageX-e.touches[0].pageX)/2-this.clientRect.x,y:e.touches[0].pageY+(e.touches[1].pageY-e.touches[0].pageY)/2-this.clientRect.y});3===e.touches.length&&(this.store.emitter.emit("contextmenu",{e:{x:t,y:i,clientX:e.touches[0].clientX,clientY:e.touches[0].clientY,pageX:e.touches[0].pageX,pageY:e.touches[0].pageY},clientRect:this.clientRect}),e.preventDefault(),e.stopPropagation()),this.touchStartTimer=void 0}),50))},this.ontouchmove=e=>{if(this.store.data.locked===o.Disable)return;e.stopPropagation(),e.preventDefault();const t=performance.now();if(t-this.touchStart<50)return;this.touchStart=t;const i=e.touches,n=i.length,r=e.touches[0].pageX-this.clientRect.x,s=e.touches[0].pageY-this.clientRect.y;if(1===n)this.onMouseMove({x:r,y:s,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,buttons:1});else if(2===n&&2===this.startTouches?.length){if(!this.touchMoving&&!this.touchScaling){const e=this.startTouches[0].pageX-i[0].pageX,t=this.startTouches[1].pageX-i[1].pageX,n=this.startTouches[0].pageY-i[0].pageY,r=this.startTouches[1].pageY-i[1].pageY;(e>=0&&t<0||e<=0&&t>0)&&(n>=0&&r<0||n<=0&&r>0)?this.touchScaling=!0:this.touchMoving=!0}if(this.touchScaling){if(this.store.options.disableScale)return;const e=Math.hypot(i[0].pageX-i[1].pageX,i[0].pageY-i[1].pageY)/this.initTouchDis;this.scale(this.initScale*e,$(this.touchCenter))}if(this.touchMoving){if(this.store.data.locked>=o.DisableMove&&this.store.data.locked!==o.DisableScale||this.store.options.disableScale)return;if(this.lastOffsetX){const{scale:e}=this.store.data;this.translate((r-this.lastOffsetX)/e,(s-this.lastOffsetY)/e)}this.lastOffsetX=r,this.lastOffsetY=s}}},this.ontouchend=e=>{if(this.store.data.locked===o.Disable)return;this.touchCenter=void 0,this.touchScaling=void 0,this.touchMoving=void 0,this.startTouches=void 0,this.lastOffsetX=0,this.lastOffsetY=0;const t=e.changedTouches[0].pageX-this.clientRect.x,i=e.changedTouches[0].pageY-this.clientRect.y;this.onMouseUp({x:t,y:i,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,buttons:1}),setTimeout((()=>{this.render()}),20)},this.onGesturestart=e=>{e.preventDefault()},this.onMouseDown=e=>{if(2!==e.buttons||this.drawingLine||(this.mouseRight=g.Down),this.hideInput(),this.store.data.locked===o.Disable||1!==e.buttons&&2!==e.buttons)this.hoverType=v.None;else if(!this.magnifierCanvas.magnifier)if(this.calibrateMouse(e),this.mousePos.x=e.x,this.mousePos.y=e.y,this.mouseDown=e,this.lastMouseTime=performance.now(),this.hotkeyType!==x.AddAnchor){if(!this.store.options.autoAnchor&&!this.drawingLine&&e.shiftKey&&e.ctrlKey&&e.altKey){this.setAnchor(this.store.pointAt),this.drawingLineName=this.store.options.drawingLineName;const e=this.store.activeAnchor;if(!e)return;const t={id:ne(),x:e.x,y:e.y};this.drawingLine=this.createDrawingLine(t);let i=$e(this.drawingLine);return this.drawingLine.calculative.activeAnchor=i,qe(this.store.hover,e,this.drawingLine,t),void this.drawline()}if(this.hotkeyType!==x.Translate&&(this.mouseRight!==g.Down||this.store.options.mouseRightActive)){if(this.drawingLine){if(this.store.hoverAnchor){const e=Xe(this.drawingLine);return this.store.hoverAnchor.type===A.Line?M(e,this.store.hoverAnchor,this.store):(e.x=this.store.hoverAnchor.x,e.y=this.store.hoverAnchor.y),qe(this.store.hover,this.store.hoverAnchor,this.drawingLine,e),this.drawline(),void this.finishDrawline(!0)}if(!this.store.options.autoAnchor&&e.shiftKey&&e.altKey&&e.ctrlKey){this.setAnchor(this.store.pointAt);const e=Xe(this.drawingLine),t=this.store.activeAnchor;if(!t)return;return e.x=t.x,e.y=t.y,qe(this.store.hover,t,this.drawingLine,e),this.drawline(),void this.finishDrawline(!0)}if(2===e.buttons||"mind"===this.drawingLineName&&this.drawingLine?.calculative.worldAnchors.length>1||this.store.options.drawingLineLength&&this.drawingLine?.calculative.worldAnchors.length>this.store.options.drawingLineLength)return this.finishDrawline(!0),void(this.store.active[0]?.anchors[0].connectTo?this.drawingLineName="":this.drawingLineName=this.store.options.drawingLineName);if(this.store.options.autoAnchor&&this.hoverType===v.Node){const t=Xe(this.drawingLine),i=We(this.store.hover,e);return t.x=i.x,t.y=i.y,this.drawingLine.autoTo=!0,qe(this.store.hover,i,this.drawingLine,t),this.drawline(),void this.finishDrawline(!0)}const t=Xe(this.drawingLine);t.isTemp?(this.drawingLine.calculative.activeAnchor=this.drawingLine.calculative.worldAnchors[this.drawingLine.calculative.worldAnchors.length-2],t.isTemp=void 0):(this.drawingLine.calculative.activeAnchor=t,this.drawingLine.calculative.worldAnchors.push({x:t.x,y:t.y,penId:t.penId})),this.drawingLine.calculative.drawlineH=void 0,"polyline"!==this.drawingLineName&&this.drawline()}if(this.drawingLineName){if(this.hoverType===v.Node)if(this.store.options.autoAnchor){this.inactive(!0);const t=We(this.store.hover,e);this.store.hoverAnchor=t;const i={id:ne(),x:t.x,y:t.y};this.drawingLine=this.createDrawingLine(i),this.drawingLine.autoFrom=!0,qe(this.store.hover,t,this.drawingLine,i)}else this.inactive(),this.hoverType=v.None;else if(this.hoverType===v.NodeAnchor){this.drawingLineName=this.store.options.drawingLineName;const e={id:ne(),x:this.store.hoverAnchor.x,y:this.store.hoverAnchor.y};this.drawingLine=this.createDrawingLine(e),this.drawingLine.calculative.activeAnchor=e,qe(this.store.hover,this.store.hoverAnchor,this.drawingLine,e)}else if(!this.drawingLine&&"curve"!==this.drawingLineName){this.inactive(!0);const t={id:ne(),x:e.x,y:e.y};this.drawingLine=this.createDrawingLine(t),this.drawingLine.calculative.activeAnchor=t}}else if(this.pencil){this.inactive(!0);const t=ne(),i={x:e.x,y:e.y,id:ne(),penId:t};this.pencilLine=this.getInitPencilLine(i)}else{switch(this.hoverType){case v.None:this.store.data.rule&&!this.store.options.disableRuleLine&&this.addRuleLine(e);break;case v.Node:case v.Line:if(this.store.hover){const t=se(this.store.hover,!0)||this.store.hover;e.ctrlKey&&!e.shiftKey?(t.calculative.active?this.willInactivePen=t:(t.calculative.active=!0,tt(t),this.store.active.push(t),this.store.emitter.emit("active",this.store.active)),this.patchFlags=!0):e.ctrlKey&&e.shiftKey&&this.store.hover.parentId?this.active([this.store.hover]):t.calculative.active||this.active([t]),this.calcActiveRect()}break;case v.LineAnchor:this.store.activeAnchor=this.store.hoverAnchor,this.store.hover.calculative.activeAnchor=this.store.hoverAnchor,this.active([this.store.hover]);break;case v.LineAnchorPrev:case v.LineAnchorNext:this.store.activeAnchor&&(this.prevAnchor={...this.store.activeAnchor.prev},this.nextAnchor={...this.store.activeAnchor.next});break;case v.Resize:this.activeInitPos=[],this.store.active.forEach((e=>{this.activeInitPos.push({x:(e.calculative.worldRect.x-this.activeRect.x)/this.activeRect.width,y:(e.calculative.worldRect.y-this.activeRect.y)/this.activeRect.height})}))}this.store.emitter.emit("mousedown",{x:e.x,y:e.y,pen:this.store.hover})}this.render()}}else this.setAnchor(this.store.pointAt)},this.onMouseMove=e=>{if(this.store.data.locked===o.Disable)return void(this.hoverType=v.None);if(this.mouseDown&&!this.mouseDown.restore&&1!==e.buttons&&2!==e.buttons)return void this.onMouseUp(e);if(this.lastMouseTime){if(performance.now()-this.lastMouseTime<50)return void(this.lastMouseTime=0);this.lastMouseTime=0}if(this.calibrateMouse(e),this.mousePos.x=e.x,this.mousePos.y=e.y,this.magnifierCanvas.magnifier)return void this.render();if(this.mouseDown&&!this.store.options.disableTranslate){if(this.mouseRight===g.Down&&(this.mouseRight=g.Translate),this.store.data.locked===o.DisableEdit||this.store.data.locked===o.DisableScale||this.hotkeyType===x.Translate||this.mouseRight===g.Translate){const{scale:t}=this.store.data;let i=(e.x-this.mouseDown.x)/t,n=(e.y-this.mouseDown.y)/t;return e.shiftKey&&!e.ctrlKey&&(n=0),e.ctrlKey&&(i=0),void this.translate(i,n)}if(this.store.data.locked)return;if(this.drawingLine||this.pencil){if(this.pencil){const t={...e};t.id=ne(),t.penId=this.pencilLine.id,this.pencilLine.calculative.worldAnchors.push(t),this.store.path2dMap.set(this.pencilLine,N.path2dDraws[this.pencilLine.name](this.pencilLine)),this.patchFlags=!0}}else{if(this.drawingLineName||this.movingAnchor){if(this.drawingLineName&&this.hoverType===v.None){const t={id:ne(),x:e.x,y:e.y};return this.drawingLine=this.createDrawingLine(t),this.drawingLine.calculative.activeAnchor=t,void this.drawline()}}else if(this.hoverType===v.NodeAnchor){this.drawingLineName=this.store.options.drawingLineName;const e={id:ne(),x:this.store.hoverAnchor.x,y:this.store.hoverAnchor.y};return this.drawingLine=this.createDrawingLine(e),this.drawingLine.calculative.activeAnchor=e,qe(this.store.hover,this.store.hoverAnchor,this.drawingLine,e),void this.drawline()}if(1===e.buttons&&!this.hoverType&&!this.hotkeyType)return this.dragRect={x:Math.min(this.mouseDown.x,e.x),y:Math.min(this.mouseDown.y,e.y),ex:Math.max(this.mouseDown.x,e.x),ey:Math.max(this.mouseDown.y,e.y),width:Math.abs(e.x-this.mouseDown.x),height:Math.abs(e.y-this.mouseDown.y)},void this.render();if(this.movingAnchor){const t=e.x-this.movingAnchor.x,i=e.y-this.movingAnchor.y;return this.translateAnchor(t,i),void this.render()}if(!this.store.active[0]?.locked){const t={x:e.x,y:e.y};if(this.hoverType===v.LineAnchor)return!this.dockInAnchor(e)||this.store.options.disableDock||this.store.options.disableLineDock||(this.clearDock(),this.dock=pt(this.store,t,this.store.activeAnchor),this.dock?.xDock&&(t.x+=this.dock.xDock.step),this.dock?.yDock&&(t.y+=this.dock.yDock.step)),void this.moveLineAnchor(t,e);if(this.hoverType===v.LineAnchorPrev)return void this.moveLineAnchorPrev(e);if(this.hoverType===v.LineAnchorNext)return void this.moveLineAnchorNext(e)}if(this.hoverType===v.Rotate)return void this.rotatePens({x:e.x,y:e.y});if(this.hoverType===v.Resize)return void this.resizePens(e);if(this.hoverType===v.Node||this.hoverType===v.Line){const t=e.x-this.mouseDown.x,i=e.y-this.mouseDown.y,n=20;if(e.ctrlKey&&!e.shiftKey&&(Math.abs(t)>=n||Math.abs(i)>=n)&&(this.willInactivePen=void 0),1===this.store.active.length){const e=this.store.active[0];e.locked<o.DisableMove&&e?.onMouseMove?.(e,this.mousePos)}return void this.movePens(e)}}}if(this.drawingLine){const t={...e};if(t.id=ne(),t.penId=this.drawingLine.id,this.store.options.disableDock||this.store.options.disableLineDock||(this.clearDock(),this.dock=pt(this.store,t),this.dock?.xDock&&(t.x+=this.dock.xDock.step),this.dock?.yDock&&(t.y+=this.dock.yDock.step)),this.mouseDown&&"curve"===this.drawingLineName&&!this.drawingLine.calculative.worldAnchors[0].connectTo)this.drawline(t);else{let i;if(this.drawingLine.calculative.worldAnchors.length>1&&(i=Xe(this.drawingLine)),i?(i.prev=void 0,i.next=void 0,i.id||(i.id=ne()),i.x=t.x,i.y=t.y,i.connectTo=void 0):(i={...t},this.drawingLine.calculative.worldAnchors.push(i)),this.hoverType!==v.NodeAnchor&&this.hoverType!==v.LineAnchor||(this.store.hoverAnchor.type!==A.Line&&(i.x=this.store.hoverAnchor.x,i.y=this.store.hoverAnchor.y),i.connectTo=this.store.hoverAnchor.penId,"polyline"===this.drawingLineName&&(i.isTemp=!1)),"line"===this.drawingLineName)if(e.ctrlKey&&!e.shiftKey)i.x=this.drawingLine.calculative.worldAnchors[this.drawingLine.calculative.worldAnchors.length-2].x;else if(e.shiftKey&&!e.ctrlKey)i.y=this.drawingLine.calculative.worldAnchors[this.drawingLine.calculative.worldAnchors.length-2].y;else if(e.shiftKey&&e.ctrlKey){let e=this.drawingLine.calculative.worldAnchors[this.drawingLine.calculative.worldAnchors.length-2];this.getSpecialAngle(i,e)}this.drawline()}}globalThis.debug&&console.time("hover");const t=performance.now();t-this.hoverTimer>50&&(this.hoverTimer=t,this.getHover(e)),globalThis.debug&&console.timeEnd("hover"),this.hotkeyType===x.AddAnchor&&(this.patchFlags=!0),this.render(!1)},this.onMouseUp=e=>{if(this.store.data.locked!==o.Disable){if(this.mouseDown){if(this.mouseRight===g.Down&&this.store.emitter.emit("contextmenu",{e,clientRect:this.clientRect}),this.mouseRight=g.None,this.calibrateMouse(e),this.mousePos.x=e.x,this.mousePos.y=e.y,this.pencil&&this.finishPencil(),this.drawingLine){if(this.store.hoverAnchor){const e=Xe(this.drawingLine);return this.store.hoverAnchor.type===A.Line?M(e,this.store.hoverAnchor,this.store):(e.x=this.store.hoverAnchor.x,e.y=this.store.hoverAnchor.y),qe(this.store.hover,this.store.hoverAnchor,this.drawingLine,e),this.drawline(),void this.finishDrawline(!0)}if(this.store.options.autoAnchor&&this.hoverType===v.Node){const t=Xe(this.drawingLine),i=We(this.store.hover,e);return t.x=i.x,t.y=i.y,this.drawingLine.autoTo=!0,qe(this.store.hover,i,this.drawingLine,t),this.drawline(),void this.finishDrawline(!0)}}if(this.hoverType===v.LineAnchor&&this.store.hover&&this.store.active[0]&&"line"===this.store.active[0].name&&this.store.active[0]!==this.store.hover){const t=this.store.active[0],i=$e(t),n=Xe(t);if(this.store.hoverAnchor){const o=this.store.hover,s=$e(o)===this.store.hoverAnchor,a=Xe(o)===this.store.hoverAnchor,c=i===this.store.activeAnchor,l=n===this.store.activeAnchor;if((e.ctrlKey||e.altKey)&&o.type===r.Line&&(s||a)&&(c||l)){const e=o.calculative.worldAnchors.map((e=>({...e,penId:t.id})));s?e.shift():a&&e.pop(),(s&&c||a&&l)&&e.reverse(),c?(t.calculative.worldAnchors[0].connectTo=void 0,t.calculative.worldAnchors.unshift(...e)):l&&(t.calculative.worldAnchors[t.calculative.worldAnchors.length-1].connectTo=void 0,t.calculative.worldAnchors.push(...e)),this.delete([o]),this.render()}else this.store.activeAnchor&&(this.store.hoverAnchor.type===A.Line?M(this.store.activeAnchor,this.store.hoverAnchor,this.store):(this.store.activeAnchor.x=this.store.hoverAnchor.x,this.store.activeAnchor.y=this.store.hoverAnchor.y),qe(this.store.hover,this.store.hoverAnchor,t,this.store.activeAnchor));this[t.lineName]&&"polyline"!==t.lineName&&this[t.lineName](this.store,t),this.store.path2dMap.set(t,N.path2dDraws.line(t)),this.initLineRect(t)}else i===this.store.activeAnchor&&t.autoFrom?this.calcAutoAnchor(t,i,this.store.hover):n===this.store.activeAnchor&&t.autoTo&&this.calcAutoAnchor(t,n,this.store.hover)}if(this.addCaches&&this.addCaches.length&&(this.store.data.locked||this.dropPens(this.addCaches,e),this.addCaches=void 0),this.hoverType===v.Rotate&&(this.getSizeCPs(),this.store.active.forEach((e=>{e.rotate=e.calculative.rotate}))),this.patchFlagsLines.forEach((e=>{e.type&&this.initLineRect(e)})),this.patchFlagsLines.clear(),this.dragRect){const e=this.store.data.pens.filter((e=>!(!1===e.visible||e.locked>=o.DisableMove||e.parentId)&&(Et(e.calculative.worldRect,this.dragRect,this.store.options.dragAllIn)?!(e.type===r.Line&&!this.store.options.dragAllIn)||function(e,t){const i=e.calculative.worldAnchors;for(let e=0;e<i.length-1;e++){const n=i[e],r=i[e+1];if(n.next||r.prev){if(li(n,r,t))return!0}else if(ci(n,r,t))return!0}return!1}(e,this.dragRect):void 0)));this.active(e)}2!==e.button&&(R(this.mouseDown,e)<2&&(this.store.hover&&this.store.hover.input&&this.showInput(this.store.hover),this.store.emitter.emit("click",{x:e.x,y:e.y,pen:this.store.hover})),this.store.emitter.emit("mouseup",{x:e.x,y:e.y,pen:this.store.hover})),this.willInactivePen&&(this.willInactivePen.calculative.active=void 0,tt(this.willInactivePen,!1),this.store.active.splice(this.store.active.findIndex((e=>e===this.willInactivePen)),1),this.calcActiveRect(),this.willInactivePen=void 0,this.store.emitter.emit("inactive",[this.willInactivePen]),this.render()),this.movingPens&&(e.altKey&&!e.shiftKey?this.copyMovedPens():this.movedActivePens(e.ctrlKey&&e.shiftKey),this.getAllByPens(this.movingPens).forEach((e=>{this.store.pens[e.id]=void 0})),this.movingPens=void 0),this.store.active&&this.store.active[0]&&(this.store.active[0].calculative.h=void 0),this.mouseDown=void 0,this.lastOffsetX=0,this.lastOffsetY=0,this.clearDock(),this.dragRect=void 0,this.initActiveRect=void 0,this.render()}}else this.hoverType=v.None},this.clearDock=()=>{const e=this.dock?.xDock?.penId,t=this.dock?.yDock?.penId,i=this.store.pens[e];i&&(i.calculative.isDock=!1);const n=this.store.pens[t];n&&(n.calculative.isDock=!1),this.dock=void 0},this.onResize=()=>{this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>{this.resize(),this.timer=void 0}),100)},this.onScroll=()=>{this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>{this.clientRect=this.canvas.getBoundingClientRect(),this.timer=void 0}),100)},this.calibrateMouse=e=>(e.x-=this.store.data.x,e.y-=this.store.data.y,e),this.getHover=e=>{if(this.dragRect)return;let t=v.None;this.store.hover=void 0,this.store.hoverAnchor=void 0,this.store.pointAt=void 0,this.store.pointAtIndex=void 0;const i=1===this.store.active.length&&this.store.active[0].type;if(!this.drawingLineName&&this.hotkeyType!==x.AddAnchor&&this.activeRect&&!i&&!this.store.data.locked){const i=rt(this.store.active),n=ot(this.store.active)||this.store.options.disableRotate,r=at(this.store.active)||this.store.options.disableSize;if(!i&&!n){const i={x:this.activeRect.center.x,y:this.activeRect.y-30};this.activeRect.rotate&&S(i,this.activeRect.rotate,this.activeRect.center),!this.hotkeyType&&P(e,i,this.pointSize)&&(t=v.Rotate,this.externalElements.style.cursor=`url("${this.store.options.rotateCursor}"), auto`)}if(!i&&!r)for(let i=0;i<8;i++){const n=i<4;if((this.hotkeyType===x.Resize||n&&!this.hotkeyType)&&P(e,this.sizeCPs[i],this.pointSize)){let e=n?m:b,r=0;Math.abs(this.activeRect.rotate%90-45)<25?(e=n?b:m,r=Math.round((this.activeRect.rotate-45)/90)+(n?0:1)):r=Math.round(this.activeRect.rotate/90),t=v.Resize,this.resizeIndex=i,this.externalElements.style.cursor=e[(i+r)%4];break}}}t===v.None&&(t=this.inPens(e,this.store.data.pens)),t||i||!_t(e,this.activeRect)||(t=v.Node,this.externalElements.style.cursor="move"),this.hoverType=t,t===v.None&&(this.drawingLineName||this.pencil?this.externalElements.style.cursor="crosshair":this.mouseDown||(this.externalElements.style.cursor="default"),this.store.hover=void 0),this.store.lastHover!==this.store.hover&&(this.patchFlags=!0,this.store.lastHover&&(this.store.lastHover.calculative.hover=!1,it(se(this.store.lastHover,!0)||this.store.lastHover,!1),this.store.emitter.emit("leave",this.store.lastHover),this.tooltip.hide()),this.store.hover&&(this.store.hover.calculative.hover=!0,it(se(this.store.hover,!0)||this.store.hover),this.store.emitter.emit("enter",this.store.hover),this.tooltip.show(this.store.hover,e)),this.store.lastHover=this.store.hover),this.store.hover?.onMouseMove?.(this.store.hover,this.mousePos)},this.inPens=(e,t)=>{let i=v.None;e:for(let n=t.length-1;n>=0;--n){const r=t[n];if(0==r.visible||0==r.calculative.inView||r.locked===o.Disable)continue;const s=ii(r);if(r.calculative.active||kt(e,r.calculative.worldRect,s)||_t(e,r.calculative.worldRect)){if(this.store.data.locked&&r.calculative.worldAnchors)for(const t of r.calculative.worldAnchors)if(P(e,t,this.pointSize,t.penId?this.store.pens[t.penId]:void 0)&&(this.title.show(t),t.title))break e;if(!this.store.data.locked&&this.hotkeyType!==x.Resize&&r.calculative.worldAnchors)for(const t of r.calculative.worldAnchors)if(i=this.inAnchor(e,r,t),i)break e;if(r.type){const t=ri(e,r);if(t){this.store.data.locked||r.locked?this.externalElements.style.cursor=this.store.options.hoverCursor:this.hotkeyType===x.AddAnchor?this.externalElements.style.cursor="pointer":this.externalElements.style.cursor="move",this.store.hover=r,this.store.pointAt=t.point,this.store.pointAtIndex=t.i,i=v.Line;break}}else{if(r.children){const t=[];if(r.children.forEach((e=>{this.store.pens[e]&&t.push(this.store.pens[e])})),i=this.inPens(e,t),i)break}let t=!1;if(t="line"===r.name?kt(e,r.calculative.worldRect,r.lineWidth):_t(e,r.calculative.worldRect),t){if(this.store.data.locked||r.locked?this.externalElements.style.cursor=this.store.options.hoverCursor:this.hotkeyType===x.AddAnchor?this.externalElements.style.cursor="pointer":this.externalElements.style.cursor="move",this.store.hover=r,i=v.Node,this.store.pointAt=e,!e.ctrlKey){let{x:t,y:i,ex:n,ey:r,rotate:o,center:s}=this.store.hover.calculative.worldRect;if(o){const a=[{x:t,y:i},{x:n,y:i},{x:n,y:r},{x:t,y:r}];a.forEach((e=>{S(e,o,s)}));let c=a[a.length-1];for(const t of a){if(c.y>e.y!=t.y>e.y){const i=t.x+(e.y-t.y)*(c.x-t.x)/(c.y-t.y);Math.abs(i-this.store.pointAt.x)<10&&(this.store.pointAt.x=i)}c=t}}else this.store.pointAt.x-10<t?this.store.pointAt.x=t:this.store.pointAt.x+10>n&&(this.store.pointAt.x=n),this.store.pointAt.y-10<i?this.store.pointAt.y=i:this.store.pointAt.y+10>r&&(this.store.pointAt.y=r)}break}}}}return i},this.dockInAnchor=e=>{this.store.hover=void 0;for(let t=this.store.data.pens.length-1;t>=0;--t){const i=this.store.data.pens[t];if(0==i.visible||i.locked===o.Disable||i===this.store.active[0])continue;let n=ii(i);if(n+=2*this.store.options.anchorRadius,kt(e,i.calculative.worldRect,n)&&(this.store.hover=i,this.hotkeyType!==x.Resize&&i.calculative.worldAnchors))for(const t of i.calculative.worldAnchors){if(t.twoWay===T.In){const e=Xe(this.store.active[0]);if(this.store.activeAnchor.id!==e.id)continue}if(t.twoWay===T.Out){const e=$e(this.store.active[0]);if(this.store.activeAnchor.id!==e.id)continue}if(t.twoWay!==T.DisableConnected&&t.twoWay!==T.Disable&&this.store.activeAnchor?.twoWay!==T.DisableConnectTo&&this.store.activeAnchor?.twoWay!==T.Disable&&this.inAnchor(e,i,t))return!0}}},this.render=e=>{if(e&&(this.opening=!1),this.opening)return;let t;if(null==e||!0===e||e===1/0?(t=performance.now(),this.patchFlags=!0):t=e>1?e:performance.now(),!this.patchFlags)return;if(t-this.lastRender<this.store.options.interval)return this.renderTimer&&cancelAnimationFrame(this.renderTimer),void(this.renderTimer=requestAnimationFrame(this.render));this.renderTimer=void 0,this.lastRender=t;const i=this.offscreen.getContext("2d");i.clearRect(0,0,this.offscreen.width,this.offscreen.height),i.save(),i.translate(this.store.data.x,this.store.data.y),globalThis.debugRender&&console.time("renderPens"),this.renderPens(),globalThis.debugRender&&console.timeEnd("renderPens"),this.renderBorder(),this.renderHoverPoint(),i.restore(),this.magnifierCanvas.render();const n=this.canvas.getContext("2d");n.clearRect(0,0,this.canvas.width,this.canvas.height),n.drawImage(this.offscreen,0,0,this.width,this.height),this.canvasImageBottom.render(),this.canvasImage.render(),this.patchFlags=!1},this.renderPens=()=>{const e=this.offscreen.getContext("2d");e.strokeStyle=De(this.store);for(const t of this.store.data.pens)isFinite(t.x)&&t.calculative.inView&&Ce(e,t);this.drawingLine&&Ce(e,this.drawingLine),this.pencilLine&&Ce(e,this.pencilLine),this.movingPens&&this.movingPens.forEach((t=>{this.renderPenContainChild(e,t)}))},this.renderPenContainChild=(e,t)=>{t.calculative.inView&&Ce(e,t),t.children?.forEach((t=>{const i=this.store.pens[t];i&&this.renderPenContainChild(e,i)}))},this.renderBorder=()=>{if(!this.store.data.locked&&this.activeRect&&(1!==this.store.active.length||!this.store.active[0].type)&&!this.movingPens){const e=this.offscreen.getContext("2d");if(e.save(),e.translate(.5,.5),this.activeRect.rotate&&(e.translate(this.activeRect.center.x,this.activeRect.center.y),e.rotate(this.activeRect.rotate*Math.PI/180),e.translate(-this.activeRect.center.x,-this.activeRect.center.y)),e.strokeStyle=this.store.options.activeColor,e.globalAlpha=.3,e.beginPath(),e.strokeRect(this.activeRect.x,this.activeRect.y,this.activeRect.width,this.activeRect.height),e.globalAlpha=1,rt(this.store.active)||ot(this.store.active)||this.store.options.disableRotate)return void e.restore();e.beginPath(),e.moveTo(this.activeRect.center.x,this.activeRect.y),e.lineTo(this.activeRect.center.x,this.activeRect.y-30),e.stroke(),e.beginPath(),e.strokeStyle=this.store.options.activeColor,e.fillStyle="#ffffff",e.arc(this.activeRect.center.x,this.activeRect.y-30,5,0,2*Math.PI),e.fill(),e.stroke(),e.restore()}},this.renderHoverPoint=()=>{if(this.store.data.locked)return;const e=this.offscreen.getContext("2d");if(e.save(),e.translate(.5,.5),!this.store.options.disableAnchor&&this.store.hover&&!this.store.hover.disableAnchor&&(this.hotkeyType!==x.Resize||1!==this.store.active.length||this.store.active[0]!==this.store.hover)){const t=[...this.store.hover.calculative.worldAnchors];this.store.pointAt&&this.hotkeyType===x.AddAnchor&&t.push(this.store.pointAt),t&&(e.strokeStyle=this.store.hover.anchorColor||this.store.options.anchorColor,e.fillStyle=this.store.hover.anchorBackground||this.store.options.anchorBackground,t.forEach((t=>{if(t.hidden&&t.locked>o.DisableEdit)return;if(t===this.store.hoverAnchor){e.save();const t=this.store.hover.hoverAnchorColor||this.store.options.hoverAnchorColor;e.strokeStyle=t,e.fillStyle=t}e.beginPath();let i=t.radius||this.store.hover.anchorRadius||this.store.options.anchorRadius;if(!this.store.hover.type||t.radius||this.store.hover.anchorRadius||(i=3,this.store.hover.calculative.lineWidth>3&&(i=this.store.hover.calculative.lineWidth)),t.type===A.Line){let n=this.store.pens[t.penId].rotate;this.store.pens[t.penId].calculative.flipX&&(n*=-1),this.store.pens[t.penId].calculative.flipY&&(n*=-1);let r=t.rotate+n;this.store.pens[t.penId].calculative.flipX&&(r*=-1),this.store.pens[t.penId].calculative.flipY&&(r*=-1),e.save(),e.translate(t.x,t.y),e.rotate(r*Math.PI/180),e.translate(-t.x,-t.y),e.rect(t.x-t.length*this.store.data.scale/2,t.y-i,t.length*this.store.data.scale,2*i),e.restore()}else e.arc(t.x,t.y,i,0,2*Math.PI);if(this.store.hover.type&&this.store.hoverAnchor===t?(e.save(),e.strokeStyle=this.store.hover.activeColor||this.store.options.activeColor,e.fillStyle=e.strokeStyle):(t.color||t.background)&&(e.save(),e.strokeStyle=t.color,e.fillStyle=t.background),e.fill(),e.stroke(),t===this.store.hoverAnchor&&e.restore(),(this.store.hover.type&&this.store.hoverAnchor===t||t.color||t.background)&&e.restore(),!this.store.hover.parentId&&this.store.hover.children&&this.store.hover.children.length>0&&t===this.store.hoverAnchor){e.save(),e.beginPath(),e.lineWidth=3;const n=this.store.hover.hoverAnchorColor||this.store.options.hoverAnchorColor;globalThis.pSBC&&(e.strokeStyle=globalThis.pSBC(.5,n)),e.arc(t.x,t.y,i+1.5,0,2*Math.PI),e.stroke(),e.restore()}})))}this.hotkeyType===x.AddAnchor||this.movingPens||!this.activeRect||1===this.store.active.length&&this.store.active[0].type||rt(this.store.active)||at(this.store.active)||this.store.options.disableSize||(e.strokeStyle=this.store.options.activeColor,e.fillStyle="#ffffff",this.sizeCPs.forEach(((t,i)=>{this.activeRect.rotate&&(e.save(),e.translate(t.x,t.y),e.rotate(this.activeRect.rotate*Math.PI/180),e.translate(-t.x,-t.y)),(i<4||this.hotkeyType===x.Resize)&&(e.beginPath(),e.fillRect(t.x-4.5,t.y-4.5,8,8),e.strokeRect(t.x-5.5,t.y-5.5,10,10)),this.activeRect.rotate&&e.restore()}))),!this.store.data.locked&&this.dragRect&&(e.save(),e.fillStyle=ee(this.store.options.dragColor,.2),e.strokeStyle=this.store.options.dragColor,e.beginPath(),e.strokeRect(this.dragRect.x,this.dragRect.y,this.dragRect.width,this.dragRect.height),e.fillRect(this.dragRect.x,this.dragRect.y,this.dragRect.width,this.dragRect.height),e.restore()),this.dock&&(e.strokeStyle=this.store.options.dockColor,this.dock.xDock&&(e.beginPath(),e.moveTo(this.dock.xDock.x,this.dock.xDock.y),e.lineTo(this.dock.xDock.x,this.dock.xDock.prev.y),e.stroke()),this.dock.yDock&&(e.beginPath(),e.moveTo(this.dock.yDock.x,this.dock.yDock.y),e.lineTo(this.dock.yDock.prev.x,this.dock.yDock.y),e.stroke())),e.restore()},this.pastePen=(e,t)=>{const i=e.id;if(wt(e),e.parentId=t,e.type===r.Line?this.changeNodeConnectedLine(i,e,this.store.clipboard.pens):this.changeLineAnchors(i,e,this.store.clipboard.pens),!e.parentId){const t=this.getPenRect(e,this.store.clipboard.origin,this.store.clipboard.scale),i=this.getPenRect(this.store.clipboard.initRect,this.store.clipboard.origin,this.store.clipboard.scale),{origin:n,scale:r}=this.store.data;e.x=n.x+t.x*r,e.y=n.y+t.y*r,e.width=t.width*r,e.height=t.height*r,i.x=n.x+i.x*r,i.y=n.y+i.y*r,Tt(i),this.store.clipboard.pos&&(e.x-=i.center.x-this.store.clipboard.pos.x,e.y-=i.center.y-this.store.clipboard.pos.y),e.x+=this.store.clipboard.offset*this.store.data.scale,e.y+=this.store.clipboard.offset*this.store.data.scale}this.makePen(e);const n=[];if(Array.isArray(e.children))for(const t of e.children){const i=this.store.clipboard.pens.find((e=>e.id===t));i&&n.push(this.pastePen(i,e.id).id)}return e.children=n,e},this.ondblclick=e=>{!this.store.hover||this.store.data.locked||this.store.options.disableInput||(this.store.hover.onShowInput?this.store.hover.onShowInput(this.store.hover,e):this.showInput(this.store.hover)),this.store.emitter.emit("dblclick",{x:e.x,y:e.y,pen:this.store.hover})},this.showInput=(e,t,i="transparent")=>{if(!window||!this.store.hover||this.store.hover.locked||this.store.hover.externElement||this.store.hover.disableInput)return;if(this.inputDiv.dataset.penId===e.id){this.inputDiv.dataset.isInput="true",this.inputDiv.contentEditable="true",this.inputDiv.focus();const e=window.getSelection();return e.selectAllChildren(this.inputDiv),e.collapseToEnd(),this.inputDiv.scrollTop=this.inputDiv.scrollHeight,void(this.inputDiv.scrollLeft=this.inputDiv.scrollWidth)}t||this.setInputStyle(e);const n=t||e.calculative.worldTextRect,r=`${(e.calculative.tempText||e.text+""||"").replace(/\x20/g,"&nbsp;").split(/[\s\n]/).join("</div><div>")}</div>`.replace("</div>","").replace(/\<div\>\<\/div\>/g,"<div><br></div>");this.inputDiv.innerHTML=r,this.inputParent.style.left=n.x+this.store.data.x-(e.textLeft||0)+"px",this.inputParent.style.top=n.y+this.store.data.y-(e.textTop||0)+"px";let o=n.width+(e.textLeft||0);this.inputParent.style.width=(o<0?12:o)+"px",this.inputParent.style.height=n.height+(e.textTop||0)+"px",this.inputParent.style.zIndex="9999",this.inputParent.style.background=i,e.rotate%360?this.inputParent.style.transform=`rotate(${e.rotate}deg)`:this.inputParent.style.transform=null,this.inputParent.style.display="flex",this.inputDiv.dataset.penId=e.id,this.inputDiv.contentEditable=null==e.disableInput?"true":e.disableInput.toString(),e.dropdownList&&"block"!==this.dropdown.style.display?(this.store.data.locked||(this.inputRight.style.display="none"),this.setDropdownList()):this.inputRight.style.display="none",this.inputDiv.contentEditable="true",this.inputDiv.focus();const s=window.getSelection();s.selectAllChildren(this.inputDiv),s.collapseToEnd(),this.inputDiv.scrollTop=this.inputDiv.scrollHeight,this.inputDiv.scrollLeft=this.inputDiv.scrollWidth,e.calculative.text=void 0,this.render()},this.setInputStyle=e=>{let t;e.text||(e.text="");for(let e=0;e<document.styleSheets.length;e++)"le5le.com"===document.styleSheets[e].title&&(t=document.styleSheets[e]);let i="overflow: scroll;",n="",r=1;const{scale:o}=this.store.data;if(e.fontSize<12&&(r=12/e.fontSize),e.textAlign?i+=`text-align: ${e.textAlign};`:i+="text-align: center;",e.textAlign&&"pre-line"===e.whiteSpace&&(i+=`align-items: ${{left:"start",center:"center",right:"end"}[e.textAlign]};`),e.textBaseline?i+=`justify-content: ${{top:"start",middle:"center",bottom:"end"}[e.textBaseline]};`:i+="justify-content: center;",e.fontFamily&&(i+=`font-family: ${e.fontFamily};`),e.fontSize&&(e.fontSize*o<12?(i+=`font-size:${e.fontSize}px;`,i+=`zoom:${e.fontSize/12*o};`):i+=`font-size:${e.fontSize*o}px;`),i+=`color:${we(e,this.store)};`,e.fontStyle&&(i+=`font-style: ${e.fontStyle};`),e.fontWeight&&(i+=`font-weight: ${e.fontWeight};`),e.textLeft&&(i+=`margin-left:${o>1?e.textLeft*r:e.textLeft*r/o}px;`),e.textTop&&(i+=`margin-top:${o>1?e.textTop*r:e.textTop*r/o}px;`),e.lineHeight&&(i+=`line-height:${o>1?e.fontSize*e.lineHeight*o:e.fontSize*e.lineHeight*r}px;`),e.textHeight)i+=`height:${o>1?e.textHeight*r*o:e.textHeight*r}px;`;else{let t=e.calculative.worldRect.height/o-(e.textTop||0);t<0&&(t=0),i+=`height:${e.fontSize*o<12?t*r:t*o*r}px;`}let s=null;if(e.textWidth)s=e.textWidth<1&&e.textWidth>-1?e.textWidth*e.calculative.worldRect.width:e.textWidth,"pre-line"!==e.whiteSpace&&(s<e.fontSize?i+=`width:${1.2*e.fontSize*r}px;`:i+=`width:${o>1?s*r*o:s*r}px;`);else if(void 0===e.whiteSpace||"break-all"===e.whiteSpace){let t=(e.calculative.worldTextRect.width||12)/o;t<0&&(t=0),i+=`width:${e.fontSize*o<12?t*r:t*o}px;`}e.whiteSpace&&("pre-line"===e.whiteSpace?i+="white-space:pre;":(i+=`white-space:${e.whiteSpace};`,"nowrap"===e.whiteSpace&&(n+="display:contents;"))),"nowrap"!==e.whiteSpace&&1.2*e.fontSize*e.text.length>(s||e.calculative.worldRect.width/o)*Math.floor(e.calculative.worldRect.height/o/(e.lineHeight*e.fontSize))&&(i+="justify-content: start;"),t.deleteRule(0),t.deleteRule(0),t.insertRule(`.meta2d-input\n      .input-div{\n        resize:none;border:none;outline:none;background:transparent;position:absolute;flex-grow:1;height:100%;width: 100%;position:absolute;left:0;top:0;display:flex;flex-direction: column;cursor: text;${i}}`),t.insertRule(`.input-div div{${n}}`)},this.hideInput=()=>{if("flex"===this.inputParent.style.display){this.inputParent.style.display="none";const e=this.store.pens[this.inputDiv.dataset.penId];if(!e)return;if(e.calculative.text=e.text,this.inputDiv.dataset.value=this.inputDiv.innerHTML.replace(/\<div\>/g,"\n").replace(/\<\/div\>/g,"").replace(/\<br\>/g,"").replace(/&nbsp;/g," ").replace(/(<([^>]+)>)/gi,""),this.inputDiv.dataset.value=this.convertSpecialCharacter(this.inputDiv.dataset.value),e.onInput)e.onInput(e,this.inputDiv.dataset.value);else if(e.text!==this.inputDiv.dataset.value){const t=[$(e,!0)];e.text=this.inputDiv.dataset.value,e.calculative.text=e.text,this.inputDiv.dataset.penId=void 0,U(e),this.patchFlags=!0,this.pushHistory({type:H.Update,pens:[$(e,!0)],initPens:t}),this.store.emitter.emit("valueUpdate",e)}}this.inputDiv.dataset.penId=void 0,this.dropdown.style.display="none",this.inputDiv.dataset.isInput="false",this.inputDiv.contentEditable="false",this.render()},this.setDropdownList=e=>{if(this.clearDropdownList(),!this.store.data.locked)return;this.dropdown.style.display="block",this.inputRight.style.display="block",setTimeout((()=>{this.inputRight.style.transform="rotate(315deg)",this.inputRight.style.zoom=this.store.data.scale}));const t=this.store.pens[this.inputDiv.dataset.penId];if(!t||!t.dropdownList)return this.dropdown.style.display="none",this.inputRight.style.display="none",void(this.inputRight.style.transform="rotate(135deg)");if(!t.dropdownList.length){const e=document.createElement("div");return e.innerText="None",e.style.padding="5px 12px",e.style.color="#ddd",void this.dropdown.appendChild(e)}const i=this.inputDiv.innerHTML.replace(/\<div\>/g,"\n").replace(/\<\/div\>/g,"").replace(/\<br\>/g,"");let n=0;for(const r of t.dropdownList){const t="string"==typeof r?r:r.text;e&&i?t.includes(i)&&this.dropdownAppendOption(t,n):this.dropdownAppendOption(t,n),++n}if(!this.dropdown.hasChildNodes()){const e=document.createElement("div");e.innerText="None",e.style.padding="5px 12px",e.style.color="#ddd",this.dropdown.appendChild(e)}},this.selectDropdown=e=>{const t=e.target,i=this.store.pens[this.inputDiv.dataset.penId];if(!t||!i||!i.dropdownList)return;const n=+t.dataset.i,r=i.dropdownList[n];if(!r)return;const o=[$(i,!0)];"object"==typeof r?(this.updateValue(i,{...r}),i.calculative.text=void 0,this.calcActiveRect()):i.text=r+"",this.inputDiv.innerText=i.text,this.hideInput(),this.pushHistory({type:H.Update,pens:[$(i,!0)],initPens:o}),this.render(),this.store.emitter.emit("valueUpdate",i)},this.canvasImageBottom=new un(t,i,!0),this.canvasImageBottom.canvas.style.zIndex="1",t.appendChild(this.canvas),this.canvas.style.position="absolute",this.canvas.style.backgroundRepeat="no-repeat",this.canvas.style.backgroundSize="100% 100%",this.canvas.style.zIndex="2",this.canvasImage=new un(t,i),this.canvasImage.canvas.style.zIndex="3",this.magnifierCanvas=new fn(this,t,i),this.magnifierCanvas.canvas.style.zIndex="4",this.externalElements.style.position="absolute",this.externalElements.style.left="0",this.externalElements.style.top="0",this.externalElements.style.outline="none",this.externalElements.style.background="transparent",this.externalElements.style.zIndex="4",t.style.position="relative",t.appendChild(this.externalElements),this.createInput(),this.tooltip=new hn(t,i),this.tooltip.box.onmouseleave=e=>{this.patchFlags=!0,this.store.lastHover&&(this.store.lastHover.calculative.hover=!1),it(this.store.data.pens.find((e=>!0===e.calculative.hover)),!1)},this.dialog=new vn(t),this.title=new yn(t),this.store.options.scroll&&(this.scroll=new dn(this)),this.store.dpiRatio=globalThis.devicePixelRatio||1,this.store.dpiRatio<1?this.store.dpiRatio=1:this.store.dpiRatio>1&&this.store.dpiRatio<1.5&&(this.store.dpiRatio=1.5),this.clientRect=this.externalElements.getBoundingClientRect(),this.listen(),window?.addEventListener("resize",this.onResize),window?.addEventListener("scroll",this.onScroll)}listen(){switch(this.externalElements.addEventListener("gesturestart",this.onGesturestart),this.externalElements.ondragover=e=>e.preventDefault(),this.externalElements.ondrop=this.ondrop,this.externalElements.oncontextmenu=e=>e.preventDefault(),this.store.options.interval=50,this.externalElements.ontouchstart=this.ontouchstart,this.externalElements.ontouchmove=this.ontouchmove,this.externalElements.ontouchend=this.ontouchend,this.externalElements.onmousedown=e=>{this.onMouseDown({x:e.offsetX,y:e.offsetY,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,buttons:e.buttons})},this.externalElements.onmousemove=e=>{e.target===this.externalElements&&this.onMouseMove({x:e.offsetX,y:e.offsetY,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,buttons:e.buttons})},this.externalElements.onmouseup=e=>{this.onMouseUp({x:e.offsetX,y:e.offsetY,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey,altKey:e.altKey,buttons:e.buttons,button:e.button})},this.externalElements.onmouseleave=e=>{e.toElement!==this.tooltip.box&&(this.tooltip.hide(),this.store.lastHover=void 0)},this.externalElements.ondblclick=this.ondblclick,this.externalElements.tabIndex=0,this.externalElements.onblur=()=>{this.mouseDown=void 0},this.externalElements.onwheel=this.onwheel,document.addEventListener("copy",this.onCopy),document.addEventListener("cut",this.onCut),document.addEventListener("paste",this.onPaste),this.store.options.keydown){case z.Document:document.addEventListener("keydown",this.onkeydown),document.addEventListener("keyup",this.onkeyup);break;case z.Canvas:this.externalElements.addEventListener("keydown",this.onkeydown),this.externalElements.addEventListener("keyup",this.onkeyup)}}splitLine(e,t){const i=e.calculative.worldAnchors,n=i.findIndex((e=>e===t));if([-1,0,i.length-1].includes(n))return;const r=$(e,!0),o=$(e,!0),s=ne();o.id=s,o.calculative.canvas=this,o.calculative.active=!1,o.calculative.hover=!1;const a=$(i.slice(0,n+1)),c=$(i.slice(n)).map((e=>(e.penId=s,e)));e.calculative.worldAnchors=a,o.calculative.worldAnchors=c,this.initLineRect(e),this.initLineRect(o),this.store.data.pens.push(o),this.store.pens[s]=o,this.pushHistory({type:H.Add,pens:[$(o,!0)],step:2}),this.pushHistory({type:H.Update,initPens:[r],pens:[$(e,!0)],step:2})}translateAnchor(e,t){this.movingAnchor.x+=e,this.movingAnchor.y+=t;const i=this.movingAnchor.penId;if(i){const e=this.store.pens[i],t=e.calculative.worldRect;this.movingAnchor.x<t.x?this.movingAnchor.x=t.x:this.movingAnchor.x>t.ex&&(this.movingAnchor.x=t.ex),this.movingAnchor.y<t.y?this.movingAnchor.y=t.y:this.movingAnchor.y>t.ey&&(this.movingAnchor.y=t.ey);const n=Nt(this.movingAnchor,t),r=e.anchors.findIndex((e=>e.id===this.movingAnchor.id));e.anchors[r]=n,this.patchFlags=!0}}async fileToPen(e,t){let i="";return i=this.store.options.uploadFn?await this.store.options.uploadFn(e):this.store.options.uploadUrl?await async function(e,t,i,n){const r=new FormData;if(r.append("file",e),i)for(const e in i)i.hasOwnProperty(e)&&r.append(e,i[e]);const o=await fetch(t,{method:"POST",headers:n,body:r});return(await o.json()).url}(e,this.store.options.uploadUrl,this.store.options.uploadParams,this.store.options.uploadHeaders):await async function(e){return new Promise(((t,i)=>{const n=new FileReader;n.onload=e=>{t(e.target.result)},n.onerror=e=>{i(e)},n.readAsDataURL(e)}))}(e),new Promise(((e,n)=>{const r=new Image;r.onload=()=>{N.htmlElements[i]=r,e({width:r.width,height:r.height,name:t?"gif":"image",image:i})},r.onerror=e=>{n(e)},r.crossOrigin="anonymous",r.src=i}))}async dropPens(e,t){for(const t of e)!t.parentId&&this.randomCombineId(t,e);for(const t of e)t.id||(t.id=ne()),!t.calculative&&(t.calculative={canvas:this}),this.store.pens[t.id]=t;for(const i of e)i.parentId||(i.width*=this.store.data.scale,i.height*=this.store.data.scale,i.x=t.x-i.width/2,i.y=t.y-i.height/2,i.tags&&i.tags.includes("meta3d")&&(i.x=this.store.data.origin.x,i.y=this.store.data.origin.y));const i=this.store.data.width||this.store.options.width,n=this.store.data.height||this.store.options.height;if(i&&n){let t={x:this.store.data.origin.x,y:this.store.data.origin.y,width:i*this.store.data.scale,height:n*this.store.data.scale},r=!0;for(const i of e)if(!i.parentId){let e=[{x:i.x,y:i.y},{x:i.x+i.width,y:i.y},{x:i.x,y:i.y+i.height},{x:i.x+i.width,y:i.y+i.height}];if(i.x===t.x&&i.y===t.y&&i.width===t.width&&i.height===t.height||e.some((e=>_t(e,t)))){r=!1;break}}if(r)return void console.info("画笔在大屏范围外")}await this.addPens(e,!0),this.active(e.filter((e=>!e.parentId))),this.render(),this.externalElements.focus()}randomCombineId(e,t,i){wt(e),e.parentId=i;const n=[];if(Array.isArray(e.children))for(const i of e.children){const r=t.find((e=>e.id===i));r&&n.push(this.randomCombineId(r,t,e.id).id)}return e.children=n,e}async addPens(e,t){if(this.beforeAddPens&&1!=await this.beforeAddPens(e))return[];const i=[];for(const t of e)this.beforeAddPen&&1!=this.beforeAddPen(t)||(this.makePen(t),i.push(t));return this.render(),this.store.emitter.emit("add",i),t&&this.pushHistory({type:H.Add,pens:$(i,!0)}),i}getInitPencilLine(e){const{data:t,options:i}=this.store,n=t.scale,o=t.lineWidth||1;return{id:e.penId,name:"line",x:e.x,y:e.y,type:r.Line,calculative:{canvas:this,pencil:!0,active:!0,worldAnchors:[e],lineWidth:o*n},fromArrow:t.fromArrow||i.fromArrow,toArrow:t.toArrow||i.toArrow,lineWidth:o}}createDrawingLine(e){this.inactive();const{data:t,options:i}=this.store,n=t.scale,o=t.lineWidth||1;return e.penId=ne(),{id:e.penId,name:"line",lineName:this.drawingLineName,x:e.x,y:e.y,type:r.Line,calculative:{canvas:this,active:!0,worldAnchors:[e],lineWidth:o*n},fromArrow:t.fromArrow||i.fromArrow,toArrow:t.toArrow||i.toArrow,lineWidth:o}}addRuleLine(e){const{x:t,y:i}=this.store.data,n=e.x+t,o=e.y+i;let s=e.x,a=e.y,c=0,l=0,h=0,d=0;if(n<=o&&n<20)s=-t,c=this.width,h=1;else{if(!(o<n&&o<20))return;a=-i,l=this.height,d=1}this.addPen({isRuleLine:!0,type:r.Line,name:"line",lineName:"line",x:s,y:a,width:c,height:l,color:this.store.options.ruleLineColor,anchors:[{x:0,y:0},{x:h,y:d}]}),this.inactive()}movedActivePens(e){const t=$(this.store.active,!0);this.store.active.forEach(((e,t)=>{const{x:i,y:n}=this.movingPens[t];Object.assign(e,{x:i,y:n}),e.onMove?.(e),this.updatePenRect(e),this.updateLines(e),this.store.emitter.emit("updateLines",e),this.patchFlagsLines.forEach((e=>{e.type&&this.initLineRect(e)})),this.patchFlagsLines.clear(),e.calculative.x=e.x,e.calculative.y=e.y,e.calculative.initRect&&(e.calculative.initRect.x=e.calculative.x,e.calculative.initRect.y=e.calculative.y,e.calculative.initRect.ex=e.calculative.x+e.calculative.width,e.calculative.initRect.ey=e.calculative.y+e.calculative.height)})),this.initImageCanvas(this.store.active);const{xDock:i,yDock:n}=this.dock;let r;i&&(r=this.store.pens[i.penId]),!r&&n&&(r=this.store.pens[n.penId]);const o=$(this.store.active,!0);if(e&&1===this.store.active.length&&1===r?.type&&(i?.anchorId||n?.anchorId)){const e=$e(r),s=Xe(r);if(i?.anchorId){const n=this.store.pens[this.store.active[0].id+mn].calculative.worldAnchors.find((e=>e.id===i.anchorId));n.x===e.x&&n.y===e.y?(t.push($(r,!0)),qe(this.store.active[0],n,r,e),o.push($(r,!0))):n.x===s.x&&n.y===s.y&&(t.push($(r,!0)),qe(this.store.active[0],n,r,s),o.push($(r,!0)))}else if(n?.anchorId){const i=this.store.pens[this.store.active[0].id+mn].calculative.worldAnchors.find((e=>e.id===n.anchorId));i.x===e.x&&i.y===e.y?(t.push($(r,!0)),qe(this.store.active[0],i,r,e),o.push($(r,!0))):i.x===s.x&&i.y===s.y&&(t.push($(r,!0)),qe(this.store.active[0],i,r,s),o.push($(r,!0)))}}this.pushHistory({type:H.Update,pens:o,initPens:t}),this.store.emitter.emit("translatePens",o)}copyMovedPens(){this.copy(this.store.active.map(((e,t)=>{const{x:i,y:n}=this.movingPens[t];return this.updateLines(e),{...e,x:i,y:n}}))),this.pasteOffset=!1,this.paste()}initImageCanvas(e){e.some((e=>this.hasImage(e,!1)))&&this.canvasImage.init(),e.some((e=>this.hasImage(e,!0)))&&this.canvasImageBottom.init()}hasImage(e,t){return!(!e.image||"gif"===e.name||!e.isBottom!=!t)||e.children?.some((e=>{const i=this.store.pens[e];return i&&this.hasImage(i,t)}))}inactive(e){this.store.active.length&&(this.store.active.forEach((e=>{e.calculative.active=void 0,e.calculative.activeAnchor=void 0,e.calculative.hover=!1,tt(e,!1)})),!e&&this.store.emitter.emit("inactive",this.store.active),this.store.active=[],this.activeRect=void 0,this.sizeCPs=void 0,this.store.activeAnchor=void 0,this.patchFlags=!0)}active(e,t=!0){if(this.store.active){t&&this.store.emitter.emit("inactive",this.store.active);for(const e of this.store.active)e.calculative.active=void 0,e.calculative.hover=!1,tt(e,!1)}this.store.active=[],e.forEach((e=>{e.calculative.active=!0,tt(e)})),this.store.active.push(...e),this.activeRect=void 0,this.calcActiveRect(),this.patchFlags=!0,t&&this.store.emitter.emit("active",this.store.active)}getSizeCPs(){this.sizeCPs=Pt(this.activeRect);const{x:e,y:t,width:i,height:n,rotate:r,center:o}=this.activeRect;[{x:.5,y:0},{x:1,y:.5},{x:.5,y:1},{x:0,y:.5}].forEach((s=>{const a={x:s.x*i+e,y:s.y*n+t};S(a,r,o),this.sizeCPs.push(a)}))}getSpecialAngle(e,t){let i=0,n=[0,30,45,60,90,120,150,135,180];e.x-t.x!=0?(i=180*Math.atan((t.y-e.y)/(e.x-t.x))/Math.PI,e.x<t.x&&(i>0?i-=180:i+=180)):t.y>e.y?i=90:t.y<e.y&&(i=-90);let r=999,o=-1;for(let e=0;e<n.length;e++)i<0?Math.abs(i+n[e])<r&&(o=e,r=Math.abs(i+n[e])):Math.abs(i-n[e])<r&&(o=e,r=Math.abs(i-n[e]));i=i<0?-n[o]:n[o];let s=Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y));e.x=t.x+Math.cos(i/180*Math.PI)*s,e.y=t.y-Math.sin(i/180*Math.PI)*s}clearHover(){this.hoverType=v.None,this.store.hover=null,this.store.hoverAnchor=null}inAnchor(e,t,i){if(this.store.hoverAnchor=void 0,this.movingAnchor=void 0,!i||i.locked>o.DisableEdit)return v.None;if((!t.type||!t.calculative.active)&&this.store.options.disableAnchor||t.disableAnchor)return v.None;if((this.mouseDown||this.drawingLine)&&"line"===t.name&&i.connectTo){const e=this.findOne(i.connectTo);if(e?.calculative&&!e?.calculative.active){t=e;const n=e.calculative.worldAnchors.find((e=>e.id===i.anchorId));n&&(i=n)}}if(i.twoWay===T.Disable&&"line"!==t.name)return v.None;if("line"===t.name&&i.connectTo){let e=this.findOne(i.connectTo)?.anchors.find((e=>e.id===i.anchorId));if(e&&e.twoWay)return v.None}if(this.drawingLine){if(i.twoWay===T.Out)return v.None}else if(this.mouseDown&&this.hoverType===v.LineAnchor);else if(i.twoWay===T.In)return v.None;if(P(e,i,this.pointSize,i.penId?this.store.pens[i.penId]:void 0))return i!==this.store.hoverAnchor&&(this.patchFlags=!0),this.store.hoverAnchor=i,this.store.hover=t,t.type?i.connectTo&&!t.calculative.active&&(this.store.hover=this.store.pens[i.connectTo],this.store.hover)?(this.store.hoverAnchor=this.store.hover.calculative.worldAnchors.find((e=>e.id===i.anchorId)),this.externalElements.style.cursor="crosshair",v.NodeAnchor):(this.hotkeyType===x.AddAnchor?this.externalElements.style.cursor="vertical-text":this.externalElements.style.cursor="pointer",v.LineAnchor):(this.hotkeyType===x.AddAnchor?this.externalElements.style.cursor="vertical-text":this.externalElements.style.cursor="crosshair",v.NodeAnchor);if(!this.mouseDown&&t.type){if(t.calculative.active&&i.prev&&P(e,i.prev,this.pointSize))return this.store.hoverAnchor=i,this.store.hover=t,this.externalElements.style.cursor="pointer",v.LineAnchorPrev;if(t.calculative.active&&i.next&&P(e,i.next,this.pointSize))return this.store.hoverAnchor=i,this.store.hover=t,this.externalElements.style.cursor="pointer",v.LineAnchorNext}return v.None}resize(e,t){e=e||this.parentElement.clientWidth,t=t||this.parentElement.clientHeight,this.width=e,this.height=t,this.canvasRect={x:0,y:0,width:e,height:t},At(this.canvasRect),this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.externalElements.style.width=e+"px",this.externalElements.style.height=t+"px",this.canvasImage.resize(e,t),this.canvasImageBottom.resize(e,t),this.magnifierCanvas.resize(e,t),e=e*this.store.dpiRatio|0,t=t*this.store.dpiRatio|0,this.canvas.width=e,this.canvas.height=t,this.offscreen.width=e,this.offscreen.height=t,this.clientRect=this.externalElements.getBoundingClientRect(),this.canvas.getContext("2d").scale(this.store.dpiRatio,this.store.dpiRatio),this.offscreen.getContext("2d").scale(this.store.dpiRatio,this.store.dpiRatio),this.offscreen.getContext("2d").textBaseline="middle",this.render();for(const e of this.store.data.pens)ht(e)}clearCanvas(){this.activeRect=void 0,this.sizeCPs=void 0,this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height),this.offscreen.getContext("2d").clearRect(0,0,this.offscreen.width,this.offscreen.height),this.canvasImage.clear(),this.canvasImageBottom.clear()}async addPen(e,t,i){if(!(this.beforeAddPens&&1!=await this.beforeAddPens([e])||this.beforeAddPen&&1!=this.beforeAddPen(e)))return this.makePen(e),this.active([e]),this.render(),i&&this.store.emitter.emit("add",[e]),t&&this.pushHistory({type:H.Add,pens:[e]}),e}pushHistory(e){if(this.store.data.locked)return;const{origin:t,scale:i}=this.store.data;e.origin=$(t),e.scale=i,e.type!==H.Update&&e.pens&&e.pens.forEach((e=>{e.calculative&&(e.calculative.layer=this.store.data.pens.findIndex((t=>t.id===e.id)))})),this.store.historyIndex<this.store.histories.length-1&&this.store.histories.splice(this.store.historyIndex+1,this.store.histories.length-this.store.historyIndex-1),e.pens?.forEach((t=>{let i;if(e.initPens)for(const n of e.initPens)n.id===t.id&&(i=n);if(i)for(const e in t)null==i[e]&&(i[e]=void 0)})),this.store.histories.push(e),this.store.historyIndex=this.store.histories.length-1,this.store.emitter.emit("update",{previous:e.initPens,current:e.pens})}undo(){if(this.store.data.locked||null==this.store.historyIndex||this.store.historyIndex<0)return;const e=this.store.histories[this.store.historyIndex--];this.doEditAction(e,!0);let t=e.step;for(;t>1;){const e=this.store.histories[this.store.historyIndex--];this.doEditAction(e,!0),t--}e.type!=H.Add&&e.type!=H.Delete||this.activeHistory()}redo(){if(this.store.data.locked||null==this.store.historyIndex||this.store.historyIndex>this.store.histories.length-2)return;const e=this.store.histories[++this.store.historyIndex];this.doEditAction(e,!1);let t=e.step;for(;t>1;){const e=this.store.histories[++this.store.historyIndex];this.doEditAction(e,!1),t--}e.type!=H.Add&&e.type!=H.Delete||this.activeHistory()}activeHistory(){let e=this.store.histories[this.store.historyIndex];if(e&&e.type===H.Add){const t=[];e.pens.forEach((e=>{t.push(this.store.pens[e.id])})),this.active(t)}}doEditAction(e,t){switch(this.inactive(),this.store.hoverAnchor=void 0,this.store.hover=void 0,e.type){case H.Add:e.pens.forEach((e=>{const t=$(e,!0),i=this.store.data.pens.findIndex((e=>e.id===t.id));i>-1&&(t.onDestroy?.(this.store.pens[t.id]),this.store.data.pens.splice(i,1),this.store.pens[t.id]=void 0,t.calculative||(t.calculative={}),t.calculative.canvas=this,this.store.animates.delete(t),this.store.animateMap.delete(t))})),e.type=H.Delete;break;case H.Update:const i=t?e.initPens:e.pens,n=t?e.pens:e.initPens;i.forEach((t=>{const i=$(t,!0),r=this.store.data.pens.findIndex((e=>e.id===i.id));if(r>-1){i.calculative=this.store.data.pens[r].calculative,this.store.data.pens[r]=i,this.store.pens[i.id]=i;for(const e in i)"object"==typeof i[e]&&"lineDash"!==e||(i.calculative[e]=i[e]);i.calculative.image=void 0;const t=this.getPenRect(i,e.origin,e.scale);if(this.setPenRect(i,t,!1),this.updateLines(i,!0),i.calculative.canvas.parent.isCombine(i)){let e=n.find((e=>e.id===i.id));_.forEach((t=>{i[t]!==e[t]&&this.parent.setValue({id:i.id,[t]:i[t]},{render:!0,doEvent:!1})}))}}}));break;case H.Delete:e.pens.forEach((e=>{const t=$(e,!0);t.calculative||(t.calculative={}),this.store.data.pens.splice(t.calculative?.layer,0,t),this.store.pens[t.id]=t,t.calculative.canvas=this})),e.pens.forEach((t=>{const i=this.store.pens[t.id],n=this.getPenRect(i,e.origin,e.scale);this.setPenRect(i,n,!1),i.calculative.image=void 0,i.calculative.backgroundImage=void 0,i.calculative.strokeImage=void 0,this.loadImage(i)})),e.type=H.Add}e.type===H.Update?this.initImageCanvas([...e.pens,...e.initPens]):this.initImageCanvas(e.pens),this.parent.onSizeUpdate(),this.render(),this.store.emitter.emit(t?"undo":"redo",e)}makePen(e){if(e.id||(e.id=ne()),this.store.data.pens.push(e),this.store.pens[e.id]=e,e.path){!e.pathId&&(e.pathId=ne());const t=this.store.data.paths;!t[e.pathId]&&(t[e.pathId]=e.path),e.path=void 0}null==e.lineWidth&&(e.lineWidth=1);const{fontSize:t,lineHeight:i}=this.store.options;e.fontSize||(e.fontSize=t),e.lineHeight||(e.lineHeight=i),e.calculative={canvas:this,singleton:e.calculative?.singleton},(e.video||e.audio)&&(e.calculative.onended=e=>{this.nextAnimate(e)});for(const t in e)"object"==typeof e[t]&&"lineDash"!==t||(e.calculative[t]=e[t]);e.calculative.image=void 0,e.calculative.backgroundImage=void 0,e.calculative.strokeImage=void 0,!e.anchors&&N.anchors[e.name]&&(e.anchors||(e.anchors=[]),N.anchors[e.name](e)),this.updatePenRect(e),!e.anchors&&e.calculative.worldAnchors&&(e.anchors=e.calculative.worldAnchors.map((t=>Nt(t,e.calculative.worldRect)))),!e.rotate&&(e.rotate=0),this.loadImage(e)}drawline(e){this.drawingLine&&(this[this.drawingLineName]?.(this.store,this.drawingLine,e),this.store.path2dMap.set(this.drawingLine,N.path2dDraws.line(this.drawingLine)),this.patchFlags=!0)}initLineRect(e){if(!e)return;if(!e.calculative.worldAnchors?.length)return void this._del([e]);if(!isFinite(e.x)||!isFinite(e.x))return;if(null==e.x||null==e.y)return;const t=ti(e);e.parentId||Object.assign(e,t);const{fontSize:i,lineHeight:n}=this.store.options;e.fontSize||(e.fontSize=i,e.calculative.fontSize=e.fontSize*this.store.data.scale),e.lineHeight||(e.lineHeight=n,e.calculative.lineHeight=e.lineHeight),Tt(t),e.calculative.worldRect=t,Be(e,t),U(e),ht(e),this.store.path2dMap.set(e,N.path2dDraws[e.name](e)),e.calculative.worldAnchors&&(e.anchors=e.calculative.worldAnchors.map((t=>Nt(t,e.calculative.worldRect))))}drawingPencil(){pn(this.store),this.pencil=!0,this.externalElements.style.cursor="crosshair"}stopPencil(){this.pencil=!1,this.pencilLine=void 0,this.externalElements.style.cursor="default"}async finishDrawline(e){if(!this.drawingLine)return;const t=$e(this.drawingLine);let i=Xe(this.drawingLine);if(i.isTemp&&(this.drawingLine.calculative.worldAnchors.pop(),i=Xe(this.drawingLine)),!e&&(!i.connectTo&&this.drawingLine.calculative.worldAnchors.pop(),$e(this.drawingLine)===this.drawingLine.calculative.activeAnchor))return this.drawingLine=void 0,void this.render();if(t.connectTo&&i.connectTo){if(this.store.options.disableRepeatLine&&this.store.data.pens.find((e=>{if(e.type){const n=$e(e),r=Xe(e);return L(n,t)&&L(r,i)}})))return this.drawingLine=void 0,void this.render()}else if(this.store.options.disableEmptyLine)return this.drawingLine=void 0,void this.render();const n=ti(this.drawingLine);Object.assign(this.drawingLine,n),this.drawingLine.calculative.worldRect=n,this.drawingLine.calculative.activeAnchor=Xe(this.drawingLine),this.store.activeAnchor=this.drawingLine.calculative.activeAnchor,(!this.beforeAddPens||await this.beforeAddPens([this.drawingLine]))&&(!this.beforeAddPen||this.beforeAddPen(this.drawingLine))&&(this.initLineRect(this.drawingLine),this.store.data.pens.push(this.drawingLine),this.store.pens[this.drawingLine.id]=this.drawingLine,this.store.emitter.emit("add",[this.drawingLine]),this.active([this.drawingLine]),this.pushHistory({type:H.Add,pens:$([this.drawingLine],!0)})),this.store.path2dMap.set(this.drawingLine,N.path2dDraws[this.drawingLine.name](this.drawingLine)),this.drawingLine=void 0,this.drawingLineName=void 0,this.render()}async finishPencil(){if(this.pencilLine){const e=vi(this.pencilLine.calculative.worldAnchors,10,0,this.pencilLine.calculative.worldAnchors.length-1);let t=$e(this.pencilLine);e.unshift({id:t.id,penId:t.penId,x:t.x,y:t.y}),t=Xe(this.pencilLine),e.push({id:t.id,penId:t.penId,x:t.x,y:t.y}),this.pencilLine.calculative.worldAnchors=function(e,t=.8,i=!1){if(e.length<3)return e;let n,r,o,s,a,c,l,h,d,u,f,p,v,x,g,y;const m=(e,t,i,n)=>(s=Math.sqrt(e*e+t*t),s>0?(v=e/s,g=t/s):(v=1,g=0),a=Math.sqrt(i*i+n*n),a>0?(x=i/a,y=n/a):(x=1,y=0),Math.acos(v*x+g*y));f=[],p=e.length,n=e[0],h=e[p-1],f.push({...e[0]});for(let h=0;h<p-1;h++){if(r=e[h],o=e[h+1],u=Math.abs(m(r.x-n.x,r.y-n.y,o.x-r.x,o.y-r.y)),s)if(u<3.14*t)if(i&&(s=Math.min(s,a),a=s),c=(v+x)/2,l=(g+y)/2,d=Math.sqrt(c*c+l*l),0===d)f.push({...r});else{c/=d,l/=d;const e={...r};e.prevNextType=k.Bilateral,e.prev={penId:e.penId,x:r.x-c*s*.25,y:r.y-l*s*.25},e.next={penId:e.penId,x:r.x+c*a*.25,y:r.y+l*a*.25},f.push(e)}else f.push({...r});n=r}return f.push({...e[e.length-1]}),f}(e),this.pencilLine.calculative.worldAnchors.length>1&&(this.pencilLine.calculative.pencil=!1,this.store.path2dMap.set(this.pencilLine,N.path2dDraws[this.pencilLine.name](this.pencilLine)),(!this.beforeAddPens||await this.beforeAddPens([this.pencilLine]))&&(!this.beforeAddPen||this.beforeAddPen(this.pencilLine))&&(this.initLineRect(this.pencilLine),this.store.data.pens.push(this.pencilLine),this.store.pens[this.pencilLine.id]=this.pencilLine,this.store.emitter.emit("add",[this.pencilLine]),this.active([this.pencilLine]),this.pushHistory({type:H.Add,pens:$([this.pencilLine],!0)}))),this.pencilLine=void 0,this.render()}}firefoxLoadSvg(e){const t=new Image,i=new XMLHttpRequest;i.open("GET",e.image,!0),i.onload=()=>{const n=(new DOMParser).parseFromString(i.responseText,"text/xml").getElementsByTagName("svg")[0],{width:r,height:o}=e.calculative.worldRect;n.setAttribute("width",`${r}px`),n.setAttribute("height",`${o}px`);const s="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent((new XMLSerializer).serializeToString(n))));t.src=s,t.onload=()=>{e.calculative.img=t,e.calculative.imgNaturalWidth=t.naturalWidth||e.iconWidth,e.calculative.imgNaturalHeight=t.naturalHeight||e.iconHeight,N.htmlElements[e.image]=t,this.imageLoaded()}},i.send()}loadImage(e){if(e.image!==e.calculative.image||!e.calculative.img){if(e.calculative.img=void 0,e.image)if(N.htmlElements[e.image]){const t=N.htmlElements[e.image];e.calculative.img=t,e.calculative.imgNaturalWidth=t.naturalWidth||e.iconWidth,e.calculative.imgNaturalHeight=t.naturalHeight||e.iconHeight,this.imageLoaded()}else if(navigator.userAgent.includes("Firefox")&&e.image.endsWith(".svg"))this.firefoxLoadSvg(e);else{const t=new Image;t.crossOrigin="undefined"===e.crossOrigin?void 0:e.crossOrigin||"anonymous",t.src=e.image,this.store.options.cdn&&!(e.image.startsWith("http")||e.image.startsWith("//")||e.image.startsWith("data:image"))&&(t.src=this.store.options.cdn+e.image),t.onload=()=>{e.calculative.img=t,e.calculative.imgNaturalWidth=t.naturalWidth||e.iconWidth,e.calculative.imgNaturalHeight=t.naturalHeight||e.iconHeight,N.htmlElements[e.image]=t,this.imageLoaded()}}e.calculative.image=e.image}if(e.backgroundImage!==e.calculative.backgroundImage){if(e.calculative.backgroundImg=void 0,e.backgroundImage)if(N.htmlElements[e.backgroundImage]){const t=N.htmlElements[e.backgroundImage];e.calculative.backgroundImg=t}else{const t=new Image;t.crossOrigin="anonymous",t.src=e.backgroundImage,this.store.options.cdn&&!(e.backgroundImage.startsWith("http")||e.backgroundImage.startsWith("//")||e.backgroundImage.startsWith("data:image"))&&(t.src=this.store.options.cdn+e.backgroundImage),t.onload=()=>{e.calculative.backgroundImg=t,N.htmlElements[e.backgroundImage]=t,this.imageLoaded()}}e.calculative.backgroundImage=e.backgroundImage}if(e.strokeImage!==e.calculative.strokeImage){if(e.calculative.strokeImg=void 0,e.strokeImage)if(N.htmlElements[e.strokeImage]){const t=N.htmlElements[e.strokeImage];e.calculative.strokeImg=t}else{const t=new Image;t.crossOrigin="anonymous",t.src=e.strokeImage,this.store.options.cdn&&!(e.strokeImage.startsWith("http")||e.strokeImage.startsWith("//")||e.strokeImage.startsWith("data:image"))&&(t.src=this.store.options.cdn+e.strokeImage),t.onload=()=>{e.calculative.strokeImg=t,N.htmlElements[e.strokeImage]=t,this.imageLoaded()}}e.calculative.strokeImage=e.strokeImage}}imageLoaded(){this.imageTimer&&clearTimeout(this.imageTimer),this.imageTimer=setTimeout((()=>{this.canvasImage.init(),this.canvasImageBottom.init(),this.render()}),100)}setCalculativeByScale(e){const t=this.store.data.scale;e.calculative.lineWidth=e.lineWidth*t,e.calculative.fontSize=e.fontSize*t,e.fontSize<1&&(e.calculative.fontSize=e.fontSize*e.calculative.worldRect.height),e.calculative.iconSize=e.iconSize*t,e.calculative.iconWidth=e.iconWidth*t,e.calculative.iconHeight=e.iconHeight*t,e.calculative.iconLeft=e.iconLeft<1&&e.iconLeft>-1?e.iconLeft:e.iconLeft*t,e.calculative.iconTop=e.iconTop<1&&e.iconTop>-1?e.iconTop:e.iconTop*t,e.calculative.textWidth=e.textWidth<1&&e.textWidth>-1?e.textWidth:e.textWidth*t,e.calculative.textHeight=e.textHeight<1&&e.textHeight>-1?e.textHeight:e.textHeight*t,e.calculative.textLeft=e.textLeft<1&&e.textLeft>-1?e.textLeft:e.textLeft*t,e.calculative.textTop=e.textTop<1&&e.textTop>-1?e.textTop:e.textTop*t,e.type===r.Line&&e.borderWidth&&(e.calculative.borderWidth=e.borderWidth*t)}updatePenRect(e,{worldRectIsReady:t,playingAnimate:i}={}){t?Fe(e):Oe(e),i||this.setCalculativeByScale(e),ze(e),je(this.store.pens,e),U(e),ht(e),N.path2dDraws[e.name]&&this.store.path2dMap.set(e,N.path2dDraws[e.name](e)),e.calculative.patchFlags=!0,this.patchFlags=!0,e.children&&e.children.forEach((e=>{const t=this.store.pens[e];t&&this.updatePenRect(t,{worldRectIsReady:!1})})),e.type&&this.initLineRect(e),e.calculative.gradientTimer&&clearTimeout(e.calculative.gradientTimer),e.calculative.gradientTimer=setTimeout((()=>{e.calculative.lineGradient&&(e.calculative.lineGradient=null),e.calculative.gradient&&(e.calculative.gradient=null),e.calculative.radialGradient&&(e.calculative.radialGradient=null),this.patchFlags=!0,e.calculative.gradientTimer=void 0}),50)}translate(e=0,t=0){this.store.data.x+=e*this.store.data.scale,this.store.data.y+=t*this.store.data.scale,this.store.data.x=Math.round(this.store.data.x),this.store.data.y=Math.round(this.store.data.y),setTimeout((()=>{this.canvasImage.init(),this.canvasImageBottom.init(),this.render()})),this.store.emitter.emit("translate",{x:this.store.data.x,y:this.store.data.y}),this.tooltip.translate(e,t),this.scroll&&this.scroll.isShow&&this.scroll.translate(e,t),this.onMovePens()}onMovePens(){const e=this.parent.map;e&&e.isShow&&e.setView();for(const e of this.store.data.pens)ht(e),e.onMove?.(e),e.isRuleLine&&(e.width?e.height||(e.x=-this.store.data.x):e.y=-this.store.data.y,this.updatePenRect(e))}scale(e,t={x:0,y:0}){const{minScale:i,maxScale:n}=this.store.options;if(!(e>=i&&e<=n))return;this.calibrateMouse(t);const r=e/this.store.data.scale;this.store.data.scale=e,this.store.data.center=t,this.store.clipboard?.pos&&C(this.store.clipboard.pos,r,t),C(this.store.data.origin,r,t),this.store.data.pens.forEach((e=>{if(!e.parentId){if(He(e,r,t),e.onScale&&e.onScale(e),e.isRuleLine){const t=r>1?1:1/r/r,i=e.calculative.worldRect.center;e.width&&e.height||He(e,t,i)}this.updatePenRect(e,{worldRectIsReady:!0}),this.execPenResize(e)}})),this.calcActiveRect(),setTimeout((()=>{this.canvasImage.init(),this.canvasImageBottom.init();const e=this.parent.map;e&&e.isShow&&e.setView(),this.render(),this.store.emitter.emit("scale",this.store.data.scale)}))}rotatePens(e){this.initPens||(this.initPens=$(this.getAllByPens(this.store.active))),this.activeRect.rotate=E(e,this.activeRect.center),this.activeRect.rotate%90<10&&(this.activeRect.rotate-=this.activeRect.rotate%90),this.activeRect.rotate%90>80&&(this.activeRect.rotate+=90-this.activeRect.rotate%90),1===this.store.active.length&&(this.lastRotate=this.store.active[0].rotate||0);const t=this.activeRect.rotate-this.lastRotate;for(const e of this.store.active){if(e.parentId)return;this.rotatePen(e,t,this.activeRect),e.onRotate&&e.onRotate(e),this.updateLines(e)}this.lastRotate=this.activeRect.rotate,this.getSizeCPs(),this.initImageCanvas(this.store.active),this.render(),this.store.emitter.emit("rotatePens",this.store.active),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>{this.timer=void 0,this.pushHistory({type:H.Update,pens:$(this.getAllByPens(this.store.active)),initPens:this.initPens}),this.initPens=void 0}),200)}resizePens(e){if(this.initPens||(this.initPens=$(this.store.active,!0)),!this.initActiveRect)return void(this.initActiveRect=$(this.activeRect));const t=this.mouseDown.x,i=this.mouseDown.y;let n=e.x-t,r=e.y-i;const o=$(this.initActiveRect);if(Lt(o,n,r,this.resizeIndex),Tt(o),!this.store.options.disableDock){this.clearDock();const e=this.customResizeDock||gt;this.dock=e(this.store,o,this.store.active,this.resizeIndex);const{xDock:t,yDock:i}=this.dock;t&&(n+=t.step,this.store.pens[t.penId].calculative.isDock=!0),i&&(r+=i.step,this.store.pens[i.penId].calculative.isDock=!0)}const s=this.activeRect.width,a=this.activeRect.height;let c=n-this.lastOffsetX,l=r-this.lastOffsetY;this.lastOffsetX=n,this.lastOffsetY=r,(e.ctrlKey||1===this.initPens.length&&this.initPens[0].ratio)&&(l=([1,3].includes(this.resizeIndex)?-1:1)*(c*a)/s),Lt(this.activeRect,c,l,this.resizeIndex),Tt(this.activeRect);const h=this.activeRect.width/s,d=this.activeRect.height/a;this.store.active.forEach(((e,t)=>{e.calculative.worldRect.x=this.activeInitPos[t].x*this.activeRect.width+this.activeRect.x,e.calculative.worldRect.y=this.activeInitPos[t].y*this.activeRect.height+this.activeRect.y,e.calculative.worldRect.width*=h,e.calculative.iconWidth&&(e.calculative.iconWidth*=h),e.calculative.worldRect.height*=d,e.calculative.iconHeight&&(e.calculative.iconHeight*=d),At(e.calculative.worldRect),Tt(e.calculative.worldRect),this.updatePenRect(e,{worldRectIsReady:!0}),this.execPenResize(e),this.updateLines(e)})),this.getSizeCPs(),this.initImageCanvas(this.store.active),this.render(),this.store.emitter.emit("resizePens",this.store.active),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>{this.timer=void 0,this.pushHistory({type:H.Update,pens:$(this.store.active,!0),initPens:this.initPens}),this.initPens=void 0}),200)}movePens(e){if(!this.activeRect||this.store.data.locked)return;if(!this.initActiveRect)return void(this.initActiveRect=$(this.activeRect));if(!this.store.options.moveConnectedLine&&!this.canMoveLine&&1===this.store.active.length&&(this.store.active[0].anchors[0]?.connectTo||this.store.active[0].anchors[this.store.active[0].anchors.length-1]?.connectTo))return;if(this.movingPens||(this.initMovingPens(),this.store.active.forEach((e=>{it(e,!1)})),this.store.hover=void 0),!this.mouseDown)return;let t=e.x-this.mouseDown.x,i=e.y-this.mouseDown.y;e.shiftKey&&!e.ctrlKey&&(i=0),e.ctrlKey&&(t=0);const n=$(this.initActiveRect);Rt(n,t,i);const r={x:n.x-this.activeRect.x,y:n.y-this.activeRect.y};if(!this.store.options.disableDock){this.clearDock();const e=this.customMoveDock||vt;this.dock=e(this.store,n,this.movingPens,r);const{xDock:t,yDock:i}=this.dock;let o;t&&(r.x+=t.step,o=this.store.pens[t.penId],o.calculative.isDock=!0),i&&(r.y+=i.step,o=this.store.pens[i.penId],o.calculative.isDock=!0)}this.translatePens(this.movingPens,r.x,r.y,!0)}changeIdsByMoving(e,t){e.id+=mn,e.parentId&&t.find((t=>t.id===e.parentId))&&(e.parentId+=mn),e.children&&(e.children=e.children.map((e=>e+mn))),e.connectedLines&&(e.connectedLines=e.connectedLines.map((e=>(t.find((t=>t.id===e.lineId))&&(e.lineId+=mn),e)))),e.type&&e.calculative.worldAnchors&&(e.calculative.worldAnchors=e.calculative.worldAnchors.map((e=>(e.connectTo&&t.find((t=>t.id===e.connectTo))&&(e.connectTo+=mn),e))))}initMovingPens(){if(!this.store.options.moveConnectedLine&&!this.canMoveLine)for(let e=0;e<this.store.active.length;e++){const t=this.store.active[e];(t.anchors[0]?.connectTo||t.anchors[t.anchors.length-1]?.connectTo)&&(this.store.active.splice(e,1),t.calculative.active=void 0,--e)}this.movingPens=$(this.store.active,!0);const e=this.getAllByPens(this.movingPens),t=$(e,!0);e.forEach((e=>{this.changeIdsByMoving(e,t),this.store.pens[e.id]=e,e.calculative.canvas=this;const i={globalAlpha:.5};0===e.lineWidth&&(i.lineWidth=1),(f.includes(e.name)||this.store.options.domShapes.includes(e.name)||e.image)&&(i.name="rectangle",i.onDestroy=void 0),this.updateValue(e,i),e.calculative.image=void 0}))}moveLineAnchor(e,t){if(!this.activeRect||this.store.data.locked)return;if(this.initPens||(this.initPens=$(this.store.active,!0)),this.store.activeAnchor?.connectTo){const e=this.store.pens[this.store.activeAnchor.connectTo];Ke(e,Ye(e,this.store.activeAnchor.anchorId),this.store.pens[this.store.activeAnchor.penId],this.store.activeAnchor)}let i=this.store.activeAnchor.id,n=this.store.pens[this.store.activeAnchor.penId]?.connectedLines?.filter((e=>e.anchor===i));n&&n.length>0&&n.forEach((e=>{const t=this.store.pens[e.lineId];Ke(this.store.pens[this.store.activeAnchor.penId],this.store.activeAnchor,t,Ye(t,e.lineAnchor))}));const r=this.store.active[0],o=($e(r),Xe(r));if("polyline"!==r.lineName||t.shiftKey){let i=0,n=0;if("line"===r.lineName&&r.calculative.worldAnchors[r.calculative.worldAnchors.length-1]===this.store.activeAnchor)if(t.ctrlKey&&t.shiftKey){let t=$(e);this.getSpecialAngle(t,r.calculative.worldAnchors[r.calculative.worldAnchors.length-2]),i=t.x-this.store.activeAnchor.x,n=t.y-this.store.activeAnchor.y}else if(!t.ctrlKey&&t.shiftKey){let t={x:e.x,y:r.calculative.worldAnchors[r.calculative.worldAnchors.length-2].y};i=t.x-this.store.activeAnchor.x,n=t.y-this.store.activeAnchor.y}else if(t.ctrlKey&&!t.shiftKey){let t={x:r.calculative.worldAnchors[r.calculative.worldAnchors.length-2].x,y:e.y};i=t.x-this.store.activeAnchor.x,n=t.y-this.store.activeAnchor.y}else i=e.x-this.store.activeAnchor.x,n=e.y-this.store.activeAnchor.y;else i=e.x-this.store.activeAnchor.x,n=e.y-this.store.activeAnchor.y;I(this.store.activeAnchor,i,n),this.store.hover&&this.store.hoverAnchor&&this.store.hoverAnchor.penId!==this.store.activeAnchor.penId&&(this.store.hoverAnchor.type===A.Line?(i=e.x-this.store.activeAnchor.x,n=e.y-this.store.activeAnchor.y,M(this.store.activeAnchor,this.store.hoverAnchor,this.store)):(i=this.store.hoverAnchor.x-this.store.activeAnchor.x,n=this.store.hoverAnchor.y-this.store.activeAnchor.y),I(this.store.activeAnchor,i,n),o.prev=void 0,"polyline"!==r.lineName&&this[r.lineName]?.(this.store,r))}else!function(e,t,i){if(!e.calculative.worldAnchors)return;const n=e.calculative.worldAnchors.findIndex((e=>e.id===t.id)),r=$e(e),o=Xe(e);let s=e.calculative.worldAnchors[n-1],a=e.calculative.worldAnchors[n+1];if(null==e.calculative.h&&(r.connectTo&&(fi(e,t,!0)?e.calculative.h=!0:pi(e,t,!0)&&(e.calculative.h=!1)),null==e.calculative.h&&o.connectTo&&(fi(e,t,!1)?e.calculative.h=!0:pi(e,t,!1)&&(e.calculative.h=!1)),null==e.calculative.h&&(s?e.calculative.h=s.y===t.y:a&&(e.calculative.h=a.y===t.y))),e.calculative.h){if(t.x=i.x,r.connectTo&&fi(e,t,!0))return void(a&&a.y!==t.y&&(a.x=t.x));if(o.connectTo&&fi(e,t,!1))return void(s&&s.y!==t.y&&(s.x=t.x));const c=e.anchors[n];let l;for(let t=n-1;t>-1;t--)if(s=e.anchors[t],null==l&&(l=s.y===c.y),!0===l){if(s.y!==c.y)break;e.calculative.worldAnchors[t].y=i.y}else{if(s.x!==c.x)break;e.calculative.worldAnchors[t].x=i.x}l=void 0;for(let t=n+1;t<e.calculative.worldAnchors.length&&(a=e.anchors[t],a);t++)if(null==l&&(l=a.y===c.y),!0===l){if(a.y!==c.y)break;e.calculative.worldAnchors[t].y=i.y}else{if(a.x!==c.x)break;e.calculative.worldAnchors[t].x=i.x}t.y=i.y}else{if(t.y=i.y,r.connectTo&&pi(e,t,!0))return void(a&&a.x!==t.x&&(a.y=t.y));if(o.connectTo&&pi(e,t,!1))return void(s&&s.x!==t.x&&(s.y=t.y));const c=e.anchors[n];let l;for(let t=n-1;t>-1;t--)if(s=e.anchors[t],null==l&&(l=s.x===c.x),!0===l){if(s.x!==c.x)break;e.calculative.worldAnchors[t].x=i.x}else{if(s.y!==c.y)break;e.calculative.worldAnchors[t].y=i.y}l=void 0;for(let t=n+1;t<e.calculative.worldAnchors.length&&(a=e.anchors[t],a);t++)if(null==l&&(l=a.x===c.x),!0===l){if(a.x!==c.x)break;e.calculative.worldAnchors[t].x=i.x}else{if(a.y!==c.y)break;e.calculative.worldAnchors[t].y=i.y}t.x=i.x}}(r,this.store.activeAnchor,e);this.patchFlagsLines.add(r),this.store.path2dMap.set(r,N.path2dDraws[r.name](r)),this.render(),this.store.active[0].calculative&&(this.store.active[0].calculative.gradientAnimatePath=void 0),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>{this.timer=void 0,this.pushHistory({type:H.Update,pens:$(this.store.active,!0),initPens:this.initPens}),this.initPens=void 0}),500)}moveLineAnchorPrev(e){if(!this.activeRect||this.store.data.locked||!this.store.activeAnchor)return;if(this.initPens||(this.initPens=$(this.store.active,!0)),this.store.activeAnchor.prev.x=e.x,this.store.activeAnchor.prev.y=e.y,this.store.activeAnchor.next)if(this.store.activeAnchor.prevNextType){if(this.store.activeAnchor.prevNextType===k.Bilateral&&this.prevAnchor){const t=E(e,this.store.activeAnchor),i=E(this.prevAnchor,this.store.activeAnchor);this.store.activeAnchor.next.x=this.nextAnchor.x,this.store.activeAnchor.next.y=this.nextAnchor.y,S(this.store.activeAnchor.next,t-i,this.store.activeAnchor)}}else this.store.activeAnchor.next.x=e.x,this.store.activeAnchor.next.y=e.y,S(this.store.activeAnchor.next,180,this.store.activeAnchor);const t=this.store.active[0];this.patchFlagsLines.add(t),this.store.path2dMap.set(t,N.path2dDraws[t.name](t)),this.render(),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>{this.timer=void 0,this.pushHistory({type:H.Update,pens:$(this.store.active,!0),initPens:this.initPens}),this.initPens=void 0}),200)}moveLineAnchorNext(e){if(!this.activeRect||this.store.data.locked||!this.store.activeAnchor)return;if(this.initPens||(this.initPens=$(this.store.active,!0)),this.store.activeAnchor.next.x=e.x,this.store.activeAnchor.next.y=e.y,this.store.activeAnchor.prev)if(this.store.activeAnchor.prevNextType){if(this.store.activeAnchor.prevNextType===k.Bilateral&&this.nextAnchor){const t=E(e,this.store.activeAnchor),i=E(this.nextAnchor,this.store.activeAnchor);this.store.activeAnchor.prev.x=this.prevAnchor.x,this.store.activeAnchor.prev.y=this.prevAnchor.y,S(this.store.activeAnchor.prev,t-i,this.store.activeAnchor)}}else this.store.activeAnchor.prev.x=e.x,this.store.activeAnchor.prev.y=e.y,S(this.store.activeAnchor.prev,180,this.store.activeAnchor);const t=this.store.active[0];this.patchFlagsLines.add(t),this.store.path2dMap.set(t,N.path2dDraws[t.name](t)),this.render(),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>{this.timer=void 0,this.pushHistory({type:H.Update,pens:$(this.store.active,!0),initPens:this.initPens}),this.initPens=void 0}),200)}async setAnchor(e){const t=[$(this.store.hover,!0)],i=this.store.hover;if(this.store.hoverAnchor){if(this.beforeRemoveAnchor&&!await this.beforeRemoveAnchor(i,this.store.hoverAnchor))return;i.type===r.Line&&i.calculative.worldAnchors?.length<=2?this.delete([i]):(function(e,t){if(!e||!e.calculative.worldAnchors)return;let i=e.calculative.worldAnchors.findIndex((e=>e.id===t.id));i>-1&&e.calculative.worldAnchors.splice(i,1),i=e.anchors.findIndex((e=>e.id===t.id)),i>-1&&e.anchors.splice(i,1)}(i,this.store.hoverAnchor),i.type===r.Line&&this.initLineRect(i)),this.store.hoverAnchor=void 0,this.store.activeAnchor=void 0,this.externalElements.style.cursor="default"}else if(i){if(this.beforeAddAnchor&&!await this.beforeAddAnchor(i,this.store.pointAt))return;if(i.type===r.Line){this.store.activeAnchor=function(e,t,i){e.anchors||(e.anchors=[]),e.calculative.worldAnchors||(e.calculative.worldAnchors=[]);const n=function(e,t,i){let n=e.calculative.worldAnchors[i],r=e.calculative.worldAnchors[i+1];const o=t.step;let s;if(n.next&&r.prev){const t=n,i=n.next,a=r.prev,c=r,l=Gt(t,i,o),h=Gt(i,a,o),d=Gt(a,c,o),u=Gt(l,h,o),f=Gt(h,d,o);s=Gt(u,f,o),u.penId=e.id,s.prev=u,f.penId=e.id,s.next=f,n.next.x=l.x,n.next.y=l.y,r.prev.x=d.x,r.prev.y=d.y}else if(n.next||r.prev){const i=n,a=n.next||r.prev,c=r,l=Gt(i,a,o),h=Gt(a,c,o);s=t,l.penId=e.id,h.penId=e.id,s.prev=l,s.next=h,n.next=void 0,r.prev=void 0}else s=t;return s.penId=e.id,s.id=ne(),s.prevNextType=k.Bilateral,s}(e,t,i);return e.calculative.worldAnchors.splice(i+1,0,n),e.anchors.splice(i+1,0,Nt(n,e.calculative.worldRect)),e.calculative.activeAnchor=n,n}(i,this.store.pointAt,this.store.pointAtIndex),this.initLineRect(i);const t={x:e.x,y:e.y};this.getHover(t)}else{const t={id:ne(),x:e.x,y:e.y};this.store.activeAnchor=function(e,t){e.anchors||(e.anchors=[]),e.calculative.worldAnchors||(e.calculative.worldAnchors=[]);const i={id:t.id,penId:e.id,x:t.x,y:t.y};if(e.calculative.worldAnchors.push(i),e.calculative.worldRect){e.rotate%360&&S(t,-e.rotate,e.calculative.worldRect.center);const i={id:t.id,penId:e.id,x:(t.x-e.calculative.worldRect.x)/e.calculative.worldRect.width,y:(t.y-e.calculative.worldRect.y)/e.calculative.worldRect.height};e.anchors.push(i)}return i}(i,t)}}this.hotkeyType=x.None,this.render(),i&&this.pushHistory({type:H.Update,pens:[$(i,!0)],initPens:t})}checkDisconnect(e,t){if(e.id.indexOf(mn)>0){const t=e.id;e=this.store.pens[t.replace(mn,"")]}e.anchors.forEach((i=>{if(i.connectTo&&!t.find((e=>e.id===i.connectTo||e.id===i.connectTo+mn))){const t=this.store.pens[i.connectTo];if(!t||t.type)return;Ke(t,Ye(t,i.anchorId),e,i)}}))}translatePens(e=this.store.active,t,i,n){if(!e||!e.length)return;if(e.some((e=>{if(e.locked>=o.DisableMove)return!0})))return;const s=!n&&$(e,!0);this.activeRect&&Rt(this.activeRect,t,i);const a=this.getAllByPens(e);e.forEach((e=>{if(!(e.locked>=o.DisableMove)){if(e.type===r.Line){if(!this.store.options.moveConnectedLine&&!this.canMoveLine)return;!function(e,t,i){e.x+=t,e.y+=i,e.anchors&&e.anchors.forEach((e=>{I(e,t,i)})),e.calculative.worldAnchors&&e.calculative.worldAnchors.forEach((e=>{I(e,t,i)}))}(e,t,i),this.checkDisconnect(e,a),this.store.path2dMap.set(e,N.path2dDraws[e.name](e)),n||(this.initLineRect(e),e.connectedLines?.forEach((e=>{const t=this.store.pens[e.lineId];this.initLineRect(t)})))}else Rt(e.calculative.worldRect,t,i),this.updatePenRect(e,{worldRectIsReady:!0}),e.calculative.x=e.x,e.calculative.y=e.y,e.calculative.initRect&&(e.calculative.initRect.x=e.calculative.x,e.calculative.initRect.y=e.calculative.y,e.calculative.initRect.ex=e.calculative.x+e.calculative.width,e.calculative.initRect.ey=e.calculative.y+e.calculative.height);this.updateLines(e),e.onMove?.(e)}})),this.activeRect&&this.getSizeCPs(),this.render(),this.tooltip.translate(t,i),n||(this.pushHistory({type:H.Update,pens:$(e,!0),initPens:s}),this.initImageCanvas(e),this.store.emitter.emit("translatePens",e)),this.store.emitter.emit("translatingPens",e)}calcAutoAnchor(e,t,i,n){const r=$e(e),o=Xe(e),s=We(i,t===r?o:r);t.x=s.x,t.y=s.y,t.prev=void 0,t.next=void 0,n?n.anchor=s.id:qe(i,s,e,t),this[e.lineName]&&this[e.lineName](this.store,e),this.store.path2dMap.set(e,N.path2dDraws.line(e)),this.initLineRect(e)}restoreNodeAnimate(e){if(e.calculative.initRect){if(e.keepAnimateState)for(const t in e)void 0!==e.calculative[t]&&("x"===t||"y"===t||"width"===t||"height"===t||"initRect"===t||"object"==typeof e[t]&&"lineDash"!==t||(e[t]="fontSize"===t||"lineWidth"===t?e.calculative[t]/e.calculative.canvas.store.data.scale:e.calculative[t]));else{const t=e.calculative.initRect.rotate-e.calculative.rotate;for(const t in e)"x"===t||"y"===t||"width"===t||"height"===t||"initRect"===t||"rotate"===t||"object"==typeof e[t]&&"lineDash"!==t||(e.calculative[t]=e[t]);e.children?.length?t&&st(e,t,e.calculative.worldRect):e.calculative.rotate=e.rotate;const i=$(this.store.animateMap.get(e));i&&(i.id=e.id,this.parent.setValue(i,{doEvent:!1,render:!0,history:!1})),e.calculative.worldRect=e.calculative.initRect}this.updatePenRect(e,{worldRectIsReady:!0}),e.calculative.text!==e.text&&(e.calculative.text=e.text,V(e)),e.calculative.initRect=void 0}}updateLines(e,t){e.children?.forEach((e=>{const i=this.store.pens[e];i&&this.updateLines(i,t)})),e.connectedLines&&e.connectedLines.forEach((i=>{const n=this.store.pens[i.lineId];if(!n||n.calculative.active)return;const r=Ye(n,i.lineAnchor);if(!r)return;if(n.autoFrom){const t=$e(n);t.id===r.id&&this.calcAutoAnchor(n,t,e,i)}if(n.autoTo){const t=Xe(n);t.id===r.id&&this.calcAutoAnchor(n,t,e,i)}const o=Ye(e,i.anchor);if(!o)return;let s=e.rotate;e.flipX&&(s*=-1),e.flipY&&(s*=-1);let a=r.distance*this.store.data.scale*Math.cos((s+o.rotate)/180*Math.PI)||0,c=r.distance*this.store.data.scale*Math.sin((s+o.rotate)/180*Math.PI)||0;if(e.flipX&&(a=-a),e.flipY&&(c=-c),I(r,o.x-r.x+a,o.y-r.y+c),this.store.options.autoPolyline&&!this.autoPolylineFlag&&!1!==n.autoPolyline&&"polyline"===n.lineName){let e=$e(n),t=Xe(n),i=!1;e.id===r.id?(e=r,i=!0):t.id===r.id&&(t=r,i=!0),i&&(n.calculative.worldAnchors=[e,t],n.calculative.activeAnchor=e,this.polyline(this.store,n,t),this.initLineRect(n))}this.store.path2dMap.set(n,N.path2dDraws[n.name](n)),this.patchFlagsLines.add(n),t&&ai(n)}))}calcActiveRect(){const e=this.store.active.filter((e=>(!e.locked||e.locked<o.DisableMove)&&0!=e.visible));e.length&&(1===e.length?(this.activeRect=$(e[0].calculative.worldRect),this.activeRect.rotate=e[0].calculative.rotate||0,Tt(this.activeRect)):(this.activeRect=St(e),this.activeRect.rotate=0),this.lastRotate=0,this.getSizeCPs())}rotatePen(e,t,i){e.type?(e.calculative.worldAnchors.forEach((e=>{S(e,t,i.center)})),this.initLineRect(e),Fe(e)):(e.calculative.rotate?e.calculative.rotate+=t:e.calculative.rotate=t,S(e.calculative.worldRect.center,t,i.center),e.parentId?(e.calculative.worldRect.x=e.calculative.worldRect.center.x-e.calculative.worldRect.width/2,e.calculative.worldRect.y=e.calculative.worldRect.center.y-e.calculative.worldRect.height/2,e.x=(e.calculative.worldRect.x-i.x)/i.width,e.y=(e.calculative.worldRect.y-i.y)/i.height):(e.x=e.calculative.worldRect.center.x-e.width/2,e.y=e.calculative.worldRect.center.y-e.height/2),e.rotate=e.calculative.rotate,this.updatePenRect(e),e.children&&e.children.forEach((i=>{const n=this.store.pens[i];this.rotatePen(n,t,e.calculative.worldRect)})))}nextAnimate(e){if(!e)return;let t;this.store.emitter.emit("animateEnd",e),e.nextAnimate&&(t=this.store.data.pens.filter((t=>t.id===e.nextAnimate||t.tags&&t.tags.indexOf(e.nextAnimate)>-1))),t&&(t.forEach((e=>{if(e.calculative.pause){const t=Date.now()-e.calculative.pause;e.calculative.pause=void 0,e.calculative.frameStart+=t,e.calculative.frameEnd+=t}else"video"===e.name?(e.calculative.media.currentTime=0,e.calculative.media?.play(),e.onStartVideo?.(e)):(e.type||e.frames?.length)&&(e.type||this.store.animateMap.set(e,this.getFrameProps(e)),this.store.animates.add(e))})),this.animate())}getFrameProps(e){let t={};return e.frames&&e.frames.forEach((i=>{for(let n in i)["duration","x","y","width","height","rotate"].includes(n)||t[n]||(t[n]=e[n])})),t}animate(){this.animateRendering||requestAnimationFrame((()=>{const e=Date.now();if(e-this.lastAnimateRender<this.store.options.animateInterval)return void(this.store.animates.size>0&&this.animate());this.lastAnimateRender=e,this.animateRendering=!0;const t=[];let i=!1;for(const n of this.store.animates)if(!n.calculative.pause){if(!n.calculative.active||n.type||this.movingPens||(i=!0),n.type){if(!et(n)){if(n.keepAnimateState){for(const e in n)void 0!==n.calculative[e]&&("object"==typeof n[e]&&"lineDash"!==e||(n[e]="lineWidth"===e?n.calculative[e]/n.calculative.canvas.store.data.scale:n.calculative[e]));Fe(n)}else for(const e in n)"object"==typeof n[e]&&"lineDash"!==e||(n.calculative[e]="lineWidth"===e?n[e]*n.calculative.canvas.store.data.scale:n[e]);t.push(n),this.nextAnimate(n)}}else Ge(n,e)?n.calculative.patchFlags&&(Tt(n.calculative.worldRect),this.updatePenRect(n,{worldRectIsReady:!0,playingAnimate:!0})):(requestAnimationFrame((()=>{this.restoreNodeAnimate(n)})),t.push(n),this.nextAnimate(n)),this.updateLines(n,!0);this.patchFlags=!0}i&&this.calcActiveRect(),t.forEach((e=>{this.store.animates.delete(e)})),this.render(!1),this.animateRendering=!1,this.animate()}))}get clipboardName(){return"meta2d-clipboard"}async copy(e,t=!0){const i=ne(),{origin:n,scale:r}=this.store.data;this.store.clipboard=void 0,localStorage.removeItem(this.clipboardName),sessionStorage.setItem("page",i);let o=this.getAllByPens($(e||this.store.active,!0));o.forEach((e=>{e.copyIndex=this.store.data.pens.findIndex((t=>t.id===e.id))})),o.sort(((e,t)=>e.copyIndex-t.copyIndex)),o.forEach((e=>{delete e.copyIndex}));const s={meta2d:!0,pens:o,origin:$(n),scale:r,page:i,initRect:$(this.activeRect),offset:10};if(!navigator.clipboard||this.store.options.disableClipboard||navigator.userAgent.includes("Firefox"))localStorage.setItem(this.clipboardName,JSON.stringify(s));else try{await navigator.clipboard.writeText(JSON.stringify(s))}catch{localStorage.setItem(this.clipboardName,JSON.stringify(s))}t&&this.store.emitter.emit("copy",s.pens)}cut(e){this.copy(e,!1),this.delete(e),this.store.emitter.emit("cut",e)}async paste(){let e,t,i,n;if(!navigator.clipboard||this.store.options.disableClipboard||navigator.userAgent.includes("Firefox"))e=localStorage.getItem(this.clipboardName);else try{e=await(navigator.clipboard?.readText())}catch{e=localStorage.getItem(this.clipboardName)}if(!e)return;try{t=JSON.parse(e)}catch(e){return void console.warn("剪切板数据不是json",e.message)}if(!t||!t.meta2d)return;if(this.beforeAddPens&&1!=await this.beforeAddPens(t.pens))return;this.store.clipboard&&(i=this.store.clipboard.offset+10,n=this.store.clipboard.pos),this.store.clipboard=$(t),sessionStorage.getItem("page")!==t.page?(this.store.clipboard.pos={x:this.mousePos.x,y:this.mousePos.y},this.store.clipboard.offset=0):this.pasteOffset?(i&&(this.store.clipboard.offset=i),n&&(this.store.clipboard.pos=n)):(this.store.clipboard.offset=0,this.pasteOffset=!0);const r=this.store.clipboard.pens.filter((e=>!e.parentId));for(const e of r)this.pastePen(e,void 0);sessionStorage.setItem("page",t.page),this.active(r),this.pushHistory({type:H.Add,pens:this.store.clipboard.pens}),this.render(),this.store.emitter.emit("add",this.store.clipboard.pens),this.store.emitter.emit("paste",this.store.clipboard.pens)}getAllByPens(e){const t=[];for(const i of e)t.push(...$(ae(i,this.store),!0));return t.concat(e)}changeLineAnchors(e,t,i){if(Array.isArray(t.connectedLines))for(let n=0;n<t.connectedLines.length;n++){const{lineId:r}=t.connectedLines[n],o=i.find((e=>e.id===r));if(o){const i=o.anchors[0],n=o.anchors[o.anchors.length-1];i.connectTo===e&&(i.connectTo=t.id),n.connectTo===e&&(n.connectTo=t.id)}else t.connectedLines.splice(n,1),n--}}changeNodeConnectedLine(e,t,i){const n=[t.anchors[0],t.anchors[t.anchors.length-1]];for(const r of n){const n=r.connectTo;if(n){const o=i.find((e=>e.id===n));o?o.connectedLines?.forEach((i=>{i.lineId===e&&(i.lineId=t.id,i.lineAnchor=r.id)})):(r.connectTo=void 0,r.prev&&(r.prev.connectTo=void 0),r.next&&(r.next.connectTo=void 0))}}}async delete(e=this.store.active,t=!1,i=!0){if(!e||!e.length)return;if(this.beforeRemovePens&&1!=await this.beforeRemovePens(e))return;if(t||(e=e.filter((e=>!e.locked))),!e||!e.length)return;const n=[];this._del(e,n),this.initImageCanvas(n),this.inactive(),this.clearHover(),this.render(),i&&this.pushHistory({type:H.Delete,pens:n}),this.store.emitter.emit("delete",e)}_del(e,t){e&&e.forEach((e=>{if(e.parentId){if(this.getLockedParent(e))return void console.warn("父节点锁定");{const i=se(e),n=i.children.indexOf(e.id);i.children.splice(n,1),t&&this.getDelPens(e,t),this.delForce(e)}}else{if(e.locked)return;t&&this.getDelPens(e,t),this.delForce(e)}}))}getDelPens(e,t){if(e){if(this.store.data.pens.findIndex((t=>t.id===e.id))>-1){const i=this.store.pens[e.id];i.calculative.active=void 0,t.push(i)}e.children&&e.children.forEach((e=>{this.getDelPens(this.store.pens[e],t)}))}}getLockedParent(e){if(!e.parentId)return!1;const t=se(e);if(t.locked)return t;this.getLockedParent(t)}delForce(e){if(!e)return;const t=this.store.data.pens.findIndex((t=>t.id===e.id));t>-1&&(this.delConnectedLines(this.store.data.pens[t]),this.store.data.pens.splice(t,1),this.store.pens[e.id]=void 0,delete this.store.pens[e.id]),this.store.animates.delete(e),this.store.animateMap.delete(e),e.children&&e.children.forEach((e=>{this.delForce(this.store.pens[e])})),e.onDestroy?.(e)}delConnectedLines(e){if(e.connectedLines)for(let t=0;t<e.connectedLines.length;t++){const{lineId:i,lineAnchor:n}=e.connectedLines[t],r=this.store.pens[i];if(r){let t=r.anchors.find((e=>e.id===n));t?.connectTo===e.id&&(t.connectTo=void 0,t.anchorId=void 0,t.prev&&(t.prev.connectTo=void 0),t.next&&(t.next.connectTo=void 0)),t=Ye(r,n),t&&(t.connectTo=void 0,t.anchorId=void 0,t.prev&&(t.prev.connectTo=void 0),t.next&&(t.next.connectTo=void 0))}}e.type&&e.calculative.worldAnchors?.forEach(((t,i)=>{if(!t.connectTo)return;const n=this.store.pens[t.connectTo];n&&n.calculative.worldAnchors?.forEach((i=>{Ke(n,i,e,t)}))}))}convertSpecialCharacter(e){var t={lt:"<",gt:">",nbsp:" ",amp:"&",quot:'"'};return e.replace(/&(lt|gt|nbsp|amp|quot);/gi,(function(e,i){return t[i]}))}createInput(){let e;this.inputParent.classList.add("meta2d-input"),this.inputRight.classList.add("right"),this.inputDiv.classList.add("input-div"),this.inputParent.appendChild(this.inputDiv),this.inputParent.appendChild(this.inputRight),this.dropdown.onmouseleave=()=>{this.store.hover=null},this.inputParent.appendChild(this.dropdown),this.externalElements.appendChild(this.inputParent),this.inputParent.onmousedown=this.stopPropagation,this.inputDiv.onmousedown=this.stopPropagation,this.inputDiv.contentEditable="false",this.inputRight.onmousedown=this.stopPropagation,this.dropdown.onmousedown=this.stopPropagation,this.inputRight.style.transform="rotate(135deg)";for(let t=0;t<document.styleSheets.length;t++)"le5le.com"===document.styleSheets[t].title&&(e=document.styleSheets[t]);if(!e){const t=document.createElement("style");t.title="le5le.com",document.head.appendChild(t),e=t.sheet,e.insertRule(".meta2d-input{display:none;position:absolute;outline:none;align-items: center;}"),e.insertRule(".meta2d-input textarea{resize:none;border:none;outline:none;background:transparent;flex-grow:1;height:100%;left:0;top:0}"),e.insertRule(".meta2d-input .right{width:10px;height:10px;flex-shrink:0;border-top: 1px solid;border-right: 1px solid;margin-right: 5px;transition: all .3s cubic-bezier(.645,.045,.355,1);position:absolute;right:1px;}"),e.insertRule(".meta2d-input ul{position:absolute;top:100%;left:-5px;width:calc(100% + 10px);min-height:30px;border-radius: 2px;box-shadow: 0 2px 8px #00000026;list-style-type: none;background-color: #fff;padding: 4px 0;max-height: 105px;overflow-y: auto;}"),e.insertRule(".meta2d-input ul li{padding: 5px 12px;line-height: 22px;white-space: nowrap;cursor: pointer;}"),e.insertRule(".meta2d-input ul li:hover{background: #eeeeee;}"),e.insertRule(".input-div::-webkit-scrollbar {display:none}"),e.insertRule(".meta2d-input .input-div{resize:none;border:none;outline:none;background:transparent;flex-grow:1;height:100%;width: 100%;left:0;top:0;display:flex;text-align: center;justify-content: center;flex-direction: column;}"),e.insertRule(".input-div div{}")}this.inputDiv.onclick=e=>{e.stopPropagation();const t=this.store.pens[this.inputDiv.dataset.penId];"block"===this.dropdown.style.display?(this.dropdown.style.display="none",this.inputRight.style.transform="rotate(135deg)"):t?.dropdownList&&this.store.data.locked&&(this.dropdown.style.display="block",this.inputRight.style.transform="rotate(315deg)"),this.store.emitter.emit("clickInput",t)},this.inputDiv.onkeyup=e=>{this.setDropdownList(!0);const t=this.store.pens[this.inputDiv.dataset.penId];this.store.emitter.emit("input",{pen:t,text:e.key}),e.stopPropagation()},this.inputDiv.onkeydown=e=>{e.stopPropagation()},this.inputDiv.onmousedown=this.stopPropagation,this.inputDiv.onwheel=e=>{e.stopPropagation()},this.inputDiv.onpaste=e=>{e.preventDefault();let t="";e.clipboardData&&e.clipboardData.getData&&(t=e.clipboardData.getData("text/plain")),document.execCommand("insertHTML",!1,t)}}clearDropdownList(){if(this.dropdown.hasChildNodes())for(let e=0;e<this.dropdown.childNodes.length;e++)this.dropdown.childNodes[e].remove(),--e}dropdownAppendOption(e,t){const i=document.createElement("li");i.onwheel=this.stopPropagation,i.innerText=e,i.style.overflow="hidden",i.style.textOverflow="ellipsis",i.title=e,i.style.zoom=this.store.data.scale,i.onmousedown=this.stopPropagation,i.dataset.i=t+"",i.onclick=this.selectDropdown,this.dropdown.appendChild(i)}find(e){return this.store.data.pens.filter((t=>t.id==e||t.tags&&t.tags.indexOf(e)>-1))}findOne(e){return this.store.data.pens.find((t=>t.id==e||t.tags&&t.tags.indexOf(e)>-1))}changePenId(e,t){if(e===t)return;const i=this.store.pens[e];if(i&&!this.store.pens[t]){if(i.id=t,this.store.pens[t]=this.store.pens[e],i.onChangeId?.(i,e,t),delete this.store.pens[e],i.parentId){const n=this.store.pens[i.parentId],r=n.children?.findIndex((t=>t===e));-1!==r&&n.children?.splice(r,1,t)}i.children?.forEach((e=>{this.store.pens[e].parentId=t})),i.type===r.Line?this.changeNodeConnectedLine(e,i,this.store.data.pens):(this.changeLineAnchors(e,i,this.store.data.pens),i.connectedLines?.forEach((({lineId:e})=>{ze(this.store.pens[e])})))}}updateValue(e,t){const i=this.getPenRect(e),n=e.name;Object.assign(e,t);const r=n!==e.name;t.newId&&this.changePenId(e.id,t.newId);let o,s=!1,a=!1,u=!1,f=!1,p=!1,v=!1,x=!1;for(const i in t)"rotate"===i&&(o=e.calculative.rotate||0),"object"==typeof e[i]&&"lineDash"!==i||(e.calculative[i]=t[i]),c.includes(i)&&(a=!0),["name","borderRadius"].includes(i)&&(s=!0),l.includes(i)&&(p=!0),h.includes(i)&&(u=!0),d.includes(i)&&(f=!0),"isBottom"===i&&(v=!0),"image"===i&&(x=!0),-1!==i.indexOf(".")&&(delete e[i],gn(e,i,t[i]));if(this.setCalculativeByScale(e),r&&(e.onDestroy?.(e),function(e){e.onAdd=void 0,e.onValue=void 0,e.onBeforeValue=void 0,e.onDestroy=void 0,e.onMove=void 0,e.onResize=void 0,e.onRotate=void 0,e.onClick=void 0,e.onMouseEnter=void 0,e.onMouseLeave=void 0,e.onMouseDown=void 0,e.onMouseMove=void 0,e.onMouseUp=void 0,e.onShowInput=void 0,e.onInput=void 0,e.onChangeId=void 0,e.onBinds=void 0,e.onStartVideo=void 0,e.onPauseVideo=void 0,e.onStopVideo=void 0,e.onRenderPenRaw=void 0,e.onKeyDown=void 0}(e)),p){const n={x:t.x??i.x,y:t.y??i.y,width:t.width??i.width,height:t.height??i.height};this.setPenRect(e,n,!1),this.updateLines(e,!0)}else u?this.updatePenRect(e):(a&&U(e),f&&je(this.store.pens,e),s&&N.path2dDraws[e.name]&&this.store.path2dMap.set(e,N.path2dDraws[e.name](e)));if(void 0!==o){const t=e.calculative.rotate;e.calculative.rotate=o,this.rotatePen(e,t-o,e.calculative.worldRect)}(t.image||t.backgroundImage||t.strokeImage)&&(e.calculative.image=void 0,e.calculative.backgroundImage=void 0,e.calculative.strokeImage=void 0,this.loadImage(e)),t.lineGradientColors&&(e.calculative.lineGradient=void 0,e.calculative.gradientColorStop=void 0),t.gradientColors&&(e.calculative.gradient=void 0,e.calculative.radialGradient=void 0),t.gradientRadius&&(e.calculative.gradient=void 0,e.calculative.radialGradient=void 0),t.animateLineWidth&&(e.calculative.gradientAnimatePath=void 0),t.gradientSmooth&&(e.calculative.gradientAnimatePath=void 0),v?(this.canvasImage.init(),this.canvasImageBottom.init()):x?e.isBottom?this.canvasImageBottom.init():this.canvasImage.init():this.initImageCanvas([e])}execPenResize(e){e.onResize?.(e),e.children?.forEach((e=>{const t=this.store.pens[e];t&&this.execPenResize(t)}))}setPenRect(e,t,i=!0){if(e.parentId)Object.assign(e,t);else{const{origin:i,scale:n}=this.store.data;e.x=i.x+t.x*n,e.y=i.y+t.y*n,e.width=t.width*n,e.height=t.height*n}this.updatePenRect(e),this.execPenResize(e),i&&this.render()}getPenRect(e,t=this.store.data.origin,i=this.store.data.scale){if(e)return e.parentId?{x:e.x,y:e.y,width:e.width,height:e.height}:{x:(e.x-t.x)/i,y:(e.y-t.y)/i,width:e.width/i,height:e.height/i}}toPng(e=2,t,i=!1){const n=St(this.store.data.pens);if(!isFinite(n.width))throw new Error("can not to png, because width is not finite");const r=$(n),o=this.store.data,s=i&&!o.background&&this.store.bkImg;let a=!1,c=!1;if(s){if(n.x+=o.x,n.y+=o.y,At(n),Et(n,this.canvasRect,!0))Object.assign(n,this.canvasRect);else{const e=Ct([...Pt(n),...Pt(this.canvasRect)]);Object.assign(n,e)}a=0===n.x,c=0===n.y}const l=re(e);n.x-=l[3],n.y-=l[0],n.width+=l[3]+l[1],n.height+=l[0]+l[2],At(n);const h=document.createElement("canvas");if(h.width=n.width,h.height=n.height,h.width>32767||h.height>32767||!navigator.userAgent.includes("Firefox")&&h.height*h.width>268435456||navigator.userAgent.includes("Firefox")&&h.height*h.width>472907776)throw new Error("can not to png, because the size exceeds the browser limit");const d=h.getContext("2d");if(d.textBaseline="middle",s){const e=n.x<0?-n.x:0,t=n.y<0?-n.y:0;d.drawImage(this.store.bkImg,e,t,this.canvasRect.width,this.canvasRect.height)}const u=this.store.data.background||this.store.options.background;u&&(d.save(),d.fillStyle=u,d.fillRect(0,0,h.width,h.height),d.restore()),s?d.translate(a?o.x:-r.x,c?o.y:-r.y):d.translate(-n.x,-n.y);for(const e of this.store.data.pens){if(!lt(e,this.store)||0==e.visible)continue;const{active:t}=e.calculative;e.calculative.active=!1,e.calculative.img?Ie(d,e):Ce(d,e),e.calculative.active=t}if(!t)return h.toDataURL();h.toBlob(t)}toggleAnchorMode(){if(this.hotkeyType)this.hotkeyType===x.AddAnchor&&(this.hotkeyType=x.None,this.store.hoverAnchor?this.externalElements.style.cursor="vertical-text":this.store.hover&&(this.externalElements.style.cursor="move"));else{if(this.store.options.disableAnchor||this.store.hover?.disableAnchor)return;this.hotkeyType=x.AddAnchor,this.store.hover&&(this.externalElements.style.cursor="pointer")}this.patchFlags=!0}addAnchorHand(){if(this.store.activeAnchor&&this.store.active&&1===this.store.active.length&&this.store.active[0].type){const e=[$(this.store.active[0],!0)];this.store.activeAnchor.prev?this.store.activeAnchor.next||(this.store.activeAnchor.next={...this.store.activeAnchor.prev},S(this.store.activeAnchor.next,180,this.store.activeAnchor),this.initLineRect(this.store.active[0]),this.patchFlags=!0):(this.store.activeAnchor.next||(this.store.activeAnchor.next={penId:this.store.activeAnchor.penId,x:this.store.activeAnchor.x+50,y:this.store.activeAnchor.y}),this.store.activeAnchor.prev={...this.store.activeAnchor.next},S(this.store.activeAnchor.prev,180,this.store.activeAnchor),this.initLineRect(this.store.active[0]),this.patchFlags=!0),this.pushHistory({type:H.Update,pens:[$(this.store.active[0],!0)],initPens:e})}}removeAnchorHand(){if(this.store.activeAnchor&&this.store.active&&1===this.store.active.length&&this.store.active[0].type){const e=[$(this.store.active[0],!0)];this.hoverType===v.LineAnchorPrev?(this.store.activeAnchor.prev=void 0,this.initLineRect(this.store.active[0]),this.patchFlags=!0):this.hoverType===v.LineAnchorNext?(this.store.activeAnchor.next=void 0,this.initLineRect(this.store.active[0]),this.patchFlags=!0):(this.store.activeAnchor.prev=void 0,this.store.activeAnchor.next=void 0,this.initLineRect(this.store.active[0]),this.patchFlags=!0),this.pushHistory({type:H.Update,pens:[$(this.store.active[0])],initPens:e})}}toggleAnchorHand(){1===this.store.active.length&&this.store.active[0].type&&this.store.activeAnchor&&(this.store.activeAnchor.prevNextType||(this.store.activeAnchor.prevNextType=k.Mirror),this.store.activeAnchor.prevNextType=(this.store.activeAnchor.prevNextType+1)%3)}gotoView(e,t){const i=St(this.store.data.pens);if(!isFinite(i.width))throw new Error("can not move view, because width is not finite");this.store.data.x=this.canvas.clientWidth/2-e*i.width-i.x,this.store.data.y=this.canvas.clientHeight/2-t*i.height-i.y,this.onMovePens(),this.canvasImage.init(),this.canvasImageBottom.init(),this.render()}showMagnifier(){this.magnifierCanvas.magnifier=!0,this.externalElements.style.cursor="default",this.render()}hideMagnifier(){this.magnifierCanvas.magnifier=!1,this.externalElements.style.cursor="default",this.render()}toggleMagnifier(){this.magnifierCanvas.magnifier=!this.magnifierCanvas.magnifier,this.magnifierCanvas.magnifier&&(this.externalElements.style.cursor="default"),this.render()}destroy(){switch(this.scroll&&this.scroll.destroy(),this.tooltip?.destroy(),this.dialog?.destroy(),this.title?.destroy(),this.externalElements.removeEventListener("gesturestart",this.onGesturestart),this.externalElements.ondragover=e=>e.preventDefault(),this.externalElements.ondrop=void 0,this.externalElements.ontouchstart=void 0,this.externalElements.ontouchmove=void 0,this.externalElements.ontouchend=void 0,this.externalElements.onmousedown=void 0,this.externalElements.onmousemove=void 0,this.externalElements.onmouseup=void 0,this.externalElements.onmouseleave=void 0,this.externalElements.ondblclick=void 0,this.store.options.keydown){case z.Document:document.removeEventListener("keydown",this.onkeydown),document.removeEventListener("keyup",this.onkeyup);break;case z.Canvas:this.externalElements.removeEventListener("keydown",this.onkeydown),this.externalElements.removeEventListener("keyup",this.onkeyup)}document.removeEventListener("copy",this.onCopy),document.removeEventListener("cut",this.onCut),document.removeEventListener("paste",this.onPaste),window&&window.removeEventListener("resize",this.onResize),window&&window.removeEventListener("scroll",this.onScroll)}}var wn;!function(e){e[e.Link=0]="Link",e[e.SetProps=1]="SetProps",e[e.StartAnimate=2]="StartAnimate",e[e.PauseAnimate=3]="PauseAnimate",e[e.StopAnimate=4]="StopAnimate",e[e.JS=5]="JS",e[e.GlobalFn=6]="GlobalFn",e[e.Emit=7]="Emit",e[e.StartVideo=8]="StartVideo",e[e.PauseVideo=9]="PauseVideo",e[e.StopVideo=10]="StopVideo",e[e.SendPropData=11]="SendPropData",e[e.SendVarData=12]="SendVarData",e[e.Navigator=13]="Navigator",e[e.Dialog=14]="Dialog",e[e.SendData=15]="SendData"}(wn||(wn={}));class _n{constructor(e){let t;this.parent=e,this.boxWidth=320,this.boxHeight=180,this.ratio=this.boxWidth/this.boxHeight,this.padding=5,this.onMouseDown=e=>{e.preventDefault(),e.stopPropagation(),this.isDown=!0},this.onMouseMove=e=>{if(e.preventDefault(),e.stopPropagation(),this.isDown)try{this.parent.gotoView(e.offsetX/this.box.clientWidth,e.offsetY/this.box.clientHeight)}catch(e){console.warn(e.message),this.isDown=!1}},this.onMouseUp=e=>{e.preventDefault(),e.stopPropagation();try{this.parent.gotoView(e.offsetX/this.box.clientWidth,e.offsetY/this.box.clientHeight)}catch(e){console.warn(e.message)}finally{this.isDown=!1}},this.box=document.createElement("div"),this.img=new Image,this.view=document.createElement("div"),this.box.appendChild(this.img),this.box.appendChild(this.view),this.parent.externalElements.appendChild(this.box),this.box.className="meta2d-map",this.box.onmousedown=this.onMouseDown,this.box.onmousemove=this.onMouseMove,this.box.onmouseup=this.onMouseUp;for(let e=0;e<document.styleSheets.length;e++)"le5le/map"===document.styleSheets[e].title&&(t=document.styleSheets[e]);if(!t){let e=document.createElement("style");e.type="text/css",e.title="le5le.com/map",document.head.appendChild(e),e=document.createElement("style"),e.type="text/css",document.head.appendChild(e),t=e.sheet,t.insertRule(`.meta2d-map{display:flex;width:${this.boxWidth+2*this.padding}px;height:${this.boxHeight+2*this.padding}px;padding:${this.padding}px;background:#f4f4f4;border:1px solid #ffffff;box-shadow: 0px 0px 14px 0px rgba(0,10,38,0.30);border-radius:8px;position:absolute;z-index:9999;right:0;bottom:0;justify-content:center;align-items:center;cursor:default;user-select:none;overflow: hidden;}`),t.insertRule(".meta2d-map img{max-width:100%;max-height:100%;pointer-events: none;}"),t.insertRule(".meta2d-map div{pointer-events: none;border:1px solid #1890ff;position:absolute}")}}show(){this.box.style.display="flex",this.parent.store.data.pens.length?(this.img.style.display="block",this.img.src=this.parent.toPng(),this.setView()):this.img.style.display="none",this.isShow=!0}hide(){this.box.style.display="none",this.isShow=!1}setView(){const e=this.parent.store.data;if(e.pens.length){const t=St(e.pens);if(Rt(t,e.x,e.y),t.width/t.height>this.ratio){const e=t.width/this.ratio;t.y-=(e-t.height)/2,t.height=e,At(t)}else{const e=t.height*this.ratio;t.x-=(e-t.width)/2,t.width=e,At(t)}const i=this.parent.canvasRect;let n=0,r=0;if(t.x<0)n=-t.x/t.width;else if(t.x+t.width>i.width){let e=0;i.width>t.width&&(e=i.width-t.width),n=(-t.x+e)/t.width}if(t.y<0)r=-t.y/t.height;else if(t.y+t.height>i.height){let e=0;i.height>t.height&&(e=i.height-t.height),r=(-t.y+e)/t.height}const o=i.width>t.width?1:i.width/t.width,s=i.height>t.height?1:i.height/t.height;this.view.style.left=this.padding+n*this.boxWidth+"px",this.view.style.width=o*this.boxWidth+"px",this.view.style.top=this.padding+r*this.boxHeight+"px",this.view.style.height=s*this.boxHeight+"px"}}}var kn,Tn,An=i(421);class Sn{constructor(i,n={}){this.events={},this.facePen=Ue,this.getWords=q,this.calcTextLines=V,this.calcTextRect=U,this.calcTextDrawRect=W,this.register=O,this.registerCanvasDraw=B,this.registerAnchors=F,this.httpTimerList=[],this.onEvent=(e,t)=>{switch(e){case"add":t.forEach((e=>{e.onAdd?.(e)})),this.onSizeUpdate();break;case"enter":t&&t.onMouseEnter&&t.onMouseEnter(t,this.canvas.mousePos),this.store.data.locked&&this.doEvent(t,e);break;case"leave":t&&t.onMouseLeave&&t.onMouseLeave(t,this.canvas.mousePos),this.store.data.locked&&this.doEvent(t,e);break;case"active":case"inactive":this.store.data.locked&&t.forEach((t=>{this.doEvent(t,e)}));break;case"click":t.pen&&t.pen.onClick&&t.pen.onClick(t.pen,this.canvas.mousePos),this.store.data.locked&&t.pen&&this.doEvent(t.pen,e);break;case"mousedown":t.pen&&t.pen.onMouseDown&&t.pen.onMouseDown(t.pen,this.canvas.mousePos),this.store.data.locked&&t.pen&&this.doEvent(t.pen,e);break;case"mouseup":t.pen&&t.pen.onMouseUp&&t.pen.onMouseUp(t.pen,this.canvas.mousePos),this.store.data.locked&&t.pen&&this.doEvent(t.pen,e);break;case"dblclick":this.store.data.locked&&t.pen&&this.doEvent(t.pen,e);break;case"valueUpdate":this.store.data.locked&&this.doEvent(t,e),this.canvas.tooltip.updateText(t);break;case"update":case"delete":case"translatePens":case"rotatePens":case"resizePens":this.onSizeUpdate()}},this.doEvent=(e,t)=>{e&&(e.events?.forEach((i=>{if(i.actions&&i.actions.length)i.actions.forEach((n=>{this.events[n.action]&&i.name===t&&this.events[n.action](e,n)}));else if(this.events[i.action]&&i.name===t){let t=!i.where?.type;if(i.where){const{fn:n,fnJs:r,comparison:o,key:s,value:a}=i.where;if(n)t=n(e,{meta2d:this});else if(r){try{i.where.fn=new Function("pen","context",r)}catch(e){console.error("Error: make function:",e)}i.where.fn&&(t=i.where.fn(e,{meta2d:this}))}else switch(o){case">":t=e[s]>+a;break;case">=":t=e[s]>=+a;break;case"<":t=e[s]<+a;break;case"<=":t=e[s]<=+a;break;case"=":case"==":t=e[s]==a;break;case"!=":t=e[s]!=a;break;case"[)":t=te(+e[s],a);break;case"![)":t=!te(+e[s],a);break;case"[]":t=ie(+e[s],a);break;case"![]":t=!ie(+e[s],a)}}t&&this.events[i.action](e,i)}})),e.realTimes?.forEach((t=>{t.triggers?.forEach((i=>{let n=!1;"and"===i.conditionType?n=i.conditions.every((i=>this.judgeCondition(e,t.key,i))):"or"===i.conditionType&&(n=i.conditions.some((i=>this.judgeCondition(e,t.key,i)))),n&&i.actions?.forEach((t=>{this.events[t.action](e,t)}))}))})),this.doEvent(this.store.pens[e.parentId],t))},this.renderPenRaw=Ie,this.setElemPosition=nt,this.store=((e="default")=>{var t;return N[e]||(N[e]={data:{x:0,y:0,scale:1,pens:[],origin:{x:0,y:0},center:{x:0,y:0},paths:{}},histories:[],pens:{},path2dMap:new WeakMap,animateMap:new WeakMap,active:[],animates:new Set,options:{...j},emitter:{all:t=t||new Map,on:function(e,i){var n=t.get(e);n&&n.push(i)||t.set(e,[i])},off:function(e,i){var n=t.get(e);n&&n.splice(n.indexOf(i)>>>0,1)},emit:function(e,i){(t.get(e)||[]).slice().map((function(e){e(i)})),(t.get("*")||[]).slice().map((function(t){t(e,i)}))}},bindDatas:{},bind:{},cacheDatas:[]},N[e].id=e),N[e]})(ne()),this.setOptions(n),this.setDatabyOptions(n),this.init(i),this.register({rectangle:e,square:t,circle:Ei,svgPath:Wt,diamond:Ri,triangle:Ii,pentagon:Mi,pentagram:Ni,hexagon:Fi,leftArrow:zi,rightArrow:ji,twowayArrow:Hi,message:Ui,cloud:Wi,file:Vi,people:qi,line:Jt,iframe:gi,video:_i,gif:Yi,mindNode:en,mindLine:an}),this.registerCanvasDraw({cube:Vt}),this.registerAnchors({triangle:Li,pentagon:Di,pentagram:Oi,mindNode:rn,mindLine:cn}),globalThis.meta2d=this,this.initEventFns(),this.store.emitter.on("*",this.onEvent)}get beforeAddPen(){return this.canvas.beforeAddPen}set beforeAddPen(e){this.canvas.beforeAddPen=e}get beforeAddPens(){return this.canvas.beforeAddPens}set beforeAddPens(e){this.canvas.beforeAddPens=e}get beforeAddAnchor(){return this.canvas.beforeAddAnchor}set beforeAddAnchor(e){this.canvas.beforeAddAnchor=e}get beforeRemovePens(){return this.canvas.beforeRemovePens}set beforeRemovePens(e){this.canvas.beforeRemovePens=e}get beforeRemoveAnchor(){return this.canvas.beforeRemoveAnchor}set beforeRemoveAnchor(e){this.canvas.beforeRemoveAnchor=e}setOptions(e={}){this.store.options=Object.assign(this.store.options,e),this.canvas&&void 0!==e.scroll&&(e.scroll?(!this.canvas.scroll&&(this.canvas.scroll=new dn(this.canvas)),this.canvas.scroll.show()):this.canvas.scroll&&this.canvas.scroll.hide())}getOptions(){return this.store.options}setDatabyOptions(e={}){const{color:t,activeColor:i,activeBackground:n,grid:r,gridColor:o,gridSize:s,fromArrow:a,toArrow:c,rule:l,ruleColor:h,textColor:d}=e;this.setRule({rule:l,ruleColor:h}),this.setGrid({grid:r,gridColor:o,gridSize:s}),this.store.data=Object.assign(this.store.data,{textColor:d,color:t,activeColor:i,activeBackground:n,fromArrow:a,toArrow:c})}init(e){this.canvas=new bn(this,"string"==typeof e?document.getElementById(e):e,this.store),this.resize(),this.canvas.listen()}initEventFns(){this.events[wn.Link]=(e,t)=>{window&&t.value&&"string"==typeof t.value?window.open(t.value,t.params??"_blank"):console.warn("[meta2d] Link param is not a string")},this.events[wn.SetProps]=(e,t)=>{const i=t.value;if(i&&"object"==typeof i)return(t.params?this.find(t.params):[e]).forEach((e=>{i.hasOwnProperty("visible")&&this.setVisible(e,i.visible),this.setValue({id:e.id,...i},{render:!1,doEvent:!1})})),void this.render();console.warn("[meta2d] SetProps value is not an object")},this.events[wn.StartAnimate]=(e,t)=>{t.targetType&&t.params?this.startAnimate(t.value||[e],t.params):t.value&&"string"!=typeof t.value?console.warn("[meta2d] StartAnimate value is not a string"):this.startAnimate(t.value||[e])},this.events[wn.PauseAnimate]=(e,t)=>{t.value&&"string"!=typeof t.value?console.warn("[meta2d] PauseAnimate value is not a string"):this.pauseAnimate(t.value||[e])},this.events[wn.StopAnimate]=(e,t)=>{t.value&&"string"!=typeof t.value?console.warn("[meta2d] StopAnimate event value is not a string"):this.stopAnimate(t.value||[e])},this.events[wn.StartVideo]=(e,t)=>{t.value&&"string"!=typeof t.value?console.warn("[meta2d] StartVideo value is not a string"):this.startVideo(t.value||[e])},this.events[wn.PauseVideo]=(e,t)=>{t.value&&"string"!=typeof t.value?console.warn("[meta2d] PauseVideo value is not a string"):this.pauseVideo(t.value||[e])},this.events[wn.StopVideo]=(e,t)=>{t.value&&"string"!=typeof t.value?console.warn("[meta2d] StopVideo event value is not a string"):this.stopVideo(t.value||[e])},this.events[wn.JS]=(e,t)=>{if(t.value&&!t.fn)try{if("string"!=typeof t.value)throw new Error("[meta2d] Function value must be string");const e=t.value;t.fn=new Function("pen","params","context",e)}catch(e){console.error("[meta2d]: Error on make a function:",e)}t.fn?.(e,t.params,{meta2d:this,eventName:t.name})},this.events[wn.GlobalFn]=(e,t)=>{"string"==typeof t.value?globalThis[t.value]&&globalThis[t.value](e,t.params):console.warn("[meta2d] GlobalFn value must be a string")},this.events[wn.Emit]=(e,t)=>{"string"==typeof t.value?this.store.emitter.emit(t.value,{pen:e,params:t.params,eventName:t.name}):console.warn("[meta2d] Emit value must be a string")},this.events[wn.SendPropData]=(e,t)=>{const i=$(t.value);if(i&&"object"==typeof i){const n=t.params?this.findOne(t.params):e;for(let e in i)i[e]||(i[e]=n[e]);return i.id=n.id,void this.doSendDataEvent(i,t.extend)}console.warn("[meta2d] SendPropData value is not an object")},this.events[wn.SendVarData]=(e,t)=>{const i=$(t.value);if(i&&"object"==typeof i){const n=t.params?this.findOne(t.params):e;let r=[];for(let e in i){let t={dataId:e,value:i[e]};if(!t.value){let e=n.form.find((e=>e.dataIds&&e.dataIds.dataId===t.dataId));e&&(t.value=n[e.key])}r.push(t)}this.doSendDataEvent(r,t.extend)}else console.warn("[meta2d] SendVarData value is not an object")},this.events[wn.Navigator]=(e,t)=>{t.value&&"string"==typeof t.value&&this.navigatorTo(t.value)},this.events[wn.Dialog]=(e,t)=>{t.params&&"string"==typeof t.params&&t.value&&"string"==typeof t.value&&this.canvas.dialog.show(t.value,t.params)},this.events[wn.SendData]=(e,t)=>{const i=$(t.value);if(i&&"object"==typeof i&&"action"===t.targetType){const n=t.params?this.findOne(t.params):e;for(let e in i)i[e]||(i[e]=n[e]);return i.id=n.id,void this.sendDataToNetWork(i,t.network)}}}navigatorTo(e){if(!e)return;let t=window.location.href.split("id=");if(t.length>1){let i=t[1].indexOf("&");window.location.href=-1===i?t[0]+"id="+e:t[0]+"id="+e+t[1].slice(i+1)}}doSendDataEvent(e,t){let i=JSON.stringify(e);this.mqttClient&&this.mqttClient.connected&&(t?t.split(",").forEach((e=>{this.mqttClient.publish(e,i)})):this.store.data.mqttTopics&&this.store.data.mqttTopics.split(",").forEach((e=>{this.mqttClient.publish(e,i)}))),this.websocket&&1===this.websocket.readyState&&this.websocket.send(i),(this.store.data.https||this.store.data.http)&&this.sendDatabyHttp(i),this.store.emitter.emit("sendData",i)}async sendDataToNetWork(e,t){if(t.url)if("http"===t.type)(await fetch(t.url,{headers:t.headers,method:t.method,body:e})).ok&&console.info("http消息发送成功");else if("mqtt"===t.type){const i=this.mqttClients.filter((e=>e.options.href===t.url));if(i&&i.length)i[0].connected&&t.topics.split(",").forEach((t=>{i[0].publish(t,e)}));else{let i=An.connect(t.url,t.options);i.on("connect",(()=>{console.info("mqtt连接成功"),t.topics.split(",").forEach((t=>{i.publish(t,e),i?.end()}))}))}}else if("websocket"===t.type){const i=this.websockets.filter((e=>e.url===t.url));if(i&&i.length)1===i[0].readyState&&i[0].send(e);else{let i=new WebSocket(t.url,t.protocols);i.onopen=function(){console.info("websocket连接成功"),i.send(e),setTimeout((()=>{i.close()}),100)}}}}resize(e,t){this.canvas.resize(e,t),this.render(),this.store.emitter.emit("resize",{width:e,height:t}),this.canvas.scroll&&this.canvas.scroll.isShow&&this.canvas.scroll.init()}async addPen(e,t,i=!0){return await this.canvas.addPen(e,t,i)}async addPens(e,t){return await this.canvas.addPens(e,t)}render(e){this.canvas.render(e)}async setBackgroundImage(e){let t=this;this.store.data.bkImage=e;const i=this.store.data.width||this.store.options.width,n=this.store.data.height||this.store.options.height;if(this.canvas.canvasImageBottom.canvas.style.backgroundImage=i&&n?null:e?`url('${e}')`:"",e){const i=await async function(e){return new Promise((i=>{const n=new Image;n.src=e,t.store.options.cdn&&!(e.startsWith("http")||e.startsWith("//")||e.startsWith("data:image"))&&(n.src=t.store.options.cdn+e),n.crossOrigin="anonymous",n.onload=()=>{i(n)}}))}(e);this.store.bkImg=i}else this.store.bkImg=null}setBackgroundColor(e=this.store.data.background){this.store.data.background=e,this.store.patchFlagsBackground=!0}setGrid({grid:e=this.store.data.grid,gridColor:t=this.store.data.gridColor,gridSize:i=this.store.data.gridSize,gridRotate:n=this.store.data.gridRotate}={}){this.store.data.grid=e,this.store.data.gridColor=t,this.store.data.gridSize=i,this.store.data.gridRotate=n,this.store.patchFlagsBackground=!0}setRule({rule:e=this.store.data.rule,ruleColor:t=this.store.data.ruleColor}={}){this.store.data.rule=e,this.store.data.ruleColor=t,this.store.patchFlagsTop=!0}open(e,t=!0){if(this.clear(!1),this.canvas.autoPolylineFlag=!0,e){this.setBackgroundImage(e.bkImage),Object.assign(this.store.data,e),this.store.data.pens=[];for(const t of e.pens)t.id||(t.id=ne()),!t.calculative&&(t.calculative={canvas:this.canvas}),this.store.pens[t.id]=t;for(const t of e.pens)this.canvas.makePen(t);for(const t of e.pens)this.canvas.updateLines(t)}if(t||(this.canvas.opening=!0),this.initBindDatas(),this.initBinds(),this.render(),this.listenSocket(),this.connectSocket(),this.connectNetwork(),this.startAnimate(),this.startVideo(),this.doInitJS(),this.store.data.iconUrls)for(const e of this.store.data.iconUrls)i=e,n=()=>{this.render()},void 0,r=void 0,(r=document.createElement("link")).href=i,r.rel="stylesheet",n&&(r.onload=n),document.head.appendChild(r);var i,n,r;this.canvas.autoPolylineFlag=!1,this.store.emitter.emit("opened"),this.canvas.scroll&&this.canvas.scroll.isShow&&this.canvas.scroll.init()}cacheData(e){if(e&&this.store.options.cacheLength){let t=this.store.cacheDatas.findIndex((t=>t.data&&t.data._id===e));if(-1===t)this.store.cacheDatas.push({data:$(this.store.data,!0)}),this.store.cacheDatas.length>this.store.options.cacheLength&&this.store.cacheDatas.shift();else{let e=this.store.cacheDatas.splice(t,1)[0];this.store.cacheDatas.push(e)}}}loadCacheData(e){let t=this.store.cacheDatas.findIndex((t=>t.data&&t.data._id===e));-1!==t&&(this.store.data=this.store.cacheDatas[t].data,this.setBackgroundImage(this.store.data.bkImage),this.store.pens={},this.store.data.pens.forEach((e=>{e.calculative.canvas=this.canvas,this.store.pens[e.id]=e,N.path2dDraws[e.name]&&this.store.path2dMap.set(e,N.path2dDraws[e.name](e)),e.type&&this.store.path2dMap.set(e,N.path2dDraws[e.name](e)),e.image&&(e.calculative.imageDrawed=!1,this.canvas.loadImage(e))})),this.render())}initBindDatas(){this.store.bindDatas={},this.store.data.pens.forEach((e=>{e.form?.forEach((t=>{let i;t.dataIds&&(i=Array.isArray(t.dataIds)?t.dataIds:[t.dataIds]),i?.forEach((i=>{this.store.bindDatas[i.dataId]||(this.store.bindDatas[i.dataId]=[]),this.store.bindDatas[i.dataId].push({id:e.id,formItem:t})}))}))}))}initBinds(){this.store.bind={},this.store.data.pens.forEach((e=>{e.realTimes?.forEach((t=>{t.bind&&t.bind.id&&(this.store.bind[t.bind.id]||(this.store.bind[t.bind.id]=[]),this.store.bind[t.bind.id].push({id:e.id,key:t.key}))}))}))}connectSocket(){this.connectWebsocket(),this.connectMqtt(),this.connectHttp()}doInitJS(){const e=this.store.data.initJs;if(e&&e.trim())try{new Function("context",e)({meta2d:this})}catch(e){console.warn("initJs error",e)}}drawLine(e){e&&pn(this.store),this.canvas.drawingLineName=e}drawingPencil(){this.canvas.drawingPencil()}stopPencil(){this.canvas.stopPencil()}lock(e){this.store.data.locked=e,this.finishDrawLine(!0),this.canvas.drawingLineName="",this.stopPencil(),this.store.data.pens.forEach((e=>{!0===e.externElement&&e.onMove&&e.onMove(e)}))}async finishDrawLine(e){await this.canvas.finishDrawline(e)}async finishPencil(){await this.canvas.finishPencil()}updateLineType(e,t){if(!e||"line"!=e.name||!t||!this.canvas[t])return;e.lineName=t;const i=$e(e),n=Xe(e);i.prev=void 0,i.next=void 0,n.prev=void 0,n.next=void 0,e.calculative.worldAnchors=[i,n],e.calculative.activeAnchor=i,this.canvas[t](this.store,e,n),"curve"===e.lineName&&(i.prev={penId:i.penId,x:i.x-50,y:i.y},i.next={penId:i.penId,x:i.x+50,y:i.y},n.prev={penId:n.penId,x:n.x-50,y:n.y},n.next={penId:n.penId,x:n.x+50,y:n.y}),e.calculative.activeAnchor=void 0,this.canvas.initLineRect(e),this.render()}addDrawLineFn(e,t){this.canvas[e]=t,this.canvas.drawLineFns.push(e)}removeDrawLineFn(e){const t=this.canvas.drawLineFns.indexOf(e);t>-1&&this.canvas.drawLineFns.splice(t,1)}showMagnifier(){this.canvas.showMagnifier()}hideMagnifier(){this.canvas.hideMagnifier()}toggleMagnifier(){this.canvas.toggleMagnifier()}clear(e=!0){for(const e of this.store.data.pens)e.onDestroy?.(e);var t;(t=this.store).data={x:0,y:0,scale:1,pens:[],origin:{x:0,y:0},center:{x:0,y:0},paths:{}},t.pens={},t.histories=[],t.historyIndex=null,t.path2dMap=new WeakMap,t.animateMap=new WeakMap,t.bindDatas={},t.bind={},t.active=[],t.hover=void 0,t.lastHover=void 0,t.animates.clear(),this.hideInput(),this.canvas.tooltip.hide(),this.canvas.clearCanvas(),sessionStorage.removeItem("page"),this.store.clipboard=void 0,this.store.patchFlagsBackground=!0,this.store.patchFlagsTop=!0,this.setBackgroundImage(void 0),e&&this.render()}emit(e,t){this.store.emitter.emit(e,t)}on(e,t){return this.store.emitter.on(e,t),this}off(e,t){return this.store.emitter.off(e,t),this}registerMoveDock(e){this.canvas.customMoveDock=e}registerResizeDock(e){this.canvas.customResizeDock=e}find(e){return this.canvas.find(e)}findOne(e){return this.canvas.findOne(e)}getPenRect(e){return this.canvas.getPenRect(e)}setPenRect(e,t,i=!0){this.canvas.setPenRect(e,t,i)}startAnimate(e,t){let i;this.stopAnimate(e),i=e?"string"==typeof e?this.find(e):e:this.store.data.pens.filter((e=>(e.type||e.frames)&&e.autoPlay)),i.forEach((e=>{if(e.calculative.pause){const t=Date.now()-e.calculative.pause;e.calculative.pause=void 0,e.calculative.frameStart+=t,e.calculative.frameEnd+=t}else{if(void 0!==t&&e.animations){let i=-1;if("string"==typeof t){if(i=e.animations.findIndex((e=>e.name===t)),-1===i)return}else if("number"==typeof t){if(!(e.animations.length>t))return;i=t}const n=$(e.animations[i]);delete n.name,n.currentAnimation=i,!e.type&&n.frames&&(n.showDuration=this.calcAnimateDuration(n)),this.setValue({id:e.id,...n},{doEvent:!1,history:!1})}this.store.animates.add(e),e.type||this.store.animateMap.set(e,e.calculative.canvas.getFrameProps(e))}})),this.canvas.canvasImage.init(),this.canvas.canvasImageBottom.init(),this.canvas.animate()}pauseAnimate(e){let t=[];e?t="string"==typeof e?this.find(e):e:this.store.animates.forEach((e=>{t.push(e)})),t.forEach((e=>{e.calculative.pause||(e.calculative.pause=Date.now())}))}stopAnimate(e){let t=[];e?t="string"==typeof e?this.find(e):e:this.store.animates.forEach((e=>{t.push(e)})),t.forEach((e=>{e.currentAnimation=void 0,e.calculative.pause=void 0,e.calculative.start=void 0,e.calculative.duration=void 0,e.calculative.animatePos=0,this.store.animates.delete(e),this.canvas.restoreNodeAnimate(e),this.canvas.updateLines(e),this.store.animateMap.delete(e)})),this.initImageCanvas(t),setTimeout((()=>{this.canvas.calcActiveRect(),this.render()}),20)}startVideo(e){let t;t=e?"string"==typeof e?this.find(e):e:this.store.data.pens.filter((e=>(e.video||e.audio)&&e.autoPlay)),t.forEach((e=>{e.calculative.media?.play(),e.onStartVideo?.(e)}))}pauseVideo(e){let t=[];t=e?"string"==typeof e?this.find(e):e:this.store.data.pens.filter((e=>(e.video||e.audio)&&e.autoPlay)),t.forEach((e=>{e.calculative.media?.pause(),e.onPauseVideo?.(e)}))}stopVideo(e){let t=[];t=e?"string"==typeof e?this.find(e):e:this.store.data.pens.filter((e=>(e.video||e.audio)&&e.autoPlay)),t.forEach((e=>{e.calculative.media&&(e.calculative.media.currentTime=0,e.calculative.media.pause()),e.onStopVideo?.(e)}))}calcAnimateDuration(e){return e.frames.reduce(((e,t)=>e+t.duration),0)}combine(e=this.store.active,t){if(!e||!e.length)return;const i=$(e);if(1===e.length&&e[0].type)return e[0].type=r.Node,this.canvas.active(e),this.pushHistory({type:H.Update,initPens:i,pens:$(e,!0)}),void this.render();const n=St(e);let s={id:ne(),name:"combine",...n,children:[],showChild:t};this.canvas.makePen(s);const a=$(s);let c=1/0;e.forEach((e=>{const t=this.store.data.pens.findIndex((t=>t.id===e.id));if(t<c&&(c=t),e===s||e.parentId===s.id)return;s.children.push(e.id),e.parentId=s.id;const i=Dt(e.calculative.worldRect,n);Object.assign(e,i),e.locked=e.lockedOnCombine??o.DisableMove})),this.store.data.pens.splice(c,0,s),this.store.data.pens.pop(),this.canvas.active([s]),this.pushHistory({type:H.Add,pens:[a],step:3}),this.pushHistory({type:H.Update,initPens:[a],pens:[s],step:3}),this.pushHistory({type:H.Update,initPens:i,pens:e,step:3}),null!=t&&(e.forEach((e=>{ht(e,!0)})),this.initImageCanvas([s])),this.store.emitter.emit("combine",[s]),this.render()}uncombine(e){if(!e&&this.store.active&&(e=this.store.active[0]),!e||!e.children)return;const t=e.children.map((e=>this.store.pens[e]));let i=$(t);t.forEach((e=>{e.parentId=void 0,e.x=e.calculative.worldRect.x,e.y=e.calculative.worldRect.y,e.width=e.calculative.worldRect.width,e.height=e.calculative.worldRect.height,e.locked=o.None,e.calculative.active=void 0,e.calculative.hover=!1,this.setVisible(e,!0)}));const n=this.isCombine(e)?3:2;this.pushHistory({type:H.Update,initPens:i,pens:t,step:n}),i=[$(e)],e.children=void 0,this.pushHistory({type:H.Update,initPens:i,pens:[e],step:n}),this.isCombine(e)&&(this.delete([e]),this.store.histories[this.store.histories.length-1].step=n),this.inactive()}isCombine(e){return"combine"===e.name||!!(e.children&&e.children.length>0)}active(e,t=!0){this.canvas.active(e,t)}inactive(){this.canvas.inactive()}activeAll(){this.canvas.active(this.store.data.pens.filter((e=>!e.parentId&&e.locked!==o.Disable))),this.render()}delete(e,t=!1,i=!0){this.canvas.delete(e,t,i)}scale(e,t={x:0,y:0}){this.canvas.scale(e,t)}translate(e,t){this.canvas.translate(e,t)}translatePens(e,t,i){this.canvas.translatePens(e,t,i)}getParent(e,t){return se(e,t)}data(){const e=$(this.store.data),{pens:t,paths:i}=this.store.data;e.version=D,e.paths={};for(const n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.find((e=>e.pathId===n))&&(e.paths[n]=i[n]);return e}copy(e){this.canvas.copy(e)}cut(e){this.canvas.cut(e)}paste(){this.canvas.paste()}undo(){this.canvas.undo()}redo(){this.canvas.redo()}listenSocket(){try{let e;const t=this.store.data.socketCbJs;if(t&&(e=new Function("e","context",t)),!e)return!1;this.socketFn=e}catch(e){return console.error("Create the function for socket:",e),!1}return!0}connectWebsocket(e){this.closeWebsocket(),e&&(this.store.data.websocket=e),this.store.data.websocket&&(this.websocket=new WebSocket(this.store.data.websocket,this.store.data.websocketProtocols),this.websocket.onmessage=e=>{this.socketCallback(e.data,{type:"websocket",url:this.store.data.websocket})},this.websocket.onclose=()=>{console.info("Canvas websocket closed and reconneting..."),this.connectWebsocket()})}closeWebsocket(){this.websocket&&(this.websocket.onclose=void 0,this.websocket.close(),this.websocket=void 0)}connectMqtt(e){this.closeMqtt(),e&&(this.store.data.mqtt=e.mqtt,this.store.data.mqttTopics=e.mqttTopics,this.store.data.mqttOptions=e.mqttOptions),this.store.data.mqtt&&(this.store.data.mqttOptions.clientId&&!this.store.data.mqttOptions.customClientId&&(this.store.data.mqttOptions.clientId=ne()),this.mqttClient=An.connect(this.store.data.mqtt,this.store.data.mqttOptions),this.mqttClient.on("message",((e,t)=>{this.socketCallback(t.toString(),{topic:e,type:"mqtt",url:this.store.data.mqtt})})),this.store.data.mqttTopics&&this.mqttClient.subscribe(this.store.data.mqttTopics.split(",")))}closeMqtt(){this.mqttClient?.end()}connectHttp(){this.closeHttp();const{https:e}=this.store.data;if(e)e.forEach(((e,t)=>{e.http&&(this.httpTimerList[t]=setInterval((async()=>{const t=await fetch(e.http,{headers:e.httpHeaders});if(t.ok){const i=await t.text();this.socketCallback(i,{type:"http",url:e.http})}}),e.httpTimeInterval||1e3))}));else{const{http:e,httpTimeInterval:t,httpHeaders:i}=this.store.data;e&&(this.httpTimer=setInterval((async()=>{const t=await fetch(e,{headers:i});if(t.ok){const i=await t.text();this.socketCallback(i,{type:"http",url:e})}}),t||1e3))}}async sendDatabyHttp(e){const{https:t}=this.store.data;if(t)t.forEach((async t=>{t.http&&(await fetch(t.http,{method:"post",body:e,headers:t.httpHeaders})).ok&&console.info("http消息发送成功")}));else{const{http:t,httpHeaders:i}=this.store.data;t&&(await fetch(t,{method:"post",body:e,headers:i})).ok&&console.info("http消息发送成功")}}closeHttp(){clearInterval(this.httpTimer),this.httpTimer=void 0,this.httpTimerList&&this.httpTimerList.forEach((e=>{clearInterval(e),e=void 0}))}connectNetwork(){this.closeNetwork();const{networks:e}=this.store.data,t=[];if(e){let i=0;this.mqttClients=[];let n=0;this.websockets=[],e.forEach((e=>{"subscribe"===e.type&&("mqtt"===e.protocol?(e.options.clientId&&!e.options.customClientId&&(e.options.clientId=ne()),this.mqttClients[i]=An.connect(e.url,e.options),this.mqttClients[i].on("message",((t,i)=>{this.socketCallback(i.toString(),{topic:t,type:"mqtt",url:e.url})})),e.topics&&this.mqttClients[i].subscribe(e.topics.split(",")),i+=1):"websocket"===e.protocol?(this.websockets[n]=new WebSocket(e.url,e.protocols),this.websockets[n].onmessage=t=>{this.socketCallback(t.data,{type:"websocket",url:e.url})},n+=1):"http"===e.protocol&&t.push({url:e.url,headers:e.headers||void 0,method:e.method,body:e.body}))}))}this.onNetworkConnect(t)}randomString(e){e=e||32;let t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",i=t.length,n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*i));return n}penMock(e){if(e.realTimes){let t={};if(e.realTimes.forEach((e=>{if(e.enableMock&&void 0!==e.mock)if("float"===e.type)if(e.mock&&-1!==e.mock.indexOf(",")){let i=e.mock.split(","),n=Math.floor(Math.random()*i.length);t[e.key]=parseFloat(i[n])}else if(e.mock&&-1!==e.mock.indexOf("-")){let i,n,r,o=e.mock.split("-");if("-"===e.mock.charAt(0)?4===o.length?(i=-parseFloat(o[3]),n=-parseFloat(o[1]),r=o[3]):(i=parseFloat(o[2]),n=-parseFloat(o[1]),r=o[2]):(i=parseFloat(o[1]),n=parseFloat(o[0]),r=o[1]),-1!==(r+"").indexOf(".")){let o=(r+"").split(".")[1].length;t[e.key]=(Math.random()*(i-n)+n).toFixed(o)}else t[e.key]=Math.random()*(i-n)+n}else t[e.key]=parseFloat(e.mock);else if("integer"===e.type)if(e.mock&&-1!==e.mock.indexOf(",")){let i=e.mock.split(","),n=Math.floor(Math.random()*i.length);t[e.key]=parseInt(i[n])}else if(e.mock&&-1!==e.mock.indexOf("-")){let i,n,r=e.mock.split("-");"-"===e.mock.charAt(0)?4===r.length?(i=-parseFloat(r[3]),n=-parseFloat(r[1])):(i=parseFloat(r[2]),n=-parseFloat(r[1])):(i=parseInt(r[1]),n=parseInt(r[0])),t[e.key]=parseInt(Math.random()*(i-n)+n+"")}else t[e.key]=parseInt(e.mock);else if("bool"===e.type)"boolean"==typeof e.mock?t[e.key]=e.mock:"true"===e.mock?t[e.key]=!0:"false"===e.mock?t[e.key]=!1:t[e.key]=Math.random()<.5;else if("object"===e.type||"array"===e.type)e.mock;else if(e.mock&&e.mock.startsWith("{")&&e.mock.endsWith("}")){let i=e.mock.substring(1,e.mock.length-1).split(","),n=Math.floor(Math.random()*i.length);t[e.key]=i[n]}else if(e.mock&&e.mock.startsWith("[")&&e.mock.endsWith("]")){let i=parseInt(e.mock.substring(1,e.mock.length-1));t[e.key]=this.randomString(i)}else t[e.key]=e.mock})),Object.keys(t).length){let i=e.onBeforeValue?e.onBeforeValue(e,t):t;this.canvas.updateValue(e,i),this.store.emitter.emit("valueUpdate",e),e.onValue?.(e)}}}onNetworkConnect(e){let t=this.store.data.enableMock;(e&&e.length||t)&&(this.updateTimer=setInterval((()=>{t&&this.store.data.pens.forEach((e=>{this.penMock(e)})),e.forEach((async e=>{if(e.url){const t=await fetch(e.url,{headers:e.headers,method:e.method,body:"GET"===e.method?void 0:e.body});if(t.ok){const i=await t.text();this.socketCallback(i,{type:"http",url:e.url})}}})),this.render()}),this.store.data.networkInterval||1e3))}closeNetwork(){this.mqttClients&&this.mqttClients.forEach((e=>{e.end()})),this.websockets&&this.websockets.forEach((e=>{e.close()})),this.mqttClients=void 0,this.websockets=void 0,clearInterval(this.updateTimer),this.updateTimer=void 0}socketCallback(e,t){if(this.store.emitter.emit("socket",{message:e,context:t}),this.socketFn&&!this.socketFn(e,{meta2d:this,type:t.type,topic:t.topic,url:t.url}))return;let i;if(e.constructor===Object||e.constructor===Array)i=e;else{if("string"!=typeof e)return;try{i=JSON.parse(e)}catch(e){console.warn("Invalid socket data:",i,e)}}i&&(Array.isArray(i)||(i=[i]),i[0].dataId?this.setDatas(i):i.forEach((e=>{this.setValue(e)})))}setDatas(e,{render:t=!0,doEvent:i=!0,history:n}={}){const r=new Map;let o,s;e.forEach((t=>{this.store.bindDatas[t.dataId]?.forEach((i=>{const n=this.store.pens[i.id];if(!n)return;let o=r.get(n);if("function"!=typeof n.onBinds)o?o[i.formItem.key]=t.value:(o={id:i.id,[i.formItem.key]:t.value},r.set(n,o));else{if(o)return;r.set(n,n.onBinds(n,e,i.formItem))}})),this.store.bind[t.id]?.forEach((e=>{const i=this.store.pens[e.id];if(!i)return;let n=r.get(i);n?n[e.key]=t.value:(n={id:e.id,[e.key]:t.value},r.set(i,n))}))})),n&&(o=[]),r.forEach(((e,t)=>{this.setValue(e,{render:!1,doEvent:i,history:!1}),n&&(o.push($(t,!0)),s.push(t))})),t&&this.render(),n&&this.pushHistory({type:H.Update,initPens:o,pens:s})}setValue(e,{render:t=!0,doEvent:i=!0,history:n}={}){let r,o=[];if(e.id){if(e.id===this.store.data.id)return this.setDatabyOptions(e),e.bkImage&&this.setBackgroundImage(e.bkImage),e.background&&this.setBackgroundColor(e.background),void this.render();const r=this.store.pens[e.id];if(r)o=[r];else{let r=this.store.bind[e.id];if(r&&r.length)return o=[],void this.setDatas([e],{render:t,doEvent:i,history:n})}}else{if(e.dataId)return o=[],void this.setDatas([e],{render:t,doEvent:i,history:n});if(!e.tag)return;o=this.find(e.tag)}(n=n&&!this.store.data.locked)&&(r=$(o)),o.forEach((t=>{const i=t.onBeforeValue?t.onBeforeValue(t,e):e;e.frames&&(this.stopAnimate([t]),e.showDuration||(e.showDuration=e.frames.reduce(((e,t)=>e+t.duration),0))),ft(t,i),this.canvas.updateValue(t,i),t.onValue?.(t)})),this.store.data.locked||!this.store.active.length||this.canvas.movingPens||this.canvas.calcActiveRect(),n&&this.pushHistory({type:H.Update,initPens:r,pens:o}),i&&o.forEach((e=>{this.store.emitter.emit("valueUpdate",e)})),t&&this.render()}_setValue(e,t=!1){this.setValue(e,{history:t,render:!1,doEvent:!1})}pushHistory(e){this.canvas.pushHistory(e)}showInput(e,t){this.canvas.showInput(e,t)}hideInput(){this.canvas.hideInput()}clearDropdownList(){this.canvas.clearDropdownList()}judgeCondition(e,t,i){const{type:n,target:r,fnJs:o,fn:s,operator:a,valueType:c}=i;let l=!1;if("fn"===n){if(s)l=s(e,{meta2d:this});else if(o){try{i.fn=new Function("pen","context",o)}catch(e){console.error("Error: make function:",e)}i.fn&&(l=i.fn(e,{meta2d:this}))}}else{let n=i.value;switch("prop"===c&&(n=this.store.pens[r][i.value]),a){case">":l=e[t]>+n;break;case">=":l=e[t]>=+n;break;case"<":l=e[t]<+n;break;case"<=":l=e[t]<=+n;break;case"=":case"==":l=e[t]==n;break;case"!=":l=e[t]!=n;break;case"[)":l=te(+e[t],n);break;case"![)":l=!te(+e[t],n);break;case"[]":l=ie(+e[t],n);break;case"![]":l=!ie(+e[t],n)}}return l}pushChildren(e,t){const i=[$(e,!0)],n=[];e.children||(e.children=[]);const r=[];t.forEach((t=>{let s=$(t,!0);if(t.id&&this.store.pens[t.id]||(this.canvas.makePen(t),s=null),t.parentId){const e=this.store.pens[t.parentId],n=e.children.findIndex((e=>e===t.id));i.push($(e,!0)),e.children.splice(n,1),r.push($(e,!0))}e.children.push(t.id),t.parentId=e.id;const a=Dt(t.calculative.worldRect,e.calculative.worldRect);Object.assign(t,a),t.locked=t.lockedOnCombine??o.DisableMove,s?(i.push(s),r.push($(t,!0))):n.push($(t,!0))})),r.push($(e,!0));let s=1;n.length&&(s=2,this.pushHistory({type:H.Add,pens:n,step:s})),this.pushHistory({type:H.Update,initPens:i,pens:r,step:s})}toPng(e,t,i=!1){return this.canvas.toPng(e,t,i)}downloadPng(e,t){for(const e of this.store.data.pens)e.calculative.img&&e.onRenderPenRaw?.(e);setTimeout((()=>{const i=document.createElement("a");i.setAttribute("download",(e||this.store.data.name||"le5le.meta2d")+".png"),i.setAttribute("href",this.toPng(t,void 0,!0));const n=document.createEvent("MouseEvents");n.initEvent("click",!0,!0),i.dispatchEvent(n)}))}getRect(e=this.store.data.pens){return St(e)}fitView(e=!0,t=10){if(!this.hasView())return;const{canvas:i}=this.canvas,{offsetWidth:n,offsetHeight:r}=i;this.resize(n,r);const o=re(t),s=this.getRect(),a=(n-o[1]-o[3])/s.width,c=(r-o[0]-o[2])/s.height;let l=a;l=e?a>c?c:a:a>c?a:c,this.scale(l*this.store.data.scale),this.centerView()}fitSizeView(e=!0,t=10){const{canvas:i}=this.canvas,{offsetWidth:n,offsetHeight:r}=i;this.resize(n,r);const o=re(t),s=(this.store.data.width||this.store.options.width)*this.store.data.scale,a=(this.store.data.height||this.store.options.height)*this.store.data.scale,c=(n-o[1]-o[3])/s,l=(r-o[0]-o[2])/a;let h=c;h=e?c>l?l:c:c>l?c:l,this.scale(h*this.store.data.scale),this.centerSizeView()}centerSizeView(){const e=this.getViewCenter(),t={x:0,y:0,width:this.store.data.width||this.store.options.width,height:this.store.data.height||this.store.options.height};Tt(t);const{center:i}=t,{scale:n,origin:r,x:o,y:s}=this.store.data;this.translate((e.x-r.x)/n-i.x-o/n,(e.y-r.y)/n-i.y-s/n);const{canvas:a}=this.canvas,c=(a.scrollWidth-a.offsetWidth)/2,l=(a.scrollHeight-a.offsetHeight)/2;a.scrollTo(c,l)}scrollView(e=10,t=!1){if(!this.hasView())return;if(!this.canvas.scroll)return;const{canvas:i}=this.canvas,{offsetWidth:n,offsetHeight:r}=i;this.resize(n,r);const o=re(e),s=this.getRect(),a=(n-o[1]-o[3])/s.width;this.scale(a*this.store.data.scale),this.topView(o[0]),t&&this.canvas.scroll.changeMode()}screenView(e=10,t=!0){if(!this.hasView())return;const{canvas:i}=this.canvas,{offsetWidth:n,offsetHeight:r}=i;this.resize(n,r);const o=re(e),s=this.getRect();let a=(n-o[1]-o[3])/s.width;t||(a=(r-o[0]-o[2])/s.height),this.scale(a*this.store.data.scale),this.topView(o[0])}topView(e=10){if(!this.hasView())return;const t=this.getRect(),i=this.getViewCenter(),n=this.getPenRect(t);Tt(n);const{center:r}=n,{scale:o,origin:s,x:a,y:c}=this.store.data;this.translate((i.x-s.x)/o-r.x-a/o,(e-s.y)/o-n.y-c/o);const{canvas:l}=this.canvas,h=(l.scrollWidth-l.offsetWidth)/2,d=(l.scrollHeight-l.offsetHeight)/2;l.scrollTo(h,d)}centerView(){if(!this.hasView())return;const e=this.getRect(),t=this.getViewCenter(),i=this.getPenRect(e);Tt(i);const{center:n}=i,{scale:r,origin:o,x:s,y:a}=this.store.data;this.translate((t.x-o.x)/r-n.x-s/r,(t.y-o.y)/r-n.y-a/r);const{canvas:c}=this.canvas,l=(c.scrollWidth-c.offsetWidth)/2,h=(c.scrollHeight-c.offsetHeight)/2;c.scrollTo(l,h)}hasView(){return!!this.store.data.pens.filter((e=>!e.isRuleLine)).length}getViewCenter(){const{width:e,height:t}=this.canvas;return{x:e/2,y:t/2}}beSameByFirst(e=this.store.data.pens,t){const i=$(e),n=e[0],{width:r,height:o}=this.getPenRect(n);for(let i=1;i<e.length;i++){const n=e[i];"width"===t?this.setValue({id:n.id,width:r},{render:!1,doEvent:!1}):"height"===t?this.setValue({id:n.id,height:o},{render:!1,doEvent:!1}):this.setValue({id:n.id,width:r,height:o},{render:!1,doEvent:!1})}this.render(),this.pushHistory({type:H.Update,initPens:i,pens:e})}beSameByLast(e=this.store.data.pens,t){const i=$(e),n=e[e.length-1],{width:r,height:o}=this.getPenRect(n);for(let i=0;i<e.length-1;i++){const n=e[i];"width"===t?this.setValue({id:n.id,width:r},{render:!1,doEvent:!1}):"height"===t?this.setValue({id:n.id,height:o},{render:!1,doEvent:!1}):this.setValue({id:n.id,width:r,height:o},{render:!1,doEvent:!1})}this.render(),this.pushHistory({type:H.Update,initPens:i,pens:e})}formatPainterByFirst(e=this.store.data.pens){const t=$(e),i=e[0],n={};p.forEach((e=>{n[e]=i[e]}));for(let t=1;t<e.length;t++){const i=e[t];this.setValue({id:i.id,...n},{render:!1,doEvent:!1})}this.render(),this.pushHistory({type:H.Update,initPens:t,pens:e})}setFormatPainter(){const e=this.store.active,t={};if(e.length>0){const i=e[0];p.forEach((e=>{t[e]=i[e]||this.store.options.defaultFormat[e]||this.store.options[e]}))}else{const e={};p.forEach((t=>{e[t]=this.store.options.defaultFormat[t]||this.store.options[t]||void 0}))}localStorage.setItem("meta2d-formatPainter",JSON.stringify(t))}formatPainter(){const e=this.store.active,t=$(e),i=JSON.parse(localStorage.getItem("meta2d-formatPainter"));for(let t=0;t<e.length;t++){const n=e[t];this.setValue({id:n.id,...i},{render:!1,doEvent:!1})}this.render(),this.pushHistory({type:H.Update,initPens:t,pens:e})}clearFormatPainter(){const e={};p.forEach((t=>{e[t]=this.store.options.defaultFormat[t]||this.store.options[t]||void 0})),localStorage.setItem("meta2d-formatPainter",JSON.stringify(e)),this.formatPainter()}alignNodes(e,t=this.store.data.pens,i){!i&&(i=this.getPenRect(this.getRect(t)));const n=$(t);for(const n of t)this.alignPen(e,n,i);this.render(),this.pushHistory({type:H.Update,initPens:n,pens:t})}alignNodesByFirst(e,t=this.store.data.pens){const i=$(t),n=t[0],r=this.getPenRect(n);for(let i=1;i<t.length;i++){const n=t[i];this.alignPen(e,n,r)}this.render(),this.pushHistory({type:H.Update,initPens:i,pens:t})}alignNodesByLast(e,t=this.store.data.pens){const i=$(t),n=t[t.length-1],r=this.getPenRect(n);for(let i=0;i<t.length-1;i++){const n=t[i];this.alignPen(e,n,r)}this.render(),this.pushHistory({type:H.Update,initPens:i,pens:t})}alignPen(e,t,i){const n=this.getPenRect(t);switch(e){case"left":n.x=i.x;break;case"right":n.x=i.x+i.width-n.width;break;case"top":n.y=i.y;break;case"bottom":n.y=i.y+i.height-n.height;break;case"center":n.x=i.x+i.width/2-n.width/2;break;case"middle":n.y=i.y+i.height/2-n.height/2}this.setValue({id:t.id,...n},{render:!1,doEvent:!1})}spaceBetweenByDirection(e,t=this.store.data.pens,i){if(!i&&(i=this.getPenRect(this.getRect(t))[e]),(t=t.filter((e=>!e.parentId))).length<=2)return;const n=$(t),r=t.reduce(((t,i)=>t+this.getPenRect(i)[e]),0),o=(i-r)/(t.length-1);t=t.sort(((t,i)=>"width"===e?t.x-i.x:t.y-i.y));const s=this.getPenRect(t[0]);let a="width"===e?s.x:s.y;for(const i of t){const t=this.getPenRect(i);"width"===e?t.x=a:t.y=a,a+=t[e]+o,this.setValue({id:i.id,...t},{render:!1,doEvent:!1})}this.render(),this.pushHistory({type:H.Update,initPens:n,pens:t})}spaceBetween(e,t){this.spaceBetweenByDirection("width",e,t)}spaceBetweenColumn(e,t){this.spaceBetweenByDirection("height",e,t)}layout(e=this.store.data.pens,t,i=30){const n=this.getPenRect(St(e));!t&&(t=n.width);const r=$(e=e.filter((e=>!e.type&&!e.parentId)));let o=0;e.forEach((e=>{const t=this.getPenRect(e);t.height>o&&(o=t.height)}));let s=n.x,a=n.y;e.forEach(((r,c)=>{const l=this.getPenRect(r);if(l.x=s,l.y=a+o/2-l.height/2,this.setValue({id:r.id,...l},{render:!1,doEvent:!1}),c===e.length-1)return;const h=s+l.width-n.x,d=this.getPenRect(e[c+1]);Math.round(t-h)>=Math.round(d.width+i)?s+=l.width+i:(s=n.x,a+=o+i)})),this.render(),this.pushHistory({type:H.Update,initPens:r,pens:e})}gotoView(e){const t=this.getViewCenter(),i=t.x-e.calculative.worldRect.x-e.calculative.worldRect.width/2,n=t.y-e.calculative.worldRect.y-e.calculative.worldRect.height/2;this.canvas.scroll&&this.canvas.scroll.isShow&&this.canvas.scroll.translate(i-this.store.data.x,n-this.store.data.y),this.store.data.x=i,this.store.data.y=n,this.canvas.canvasImage.init(),this.canvas.canvasImageBottom.init(),this.render()}showMap(){this.map||(this.map=new _n(this.canvas)),this.map.show()}hideMap(){this.map.hide()}onSizeUpdate(){this.mapTimer&&(clearTimeout(this.mapTimer),this.mapTimer=void 0),this.mapTimer=setTimeout((()=>{this.map&&this.map.isShow&&this.map.show(),this.canvas.scroll&&this.canvas.scroll.isShow&&this.canvas.scroll.resize()}),500)}toggleAnchorMode(){this.canvas.toggleAnchorMode()}addAnchorHand(){this.canvas.addAnchorHand()}removeAnchorHand(){this.canvas.removeAnchorHand()}toggleAnchorHand(){this.canvas.toggleAnchorHand()}top(e){e||(e=this.store.active),Array.isArray(e)||(e=[e]);for(const t of e){const e=this.store.data.pens,i=[...ae(t,this.store),t].map((e=>e.id));e.filter((e=>i.includes(e.id))).forEach((t=>{const i=e.findIndex((e=>e.id===t.id));i>-1&&(e.push(e[i]),e.splice(i,1),this.initImageCanvas([t])),this.specificLayerMove(t,"top")}))}}initImageCanvas(e){this.canvas.initImageCanvas(e)}bottom(e){e||(e=this.store.active),Array.isArray(e)||(e=[e]);for(const t of e){const e=this.store.data.pens,i=[...ae(t,this.store),t].map((e=>e.id)),n=e.filter((e=>i.includes(e.id)));for(let t=n.length-1;t>=0;t--){const i=n[t],r=e.findIndex((e=>e.id===i.id));r>-1&&(e.unshift(e[r]),e.splice(r+1,1),this.initImageCanvas([i])),this.specificLayerMove(i,"bottom")}}}upByArea(e){if(-1===this.store.data.pens.findIndex((t=>t.id===e.id)))return void console.warn("upByArea: pen not in canvas");const t=[e,...ae(e,this.store)];let i=t.map((e=>this.store.data.pens.findIndex((t=>t.id===e.id))));i.includes(-1)&&(console.warn("upByArea: pen children not in canvas"),i=i.filter((e=>-1!==e)));const n=Math.min(...i),r=e.calculative.worldRect,o=this.store.data.pens.findIndex(((t,i)=>{if(i<=n)return!1;if(t.id===e.id||function(e,t){if(!e||!t)return!1;let i=se(e);for(;i;){if(i.id===t.id)return!0;i=se(i)}return!1}(t,e))return!1;const o=t.calculative.worldRect;return Et(r,o)}));if(-1!==o){this.store.data.pens.splice(o+1,0,...t);for(const e of t){const t=this.store.data.pens.findIndex((t=>t.id===e.id));t>-1&&this.store.data.pens.splice(t,1)}this.initImageCanvas([e])}else this.up(e)}specificLayerMove(e,t){if(e.image&&"gif"!==e.name){let i=!1;"bottom"!==t&&"down"!==t||(i=!0),this.setValue({id:e.id,isBottom:i},{render:!1,doEvent:!1,history:!1})}if(e.externElement||"gif"===e.name){let i=0;"top"===t?(e.calculative.canvas.maxZindex+=1,i=e.calculative.canvas.maxZindex):"up"===t?i=void 0===e.calculative.zIndex?5:e.calculative.zIndex+1:"down"===t&&(i=void 0===e.calculative.zIndex?3:e.calculative.zIndex-1,i<0&&(i=0)),this.setValue({id:e.id,zIndex:i},{render:!1,doEvent:!1,history:!1})}}up(e){e||(e=this.store.active),Array.isArray(e)||(e=[e]);for(const t of e){const e=this.store.data.pens;if(t.children&&t.children.length){const i=[...ae(t,this.store),t],n=[];for(let t=0;t<e.length;t++){const r=e[t];-1!==i.findIndex((e=>e.id===r.id))&&(r.temIndex=t,n.push(r))}let r=-1,o=0;n.forEach((t=>{t.temIndex-=o,e.splice(t.temIndex,1),o+=1,r=t.temIndex,delete t.temIndex,this.specificLayerMove(t,"up")})),e.splice(r+1,0,...n),this.initImageCanvas(n)}else{const i=e.findIndex((e=>e.id===t.id));i>-1&&i!==e.length-1&&(e.splice(i+2,0,e[i]),e.splice(i,1),this.initImageCanvas([t])),this.specificLayerMove(t,"up")}}}down(e){e||(e=this.store.active),Array.isArray(e)||(e=[e]);for(const t of e){const e=this.store.data.pens;if(t.children&&t.children.length){const i=[...ae(t,this.store),t],n=[];for(let t=0;t<e.length;t++){const r=e[t];-1!==i.findIndex((e=>e.id===r.id))&&(r.temIndex=t,n.push(r))}let r=-1,o=0;n.forEach(((t,i)=>{t.temIndex-=o,e.splice(t.temIndex,1),o+=1,0===i&&(r=t.temIndex),delete t.temIndex,this.specificLayerMove(t,"down")})),e.splice(r-1,0,...n),this.initImageCanvas(n)}else{const i=e.findIndex((e=>e.id===t.id));i>-1&&0!==i&&(e.splice(i-1,0,e[i]),e.splice(i+1,1),this.initImageCanvas([t])),this.specificLayerMove(t,"down")}}}setLayer(e,t,i=this.store.data.pens){const n=i.findIndex((t=>t.id===e.id));n>-1&&(n>t?(i.splice(t,0,i[n]),i.splice(n+1,1)):n<t&&(i.splice(t,0,i[n]),i.splice(n,1)))}changePenId(e,t){this.canvas.changePenId(e,t)}getLines(e,t="all"){if(e.type===r.Line)return[];const i=[];return e.connectedLines?.forEach((({lineId:n})=>{const r=this.store.pens[n];if(r)switch(t){case"all":i.push(r);break;case"in":Xe(r).connectTo===e.id&&i.push(r);break;case"out":$e(r).connectTo===e.id&&i.push(r)}else console.warn(e,"node contain a error connectedLine")})),i}nextNode(e){if(e.type===r.Line){const t=this.store.pens[Xe(e).connectTo];return t?[t]:[]}{const t=this.getLines(e,"out"),i=[];return t.forEach((e=>{const t=this.nextNode(e);for(const e of t)!i.find((t=>t.id===e.id))&&i.push(e)})),i}}previousNode(e){if(e.type===r.Line){const t=this.store.pens[$e(e).connectTo];return t?[t]:[]}{const t=this.getLines(e,"in"),i=[];return t.forEach((e=>{const t=this.previousNode(e);for(const e of t)!i.find((t=>t.id===e.id))&&i.push(e)})),i}}getNext(e){if(e.type===r.Line)return void console.warn("非连线节点");const t=[];return e.connectedLines?.forEach((({lineId:i,anchor:n})=>{const r=e.anchors?.filter((e=>e.id===n))[0],o=this.findOne(i);if(o.anchors[0].connectTo==e.id){const i=o.anchors[o.anchors.length-1].connectTo;if(i){const n=this.findOne(i),s=n.connectedLines?.filter((e=>e.lineId===o.id))[0],a=n.anchors.filter((e=>e.id===s.anchor))[0];t.push({from:e,fromAnchor:r,line:o,to:n,toAnchor:a})}}})),t}addAnchor(e,t,i){if(!e)return;if(e.anchors||(e.anchors=[]),e.calculative.worldAnchors||(e.calculative.worldAnchors=[]),e.type===r.Line&&(i<0&&(i=e.anchors.length+1+i),i>e.anchors.length&&(i=e.anchors.length),i<0&&(i=0),0==i&&e.anchors[0].connectTo||i==e.anchors.length&&e.anchors[i-1].connectTo))return void console.warn("端点存在连接关系");let n=null,o=null;t.x<=1&&t.x>=0&&t.y<=1&&t.y>=0?(o={id:t.id||ne(),penId:e.id,x:e.calculative.worldRect.x+e.calculative.worldRect.width*t.x,y:e.calculative.worldRect.y+e.calculative.worldRect.height*t.y},e.calculative.worldRect&&e.rotate%360&&S(o,e.rotate,e.calculative.worldRect.center),n={id:o.id,penId:e.id,x:t.x,y:t.y}):(o={id:t.id||ne(),penId:e.id,x:t.x,y:t.y},e.calculative.worldRect&&(e.rotate%360&&S(t,-e.rotate,e.calculative.worldRect.center),n={id:o.id,penId:e.id,x:(t.x-e.calculative.worldRect.x)/e.calculative.worldRect.width,y:(t.y-e.calculative.worldRect.y)/e.calculative.worldRect.height})),e.type===r.Line?(e.calculative.worldAnchors.splice(i,0,o),e.anchors.splice(i,0,n),this.canvas.updateLines(e),this.canvas.initLineRect(e),this.render()):(e.calculative.worldAnchors.push(o),e.anchors.push(n))}connectLine(e,t,i,n,r=!0){if(!i){const n=t.calculative.worldRect;i=We(e,{x:n.x+n.width/2,y:n.y+n.height/2})}if(!n){const i=e.calculative.worldRect;n=We(t,{x:i.x+i.width/2,y:i.y+i.height/2})}const o=Math.abs(i.x-n.x),s={height:Math.abs(i.y-n.y),lineName:"line",lineWidth:1,name:"line",type:1,width:o,x:Math.min(i.x,n.x),y:Math.min(i.y,n.y),anchors:[{x:i.x>n.x?1:0,y:i.y>n.y?1:0,id:ne()},{x:i.x>n.x?0:1,y:i.x>n.x?0:1,id:ne()}]};return this.addPens([s]),qe(e,i,s,s.calculative.worldAnchors[0]),qe(t,n,s,s.calculative.worldAnchors[1]),s.calculative.active=!1,this.canvas.updateLines(s),this.canvas.updateLines(e),this.canvas.updateLines(t),this.canvas.initLineRect(s),r&&this.render(),s}toComponent(e=this.store.data.pens,t,i){if(1===e.length){const t=$(e[0]);return t.type=r.Node,t.id=void 0,[t]}const n=$(e,!0),s=St(n);let a={id:ne(),name:"combine",...s,children:[],showChild:t};i&&(a.anchors=[{id:"0",penId:a.id,x:.5,y:0},{id:"1",penId:a.id,x:1,y:.5},{id:"2",penId:a.id,x:.5,y:1},{id:"3",penId:a.id,x:0,y:.5}]);const c=n.find((e=>e.width===s.width&&e.height===s.height)),l=c&&void 0===t;return l&&(c.children||(c.children=[]),a=c),n.forEach((e=>{if(e===a||e.parentId===a.id)return;if(e.parentId)return;a.children.push(e.id),e.parentId=a.id;const t=Dt(e.calculative.worldRect,s);Object.assign(e,t),e.locked=e.lockedOnCombine??o.DisableMove})),$(l?n:[a,...n])}setVisible(e,t,i=!0){if(this.onSizeUpdate(),this.setValue({id:e.id,visible:t},{render:!1,doEvent:!1}),e.children)for(const i of e.children){const e=this.store.pens[i];e&&this.setVisible(e,t,!1)}i&&this.render()}clearHover(){this.canvas.clearHover()}closeSocket(){this.closeWebsocket(),this.closeMqtt(),this.closeHttp()}destroy(e){if(this.clear(!1),this.closeSocket(),this.closeNetwork(),this.store.emitter.all.clear(),this.canvas.destroy(),this.canvas=void 0,N[this.store.id]=void 0,!e){for(const e in N)delete N[e];N.path2dDraws={},N.canvasDraws={},N.anchors={},N.htmlElements={}}}}function Pn(e,t){e.onDestroy||(e.onDestroy=En,e.onAdd=Cn);const i=t||new Path2D,{x:n,y:r,width:o,height:s,ex:a}=e.calculative.worldRect;let c=e.calculative.borderRadius||0,l=c;c<1&&(c*=o,l*=s);let h=c<l?c:l;o<2*h&&(h=o/2),s<2*h&&(h=s/2),i.moveTo(n+h,r),i.arcTo(n+o,r,n+o,r+s,h),i.arcTo(n+o,r+s,n,r+s,h),i.arcTo(n,r+s,n,r,h),i.arcTo(n,r,n+o,r,h);const d=.2*s;i.moveTo(n,r+d),i.lineTo(a,r+d);const u=r+d+(s-d)/2;if(i.moveTo(n,u),i.lineTo(a,u),i.closePath(),i instanceof Path2D)return i}function Cn(e){const{x:t,y:i,width:n,height:r}=e.calculative.worldRect,o=e.list,s={name:"text",x:t,y:i+.2*r,width:n,height:.4*r,textAlign:"left",textBaseline:"top",textLeft:10,textTop:10},a={name:"text",x:t,y:i+.6*r,width:n,height:.4*r,textAlign:"left",textBaseline:"top",textLeft:10,textTop:10};Object.assign(s,o[0]),Object.assign(a,o[1]),e.calculative.canvas.makePen(s),e.calculative.canvas.makePen(a),e.calculative.canvas.parent.pushChildren(e,[s]),e.calculative.canvas.parent.pushChildren(e,[a])}function En(e){const t=e.calculative.canvas.store;e.children.forEach((e=>{const i=t.data.pens.findIndex((t=>t.id===e));i>-1&&(t.data.pens.splice(i,1),t.pens[e]=void 0)})),e.children=void 0}function Rn(e,t){e.onDestroy||(e.onDestroy=Ln,e.onAdd=In);const i=t||new Path2D,{x:n,y:r,width:o,height:s,ex:a}=e.calculative.worldRect;let c=e.calculative.borderRadius||0,l=c;c<1&&(c*=o,l*=s);let h=c<l?c:l;o<2*h&&(h=o/2),s<2*h&&(h=s/2),i.moveTo(n+h,r),i.arcTo(n+o,r,n+o,r+s,h),i.lineTo(n+o,r+s-h),i.arcTo(n+o,r+s,n,r+s,h),i.arcTo(n,r+s,n,r,h),i.arcTo(n,r,n+o,r,h);const d=.2*s;if(i.moveTo(n,r+d),i.lineTo(a,r+d),i.closePath(),i instanceof Path2D)return i}function In(e){const{x:t,y:i,width:n,height:r}=e.calculative.worldRect,o=e.list;let s={name:"text",x:t,y:i+.2*r,width:n,height:.8*r,textAlign:"left",textBaseline:"top",textLeft:10,textTop:10};Object.assign(s,o[0]),e.calculative.canvas.makePen(s),e.calculative.canvas.parent.pushChildren(e,[s])}function Ln(e){const t=e.calculative.canvas.store;e.children.forEach((e=>{const i=t.data.pens.findIndex((t=>t.id===e));i>-1&&(t.data.pens.splice(i,1),t.pens[e]=void 0)})),e.children=[]}function Mn(){return{interfaceClass:Pn,simpleClass:Rn}}function Dn(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;if(i.rect(n,r,o,s),i.closePath(),i instanceof Path2D)return i}function Nn(e,t){const i=t.headHeight??50,{x:n,y:r,width:o,height:s,ey:a}=t.calculative.worldRect;let c=t.calculative.borderRadius||0,l=c;t.calculative.borderRadius<1&&(c*=o,l*=s);let h=c<l?c:l;o<2*h&&(h=o/2),i<2*h&&(h=i/2),e.beginPath(),e.moveTo(n+h,r),e.arcTo(n+o,r,n+o,r+i,h),e.arcTo(n+o,r+i,n,r+i,h),e.arcTo(n,r+i,n,r,h),e.arcTo(n,r,n+o,r,h),e.closePath(),e.stroke(),e.save(),e.beginPath(),e.lineWidth=1,e.setLineDash([7,7]);const d=n+o/2;e.moveTo(d,r+i+1),e.lineTo(d,a),e.stroke(),e.restore()}function On(){return{sequenceFocus:Dn}}function Bn(){return{lifeline:Nn}}function Fn(e,t){const{x:i,y:n,width:r,height:o}=t.calculative.worldRect;e.beginPath(),e.ellipse(i+r/2,n+o/2,r/2,o/2,0,0,2*Math.PI),e.stroke(),e.beginPath(),e.fillStyle=e.strokeStyle,e.ellipse(i+r/2,n+o/2,r/4,o/4,0,0,2*Math.PI),e.fill()}function zn(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s,ey:a}=e.calculative.worldRect,c=e.calculative.lineLeft||.08;let l=e.calculative.borderRadius||0,h=l;l<1&&(l*=o,h=s*l);let d=l<h?l:h;if(o<2*d&&(d=o/2),s<2*d&&(d=s/2),i.moveTo(n+d,r),i.arcTo(n+o,r,n+o,r+s,d),i.arcTo(n+o,r+s,n,r+s,d),i.arcTo(n,r+s,n,r,d),i.arcTo(n,r,n+o,r,d),i.closePath(),i.moveTo(n+c*o,r),i.lineTo(n+c*o,a),i instanceof Path2D)return i}function jn(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s,ex:a}=e.calculative.worldRect,c=e.calculative.lineTop||.08;let l=e.calculative.borderRadius||0,h=l;l<1&&(l*=o,h*=s);let d=l<h?l:h;if(o<2*d&&(d=o/2),s<2*d&&(d=s/2),i.moveTo(n+d,r),i.arcTo(n+o,r,n+o,r+s,d),i.arcTo(n+o,r+s,n,r+s,d),i.arcTo(n,r+s,n,r,d),i.arcTo(n,r,n+o,r,d),i.closePath(),i.moveTo(n,r+c*s),i.lineTo(a,r+c*s),i instanceof Path2D)return i}function Hn(){return{forkV:e,forkH:e,swimlaneH:zn,swimlaneV:jn}}function Un(){return{activityFinal:Fn}}function Wn(e,t){const i=t||new Path2D,{x:n,y:r,width:o,ey:s}=e.calculative.worldRect,a=o/4;if(i.moveTo(n+a,r),i.lineTo(n,r),i.lineTo(n,s),i.lineTo(n+a,s),i instanceof Path2D)return i}function Vn(e){e.anchors=[{x:.25,y:0},{x:.25,y:1},{x:0,y:.5}].map((({x:t,y:i},n)=>({id:n+"",x:t,y:i,penId:e.id})))}function qn(e,t){const i=t||new Path2D,{x:n,y:r,width:o,ex:s,ey:a}=e.calculative.worldRect,c=e.offsetX;let l=o/7;if(c>1?l=c:c>0&&(l=o*c),i.moveTo(n+l,r),i.lineTo(s,r),i.lineTo(n+o-l,a),i.lineTo(n,a),i.closePath(),i instanceof Path2D)return i}function Kn(e,t){const i=t||new Path2D,{x:n,y:r,height:o,ex:s,ey:a}=e.calculative.worldRect,c=o/7;if(i.moveTo(n,r+c),i.bezierCurveTo(n,r-c/2|0,s,r-c/2|0,s,r+c),i.lineTo(s,a-c),i.bezierCurveTo(s,a+c/2|0,n,a+c/2|0,n,a-c),i.closePath(),i.moveTo(n,a-c),i.bezierCurveTo(n,a-2*c|0,s,a-2*c|0,s,a-c),i instanceof Path2D)return i}function Yn(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s,ex:a,ey:c}=e.calculative.worldRect,l=o/8;if(i.moveTo(n+l,r),i.lineTo(a-l,r),i.bezierCurveTo(a+l/3,r,a+l/3,c,a-l,c),i.lineTo(n+l,c),i.lineTo(n,r+s/2),i.closePath(),i instanceof Path2D)return i}function $n(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s,ex:a,center:c}=e.calculative.worldRect,l=c.x,h=r+6*s/7,d=s/6;if(i.moveTo(n,r),i.lineTo(a,r),i.lineTo(a,h),i.bezierCurveTo(a-20,h-d,l+o/5,h-d,l,h),i.bezierCurveTo(l-o/5,h+d,n,h+d,n,h),i.closePath(),i instanceof Path2D)return i}function Xn(e){e.anchors=[{x:.5,y:0},{x:1,y:.5},{x:.5,y:6/7},{x:0,y:.5}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function Gn(e,t){const i=t||new Path2D,{x:n,y:r,width:o,ex:s,ey:a}=e.calculative.worldRect,c=o/10;if(i.moveTo(n+2*c,r),i.bezierCurveTo(n-2*c/3,r,n-2*c/3,a,n+2*c,a),i.lineTo(s,a),i.bezierCurveTo(s-c,a,s-c,r,s,r),i.closePath(),i instanceof Path2D)return i}function Qn(e,t){const i=t||new Path2D,{x:n,y:r,width:o,ex:s,ey:a}=e.calculative.worldRect;i.moveTo(n,r),i.lineTo(s,r),i.lineTo(s,a),i.lineTo(n,a),i.closePath();const c=o/7;if(i.moveTo(n,r+c),i.lineTo(s,r+c),i.moveTo(n+c,r),i.lineTo(n+c,a),i instanceof Path2D)return i}function Jn(e,t){const i=t||new Path2D,{x:n,y:r,height:o,ex:s,ey:a}=e.calculative.worldRect,c=o/4;if(i.moveTo(n,r+c),i.lineTo(s,r),i.lineTo(s,a),i.lineTo(n,a),i.closePath(),i instanceof Path2D)return i}function Zn(e){e.anchors=[{x:.5,y:.125},{x:1,y:.5},{x:.5,y:1},{x:0,y:.5}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function er(e,t){const i=t||new Path2D,{x:n,y:r,ex:o,ey:s}=e.calculative.worldRect;if(i.moveTo(n,r),i.lineTo(o,r),i.moveTo(n,s),i.lineTo(o,s),i instanceof Path2D)return i}function tr(e){e.anchors=[{x:.5,y:0},{x:.5,y:1}].map((({x:t,y:i},n)=>({id:n+"",x:t,y:i,penId:e.id})))}function ir(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s,ex:a,ey:c}=e.calculative.worldRect;if(i.ellipse(n+o/2,r+s/2,o/2,s/2,0,0,2*Math.PI),i.moveTo(n+o/2,c),i.lineTo(a,c),i.closePath(),i instanceof Path2D)return i}function nr(e,t){const i=t||new Path2D,{x:n,y:r,width:o,ex:s,ey:a}=e.calculative.worldRect,c=o/7;if(i.moveTo(n,r),i.lineTo(s,r),i.lineTo(s,a),i.lineTo(n,a),i.closePath(),i.moveTo(n+c,r),i.lineTo(n+c,a),i.moveTo(s-c,r),i.lineTo(s-c,a),i instanceof Path2D)return i}function rr(){return{flowComment:Wn,flowData:qn,flowDb:Kn,flowDisplay:Yn,flowDocument:$n,flowExternStorage:Gn,flowInternalStorage:Qn,flowManually:Jn,flowParallel:er,flowQueue:ir,flowSubprocess:nr}}function or(){return{flowDocument:Xn,flowManually:Zn,flowParallel:tr,flowComment:Vn}}function sr(e){const t=new Date,i=t.getFullYear(),n=t.getMonth()+1,r=t.getDate(),o=t.getDay(),s=t.getHours(),a=t.getMinutes(),c=t.getSeconds();return new Function("year","month","day","week","hours","minutes","seconds",e?`return ${e}`:"return `${year}:${month}:${day} ${hours}:${minutes}:${seconds} 星期${week}`")(i,n,r,["天","一","二","三","四","五","六"][o],s,a,c)}function ar(e){let t=globalThis.echarts;if(!e.echarts||!t)return;if("string"==typeof e.echarts)try{e.echarts=JSON.parse(e.echarts)}catch(e){}if(!e.echarts)return;e.onDestroy||(e.onDestroy=lr,e.onMove=hr,e.onResize=dr,e.onRotate=hr,e.onValue=ur,e.onBeforeValue=fr,e.onBinds=pr,e.onMouseEnter=hr,e.onAdd=cr,e.onRenderPenRaw=vr),e.calculative.singleton||(e.calculative.singleton={});const i=new Path2D,n=e.calculative.worldRect;if(!e.calculative.singleton.div){const i=document.createElement("div");i.style.position="absolute",i.style.outline="none",i.style.left="-9999px",i.style.top="-9999px",i.style.width=n.width+"px",i.style.height=n.height+"px",document.body.appendChild(i),e.calculative.canvas.externalElements?.parentElement.appendChild(i),nt(e,i),e.calculative.singleton.div=i,e.calculative.singleton.echart=t.init(i,e.echarts.theme),e.calculative.singleton.echartsReady=!0,e.echarts.geoName&&!t.getMap(e.echarts.geoName)&&(e.echarts.geoJson?t.registerMap(e.echarts.geoName,e.echarts.geoJson):e.echarts.geoUrl&&(e.calculative.singleton.echartsReady=!1,fetch(e.echarts.geoUrl).then((i=>{i.text().then((i=>{if("string"==typeof i)try{i=JSON.parse(i)}catch{}i.constructor===Object||i.constructor===Array?(t.registerMap(e.echarts.geoName,i),e.calculative.singleton.echartsReady=!0,e.calculative.singleton.echart.setOption(e.echarts.option,!0),setTimeout((()=>{vr(e)}),300)):console.warn("Invalid data:",i)}))})))),e.calculative.singleton.echartsReady&&setTimeout((()=>{e.calculative.singleton.echart.setOption(e.echarts.option,!0),setTimeout((()=>vr(e)),300)}))}return i}function cr(e){e.beforeScale=e.calculative.canvas.store.data.scale}function lr(e){if(e.calculative.singleton&&e.calculative.singleton.div){e.calculative.singleton.div.remove();let t=globalThis.echarts;t&&t.dispose(e.calculative.singleton.echart),delete e.calculative.singleton.div,delete e.calculative.singleton.echart}}function hr(e){e.calculative.singleton.div&&nt(e,e.calculative.singleton.div)}function dr(e){if(!e.calculative.singleton.echart)return;nt(e,e.calculative.singleton.div);let t=e.echarts.option;e.beforeScale||(e.beforeScale=e.calculative.canvas.store.data.scale);let i=e.calculative.canvas.store.data.scale/e.beforeScale;if(t.grid){let e=["top","bottom","left","right"];for(let n=0;n<e.length;n++)Array.isArray(t.grid)?t.grid.forEach((t=>{isNaN(t[e[n]])||(t[e[n]]*=i)})):isNaN(t.grid[e[n]])||(t.grid[e[n]]*=i)}if(t.dataZoom){let e=["right","top","width","height","left","bottom"];for(let n=0;n<e.length;n++)t.dataZoom.forEach((t=>{isNaN(t[e[n]])||(t[e[n]]*=i)}))}X(t,"fontSize",i),e.calculative.singleton.echart.setOption(t,!0),e.beforeScale=e.calculative.canvas.store.data.scale,e.calculative.singleton.echart.resize()}function ur(e){e.calculative.singleton.echart&&(nt(e,e.calculative.singleton.div),e.calculative.singleton.echartsReady&&e.calculative.singleton.echart.setOption(e.echarts.option,!0))}function fr(e,t){if(t.echarts)return t;if(e.realTimes&&e.realTimes.length){const{xAxis:i,yAxis:n}=e.echarts.option,{max:r,replaceMode:o,timeFormat:s}=e.echarts;for(let n in t)if(n.includes("echarts.option")){let a=xn(e,n);if(Array.isArray(a)&&o===kn.Add){a.push(t[n]),r&&a.splice(0,a.length-r),t[n]=a;let o="echarts.option.xAxis.data";Array.isArray(i)&&i.length&&(o="echarts.option.xAxis.0.data");let c=xn(e,o),l=sr(s||"`${hours}:${minutes}:${seconds}`");c.push(l),r&&c.splice(0,c.length-r),t[o]=c}}return t}if(!t.dataX&&!t.dataY)return t;const i=e.echarts,{max:n,replaceMode:r}=i;let o=t.dataX,s=t.dataY;const a=i.option.series,c=a.length,{xAxis:l,yAxis:h}=i.option;Array.isArray(l)&&l.length>1&&console.warn("echarts 只支持单 x 轴,多 x 轴将被忽略");const d=Array.isArray(l)?l[0]:l,u=Array.isArray(h)?h[0]:h;if(r)if(r===kn.Replace)if(d||u){if(("category"===d.type||"category"===u.type)&&o&&s){const e="category"===d.type?d.data:u.data;!Array.isArray(o)&&(o=[o]),!Array.isArray(s)&&(s=[s]),1===c?s.forEach(((t,i)=>{const n=e.indexOf(o[i]);a[0].data[n]=t})):a.forEach(((t,i)=>{s[i].forEach(((i,n)=>{const r=e.indexOf(o[n]);t.data[r]=i}))}))}}else s&&(1===c?(!Array.isArray(s)&&(s=[s]),s.forEach(((e,t)=>{const i=a[0].data.find((t=>t.name===e.name));i&&(i.value=e.value)}))):a.forEach(((e,t)=>{Array.isArray(s[t])||(s[t]=[s[t]]),s[t].forEach(((t,i)=>{const n=e.data.find((e=>e.name===t.name));n&&(n.value=t.value)}))})));else r===kn.ReplaceAll&&(o&&(d.data=o,d.data.splice(0,d.data.length-n)),s&&(1===c?(a[0].data=s,a[0].data.splice(0,a[0].data.length-n)):a.forEach(((e,t)=>{e.data=s[t],e.data.splice(0,e.data.length-n)}))));else{if(o){!Array.isArray(o)&&(o=[o]);const e=d.data;e.push(...o),e.splice(0,e.length-n)}if(s)if(1===c){!Array.isArray(s)&&(s=[s]);const e=a[0].data;e.push(...s),e.splice(0,e.length-n)}else a.forEach(((e,t)=>{Array.isArray(s[t])||(s[t]=[s[t]]);const i=e.data;i.push(...s[t]),i.splice(0,i.length-n)}))}return delete t.dataX,delete t.dataY,Object.assign(t,{echarts:i})}function pr(e,t,i){if("dataY"!==i.key)return;const n=e.echarts,{xAxis:r,yAxis:o}=n.option;Array.isArray(r)&&r.length>1&&console.warn("echarts 只支持单 x 轴,多 x 轴将被忽略");const s=Array.isArray(r)?r[0]:r,a=Array.isArray(o)?o[0]:o,c=n.option.series;if(s||a){if("category"===s.type||"category"===a.type){const n=[],r=[],o="category"===s.type?s.data:a.data;return o?.forEach((e=>{const{dataId:o}=i.dataIds.find((t=>t.name===e));if(o){const i=t.find((e=>e.dataId===o));i&&(r.push(e),n.push(i.value))}})),{id:e.id,dataY:n,dataX:r}}if("time"===s.type){const n=[],r=+new Date;let o=!1;if(c.forEach(((e,s)=>{const a=[],{dataId:c}=i.dataIds.find((t=>t.name===e.name));if(c){const e=t.find((e=>e.dataId===c));e&&(a.push([r,e.value]),o=!0)}n[s]=a})),!o)return;return n.forEach(((e,t)=>{if(!e||0===e.length){const e=c[t].data[c[t].data.length-1];n[t]=[[r,e[1]]]}})),{id:e.id,dataY:1===n.length?n[0]:n}}}else{const n=[];if(Array.isArray(c)&&1===c.length)return c[0].data.forEach((e=>{const{dataId:r}=i.dataIds.find((t=>t.name===e.name));if(r){const i=t.find((e=>e.dataId===r));i&&n.push({name:e.name,value:i.value})}})),{id:e.id,dataY:n}}}function vr(e){const t=new Image;t.src=e.calculative.singleton?.echart?.getDataURL({pixelRatio:2}),e.calculative.img=t}function xr(e){const t=globalThis.Highcharts;if(!t)return;if("string"==typeof e.highcharts)try{e.highcharts=JSON.parse(e.highcharts.option)}catch(e){}if(!e.highcharts)return;e.onDestroy||(e.onDestroy=gr,e.onMove=yr,e.onResize=mr,e.onRotate=yr,e.onValue=br,e.onBeforeValue=wr,e.onRenderPenRaw=_r),e.calculative.singleton||(e.calculative.singleton={});const i=new Path2D,n=e.calculative.worldRect;if(!e.calculative.singleton.div){const i=document.createElement("div");i.style.position="absolute",i.style.outline="none",i.style.left="-9999px",i.style.top="-9999px",i.style.width=n.width+"px",i.style.height=n.height+"px",i.style.minWidth="100px",i.style.minHeight="100px",i.id=e.id,document.body.appendChild(i),e.calculative.singleton.div=i,setTimeout((()=>{e.calculative.singleton.highchart=t.chart(e.id,e.highcharts.option);const i=e.calculative.singleton.highchart.getSVG(),n=new Image;n.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(i))),e.calculative.img=n})),e.calculative.canvas.externalElements?.parentElement.appendChild(i),nt(e,i)}return e.calculative.patchFlags&&e.calculative.singleton.div&&nt(e,e.calculative.singleton.div),i}function gr(e){e.calculative.singleton&&e.calculative.singleton.div&&(e.calculative.singleton.div.remove(),e.calculative.singleton.highchart.destroy(),delete e.calculative.singleton.div,delete e.calculative.singleton.highchart)}function yr(e){e.calculative.singleton.div&&nt(e,e.calculative.singleton.div)}function mr(e){e.calculative.singleton.div&&(nt(e,e.calculative.singleton.div),setTimeout((()=>{e.calculative.singleton.highchart.reflow()}),100))}function br(e){e.calculative.singleton.div&&nt(e,e.calculative.singleton.div)}function wr(e,t){if(t.highcharts)return e.calculative.singleton.highchart.update(t.highcharts.option),t;if(!t.dataX&&!t.dataY)return t;const i=e.highcharts,n=i.max;let r=t.dataX,o=t.dataY;const s=i.option.series.length;if(t.overwrite)r&&(i.option.xAxis.categories=r,i.option.xAxis.categories.splice(0,i.option.xAxis.categories.length-n)),o&&(1===s?(i.option.series[0].data=o,i.option.series[0].data.splice(0,i.option.series[0].data.length-n)):i.option.series.forEach(((e,t)=>{e.data=o[t],e.data.splice(0,e.data.length-n)}))),e.calculative.singleton.highchart.update(i.option);else{let t=[],a=null,c=!1;if(r){Array.isArray(r)||(r=[r]);const e=i.option.xAxis,o=Array.isArray(e)?e[0].categories:e.categories;o&&(o.push(...r),o.splice(0,o.length-n),c=!0),t=[...r]}o&&(1===s?(Array.isArray(o)||(o=[o]),a=[o]):(a=[],i.option.series.forEach(((e,t)=>{Array.isArray(o[t])||(o[t]=[o[t]]),a.push(o[t])})))),a&&e.calculative.singleton.highchart.series.forEach(((e,i)=>{a[i].forEach(((i,r)=>{let o=!1;n&&e.data.length>=n&&(o=!0);const s=c||null==t[r]?i:[t[r],i];e.addPoint(s,!0,o)}))}))}return delete t.dataX,delete t.dataY,delete t.overwrite,Object.assign(t,{highcharts:i})}function _r(e){if(!e.calculative?.singleton)return;const t=e.calculative.singleton.highchart.getSVG(),i=new Image;i.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t))),e.calculative.img=i}function kr(e){let t=globalThis.lcjs;if(!e.lightningCharts||!t)return;if("string"==typeof e.lightningCharts)try{e.lightningCharts=JSON.parse(e.lightningCharts)}catch(e){}if(!e.lightningCharts)return;e.onDestroy||(e.onDestroy=Ar,e.onMove=Sr,e.onResize=Pr,e.onRotate=Sr,e.onValue=Cr,e.onRenderPenRaw=Er);const i=new Path2D,n=e.calculative.worldRect;if(e.calculative.singleton||(e.calculative.singleton={}),!e.calculative.singleton.div){const t=document.createElement("div");t.style.position="absolute",t.style.outline="none",t.style.left="-9999px",t.style.top="-9999px",t.style.width=n.width+"px",t.style.height=n.height+"px",t.id=e.id,document.body.appendChild(t),e.calculative.singleton.div=t,setTimeout((()=>{Tr(e)}),100),setTimeout((()=>{e.calculative.canvas.externalElements&&e.calculative.canvas.externalElements.parentElement.appendChild(t),nt(e,t);const i=new Image;i.src=e.calculative.singleton.div.children[0].toDataURL(),e.calculative.img=i}),400)}return e.calculative.patchFlags&&e.calculative.singleton.div&&nt(e,e.calculative.singleton.div),i}function Tr(e){const{lightningChart:t,PieChartTypes:i,LegendBoxBuilders:n,SliceLabelFormatters:r,Themes:o,GaugeChartTypes:s,SolidLine:a,SolidFill:c,ColorRGBA:l,UIOrigins:h,emptyLine:d,AutoCursorModes:u,AxisScrollStrategies:f,AxisTickStrategies:p,UIElementBuilders:v}=lcjs,x=e.lightningCharts.option.data,g=e.lightningCharts.option.title||"Title",y=o[e.lightningCharts.option.theme||"lightNew"];switch(e.calculative.singleton.lightningChart=t(),e.lightningCharts.option.type){case"line":const t=e.calculative.singleton.lightningChart.ChartXY({container:e.id}).setTitle(g);x.forEach((e=>{t.addLineSeries().setName(e.name).add(e.data)}));break;case"bar":const i=e.calculative.singleton.lightningChart;let o;o=t=>{const r=[],o=[],s=i.ChartXY(t).setTitle(g).setAutoCursorMode(u.onHover).setMouseInteractions(!1).setPadding({bottom:30}),a=s.getDefaultAxisX().setMouseInteractions(!1).setScrollStrategy(void 0).setTickStrategy(p.Empty);s.getDefaultAxisY().setMouseInteractions(!1).setTitle(e.lightningCharts.option.yTitle).setInterval(0,70).setScrollStrategy(f.fitting),s.setAutoCursor((e=>e.disposePointMarker().disposeTickMarkerX().disposeTickMarkerY().setGridStrokeXStyle(d).setGridStrokeYStyle(d).setResultTable((e=>{e.setOrigin(h.CenterBottom)}))));const c=s.addLegendBox(n.VerticalLegendBox).setAutoDispose({type:"max-width",maxWidth:.2});return{addCategory:e=>{const t=(e=>{const t=s.addRectangleSeries();return t.setCursorResultTableFormatter(((t,i,n)=>{let r={name:e.name,value:e.data[e.figures.indexOf(n)]};return t.addRow("Department:",r.name).addRow("# of employees:",String(r.value))})),t})(e).setName(e.name);e.figures=e.data.map((e=>t.add({x:0,y:0,width:0,height:0}))),c.add(t),o.push(e),(()=>{let e=0;for(let t=0;t<r.length;t++){const i=r[t],n=e;for(const i of o){const n=i.data[t];void 0!==n&&(i.figures[t].setDimensions({x:e,y:0,width:10,height:n}),e+=12.5)}i.tick.setValue((n+e-2.5)/2),e+=7.5}a.setInterval(-10,e)})()},addGroups:e=>{for(const t of e)r.push({name:t,tick:a.addCustomTick(v.AxisTick).setGridStrokeLength(0).setTextFormatter((e=>t))})}}};const s=o({theme:y,container:e.id});s.addGroups(e.lightningCharts.option.groups);const a=e.lightningCharts.option.categories;x.forEach(((e,t)=>s.addCategory({name:a[t],data:e})));break;case"pie":const m=e.calculative.singleton.lightningChart.Pie({theme:y,container:e.id}).setTitle(g).setAnimationsEnabled(!0).setMultipleSliceExplosion(!0);x.map((e=>m.addSlice(e.name,e.value))),m.setInnerRadius(e.lightningCharts.option.innerRadius||0).setLabelFormatter(r.NamePlusRelativeValue),m.addLegendBox(n.VerticalLegendBox).setAutoDispose({type:"max-width",maxWidth:.3}).add(m);break;case"gauge":const b=e.calculative.singleton.lightningChart.Gauge({theme:y,container:e.id}).setTitle(g).setThickness(20).setAngleInterval(e.lightningCharts.option.startAngle||225,e.lightningCharts.option.endAngle||-45);let w=function(e){let t=e.toLowerCase();if(t&&/^#([0-9|a-f]{3}|[0-9|a-f]{6})$/.test(t)){4==t.length&&(t="#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);for(var i=[],n=1;n<7;n+=2)i.push(parseInt("0x"+t.slice(n,n+2)));return i}return t&&/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/.test(t)?t.match(/\(([^)]*)\)/)[1].split(",").map((e=>parseInt(e))):t}(e.lightningCharts.option.background);b.getDefaultSlice().setInterval(e.lightningCharts.option.min||0,e.lightningCharts.option.max||100).setValue(x).setFillStyle(new c({color:l(w[0],w[1],w[2])}))}}function Ar(e){e.calculative.singleton&&e.calculative.singleton.div&&(e.calculative.singleton.div.remove(),delete e.calculative.singleton.div,delete e.calculative.singleton.lightningChart)}function Sr(e){e.calculative.singleton.div&&nt(e,e.calculative.singleton.div)}function Pr(e){e.calculative.singleton.div&&nt(e,e.calculative.singleton.div)}function Cr(e){e.calculative.singleton.div&&(Tr(e),nt(e,e.calculative.singleton.div))}function Er(e){if(!e.calculative?.singleton)return;const t=new Image;t.src=e.calculative.singleton.div.children[0].toDataURL(),e.calculative.img=t}function Rr(e){e&&(globalThis.echarts=e),O({echarts:ar})}function Ir(e){e&&(globalThis.Highcharts=e),O({highcharts:xr})}function Lr(e){e&&(globalThis.lcjs=e),O({lightningCharts:kr})}function Mr(e,t){t.onAdd||(t.onAdd=Dr,t.onMouseMove=Br,t.onMouseLeave=Fr,t.onMouseDown=zr,t.onShowInput=Nr,t.onInput=Or,t.onValue=qr,t.onBeforeValue=Kr);const i=t.calculative.canvas.store.data,n=t.calculative.canvas.store.options;t.color=t.color||i.color||n.color,t.activeColor=t.activeColor||n.activeColor,t.hoverColor=t.hoverColor||n.hoverColor,t.activeBackground=t.activeBackground||n.activeBackground,t.hoverBackground=t.hoverBackground||n.hoverBackground,function(e,t){if(!t.colPos)return;const i=t.calculative.worldRect;e.save(),e.strokeStyle=t.color,e.beginPath(),e.rect(i.x,i.y,i.width,i.height),t.background&&(e.fillStyle=t.background,e.fill()),e.stroke();let n=t.rowPos[t.rowPos.length-1];for(const i of t.rowPos){if(i===n)continue;const r=i*t.calculative.worldRect.height/t.tableHeight;e.beginPath(),e.moveTo(t.calculative.worldRect.x,t.calculative.worldRect.y+r),e.lineTo(t.calculative.worldRect.ex,t.calculative.worldRect.y+r),e.stroke()}n=t.colPos[t.colPos.length-1],t.colPos.forEach(((i,r)=>{if(i===n)return;const o=i*t.calculative.worldRect.width/t.tableWidth;e.beginPath(),e.moveTo(t.calculative.worldRect.x+o,t.calculative.worldRect.y),e.lineTo(t.calculative.worldRect.x+o,t.calculative.worldRect.ey),e.stroke()})),e.restore()}(e,t),function(e,t){if(!t.colPos)return;t.calculative.texts||(t.calculative.texts=[]);for(let i=0;i<t.rowPos.length;i++)for(let n=0;n<t.colPos.length;n++){let r,o=Hr(t,i,n),s=o.color||t.color,a=o.background;t.calculative.activeCell?.row===i&&t.calculative.activeCell?.col===n&&(s=t.activeColor,a=t.activeBackground,r=s),t.calculative.hoverCell?.row===i&&t.calculative.hoverCell?.col===n&&(s=t.hoverColor,a=t.hoverBackground,r=s);const c=Wr(t,i,n);a&&(e.save(),e.fillStyle=a,e.fillRect(c.x,c.y,c.width,c.height),e.restore()),r&&(e.save(),e.strokeStyle=r,e.strokeRect(c.x,c.y,c.width,c.height),e.restore()),t.calculative.worldTextRect=c;let l=t.calculative.texts[i];if(t.calculative.texts[i]||(l=[],t.calculative.texts.push(l)),null==l[n]){if(Array.isArray(o)){l[n]="",o[0].id||(Vr(t,c,o),t.calculative.canvas.parent.pushChildren(t,o));continue}if(l[n]=o.text||o+"",!l[n])continue;l[n]=V(t,l[n])}if(l[n]){if(e.save(),e.fillStyle=s,e.textAlign="center",e.textBaseline="middle",e.font=(t.calculative.fontStyle||"")+" normal "+(t.calculative.fontWeight||"")+" "+1*(t.calculative.fontSize||12)+"px "+t.calculative.fontFamily,1===l[n].length)e.fillText(l[n][0],c.x+c.width/2,c.y+c.height/2);else{const i=.55,r=t.calculative.fontSize*t.calculative.lineHeight*1,o=l[n].length*r;let s=(c.height-o)/2;l[n].forEach(((t,n)=>{e.fillText(t,c.x+c.width/2,c.y+s+(n+i)*r)}))}e.restore()}}}(e,t)}function Dr(e){!function(e){const t=[],i=[];e.table.rowHeight||(e.table.rowHeight=40),e.table.colWidth||(e.table.colWidth=150);let n=0;for(const i of e.table.header.data)n+=i.width||e.table.colWidth,t.push(n);let r=0;0!=e.table.header.show&&(r+=e.table.header.height||e.table.rowHeight,i.push(r));for(const t of e.table.data)r+=t.height||e.table.rowHeight,i.push(r);e.colPos=t,e.rowPos=i,e.tableWidth=n,e.tableHeight=r,e.width||(e.width=n,e.height=r,e.calculative.width=n,e.calculative.height=r,e.calculative.worldRect={x:e.x,y:e.y,height:e.height,width:e.width},At(e.calculative.worldRect))}(e)}function Nr(e,t){if(!e.calculative.hoverCell)return;const i=Hr(e,e.calculative.hoverCell.row,e.calculative.hoverCell.col);if(Array.isArray(i))return;e.calculative.inputCell=e.calculative.hoverCell;const n=Wr(e,e.calculative.hoverCell.row,e.calculative.hoverCell.col);e.calculative.tempText=i.text||i+"",e.calculative.canvas.showInput(e,n,"#ffffff")}function Or(e,t){e.calculative.inputCell&&(Ur(e,e.calculative.inputCell.row,e.calculative.inputCell.col,t),e.calculative.canvas.render())}function Br(e,t){e.calculative.hoverCell=jr(e,t),e.calculative.canvas.render()}function Fr(e,t){e.calculative.hoverCell=void 0,e.calculative.canvas.render()}function zr(e,t){e.calculative.activeCell=jr(e,t),e.calculative.canvas.render()}function jr(e,t){const i=e.calculative.worldRect.width/e.tableWidth,n=e.calculative.worldRect.height/e.tableHeight,r={row:0,col:0};for(let n=0;n<e.colPos.length;n++)t.x>e.calculative.worldRect.x+e.colPos[n]*i&&(r.col=n+1);for(let i=0;i<e.rowPos.length;i++)t.y>e.calculative.worldRect.y+e.rowPos[i]*n&&(r.row=i+1);return r}function Hr(e,t,i){if(!e.table.data||!Array.isArray(e.table.data))return;if(0==e.table.header.show){const n=e.table.data[t];if(Array.isArray(n))return n[i];if(!n.data||!Array.isArray(n.data))return;return n.data[i]}if(0===t){const t=e.table.header.data[i];return t.fontWeight=e.table.header.fontWeight,t}const n=e.table.data[t-1];if(n){if(Array.isArray(n))return n[i];if(n.data&&Array.isArray(n.data))return n.data[i]}}function Ur(e,t,i,n){if(!e.table.data||!Array.isArray(e.table.data))return;let r;e.calculative.texts=void 0,0==e.table.header.show?(r=e.table.data[t],Array.isArray(r)||r.data&&Array.isArray(r.data)&&(r=r.data)):0===t?r=e.table.header.data:(r=e.table.data[t-1],Array.isArray(r)||r.data&&Array.isArray(r.data)&&(r=r.data)),r&&(r[i]instanceof Object?r[i].text=n:r[i]=n,e.calculative.canvas.store.emitter.emit("valueUpdate",e))}function Wr(e,t,i){const n=e.calculative.worldRect.width/e.tableWidth,r=e.calculative.worldRect.height/e.tableHeight;let o=0,s=e.colPos[i]*n;i>0&&(o=e.colPos[i-1]*n);let a=0,c=e.rowPos[t]*r;return t>0&&(a=e.rowPos[t-1]*r),{x:e.calculative.worldRect.x+o,y:e.calculative.worldRect.y+a,ex:e.calculative.worldRect.x+s,ey:e.calculative.worldRect.y+c,width:s-o,height:c-a}}function Vr(e,t,i){const n=e.calculative.worldRect.width/e.tableWidth,r=e.calculative.worldRect.height/e.tableHeight;let o=0,s=0,a=0;for(const e of i)s+e.width*n+20*n<t.width?(e.x=t.x+s+10*n,e.y=t.y+a+10*r,s+=(e.width+10)*n,o=Math.max(o,a+(e.height+10)*r)):(s=0,a=o,e.x=t.x+s+10*n,e.y=t.y+a+10*r,o+=(e.height+10)*r);if(o+20*r<t.height){const e=(t.height-o-10*r)/2;for(const t of i)t.y+=e}}function qr(e){e.calculative.texts=void 0}function Kr(e,t){return t.table||null==t.col&&null==t.row||(Ur(e,t.row,t.col,t.value),e.calculative.canvas.render(),delete t.col,delete t.row),t}function Yr(e,t){const i=14*t.calculative.worldRect.height/16,n=(e.match(/[\u4e00-\u9fa5]/g)||"").length;return(e.length-n)*i*.6+n*i}function $r(e){if("horizontal"==e.direction){const t=[];let i=0;const n=e.height;e.checkboxHeight=n,e.options.forEach(((r,o)=>{t.push(o*(40+n)+i),i+=Yr(r.text,e)})),e.optionPos=t;const r=t.length*(40+n)+i;e.checkboxWidth=r,e.width=r,e.calculative.width=r,e.calculative.worldRect={x:e.x,y:e.y,height:e.height,width:e.width,center:{x:e.x+e.width/2,y:e.y+e.height/2}},At(e.calculative.worldRect)}else if("vertical"==e.direction){null==e.optionInterval&&(e.optionInterval=20),e.optionHeight||(e.optionHeight=20);const t=[];e.options.forEach(((i,n)=>{t.push(n*(e.optionInterval+e.optionHeight))})),e.optionPos=t;const i=t[t.length-1]+e.optionHeight;e.checkboxHeight=i,e.width||(e.height=i,e.calculative.height=i,e.calculative.worldRect={x:e.x,y:e.y,height:e.height,width:e.width,center:{x:e.x+e.width/2,y:e.y+e.height/2}},At(e.calculative.worldRect))}}function Xr(e,t){t.onAdd||(t.onAdd=Gr,t.rowPos&&t.colPos||t.onAdd(t),t.onMouseMove=Zr,t.onMouseLeave=eo,t.onMouseDown=to,t.onShowInput=Qr,t.onInput=Jr,t.onValue=co,t.onBeforeValue=lo);const i=t.calculative.canvas.store.data,n=t.calculative.canvas.store.options;t.color=t.color||i.color||n.color,t.textColor=t.textColor||t.color||i.textColor||n.textColor,t.activeColor=t.activeColor||n.activeColor,t.hoverColor=t.hoverColor||n.hoverColor,t.activeBackground=t.activeBackground||n.activeBackground,t.hoverBackground=t.hoverBackground||n.hoverBackground,function(e,t){if(!t.colPos)return;const{x:i,y:n,width:r,height:o,ex:s,ey:a}=t.calculative.worldRect;e.save(),e.strokeStyle=t.color,e.beginPath();let c=t.calculative.borderRadius||0,l=c;c<1&&(c*=r,l*=o);let h=c<l?c:l;if(r<2*h&&(h=r/2),o<2*h&&(h=o/2),e.moveTo(i+h,n),e.arcTo(s,n,s,a,h),e.arcTo(s,a,i,a,h),e.arcTo(i,a,i,n,h),e.arcTo(i,n,s,n,h),t.background&&(e.fillStyle=t.background,e.fill()),!1!==t.bordered&&e.stroke(),!1!==t.hLine){let i=t.rowPos[t.rowPos.length-1];for(const n of t.rowPos){if(n===i)continue;const r=n*t.calculative.worldRect.height/t.tableHeight;e.beginPath(),e.moveTo(t.calculative.worldRect.x,t.calculative.worldRect.y+r),e.lineTo(t.calculative.worldRect.ex,t.calculative.worldRect.y+r),e.stroke()}}if(!1!==t.vLine){let i=t.colPos[t.colPos.length-1];t.colPos.forEach(((n,r)=>{if(n===i)return;const o=n*t.calculative.worldRect.width/t.tableWidth;e.beginPath(),e.moveTo(t.calculative.worldRect.x+o,t.calculative.worldRect.y),e.lineTo(t.calculative.worldRect.x+o,t.calculative.worldRect.ey),e.stroke()}))}e.restore()}(e,t),function(e,t){if(!t.colPos)return;t.calculative.texts||(t.calculative.texts=[]);for(let i=0;i<t.rowPos.length;i++){let{style:n}=ro(t,i);for(let r=0;r<t.colPos.length;r++){let{value:o,style:s}=no(t,i,r),a=!0;s.wheres&&Array.isArray(s.wheres)&&(a=!1,a=s.wheres.every((function(e){return new Function("attr",`return attr ${e.comparison} ${e.value}`)(o)})));let c,l=t.color,h=t.textColor||t.color,d=null,u=null,f=null,p=null;a&&(l=s.color||n.color||t.color,h=s.textColor||n.textColor||t.textColor,d=s.background||n.background,u=(s.fontSize||n.fontSize||0)*t.calculative.canvas.store.data.scale,f=s.fontWeight||n.fontWeight,p=s.fontStyle||n.fontStyle),t.stripe&&(!1!==t.hasHeader?i%2==1&&(d=d||t.stripeColor||"#407FFF1F"):i%2==0&&(d=d||t.stripeColor||"#407FFF1F")),t.calculative.active&&t.calculative.activeCell?.row===i&&t.calculative.activeCell?.col===r&&(l=t.activeColor,d=t.activeBackground,c=l,h=t.activeTextColor||t.activeColor),t.calculative.hoverCell?.row===i&&t.calculative.hoverCell?.col===r&&(l=t.hoverColor,d=t.hoverBackground,h=t.hoverTextColor||t.hoverColor,c=l);const v=so(t,i,r);d&&(e.save(),e.fillStyle=d,e.fillRect(v.x,v.y,v.width+.25*t.calculative.canvas.store.data.scale,v.height),e.restore()),c&&(e.save(),e.strokeStyle=c,e.strokeRect(v.x,v.y,v.width,v.height),e.restore()),t.calculative.worldTextRect=v;let x=t.calculative.texts[i];if(t.calculative.texts[i]||(x=[],t.calculative.texts.push(x)),null==x[r]){if("object"==typeof o){const e=t.styles&&t.styles.filter((e=>e.col===r&&void 0===e.row&&e.pens));if(e.length>0){if(x[r]="",t.isFirstTime){let n=JSON.parse(JSON.stringify(e[0].pens));n.forEach((e=>{Object.assign(e,{row:i,col:r},o),e.activeBackground=e.background,e.hoverBackground=e.background,e.activeColor=e.color,e.hoverColor=e.color,e.activeTextColor=e.textColor,e.hoverTextColor=e.textColor,e.height*=t.calculative.canvas.store.data.scale,e.width*=t.calculative.canvas.store.data.scale})),ao(t,v,n),t.calculative.canvas.parent.pushChildren(t,n)}continue}}else x[r]=void 0===o?"":o.text||o+"";if(!x[r])continue;x[r]=V(t,x[r])}if(x[r]){if(e.save(),e.fillStyle=h,e.textAlign="center",e.textBaseline="middle",e.font=(p||t.calculative.fontStyle||"")+" normal "+(f||t.calculative.fontWeight||"")+" "+1*(u||t.calculative.fontSize||12)+"px "+t.calculative.fontFamily,1===x[r].length)e.fillText(x[r][0],v.x+v.width/2,v.y+v.height/2);else{const i=.55,n=(u||t.calculative.fontSize)*t.calculative.lineHeight*1,o=x[r].length*n;let s=(v.height-o)/2;x[r].forEach(((t,r)=>{e.fillText(t,v.x+v.width/2,v.y+s+(r+i)*n)}))}e.restore()}}}}(e,t),function(e,t){if(!t.calculative.hover)return;if(!t.calculative.hoverCell)return;if(t.calculative.isInput)return;if(!t.calculative.isHover)return;const{row:i,col:n}=t.calculative.hoverCell,{x:r,y:o}=t.calculative.canvas.mousePos;if(!t.data[i])return;let s=t.data[i][n];if("object"==typeof s||!s)return;e.save(),e.textAlign="start",e.textBaseline="middle",e.font=e.font=(t.calculative.fontStyle||"")+" normal "+(t.calculative.fontWeight||"")+" "+(t.calculative.fontSize||12)+"px "+t.calculative.fontFamily;const a=e.measureText(s).width;e.beginPath(),e.fillStyle="#fff",e.strokeStyle="#000",e.moveTo(r,o),e.rect(r-10,o,a+20,20),e.fill(),e.stroke(),e.beginPath(),e.fillStyle="#000",e.fillText(s,r,o+10),e.restore()}(e,t),t.isFirstTime=!1}function Gr(e){e.isFirstTime=!0,function(e){const t=[],i=[];e.rowHeight||(e.rowHeight=40),e.colWidth||(e.colWidth=150);let n=0;const r=e.styles&&e.styles.filter((e=>void 0!==e.col&&void 0===e.row&&e.width));let o={};r&&r.forEach((e=>{o[e.col]=e.width}));for(let i=0;i<e.data[0].length;i++)n+=(o[i]||e.colWidth)*e.calculative.canvas.store.data.scale,t.push(n);let s=0;const a=e.styles&&e.styles.filter((e=>void 0===e.col&&void 0!==e.row&&e.height));let c={};a&&a.forEach((e=>{c[e.row]=e.height}));for(let t=0;t<e.data.length;t++)s+=(c[t]||e.rowHeight)*e.calculative.canvas.store.data.scale,i.push(s);e.colPos=t,e.rowPos=i,e.tableWidth=n,e.tableHeight=s,e.width=n,e.height=s,e.calculative.width=n,e.calculative.height=s,e.calculative.worldRect={x:e.x,y:e.y,height:e.height,width:e.width,center:{x:e.x+e.width/2,y:e.y+e.height/2}},At(e.calculative.worldRect)}(e)}function Qr(e,t){if(!e.calculative.hoverCell)return;const{value:i}=no(e,e.calculative.hoverCell.row,e.calculative.hoverCell.col);if("object"==typeof i)return;e.calculative.isHover=!1,e.calculative.isInput=!0,e.calculative.canvas.render(),e.calculative.inputCell=e.calculative.hoverCell;const n=so(e,e.calculative.hoverCell.row,e.calculative.hoverCell.col);e.calculative.tempText=i.text||i+"",e.calculative.canvas.showInput(e,n,"#ffffff")}function Jr(e,t){e.calculative.inputCell&&(oo(e,e.calculative.inputCell.row,e.calculative.inputCell.col,t),e.calculative.isInput=!1,e.calculative.isHover=!0,e.calculative.canvas.render())}function Zr(e,t){e.timer&&(e.calculative.isHover=!1,clearTimeout(e.timer)),e.timer=setTimeout((()=>{e.calculative.isHover=!0,e.calculative.canvas.render()}),500),e.calculative.hoverCell=io(e,t),e.calculative.canvas.render()}function eo(e,t){e.calculative.hoverCell=void 0,e.calculative.canvas.render()}function to(e,t){e.calculative.activeCell=io(e,t),e.calculative.canvas.render()}function io(e,t){const i=e.calculative.worldRect.width/e.tableWidth,n=e.calculative.worldRect.height/e.tableHeight,r={row:0,col:0};for(let n=0;n<e.colPos.length;n++)t.x>e.calculative.worldRect.x+e.colPos[n]*i&&(r.col=n+1);for(let i=0;i<e.rowPos.length;i++)t.y>e.calculative.worldRect.y+e.rowPos[i]*n&&(r.row=i+1);return r}function no(e,t,i){if(!e.data||!Array.isArray(e.data))return;const n=e.data[t],r=e.styles&&e.styles.filter((e=>e.row===t&&e.col===i));if(Array.isArray(n))return{value:n[i],style:r?.length>0?r[0]:{}};n.data&&Array.isArray(n.data)}function ro(e,t){if(!e.data||!Array.isArray(e.data))return;const i=e.data[t],n=e.styles&&e.styles.filter((e=>e.row===t&&!e.col));if(Array.isArray(i))return{value:i,style:n?.length>0?n[0]:{}};i.data&&Array.isArray(i.data)}function oo(e,t,i,n){if(!e.data||!Array.isArray(e.data))return;e.isFirstTime=!1,e.calculative.texts=void 0;let r=e.data[t];r&&(r[i]instanceof Object||(r[i]=n),e.calculative.canvas.store.emitter.emit("valueUpdate",e))}function so(e,t,i){const n=e.calculative.worldRect.width/e.tableWidth,r=e.calculative.worldRect.height/e.tableHeight;let o=0,s=e.colPos[i]*n;i>0&&(o=e.colPos[i-1]*n);let a=0,c=e.rowPos[t]*r;return t>0&&(a=e.rowPos[t-1]*r),{x:e.calculative.worldRect.x+o,y:e.calculative.worldRect.y+a,ex:e.calculative.worldRect.x+s,ey:e.calculative.worldRect.y+c,width:s-o,height:c-a}}function ao(e,t,i){const n=e.calculative.worldRect.width/e.tableWidth,r=e.calculative.worldRect.height/e.tableHeight;let o=0,s=0,a=0;const c=e.calculative.canvas.store.data.scale;if(i.length>1){for(const e of i)s+e.width*n+20*c*n<t.width?(e.x=t.x+s+10*c*n,e.y=t.y+a+10*c*r,s+=(e.width+10*c)*n,o=Math.max(o,a+(e.height+10*c)*r)):(s=0,a=o,e.x=t.x+s+10*c*n,e.y=t.y+a+10*c*r,o+=(e.height+10*c)*r);if(o+20*c*r<t.height){const e=(t.height-o-10*c*r)/2;for(const t of i)t.y+=e}}else i[0].x=t.x+(t.width-i[0].width)/2,i[0].y=t.y+(t.height-i[0].height)/2}function co(e){if(e.calculative.isUpdateData){Gr(e),delete e.calculative.isUpdateData;let t=e.children;e.children=[],t&&t.forEach((t=>{e.calculative.canvas.delForce(e.calculative.canvas.findOne(t))})),e.calculative.texts=void 0}}function lo(e,t){if(e.calculative.isUpdateData=!1,t.table||null==t.col&&null==t.row){if(t.dataY){const i=e.replaceMode;let n=[];return i?i===Tn.Replace?(n=e.data,t.dataX&&t.dataX.forEach(((e,i)=>{n[e]=t.dataY[i]}))):i===Tn.ReplaceAll&&(t.dataX?n[0]=t.dataX:n[0]=e.data[0],n=n.concat(t.dataY)):n=e.data.concat(t.dataY),delete t.dataX,delete t.dataY,e.calculative.isUpdateData=!0,Object.assign(t,{data:n})}return(t.data||e.styles)&&(e.calculative.isUpdateData=!0),t}let i=e.data[t.row];return i?(i[t.col]instanceof Object||(i[t.col]=t.value),oo(e,t.row,t.col,t.value),e.calculative.canvas.render(),delete t.col,delete t.row,t):t}function ho(e,t){t.onAdd||(t.onAdd=uo,t.onResize=uo,t.onMove=uo,t.onMouseMove=vo,t.onMouseDown=po,t.onValue=xo,t.onBeforeValue=go),t.calculative.barRect||uo(t),t.calculative.canvas.store.data;const i=t.calculative.canvas.store.options;e.fillStyle=t.background,e.beginPath();let n=t.calculative.worldRect.x+t.calculative.barRect.x,r=t.calculative.worldRect.y+t.calculative.barRect.y,o=t.calculative.barRect.width,s=t.calculative.barRect.height,a=s/2;e.moveTo(n+a,r),e.arcTo(n+o,r,n+o,r+s,a),e.arcTo(n+o,r+s,n,r+s,a),e.arcTo(n,r+s,t.x,t.y,a),e.arcTo(n,r,n+o,r,a),e.fill(),e.fillStyle=t.activeColor||i.activeColor,e.beginPath(),o=t.calculative.ballRect.x,e.moveTo(n+a,r),e.arcTo(n+o,r,n+o,r+s,a),e.arcTo(n+o,r+s,n,r+s,a),e.arcTo(n,r+s,t.x,t.y,a),e.arcTo(n,r,n+o,r,a),e.fill(),e.fillStyle="#ffffff",e.beginPath(),n=t.calculative.worldRect.x+t.calculative.ballRect.x,r=t.calculative.worldRect.y+t.calculative.ballRect.y+t.calculative.ballRect.height/2,e.lineWidth=t.calculative.ballRect.width/10,e.arc(n,r,t.calculative.ballRect.width/2,0,2*Math.PI),e.fill(),e.stroke()}function uo(e){if(e._textWidth||(e._textWidth=e.textWidth||50,e._fontSize=e.fontSize||12),e.textWidth=e.calculative.worldRect.width,e.calculative.textWidth=e.textWidth,e.unit||(e.unit="%"),e.sliderWidth||(e.sliderWidth=e.width),e.sliderHeight||(e.sliderHeight=e.height),!e.calculative.worldRect)return;const t=e.calculative.worldRect.width/e.sliderWidth,i=e.calculative.worldRect.height/e.sliderHeight,n=Math.min(t,i);e.fontSize=e._fontSize*n;const r=e.calculative.worldRect.width-e._textWidth*n;e.textLeft=r+10*n,e.calculative.textLeft=e.textLeft,e.calculative.barRect={x:0,y:(e.calculative.worldRect.height-e.barHeight*i)/2,width:r,height:e.barHeight*i},At(e.calculative.barRect),fo(e)}function fo(e){const t=3.5*e.calculative.barRect.height,i=e.calculative.barRect.width*e.value/100;e.calculative.ballRect={x:i,y:(e.calculative.worldRect.height-t)/2,width:t,height:t},At(e.calculative.ballRect),e.calculative.text=e.value+e.unit,U(e)}function po(e,t){const i=t.x-e.calculative.worldRect.x;if(i>e.calculative.barRect.width)return;let n=Math.round(i/e.calculative.barRect.width*100);n<e.min||n>e.max||n<0||n>100||(e.value=n,fo(e),e.calculative.text=e.value+e.unit,U(e),e.calculative.canvas.store.emitter.emit("valueUpdate",e),e.calculative.canvas.render())}function vo(e,t){e.calculative.canvas.mouseDown&&po(e,t)}function xo(e){e.calculative.isUpdateData&&(delete e.calculative.isUpdateData,uo(e)),fo(e)}function go(e,t){return e.calculative.isUpdateData=!1,(t.textWidth||t.barHeight)&&(t.textWidth&&(e._textWidth=0),e.calculative.isUpdateData=!0),t}function yo(e,t){t.onClick||(t.onClick=mo);let i=t.calculative.worldRect.x,n=t.calculative.worldRect.y,r=t.calculative.worldRect.width,o=t.calculative.worldRect.height;r<1.5*o&&(r=1.5*o),e.beginPath(),e.arc(i+o/2,n+o/2,o/2,Math.PI/2,3*Math.PI/2),e.lineTo(i+r-o/2,n),e.arc(i+r-o/2,n+o/2,o/2,-Math.PI/2,Math.PI/2),e.lineTo(i+o/2,n+o),t.checked?(e.fillStyle=t.onColor,t.disable&&(e.fillStyle=t.disableOnColor),e.fill(),e.closePath(),e.beginPath(),e.fillStyle="#ffffff",e.moveTo(i+2*o,n+o/2),e.arc(i+r-o/2,n+o/2,o/2>2?o/2-2:1,0,2*Math.PI),e.fill()):(e.fillStyle=t.offColor,t.disable&&(e.fillStyle=t.disableOffColor),e.fill(),e.closePath(),e.beginPath(),e.fillStyle="#ffffff",e.moveTo(i+o,n+o/2),e.arc(i+o/2,n+o/2,o/2>2?o/2-2:1,0,2*Math.PI),e.fill()),e.closePath()}function mo(e){e.disable||(e.checked=!e.checked,e.calculative.canvas.store.emitter.emit("valueUpdate",e),e.calculative.canvas.render())}function bo(e,t){t.onMouseDown||(t.onMouseDown=wo);let i=t.calculative.worldRect.x,n=t.calculative.worldRect.y,r=t.calculative.worldRect.height;t.calculative.worldRect.width;const{fontStyle:o,fontWeight:s,fontSize:a,fontFamily:c,lineHeight:l}=t.calculative;e.beginPath(),e.moveTo(i,n),e.arcTo(i+r,n,i+r,n+r,2),e.arcTo(i+r,n+r,i,n+r,2),e.arcTo(i,n+r,i,n,2),e.arcTo(i,n,i+r,n,2),e.strokeStyle="#d9d9d9",e.fillStyle="#ffffff00",t.checked&&(e.fillStyle=t.background||"#1890ff",e.strokeStyle=t.background||"#1890ff"),t.isForbidden&&(e.fillStyle="#ebebeb",e.strokeStyle="#d9d9d9"),e.closePath(),e.fill(),e.stroke(),e.save(),t.checked&&(e.beginPath(),e.lineWidth=r/10,e.strokeStyle="#ffffff",e.moveTo(i+102/506*r,n+r/2),e.lineTo(i+220/506*r,n+346/460*r),e.lineTo(i+404/506*r,n+142/460*r),e.stroke()),e.restore(),e.save(),e.fillStyle=t.isForbidden?"#00000040":we(t,t.calculative.canvas.parent.store)||"#000000d9",e.textAlign="start",e.textBaseline="middle",e.font=Ae({fontStyle:o,fontWeight:s,fontFamily:c||t.calculative.canvas.parent.store.options.fontFamily,fontSize:a,lineHeight:l}),e.fillText(t.value+"",i+r+10,n+r/2),e.restore()}function wo(e,t){e.isForbidden||(e.checked=!e.checked,e.calculative.canvas.store.emitter.emit("valueUpdate",e),e.calculative.canvas.render())}function _o(e,t){t.onAdd||(t.onAdd=ko,t.optionPos||(t.onAdd(t),t.calculative.canvas.parent.active([t])),t.onMouseDown=To,t.onValue=Ao);let i=t.calculative.worldRect.x,n=t.calculative.worldRect.y,r=t.calculative.worldRect.height,o=t.calculative.worldRect.width;if(!t.optionPos)return;const{fontStyle:s,fontWeight:a,fontSize:c,fontFamily:l,lineHeight:h}=t.calculative;if("horizontal"==t.direction)for(let c=0;c<t.optionPos.length;c++){const d=t.optionPos[c]*o/t.checkboxWidth,u=t.options[c].isForbidden;e.beginPath(),e.arc(i+d+r/2,n+r/2,r/2,0,2*Math.PI),e.strokeStyle="#d9d9d9",e.fillStyle="#ffffff00",t.options[c].text===t.checked&&(e.strokeStyle=t.options[c].background||t.background||"#1890ff"),u&&(e.fillStyle="#ebebeb",e.strokeStyle="#d9d9d9"),e.closePath(),e.fill(),e.stroke(),e.save(),u||t.options[c].text!==t.checked||(e.beginPath(),e.strokeStyle=t.options[c].background?t.options[c].background+"20":t.background||"#1890ff20",e.arc(i+r/2+d,n+r/2,r/2+1.5,0,2*Math.PI),e.stroke(),e.closePath(),e.beginPath(),e.fillStyle=t.options[c].background||t.background||"#1890ff",e.arc(i+r/2+d,n+r/2,r/4,0,2*Math.PI),e.fill(),e.closePath()),e.restore(),e.save(),e.fillStyle=u?"#00000040":we(t,t.calculative.canvas.parent.store)||"#000000d9";const f=14*t.calculative.worldRect.height/16;e.textAlign="start",e.textBaseline="middle",e.font=Ae({fontStyle:s,fontWeight:a,fontFamily:l||t.calculative.canvas.parent.store.options.fontFamily,fontSize:f,lineHeight:h}),e.fillText(t.options[c].text,i+r+d+10/t.checkboxWidth*o,n+r/2),e.restore()}else if("vertical"==t.direction){const o=t.optionHeight*r/t.checkboxHeight;for(let c=0;c<t.optionPos.length;c++){const d=t.optionPos[c]*r/t.checkboxHeight,u=t.options[c].isForbidden;e.beginPath(),e.arc(i+o/2,n+o/2+d,o/2,0,2*Math.PI),e.strokeStyle="#d9d9d9",e.fillStyle="#ffffff00",t.options[c].text===t.checked&&(e.strokeStyle=t.options[c].background||"#1890ff"),u&&(e.fillStyle="#ebebeb",e.strokeStyle="#d9d9d9"),e.closePath(),e.fill(),e.stroke(),e.save(),u||t.options[c].text!==t.checked||(e.beginPath(),e.strokeStyle=t.options[c].background?t.options[c].background+"20":"#1890ff20",e.arc(i+o/2,n+o/2+d,o/2+1.5,0,2*Math.PI),e.stroke(),e.closePath(),e.beginPath(),e.fillStyle=t.options[c].background||"#1890ff",e.arc(i+o/2,n+o/2+d,o/4,0,2*Math.PI),e.fill(),e.closePath()),e.restore(),e.save(),e.fillStyle=u?"#00000040":we(t,t.calculative.canvas.parent.store)||"#000000d9";const f=14*t.calculative.worldRect.height/t.checkboxHeight;e.textAlign="start",e.textBaseline="middle",e.font=Ae({fontStyle:s,fontWeight:a,fontFamily:l||t.calculative.canvas.parent.store.options.fontFamily,fontSize:f,lineHeight:h}),e.fillText(t.options[c].text,i+o+10,n+o/2+d),e.restore()}}}function ko(e){$r(e)}function To(e,t){if("horizontal"==e.direction)for(let i=0;i<e.optionPos.length;i++)!e.options[i].isForbidden&&t.x>e.calculative.worldRect.x+e.optionPos[i]*e.calculative.worldRect.width/e.checkboxWidth&&t.x<e.calculative.worldRect.x+(e.optionPos[i]+e.height)/e.checkboxWidth*e.calculative.worldRect.width+Yr(e.options[i].text,e)+10/e.checkboxWidth*e.calculative.worldRect.width&&(e.checked=e.options[i].text,e.calculative.canvas.store.emitter.emit("valueUpdate",e));else if("vertical"==e.direction){const i=e.calculative.worldRect.height/e.checkboxHeight;for(let n=0;n<e.optionPos.length;n++)!e.options[n].isForbidden&&t.y>e.calculative.worldRect.y+e.optionPos[n]*i&&t.y<e.calculative.worldRect.y+(e.optionPos[n]+e.optionHeight)*i&&(e.checked=e.options[n].text,e.calculative.canvas.store.emitter.emit("valueUpdate",e))}e.calculative.canvas.render()}function Ao(e){$r(e)}function So(){return{radio:_o,switch:yo,slider:ho,checkbox:bo,table:Mr,table2:Xr}}function Po(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect,a=s/6,c=o/4;if(i.moveTo(n+2*c,r+0),i.lineTo(n+2*c,r+a),i.moveTo(n,r+a+2*c),i.arc(n+2*c,r+a+2*c,2*c,1*Math.PI,2*Math.PI,!1),i.lineTo(n+4*c,r+5*a),i.lineTo(n,r+5*a),i.lineTo(n,r+a+2*c),i.moveTo(n+c,r+5*a),i.lineTo(n+c,r+6*a),i.moveTo(n+2*c,r+5*a),i.lineTo(n+2*c,r+6*a),i.moveTo(n+3*c,r+5*a),i.lineTo(n+3*c,r+6*a),i.closePath(),i instanceof Path2D)return i}function Co(e){e.anchors=[{x:.5,y:0},{x:.25,y:1},{x:.5,y:1},{x:.75,y:1}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function Eo(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect,a=s-o,c=.5*o;if(i.moveTo(n+o/2,r),i.lineTo(n+o/2,r+a),i.moveTo(n+o,r+c+a),i.arc(n+o/2,r+c+a,c,0,2*Math.PI,!1),i.closePath(),i instanceof Path2D)return i}function Ro(e){e.anchors=[{x:.5,y:0},{x:.5,y:1}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function Io(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect,a=s/2,c=o/5;if(i.moveTo(n,r+a),i.lineTo(n+c,r+a),i.moveTo(n+5*c,r+a),i.ellipse(n+3*c,r+a,2*c,a,0,0,2*Math.PI),i.closePath(),i instanceof Path2D)return i}function Lo(e){e.anchors=[{x:.6,y:0},{x:1,y:.5},{x:.6,y:1},{x:0,y:.5}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function Mo(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect,a=s/4,c=.5*o;if(i.moveTo(n+c,r),i.lineTo(n+c,r+a),i.moveTo(n,r+a),i.rect(n,r+a,2*c,2*a),i.moveTo(n+c,r+3*a),i.lineTo(n+c,r+4*a),i.closePath(),i instanceof Path2D)return i}function Do(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect,a=s/8,c=.25*o;if(i.moveTo(n+2*c,r),i.lineTo(n+2*c,r+2*a),i.lineTo(n+3*c,r+3*a),i.lineTo(n+3*c,r+5*a),i.lineTo(n+2*c,r+6*a),i.lineTo(n+1*c,r+5*a),i.lineTo(n+1*c,r+3*a),i.lineTo(n+2*c,r+2*a),i.moveTo(n+3*c,r+4*a),i.lineTo(n+4*c,r+4*a),i.moveTo(n+2*c,r+6*a),i.lineTo(n+2*c,r+8*a),i.closePath(),i instanceof Path2D)return i}function No(e){e.anchors=[{x:.5,y:0},{x:1,y:.5},{x:.5,y:1}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function Oo(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect,a=o/2,c=s/10;if(i.moveTo(n+a,r),i.lineTo(n+a,r+c),i.moveTo(n+a,r+c),i.quadraticCurveTo(n+2*a,r+c,n+2*a,r+9*c),i.moveTo(n+a,r+c),i.quadraticCurveTo(n,r+c,n,r+9*c),i.quadraticCurveTo(n+a,r+6*c,n+2*a,r+9*c),i.moveTo(n+a,r+3*s/4),i.lineTo(n+a,r+s),i.moveTo(n+2*a/5,r+201*s/250),i.lineTo(n+2*a/5,r+s),i.moveTo(n+8*a/5,r+201*s/250),i.lineTo(n+8*a/5,r+s),i.closePath(),i instanceof Path2D)return i}function Bo(e){e.anchors=[{x:.5,y:0},{x:.2,y:1},{x:.5,y:1},{x:.8,y:1}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function Fo(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect,a=s/6,c=o/4;if(i.moveTo(n+2*c,r+0),i.lineTo(n+2*c,r+a),i.moveTo(n,r+a+2*c),i.arc(n+2*c,r+a+2*c,2*c,1*Math.PI,2*Math.PI,!1),i.lineTo(n+4*c,r+5*a),i.lineTo(n,r+5*a),i.lineTo(n,r+a+2*c),i.moveTo(n,r+5*a-a/3),i.lineTo(n+4*c,r+5*a-a/3),i.moveTo(n+c,r+5*a),i.lineTo(n+c,r+6*a),i.moveTo(n+2*c,r+5*a),i.lineTo(n+2*c,r+6*a),i.moveTo(n+3*c,r+5*a),i.lineTo(n+3*c,r+6*a),i.closePath(),i instanceof Path2D)return i}function zo(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect,a=s/4,c=.5*o;if(i.moveTo(n+c,r),i.lineTo(n+c,r+a),i.lineTo(n+2*c,r+2*a),i.lineTo(n+2*c,r+4*a),i.lineTo(n,r+4*a),i.lineTo(n,r+2*a),i.lineTo(n+c,r+a),i.closePath(),i instanceof Path2D)return i}function jo(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect,a=s/4,c=o/2;if(i.moveTo(n+c,r),i.lineTo(n+c,r+a),i.lineTo(n+2*c,r+4*a),i.lineTo(n,r+4*a),i.lineTo(n+c,r+a),i.closePath(),i instanceof Path2D)return i}function Ho(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect,a=s/3,c=.5*o;if(i.moveTo(n+c,r),i.lineTo(n+c,r+a),i.lineTo(n+o,r+2*a),i.lineTo(n+c,r+s),i.lineTo(n,r+2*a),i.lineTo(n+c,r+a),i.closePath(),i instanceof Path2D)return i}function Uo(e){e.anchors=[{x:.5,y:0},{x:1,y:2/3},{x:.5,y:1},{x:0,y:2/3}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function Wo(e,t){const{x:i,y:n,width:r,height:o}=t.calculative.worldRect,s=r/2,a=o/10;e.beginPath(),e.moveTo(i+s,n),e.lineTo(i+s,n+a),e.moveTo(i+s,n+a),e.quadraticCurveTo(i+2*s,n+a,i+2*s,n+9*a),e.moveTo(i+s,n+a),e.quadraticCurveTo(i,n+a,i,n+9*a),e.quadraticCurveTo(i+s,n+6*a,i+2*s,n+9*a),e.moveTo(i+s,n+3*o/4),e.lineTo(i+s,n+9*o/10),e.moveTo(i+2*s/5,n+201*o/250),e.lineTo(i+2*s/5,n+9*o/10),e.moveTo(i+8*s/5,n+201*o/250),e.lineTo(i+8*s/5,n+9*o/10),e.stroke(),e.closePath(),e.beginPath();const c=2*s>10*a?a:s/5;e.fillStyle="#333333",e.font=c+"px Arial",e.textBaseline="bottom",e.textAlign="center",e.fillText("o",i+s,n+o),e.fillText("m",i+2*s/5,n+o),e.fillText("o",i+8*s/5,n+o),e.closePath()}function Vo(e,t){const i=t||new Path2D,{x:n,y:r,width:o,height:s}=e.calculative.worldRect;let a=o/2,c=s/10;if(i.moveTo(n+a,r),i.lineTo(n+a,r+c),i.moveTo(n+a,r+c),i.quadraticCurveTo(n+2*a,r+c,n+2*a,r+9*c),i.moveTo(n+a,r+c),i.quadraticCurveTo(n,r+c,n,r+9*c),i.quadraticCurveTo(n+a,r+6*c,n+2*a,r+9*c),i.moveTo(n,r+10*c),i.quadraticCurveTo(n+a,r+7*c,n+2*a,r+10*c),i.moveTo(n+2*a/5,r+201*s/250+c),i.lineTo(n+2*a/5,r+s),i.moveTo(n+8*a/5,r+201*s/250+c),i.lineTo(n+8*a/5,r+s),i.closePath(),i instanceof Path2D)return i}function qo(e){e.anchors=[{x:.5,y:0},{x:.2,y:1},{x:.8,y:1}].map((({x:t,y:i},n)=>({id:`${n}`,penId:e.id,x:t,y:i})))}function Ko(){return{andGate:Po,basicEvent:Eo,conditionalEvent:Io,event:Mo,forbiddenGate:Do,orGate:Oo,priorityAndGate:Fo,switchEvent:zo,transferSymbol:jo,unexpandedEvent:Ho,xorGate:Vo}}function Yo(){return{votingGate:Wo}}function $o(){return{andGate:Co,orGate:Bo,priorityAndGate:Co,votingGate:Bo,xorGate:qo,forbiddenGate:No,basicEvent:Ro,unexpandedEvent:Uo,conditionalEvent:Lo,transferSymbol:Ro}}!function(e){e[e.Add=0]="Add",e[e.Replace=1]="Replace",e[e.ReplaceAll=2]="ReplaceAll"}(kn||(kn={})),function(e){e[e.Add=0]="Add",e[e.Replace=1]="Replace",e[e.ReplaceAll=2]="ReplaceAll"}(Tn||(Tn={}));const Xo=15;function Go(e,t=Xo){let i=""+e;return i.indexOf(".")>=0&&(i=Number.parseFloat(i).toFixed(t)),Number.parseFloat(i)}function Qo(e){return"number"==typeof e&&Number.isFinite(e)}function Jo(e,t){const i=t.calculative.worldRect.x,n=t.calculative.worldRect.y,r=t.calculative.worldRect.width,o=t.calculative.worldRect.height;let s=[];if(t.echarts)for(let e=0;e<t.echarts.option.series.length;e++)s.push(t.echarts.option.series[e].data);else s=t.data;let a=[];for(let e=0;e<s.length;e++)a=a.concat(s[e]);let c=function(e){e={max:null,min:null,splitNumber:4,symmetrical:!1,deviation:!1,preferZero:!1,...e};const t=[10,15,20,25,30,40,50,60,70,80,90,100,150];let{max:i,min:n,splitNumber:r,symmetrical:o,deviation:s,preferZero:a}=e;if(!Qo(i)||!Qo(n)||i<n)return{splitNumber:r};if(i===n&&0===i)return{max:Go(t[0]*r),min:n,interval:t[0],splitNumber:r};i===n&&(a=!0),(!Qo(r)||r<=0)&&(r=4),a&&i*n>0&&(i<0?i=0:n=0);const c=(i-n)/r;let l=Math.floor(Math.log10(c)-1);l=Math.pow(10,l);const h=c/l;let d,u=t[0]*l,f=-1;for(d=0;d<t.length;d++)if(t[d]>h){u=t[d]*l;break}let p=i,v=n;function x(e){if(p=parseInt(""+(i/e+1))*e,v=parseInt(""+(n/e-1))*e,0===i&&(p=0),0===n&&(v=0),o&&p*v<0){const e=Math.max(Math.abs(p),Math.abs(v));p=e,v=-e}}if(x(u),s)return{max:Go(p),min:Go(v),interval:Go(u),splitNumber:Math.round((p-v)/u)};if(!o||p*v>0){let e;e:do{if(e=Math.round((p-v)/u),(d-f)*(e-r)<0)for(;e<r;)if(v-n<=p-i&&0!==v||0===p?v-=u:p+=u,e++,e===r)break e;if(d>=t.length-1||d<=0||e===r)break;f=d,u=e>r?t[++d]*l:t[--d]*l,x(u)}while(e!==r)}p=Go(p),v=Go(v);const g=Go((p-v)/r);return{max:p,min:v,interval:g,splitNumber:r}}({max:Math.max.apply(null,a),min:Math.min.apply(null,a),splitNumber:5}),l=t.echarts?t.echarts.option.xAxis.data.length:t.xAxisData.length;e.beginPath(),e.strokeStyle="#BFBFBF",e.lineWidth=6,e.lineCap="butt";let h=(r-1*(l+1))/l;e.setLineDash([1,h]),e.moveTo(i,n+o+3),e.lineTo(i+r,n+o+3),e.stroke(),e.closePath(),e.beginPath(),e.lineWidth=1,e.setLineDash([]),e.moveTo(i,n+o),e.lineTo(i+r,n+o),e.stroke(),e.closePath(),e.beginPath(),e.fillStyle="#BFBFBF",e.strokeStyle="#E9E9E9",e.setLineDash([2,2]);for(let t=0;t<c.splitNumber+1;t++){let s=t*o/c.splitNumber;e.textAlign="right",e.textBaseline="middle",e.fillText(c.max-t*c.interval+"",i-10,n+s),e.fill(),t<c.splitNumber&&(e.moveTo(i,n+s),e.lineTo(i+r,n+s),e.stroke())}e.closePath(),e.beginPath(),e.strokeStyle="#BFBFBF";let d=t.echarts?t.echarts.option.xAxis.data:t.xAxisData,u=0;for(let t=0;t<d.length;t++)u=i+(1+h/2)+(h+1)*t,e.textAlign="center",e.textBaseline="top",e.fillText(d[t],u,n+o+10),e.fill();return e.closePath(),e.setLineDash([]),{dash:h,normalizedOption:c}}function Zo(e,t){if(!isNaN(e))return-1===t?e:Math.round(1e3*Number(e))/1e3}var es;function ts(e,t){t.onBeforeValue||(t.onBeforeValue=is);const i=t.calculative.worldRect.x,n=t.calculative.worldRect.y,r=(t.calculative.worldRect.width,t.calculative.worldRect.height);let o=[];t.echarts&&!t.echarts.option.color&&(t.echarts.option.color=["#1890ff","#2FC25B","#FACC14","#c23531","#2f4554","#61a0a8","#d48265"]);let s=Jo(e,t),a=s.dash,c=s.normalizedOption;const l=!!(t.echarts?t.echarts.option.series[0].smooth:t.smooth);let h=[];if(t.echarts)for(let e=0;e<t.echarts.option.series.length;e++)o.push(t.echarts.option.series[e].data);else o=t.data;for(let s=0;s<o.length;s++){e.beginPath();let d=o[s];e.strokeStyle=t.echarts?t.echarts.option.color[s]:t.chartsColor[s],e.fillStyle=t.echarts?t.echarts.option.color[s]:t.chartsColor[s];let u=i+(1+a/2),f=n+r-(d[0]-c.min)/(c.max-c.min)*r;if(e.moveTo(u,f),h.push({x:u,y:f}),l)if(d.length<=2)for(let t=1;t<d.length;t++)u=i+(1+a/2)+(a+1)*t,f=n+r-(d[t]-c.min)/(c.max-c.min)*r,e.lineTo(u,f),h.push({x:u,y:f});else{let t,o,s,l;d.forEach(((p,v)=>{u=i+(1+a/2)+(a+1)*v,f=n+r-(d[v]-c.min)/(c.max-c.min)*r;let x=i+(1+a/2)+(a+1)*(v+1),g=n+r-(d[v+1]-c.min)/(c.max-c.min)*r,y=i+(1+a/2)+(a+1)*(v-1),m=n+r-(d[v-1]-c.min)/(c.max-c.min)*r,b=i+(1+a/2)+(a+1)*(v+2),w=n+r-(d[v+2]-c.min)/(c.max-c.min)*r;0===v?(y=i+(1+a/2)+(a+1)*v,m=n+r-(d[v]-c.min)/(c.max-c.min)*r):v===d.length-2&&(b=i+(1+a/2)+(a+1)*(v+1),w=n+r-(d[v+1]-c.min)/(c.max-c.min)*r),h.push({x:u,y:f}),t=u+(x-y)/4,o=f+(g-m)/4,s=x-(b-u)/4,l=g-(w-f)/4,e.bezierCurveTo(t,o,s,l,x,g)}))}else for(let t=1;t<d.length;t++)u=i+(1+a/2)+(a+1)*t,f=n+r-(d[t]-c.min)/(c.max-c.min)*r,e.lineTo(u,f),h.push({x:u,y:f});e.stroke(),e.closePath(),e.save(),h.forEach(((t,i)=>{e.beginPath(),e.strokeStyle="#fff",e.lineWidth=2,e.arc(t.x,t.y,4,0,2*Math.PI),e.stroke(),e.fill(),e.closePath()})),e.restore(),h=[]}}function is(e,t){if(t.xAxisData||t.data||!t.dataX&&!t.dataY)return t;const i=e.xAxisData,n=e.data,r=e.replaceMode;let o=[],s=[];return r?r===es.Replace?(t.dataX.forEach(((e,r)=>{let o=i.indexOf(e);n.forEach(((e,i)=>{e[o]=t.dataY[i][r]}))})),o=i,s=n):r===es.ReplaceAll&&(o=t.dataX,s=t.dataY):(o=[...i,...t.dataX],n.forEach(((e,i)=>{let n=[...e,...t.dataY[i]];s.push(n)}))),delete t.dataX,delete t.dataY,Object.assign(t,{xAxisData:o,data:s})}function ns(e,t){t.onBeforeValue||(t.onBeforeValue=rs);const i=t.calculative.worldRect.x,n=t.calculative.worldRect.y,r=t.calculative.worldRect.width,o=t.calculative.worldRect.height,s=!!t.echarts;t.echarts?(t.echarts.option.color||(t.echarts.option.color=["#1890ff","#2FC25B","#FACC14","#c23531","#2f4554","#61a0a8","#d48265"]),t.chartsColor=t.echarts.option.color):t.chartsColor||(t.chartsColor=["#1890ff","#2FC25B","#FACC14","#c23531","#2f4554","#61a0a8","#d48265"]);const a=s?t.echarts.option.series:t.data;let c=0;for(let l=0;l<a.length;l++){let h=a[l],d=r/2;o<r&&(d=o/2);const u=i+r/2,f=n+o/2;let p=0;p=s?h.data.reduce(((e,t)=>e+t.value),0):h.reduce(((e,t)=>e+t.value),0);const v=d*parseFloat(s?h.radius[0]:t.chartsRadius[l][0])/100,x=d*parseFloat(s?h.radius[1]:t.chartsRadius[l][1])/100;if(v>x)return;let g=0,y=0;e.strokeStyle=s&&h.itemStyle?.borderColor||"#fff",e.lineWidth=s&&h.itemStyle?.borderWidth||2;const m=s?h.data:h;m.forEach(((i,n)=>{y+=2*Math.PI*i.value/p,e.beginPath();let r=c+n;r>=t.chartsColor.length&&(r%=t.chartsColor.length),e.fillStyle=s?t.echarts.option.color[r]:t.chartsColor[r],e.moveTo(u+v*Math.sin(y),f-v*Math.cos(y)),e.arc(u,f,v,-Math.PI/2+y,-Math.PI/2+g,!0),e.lineTo(u+x*Math.sin(g),f-x*Math.cos(g)),e.arc(u,f,x,-Math.PI/2+g,-Math.PI/2+y),e.lineTo(u+v*Math.sin(y),f-v*Math.cos(y)),e.stroke(),e.fill(),e.closePath();let o=(g+y)/2,a=u+(x+5)*Math.sin(o),l=f-(x+5)*Math.cos(o),m=e.fillStyle;h.label||(h.label={position:"outside",show:!0}),s&&["inner","inside"].includes(h.label.position)?(e.fillStyle="#ffffff",a=u+(x-v)/2*Math.sin(o),l=f-(x-v)/2*Math.cos(o)):s&&h.label.position,h.labelLine||(h.labelLine={show:!0}),(s&&!1!==h.labelLine.show||!s)&&(e.beginPath(),e.strokeStyle=s?t.echarts.option.color[c+n]:t.chartsColor[c+n],e.moveTo(u+x*Math.sin(o),f-x*Math.cos(o)),e.lineTo(a,l)),e.font=d/10+"px AlibabaPuHuiTi-Regular, Alibaba PuHuiTi",e.textBaseline="middle",e.textAlign="center",o>Math.PI?((s&&"outside"===h.label.position||!s)&&(e.textAlign="end"),(s&&!1!==h.labelLine.show||!s)&&e.lineTo(a-5,l),(s&&!1!==h.label.show||!s)&&e.fillText(i.name,a-5,l)):((s&&"outside"===h.label.position||!s)&&(e.textAlign="start"),(s&&!1!==h.labelLine.show||!s)&&e.lineTo(a+5,l),(s&&!1!==h.label.show||!s)&&e.fillText(i.name,a+5,l)),e.stroke(),e.closePath(),e.fillStyle=m,e.strokeStyle=s&&h.itemStyle?.borderColor||"#fff",g=y})),c+=m.length}}function rs(e,t){if(t.data||!t.dataX&&!t.dataY)return t;const i=e.data,n=e.replaceMode;let r=[];return n?n===es.Replace?(t.dataY.forEach(((e,t)=>{e.forEach(((e,n)=>{let r=i[t].filter((t=>t.name===e.name));r.length>0&&(r[0].value=e.value)}))})),r=i):n===es.ReplaceAll&&(r=t.dataY):i.forEach(((e,i)=>{let n=[...e,...t.dataY[i]];r.push(n)})),delete t.dataX,delete t.dataY,Object.assign(t,{data:r})}function os(e,t){t.onBeforeValue||(t.onBeforeValue=is);const i=t.calculative.worldRect.x,n=t.calculative.worldRect.y,r=(t.calculative.worldRect.width,t.calculative.worldRect.height);let o=[];if(t.echarts&&!t.echarts.option.color&&(t.echarts.option.color=["#1890ff","#2FC25B","#FACC14","#c23531","#2f4554","#61a0a8","#d48265"]),t.echarts)for(let e=0;e<t.echarts.option.series.length;e++)o.push(t.echarts.option.series[e].data);else o=t.data;let s=Jo(e,t),a=s.dash,c=s.normalizedOption,l=4*a/5/o.length;for(let s=0;s<o.length;s++){e.beginPath();let h=o[s];e.fillStyle=t.echarts?t.echarts.option.color[s]:t.chartsColor[s],e.strokeStyle="#ffffff";let d=0,u=0,f=0;for(let t=0;t<h.length;t++)d=i+(1+.1*a)+(a+1)*t+l*s,f=(h[t]-c.min)/(c.max-c.min)*r,u=n+r-f,e.rect(d,u,l-1,f-1),e.stroke(),e.fill();e.closePath()}}function ss(e,t){t.onAdd||(t.onAdd=as,t.onDestroy=cs,t.onClick=ls,t.clockInterval&&(t.onDestroy(t),t.onAdd(t)));const i=t.calculative.worldRect.x,n=t.calculative.worldRect.y,r=t.calculative.worldRect.width,o=t.calculative.worldRect.height;let s={startAngle:225,endAngle:-45,min:0,max:100,splitNumber:10};if(t.echarts&&t.echarts.option){let e=t.echarts.option.series[0];t.startAngle=e.startAngle||s.startAngle,t.endAngle=e.endAngle||s.endAngle,t.min=e.min||s.min,t.max=e.max||s.max,t.axisLine=e.axisLine.lineStyle.color,t.unit=e.detail.formatter.replace("{value}",""),t.value=e.data[0].value,t.splitNumber=e.splitNumber||s.splitNumber}let a,c=r>o?o/2*9/10:r/2*9/10,l=i+r/2,h=n+o/2,d=(t={...s,...t}).echarts?t.echarts.option.series[0].data[0].value:t.value,u=t.startAngle-t.endAngle,f=t.background||"#E6EBF8";e.strokeStyle=f;let p=c/10;e.lineWidth=p,e.beginPath(),e.lineCap="round",e.arc(l,h,c,-t.startAngle/180*Math.PI,-t.endAngle/180*Math.PI),e.stroke(),e.closePath();let v=0;if(t.axisLine&&!t.isClock)for(let i=t.axisLine.length-1;i>=0;i--)t.axisLine[i][0]*(t.max-t.min)<d?v=t.axisLine[i][0]:(v=(d-t.min)/(t.max-t.min),a=t.axisLine[i][1]),e.beginPath(),e.strokeStyle=t.axisLine[i][1],e.arc(l,h,c,-t.startAngle/180*Math.PI,(-t.startAngle+v*u)/180*Math.PI),e.stroke(),e.closePath();e.lineCap="butt";let x=c-p;x<0&&(x=0);let g=u/180*Math.PI*x,y=(g-2*t.splitNumber)/t.splitNumber,m=u/180*Math.PI*2/2/g;e.beginPath(),e.strokeStyle=t.color||"#999999",e.lineWidth=c/20,e.setLineDash([2,y]),e.arc(l,h,x,-t.startAngle/180*Math.PI-m,-t.endAngle/180*Math.PI+m),e.stroke(),e.closePath();let b=c-p;b<0&&(b=0);let w=u/180*Math.PI*b,_=(w-5*t.splitNumber)/5/t.splitNumber,k=u/180*Math.PI*1/2/w;e.beginPath(),e.strokeStyle=t.color||"#999999",e.lineWidth=c/40,e.setLineDash([1,_]),e.arc(l,h,b,-t.startAngle/180*Math.PI-k,-t.endAngle/180*Math.PI+k),e.stroke(),e.closePath(),e.beginPath();let T=t.max-t.min,A=T/t.splitNumber;e.font=(t.calculative.fontStyle||"")+" normal "+(t.calculative.fontWeight||"")+" "+c/10+"px "+t.calculative.fontFamily;let S=c-p-c/20;for(let i=0;i<=t.splitNumber;i++){if(Math.abs(t.startAngle)+Math.abs(t.endAngle)===360&&0==i)continue;let n=t.startAngle-A*i/T*u,r=Math.cos(n/180*Math.PI),o=Math.sin(n/180*Math.PI);e.fillStyle="#999999",e.textAlign=r>.02?"end":r<-.02?"start":"center",e.textBaseline=o>.02?"top":o<-.02?"bottom":"middle",e.fillText(Zo(A*i+t.min,1),l+S*r,h-S*o),e.fill()}e.closePath();let P=1,C=["value"];if(t.isClock&&(P=3,C=["hourvalue","minutevalue","secondvalue"]),t.isClock)for(let i=0;i<P;i++){let n=(t.startAngle-(t[C[i]]-t.min)/(t.max-t.min)*u)/180*Math.PI;i>0&&(n=(t.startAngle-(t[C[i]]-t.min)/(5*t.max-t.min)*u)/180*Math.PI);let r=.8*c;"hourvalue"===C[i]&&(r=.6*c),"minutevalue"===C[i]&&(r=.7*c);let o=1*c/40;e.beginPath(),e.setLineDash([]),e.lineWidth=c/(i+1)/20,e.strokeStyle=t.color||"#999999",e.moveTo(l-3*o*Math.cos(n),h+3*o*Math.sin(n)),e.lineTo(l+r*Math.cos(n),h-r*Math.sin(n)),e.stroke()}else{let i=(t.startAngle-(d-t.min)/(t.max-t.min)*u)/180*Math.PI,n=.8*c,r=1*c/40;e.beginPath(),e.setLineDash([]),e.lineWidth=2,e.fillStyle=a,e.moveTo(l-3*r*Math.cos(i),h+3*r*Math.sin(i)),e.lineTo(l+r*Math.cos(i-Math.PI/2),h-r*Math.sin(i-Math.PI/2)),e.lineTo(l+n*Math.cos(i),h-n*Math.sin(i)),e.lineTo(l+r*Math.cos(i+Math.PI/2),h-r*Math.sin(i+Math.PI/2)),e.lineTo(l-3*r*Math.cos(i),h+3*r*Math.sin(i)),e.fill()}e.beginPath(),e.textAlign="center",e.textBaseline="middle",e.font=(t.calculative.fontStyle||"")+" normal "+(t.calculative.fontWeight||"")+" "+c/5+"px "+t.calculative.fontFamily,e.fillStyle=a,t.isClock?e.fillText(("0"+parseInt(t.hourvalue)).slice(-2)+":"+("0"+parseInt(t.minutevalue)).slice(-2)+":"+("0"+parseInt(t.secondvalue)).slice(-2),l,h+c/2):e.fillText(d+" "+(t.unit||""),l,h+c/2),e.fill(),t.isClock&&(e.beginPath(),e.fillStyle=t.color||"#999999",e.strokeStyle="#ffffff",e.arc(l,h,c/20,0,2*Math.PI),e.stroke(),e.fill(),e.closePath())}function as(e){if(e.isClock)e.clockInterval=setInterval((()=>{var t=new Date,i=t.getSeconds(),n=t.getMinutes()+i/60,r=t.getHours()%12+n/60;e.calculative.canvas.parent.setValue({id:e.id,hourvalue:r,minutevalue:n,secondvalue:i},{render:!0,doEvent:!1})}),1e3);else{const t=e.value;e.value=0,e.frames=[{duration:2e3,value:t}],e.calculative.canvas.parent.startAnimate(e.id),setTimeout((()=>{e.value=t}),1e3)}}function cs(e){e.clockInterval&&(clearInterval(e.clockInterval),e.clockInterval=void 0)}function ls(e){e.isClock&&(e.onDestroy(e),e.onAdd(e))}function hs(){return{lineChart:ts,histogram:os,pieChart:ns,gauge:ss}}!function(e){e[e.Add=0]="Add",e[e.Replace=1]="Replace",e[e.ReplaceAll=2]="ReplaceAll"}(es||(es={})),globalThis.Meta2d=Sn,globalThis.registerCommonDiagram=function(){var e=globalThis.meta2d;e&&(Rr(),Ir(),Lr(),e.register(rr()),e.registerAnchors(or()),e.register(Hn()),e.registerCanvasDraw(Un()),e.register(Mn()),e.register(On()),e.registerCanvasDraw(Bn()),e.registerCanvasDraw(So()),e.registerCanvasDraw(hs()),e.register(Ko()),e.registerCanvasDraw(Yo()),e.registerAnchors($o()))}})(),n})()));
src/utils/numUtil.js
对比新文件
@@ -0,0 +1,23 @@
/**
 * 格式化金额
 * @param val
 * @returns {string}
 */
export function formatMoney (val) {
  let str = (val / 1).toFixed(2) + ''
  let intSum = str.substring(0, str.indexOf('.')).replace(/\B(?=(?:\d{3})+$)/g, ',')
  let dot = str.substring(str.length, str.indexOf('.'))
  let ret = intSum + dot
  return ret
}
export function formatNum (val, decimalPlaces = 0) {
  if (!Number(val)) {
    return ''
  }
  let str = (Number(val) / 1).toFixed(decimalPlaces) + ''
  let intSum = str.substring(0, str.indexOf('.') === -1 ? (str.length) : str.indexOf('.')).replace(/\B(?=(?:\d{3})+$)/g, ',')
  let dot = str.indexOf('.') === -1 ? '' : str.substring(str.indexOf('.'), str.length)
  let ret = intSum + dot
  return ret
}
src/views/modules/analysis/coal-trend-analysis.vue
对比新文件
@@ -0,0 +1,33 @@
<template>
  <el-card shadow="never" class="aui-card--fill">
    <el-image
        style="width: 100%; height: 100%"
        :src="src"
        @click="changeImage()"
    >
    </el-image>
  </el-card>
</template>
<script>
export default {
  data() {
    return {
      src: require('./img/煤质趋势分析.png'),
      flag: '1'
    };
  },
  methods: {
    changeImage() {
      if(this.flag == 1){
        this.src = require('./img/煤质趋势分析_可选性曲线.png')
        this.flag = 2
      }else if(this.flag == 2){
        this.src = require('./img/煤质趋势分析.png')
        this.flag = 1
      }
    }
  }
};
</script>
src/views/modules/analysis/components/analysis-history.vue
对比新文件
@@ -0,0 +1,208 @@
<template>
  <el-drawer
      direction="rtl"
      :visible.sync="visible"
      @close="handleClose"
      size="50%"
      append-to-body>
    <div style="padding: 10px;">
      <el-form
          :inline="true"
          :model="dataForm"
          ref="dataForm"
          @keyup.enter.native="getDataList()"
      >
        <el-form-item prop="tagType">
          <el-input
              v-model="dataForm.tagType"
              placeholder="Tag类型"
              clearable>
          </el-input>
        </el-form-item>
        <el-form-item prop="tagCode">
          <el-input
              v-model="dataForm.tagCode"
              placeholder="Tag编码"
              clearable>
          </el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="getDataList()"
          >{{ $t("query") }}
          </el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="addOrUpdateHandle()"
          >新增
          </el-button>
        </el-form-item>
      </el-form>
      <el-table
          v-loading="dataListLoading"
          :data="dataList"
          border
          style="width: 100%"
      >
        <el-table-column
            prop="tagType"
            label="Tag类型"
            header-align="center"
            align="left"
            min-width="100"
        ></el-table-column>
        <el-table-column
            prop="tagCode"
            label="Tag编码"
            header-align="center"
            align="left"
            min-width="100"
        ></el-table-column>
        <el-table-column
            prop="tagName"
            label="Tag名称"
            header-align="center"
            align="left"
            min-width="100"
        ></el-table-column>
      </el-table>
      <el-pagination
          @size-change="sizeChangeHandle"
          @current-change="currentChangeHandle"
          :current-page="pageIndex"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="pageSize"
          :total="totalPage"
          layout="total, sizes, prev, pager, next, jumper"
      >
      </el-pagination>
    </div>
  </el-drawer>
</template>
<script>
  export default {
    props: {
      address: String,
    },
    data() {
      return {
        visible: false,
        dataForm: {
          tagType: '',
          tagCode: '',
          tagName: ''
        },
        dataList: [],
        pageIndex: 1,
        pageSize: 10,
        totalPage: 0,
        dataListLoading: false,
      };
    },
    mounted() {
      this.getDataList();
    },
    methods: {
      init(name, code) {
        this.importUrl = '/proxyApi/iailab-ntt-data/http/tag/import/' + name
        this.listUrl = '/iailab-ntt-data/http/tag/page',
        this.deleteUrl = '/iailab-ntt-data/http/tag/delete',
      this.code = code
      this.visible = true;
      this.$nextTick(() => {
        this.$refs['dataForm'].resetFields()
        this.getDataList();
      });
      },
      handleClose() {
        // this.$refs["dataForm"].resetFields();
        this.dataList = [];
      },
      // 获取数据列表
      getDataList() {
        this.dataListLoading = true;
        this.$http({
          url: this.listUrl,
          method: "get",
          params: this.$http.adornParams({
            page: this.pageIndex,
            limit: this.pageSize,
            httpApiCode: this.code,
          }),
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.dataList = data.page.list;
            this.totalPage = data.page.totalCount;
          } else {
            this.dataList = [];
            this.totalPage = 0;
          }
          this.dataListLoading = false;
        });
      },
      // 每页数
      sizeChangeHandle(val) {
        this.pageSize = val;
        this.pageIndex = 1;
        this.getDataList();
      },
      // 当前页
      currentChangeHandle(val) {
        this.pageIndex = val;
        this.getDataList();
      },
      // 多选
      selectionChangeHandle(val) {
        this.dataListSelections = val;
      },
      // 新增 / 修改
      addOrUpdateHandle(id) {
        this.addOrUpdateVisible = true;
        this.$nextTick(() => {
          this.$refs.addOrUpdate.init(
            id,
            this.code,
            this.dataForm.device,
            this.dataForm.address,
          );
        });
      },
      // 删除
      deleteHandle(id) {
        this.$confirm(`确定对选中项进行删除操作?`, "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.$http({
              headers: {
                "Content-Type": "application/json",
              },
              url: this.deleteUrl,
              method: "post",
              data: this.$http.adornData({
                id: id,
              }),
            }).then(({data}) => {
              if (data && data.code === 0) {
                this.$message({
                  message: "操作成功",
                  type: "success",
                  duration: 1500,
                  onClose: () => {
                    this.getDataList();
                  },
                });
              } else {
                this.$message.error(data.msg);
              }
            });
          })
          .catch(() => {
          });
      },
    },
  };
</script>
src/views/modules/analysis/components/product-evaluate.vue
对比新文件
@@ -0,0 +1,1696 @@
<template>
  <div id="data-evaluate-body">
    <div id="data-upper">
      <div class="data-upper-1">
        <img :src="img_upper_1" style="width: 130%;"/>
        <div class="data-upper-1-1">
          <div class="data-upper-content-1">
            <span>{{Number(allEvaluation.zong_level[0][0] || 0).toFixed(1) || 0}}</span>
          </div>
          <div class="data-upper-content-2">
            <span>今日评分</span>
            <span>{{allEvaluation.runTime}}</span>
          </div>
          <div class="data-upper-content-3">
            <el-rate v-model="evaluationRate" :disabled="true"></el-rate>
          </div>
        </div>
        <div class="data-upper-1-2">
          <img :src="img_upper_2" style="width: 130%;padding-left: 15px;"/>
          <div style="width: 130%;margin-top: -60px;padding-left: 80px;">
            <span style="font-size: 16px;color: #80D8FE;">{{allEvaluation.zong_level[1][0]}}</span>
          </div>
        </div>
      </div>
      <div class="data-upper-2">
        <div ref="chartUpper1" class="chart-line"></div>
      </div>
      <div class="data-upper-3">
        <div ref="chartUpper2" class="chart-line"></div>
      </div>
      <div class="data-upper-4">
        <dv-scroll-board :config="config" style="height: 100%;"/>
      </div>
    </div>
    <div class="data-title">
      <div class="data-title-sub">
        <img :src="img_title_1"/>
      </div>
      <div class="data-title-sub">
        <img :src="img_title_2"/>
      </div>
      <div class="data-title-sub">
        <img :src="img_title_3"/>
      </div>
    </div>
    <div id="data-middle">
      <div class="data-middle-sub">
        <div ref="chartMiddle1" class="chart-line"></div>
      </div>
      <div class="data-middle-sub">
        <div ref="chartMiddle2" class="chart-line-1"></div>
        <div class="pf-text">
          <span v-if="alarm.sl.isAlarm" style="color: #FFAA5D">
            今日数量得分:{{alarm.sl.fen}}。{{alarm.sl.alarmMsg}}。{{alarm.sl.adjust}}。
          </span>
          <span v-else style="color: #5BFD9E">
            今日数量得分:{{alarm.sl.fen}}。{{alarm.sl.alarmMsg}}。{{alarm.sl.adjust}}。
          </span>
        </div>
      </div>
      <div class="data-middle-sub">
        <div ref="chartMiddle3" class="chart-line-1"></div>
        <div class="pf-text">
          <span v-if="alarm.zl.isAlarm" style="color: #FFAA5D">
            今日质量得分:{{alarm.zl.fen}}。{{alarm.zl.alarmMsg}}。{{alarm.zl.adjust}}。
          </span>
          <span v-else style="color: #5BFD9E">
            今日质量得分:{{alarm.zl.fen}}。{{alarm.zl.alarmMsg}}。{{alarm.zl.adjust}}。
          </span>
        </div>
      </div>
    </div>
    <div class="data-title">
      <div class="data-title-sub">
        <img :src="img_title_4"/>
      </div>
      <div class="data-title-sub">
        <img :src="img_title_5"/>
      </div>
      <div class="data-title-sub">
        <img :src="img_title_6"/>
      </div>
    </div>
    <div id="data-under">
      <div class="data-under-sub">
        <div ref="chartUnder1" class="chart-line-1"></div>
        <div class="pf-text">
          <span v-if="alarm.xh.isAlarm" style="color: #FFAA5D">
            今日生产消耗得分:{{alarm.xh.fen}}。{{alarm.xh.alarmMsg}}。{{alarm.xh.adjust}}。
          </span>
          <span v-else style="color: #5BFD9E">
            今日生产消耗得分:{{alarm.xh.fen}}。{{alarm.xh.alarmMsg}}。{{alarm.xh.adjust}}。
          </span>
        </div>
      </div>
      <div class="data-under-sub">
        <div ref="chartUnder2" class="chart-line-1"></div>
        <div class="pf-text">
          <span v-if="alarm.kz.isAlarm" style="color: #FFAA5D">
            今日过程控制得分:{{alarm.kz.fen}}。{{alarm.kz.alarmMsg}}。{{alarm.kz.adjust}}。
          </span>
          <span v-else style="color: #5BFD9E">
            今日过程控制得分:{{alarm.kz.fen}}。{{alarm.kz.alarmMsg}}。{{alarm.kz.adjust}}。
          </span>
        </div>
      </div>
      <div class="data-under-sub">
        <div ref="chartUnder3" class="chart-line-1"></div>
        <div class="pf-text">
          <span v-if="alarm.gl.isAlarm" style="color: #FFAA5D">
            今日管理得分:{{alarm.gl.fen}}。{{alarm.gl.alarmMsg}}。{{alarm.gl.adjust}}。
          </span>
          <span v-else style="color: #5BFD9E">
            今日管理得分:{{alarm.gl.fen}}。{{alarm.gl.alarmMsg}}。{{alarm.gl.adjust}}。
          </span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  import {reWriteUrlSVG} from '@/utils/hostUtil'
  import {stringToJSON} from '@/utils/jsonUtils'
  export default {
    components: {},
    data() {
      return {
        img_upper_1: this.doEeWriteUrlSVG('svg/边框.svg'),
        img_upper_2: this.doEeWriteUrlSVG('svg/今日评价.svg'),
        img_title_1: this.doEeWriteUrlSVG('svg/历史评分趋势.svg'),
        img_title_2: this.doEeWriteUrlSVG('svg/数量评分.svg'),
        img_title_3: this.doEeWriteUrlSVG('svg/质量评分.svg'),
        img_title_4: this.doEeWriteUrlSVG('svg/生产消耗评分.svg'),
        img_title_5: this.doEeWriteUrlSVG('svg/过程控制评分.svg'),
        img_title_6: this.doEeWriteUrlSVG('svg/管理评分.svg'),
        chartUpper1: {},
        chartUpper2: {},
        chartMiddle1: {},
        chartMiddle2: {},
        chartMiddle3: {},
        chartUnder1: {},
        chartUnder2: {},
        chartUnder3: {},
        config: {
          header: ['日期', '分数', '生产指标评价'],
          rowNum: 4,
          waitTime: 10000,
          columnWidth: [350, 200, 500],
          align: ['center'],
          headerBGC: 'rgba(1,109,149,0.18)',
          headerHeight: 40,
          oddRowBGC: 'rgba(0, 44, 81, 0.8)',
          evenRowBGC: 'rgba(10, 29, 50, 0.8)',
          data: []
        },
        evaluationRate: 1,
        allEvaluation: {
          runTime: '',
          zong_level: [[],[]],
          first_level: [[],[],[],[]],
          guan_li_fen: [[],[]],
          guo_cheng_fen: [[],[]],
          zhi_liang_fen: [[],[]],
          shu_liang_fen: [[],[]]
        },
        alarm: {
          sl: {
            fen: 0,
            isAlarm: false,
            alarmMsg: '',
            adjust: ''
          },
          zl: {
            fen: 0,
            isAlarm: false,
            alarmMsg: '',
            adjust: ''
          },
          xh: {
            fen: 0,
            isAlarm: false,
            alarmMsg: '',
            adjust: ''
          },
          kz: {
            fen: 0,
            isAlarm: false,
            alarmMsg: '',
            adjust: ''
          },
          gl: {
            fen: 0,
            isAlarm: false,
            alarmMsg: '',
            adjust: ''
          },
        }
      }
    },
    mounted() {
      this.chartUpper1 = this.$echarts.init(this.$refs.chartUpper1)
      this.chartUpper2 = this.$echarts.init(this.$refs.chartUpper2)
      this.chartMiddle1 = this.$echarts.init(this.$refs.chartMiddle1)
      this.chartMiddle2 = this.$echarts.init(this.$refs.chartMiddle2)
      this.chartMiddle3 = this.$echarts.init(this.$refs.chartMiddle3)
      this.chartUnder1 = this.$echarts.init(this.$refs.chartUnder1)
      this.chartUnder2 = this.$echarts.init(this.$refs.chartUnder2)
      this.chartUnder3 = this.$echarts.init(this.$refs.chartUnder3)
      let that = this;
      that.init()
    },
    methods: {
      doEeWriteUrlSVG(url) {
        return reWriteUrlSVG(url)
      },
      init() {
        this.getAllEvaluation()
        this.getChartRingData(this.chartUpper1)
        this.getLog()
        this.getChartData()
      },
      getAllEvaluation() {
        this.$http.get(`/iailab-ntt-model/api/model/model-result/all_evaluation`).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.allEvaluation.runTime = res.data.runTime
          this.allEvaluation.zong_level = stringToJSON(res.data.zong_level)
          this.allEvaluation.first_level = stringToJSON(res.data.first_level)
          this.allEvaluation.guan_li_fen = stringToJSON(res.data.guan_li_fen)
          this.allEvaluation.guo_cheng_fen = stringToJSON(res.data.guo_cheng_fen)
          this.allEvaluation.zhi_liang_fen = stringToJSON(res.data.zhi_liang_fen)
          this.allEvaluation.shu_liang_fen = stringToJSON(res.data.shu_liang_fen)
          this.alarm.sl.fen = Number(this.allEvaluation.first_level[0][0] || 0).toFixed(0) || 0
          this.alarm.zl.fen = Number(this.allEvaluation.first_level[0][1] || 0).toFixed(0) || 0
          this.alarm.xh.fen = Number(this.allEvaluation.first_level[0][2] || 0).toFixed(0) || 0
          this.alarm.kz.fen = Number(this.allEvaluation.first_level[0][3] || 0).toFixed(0) || 0
          this.alarm.gl.fen = Number(this.allEvaluation.first_level[0][4] || 0).toFixed(0) || 0
          this.alarm.sl.isAlarm = this.allEvaluation.first_level[1][0] + '' === '1'
          this.alarm.zl.isAlarm = this.allEvaluation.first_level[1][1] + '' === '1'
          this.alarm.xh.isAlarm = this.allEvaluation.first_level[1][2] + '' === '1'
          this.alarm.kz.isAlarm = this.allEvaluation.first_level[1][3] + '' === '1'
          this.alarm.gl.isAlarm = this.allEvaluation.first_level[1][4] + '' === '1'
          this.alarm.sl.alarmMsg = this.allEvaluation.first_level[2][0]
          this.alarm.zl.alarmMsg = this.allEvaluation.first_level[2][1]
          this.alarm.xh.alarmMsg = this.allEvaluation.first_level[2][2]
          this.alarm.kz.alarmMsg = this.allEvaluation.first_level[2][3]
          this.alarm.gl.alarmMsg = this.allEvaluation.first_level[2][4]
          this.alarm.sl.adjust = this.allEvaluation.first_level[3][0]
          this.alarm.zl.adjust = this.allEvaluation.first_level[3][1]
          this.alarm.xh.adjust = this.allEvaluation.first_level[3][2]
          this.alarm.kz.adjust = this.allEvaluation.first_level[3][3]
          this.alarm.gl.adjust = this.allEvaluation.first_level[3][4]
          this.evaluationRate = ((this.allEvaluation.zong_level[0][0] || 0) / 20).toFixed(1)
          let radarData = [
            Number(this.allEvaluation.first_level[0][0] || 0).toFixed(0) || 0,
            Number(this.allEvaluation.first_level[0][1] || 0).toFixed(0) || 0,
            Number(this.allEvaluation.first_level[0][2] || 0).toFixed(0) || 0,
            Number(this.allEvaluation.first_level[0][3] || 0).toFixed(0) || 0,
            Number(this.allEvaluation.first_level[0][4] || 0).toFixed(0) || 0]
          let option = {
            tooltip: {},
            radar: {
              radius: "80%", //大小
              nameGap: 2, // 图中工艺等字距离图的距离
              splitNumber: 3,
              center: ["50%", "50%"], // 图的位置
              name: {
                textStyle: {
                  color: "#19C4FF",
                  fontSize: 14
                },
                formatter: function (name) {
                  return name;
                }
              },
              indicator: [
                {"name": '数量', "max": 100, min: 0},
                {"name": '质量', "max": 100, min: 0},
                {"name": '生产消耗', "max": 100, min: 0},
                {"name": '过程控制', "max": 100, min: 0},
                {"name": '管理', "max": 100, min: 0},
              ],
              axisLine: {
                lineStyle: {
                  color: "rgba(153, 209, 246, 0.2)"
                }
              },
              splitArea: {
                show: false,
                areaStyle: {
                  color: "rgba(255,0,0,0)" // 图表背景的颜色
                }
              },
              splitLine: {
                show: true,
                lineStyle: {
                  width: 1,
                  color: "rgba(153, 209, 246, 0.2)" // 设置网格的颜色
                }
              }
            },
            series: [
              {
                name: "指标体系评分",
                type: "radar",
                symbol: "angle",
                itemStyle: {
                  normal: {
                    areaStyle: {type: "default"}
                  }
                },
                label: {
                  show: true,
                  formatter: '{b}{c}'
                },
                data: [
                  {
                    symbol: "circle",
                    symbolSize: 5,
                    value: radarData,
                    label: {
                      show: true,
                      fontSize: 14,
                      color: '#19C4FF'
                    },
                    areaStyle: {color: "rgba(64, 205, 241, 0.2)"},
                    lineStyle: {
                      color: "rgba(146, 225, 255, 1)",
                      width: 1
                    }
                  }
                ]
              }
            ]
          }
          this.chartUpper2.setOption(option);
        }).catch(() => {
        })
      },
      getChartRingData(chart) {
        this.$http.get(`/iailab-ntt-model/index/evaluate/chart/0`).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          let systemChartData = res.data.series[0].data[0]
          let systemCharLegend = res.data.legend
          let option = {
            tooltip: {
              trigger: 'item',
              formatter: '{b}:({d}%)',
            },
            legend: [
              {
                top: 'center',
                orient: 'vertical',
                right: '0%',
                icon: 'square',
                itemGap: 14,
                textStyle: {
                  color: '#19C4FF',
                  fontSize: 14,
                  padding: [0, 0, 0, 0],
                },
                data: systemCharLegend,
              }],
            grid: {
              containLabel: true,
            },
            title: {
              text: `{a| 指标体系}`,
              textStyle: {
                rich: {
                  a: {
                    fontSize: 14,
                    color: '#19C4FF',
                  },
                },
              },
              subtext: `{a|权重}`,
              subtextStyle: {
                rich: {
                  a: {
                    fontSize: 14,
                    color: '#19C4FF',
                    padding: [0, 0, 0, 18],
                  },
                },
              },
              x: '42%',
              y: '40%',
            },
            series: [
              {
                type: 'pie',
                radius: ['50%', '66%'],
                center: ['50%', '50%'],
                color: [
                  '#A871E3',
                  '#86DF6C',
                  '#0E42D2',
                  '#FF7D00',
                  '#F7BA1E',
                ],
                label: {
                  position: 'outside',
                  show: true,
                  color: '#19C4FF',
                  fontSize: 14,
                  formatter: function (params) {
                    if (params.name !== '') {
                      return params.percent + '%';
                    }
                  },
                },
                data: systemChartData,
              },
            ],
          }
          chart.setOption(option);
        }).catch(() => {
        })
      },
      getLog() {
        this.$http.get(`/iailab-ntt-model/api/model/model-result/list`, {
          params: {
            modelCode: 'all_evaluation',
            lastHour: 24 * 4,
            isAsc: false
          }
        }).then(({data: res}) => {
          let data = []
          res.data.forEach(function (item) {
            data.push([
              item.resultTime,
              Number(stringToJSON(item.zong_level)[0][0]).toFixed(1),
              stringToJSON(item.zong_level)[1][0]])
          })
          this.config = {
            header: ['日期', '分数', '生产指标评价'],
            rowNum: 4,
            waitTime: 10000,
            columnWidth: [350, 100, 500],
            align: ['center', 'center', 'center'],
            headerBGC: 'rgba(0,133,255,0.29)',
            headerHeight: 50,
            oddRowBGC: 'rgba(0, 44, 81, 0.8)',
            evenRowBGC: 'rgba(10, 29, 50, 0.8)',
            data: data
          }
        })
      },
      getChartData() {
        this.$http.get(`/iailab-ntt-model/api/model/model-result/list`, {
          params: {
            modelCode: 'all_evaluation',
            lastHour: 24 * 4,
            isAsc: true
          }
        }).then(({data: res}) => {
          let xData = []
          let zongPf = []
          let sl_xx = []
          let sl_zq = []
          let zl_xzk_hf = []
          let zl_xzk_sf = []
          let zl_xzk_rz = []
          let zl_hm_hf = []
          let zl_hm_sf = []
          let zl_hm_rz = []
          let scxh_jh = []
          let scxh_yh = []
          let scxh_dh = []
          let scxh_sh = []
          let gckz_kmhf = []
          let gckz_mmhf = []
          let gckz_1FJ = []
          let gckz_2FJ = []
          let gckz_401DL = []
          let gckz_402DL = []
          let gckz_501DL = []
          let gckz_HHM_RZ = []
          // let gckz_HHM_HF = []
          // let gckz_HHM_SF = []
          let gl_jxl = []
          let gl_kjl = []
          let gl_kql = []
          res.data.forEach(function (item) {
            xData.push(item.resultTime.toString().substr(0, 10))
            zongPf.push(stringToJSON(item.zong_level)[0][0])
            let shu_liang_fen = stringToJSON(item.shu_liang_fen)
            sl_xx.push(shu_liang_fen[0][0])
            sl_zq.push(shu_liang_fen[0][1])
            let zhi_liang_fen = stringToJSON(item.zhi_liang_fen)
            zl_xzk_hf.push(zhi_liang_fen[0][3])
            zl_xzk_sf.push(zhi_liang_fen[0][4])
            zl_xzk_rz.push(zhi_liang_fen[0][5])
            zl_hm_hf.push(zhi_liang_fen[0][6])
            zl_hm_sf.push(zhi_liang_fen[0][7])
            zl_hm_rz.push(zhi_liang_fen[0][8])
            let sheng_chan_fen = stringToJSON(item.sheng_chan_fen)
            scxh_jh.push(sheng_chan_fen[0][0])
            scxh_yh.push(sheng_chan_fen[0][1])
            scxh_dh.push(sheng_chan_fen[0][2])
            scxh_sh.push(sheng_chan_fen[0][3])
            let guo_cheng_fen = stringToJSON(item.guo_cheng_fen)
            gckz_kmhf.push(guo_cheng_fen[0][0])
            gckz_mmhf.push(guo_cheng_fen[0][1])
            gckz_1FJ.push(guo_cheng_fen[0][2])
            gckz_2FJ.push(guo_cheng_fen[0][3])
            gckz_401DL.push(guo_cheng_fen[0][4])
            gckz_402DL.push(guo_cheng_fen[0][5])
            gckz_501DL.push(guo_cheng_fen[0][6])
            gckz_HHM_RZ.push(guo_cheng_fen[0][7])
            // gckz_HHM_HF.push(guo_cheng_fen[8][0])
            // gckz_HHM_SF.push(guo_cheng_fen[9][0])
            let guan_li_fen = stringToJSON(item.guan_li_fen)
            gl_jxl.push(guan_li_fen[0][0])
            gl_kjl.push(guan_li_fen[0][1])
            gl_kql.push(guan_li_fen[0][2])
          })
          let optionZong = {
            title: {
              show: false
            },
            tooltip: {
              trigger: 'axis'
            },
            legend: {
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [2, 0, 0, 2],
                fontWeight: 100,
              },
            },
            grid: {
              top: '25%',
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            xAxis: {
              type: 'category',
              boundaryGap: false,
              axisLabel: {
                color: "#DEDEDE"
              },
              data: xData
            },
            yAxis: {
              type: 'value',
              splitLine: {
                show: false
              },
              axisLine: {
                show: true,
                onZero: false,
                color: '#FFFFFF',
              },
              axisTick: {show: true},
              axisLabel: {
                formatter: '{value}',
                color: "#DEDEDE"
              }
            },
            series: [
              {
                data: zongPf,
                type: 'line',
                smooth: true,
                showSymbol: true,
                color: 'rgba(0,194,255,0.44)',
                areaStyle: {}
              }
            ]
          };
          this.chartMiddle1.setOption(optionZong);
          let optionSl = {
            tooltip: {//提示框组件
              trigger: 'axis',//触发类型 柱状图
              axisPointer: {type: 'shadow'} //触发效果 移动上去 背景效果
            },
            grid: {
              top: '15%',
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            xAxis: [//x轴
              {
                type: 'category',//坐标轴类型 离散
                data: xData,//数据
                axisTick: false,//是否显示刻度
                axisLine: {//坐标轴样式
                  show: true,//是否显示
                  lineStyle: {//线的样式
                    type: 'dashed'//线的类型 虚线
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            yAxis: [//y轴
              {
                min: 0,//最小
                max: 100,//最大
                interval: 100,//相差
                type: 'value',//连续类型
                axisLine: {//坐标轴样式
                  show: false, //不显示
                },
                splitLine: {//分隔辅助线
                  lineStyle: {
                    type: 'dashed',//线的类型 虚线0
                    opacity: 0.2//透明度
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            series: [
              {
                name: '原煤入洗达成率',
                type: 'bar',
                barWidth: 11,
                data: sl_xx,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(3, 181, 243)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(2, 190, 251,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '栈桥运输达成率',//名称
                type: 'bar',//类型
                barWidth: 11,//宽度
                data: sl_zq,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(6, 244, 231)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(6, 244, 231,0)',
                      },
                    ],
                  },
                },
              }
            ],
            legend: {
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [2, 0, 0, 2],
                fontWeight: 100,
              },
            },
          };
          this.chartMiddle2.setOption(optionSl);
          let optionZl = {
            tooltip: {//提示框组件
              trigger: 'axis',//触发类型 柱状图
              axisPointer: {type: 'shadow'} //触发效果 移动上去 背景效果
            },
            grid: {
              top: '15%',
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            xAxis: [//x轴
              {
                type: 'category',//坐标轴类型 离散
                data: xData,//数据
                axisTick: false,//是否显示刻度
                axisLine: {//坐标轴样式
                  show: true,//是否显示
                  lineStyle: {//线的样式
                    type: 'dashed'//线的类型 虚线
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            yAxis: [//y轴
              {
                min: 0,//最小
                max: 100,//最大
                interval: 100,//相差
                type: 'value',//连续类型
                axisLine: {//坐标轴样式
                  show: false, //不显示
                },
                splitLine: {//分隔辅助线
                  lineStyle: {
                    type: 'dashed',//线的类型 虚线0
                    opacity: 0.2//透明度
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            series: [//系统列表
              {
                name: '洗中块灰分',
                type: 'bar',
                barWidth: 11,
                data: zl_xzk_hf,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(3, 181, 243)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(2, 190, 251,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '洗中块水分',//名称
                type: 'bar',//类型
                barWidth: 11,//宽度
                data: zl_xzk_sf,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(6, 244, 231)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(6, 244, 231,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '洗中块热值',//名称
                type: 'bar',//类型
                barWidth: 11,//宽度
                data: zl_xzk_rz,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: '#FFAA5D',
                      },
                      {
                        offset: 1,
                        color: 'rgba(255,170,93,0.14)',
                      },
                    ],
                  },
                },
              },
              {
                name: '混煤灰分',
                type: 'bar',
                barWidth: 11,
                data: zl_hm_hf,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgb(182,93,246)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(182,93,246,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '混煤水分',//名称
                type: 'bar',//类型
                barWidth: 11,//宽度
                data: zl_hm_sf,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgb(248,109,202)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(248,109,202,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '混煤热值',//名称
                type: 'bar',//类型
                barWidth: 11,//宽度
                data: zl_hm_rz,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgb(143,208,141)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(143,208,141,0)',
                      },
                    ],
                  },
                },
              }
            ],
            legend: {
              type: 'scroll',
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [2, 0, 0, 2],
                fontWeight: 100,
              },
            },
          };
          this.chartMiddle3.setOption(optionZl);
          let optionScxh = {
            tooltip: {//提示框组件
              trigger: 'axis',//触发类型 柱状图
              axisPointer: {type: 'shadow'} //触发效果 移动上去 背景效果
            },
            grid: {
              top: '15%',
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            xAxis: [//x轴
              {
                type: 'category',//坐标轴类型 离散
                data: xData,//数据
                axisTick: false,//是否显示刻度
                axisLine: {//坐标轴样式
                  show: true,//是否显示
                  lineStyle: {//线的样式
                    type: 'dashed'//线的类型 虚线
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            yAxis: [//y轴
              {
                min: 0,//最小
                max: 100,//最大
                interval: 100,//相差
                type: 'value',//连续类型
                axisLine: {//坐标轴样式
                  show: false, //不显示
                },
                splitLine: {//分隔辅助线
                  lineStyle: {
                    type: 'dashed',//线的类型 虚线0
                    opacity: 0.2//透明度
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            series: [//系统列表
              {
                name: '介耗',
                type: 'bar',
                barWidth: 11,
                data: scxh_jh,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(3, 181, 243)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(2, 190, 251,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '药耗',//名称
                type: 'bar',//类型
                barWidth: 11,//宽度
                data: scxh_yh,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(6, 244, 231)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(6, 244, 231,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '电耗',//名称
                type: 'bar',//类型
                barWidth: 11,//宽度
                data: scxh_dh,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: '#FFAA5D',
                      },
                      {
                        offset: 1,
                        color: 'rgba(255,170,93,0.14)',
                      },
                    ],
                  },
                },
              },
              {
                name: '水耗',//名称
                type: 'bar',//类型
                barWidth: 11,//宽度
                data: scxh_sh,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgb(220,141,248)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(220,141,248,0.1)',
                      },
                    ],
                  },
                },
              }
            ],
            legend: {
              type: 'scroll',
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [2, 0, 0, 2],
                fontWeight: 100,
              },
            },
          };
          this.chartUnder1.setOption(optionScxh);
          let optionGckz = {
            tooltip: {//提示框组件
              trigger: 'axis',//触发类型 柱状图
              axisPointer: {type: 'shadow'} //触发效果 移动上去 背景效果
            },
            grid: {
              top: '15%',
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            xAxis: [//x轴
              {
                type: 'category',//坐标轴类型 离散
                data: xData,//数据
                axisTick: false,//是否显示刻度
                axisLine: {//坐标轴样式
                  show: true,//是否显示
                  lineStyle: {//线的样式
                    type: 'dashed'//线的类型 虚线
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            yAxis: [//y轴
              {
                min: 0,//最小
                max: 100,//最大
                interval: 100,//相差
                type: 'value',//连续类型
                axisLine: {//坐标轴样式
                  show: false, //不显示
                },
                splitLine: {//分隔辅助线
                  lineStyle: {
                    type: 'dashed',//线的类型 虚线0
                    opacity: 0.2//透明度
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            series: [//系统列表
              {
                name: '块煤灰分',
                type: 'bar',
                barWidth: 10,
                data: gckz_kmhf,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(3, 181, 243)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(2, 190, 251,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '末煤灰分',//名称
                type: 'bar',//类型
                barWidth: 10,//宽度
                data: gckz_mmhf,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(6, 244, 231)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(6, 244, 231,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '1#低压风机',//名称
                type: 'bar',//类型
                barWidth: 10,//宽度
                data: gckz_1FJ,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: '#FFAA5D',
                      },
                      {
                        offset: 1,
                        color: 'rgba(255,170,93,0.14)',
                      },
                    ],
                  },
                },
              },
              {
                name: '2#低压风机',
                type: 'bar',
                barWidth: 10,
                data: gckz_2FJ,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(182,93,246)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(182,93,246,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '401底流浓度',//名称
                type: 'bar',//类型
                barWidth: 10,//宽度
                data: gckz_401DL,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(248,109,202)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(248,109,202,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '402底流浓度',//名称
                type: 'bar',//类型
                barWidth: 10,//宽度
                data: gckz_402DL,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgb(143,208,141)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(143,208,141,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '501底流浓度',
                type: 'bar',
                barWidth: 10,
                data: gckz_501DL,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(3, 181, 243)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(2, 190, 251,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '配煤混合煤热值',//名称
                type: 'bar',//类型
                barWidth: 10,//宽度
                data: gckz_HHM_RZ,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgb(248,84,109)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(248,84,109,0)',
                      },
                    ],
                  },
                },
              },
            ],
            legend: {
              type: 'scroll',
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [2, 0, 0, 2],
                fontWeight: 100,
              },
            },
          };
          this.chartUnder2.setOption(optionGckz);
          let optionGl = {
            tooltip: {//提示框组件
              trigger: 'axis',//触发类型 柱状图
              axisPointer: {type: 'shadow'} //触发效果 移动上去 背景效果
            },
            grid: {
              top: '15%',
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            xAxis: [//x轴
              {
                type: 'category',//坐标轴类型 离散
                data: xData,//数据
                axisTick: false,//是否显示刻度
                axisLine: {//坐标轴样式
                  show: true,//是否显示
                  lineStyle: {//线的样式
                    type: 'dashed'//线的类型 虚线
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            yAxis: [//y轴
              {
                min: 0,//最小
                max: 100,//最大
                interval: 100,//相差
                type: 'value',//连续类型
                axisLine: {//坐标轴样式
                  show: false, //不显示
                },
                splitLine: {//分隔辅助线
                  lineStyle: {
                    type: 'dashed',//线的类型 虚线0
                    opacity: 0.2//透明度
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            series: [//系统列表
              {
                name: '检修率',
                type: 'bar',
                barWidth: 11,
                data: gl_jxl,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(3, 181, 243)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(2, 190, 251,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '生产运行评价',//名称
                type: 'bar',//类型
                barWidth: 11,//宽度
                data: gl_kjl,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(6, 244, 231)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(6, 244, 231,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '考勤率',//名称
                type: 'bar',//类型
                barWidth: 11,//宽度
                data: gl_kql,//数值
                z: 2,
                itemStyle: {
                  color: {//渐变色
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: '#FFAA5D',
                      },
                      {
                        offset: 1,
                        color: 'rgba(255,170,93,0.14)',
                      },
                    ],
                  },
                },
              }
            ],
            legend: {
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [2, 0, 0, 2],
                fontWeight: 100,
              },
            },
          };
          this.chartUnder3.setOption(optionGl);
        })
      }
    }
  }
</script>
<style scoped>
  #data-evaluate-body {
    width: 100%;
    height: 100%;
    padding: 10px;
    display: flex;
    flex-direction: column;
  }
  #data-upper {
    width: 100%;
    height: 32%;
    display: flex;
    flex-direction: row;
  }
  .data-upper-1 {
    width: 20%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-left: 15px;
    margin-top: -16px;
  }
  .data-upper-1-1 {
    width: 100%;
    height: 30%;
    display: flex;
    flex-direction: row;
    margin-top: -48px;
    padding-left: 30px;
  }
  .data-upper-1-2 {
    width: 100%;
    height: 70%;
  }
  .data-upper-content-1 {
    width: 30%;
    height: 100%;
    font-size: 40px;
    font-weight: bold;
    color: #5BFD9E;
  }
  .data-upper-content-2 {
    width: 50%;
    height: 100%;
    font-size: 14px;
    color: #80D8FE;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
  }
  .data-upper-content-3 {
    padding-top: 14px;
    margin-right: -70px;
  }
  .data-upper-2 {
    width: 30%;
    height: 100%;
    padding-top: 15px;
    padding-left: 5px;
  }
  .data-upper-3 {
    width: 20%;
    height: 100%;
    padding-top: 15px;
    padding-left: 5px;
  }
  .data-upper-4 {
    width: 29%;
    height: 100%;
  }
  #data-middle {
    width: 100%;
    height: 27%;
    padding: 0 10px 10px 10px;
    display: flex;
    flex-direction: row;
  }
  .data-middle-sub {
    width: 33%;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  #data-under {
    width: 100%;
    height: 27%;
    display: flex;
    flex-direction: row;
  }
  .data-under-sub {
    width: 33%;
    height: 100%;
    padding: 5px 10px 5px 10px;
    margin-bottom: 5px;
  }
  .data-title {
    width: 100%;
    height: 7%;
    padding: 10px;
    display: flex;
    flex-direction: row;
  }
  .data-title-sub {
    width: 33%;
    height: 100%;
    padding-left: 20px;
  }
  .chart-line {
    width: 100%;
    height: 100%;
  }
  .chart-line-1 {
    width: 100%;
    height: 80%;
  }
  .pf-text {
    width: 90%;
    height: 20%;
    margin: 0 20px -5px 20px;
    padding: 5px;
    background-color: rgba(135, 206, 235, 0.2);
    font-size: 14px;
  }
</style>
src/views/modules/analysis/components/product-overview.vue
对比新文件
@@ -0,0 +1,1969 @@
<template>
  <div id="data-overview-body">
    <div id="data-left">
      <div class="data-left-1">
        <img :src="img_left_1">
      </div>
      <div class="data-left-2">
        <div class="data-left-sub-2">
          <div class="data-left-content-1">
            <div ref="chartLeft21" class="chart-ring-line"></div>
          </div>
          <div class="data-left-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010002}} </span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>年计划产量</span>
          </div>
          <div class="data-left-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010003}} </span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>当前完成量</span>
          </div>
          <div class="data-left-content-1">
            <div>
              <span style="font-size: 24px;font-weight: bold;color: #5BFD9E">{{indData.C010001}} </span>
              <span style="color: #538BB0">%</span>
            </div>
            <span>达成率</span>
          </div>
        </div>
        <div class="data-left-sub-2">
          <div class="data-left-content-1">
            <div ref="chartLeft22" class="chart-ring-line"></div>
          </div>
          <div class="data-left-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010006}}</span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>月计划产量</span>
          </div>
          <div class="data-left-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010007}}</span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>当前完成量</span>
          </div>
          <div class="data-left-content-1">
            <div>
              <span style="font-size: 24px;font-weight: bold;color: #5BFD9E">{{indData.C010003}}</span>
              <span style="color: #538BB0">%</span>
            </div>
            <span>达成率</span>
          </div>
        </div>
        <div class="data-left-sub-2">
          <div class="data-left-content-1">
            <div ref="chartLeft23" class="chart-ring-line"></div>
          </div>
          <div class="data-left-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010010}}</span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>昨日计划产量</span>
          </div>
          <div class="data-left-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010011}}</span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>当前完成量</span>
          </div>
          <div class="data-left-content-1">
            <div>
              <span style="font-size: 24px;font-weight: bold;color: #5BFD9E">{{indData.C010005}}</span>
              <span style="color: #538BB0">%</span>
            </div>
            <span>达成率</span>
          </div>
        </div>
      </div>
      <div class="data-left-3">
        <div>
          <span class="chart-title">原煤入洗趋势</span>
        </div>
        <div ref="rawCoalProductTrendChart" class="chart-line"></div>
      </div>
      <div class="data-left-4">
        <div>
          <span class="chart-title">原煤煤质趋势</span>
        </div>
        <div ref="rawCoalQualityTrendChart" class="chart-line"></div>
      </div>
    </div>
    <div id="data-middle">
      <div class="data-middle-1">
        <img :src="img_middle_1_1"/>
        <!--<div class="middle-fcfx-button">
          <el-button size="mini" type="text">指标显示配置</el-button>
        </div>-->
        <!--<img :src="img_middle_1_2" style="margin-left: -100px;" @click=""/>-->
      </div>
      <div class="data-middle-2">
        <div class="data-middle-sub-2">
          <div>
            <span class="chart-title">原煤灰分</span>
          </div>
          <div ref="fxChart" class="chart-line"></div>
        </div>
        <div class="data-middle-sub-2">
          <div>
            <span class="chart-title">混煤灰分</span>
          </div>
          <div ref="chartM2" class="chart-line"></div>
        </div>
      </div>
      <div class="data-middle-3">
        <div class="data-middle-sub-3-1">
          <div>
            <span class="chart-title">原煤热值</span>
          </div>
          <div ref="chartM3" class="chart-line"></div>
        </div>
        <div class="data-middle-sub-3-2">
          <div>
            <span class="chart-title">混煤热值</span>
          </div>
          <div ref="chartM4" class="chart-line"></div>
        </div>
      </div>
      <div class="data-middle-4">
        <img :src="img_middle_4"/>
      </div>
      <div class="data-middle-5">
        <div class="data-middle-sub-5">
          <div class="data-middle-sub-5-1">
            <img :src="img_middle_5_1"/>
          </div>
          <div class="data-middle-sub-5-2">
            <div style="margin-top: 5px;margin-left: 20px;">
              <div class="data-middle-sub-5-2-1">
                <div style=" width: 100%;height: 100%;padding-bottom: 18px">
                  <span style="font-size: 16px;color: #ffffff;display: inline">评分: </span>
                  <span style="font-size: 32px;font-weight: bold;color: #FFAA5D;display: inline">{{storageReliability.data.score}}</span>
                </div>
<!--                <div style=" width: 38%;height: 100%;">-->
<!--                  <div>-->
<!--                    <span style="font-size: 20px;font-weight: bold;color: #5BFD9E;">加仓</span>-->
<!--                  </div>-->
<!--                  <span style="color: #80D8FE;">进出仓动态</span>-->
<!--                </div>-->
<!--                <div style=" width: 40%;height: 100%;">-->
<!--                  <div>-->
<!--                    <span style="font-size: 20px;color: #80D8FE;font-weight: bold">1961</span>-->
<!--                    <span style="color: #538BB0">吨</span>-->
<!--                  </div>-->
<!--                  <span style="color: #80D8FE;">可支持外运量</span>-->
<!--                </div>-->
              </div>
              <div class="data-middle-sub-5-2-2">
                <img :src="img_middle_5_2"/>
              </div>
              <div class="data-middle-sub-5-2-3">
                <span style="color: #80D8FE;">仓储分析:</span>
                <span style="color: #FFFFFF;">{{storageReliability.data.analysis}}</span>
              </div>
              <div style="margin-left: -116px;padding-top: 50px;">
                <span style="font-size: 26px;color: #FFFFFF;font-weight: bold">煤储仓库   </span>
                <span style="color: #FFFFFF;">{{storageReliability.data.runTime}}</span>
                <span style="color: #FFFFFF;">更新</span>
              </div>
            </div>
          </div>
        </div>
        <div class="data-middle-sub-5">
          <dv-scroll-board :config="config" style="height: 100%;"/>
        </div>
      </div>
    </div>
    <div id="data-right">
      <div class="data-right-1">
        <img :src="img_right_1"/>
      </div>
      <div class="data-right-2">
        <div class="data-right-sub-2">
          <div class="data-right-content-1">
            <div ref="chartRight21" class="chart-ring-line"></div>
          </div>
          <div class="data-right-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010004}}</span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>年计划产量</span>
          </div>
          <div class="data-right-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010005}}</span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>当前完成量</span>
          </div>
          <div class="data-right-content-1">
            <div>
              <span style="font-size: 24px;font-weight: bold;color: #5BFD9E">{{indData.C010002}}</span>
              <span style="color: #538BB0">%</span>
            </div>
            <span>达成率</span>
          </div>
        </div>
        <div class="data-right-sub-2">
          <div class="data-right-content-1">
            <div ref="chartRight22" class="chart-ring-line"></div>
          </div>
          <div class="data-right-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010008}}</span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>月计划产量</span>
          </div>
          <div class="data-right-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010009}}</span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>当前完成量</span>
          </div>
          <div class="data-right-content-1">
            <div>
              <span style="font-size: 24px;font-weight: bold;color: #5BFD9E">{{indData.C010004}}</span>
              <span style="color: #538BB0">%</span>
            </div>
            <span>达成率</span>
          </div>
        </div>
        <div class="data-right-sub-2">
          <div class="data-right-content-1">
            <div ref="chartRight23" class="chart-ring-line"></div>
          </div>
          <div class="data-right-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010012}}</span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>昨日计划产量</span>
          </div>
          <div class="data-right-content-1">
            <div>
              <span style="font-size: 16px;font-weight: bold">{{indData.A010013}}</span>
              <span style="color: #538BB0">吨</span>
            </div>
            <span>当前完成量</span>
          </div>
          <div class="data-right-content-1">
            <div>
              <span style="font-size: 24px;font-weight: bold;color: #5BFD9E">{{indData.C010006}}</span>
              <span style="color: #538BB0">%</span>
            </div>
            <span>达成率</span>
          </div>
        </div>
      </div>
      <div class="data-right-3">
        <div>
          <span class="chart-title">栈桥生产趋势</span>
        </div>
        <div ref="goodsCoalProductTrendChart" class="chart-line"></div>
      </div>
      <div class="data-right-4">
        <div>
          <span class="chart-title">混煤产率趋势</span>
        </div>
        <div ref="goodsCoalRateTrendChart" class="chart-line"></div>
      </div>
    </div>
  </div>
</template>
<script>
  import {reWriteUrlSVG} from '@/utils/hostUtil'
  import {formatNum} from '@/utils/numUtil'
  import {getSeriesData} from '@/utils/mathUtils'
  export default {
    components: {},
    data() {
      return {
        img_left_1: this.doEeWriteUrlSVG('/svg/原煤趋势分析.svg'),
        img_middle_1_1: this.doEeWriteUrlSVG('/svg/生产过程分析.svg'),
        img_middle_1_2: this.doEeWriteUrlSVG('/svg/指标显示配置.svg'),
        img_middle_3: this.doEeWriteUrlSVG('/svg/配置.svg'),
        img_middle_4: this.doEeWriteUrlSVG('/svg/仓储可靠性分析.svg'),
        img_middle_5_1: this.doEeWriteUrlSVG('/svg/仓库.svg'),
        img_middle_5_2: this.doEeWriteUrlSVG('/svg/引导线.svg'),
        img_right_1: this.doEeWriteUrlSVG('/svg/商品煤趋势分析.svg'),
        chartLeft21: {},
        chartLeft22: {},
        chartLeft23: {},
        chartRight21: {},
        chartRight22: {},
        chartRight23: {},
        fxChart: {},
        chartM2: {},
        chartM3: {},
        chartM4: {},
        rawCoalProductTrendChart: {},
        rawCoalQualityTrendChart: {},
        goodsCoalProductTrendChart: {},
        goodsCoalRateTrendChart: {},
        config: {
          header: ['日期', '分数', '仓储分析'],
          rowNum: 3,
          waitTime: 10000,
          columnWidth: [350, 200, 500],
          align: ['center'],
          headerBGC: '#016D95',
          headerHeight: 40,
          oddRowBGC: 'rgba(0, 44, 81, 0.8)',
          evenRowBGC: 'rgba(10, 29, 50, 0.8)',
          data: []
        },
        indList: [
          'A010002',
          'A010003',
          'C010001',
          'A010006',
          'A010007',
          'C010003',
          'A010010',
          'A010011',
          'C010005',
          'A010004',
          'A010005',
          'C010002',
          'A010008',
          'A010009',
          'C010004',
          'A010012',
          'A010013',
          'C010006',
        ],
        indData: {
          A010002: '',
          A010003: '',
          C010001: '',
          A010006: '',
          A010007: '',
          C010003: '',
          A010004: '',
          A010005: '',
          C010002: '',
          A010008: '',
          A010009: '',
          C010004: '',
          A010012: '',
          A010013: '',
          C010006: '',
        },
        storageReliability: {
          code: 'storage_reliability',
          data: {
            judgement: '',
            analysis: '',
            score: '',
            runTime: '',
          }
        }
      }
    },
    mounted() {
      this.chartLeft21 = this.$echarts.init(this.$refs.chartLeft21)
      this.chartLeft22 = this.$echarts.init(this.$refs.chartLeft22)
      this.chartLeft23 = this.$echarts.init(this.$refs.chartLeft23)
      this.chartRight21 = this.$echarts.init(this.$refs.chartRight21)
      this.chartRight22 = this.$echarts.init(this.$refs.chartRight22)
      this.chartRight23 = this.$echarts.init(this.$refs.chartRight23)
      this.fxChart = this.$echarts.init(this.$refs.fxChart);
      this.chartM2 = this.$echarts.init(this.$refs.chartM2);
      this.chartM3 = this.$echarts.init(this.$refs.chartM3);
      this.chartM4 = this.$echarts.init(this.$refs.chartM4);
      this.rawCoalProductTrendChart = this.$echarts.init(this.$refs.rawCoalProductTrendChart);
      this.rawCoalQualityTrendChart = this.$echarts.init(this.$refs.rawCoalQualityTrendChart);
      this.goodsCoalProductTrendChart = this.$echarts.init(this.$refs.goodsCoalProductTrendChart);
      this.goodsCoalRateTrendChart = this.$echarts.init(this.$refs.goodsCoalRateTrendChart);
      let that = this;
      that.init()
      setInterval(function () {
        that.init()
      }, 1000 * 60 * 60)
    },
    methods: {
      init() {
        this.getIndData()
        this.getChartData1(this.rawCoalProductTrendChart)
        this.getChartData2(this.goodsCoalProductTrendChart)
        this.getChartDataYMMZ(this.rawCoalQualityTrendChart)
        this.getChartDataM1(this.fxChart)
        this.getChartDataM2(this.chartM2)
        this.getChartDataM3(this.chartM3)
        this.getChartDataM4(this.chartM4)
        this.getChartData3(this.goodsCoalRateTrendChart)
        this.getReliabilityList()
        this.getCurrentStorageReliability()
      },
      doEeWriteUrlSVG(url) {
        return reWriteUrlSVG(url)
      },
      getIndData() {
        let that = this
        this.$http.post(`/iailab-ntt-data/api/data/ind-item/current-value`, this.indList).then(({data: res}) => {
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          this.indData.A010002 = formatNum(res.data.A010002)
          this.indData.A010003 = formatNum(res.data.A010003)
          this.indData.C010001 = formatNum(res.data.C010001, 1)
          that.getChartRingData(this.chartLeft21, res.data.A010002, res.data.A010003)
          this.indData.A010006 = formatNum(res.data.A010006)
          this.indData.A010007 = formatNum(res.data.A010007)
          this.indData.C010003 = formatNum(res.data.C010003, 1)
          that.getChartRingData(this.chartLeft22, res.data.A010006, res.data.A010007)
          this.indData.A010010 = formatNum(res.data.A010010)
          this.indData.A010011 = formatNum(res.data.A010011)
          this.indData.C010005 = formatNum(res.data.C010005, 1)
          that.getChartRingData(this.chartLeft23, res.data.A010010, res.data.A010011)
          this.indData.A010004 = formatNum(res.data.A010004)
          this.indData.A010005 = formatNum(res.data.A010005)
          this.indData.C010002 = formatNum(res.data.C010002, 1)
          that.getChartRingData(this.chartRight21, res.data.A010004, res.data.A010005)
          this.indData.A010008 = formatNum(res.data.A010008)
          this.indData.A010009 = formatNum(res.data.A010009)
          this.indData.C010004 = formatNum(res.data.C010004, 1)
          that.getChartRingData(this.chartRight22, res.data.A010008, res.data.A010009)
          this.indData.A010012 = formatNum(res.data.A010012)
          this.indData.A010013 = formatNum(res.data.A010013)
          this.indData.C010006 = formatNum(res.data.C010006, 1)
          that.getChartRingData(this.chartRight23, res.data.A010012, res.data.A010013)
        })
      },
      getCurrentStorageReliability() {
        this.$http.get(`/iailab-ntt-model/api/model/model-result/${this.storageReliability.code}`).then(({data: res}) => {
          if (res.code !== 0) {
            console.log("url=/api/model-result,params=" + this.storageReliability.code)
            return this.$message.error(res.msg)
          }
          this.storageReliability.data.judgement = res.data.judgement || ''
          this.storageReliability.data.analysis = res.data.analysis || ''
          this.storageReliability.data.score = Number(res.data.score).toFixed(1) || ''
          this.storageReliability.data.runTime = res.data.result_time || ''
        }).catch(() => {
        })
      },
      getReliabilityList() {
        this.$http.get(`/iailab-ntt-model/api/model/model-result/list`, {
          params: {
            modelCode: this.storageReliability.code,
            lastHour: 48,
            isAsc: false
          }
        }).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          let data = []
          res.data.forEach(function (item) {
            data.push([
              item.resultTime,
              Number(item.score).toFixed(1),
              item.analysis])
          })
          this.config = {
            header: ['日期', '分数', '仓储分析'],
            rowNum: 4,
            waitTime: 10000,
            columnWidth: [350, 100, 500],
            align: ['center', 'center', 'center'],
            headerBGC: '#016D95',
            headerHeight: 40,
            oddRowBGC: 'rgba(0, 44, 81, 0.8)',
            evenRowBGC: 'rgba(10, 29, 50, 0.8)',
            data: data
          }
        }).catch(() => {
        })
      },
      getChartRingData(chart, planValue, finishValue) {
        let option = {
          color: ['#19C4FF', '#062847'],
          series: [
            {
              name: '',
              type: 'pie',
              radius: ['50%', '70%'],
              avoidLabelOverlap: false,
              label: {
                show: false,
                position: 'center'
              },
              emphasis: {
                label: {
                  show: true,
                  fontSize: 20,
                  fontWeight: 'bold'
                }
              },
              labelLine: {
                show: false
              },
              data: [
                {value: finishValue, name: '完成'},
                {value: (planValue - finishValue), name: '未完成'}
              ]
            }
          ]
        };
        chart.setOption(option);
      },
      getChartDataM1(chart) {
        let that = this
        let params = ['A010001']
        this.$http.post(`/iailab-ntt-data/api/data/ind-item/values-trend`, params).then(({data: res}) => {
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          let valueData = res.data['values']
          let xAxis = []
          let dataHF = []
          if (!valueData['A010001']) {
            return;
          }
          valueData['A010001'].forEach((item) =>{
            xAxis.push(item.dataTime)
            if (item.dataValue && item.dataValue >= 0) {
              dataHF.push([item.dataTime, item.dataValue])
            }
          })
          let trendData = res.data['trend']
          if (!trendData['A010001']) {
            return;
          }
          let trendS = getSeriesData(trendData['A010001']['slope'], trendData['A010001']['bias'], xAxis.length)
          let option = {
            title: {
              show: false
            },
            tooltip: {
              trigger: 'axis'
            },
            legend: {
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [0, 0, 0, 2],
                fontWeight: 100,
              },
            },
            grid: {
              top: '15%',
              left: '3%',
              right: '4%',
              bottom: '5%',
              containLabel: true
            },
            xAxis: {
              type: 'category',
              boundaryGap: false,
              data: xAxis,
              axisLabel: {
                color: "#DEDEDE"
              }
            },
            yAxis: [
              {
                type: 'value',
                axisLine: {
                  show: false,
                },
                splitLine: {
                  lineStyle: {
                    type: 'dashed',
                    opacity: 0.2
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            series: [
              {
                name: '灰分',
                data: dataHF,
                type: 'line',
                smooth: true,
                showSymbol: true,
                color: '#00C2FF'
              },
              {
                name: '趋势',
                data: trendS,
                type: 'line',
                smooth: true,
                showSymbol: false,
                color: '#FFAA5D'
              }
            ]
          };
          option && chart.setOption(option);
        })
      },
      getChartDataM2(chart) {
        let that = this
        let params = ['A010019']
        this.$http.post(`/iailab-ntt-data/api/data/ind-item/values-trend`, params).then(({data: res}) => {
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          let valueData = res.data['values']
          let xAxis = []
          let dataHF = []
          if (!valueData['A010019']) {
            return;
          }
          valueData['A010019'].forEach((item) =>{
            xAxis.push(item.dataTime)
            if (item.dataValue && item.dataValue >= 0) {
              dataHF.push([item.dataTime, item.dataValue])
            }
          })
          let trendData = res.data['trend']
          if (!trendData['A010019']) {
            return;
          }
          let trendS = getSeriesData(trendData['A010019']['slope'], trendData['A010019']['bias'], xAxis.length)
          let option = {
            title: {
              show: false
            },
            tooltip: {
              trigger: 'axis'
            },
            legend: {
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [0, 0, 0, 2],
                fontWeight: 100,
              },
            },
            grid: {
              top: '15%',
              left: '3%',
              right: '4%',
              bottom: '5%',
              containLabel: true
            },
            xAxis: {
              type: 'category',
              boundaryGap: false,
              data: xAxis,
              axisLabel: {
                color: "#DEDEDE"
              }
            },
            yAxis: [
              {
                type: 'value',
                axisLine: {
                  show: false,
                },
                splitLine: {
                  lineStyle: {
                    type: 'dashed',
                    opacity: 0.2
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            series: [
              {
                name: '灰分',
                data: dataHF,
                type: 'line',
                smooth: true,
                showSymbol: true,
                color: '#00C2FF'
              },
              {
                name: '趋势',
                data: trendS,
                type: 'line',
                smooth: true,
                showSymbol: false,
                color: '#FFAA5D'
              }
            ]
          };
          option && chart.setOption(option);
        })
      },
      getChartDataM3(chart) {
        let that = this
        let params = ['A010018']
        this.$http.post(`/iailab-ntt-data/api/data/ind-item/values-trend`, params).then(({data: res}) => {
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          let valueData = res.data['values']
          let xAxis = []
          let dataHF = []
          if (!valueData['A010018']) {
            return;
          }
          valueData['A010018'].forEach((item) =>{
            xAxis.push(item.dataTime)
            if (item.dataValue && item.dataValue >= 0) {
              dataHF.push([item.dataTime, item.dataValue])
            }
          })
          let trendData = res.data['trend']
          if (!trendData['A010018']) {
            return;
          }
          let trendS = getSeriesData(trendData['A010018']['slope'], trendData['A010018']['bias'], xAxis.length)
          let option = {
            title: {
              show: false
            },
            tooltip: {
              trigger: 'axis'
            },
            legend: {
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [0, 0, 0, 2],
                fontWeight: 100,
              },
            },
            grid: {
              top: '15%',
              left: '3%',
              right: '4%',
              bottom: '5%',
              containLabel: true
            },
            xAxis: {
              type: 'category',
              boundaryGap: false,
              data: xAxis,
              axisLabel: {
                color: "#DEDEDE"
              }
            },
            yAxis: [
              {
                type: 'value',
                min: 2000,
                axisLine: {
                  show: false,
                },
                splitLine: {
                  lineStyle: {
                    type: 'dashed',
                    opacity: 0.2
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            series: [
              {
                name: '热值',
                data: dataHF,
                type: 'line',
                smooth: true,
                showSymbol: true,
                color: '#00C2FF'
              },
              {
                name: '趋势',
                data: trendS,
                type: 'line',
                smooth: true,
                showSymbol: false,
                color: '#FFAA5D'
              }
            ]
          };
          option && chart.setOption(option);
        })
      },
      getChartDataM4(chart) {
        let that = this
        let params = ['A010020']
        this.$http.post(`/iailab-ntt-data/api/data/ind-item/values-trend`, params).then(({data: res}) => {
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          let valueData = res.data['values']
          let xAxis = []
          let dataHF = []
          if (!valueData['A010020']) {
            return;
          }
          valueData['A010020'].forEach((item) =>{
            xAxis.push(item.dataTime)
            if (item.dataValue && item.dataValue >= 0) {
              dataHF.push([item.dataTime, item.dataValue])
            }
          })
          let trendData = res.data['trend']
          if (!trendData['A010020']) {
            return;
          }
          let trendS = getSeriesData(trendData['A010020']['slope'], trendData['A010020']['bias'], xAxis.length)
          let option = {
            title: {
              show: false
            },
            tooltip: {
              trigger: 'axis'
            },
            legend: {
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [0, 0, 0, 2],
                fontWeight: 100,
              },
            },
            grid: {
              top: '15%',
              left: '3%',
              right: '4%',
              bottom: '5%',
              containLabel: true
            },
            xAxis: {
              type: 'category',
              boundaryGap: false,
              data: xAxis,
              axisLabel: {
                color: "#DEDEDE"
              }
            },
            yAxis: [
              {
                type: 'value',
                min: 2000,
                axisLine: {
                  show: false,
                },
                splitLine: {
                  lineStyle: {
                    type: 'dashed',
                    opacity: 0.2
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            series: [
              {
                name: '热值',
                data: dataHF,
                type: 'line',
                smooth: true,
                showSymbol: true,
                color: '#00C2FF'
              },
              {
                name: '趋势',
                data: trendS,
                type: 'line',
                smooth: true,
                showSymbol: false,
                color: '#FFAA5D'
              }
            ]
          };
          option && chart.setOption(option);
        })
      },
      getChartData(chart, params) {
        let option;
        option = {
          title: {
            text: name
          },
          tooltip: {
            trigger: 'axis'
          },
          legend: {
            right: '70',
            textStyle: {
              // 图例文字的样式
              color: '#fff',
              fontSize: 14,
              padding: [2, 0, 0, 2],
              fontWeight: 100,
            },
          },
          grid: {
            top: '25%',
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
          },
          xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
          },
          yAxis: {
            type: 'value',
            splitLine: {
              show: false
            },
            axisLine: {
              show: true,
              onZero: false,
              color: '#FFFFFF',
            },
            axisTick: {show: true},
            axisLabel: {
              formatter: '{value}'
            }
          },
          series: [
            {
              name: '灰分',
              data: [150, 230, 282, 218, 135, 147, 260],
              type: 'line',
              smooth: true,
              showSymbol: true,
              color: '#00C2FF'
            },
            {
              name: '热值',
              data: [260, 147, 218, 135, 290, 260, 230],
              type: 'line',
              smooth: true,
              showSymbol: true,
              color: '#FFAA5D'
            }
          ]
        };
        option && chart.setOption(option);
      },
      getChartDataYMMZ(chart) {
        let that = this
        let params = ['A010001','A010018']
        this.$http.post(`/iailab-ntt-data/api/data/ind-item/values`, params).then(({data: res}) => {
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          let xAxis = []
          let dataHF = []
          let dataRZ = []
          if (!res.data['A010001']) {
            return;
          }
          res.data['A010001'].forEach((item) =>{
            xAxis.push(item.dataTime)
            if (item.dataValue && item.dataValue >= 0) {
              dataHF.push([item.dataTime, item.dataValue])
            }
          })
          res.data['A010018'].forEach((item) =>{
            if (item.dataValue && item.dataValue >= 0) {
              dataRZ.push([item.dataTime, item.dataValue])
            }
          })
          let option = {
            title: {
              show: false
            },
            tooltip: {
              trigger: 'axis'
            },
            legend: {
              right: '70',
              textStyle: {
                color: '#fff',
                fontSize: 14,
                padding: [2, 0, 0, 2],
                fontWeight: 100,
              },
            },
            grid: {
              top: '15%',
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            xAxis: {
              type: 'category',
              boundaryGap: false,
              data: xAxis,
              axisLabel: {
                color: "#DEDEDE"
              }
            },
            yAxis: [
              {
                type: 'value',
                position: 'left',
                offset: 0,
                name: '灰分',
                nameTextStyle: {
                  color: '#FFFFFF',
                  fontSize: 10,
                  verticalAlign: 'bottom'
                },
                splitLine: {
                  show: false
                },
                axisLine: {
                  show: true,
                  onZero: false
                },
                axisTick: {show: true},
                axisLabel: {
                  color: '#FFFFFF',
                  formatter: '{value}'
                }
              },
              {
                type: 'value',
                position: 'right',
                offset: 0,
                min: 'dataMin', //取最小值为最小刻度
                name: '热值',
                nameTextStyle: {
                  color: '#FFFFFF',
                  fontSize: 10,
                  align: 'left',
                  verticalAlign: 'bottom'
                },
                splitLine: {
                  show: false
                },
                axisLine: {
                  show: true,
                  onZero: false
                },
                axisTick: {show: true},
                axisLabel: {
                  color: '#FFFFFF',
                  formatter: '{value}'
                }
              },
            ],
            series: [
              {
                name: '灰分',
                data: dataHF,
                type: 'line',
                smooth: true,
                showSymbol: true,
                color: '#00C2FF',
                yAxisIndex: 0,
              },
              {
                name: '热值',
                data: dataRZ,
                type: 'line',
                smooth: true,
                showSymbol: true,
                color: '#FFAA5D',
                yAxisIndex: 1,
              }
            ]
          };
          option && chart.setOption(option);
        })
      },
      getChartData1(chart) {
        let that = this
        let params = ['A010014','A010015','C010007']
        this.$http.post(`/iailab-ntt-data/api/data/ind-item/values`, params).then(({data: res}) => {
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          let xAxis = []
          let dataA010014 = []
          let dataA010015 = []
          let dataC010007 = []
          if (!res.data['A010014']) {
            return;
          }
          res.data['A010014'].forEach((item) =>{
            xAxis.push(item.dataTime)
            if (item.dataValue && item.dataValue >= 0) {
              dataA010014.push([item.dataTime, item.dataValue])
            }
          })
          res.data['A010015'].forEach((item) =>{
            if (item.dataValue && item.dataValue >= 0) {
              dataA010015.push([item.dataTime, item.dataValue])
            }
          })
          res.data['C010007'].forEach((item) =>{
            if (item.dataValue && item.dataValue >= 0) {
              dataC010007.push([item.dataTime, item.dataValue])
            }
          })
          let option = {
            tooltip: {
              trigger: 'axis',
              axisPointer: {type: 'shadow'}
            },
            grid: {
              top: '10%',
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            legend: {
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [2, 0, 0, 2],
                fontWeight: 100,
              },
            },
            xAxis: [//x轴
              {
                type: 'category',//坐标轴类型 离散
                data: xAxis,
                axisTick: false,//是否显示刻度
                axisLine: {//坐标轴样式
                  show: true,//是否显示
                  lineStyle: {//线的样式
                    type: 'dashed'//线的类型 虚线
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            yAxis: [
              {
                type: 'value',
                position: 'left',
                offset: 0,
                name: '吨',
                nameTextStyle: {
                  color: '#FFFFFF',
                  fontSize: 10,
                  verticalAlign: 'bottom'
                },
                splitLine: {
                  show: false
                },
                axisLine: {
                  show: true,
                  onZero: false
                },
                axisTick: {show: true},
                axisLabel: {
                  color: '#FFFFFF',
                  formatter: '{value}'
                }
              },
              {
                type: 'value',
                position: 'right',
                offset: 0,
                name: '产率',
                nameTextStyle: {
                  color: '#FFFFFF',
                  fontSize: 10,
                  verticalAlign: 'bottom'
                },
                splitLine: {
                  show: false
                },
                axisLine: {
                  show: true,
                  onZero: false
                },
                axisTick: {show: true},
                axisLabel: {
                  color: '#FFFFFF',
                  formatter: '{value}'
                }
              }
            ],
            series: [
              {
                name: '计划',
                type: 'bar',
                barWidth: 10,
                data: dataA010014,
                yAxisIndex: 0,
                z: 2,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(6, 244, 231)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(6, 244, 231,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '实绩',
                type: 'bar',
                barWidth: 10,
                data: dataA010015,
                yAxisIndex: 0,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(3, 181, 243)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(2, 190, 251,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '达成率',
                data: dataC010007,
                yAxisIndex: 1,
                type: 'line',
                smooth: true,
                showSymbol: true,
                color: '#00C2FF'
              },
            ],
          };
          option && chart.setOption(option);
        })
      },
      getChartData2(chart) {
        let that = this
        let params = ['A010016','A010017','C010008']
        this.$http.post(`/iailab-ntt-data/api/data/ind-item/values`, params).then(({data: res}) => {
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          let xAxis = []
          let dataJh = []
          let dataWc = []
          let dataDcl = []
          if (!res.data['A010016']) {
            return;
          }
          res.data['A010016'].forEach((item) =>{
            xAxis.push(item.dataTime)
            if (item.dataValue && item.dataValue >= 0) {
              dataJh.push([item.dataTime, item.dataValue])
            }
          })
          res.data['A010017'].forEach((item) =>{
            if (item.dataValue && item.dataValue >= 0) {
              dataWc.push([item.dataTime, item.dataValue])
            }
          })
          res.data['C010008'].forEach((item) =>{
            if (item.dataValue && item.dataValue >= 0) {
              dataDcl.push([item.dataTime, item.dataValue])
            }
          })
          let option = {
            tooltip: {
              trigger: 'axis',
              axisPointer: {type: 'shadow'}
            },
            grid: {
              top: '10%',
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            legend: {
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [2, 0, 0, 2],
                fontWeight: 100,
              },
            },
            xAxis: [//x轴
              {
                type: 'category',//坐标轴类型 离散
                data: xAxis,
                axisTick: false,//是否显示刻度
                axisLine: {//坐标轴样式
                  show: true,//是否显示
                  lineStyle: {//线的样式
                    type: 'dashed'//线的类型 虚线
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            yAxis: [
              {
                type: 'value',
                position: 'left',
                offset: 0,
                name: '吨',
                nameTextStyle: {
                  color: '#FFFFFF',
                  fontSize: 10,
                  verticalAlign: 'bottom'
                },
                splitLine: {
                  show: false
                },
                axisLine: {
                  show: true,
                  onZero: false
                },
                axisTick: {show: true},
                axisLabel: {
                  color: '#FFFFFF',
                  formatter: '{value}'
                }
              },
              {
                type: 'value',
                position: 'right',
                offset: 0,
                name: '产率',
                nameTextStyle: {
                  color: '#FFFFFF',
                  fontSize: 10,
                  verticalAlign: 'bottom'
                },
                splitLine: {
                  show: false
                },
                axisLine: {
                  show: true,
                  onZero: false
                },
                axisTick: {show: true},
                axisLabel: {
                  color: '#FFFFFF',
                  formatter: '{value}'
                }
              }
            ],
            series: [
              {
                name: '计划',
                type: 'bar',
                barWidth: 10,
                data: dataJh,
                yAxisIndex: 0,
                z: 2,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(6, 244, 231)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(6, 244, 231,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '实绩',
                type: 'bar',
                barWidth: 10,
                data: dataWc,
                yAxisIndex: 0,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(3, 181, 243)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(2, 190, 251,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '达成率',
                data: dataDcl,
                yAxisIndex: 1,
                type: 'line',
                smooth: true,
                showSymbol: true,
                color: '#00C2FF'
              },
            ],
          };
          option && chart.setOption(option);
        })
      },
      getChartData3(chart) {
        let that = this
        let params = ['A010021','A010022','C010009']
        this.$http.post(`/iailab-ntt-data/api/data/ind-item/values`, params).then(({data: res}) => {
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          let xAxis = []
          let dataJh = []
          let dataWc = []
          let dataDcl = []
          if (!res.data['A010021']) {
            return;
          }
          res.data['A010021'].forEach((item) =>{
            xAxis.push(item.dataTime)
            if (item.dataValue && item.dataValue >= 0) {
              dataJh.push([item.dataTime, item.dataValue])
            }
          })
          res.data['A010022'].forEach((item) =>{
            if (item.dataValue && item.dataValue >= 0) {
              dataWc.push([item.dataTime, item.dataValue])
            }
          })
          res.data['C010009'].forEach((item) =>{
            if (item.dataValue && item.dataValue >= 0) {
              dataDcl.push([item.dataTime, item.dataValue])
            }
          })
          let option = {
            tooltip: {
              trigger: 'axis',
              axisPointer: {type: 'shadow'}
            },
            grid: {
              top: '10%',
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            legend: {
              right: '70',
              textStyle: {
                // 图例文字的样式
                color: '#fff',
                fontSize: 14,
                padding: [2, 0, 0, 2],
                fontWeight: 100,
              },
            },
            xAxis: [//x轴
              {
                type: 'category',//坐标轴类型 离散
                data: xAxis,
                axisTick: false,//是否显示刻度
                axisLine: {//坐标轴样式
                  show: true,//是否显示
                  lineStyle: {//线的样式
                    type: 'dashed'//线的类型 虚线
                  },
                },
                axisLabel: {
                  color: "#DEDEDE"
                }
              },
            ],
            yAxis: [
              {
                type: 'value',
                position: 'left',
                offset: 0,
                name: '吨',
                nameTextStyle: {
                  color: '#FFFFFF',
                  fontSize: 10,
                  verticalAlign: 'bottom'
                },
                splitLine: {
                  show: false
                },
                axisLine: {
                  show: true,
                  onZero: false
                },
                axisTick: {show: true},
                axisLabel: {
                  color: '#FFFFFF',
                  formatter: '{value}'
                }
              },
              {
                type: 'value',
                position: 'right',
                offset: 0,
                name: '产率',
                nameTextStyle: {
                  color: '#FFFFFF',
                  fontSize: 10,
                  verticalAlign: 'bottom'
                },
                splitLine: {
                  show: false
                },
                axisLine: {
                  show: true,
                  onZero: false
                },
                axisTick: {show: true},
                axisLabel: {
                  color: '#FFFFFF',
                  formatter: '{value}'
                }
              }
            ],
            series: [
              {
                name: '计划',
                type: 'bar',
                barWidth: 10,
                data: dataJh,
                yAxisIndex: 0,
                z: 2,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(6, 244, 231)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(6, 244, 231,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '实绩',
                type: 'bar',
                barWidth: 10,
                data: dataWc,
                yAxisIndex: 0,
                z: 1,
                itemStyle: {
                  color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    type: 'linear',
                    global: false,
                    colorStops: [
                      {
                        offset: 0,
                        color: 'rgba(3, 181, 243)',
                      },
                      {
                        offset: 1,
                        color: 'rgba(2, 190, 251,0)',
                      },
                    ],
                  },
                },
              },
              {
                name: '达成率',
                data: dataDcl,
                yAxisIndex: 1,
                type: 'line',
                smooth: true,
                showSymbol: true,
                color: '#00C2FF'
              },
            ],
          };
          option && chart.setOption(option);
        })
      },
    }
  }
</script>
<style scoped>
  .chart-title {
    padding: 10px 10px 0 10px;
    font-weight: bold;
    font-size: 18px;
    color: #8FD6FE;
    line-height: 16px;
    text-align: left;
  }
  .middle-fcfx-button > .el-button {
    border-radius: 4px 4px 4px 4px;
    border: 2px solid #86DBFF;
  }
  .middle-fcfx-button > .el-button--text {
    font-size: 14px;
  }
  .middle-fcfx-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5px 20px 5px 5px;
    margin-left: -120px;
  }
  #data-overview-body {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
  }
  #data-left {
    width: 26%;
    height: 100%;
    padding: 10px 10px 10px 30px;
    display: flex;
    flex-direction: column;
    margin-top: -20px;
  }
  .data-left-1 {
    width: 100%;
    height: 8%;
    padding-left: 10px;
  }
  .data-left-2 {
    width: 100%;
    height: 30%;
    display: flex;
    flex-direction: column;
    padding-left: 10px;
  }
  .data-left-3 {
    width: 100%;
    height: 30%;
    margin-top: 10px;
  }
  .data-left-4 {
    width: 100%;
    height: 30%;
    margin-top: 20px;
  }
  .data-left-1 img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  .data-left-sub-2 {
    width: 100%;
    height: 33%;
    display: flex;
    flex-direction: row;
    padding-top: 5px;
  }
  .data-left-content-1 {
    width: 25%;
    height: 100%;
    color: #80D8FE;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
  }
  #data-middle {
    width: 48%;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .data-middle-1 {
    width: 100%;
    height: 8%;
    display: flex;
    flex-direction: row;
  }
  .data-middle-2 {
    width: 100%;
    height: 28%;
    display: flex;
    flex-direction: row;
  }
  .data-middle-3 {
    width: 100%;
    height: 28%;
    display: flex;
    flex-direction: row;
  }
  .data-middle-4 {
    width: 100%;
    height: 7%;
    margin-top: 20px;
  }
  .data-middle-5 {
    width: 100%;
    height: 28%;
    display: flex;
    flex-direction: row;
  }
  .data-middle-sub-2 {
    width: 50%;
    height: 100%;
  }
  .data-middle-sub-3-1 {
    width: 50%;
    height: 100%;
  }
  .data-middle-sub-3-2 {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .data-middle-sub-5 {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: row;
  }
  .data-middle-1 img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  .data-middle-sub-5-1 {
    width: 35%;
    height: 100%;
    margin-left: -25px;
  }
  .data-middle-sub-5-2 {
    width: 65%;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .data-middle-sub-5-2-1 {
    display: flex;
    flex-direction: row;
    padding-left: 18px;
  }
  .data-middle-sub-5-2-3 {
  }
  .data-middle-sub-5-2-3 {
    margin-top: -8px;
    padding-left: 54px;
  }
  #data-right {
    width: 26%;
    height: 100%;
    padding: 10px 30px 10px 10px;
    display: flex;
    flex-direction: column;
  }
  .data-right-1 {
    width: 100%;
    height: 8%;
    padding-left: 10px;
  }
  .data-right-2 {
    width: 100%;
    height: 30%;
  }
  .data-right-3 {
    width: 100%;
    height: 30%;
    margin-top: 10px;
  }
  .data-right-4 {
    width: 100%;
    height: 30%;
    margin-top: 20px;
  }
  .data-right-1 img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  .data-right-sub-2 {
    width: 100%;
    height: 33%;
    display: flex;
    flex-direction: row;
  }
  .data-right-content-1 {
    width: 25%;
    height: 100%;
    color: #80D8FE;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
  }
  .chart-line {
    margin-top: -10px;
    width: 100%;
    height: 100%;
  }
  .chart-ring-line {
    width: 100%;
    height: 100%;
  }
</style>
src/views/modules/analysis/img/bg.png
src/views/modules/analysis/img/产品煤趋势分析.png
src/views/modules/analysis/img/仓储可靠性分析.png
src/views/modules/analysis/img/指标评价体系.png
src/views/modules/analysis/img/煤质趋势分析.png
src/views/modules/analysis/img/煤质趋势分析_可选性曲线.png
src/views/modules/analysis/img/生产指标评价.png
src/views/modules/analysis/img/生产综合分析.png
src/views/modules/analysis/index-evaluate-system-add-or-update.vue
对比新文件
@@ -0,0 +1,107 @@
<template>
  <el-dialog
      :title="!dataForm.id ? `新增` : '编辑'"
      :close-on-click-modal="false"
      :visible.sync="visible">
        <el-form label-position="left" :rules="dataRule" @keyup.enter.native="dataFormSubmit()" ref="dataForm" label-width="80px" :model="dataForm">
        <el-row>
          <el-col :span="12">
            <el-form-item label="指标编码">
            <el-input v-model="dataForm.code"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="指标名称">
            <el-input v-model="dataForm.evaluateIndex"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false" :loading="uploadLoading">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()" :loading="uploadLoading">确定</el-button>
    </span>
  </el-dialog>
</template>
<script>
  import DictSelectTag from "@/components/dict/dict-select-tag";
  export default {
    components: {
      DictSelectTag
    },
    data () {
      return {
        visible: false,
        dataForm: {
          id:"",
          pid:"",
          code: "",
          evaluateIndex: "",
          weight:"0"
        },
        uploadLoading: false,
        dataRule: {
          code: [
            { required: true, message: "设备名称不能为空", trigger: "blur" },
          ],
          evaluateIndex: [
            { required: true, message: "IP地址不能为空", trigger: "blur" },
          ]
        }
      }
    },
  methods: {
    init(pid,id) {
      console.log(pid,id)
      this.visible = true;
      this.$nextTick(() => {
        this.dataForm=[];
        this.dataForm.pid = pid
        if (id) {
        this.dataForm.id = id
          this.$http.get(`/iailab-ntt-model/index/evaluate/${this.dataForm.id}`).then(({ data }) => {
            if (data && data.code === 0) {
              this.dataForm=data.data;
            }
          });
        }
      });
    },
    // 表单提交
    dataFormSubmit() {
        this.$refs["dataForm"].validate((valid) => {
        if (valid) {
        this.uploadLoading = true;
          this.$http[!this.dataForm.id ? "post" : "put"](
              "/iailab-ntt-model/index/evaluate",
              {
                ...this.dataForm,
              }
            ).then(({data: res}) => {
                if (res.code !== 0) {
                  return this.$message.error(res.msg);
                }
                this.$message({
                  message: this.$t("prompt.success"),
                  type: "success",
                  duration: 500,
                  onClose: () => {
                    this.visible = false;
                    this.$emit("refreshDataList");
                  },
                });
                this.uploadLoading = false
              })
              .catch(() => {
              });
        }
      });
    },
    beforeCloseHandle(done) {
      this.dataList = [];
      done();
    },
  },
};
</script>
src/views/modules/analysis/index-evaluate-system-bak.vue
对比新文件
@@ -0,0 +1,617 @@
<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-knowledge" style="height: 100%" v-loading="dataListLoading">
      <el-dialog
          :title="`${!isUpdate ? '新建' : '编辑'}`"
          :visible.sync="dialogVisible"
          width="30%"
          :close-on-click-modal="false">
        <el-form :model="form" :rules="dataRule" ref="form">
          <el-form-item label="名称" prop="labelName" :rules="dataRule.labelName">
            <el-input v-model="form.labelName" placeholder="输入体系名称"></el-input>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
        <el-button size="mini" type="primary" @click="dataFormSubmit">确 定</el-button>
      </span>
      </el-dialog>
      <el-row style="height: 750px" @contextmenu.native="handleMouse">
        <el-col :span="6" style="height: 100%; border: 1px solid lightgray;padding: 10px">
          <el-row>
            <el-col :span="6">
              <el-button size="mini" type="primary" style="margin-left: 5px;" @click="addNode(true)">新增</el-button>
            </el-col>
            <el-col :span="6">
              <el-button size="mini" type="primary" style="margin-left: 5px;" @click="updateNode">修改</el-button>
            </el-col>
            <el-col :span="6">
              <el-button size="mini" type="danger" style="margin-left: 5px;" @click="deleteNode">删除</el-button>
            </el-col>
          </el-row>
          <el-tree
              :data="data"
              ref="tree"
              node-key="id"
              height="600px"
              current-node-key
              default-expand-all
              :expand-on-click-node="false"
              @node-click="handleNodeClick"
              @node-contextmenu="rightClick"
              :filter-node-method="filterNode"
              :highlight-current="true"
              style="user-select: none">
          <span slot-scope="{ node, data }">
            <i v-if="node.expanded && data.children.length > 0" class="el-icon-folder-opened"></i>
            <i v-else class="el-icon-folder"></i>
            <span>{{ node.label }}</span>
          </span>
          </el-tree>
           <bar-line :option="chartOption"></bar-line>
        </el-col>
        <el-col :span="18" style="height: 100%">
          <el-col :span="24" style="height: 100%; border: 1px solid lightgray; margin-left: 5px">
            <el-row style="padding: 10px">
              <el-col :span="24">
                <el-form :inline="true" :model="fileForm" ref="fileForm">
                  <el-form-item prop="title">
                    <el-input v-model="fileForm.title" placeholder="指标名称" clearable></el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button @click="getTableList(chooseTreeId)">查询</el-button>
                    <el-button type="primary" @click="deleteHandle()">新增</el-button>
                    <el-button type="primary" @click="deleteHandle()">编辑权重</el-button>
                    <el-button type="danger" @click="deleteHandle()">批量删除</el-button>
                  </el-form-item>
                </el-form>
              </el-col>
              <el-col>
                <el-table
                    :data="tableList"
                    v-loading="tableLoading"
                    border
                    @selection-change="selectionChangeHandle">
                  <el-table-column
                      type="selection"
                      header-align="center"
                      align="center"
                      width="50">
                  </el-table-column>
                  <el-table-column
                      type="index"
                      header-align="center"
                      align="center"
                      width="50"
                      label="序号">
                  </el-table-column>
                  <el-table-column
                      prop="title"
                      header-align="center"
                      align="left"
                      min-width="150"
                      label="标题">
                  </el-table-column>
                  <el-table-column
                      prop="keyWords"
                      header-align="center"
                      align="center"
                      label="关键词">
                  </el-table-column>
                  <el-table-column
                      prop="typeId"
                      header-align="center"
                      align="center"
                      width="100"
                      label="类型">
                    <template slot-scope="scope">
                      {{ $getDictLabel("knowledge-type", scope.row.typeId) }}
                    </template>
                  </el-table-column>
                  <el-table-column
                      prop="content"
                      header-align="center"
                      align="left"
                      min-width="100"
                      label="摘要">
                  </el-table-column>
                  <el-table-column
                      header-align="center"
                      align="center"
                      width="120"
                      label="操作">
                    <template slot-scope="scope">
                      <el-button type="text" size="small" @click="filePreview(scope.row)">预览</el-button>
                      <span>|</span>
                      <el-dropdown>
                      <span class="el-dropdown-link">
                        <el-button type="text" size="small">更多</el-button>
                        <i class="el-icon-arrow-down el-icon--right"></i>
                      </span>
                        <el-dropdown-menu slot="dropdown">
                          <el-dropdown-item v-if="$hasPermission('knowledge:det:update')">
                            <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">编辑
                            </el-button>
                          </el-dropdown-item>
                          <el-dropdown-item>
                            <el-button type="text" size="small" v-if="scope.row.url" @click="download(scope.row.url)">下载
                            </el-button>
                          </el-dropdown-item>
                        </el-dropdown-menu>
                      </el-dropdown>
                    </template>
                  </el-table-column>
                </el-table>
                <el-pagination
                    @size-change="sizeChangeHandle"
                    @current-change="currentChangeHandle"
                    :current-page="pageIndex"
                    :page-sizes="[10, 20, 50, 100]"
                    :page-size="pageSize"
                    :total="totalPage"
                    layout="total, sizes, prev, pager, next, jumper">
                </el-pagination>
              </el-col>
            </el-row>
          </el-col>
        </el-col>
      </el-row>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate"
                     @refreshDataList="getTableList('')"></add-or-update>
    </div>
  </el-card>
</template>
<script>
  import AddOrUpdate from '../knowledge/document-add-or-update.vue'
  import {Base64} from 'js-base64'
  import {getHost, getFilePreviewUrl, reWriteUrl} from '@/utils/hostUtil'
  import BarLine from "@/components/chart/bar-line.vue";
  export default {
    data() {
      return {
        chartOption: {},
        filterText: '',
        data: [],
        treeClickCount: 0,
        showRightMenu: false,
        formData: {},
        targetElement: {},
        dialogVisible: false,
        addOrUpdateVisible: false,
        form: {
          labelName: ''
        },
        fileForm: {
          keyWords: '',
          title: '',
          content: '',
          treeId: ''
        },
        dataListLoading: false,
        isRoot: false,
        isLastNode: false,
        isUpdate: false,
        tableList: [],
        pageIndex: 1,
        pageSize: 10,
        totalPage: 0,
        chooseTreeId: '',
        dataListSelections: [],
        onlinePreviewUrl: '',
        host: '',
        tableLoading: false,
        dataRule: {
          labelName: [
            {required: true, message: '不能为空', trigger: 'blur'}
          ]
        }
      }
    },
    components: {
      BarLine,
      AddOrUpdate
    },
    activated() {
      // this.getDataList()
      this.setHost()
    },
    mounted() {
      // this.getDataList()
      this.setHost()
      this.getchartOption();
    },
    methods: {
      // 获取数据列表
      getDataList() {
        this.dataListLoading = true
        this.$http.get(`/knowledge/path/tree`).then(({data: res}) => {
          this.dataListLoading = false
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.data = res.data
          this.getTableList(this.chooseTreeId ? this.chooseTreeId : '')
        }).catch(() => {
        })
      },
      getchartOption(){
this.chartOption={
  tooltip: {
    trigger: 'item'
  },
  legend: {
    top: '5%',
    left: 'center'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: ['40%', '70%'],
      avoidLabelOverlap: false,
      itemStyle: {
        borderRadius: 10,
        borderColor: '#fff',
        borderWidth: 2
      },
      label: {
        show: false,
        position: 'center'
      },
      emphasis: {
        label: {
          show: true,
          fontSize: 20,
          fontWeight: 'bold'
        }
      },
      labelLine: {
        show: false
      },
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ]
    }
  ]
};
      },
      getTableList(treeId) {
        this.chooseTreeId = treeId
        this.tableLoading = true
        this.$http.get(`/knowledge/det/page`,
          {
            params: {
              'page': this.pageIndex,
              'limit': this.pageSize,
              'title': this.fileForm.title,
              'keyWords': this.fileForm.keyWords,
              'content': this.fileForm.content,
              'treeId': treeId
            }
          }
        ).then(({data: res}) => {
          this.tableLoading = false
          if (res && res.code === 0) {
            this.tableList = res.data.list
            this.totalPage = res.data.total
          } else {
            this.tableList = []
            this.totalPage = 0
          }
        }).catch(() => {
        })
      },
      // 树形图单击和双击事件
      handleNodeClick(data, node) {
        this.treeClickCount++
        window.setTimeout(() => {
          if (this.treeClickCount === 1) {
            this.treeClickCount = 0
            this.getTableList(data.id)
          } else if (this.treeClickCount > 1) {
            this.treeClickCount = 0
            this.getTableList(data.id)
            if (data.children.length > 0) {
              node.expanded = !node.expanded
            } else {
              node.expanded = false
            }
          }
        }, 300)
      },
      // 右键显示菜单
      rightClick(event, data, node) {
        if (data.id.indexOf('00') === -1) {
          this.isLastNode = true
        }
        this.showRightMenu = false
        this.showRightMenu = true
        this.formData = data
        this.targetElement = node
        let menu = document.querySelector('#menu')
        menu.style.left = `${event.clientX + 10}px`
        menu.style.top = `${event.clientY}px`
        document.addEventListener('click', this.closeRightMenu)
      },
      // 关闭右键菜单
      closeRightMenu() {
        this.showRightMenu = false
        document.removeEventListener('click', this.closeRightMenu)
      },
      // 新增节点
      addNode(isRoot) {
        this.isRoot = isRoot
        this.isUpdate = false
        this.dialogVisible = true
        this.$nextTick(() => {
          this.$refs['form'].resetFields()
        })
      },
      // 更改节点名称
      updateNode() {
        this.isUpdate = true
        this.dialogVisible = true
        this.form.labelName = this.formData.label
      },
      // 删除节点
      deleteNode() {
        this.$confirm(`确定对该节点进行删除操作?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$http.delete(`/knowledge/path/${this.formData.id}`, this.dataForm).then(({data: res}) => {
            if (res.code !== 0) {
              return this.$message.error(res.msg)
            }
            this.$message({
              message: this.$t('prompt.success'),
              type: 'success',
              duration: 500,
              onClose: () => {
                this.visible = false
                this.getDataList()
              }
            })
          }).catch(() => {
          })
        }).catch(() => {
        })
      },
      // 新增或更改节点,表单提交
      dataFormSubmit() {
        this.$refs['form'].validate((valid) => {
          if (!valid) {
            return false
          }
          let id
          let postData
          this.dialogVisible = false
          // 是否是更新节点
          if (!this.isUpdate) {
            // 是否新增的是根节点
            if (this.isRoot) {
              id = this.appendRoot()
            } else {
              id = this.append(this.formData)
            }
            postData = {id: id, label: this.form.labelName, parentId: this.isRoot ? '0000000000' : this.formData.id}
          } else {
            postData = {id: this.formData.id, label: this.form.labelName, parentId: this.formData.parentId}
          }
          this.$http[!this.isUpdate ? 'post' : 'put']('/knowledge/path', postData).then(({data: res}) => {
            if (res.code !== 0) {
              return this.$message.error(res.msg)
            }
            this.$message({
              message: this.$t('prompt.success'),
              type: 'success',
              duration: 500,
              onClose: () => {
                this.visible = false
                this.getDataList()
              }
            })
          }).catch(() => {
          })
        })
      },
      // 新增根节点
      appendRoot() {
        let id
        if (this.data.length > 0) {
          let temp = (this.data[this.data.length - 1].id.substring(0, 2) * 1 + 1) + '00000000'
          while (temp.length < 10) {
            temp = '0' + temp
          }
          id = temp
        } else {
          id = '0100000000'
        }
        this.data.push({
          id: id,
          label: this.form.labelName,
          children: []
        })
        return id
      },
      // 新增节点
      append(data) {
        let id = this.treeIdAdd(data)
        const newChild = {id: id, label: this.form.labelName, children: []}
        if (!data.children) {
          this.$set(data, 'children', [])
        }
        data.children.push(newChild)
        if (!this.targetElement.expanded) {
          this.targetElement.expanded = true
        }
        return id
      },
      // 获取新增后的id
      treeIdAdd(data) {
        let index = data.id.indexOf('00')
        let frontPart = data.id.substring(0, index)
        let backPart = ''
        if (index !== -1) {
          if (data.children.length > 0) {
            // 最大子节点id加1
            let tempStr = '1'
            for (let i = 0; i < (10 - index - 2); i++) {
              tempStr = tempStr + '0'
            }
            backPart = (data.children[data.children.length - 1].id * 1 - data.id * 1 + tempStr * 1).toString()
            while (backPart.length < 10 - index) {
              backPart = '0' + backPart
            }
          } else {
            // 在父节点id的基础上加一级
            let tempStr = '01'
            for (let i = 0; i < (10 - index - 2); i++) {
              tempStr = tempStr + '0'
            }
            backPart = tempStr
          }
          return frontPart + backPart
        }
      },
      // 新增 / 修改
      addOrUpdateHandle(knowledgeId) {
        this.addOrUpdateVisible = true
        this.$nextTick(() => {
          this.$refs.addOrUpdate.init(knowledgeId, this.chooseTreeId, this.data)
        })
      },
      // 文件预览
      filePreview(dataInfo) {
        if (dataInfo.website) {
          window.open(dataInfo.website)
        } else {
          window.open(this.onlinePreviewUrl + encodeURIComponent(Base64.encode(reWriteUrl(dataInfo.url))),
            '_blank', 'width=1500,height=850,toolbar=no,scrollbars=no,menubar=no,screenX=240,screenY=100')
        }
      },
      // 每页数
      sizeChangeHandle(val) {
        this.pageSize = val
        this.pageIndex = 1
        this.getDataList()
      },
      // 当前页
      currentChangeHandle(val) {
        this.pageIndex = val
        this.getDataList()
      },
      onSuccess() {
        this.$message({
          message: '复制成功',
          type: 'success',
          duration: 1500
        })
      },
      // 下载
      download(url) {
        window.open(reWriteUrl(url))
      },
      // 多选
      selectionChangeHandle(val) {
        this.dataListSelections = val
      },
      // 删除
      deleteHandle(knowledgeId) {
        const knowledgeIds = knowledgeId ? [knowledgeId] : this.dataListSelections.map(item => {
          return item.id
        })
        this.$confirm(`确定对所选项目进行[${knowledgeId ? '删除' : '批量删除'}]操作?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$http.delete('iailab-ntt-model/knowledge/det', {
            data: knowledgeIds
          }).then(({data}) => {
            if (data && data.code === 0) {
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                  if (knowledgeIds.length === this.tableList.length) {
                    this.pageIndex = 1
                  }
                  this.getDataList()
                }
              })
            } else {
              this.$message.error(data.msg)
            }
          })
        }).catch(() => {
        })
      },
      // 处理鼠标事件
      handleMouse(e) {
        e.preventDefault()
        return false
      },
      // 过滤节点
      filterNode(value, data) {
        if (!value) return true
        return data.label.indexOf(value) !== -1
      },
      setHost() {
        this.host = getHost()
        this.onlinePreviewUrl = getFilePreviewUrl()
      }
    },
    watch: {
      filterText(val) {
        this.$refs.tree.filter(val)
      }
    }
  }
</script>
<style>
  .dev-type-main-left {
    overflow: auto;
    padding: 10px;
  }
  .right-menu {
    z-index: 999;
    position: fixed;
    height: auto;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: white;
    padding: 15px;
  }
  .menu-item {
    list-style-type: none;
    line-height: 30px;
    font-size: 15px;
    color: #606266
  }
  li:hover {
    background-color: #edf6ff;
    color: #606266;
  }
  .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
    background-color: rgba(135, 206, 235, 0.2);
    color: #409eff;
    font-weight: bold;
  }
</style>
src/views/modules/analysis/index-evaluate-system.vue
对比新文件
@@ -0,0 +1,333 @@
<template>
  <div class="mod-prod-eval-system">
    <div class="eval-system-left">
      <el-card class="box-card">
        <div style="height: 500px;">
          <div style="text-align: center; background: #F2F3F5;margin-top: 10px;">
            <el-button type="text" v-if="$hasPermission('analysis:evaluate:update')" icon="el-icon-edit" @click="updateSystemWeight()">修改权重</el-button>
          </div>
          <div ref="chartPie1" style="width: 100%; height: 400px;"></div>
        </div>
      </el-card>
    </div>
    <div class="eval-system-mid">
      <el-card class="box-card">
  <el-tabs :tab-position="systemWeight" style="height: 50px;" @tab-click="handleClick">
    <el-tab-pane label="数量"></el-tab-pane>
    <el-tab-pane label="质量"></el-tab-pane>
    <el-tab-pane label="生产消耗"></el-tab-pane>
    <el-tab-pane label="过程控制"></el-tab-pane>
    <el-tab-pane label="管理"></el-tab-pane>
  </el-tabs>
        <div>
          <el-form :inline="true" :model="dataForm">
            <el-form-item>
              <el-input v-model="dataForm.name" placeholder="指标名称" clearable></el-input>
            </el-form-item>
            <el-form-item>
              <el-button @click="getDataList()">{{ $t('query') }}</el-button>
            </el-form-item>
            <el-form-item>
              <el-button type="primary"  v-if="$hasPermission('analysis:evaluate:update')" @click="addOrUpdateHandle(dataForm.pid)">{{ $t('add') }}
              </el-button>
            </el-form-item>
            <el-form-item>
              <el-button type="danger"  v-if="$hasPermission('analysis:evaluate:update')" @click="deleteHandle()">{{ $t('deleteBatch')}}
              </el-button>
            </el-form-item>
            <el-form-item>
              <el-button v-if="!updateWeightView && $hasPermission('analysis:evaluate:update')" @click="updateWeight()">修改权重
              </el-button>
            </el-form-item>
            <el-form-item>
              <el-button v-if="updateWeightView && $hasPermission('analysis:evaluate:update')" @click="commitUpdateWeight()">确认修改
              </el-button>
            </el-form-item>
          </el-form>
          <el-table
              v-loading="dataListLoading"
              :data="dataList"
              border
              @selection-change="dataListSelectionChangeHandle"
              @sort-change="dataListSortChangeHandle"
              height="350px"
              style="width: 100%;">
            <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
            <el-table-column prop="code" :label="$t('evaluateIndex.code')" header-align="center"
                             align="center"></el-table-column>
            <el-table-column prop="evaluateIndex" :label="$t('evaluateIndex.name')" header-align="center"
                             align="center"></el-table-column>
            <el-table-column prop="weight" :label="$t('evaluateIndex.weight')" header-align="center"
                             align="center">
              <template slot-scope="scope">
                <el-input-number size="mini" v-model="scope.row.weight" :disabled="!updateWeightView"></el-input-number>&nbsp;&nbsp;&nbsp;%
                <el-slider size="mini" v-model="scope.row.weight" :disabled="!updateWeightView" style="margin-top: -5px; margin-bottom: -5px;"></el-slider>
              </template>
            </el-table-column>
            <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="160">
              <template slot-scope="scope">
                <el-button type="text" size="small" v-if="$hasPermission('analysis:evaluate:update')"
                           @click="addOrUpdateHandle(dataForm.pid,scope.row.id)">{{ $t('update') }}
                </el-button>
                <el-button type="text" size="small" v-if="$hasPermission('analysis:evaluate:update')"
                           @click="deleteHandle(scope.row.id)">{{ $t('delete') }}
                </el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-pagination
              :current-page="page"
              :page-sizes="[10, 20, 50, 100]"
              :page-size="limit"
              :total="total"
              layout="total, sizes, prev, pager, next, jumper"
              @size-change="pageSizeChangeHandle"
              @current-change="pageCurrentChangeHandle">
          </el-pagination>
          <div ref="chartPie2" style="width: 100%; height: 300px;"></div>
        </div>
      </el-card>
      <!-- 弹窗, 编辑评价指标体系权重 -->
      <update-system-weight v-if="updateSystemWeightVisible" ref="updateSystemWeight"></update-system-weight>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>
  </div>
</template>
<script>
  import mixinViewModule from '@/mixins/view-module'
  import updateSystemWeight from "./update-system-weight";
  import AddOrUpdate from './index-evaluate-system-add-or-update'
  export default {
    mixins: [mixinViewModule],
    data() {
      return {
        mixinViewModuleOptions: {
          getDataListURL: '/iailab-ntt-model/index/evaluate/page',
          getDataListIsPage: true,
          deleteURL: '/iailab-ntt-model/index/evaluate',
          deleteIsBatch: true
        },
        updateSystemWeightVisible: false,
        updateWeightView: false,
        systemWeight:'',
        dataForm: {
          pid:"1"
        },
        chartData:[],
        charLegend:[],
        systemChartData:[],
        systemCharLegend:[],
        dataList: [],
        chartPie1:{},
        chartPie2:{},
      }
    },
    components:{
        updateSystemWeight,
        AddOrUpdate
    },
    mounted() {
      this.getPie1()
      this.getPie2()
    },
    methods: {
    // 新增 / 修改
    addOrUpdateHandle(pid,id) {
      this.addOrUpdateVisible = true;
      this.$nextTick(() => {
        this.$refs.addOrUpdate.init(pid,id);
      });
    },
      updateSystemWeight(){
          this.updateSystemWeightVisible = true;
          this.$nextTick(() => {
          this.$refs.updateSystemWeight.init();
        });
      },
      updateWeight(){
          this.updateWeightView = true;
      },
      commitUpdateWeight(){
        var sum=0
        for (var i = 0; i < this.dataList.length; i++) {
            sum += this.dataList[i].weight;
            console.log(sum)
          }
        if(sum==100){
          this.$http.post('/iailab-ntt-model/index/evaluate/updataWeight', this.dataList).then(({ data: res }) => {
            if (res.code==null || res.code !== 0) {
                return this.$message.error(res.msg)
              }
              this.$message({
                message: this.$t('prompt.success'),
                type: 'success',
                duration: 500,
              })
              this.updateWeightView = false;
              this.getDataList();
          }).catch(() => {})
        }else{
          this.$alert('各权重之和必须为100%', {
            confirmButtonText: '确定',
          });
          }
      },
      handleClick(tab, event){
        if(tab.label=="数量"){
          this.dataForm.pid=1
          this.getPie2();
          this.getDataList()
        }else if(tab.label=="质量"){
          this.dataForm.pid=2
          this.getPie2();
          this.getDataList()
      }else if(tab.label=="生产消耗"){
          this.dataForm.pid=3
          this.getPie2();
          this.getDataList()
      }else if(tab.label=="过程控制"){
          this.dataForm.pid=4
          this.getPie2();
          this.getDataList()
      }else if(tab.label=="管理"){
          this.dataForm.pid=5
          this.getPie2();
          this.getDataList()
      }
      },
      getPie1() {
        this.$http.get(`/iailab-ntt-model/index/evaluate/chart/0`).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.systemChartData=res.data.series[0].data[0]
          this.systemCharLegend=res.data.legend
        this.chartPie1 = this.$echarts.init(this.$refs.chartPie1);
        let option = {
          tooltip: {
            trigger: 'item'
          },
          legend: {
            bottom: 0,
            left: 'left',
            orient: 'vertical',
            data: this.systemCharLegend
          },
          series: [
            {
              name: '指标体系权重',
              type: 'pie',
              radius: ['40%', '70%'],
              avoidLabelOverlap: false,
              label: {
                show: false,
                position: 'center'
              },
              emphasis: {
                label: {
                  show: true,
                  fontSize: 40,
                  fontWeight: 'bold'
                }
              },
              labelLine: {
                show: false
              },
              data: this.systemChartData
            }
          ]
        };
        this.chartPie1.setOption(option)
        }).catch(() => {
        })
      },
      getPie2() {
        this.$http.get(`/iailab-ntt-model/index/evaluate/chart/${this.dataForm.pid}`).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.chartData=res.data.series[0].data[0]
          this.charLegend=res.data.legend
        this.chartPie2 = this.$echarts.init(this.$refs.chartPie2);
        let option = {
          tooltip: {
            trigger: 'item'
          },
          legend: {
            bottom: 0,
            left: 'left',
            orient: 'vertical',
            data: this.charLegend
          },
          series: [
            {
              name: '指标权重',
              type: 'pie',
              radius: ['40%', '70%'],
              avoidLabelOverlap: false,
              emphasis: {
                label: {
                  show: true,
                  fontSize: 40,
                  fontWeight: 'bold'
                }
              },
              data: this.chartData,
              emphasis: {
                itemStyle: {
                  shadowBlur: 10,
                  shadowOffsetX: 0,
                  shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
              }
            }
          ]
        };
        console.log(option)
        this.chartPie2.setOption(option)
        }).catch(() => {
        })
      }
    }
  };
</script>
<style>
  .scrollable-container {
    overflow: auto;
    width: 100%;
    margin: -10px;
    height: calc(calc(100vh - 48px - 38px - 35px - 100px));
  }
  .box-card {
    width: 100%;
    height: 100%;
  }
  .eval-system-right {
    width: 18%;
    height: 100%;
  }
  .eval-system-mid {
    width: 82%;
    height: 100%;
  }
  .eval-system-left {
    width: 18%;
    height: 100%;
    padding-right: 10px;
  }
  .mod-prod-eval-system {
    width: 100%;
    height: calc(calc(100vh - 48px - 38px - 35px));
    display: flex;
    flex-direction: row;
  }
</style>
src/views/modules/analysis/index-evaluate.vue
对比新文件
@@ -0,0 +1,118 @@
<template>
  <el-card shadow="never" class="aui-card--fill">
    <el-row style="height: 100vh;">
    <el-col :span="15" style="height: 100vh;border: 1px solid #a6a6a6;">
    <bar-line :option="chartOption"></bar-line>
    </el-col>
    <el-col :span="8" style="height: 100vh;border: 1px solid #a6a6a6;margin-left: 3vh;">
    </el-col>
    </el-row>
  </el-card>
</template>
<script>
import BarLine from "@/components/chart/bar-line.vue";
export default {
  data() {
    return {
      chartOption: {},
    };
  },
  components: { BarLine },
  mounted() {
      this.getchartOption();
    },
  methods: {
    getchartOption() {
      this.chartOption = {
        tooltip: {
          trigger: "axis",
        },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: [
            "Mon",
            "Tue",
            "Wed",
            "Thu",
            "Fri",
            "Sat",
            "Sun",
            "Mon",
            "Tue",
            "Wed",
            "Thu",
          ],
        },
        yAxis: [
          {
            type: "value",
            name: "生产量",
            min: 0,
            max: 250,
            position: "right",
            axisLine: {
              lineStyle: {
                color: "green",
              },
            },
          },
          {
            type: "value",
            name: "外运量",
            min: 0,
            max: 250,
            position: "left",
            offset: 50, // y轴位置的偏移量
            axisLine: {
              lineStyle: {
                color: "red",
              },
            },
          },
          {
            type: "value",
            name: "入洗量",
            min: 0,
            max: 25,
            position: "left",
            axisLine: {
              lineStyle: {
                color: "blue",
              },
            },
          },
        ],
        series: [
          {
            name: "蒸发量",
            type: "line",
            data: [
              2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4,
              3.3,
            ],
          },
          {
            name: "降水量",
            type: "line",
            yAxisIndex: 1, // 对应的y轴的索引值(因为有多个y轴)
            data: [
              2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0,
              2.3,
            ],
          },
          {
            name: "平均温度",
            type: "line",
            yAxisIndex: 2, // 对应y轴的索引值(因为有多个y轴)
            data: [
              2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2,
            ],
          },
        ],
      };
    },
  },
};
</script>
src/views/modules/analysis/index.vue
对比新文件
@@ -0,0 +1,107 @@
<template>
  <dv-full-screen-container>
    <div id="data-view">
      <div id="title-bar">
        <div class="title-text">
          <img :src="img_title" height="100%"/>
        </div>
      </div>
      <div id="data-body">
        <product-evaluate v-if="curMode === 'evaluate'"></product-evaluate>
        <product-overview v-if="curMode === 'overview'"></product-overview>
      </div>
      <div id="title-tab">
        <span style="cursor:pointer"><img :src="img_title_tab_left" @click="changeTab(1)"/></span>
        <span style="cursor:pointer"><img :src="img_title_tab_middle" @click= "back()"/></span>
        <span style="cursor:pointer"><img :src="img_title_tab_right" @click="changeTab(2)"/></span>
      </div>
    </div>
  </dv-full-screen-container>
</template>
<script>
  import ProductEvaluate from "@/views/modules/analysis/components/product-evaluate.vue";
  import ProductOverview from "@/views/modules/analysis/components/product-overview.vue";
  import {reWriteUrlSVG} from '@/utils/hostUtil'
  export default {
    components: {ProductOverview, ProductEvaluate},
    data() {
      return {
        curMode: 'overview',
        img_title: this.doEeWriteUrlSVG('svg/生产情况分析.svg'),
        img_title_tab_left: this.doEeWriteUrlSVG('svg/生产总览选中.svg'),
        img_title_tab_middle: this.doEeWriteUrlSVG('svg/中间装饰.svg'),
        img_title_tab_right: this.doEeWriteUrlSVG('svg/生产评价未选中.svg')
      }
    },
    methods: {
      doEeWriteUrlSVG(url) {
        return reWriteUrlSVG(url)
      },
      changeTab(id) {
        if (id == 1) {
          this.curMode = 'overview'
          this.img_title_tab_left = this.doEeWriteUrlSVG('svg/生产总览选中.svg')
          this.img_title_tab_right = this.doEeWriteUrlSVG('svg/生产评价未选中.svg')
        }
        if (id == 2) {
          this.curMode = 'evaluate'
          this.img_title_tab_left = this.doEeWriteUrlSVG('svg/生产总览未选中.svg')
          this.img_title_tab_right = this.doEeWriteUrlSVG('svg/生产评价选中.svg')
        }
      },
      back() {
        this.$router.replace({name: 'analysis-quality'})
      }
    }
  }
</script>
<style scoped>
  #dv-full-screen-container {
    box-shadow: 0 0 3px blue;
    background-image: url('./img/bg.png');
    background-size: 100% 100vh;
    background-repeat: no-repeat;
  }
  #data-view {
    width: 100%;
    height: 100vh;;
    padding: 5px;
    display: flex;
    flex-direction: column;
  }
  #title-bar {
    width: 100%;
    height: 6vh;
  }
  #title-tab {
    width: 100%;
    height: 6vh;
    display: flex;
    flex-direction: row;
    justify-content: center;
  }
  .title-text {
    overflow: hidden;
  }
  .title-text img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  #data-body {
    width: 100%;
    height: 88vh;
    display: flex;
    flex-direction: row;
  }
</style>
src/views/modules/analysis/performance/index.vue
对比新文件
@@ -0,0 +1,1759 @@
<template>
  <el-card shadow="never" class="aui-card--fill" >
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="入选量" name="first">
        <el-form :inline="true" :model="rxl.dataForm">
          <el-form-item>
            <el-date-picker
                v-model="rxl.dataForm.startDate"
                type="date"
                placeholder="选择开始时间"
                value-format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-date-picker
                v-model="rxl.dataForm.endDate"
                type="date"
                placeholder="选择结束时间"
                value-format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button :loading="raw.rxl.loading" @click="init1">查询</el-button>
          </el-form-item>
        </el-form>
        <div class="scrollable-container">
          <!--原煤入洗量-->
          <el-card shadow="never" class="aui-card--fill" v-loading="raw.rxl.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                      style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ raw.rxl.currentValue }}</span>
                      <span style="font-size: 14px">{{raw.rxl.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                      style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ raw.rxl.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-ymrxl" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                  type="flex"
                  justify="center"
                  align="middle"
                  style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{raw.rxl.trend}}
                <i :class="raw.rxl.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.rxl.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.rxl.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.rxl.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                    :span="23"
                    class="Border_text"
                    style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                    style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{raw.rxl.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
        </div>
      </el-tab-pane>
      <el-tab-pane label="分选产品" name="second">
        <el-form :inline="true" :model="cpl.dataForm">
          <el-form-item>
            <el-date-picker
                v-model="cpl.dataForm.startDate"
                type="date"
                placeholder="选择开始时间"
                value-format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-date-picker
                v-model="cpl.dataForm.endDate"
                type="date"
                placeholder="选择结束时间"
                value-format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button :loading="hm.cl.loading" @click="init2">查询</el-button>
          </el-form-item>
        </el-form>
        <div class="scrollable-container">
          <!--混煤产量-->
          <el-card shadow="never" class="aui-card--fill" v-loading="hm.cl.loading" >
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ hm.cl.currentValue }}</span>
                      <span style="font-size: 14px">{{hm.cl.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ hm.cl.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-hmcl" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{hm.cl.trend}}
                <i :class="hm.cl.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.cl.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.cl.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.cl.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{hm.cl.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--洗小块产量-->
          <el-card shadow="never" class="aui-card--fill" v-loading="xxk.cl.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ xxk.cl.currentValue }}</span>
                      <span style="font-size: 14px">{{xxk.cl.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ xxk.cl.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-xxkcl" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{xxk.cl.trend}}
                <i :class="xxk.cl.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xxk.cl.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xxk.cl.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xxk.cl.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{xxk.cl.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--洗中块产量-->
          <el-card shadow="never" class="aui-card--fill" v-loading="xzk.cl.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ xzk.cl.currentValue }}</span>
                      <span style="font-size: 14px">{{xzk.cl.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ xzk.cl.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-xzkcl" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{xzk.cl.trend}}
                <i :class="xzk.cl.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xzk.cl.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xzk.cl.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xzk.cl.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{xzk.cl.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
        </div>
      </el-tab-pane>
      <el-tab-pane label="商品外运量" name="third">
        <el-form :inline="true" :model="wyl.dataForm">
          <el-form-item>
            <el-date-picker
                v-model="wyl.dataForm.startDate"
                type="date"
                placeholder="选择开始时间"
                value-format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-date-picker
                v-model="wyl.dataForm.endDate"
                type="date"
                placeholder="选择结束时间"
                value-format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button :loading="hm.dx.loading" @click="init3">查询</el-button>
          </el-form-item>
        </el-form>
        <div class="scrollable-container">
          <!--地销混煤-->
          <el-card shadow="never" class="aui-card--fill" v-loading="hm.dx.loading" >
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ hm.dx.currentValue }}</span>
                      <span style="font-size: 14px">{{hm.dx.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ hm.dx.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-dxhm" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{hm.dx.trend}}
                <i :class="hm.dx.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.dx.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.dx.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.dx.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{hm.dx.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--洗中块外运-->
          <el-card shadow="never" class="aui-card--fill" v-loading="xzk.wy.loading" >
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ xzk.wy.currentValue }}</span>
                      <span style="font-size: 14px">{{xzk.wy.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ xzk.wy.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-xzkwy" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{xzk.wy.trend}}
                <i :class="xzk.wy.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xzk.wy.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xzk.wy.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xzk.wy.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{xzk.wy.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--洗小块外运-->
          <!--<el-card shadow="never" class="aui-card&#45;&#45;fill" v-loading="xxk.wy.loading" >
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                      style="
                    width: 100%;
                    height: 30px;
                    margin-top: 10px;
                    margin-bottom: 10px;
                    color: #000000;
                    font-size: 24px;
                  "
                    >
                      <span>{{ xxk.wy.currentValue }}</span>
                      <span style="font-size: 14px">{{xxk.wy.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                      style="
                    width: 100%;
                    height: 30px;
                    margin-top: 10px;
                    margin-bottom: 10px;
                    color: #000000;
                    font-size: 24px;
                  "
                    >
                  <span>{{ xxk.wy.length }}</span
                  ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-xxkwy" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                  type="flex"
                  justify="center"
                  align="middle"
                  style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
                <span style="font-size: 16px; font-weight: 600">
                  整体趋势{{xxk.wy.trend}}
                  <i :class="xxk.wy.iconClass"></i>
                </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xxk.wy.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xxk.wy.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xxk.wy.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                    :span="23"
                    class="Border_text"
                    style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                    style="
                    margin-left: 2vh;
                    font-size: 18px;
                    font-family: '楷体';
                    font-weight: 600;
                    color: red;
                  "
                  >{{xxk.wy.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>-->
          <!--矸石外运-->
          <el-card shadow="never" class="aui-card--fill" v-loading="gs.wy.loading" >
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ gs.wy.currentValue }}</span>
                      <span style="font-size: 14px">{{gs.wy.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ gs.wy.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-gswy" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{gs.wy.trend}}
                <i :class="gs.wy.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{gs.wy.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{gs.wy.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{gs.wy.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{gs.wy.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--小块转载-->
          <el-card shadow="never" class="aui-card--fill" v-loading="xxk.zz.loading" >
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ xxk.zz.currentValue }}</span>
                      <span style="font-size: 14px">{{xxk.zz.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ xxk.zz.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-xkzz" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{xxk.zz.trend}}
                <i :class="xxk.zz.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xxk.zz.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xxk.zz.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{xxk.zz.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{xxk.zz.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--火车外运吨数-->
          <el-card shadow="never" class="aui-card--fill" v-loading="hc.ds.loading" >
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ hc.ds.currentValue }}</span>
                      <span style="font-size: 14px">{{hc.ds.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ hc.ds.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-hcwyds" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{hc.ds.trend}}
                <i :class="hc.ds.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hc.ds.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hc.ds.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hc.ds.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{hc.ds.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--火车外运列数-->
          <el-card shadow="never" class="aui-card--fill" v-loading="hc.ls.loading" >
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ hc.ls.currentValue }}</span>
                      <span style="font-size: 14px">{{hc.ls.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ hc.ls.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-hcwyls" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{hc.ls.trend}}
                <i :class="hc.ls.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hc.ls.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hc.ls.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hc.ls.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{hc.ls.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
        </div>
      </el-tab-pane>
    </el-tabs>
  </el-card>
</template>
<script>
  import {getSeriesData} from '@/utils/mathUtils'
  import * as echarts from "echarts";
  export default {
    data() {
      return {
        activeName: 'first',
        rxl:{
          loading: false,
          dataForm: {
            startDate: '',
            endDate: '',
          },
        },
        cpl:{
          loading: false,
          dataForm: {
            startDate: '',
            endDate: '',
          },
        },
        wyl:{
          loading: false,
          dataForm: {
            startDate: '',
            endDate: '',
          },
        },
        raw: {
          rxl: {
            loading: false,
            page: 'rowCoal',
            paramCode: 'ymrxl',
            chartName: '原煤入洗量',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: ''
          }
        },
        hm: {
          cl: {
            loading: false,
            page: 'wash',
            paramCode: 'hmcl',
            chartName: '混煤产量',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: '',
          },
          dx: {
            loading: false,
            page: 'wy',
            paramCode: 'dxhm',
            chartName: '地销混煤',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: '',
          }
        },
        xxk: {
          cl: {
            loading: false,
            page: 'wash',
            paramCode: 'xxkcl',
            chartName: '洗小块产量',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: '',
          },
          wy: {
            loading: false,
            page: 'wy',
            paramCode: 'xxkwy',
            chartName: '洗小块外运',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: '',
          },
          zz: {
            loading: false,
            page: 'wy',
            paramCode: 'xkzz',
            chartName: '小块转载',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: '',
          }
        },
        xzk: {
          cl: {
            loading: false,
            page: 'wash',
            paramCode: 'xzkcl',
            chartName: '洗中块产量',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: '',
          },
          wy: {
            loading: false,
            page: 'wy',
            paramCode: 'xzkwy',
            chartName: '洗中块外运',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: '',
          }
        },
        gs: {
          wy: {
            loading: false,
            page: 'wy',
            paramCode: 'gswy',
            chartName: '矸石外运',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: '',
          }
        },
        hc: {
          ds: {
            loading: false,
            page: 'wy',
            paramCode: 'hcwyds',
            chartName: '火车外运吨数',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: '',
          },
          ls: {
            loading: false,
            page: 'wy',
            paramCode: 'hcwyls',
            chartName: '火车外运列数',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: '',
          },
        }
      }
    },
    mounted() {
      this.init1()
    },
    methods: {
      init1() {
        this.getChartData(this.raw.rxl, this.rxl.dataForm)
      },
      init2() {
        this.getChartData(this.hm.cl, this.cpl.dataForm)
        this.getChartData(this.xxk.cl, this.cpl.dataForm)
        this.getChartData(this.xzk.cl, this.cpl.dataForm)
      },
      init3() {
        this.getChartData(this.hm.dx, this.wyl.dataForm)
        //this.getChartData(this.xxk.wy, this.wyl.dataForm)
        this.getChartData(this.xzk.wy, this.wyl.dataForm)
        this.getChartData(this.gs.wy, this.wyl.dataForm)
        this.getChartData(this.xxk.zz, this.wyl.dataForm)
        this.getChartData(this.hc.ds, this.wyl.dataForm)
        this.getChartData(this.hc.ls, this.wyl.dataForm)
      },
      getChartData(chartData, dataForm) {
        let myChart = this.$echarts.init(document.getElementById("any-" + chartData.paramCode));
        chartData.loading = true
        this.$http.get(`/iailab-ntt-model/any/ind-item/trend/`, {
          params: {
            startDate: dataForm.startDate,
            endDate: dataForm.endDate,
            page: chartData.page,
            paramCode: chartData.paramCode
          }
        }).then(({data: res}) => {
          chartData.loading = false
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          chartData.chartCode = res.data.chartCode
          chartData.length = res.data.length
          chartData.unit = res.data.unit
          chartData.maxSlope = res.data.maxSlope
          chartData.minSlope = res.data.minSlope
          chartData.currentValue = res.data.currentValue
          chartData.trend = res.data.trend
          chartData.iconClass = res.data.iconClass
          chartData.trendValue = res.data.trendValue
          chartData.dispatchSug = res.data.dispatchSug
          let valueData = []
          let xAxis = []
          res.data.valueList.forEach((item) =>{
            xAxis.push(item.dataTime)
            if (item.dataValue && item.dataValue >= 0) {
              valueData.push([item.dataTime, item.dataValue])
            }
          })
          let length = xAxis.indexOf(valueData[valueData.length - 1][0]) + 1 || xAxis.length
          let trendDate = getSeriesData(chartData.trendValue.slope, chartData.trendValue.bias, length)
          let option = {
            title: {
              text: chartData.chartName,
            },
            tooltip: {
              trigger: "axis",
            },
            grid: {
              left: "3%",
              right: "4%",
              bottom: "3%",
              containLabel: true,
            },
            xAxis: {
              type: "category",
              boundaryGap: false,
              data: xAxis,
            },
            yAxis: {
              type: "value",
            },
            series: [
              {
                name: chartData.chartName,
                type: "line",
                smooth: true,
                stack: "Total",
                data: valueData,
              },
              {
                name: '趋势',
                data: trendDate,
                type: 'line',
                smooth: true,
                showSymbol: false,
                color: '#FFAA5D'
              }
            ],
          };
          if (option && typeof option === "object") {
            myChart.setOption(option);
          }
        })
      },
      handleClick(tab, event) {
        let that = this
        if ('first' === tab.name) {
          setTimeout(function () {
            that.init1()
          }, 500)
        } else if ('second' === tab.name) {
          setTimeout(function () {
            that.init2()
          }, 500)
        }else if ('third' === tab.name) {
          setTimeout(function () {
            that.init3()
          }, 500)
        }
      }
    }
  }
</script>
<style scoped>
  .scrollable-container {
    overflow: auto;
    width: 100%;
    margin: -10px;
    height: calc(calc(100vh - 48px - 38px - 35px - 150px));
  }
  .ecbox {
    width: 100%;
    height: 30vh;
  }
  .Border {
    height: 42vh;
  }
  .Border_l {
    height: 20vh;
  }
  .Border_down {
    border: 1px solid #F2F3F5;
    height: 12vh;
  }
  .Border_text {
    background-color: #F2F3F5;
    border: 1px solid #F2F3F5;
    height: 7vh;
  }
</style>
src/views/modules/analysis/process/components/report-view.vue
对比新文件
@@ -0,0 +1,150 @@
<template>
  <el-dialog :visible.sync="visible" title="报告详情" :close-on-click-modal="false"
             :close-on-press-escape="false" width="60%">
    <div style="padding: 5px;" v-loading="loading">
      <h1 style="text-align: center">{{dataForm.reportName}}</h1>
      <el-divider content-position="left">诊断时间</el-divider>
      <el-row>
        <el-col :span="12">{{dataForm.reportDate}}</el-col>
      </el-row>
      <el-divider content-position="left">诊断结论</el-divider>
      <el-row>
        <el-col :span="24">
          <p>{{dataForm.content}}</p>
        </el-col>
      </el-row>
      <el-divider content-position="left">参数分析</el-divider>
      <div v-for="(item, index) in dataForm.chartList" :key="index" class="Border" style="margin-top: 5px; padding: 10px">
        <div :id="'reportView_' + dataForm.procCode  + index" style="height: 200px; width: 100%;"></div>
      </div>
    </div>
  </el-dialog>
</template>
<script>
  export default {
    data() {
      return {
        visible: false,
        loading: false,
        dataForm: {
          id: '',
          procCode: '',
          procName: '',
          reportName: '',
          reportDate: '',
          content: '',
          createDate: '',
          chartList: []
        }
      }
    },
    methods: {
      init() {
        this.visible = true
        this.$nextTick(() => {
          this.resetFields(this.dataForm)
          this.dataForm['chartList'] = []
          if (this.dataForm.id) {
            this.getInfo()
          }
        })
      },
      // 获取信息
      getInfo() {
        let that = this
        that.loading = true
        this.$http.get(`/iailab-ntt-model/any/proc-report/${this.dataForm.id}`).then(({data: res}) => {
          that.loading = false
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.dataForm = res.data
          setTimeout(function () {
            that.dataForm.chartList.forEach(function (item, index) {
              that.getCharts('reportView_' + that.dataForm.procCode + index, item)
            })
          }, 500)
        }).catch(() => {
        })
      },
      getCharts(id, chartData) {
        if (document.getElementById(id) == null) {
          return
        }
        this.$echarts.dispose(document.getElementById(id))
        let myChart = this.$echarts.init(document.getElementById(id));
        myChart.clear()
        let seriesData = []
        if (chartData.series) {
          chartData.series.forEach(function (item, index) {
            seriesData.push(
              {
                name: item.name,
                type: 'line',
                smooth: true,
                showSymbol: false,
                data: item.data
              }
            )
          })
        }
        let option = {
          title: {
            text: chartData.valueName
          },
          tooltip: {
            trigger: 'axis'
          },
          legend: {
            data: chartData.legend,
          },
          grid: {
            top: '20%',
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
          },
          xAxis: {
            type: 'category',
            boundaryGap: false,
            data: chartData.categories,
          },
          yAxis: {
            type: 'value',
            position: 'left',
            offset: 0,
            name: '',
            splitLine: {
              show: false
            },
            axisLine: {
              show: true,
              onZero: false
            },
            axisTick: {show: true},
            axisLabel: {
              formatter: '{value}'
            }
          },
          series: seriesData
        }
        myChart.setOption(option);
      },
      resetFields (obj) {
        for (let key in obj) {
          if (key === 'id') {
            continue
          }
          if (obj[key] instanceof Array) {
            obj[key] = []
          } else if (obj[key] instanceof Object) {
            this.resetFields(obj[key])
          } else {
            obj[key] = ''
          }
        }
      }
    }
  }
</script>
src/views/modules/analysis/process/components/report.vue
对比新文件
@@ -0,0 +1,89 @@
<template>
  <div class="mod-any_proc_report">
    <el-table
        v-loading="dataListLoading"
        :data="dataList"
        border
        @selection-change="dataListSelectionChangeHandle"
        @sort-change="dataListSortChangeHandle"
        style="width: 100%;">
      <el-table-column type="index" header-align="center" align="center" width="50"></el-table-column>
      <el-table-column prop="reportName" :label="$t('anyProcReport.reportName')" header-align="center"
                       align="left"></el-table-column>
      <el-table-column prop="reportDate" :label="$t('anyProcReport.reportDate')" header-align="center"
                       align="left"></el-table-column>
      <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="80">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="viewReport(scope.row.id)">查看报告</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
        :current-page="page"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="limit"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle">
    </el-pagination>
    <!-- 弹窗, 详情 -->
    <report-view v-if="reportViewVisible" ref="reportView"></report-view>
  </div>
</template>
<script>
  import mixinViewModule from '@/mixins/view-module'
  import ReportView from './report-view'
  export default {
    name: 'AnyReport',
    mixins: [mixinViewModule],
    components: {ReportView},
    props: {
      procCode: String
    },
    data() {
      return {
        mixinViewModuleOptions: {
          getDataListURL: '/iailab-ntt-model/any/proc-report/page',
          getDataListIsPage: true,
          deleteURL: '/iailab-ntt-model/any/proc-report',
          deleteIsBatch: true
        },
        dataForm: {
          procCode: '',
          startTime: '',
          endTime: '',
        },
        reportViewVisible: false
      }
    },
    watch: {
      procCode: {
        immediate: true,
        handler() {
          this.dataForm.procCode = this.procCode
          this.getDataList()
        }
      }
    },
    methods: {
      viewReport(id) {
        this.reportViewVisible = true;
        this.$nextTick(() => {
          this.$refs.reportView.dataForm.id = id
          this.$refs.reportView.init();
        });
      }
    },
    computed: {
      getProcCode() {
        return this.procCode
      }
    }
  }
</script>
src/views/modules/analysis/process/index.vue
对比新文件
@@ -0,0 +1,1261 @@
<template>
  <el-card shadow="never" class="aui-card--fill">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="浅槽分选307" name="tab1">
        <el-row type="flex" justify="space-around">
          <el-col :span="8">
            <div class="any-card border-down">
              <el-form :model="qcfx307.anyData" ref="qcfx307AnyData" label-width="80px">
                <el-row :gutter="20">
                  <el-col :span="24">
                    <el-form-item label="诊断结果" prop="alarmInfo">
                      <el-input v-model="qcfx307.anyData.alarmInfo" readonly type="textarea" rows="6"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="诊断时间" prop="anyTime">
                      <el-input v-model="qcfx307.anyData.anyTime" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <el-divider content-position="left">诊断记录</el-divider>
              <any-report :procCode="qcfx307.anyData.code"></any-report>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form :inline="true" :model="qcfx307.dataForm" label-width="100px">
              <el-form-item>
                <el-date-picker
                    v-model="qcfx307.dataForm.startDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-date-picker
                    v-model="qcfx307.dataForm.endDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-button :loading="qcfx307.hjt.loading" @click="searchDataQc307()">{{ $t('query') }}</el-button>
              </el-form-item>
            </el-form>
            <div class="scrollable-container border-down">
              <!--合介桶桶位-->
              <div class="chart-cont" v-loading="qcfx307.hjt.loading">
                <div id="chartQcfx307Hjt" class="chart-line"></div>
              </div>
              <!--稀介桶桶位-->
              <div class="chart-cont" v-loading="qcfx307.xjt.loading">
                <div id="chartQcfx307Xjt" class="chart-line"></div>
              </div>
              <!--煤泥桶桶位-->
              <div class="chart-cont" v-loading="qcfx307.mnt.loading">
                <div id="chartQcfx307Mnt" class="chart-line"></div>
              </div>
              <!--磁性物含量-->
              <div class="chart-cont" v-loading="qcfx307.cxw.loading">
                <div id="chartQcfx307Cxw" class="chart-line"></div>
              </div>
              <!--合介密度-->
              <div class="chart-cont" v-loading="qcfx307.hjmd.loading">
                <div id="chartQcfx307Hjmd" class="chart-line"></div>
              </div>
              <!--分流阀开度-->
              <div class="chart-cont" v-loading="qcfx307.flf.loading">
                <div id="chartQcfx307Flf" class="chart-line"></div>
              </div>
              <!--加水阀开度-->
              <div class="chart-cont" v-loading="qcfx307.jsf.loading">
                <div id="chartQcfx307Jsf" class="chart-line"></div>
              </div>
              <!--灰分-->
              <div class="chart-cont" v-loading="qcfx307.hf.loading">
                <div id="chartQcfx307Hf" class="chart-line"></div>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-tab-pane>
      <el-tab-pane label="浅槽分选308" name="tab2">
        <el-row type="flex" justify="space-around">
          <el-col :span="8">
            <div class="any-card border-down">
              <el-form :model="qcfx308.anyData" ref="qcfx308AnyData" label-width="80px">
                <el-row :gutter="20">
                  <el-col :span="24">
                    <el-form-item label="诊断结果" prop="alarmInfo">
                      <el-input v-model="qcfx308.anyData.alarmInfo" readonly type="textarea" rows="6"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="诊断时间" prop="anyTime">
                      <el-input v-model="qcfx308.anyData.anyTime" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <el-divider content-position="left">诊断记录</el-divider>
              <any-report :procCode="qcfx308.anyData.code"></any-report>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form :inline="true" :model="qcfx308.dataForm" label-width="100px">
              <el-form-item>
                <el-date-picker
                    v-model="qcfx308.dataForm.startDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-date-picker
                    v-model="qcfx308.dataForm.endDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-button :loading="qcfx308.hjt.loading" @click="searchDataQc308()">{{ $t('query') }}</el-button>
              </el-form-item>
            </el-form>
            <div class="scrollable-container border-down">
              <!--合介桶桶位-->
              <div class="chart-cont" v-loading="qcfx308.hjt.loading">
                <div id="chartQcfx308Hjt" class="chart-line"></div>
              </div>
              <!--稀介桶桶位-->
              <div class="chart-cont" v-loading="qcfx308.xjt.loading">
                <div id="chartQcfx308Xjt" class="chart-line"></div>
              </div>
              <!--煤泥桶桶位-->
              <div class="chart-cont" v-loading="qcfx308.mnt.loading">
                <div id="chartQcfx308Mnt" class="chart-line"></div>
              </div>
              <!--磁性物含量-->
              <div class="chart-cont" v-loading="qcfx308.cxw.loading">
                <div id="chartQcfx308Cxw" class="chart-line"></div>
              </div>
              <!--合介密度-->
              <div class="chart-cont" v-loading="qcfx308.hjmd.loading">
                <div id="chartQcfx308Hjmd" class="chart-line"></div>
              </div>
              <!--分流阀开度-->
              <div class="chart-cont" v-loading="qcfx308.flf.loading">
                <div id="chartQcfx308Flf" class="chart-line"></div>
              </div>
              <!--加水阀开度-->
              <div class="chart-cont" v-loading="qcfx308.jsf.loading">
                <div id="chartQcfx308Jsf" class="chart-line"></div>
              </div>
              <!--灰分-->
              <div class="chart-cont" v-loading="qcfx308.hf.loading">
                <div id="chartQcfx308Hf" class="chart-line"></div>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-tab-pane>
      <el-tab-pane label="旋流分选3318" name="tab3">
        <el-row type="flex" justify="space-around">
          <el-col :span="8">
            <div class="any-card border-down">
              <el-form :model="xlfx3318.anyData" ref="xlfx3318AnyData" label-width="80px">
                <el-row :gutter="20">
                  <el-col :span="24">
                    <el-form-item label="诊断结果" prop="alarmInfo">
                      <el-input v-model="xlfx3318.anyData.alarmInfo" readonly type="textarea" rows="6"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="诊断时间" prop="anyTime">
                      <el-input v-model="xlfx3318.anyData.anyTime" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <el-divider content-position="left">诊断记录</el-divider>
              <any-report :procCode="xlfx3318.anyData.code"></any-report>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form :inline="true" :model="xlfx3318.dataForm" label-width="100px">
              <el-form-item>
                <el-date-picker
                    v-model="xlfx3318.dataForm.startDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-date-picker
                    v-model="xlfx3318.dataForm.endDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-button :loading="xlfx3318.hlt.loading" @click="searchDataXlfx3318()">{{ $t('query') }}</el-button>
              </el-form-item>
            </el-form>
            <div class="scrollable-container border-down">
              <!--混料桶桶位-->
              <div class="chart-cont" v-loading="xlfx3318.hlt.loading">
                <div id="chartXlfx3318Hlt" class="chart-line"></div>
              </div>
              <!--合介桶液位-->
              <div class="chart-cont" v-loading="xlfx3318.hjt.loading">
                <div id="chartXlfx3318Hjt" class="chart-line"></div>
              </div>
              <!--稀介桶液位-->
              <div class="chart-cont" v-loading="xlfx3318.xjt.loading">
                <div id="chartXlfx3318Xjt" class="chart-line"></div>
              </div>
              <!--煤泥桶桶位-->
              <div class="chart-cont" v-loading="xlfx3318.mnt.loading">
                <div id="chartXlfx3318Mnt" class="chart-line"></div>
              </div>
              <!--旋流器压力-->
              <div class="chart-cont" v-loading="xlfx3318.xlqyl.loading">
                <div id="chartXlfx3318Xlqyl" class="chart-line"></div>
              </div>
              <!--磁性物含量-->
              <div class="chart-cont" v-loading="xlfx3318.cxw.loading">
                <div id="chartXlfx3318Cxw" class="chart-line"></div>
              </div>
              <!--合介密度-->
              <div class="chart-cont" v-loading="xlfx3318.hjmd.loading">
                <div id="chartXlfx3318Hjmd" class="chart-line"></div>
              </div>
              <!--分流阀开度-->
              <div class="chart-cont" v-loading="xlfx3318.flf.loading">
                <div id="chartXlfx3318Flf" class="chart-line"></div>
              </div>
              <!--排水泵频率-->
              <div class="chart-cont" v-loading="xlfx3318.psb.loading">
                <div id="chartXlfx3318Psb" class="chart-line"></div>
              </div>
              <!--加介阀开度-->
              <div class="chart-cont" v-loading="xlfx3318.jjf.loading">
                <div id="chartXlfx3318Jjf" class="chart-line"></div>
              </div>
              <!--加水阀开度-->
              <div class="chart-cont" v-loading="xlfx3318.jsf.loading">
                <div id="chartXlfx3318Jsf" class="chart-line"></div>
              </div>
              <!--灰分-->
              <div class="chart-cont" v-loading="xlfx3318.hf.loading">
                <div id="chartXlfx3318Hf" class="chart-line"></div>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-tab-pane>
      <el-tab-pane label="旋流分选3319" name="tab4">
        <el-row type="flex" justify="space-around">
          <el-col :span="8">
            <div class="any-card border-down">
              <el-form :model="xlfx3319.anyData" ref="xlfx3319AnyData" label-width="80px">
                <el-row :gutter="20">
                  <el-col :span="24">
                    <el-form-item label="诊断结果" prop="alarmInfo">
                      <el-input v-model="xlfx3319.anyData.alarmInfo" readonly type="textarea" rows="6"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="诊断时间" prop="anyTime">
                      <el-input v-model="xlfx3319.anyData.anyTime" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <el-divider content-position="left">诊断记录</el-divider>
              <any-report :procCode="xlfx3319.anyData.code"></any-report>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form :inline="true" :model="xlfx3319.dataForm" label-width="100px">
              <el-form-item>
                <el-date-picker
                    v-model="xlfx3319.dataForm.startDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-date-picker
                    v-model="xlfx3319.dataForm.endDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-button :loading="xlfx3319.hf.loading" @click="searchDataXlfx3319()">{{ $t('query') }}</el-button>
              </el-form-item>
            </el-form>
            <div class="scrollable-container border-down">
              <!--混料桶桶位-->
              <div class="chart-cont" v-loading="xlfx3319.hlt.loading">
                <div id="chartXlfx3319Hlt" class="chart-line"></div>
              </div>
              <!--合介桶液位-->
              <div class="chart-cont" v-loading="xlfx3319.hjt.loading">
                <div id="chartXlfx3319Hjt" class="chart-line"></div>
              </div>
              <!--稀介桶液位-->
              <div class="chart-cont" v-loading="xlfx3319.xjt.loading">
                <div id="chartXlfx3319Xjt" class="chart-line"></div>
              </div>
              <!--煤泥桶桶位-->
              <div class="chart-cont" v-loading="xlfx3319.mnt.loading">
                <div id="chartXlfx3319Mnt" class="chart-line"></div>
              </div>
              <!--旋流器压力-->
              <div class="chart-cont" v-loading="xlfx3319.xlqyl.loading">
                <div id="chartXlfx3319Xlqyl" class="chart-line"></div>
              </div>
              <!--磁性物含量-->
              <div class="chart-cont" v-loading="xlfx3319.cxw.loading">
                <div id="chartXlfx3319Cxw" class="chart-line"></div>
              </div>
              <!--合介密度-->
              <div class="chart-cont" v-loading="xlfx3319.hjmd.loading">
                <div id="chartXlfx3319Hjmd" class="chart-line"></div>
              </div>
              <!--分流阀开度-->
              <div class="chart-cont" v-loading="xlfx3319.flf.loading">
                <div id="chartXlfx3319Flf" class="chart-line"></div>
              </div>
              <!--排水泵频率-->
              <div class="chart-cont" v-loading="xlfx3319.psb.loading">
                <div id="chartXlfx3319Psb" class="chart-line"></div>
              </div>
              <!--加介阀开度-->
              <div class="chart-cont" v-loading="xlfx3319.jjf.loading">
                <div id="chartXlfx3319Jjf" class="chart-line"></div>
              </div>
              <!--加水阀开度-->
              <div class="chart-cont" v-loading="xlfx3319.jsf.loading">
                <div id="chartXlfx3319Jsf" class="chart-line"></div>
              </div>
              <!--灰分-->
              <div class="chart-cont" v-loading="xlfx3319.hf.loading">
                <div id="chartXlfx3319Hf" class="chart-line"></div>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-tab-pane>
      <el-tab-pane label="浅槽浓缩" name="tab5">
        <el-row type="flex" justify="space-around">
          <el-col :span="8">
            <div class="any-card border-down">
              <el-form :model="qcns.anyData" ref="qcnsAnyData" label-width="80px">
                <el-row :gutter="20">
                  <el-col :span="24">
                    <el-form-item label="诊断结果" prop="alarmInfo">
                      <el-input v-model="qcns.anyData.alarmInfo" readonly type="textarea" rows="6"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="诊断时间" prop="anyTime">
                      <el-input v-model="qcns.anyData.anyTime" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <el-divider content-position="left">诊断记录</el-divider>
              <any-report :procCode="qcns.anyData.code"></any-report>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form :inline="true" :model="qcns.dataForm" label-width="100px">
              <el-form-item>
                <el-date-picker
                    v-model="qcns.dataForm.startDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-date-picker
                    v-model="qcns.dataForm.endDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-button :loading="qcns.rlnd.loading" @click="searchDataQcns">{{ $t('query') }}</el-button>
              </el-form-item>
            </el-form>
            <div class="scrollable-container border-down">
              <!--浓缩池入料浓度-->
              <div class="chart-cont" v-loading="qcns.rlnd.loading">
                <div id="chartQcnsRlnd" class="chart-line"></div>
              </div>
              <!--浓缩池入料流量-->
              <div class="chart-cont" v-loading="qcns.rlld.loading">
                <div id="chartQcnsRlll" class="chart-line"></div>
              </div>
              <!--加药流量-->
              <div class="chart-cont" v-loading="qcns.jyll.loading">
                <div id="chartQcnsJyll" class="chart-line"></div>
              </div>
              <!--循环水池浊度-->
              <div class="chart-cont" v-loading="qcns.sczd.loading">
                <div id="chartQcnsSczd" class="chart-line"></div>
              </div>
              <!--浓缩池出料浓度-->
              <div class="chart-cont" v-loading="qcns.clnd.loading">
                <div id="chartQcnsClnd" class="chart-line"></div>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-tab-pane>
      <el-tab-pane label="旋流浓缩" name="tab6">
        <el-row type="flex" justify="space-around">
          <el-col :span="8">
            <div class="any-card border-down">
              <el-form :model="xlns.anyData" ref="xlnsAnyData" label-width="80px">
                <el-row :gutter="20">
                  <el-col :span="24">
                    <el-form-item label="诊断结果" prop="alarmInfo">
                      <el-input v-model="xlns.anyData.alarmInfo" readonly type="textarea" rows="6"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="诊断时间" prop="anyTime">
                      <el-input v-model="xlns.anyData.anyTime" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <el-divider content-position="left">诊断记录</el-divider>
              <any-report :procCode="xlns.anyData.code"></any-report>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form :inline="true" :model="xlns.dataForm" label-width="100px">
              <el-form-item>
                <el-date-picker
                    v-model="xlns.dataForm.startDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-date-picker
                    v-model="xlns.dataForm.endDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-button :loading="xlns.rlnd.loading" @click="searchDataXlns()">{{ $t('query') }}</el-button>
              </el-form-item>
            </el-form>
            <div class="scrollable-container border-down">
              <!--浓缩池入料浓度-->
              <div class="chart-cont" v-loading="xlns.rlnd.loading">
                <div id="chartXlnsRlnd" class="chart-line"></div>
              </div>
              <!--浓缩池入料流量-->
              <div class="chart-cont" v-loading="xlns.rlld.loading">
                <div id="chartXlnsRlld" class="chart-line"></div>
              </div>
              <!--加药流量-->
              <div class="chart-cont" v-loading="xlns.jyll.loading">
                <div id="chartXlnsJyll" class="chart-line"></div>
              </div>
              <!--循环水池浊度-->
              <div class="chart-cont" v-loading="xlns.sczd.loading">
                <div id="chartXlnsSczd" class="chart-line"></div>
              </div>
              <!--浓缩池出料浓度-->
              <div class="chart-cont" v-loading="xlns.clnd.loading">
                <div id="chartXlnsClnd" class="chart-line"></div>
              </div>
              <!--污泥厚度-->
              <div class="chart-cont" v-loading="xlns.wnhd.loading">
                <div id="chartNSwnhd" class="chart-line"></div>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-tab-pane>
      <el-tab-pane label="旋流压滤" name="tab7">
        <el-row type="flex" justify="space-around">
          <el-col :span="8">
            <div class="any-card border-down">
              <el-form :model="xlyl.anyData" ref="xlylAnyData" label-width="80px">
                <el-row :gutter="20">
                  <el-col :span="24">
                    <el-form-item label="诊断结果" prop="alarmInfo">
                      <el-input v-model="xlyl.anyData.alarmInfo" readonly type="textarea" rows="6"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="24">
                    <el-form-item label="诊断时间" prop="anyTime">
                      <el-input v-model="xlyl.anyData.anyTime" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <el-divider content-position="left">诊断记录</el-divider>
              <any-report :procCode="xlyl.anyData.code"></any-report>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form :inline="true" :model="xlyl.dataForm" label-width="100px">
              <el-form-item>
                <el-date-picker
                    v-model="xlyl.dataForm.startDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-date-picker
                    v-model="xlyl.dataForm.endDate"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-button :loading="xlyl.rlc.loading" @click="searchDataXlyl()">{{ $t('query') }}</el-button>
              </el-form-item>
            </el-form>
            <div class="scrollable-container border-down">
              <!--入料池液位-->
              <div class="chart-cont" v-loading="xlyl.rlc.loading">
                <div id="chartXlylRlc" class="chart-line"></div>
              </div>
              <!--皮带秤瞬时量-->
              <div class="chart-cont" v-loading="xlyl.pdc.loading">
                <div id="chartXlylPdc" class="chart-line"></div>
              </div>
              <!--入料泵运行状态-->
              <div class="chart-cont" v-loading="xlyl.rlb.loading">
                <div id="chartXlylRlb" class="chart-line"></div>
              </div>
              <!--刮板机运行状态-->
              <div class="chart-cont" v-loading="xlyl.gbj.loading">
                <div id="chartXlylGbj" class="chart-line"></div>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-tab-pane>
    </el-tabs>
  </el-card>
</template>
<script>
  import {getSeriesData} from '@/utils/mathUtils'
  import AnyReport from  './components/report'
  export default {
    components: {
      AnyReport
    },
    data() {
      return {
        activeName: 'tab1',
        qcfx307: {
          loading: false,
          anyData: {
            code: 'C01',
            anyTime: '',
            alarmInfo: '',
          },
          dataForm: {
            startDate: '',
            endDate: '',
          },
          hjt: {
            loading: false,
            chartCode: 'chartQcfx307Hjt',
            chartName: '合介桶桶位',
            codes: ['M0000200012', 'M0000200015', 'M0000200016']
          },
          xjt: {
            loading: false,
            chartCode: 'chartQcfx307Xjt',
            chartName: '稀介桶桶位',
            codes: ['M0000200013', 'M0000200017', 'M0000200018']
          },
          mnt: {
            loading: false,
            chartCode: 'chartQcfx307Mnt',
            chartName: '煤泥桶桶位',
            codes: ['M0000200014', 'M0000200019', 'M0000200020']
          },
          cxw: {
            loading: false,
            chartCode: 'chartQcfx307Cxw',
            chartName: '磁性物含量',
            codes: ['M0000200021', 'M0000200022']
          },
          hjmd: {
            loading: false,
            chartCode: 'chartQcfx307Hjmd',
            chartName: '合介密度',
            codes: ['M0000200023', 'M0000200024']
          },
          flf: {
            loading: false,
            chartCode: 'chartQcfx307Flf',
            chartName: '分流阀开度',
            codes: ['M0000200025']
          },
          jsf: {
            loading: false,
            chartCode: 'chartQcfx307Jsf',
            chartName: '加水阀开度',
            codes: ['M0000200026', 'M0000200027', 'M0000200028', 'M0000200029']
          },
          hf: {
            loading: false,
            chartCode: 'chartQcfx307Hf',
            chartName: '灰分',
            codes: ['M0000100020', 'M0000200007']
          },
        },
        qcfx308: {
          loading: false,
          anyData: {
            code: 'C02',
            anyTime: '',
            alarmInfo: '',
          },
          dataForm: {
            startDate: '',
            endDate: '',
          },
          hjt: {
            loading: false,
            chartCode: 'chartQcfx308Hjt',
            chartName: '合介桶桶位',
            codes: ['M0000200030', 'M0000200031', 'M0000200032']
          },
          xjt: {
            loading: false,
            chartCode: 'chartQcfx308Xjt',
            chartName: '稀介桶桶位',
            codes: ['M0000200033', 'M0000200034', 'M0000200035']
          },
          mnt: {
            loading: false,
            chartCode: 'chartQcfx308Mnt',
            chartName: '煤泥桶桶位',
            codes: ['M0000200014', 'M0000200019', 'M0000200020']
          },
          cxw: {
            loading: false,
            chartCode: 'chartQcfx308Cxw',
            chartName: '磁性物含量',
            codes: ['M0000200036', 'M0000200037']
          },
          hjmd: {
            loading: false,
            chartCode: 'chartQcfx308Hjmd',
            chartName: '合介密度',
            codes: ['M0000200038', 'M0000200039']
          },
          flf: {
            loading: false,
            chartCode: 'chartQcfx308Flf',
            chartName: '分流阀开度',
            codes: ['M0000200040']
          },
          jsf: {
            loading: false,
            chartCode: 'chartQcfx308Jsf',
            chartName: '加水阀开度',
            codes: ['M0000200041', 'M0000200042', 'M0000200028', 'M0000200043']
          },
          hf: {
            loading: false,
            chartCode: 'chartQcfx308Hf',
            chartName: '灰分',
            codes: ['M0000100020', 'M0000200007']
          },
        },
        xlfx3318: {
          loading: false,
          anyData: {
            code: 'C03',
            anyTime: '',
            alarmInfo: '',
          },
          dataForm: {
            startDate: '',
            endDate: '',
          },
          hlt: {
            loading: false,
            chartCode: 'chartXlfx3318Hlt',
            chartName: '混料桶桶位',
            codes: ['M0000200044', 'M0000200045', 'M0000200046']
          },
          hjt: {
            loading: false,
            chartCode: 'chartXlfx3318Hjt',
            chartName: '合介桶液位',
            codes: ['M0000200047', 'M0000200048', 'M0000200049']
          },
          xjt: {
            loading: false,
            chartCode: 'chartXlfx3318Xjt',
            chartName: '稀介桶液位',
            codes: ['M0000200050', 'M0000200051', 'M0000200052']
          },
          mnt: {
            loading: false,
            chartCode: 'chartXlfx3318Mnt',
            chartName: '煤泥桶桶位',
            codes: ['M0000200053', 'M0000200054', 'M0000200055']
          },
          xlqyl: {
            loading: false,
            chartCode: 'chartXlfx3318Xlqyl',
            chartName: '旋流器压力',
            codes: ['M0000200056', 'M0000200057']
          },
          cxw: {
            loading: false,
            chartCode: 'chartXlfx3318Cxw',
            chartName: '磁性物含量',
            codes: ['M0000200058', 'M0000200059']
          },
          hjmd: {
            loading: false,
            chartCode: 'chartXlfx3318Hjmd',
            chartName: '合介密度',
            codes: ['M0000200060', 'M0000200061']
          },
          flf: {
            loading: false,
            chartCode: 'chartXlfx3318Flf',
            chartName: '分流阀开度',
            codes: ['M0000200062', 'M0000200063']
          },
          psb: {
            loading: false,
            chartCode: 'chartXlfx3318Psb',
            chartName: '排水泵频率',
            codes: ['M0000200064', 'M0000200065', 'M0000200068', 'M0000200069']
          },
          jjf: {
            loading: false,
            chartCode: 'chartXlfx3318Jjf',
            chartName: '加介阀开度',
            codes: ['M0000200066']
          },
          jsf: {
            loading: false,
            chartCode: 'chartXlfx3318Jsf',
            chartName: '加水阀开度',
            codes: ['M0000200067', 'M0000200070']
          },
          hf: {
            loading: false,
            chartCode: 'chartXlfx3318Hf',
            chartName: '灰分',
            codes: ['M0000200071', 'M0000200006']
          },
        },
        xlfx3319: {
          loading: false,
          anyData: {
            code: 'C04',
            anyTime: '',
            alarmInfo: '',
          },
          dataForm: {
            startDate: '',
            endDate: '',
          },
          hlt: {
            loading: false,
            chartCode: 'chartXlfx3319Hlt',
            chartName: '混料桶桶位',
            codes: ['M0000200072', 'M0000200073', 'M0000200074']
          },
          hjt: {
            loading: false,
            chartCode: 'chartXlfx3319Hjt',
            chartName: '合介桶液位',
            codes: ['M0000200075', 'M0000200076', 'M0000200077']
          },
          xjt: {
            loading: false,
            chartCode: 'chartXlfx3319Xjt',
            chartName: '稀介桶液位',
            codes: ['M0000200078', 'M0000200079', 'M0000200080']
          },
          mnt: {
            loading: false,
            chartCode: 'chartXlfx3319Mnt',
            chartName: '煤泥桶桶位',
            codes: ['M0000200081', 'M0000200082', 'M0000200083']
          },
          xlqyl: {
            loading: false,
            chartCode: 'chartXlfx3319Xlqyl',
            chartName: '旋流器压力',
            codes: ['M0000200084', 'M0000200085']
          },
          cxw: {
            loading: false,
            chartCode: 'chartXlfx3319Cxw',
            chartName: '磁性物含量',
            codes: ['M0000200086', 'M0000200087']
          },
          hjmd: {
            loading: false,
            chartCode: 'chartXlfx3319Hjmd',
            chartName: '合介密度',
            codes: ['M0000200088', 'M0000200089']
          },
          flf: {
            loading: false,
            chartCode: 'chartXlfx3319Flf',
            chartName: '分流阀开度',
            codes: ['M0000200090', 'M0000200091']
          },
          psb: {
            loading: false,
            chartCode: 'chartXlfx3319Psb',
            chartName: '排水泵频率',
            codes: ['M0000200092', 'M0000200093', 'M0000200094', 'M0000200095']
          },
          jjf: {
            loading: false,
            chartCode: 'chartXlfx3319Jjf',
            chartName: '加介阀开度',
            codes: ['M0000200096']
          },
          jsf: {
            loading: false,
            chartCode: 'chartXlfx3319Jsf',
            chartName: '加水阀开度',
            codes: ['M0000200067', 'M0000200096']
          },
          hf: {
            loading: false,
            chartCode: 'chartXlfx3319Hf',
            chartName: '灰分',
            codes: ['M0000200071', 'M0000200006']
          },
        },
        qcns: {
          loading: false,
          anyData: {
            code: 'C05',
            anyTime: '',
            alarmInfo: '',
          },
          dataForm: {
            startDate: '',
            endDate: '',
          },
          rlnd: {
            loading: false,
            chartCode: 'chartQcnsRlnd',
            chartName: '浓缩池入料浓度',
            codes: ['M0000100106']
          },
          rlld: {
            loading: false,
            chartCode: 'chartQcnsRlll',
            chartName: '浓缩池入料流量',
            codes: ['M0000100105']
          },
          jyll: {
            loading: false,
            chartCode: 'chartQcnsJyll',
            chartName: '加药流量',
            codes: ['M0000100123', 'M0000100124']
          },
          sczd: {
            loading: false,
            chartCode: 'chartQcnsSczd',
            chartName: '循环水池浊度',
            codes: ['M0000100109', 'M0000101081', 'M0000100115', 'M0000101084']
          },
          clnd: {
            loading: false,
            chartCode: 'chartQcnsClnd',
            chartName: '浓缩池出料浓度',
            codes: ['M0000100108', 'M0000101082', 'M0000100114', 'M0000101085']
          },
          wnhd: {
            loading: false,
            chartCode: 'chartQcnsWnhd',
            chartName: '浓缩池污泥厚度',
            codes: ['M0000100110', 'M0000101083', 'M0000100116', 'M0000101086']
          }
        },
        xlns: {
          loading: false,
          anyData: {
            code: 'C06',
            anyTime: '',
            alarmInfo: '',
          },
          dataForm: {
            startDate: '',
            endDate: '',
          },
          rlnd: {
            loading: false,
            chartCode: 'chartXlnsRlnd',
            chartName: '浓缩池入料浓度',
            codes: ['M0000100118']
          },
          rlld: {
            loading: false,
            chartCode: 'chartXlnsRlld',
            chartName: '浓缩池入料流量',
            codes: ['M0000100117']
          },
          jyll: {
            loading: false,
            chartCode: 'chartXlnsJyll',
            chartName: '加药流量',
            codes: ['M0000100139', 'M0000100140']
          },
          sczd: {
            loading: false,
            chartCode: 'chartXlnsSczd',
            chartName: '循环水池浊度',
            codes: ['M0000100121', 'M0000101092']
          },
          clnd: {
            loading: false,
            chartCode: 'chartXlnsClnd',
            chartName: '浓缩池出料浓度',
            codes: ['M0000100120', 'M0000101093']
          },
          wnhd: {
            loading: false,
            chartCode: 'chartNSwnhd',
            chartName: '污泥厚度',
            codes: ['M0000100122', 'M0000101094']
          }
        },
        xlyl: {
          loading: false,
          anyData: {
            code: 'C07',
            anyTime: '',
            alarmInfo: '',
          },
          dataForm: {
            startDate: '',
            endDate: '',
          },
          rlc: {
            loading: false,
            chartCode: 'chartXlylRlc',
            chartName: '入料池液位',
            codes: ['M0000100426']
          },
          pdc: {
            loading: false,
            chartCode: 'chartXlylPdc',
            chartName: '皮带秤瞬时量',
            codes: ['M0000100015']
          },
          rlb: {
            loading: false,
            chartCode: 'chartXlylRlb',
            chartName: '入料泵运行状态',
            codes: ['M0000100151', 'M0000100153', 'M0000100155', 'M0000100157', 'M0000100159']
          },
          gbj: {
            loading: false,
            chartCode: 'chartXlylGbj',
            chartName: '刮板机运行状态',
            codes: ['M0000100171', 'M0000100173', 'M0000100175', 'M0000100177', 'M0000100179']
          }
        }
      }
    },
    mounted() {
      this.init()
      this.searchDataQc307()
    },
    methods: {
      init() {
        this.getCard(this.qcfx307.anyData)
        this.getCard(this.qcfx308.anyData)
        this.getCard(this.xlfx3318.anyData)
        this.getCard(this.xlfx3319.anyData)
        this.getCard(this.qcns.anyData)
        this.getCard(this.xlns.anyData)
        this.getCard(this.xlyl.anyData)
      },
      getCard(anyData) {
        this.resetFields(anyData)
        this.$http.get(`/iailab-ntt-model/any/proc-card/code/${anyData.code}`).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          anyData.anyTime = res.data.anyTime
          anyData.alarmInfo = res.data.alarmInfo
        }).catch(() => {
        })
      },
      searchDataQc307() {
        this.getChart(this.qcfx307.dataForm, this.qcfx307.hjt)
        this.getChart(this.qcfx307.dataForm, this.qcfx307.xjt)
        this.getChart(this.qcfx307.dataForm, this.qcfx307.mnt)
        this.getChart(this.qcfx307.dataForm, this.qcfx307.cxw)
        this.getChart(this.qcfx307.dataForm, this.qcfx307.hjmd)
        this.getChart(this.qcfx307.dataForm, this.qcfx307.flf)
        this.getChart(this.qcfx307.dataForm, this.qcfx307.jsf)
        this.getChart(this.qcfx307.dataForm, this.qcfx307.hf)
      },
      searchDataQc308() {
        this.getChart(this.qcfx308.dataForm, this.qcfx308.hjt)
        this.getChart(this.qcfx308.dataForm, this.qcfx308.xjt)
        this.getChart(this.qcfx308.dataForm, this.qcfx308.mnt)
        this.getChart(this.qcfx308.dataForm, this.qcfx308.cxw)
        this.getChart(this.qcfx308.dataForm, this.qcfx308.hjmd)
        this.getChart(this.qcfx308.dataForm, this.qcfx308.flf)
        this.getChart(this.qcfx308.dataForm, this.qcfx308.jsf)
        this.getChart(this.qcfx308.dataForm, this.qcfx308.hf)
      },
      searchDataXlfx3318() {
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.hlt)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.hjt)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.xjt)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.mnt)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.xlqyl)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.cxw)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.hjmd)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.flf)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.psb)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.jjf)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.jsf)
        this.getChart(this.xlfx3318.dataForm, this.xlfx3318.hf)
      },
      searchDataXlfx3319() {
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.hlt)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.hjt)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.xjt)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.mnt)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.xlqyl)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.cxw)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.hjmd)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.flf)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.psb)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.jjf)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.jsf)
        this.getChart(this.xlfx3319.dataForm, this.xlfx3319.hf)
      },
      searchDataQcns() {
        this.getChart(this.qcns.dataForm, this.qcns.rlnd)
        this.getChart(this.qcns.dataForm, this.qcns.rlld)
        this.getChart(this.qcns.dataForm, this.qcns.jyll)
        this.getChart(this.qcns.dataForm, this.qcns.sczd)
        this.getChart(this.qcns.dataForm, this.qcns.clnd)
        this.getChart(this.qcns.dataForm, this.qcns.wnhd)
      },
      searchDataXlns() {
        this.getChart(this.xlns.dataForm, this.xlns.rlnd)
        this.getChart(this.xlns.dataForm, this.xlns.rlld)
        this.getChart(this.xlns.dataForm, this.xlns.jyll)
        this.getChart(this.xlns.dataForm, this.xlns.sczd)
        this.getChart(this.xlns.dataForm, this.xlns.clnd)
        this.getChart(this.xlns.dataForm, this.xlns.wnhd)
      },
      searchDataXlyl() {
        this.getChart(this.xlyl.dataForm, this.xlyl.rlc)
        this.getChart(this.xlyl.dataForm, this.xlyl.pdc)
        this.getChart(this.xlyl.dataForm, this.xlyl.rlb)
        this.getChart(this.xlyl.dataForm, this.xlyl.gbj)
      },
      getChart(dataForm, chartParam) {
        let that = this
        chartParam.loading = true
        this.$http['post'](`/iailab-ntt-data/api/data/point/chart`, {
          codes: chartParam.codes,
          startDate: dataForm.startDate,
          endDate: dataForm.endDate,
        }).then(({data: res}) => {
          chartParam.loading = false
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          let myChart = this.$echarts.init(document.getElementById(chartParam.chartCode));
          let seriesData = []
          if (res.data.series) {
            res.data.series.forEach(function (item, index) {
              seriesData.push(
                {
                  name: item.name,
                  type: 'line',
                  smooth: true,
                  showSymbol: false,
                  data: item.data
                }
              )
            })
            let option = {
              title: {
                text: chartParam.chartName
              },
              tooltip: {
                trigger: 'axis'
              },
              legend: {
                data: res.data.legend,
              },
              grid: {
                top: '20%',
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
              },
              xAxis: {
                type: 'category',
                boundaryGap: false,
                data: res.data.categories,
              },
              yAxis: {
                type: 'value',
                position: 'left',
                offset: 0,
                name: '',
                splitLine: {
                  show: false
                },
                axisLine: {
                  show: true,
                  onZero: false
                },
                axisTick: {show: true},
                axisLabel: {
                  formatter: '{value}'
                }
              },
              series: seriesData
            }
            if (option && typeof option === "object") {
              myChart.setOption(option);
            }
          }
        })
      },
      handleClick(tab, event) {
        let that = this
        if ('tab1' === tab.name) {
          setTimeout(function () {
            that.searchDataQc307()
            that.getCard(that.qcfx307.anyData)
          }, 500)
        } else if ('tab2' === tab.name) {
          setTimeout(function () {
            that.searchDataQc308()
            that.getCard(that.qcfx308.anyData)
          }, 500)
        } else if ('tab3' === tab.name) {
          setTimeout(function () {
            that.searchDataXlfx3318()
            that.getCard(that.xlfx3318.anyData)
          }, 500)
        } else if ('tab4' === tab.name) {
          setTimeout(function () {
            that.searchDataXlfx3319()
            that.getCard(that.xlfx3319.anyData)
          }, 500)
        } else if ('tab5' === tab.name) {
          setTimeout(function () {
            that.searchDataQcns()
            that.getCard(that.qcns.anyData)
          }, 500)
        } else if ('tab6' === tab.name) {
          setTimeout(function () {
            that.searchDataXlns()
            that.getCard(that.xlns.anyData)
          }, 500)
        } else if ('tab7' === tab.name) {
          setTimeout(function () {
            that.searchDataXlyl()
            that.getCard(that.xlyl.anyData)
          }, 500)
        }
      },
      resetFields (obj) {
        for (let key in obj) {
          if (key === 'id' || key === 'code') {
            continue
          }
          if (obj[key] instanceof Array) {
            obj[key] = []
          } else if (obj[key] instanceof Object) {
            this.resetFields(obj[key])
          } else {
            obj[key] = ''
          }
        }
      }
    }
  }
</script>
<style scoped>
  .chart-cont {
    height: 240px;
    width: 100%;
    padding: 0 10px 0 10px;
  }
  .chart-line {
    width: 95%;
    height: 100%;
  }
  .any-card {
    width: 90%;
    margin: 5px;
    padding: 10px;
    height: calc(calc(100vh - 48px - 38px - 35px - 110px));
  }
  .scrollable-container {
    overflow: auto;
    width: 100%;
    height: calc(calc(100vh - 48px - 38px - 35px - 160px));
  }
  .border-down {
    border: 1px solid #e2e4e9;
  }
</style>
src/views/modules/analysis/prod-index-evaluate-bak.vue
对比新文件
@@ -0,0 +1,183 @@
<template>
  <el-card shadow="never" class="aui-card--fill">
    <el-form
      :inline="true"
      :model="dataForm"
      @keyup.enter.native="getDataList()"
    >
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="原煤" name="yuanmei">
      </el-tab-pane>
      <el-tab-pane label="洗选" name="xixuan">
      </el-tab-pane>
      <el-tab-pane label="仓储" name="cangchu">
      </el-tab-pane>
    </el-tabs>
      <el-form-item>
        <dict-select-tag
          v-model="dataForm.orderType"
          placeholder="生产指标"
          dictCode="order-type"
          :clearable="true"
        />
      </el-form-item>
      <el-form-item>
        <el-date-picker
          v-model="dataForm.startTime"
          type="datetime"
          placeholder="选择开始时间"
          value-format="yyyy-MM-dd HH:mm"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-date-picker
          v-model="dataForm.endTime"
          type="datetime"
          placeholder="选择结束时间"
          value-format="yyyy-MM-dd HH:mm"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button @click="getDataList()">{{ $t("query") }}</el-button>
      </el-form-item>
      <el-form-item>
        <el-button @click="exportExcel()">导出</el-button>
      </el-form-item>
    </el-form>
    <el-table
      ref="table"
      v-loading="dataListLoading"
      :data="dataList"
      border
      style="width: 100%"
      >``
      <el-table-column
        type="index"
        header-align="center"
        align="center"
        width="50"
        label="序号"
      ></el-table-column>
      <el-table-column
        prop="date"
        header-align="center"
        align="center"
        label="日期时间"
      ></el-table-column>
      <el-table-column
        prop="device"
        header-align="center"
        align="center"
        label="生产指标"
      ></el-table-column>
      <el-table-column
        prop="evaluate"
        header-align="center"
        align="center"
        label="评价等级"
      ></el-table-column>
    </el-table>
    <el-pagination
      :current-page="page"
      :page-sizes="[10, 20, 50, 100]"
      :page-size="limit"
      :total="total"
      layout="total, sizes, prev, pager, next, jumper"
      @size-change="pageSizeChangeHandle"
      @current-change="pageCurrentChangeHandle"
    >
    </el-pagination>
    <div style="width: 600px;height:400px;margin-left:auto;margin-right:auto ">
    <bar-line :option="chartOption"></bar-line>
    </div>
  </el-card>
</template>
<script>
import mixinViewModule from "@/mixins/view-module";
import DictSelectTag from "@/components/dict/dict-select-tag.vue";
import { exportByDom } from "@/utils/exportUtil";
import BarLine from "@/components/chart/bar-line.vue";
export default {
  mixins: [mixinViewModule],
  components: {
    BarLine,
    DictSelectTag,
  },
  data() {
    return {
      loading: false,
      mixinViewModuleOptions: {
        getDataListURL: "",
        getDataListIsPage: true,
      },
      chartOption: {},
      dataForm: {
        orderType: "",
        operation: "",
        startTime: "",
        endTime: "",
      },
    };
  },
  mounted() {
    this.getchartOption();
  },
  methods: {
    getchartOption(){
      this.chartOption={
          tooltip: {
            trigger: "axis"
          },
          legend: {},
          grid: {
            left: "3%",
            right: "4%",
            bottom: "3%",
            containLabel: true,
          },
          xAxis: {
            type: "value",
            boundaryGap: [0, 0.01],
            interval: 10,
            axisLabel: {
              formatter: function (value, index) {
                if (value === 60) {
                  return "合格";
                } else if (value === 70) {
                  return "良";
                } else if (value === 90) {
                  return "优";
                } else {
                  return "";
                }
              },
            },
          },
          yAxis: {
            type: "category",
            data: [
              "平均灰分",
              "平均热值",
              "平均水分",
              "平均硫分",
              "入洗率",
              "装车率",
            ],
          },
          series: [
            {
              type: "bar",
              data: [80, 70, 90, 40, 60, 100],
            },
          ]}
    },
    exportExcel() {
      let dom = this.$refs.table;
      exportByDom(dom, undefined, "生产指标评价");
    },
  },
};
</script>
src/views/modules/analysis/prod-index-evaluate.vue
对比新文件
@@ -0,0 +1,880 @@
<template>
  <div class="mod-prod-index-eval">
    <div class="index-eval-left">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span><i class="el-icon-data-analysis"></i> 生产指标评价</span>
        </div>
        <el-form :inline="true" :model="dataForm" style="margin-top: -10px;">
          <el-form-item>
            <el-radio-group v-model="dataForm.valueType" @change="handleChange()">
              <el-radio-button label="数量"></el-radio-button>
              <el-radio-button label="质量"></el-radio-button>
              <el-radio-button label="生产消耗"></el-radio-button>
              <el-radio-button label="过程控制"></el-radio-button>
              <el-radio-button label="管理"></el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item>
            <el-date-picker
                v-model="dataForm.startDate"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择开始时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-date-picker
                v-model="dataForm.endDate"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择结束时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button :loading="loading" @click="searchData()">{{ $t('query') }}</el-button>
          </el-form-item>
        </el-form>
        <div class="chart-boday">
          <bar-line :option="chartOption" style="height: 400px;"></bar-line>
        </div>
        <div class="pc-text">
          {{alarmInfo}}
        </div>
        <el-table
            v-loading="dataListLoading"
            :data="dataList"
            border
            @selection-change="dataListSelectionChangeHandle"
            @sort-change="dataListSortChangeHandle"
            style="width: 100%;">
          <el-table-column
              type="index"
              align="center"
              width="50"
              label="序号"
          >
          </el-table-column>
          <el-table-column
              prop="dateTime"
              header-align="center"
              align="center"
              label="日期时间"
              min-width="150">
          </el-table-column>
          <el-table-column
              prop="firstLevel"
              header-align="center"
              align="center"
              label="数量"
              min-width="50">
            <template slot-scope="scope">
              <span :class="getFenClass(JSON.parse(scope.row.firstLevel)[0][0])">
                {{Number(JSON.parse(scope.row.firstLevel)[0][0])}}
              </span>
            </template>
          </el-table-column>
          <el-table-column
              prop="firstLevel"
              header-align="center"
              align="center"
              label="质量"
              min-width="50">
            <template slot-scope="scope">
              <span :class="getFenClass(JSON.parse(scope.row.firstLevel)[0][1])">
                {{Number(JSON.parse(scope.row.firstLevel)[0][1])}}
              </span>
            </template>
          </el-table-column>
          <el-table-column
              prop="firstLevel"
              header-align="center"
              align="center"
              label="生产消耗"
              min-width="50">
            <template slot-scope="scope">
              <span :class="getFenClass(JSON.parse(scope.row.firstLevel)[0][2])">
                {{Number(JSON.parse(scope.row.firstLevel)[0][2])}}
              </span>
            </template>
          </el-table-column>
          <el-table-column
              prop="firstLevel"
              header-align="center"
              align="center"
              label="过程控制"
              min-width="50">
            <template slot-scope="scope">
              <span :class="getFenClass(JSON.parse(scope.row.firstLevel)[0][3])">
                {{Number(JSON.parse(scope.row.firstLevel)[0][3])}}
              </span>
            </template>
          </el-table-column>
          <el-table-column
              prop="firstLevel"
              header-align="center"
              align="center"
              label="管理"
              min-width="50">
            <template slot-scope="scope">
              <span :class="getFenClass(JSON.parse(scope.row.firstLevel)[0][4])">
                {{Number(JSON.parse(scope.row.firstLevel)[0][4])}}
              </span>
            </template>
          </el-table-column>
          <el-table-column
              prop="zongLevel"
              header-align="center"
              align="center"
              label="总分"
              min-width="50">
            <template slot-scope="scope">
              {{Number(JSON.parse(scope.row.zongLevel)[0][0])}}
            </template>
          </el-table-column>
          <el-table-column
              prop="zongLevel"
              header-align="center"
              align="left"
              label="总评价"
              min-width="300">
            <template slot-scope="scope">
              {{JSON.parse(scope.row.zongLevel)[1][0] || ''}}
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
            :current-page="page"
            :page-sizes="[5, 10, 20]"
            :page-size="limit"
            :total="total"
            layout="total, sizes, prev, pager, next, jumper"
            @size-change="pageSizeChangeHandle"
            @current-change="pageCurrentChangeHandle">
        </el-pagination>
      </el-card>
    </div>
    <div class="index-eval-right">
      <el-card class="box-card" style="padding: 0px;">
        <div slot="header" class="clearfix">
          <span><i class="el-icon-medal"></i> 评分</span>
        </div>
        <div class="today-pf">
          <div class="today-pf-title">
            <div class="today-pf-title-text">
              <p>今日评分</p>
              <p>{{todayDate}}</p>
            </div>
            <div class="today-pf-title-value">
              {{allEvaluationToday.zong_level[0][0] || 0}}
            </div>
          </div>
          <div class="today-pf-content">
            <div class="today-pf-content-title">
              <div><i class="el-icon-chat-round" style="font-size: 20px;"></i></div>
              <div>今日评价</div>
            </div>
            <div class="today-pf-content-value">
              <span>{{allEvaluationToday.zong_level[1][0] || ''}}</span>
            </div>
          </div>
        </div>
        <el-divider/>
        <div class="yesterday-pf">
          <div class="his-pf-content-item-title">
            <div class="his-pf-content-item-title-text">昨日评分</div>
            <div class="his-pf-content-item-title-value">{{allEvaluationYesterday.zong_level[0][0] || 0}}</div>
          </div>
          <div class="today-pf-content">
            <div class="today-pf-content-value" style="width: 100%;">
              <span>{{allEvaluationYesterday.zong_level[1][0] || ''}}</span>
            </div>
          </div>
        </div>
        <div class="his-pf">
          <div class="his-pf-title">
            <span>评价历史</span>
            <!--            <span>-->
            <!--              <el-button type="text" style="float: right; margin-top: -15px">查看全部</el-button>-->
            <!--            </span>-->
            <el-divider/>
          </div>
          <div class="his-pf-content">
            <div class="his-pf-content-item" v-for="(item, index) in logDate">
              <div class="his-pf-content-item-title">
                <div class="his-pf-content-item-title-text">{{item[0]}}</div>
                <div class="his-pf-content-item-title-value">{{item[1]}}</div>
              </div>
              <div class="his-pf-content-item-content">
                <span>{{item[2]}}</span>
              </div>
            </div>
          </div>
        </div>
      </el-card>
    </div>
  </div>
</template>
<script>
  import BarLine from "@/components/chart/bar-line.vue";
  import {getNowDate, getBeforDate} from '@/utils/dateUtils'
  import {stringToJSON} from '@/utils/jsonUtils'
  import mixinViewModule from '@/mixins/view-module'
  export default {
    mixins: [mixinViewModule],
    data() {
      return {
        mixinViewModuleOptions: {
          getDataListURL: '/iailab-ntt-model/any/evaluation/page',
          getDataListIsPage: true,
          deleteURL: '/iailab-ntt-model/any/evaluation',
          deleteIsBatch: true
        },
        loading: false,
        dataForm: {
          modelId: 'c8c0d7fb-a17d-4813-baf2-e4f714369b8d',
          date: '',
          startDate: '',
          endDate: '',
          valueType: '数量',
        },
        todayDate: '',
        allEvaluationToday: {
          runTime: '',
          zong_level: [[], []],
          first_level: [[], [], [], []],
          guan_li_fen: [[], []],
          guo_cheng_fen: [[], []],
          zhi_liang_fen: [[], []],
          shu_liang_fen: [[], []]
        },
        yesterdayDate: '',
        allEvaluationYesterday: {
          runTime: '',
          zong_level: [[], []]
        },
        logDate: [],
        chartOption: {},
        chartData: {
          xData: [],
          zongPf: [],
          sl_xx: [],
          sl_zq: [],
          zl_xxk_hf: [],
          zl_xxk_sf: [],
          zl_xxk_rz: [],
          zl_xzk_hf: [],
          zl_xzk_sf: [],
          zl_xzk_rz: [],
          zl_hm_hf: [],
          zl_hm_sf: [],
          zl_hm_rz: [],
          scxh_jh: [],
          scxh_yh: [],
          scxh_dh: [],
          scxh_sh: [],
          gckz_kmhf: [],
          gckz_mmhf: [],
          gckz_1FJ: [],
          gckz_2FJ: [],
          gckz_401DL: [],
          gckz_402DL: [],
          gckz_501DL: [],
          gckz_HHM_RZ: [],
          gckz_HHM_SF: [],
          gl_jxl: [],
          gl_kjl: [],
          gl_kql: [],
        },
        series: [],
        legend: [],
        alarm: {
          sl: {
            fen: 0,
            isAlarm: false,
            alarmMsg: '',
            adjust: ''
          },
          zl: {
            fen: 0,
            isAlarm: false,
            alarmMsg: '',
            adjust: ''
          },
          xh: {
            fen: 0,
            isAlarm: false,
            alarmMsg: '',
            adjust: ''
          },
          kz: {
            fen: 0,
            isAlarm: false,
            alarmMsg: '',
            adjust: ''
          },
          gl: {
            fen: 0,
            isAlarm: false,
            alarmMsg: '',
            adjust: ''
          },
        },
        alarmInfo: ''
      };
    },
    components: {BarLine},
    mounted() {
      this.limit = 5
      this.todayDate = getNowDate()
      this.yesterdayDate = getBeforDate(1)
      this.init()
    },
    methods: {
      init() {
        let that = this
        this.getAllEvaluationToday()
        this.getAllEvaluationYesterday()
        this.getLog()
        this.getChartData()
      },
      searchData() {
        this.getChartData()
        this.getDataList()
      },
      getAllEvaluationToday() {
        this.$http.get(`/iailab-ntt-model/api/model/model-date-result`, {
          params: {
            modelCode: 'all_evaluation',
            resultTime: this.todayDate
          }
        }).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          if (res.data === null) {
            return
          }
          this.allEvaluationToday.runTime = res.data.runTime
          this.allEvaluationToday.zong_level = stringToJSON(res.data.zong_level)
          this.allEvaluationToday.first_level = stringToJSON(res.data.first_level)
          this.allEvaluationToday.guan_li_fen = stringToJSON(res.data.guan_li_fen)
          this.allEvaluationToday.guo_cheng_fen = stringToJSON(res.data.guo_cheng_fen)
          this.allEvaluationToday.zhi_liang_fen = stringToJSON(res.data.zhi_liang_fen)
          this.allEvaluationToday.shu_liang_fen = stringToJSON(res.data.shu_liang_fen)
          this.alarm.sl.fen = Number(this.allEvaluationToday.first_level[0][0] || 0).toFixed(0) || 0
          this.alarm.zl.fen = Number(this.allEvaluationToday.first_level[0][1] || 0).toFixed(0) || 0
          this.alarm.xh.fen = Number(this.allEvaluationToday.first_level[0][2] || 0).toFixed(0) || 0
          this.alarm.kz.fen = Number(this.allEvaluationToday.first_level[0][3] || 0).toFixed(0) || 0
          this.alarm.gl.fen = Number(this.allEvaluationToday.first_level[0][4] || 0).toFixed(0) || 0
          this.alarm.sl.isAlarm = this.allEvaluationToday.first_level[1][0] + '' === '1'
          this.alarm.zl.isAlarm = this.allEvaluationToday.first_level[1][1] + '' === '1'
          this.alarm.xh.isAlarm = this.allEvaluationToday.first_level[1][2] + '' === '1'
          this.alarm.kz.isAlarm = this.allEvaluationToday.first_level[1][3] + '' === '1'
          this.alarm.gl.isAlarm = this.allEvaluationToday.first_level[1][4] + '' === '1'
          this.alarm.sl.alarmMsg = this.allEvaluationToday.first_level[2][0]
          this.alarm.zl.alarmMsg = this.allEvaluationToday.first_level[2][1]
          this.alarm.xh.alarmMsg = this.allEvaluationToday.first_level[2][2]
          this.alarm.kz.alarmMsg = this.allEvaluationToday.first_level[2][3]
          this.alarm.gl.alarmMsg = this.allEvaluationToday.first_level[2][4]
          this.alarm.sl.adjust = this.allEvaluationToday.first_level[3][0]
          this.alarm.zl.adjust = this.allEvaluationToday.first_level[3][1]
          this.alarm.xh.adjust = this.allEvaluationToday.first_level[3][2]
          this.alarm.kz.adjust = this.allEvaluationToday.first_level[3][3]
          this.alarm.gl.adjust = this.allEvaluationToday.first_level[3][4]
        })
      },
      getAllEvaluationYesterday() {
        this.$http.get(`/iailab-ntt-model/api/model/model-date-result`, {
          params: {
            modelCode: 'all_evaluation',
            resultTime: this.yesterdayDate
          }
        }).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          if (res.data === null) {
            return
          }
          this.allEvaluationYesterday.runTime = res.data.runTime
          this.allEvaluationYesterday.zong_level = stringToJSON(res.data.zong_level)
        })
      },
      getLog() {
        let that = this
        this.$http.get(`/iailab-ntt-model/api/model/model-result/list`, {
          params: {
            modelCode: 'all_evaluation',
            lastHour: 24 * 4,
            isAsc: false
          }
        }).then(({data: res}) => {
          res.data.forEach(function (item) {
            that.logDate.push([
              item.resultTime,
              Number(stringToJSON(item.zong_level)[0][0]).toFixed(1),
              stringToJSON(item.zong_level)[1][0]])
          })
        })
      },
      getChartData() {
        let that = this
        this.loading = true
        this.$http.get(`/iailab-ntt-model/api/model/model-result/list`, {
          params: {
            modelCode: 'all_evaluation',
            lastHour: 24 * 7,
            isAsc: true,
            startDate: this.dataForm.startDate,
            endDate: this.dataForm.endDate,
          }
        }).then(({data: res}) => {
          this.loading = false
          this.resetFields(this.chartData)
          res.data.forEach(function (item) {
            this.chartData.xData.push(item.resultTime.toString().substr(0, 10))
            this.chartData.zongPf.push(stringToJSON(item.zong_level)[0][0])
            let shu_liang_fen = stringToJSON(item.shu_liang_fen)
            this.chartData.sl_xx.push(shu_liang_fen[0][0])
            this.chartData.sl_zq.push(shu_liang_fen[0][1])
            let zhi_liang_fen = stringToJSON(item.zhi_liang_fen)
            this.chartData.zl_xxk_hf.push(zhi_liang_fen[0][0])
            this.chartData.zl_xxk_sf.push(zhi_liang_fen[0][1])
            this.chartData.zl_xxk_rz.push(zhi_liang_fen[0][2])
            this.chartData.zl_xzk_hf.push(zhi_liang_fen[0][3])
            this.chartData.zl_xzk_sf.push(zhi_liang_fen[0][4])
            this.chartData.zl_xzk_rz.push(zhi_liang_fen[0][5])
            this.chartData.zl_hm_hf.push(zhi_liang_fen[0][6])
            this.chartData.zl_hm_sf.push(zhi_liang_fen[0][7])
            this.chartData.zl_hm_rz.push(zhi_liang_fen[0][8])
            let sheng_chan_fen = stringToJSON(item.sheng_chan_fen)
            this.chartData.scxh_jh.push(sheng_chan_fen[0][0])
            this.chartData.scxh_yh.push(sheng_chan_fen[0][1])
            this.chartData.scxh_dh.push(sheng_chan_fen[0][2])
            this.chartData.scxh_sh.push(sheng_chan_fen[0][3])
            let guo_cheng_fen = stringToJSON(item.guo_cheng_fen)
            this.chartData.gckz_kmhf.push(guo_cheng_fen[0][0])
            this.chartData.gckz_mmhf.push(guo_cheng_fen[0][1])
            this.chartData.gckz_1FJ.push(guo_cheng_fen[0][2])
            this.chartData.gckz_2FJ.push(guo_cheng_fen[0][3])
            this.chartData.gckz_401DL.push(guo_cheng_fen[0][4])
            this.chartData.gckz_402DL.push(guo_cheng_fen[0][5])
            this.chartData.gckz_501DL.push(guo_cheng_fen[0][6])
            this.chartData.gckz_HHM_RZ.push(guo_cheng_fen[0][7])
            let guan_li_fen = stringToJSON(item.guan_li_fen)
            this.chartData.gl_jxl.push(guan_li_fen[0][0])
            this.chartData.gl_kjl.push(guan_li_fen[0][1])
            this.chartData.gl_kql.push(guan_li_fen[0][2])
          }, this)
          that.handleChange();
        })
      },
      resetFields (obj) {
        for (let key in obj) {
          if (obj[key] instanceof Array) {
            obj[key] = []
          } else if (obj[key] instanceof Object) {
            this.resetFields(obj[key])
          } else {
            obj[key] = ''
          }
        }
      },
      handleChange() {
        let that = this
        if (this.dataForm.valueType === "数量") {
          this.series = [
            {
              name: "原煤入洗达成率",
              type: 'bar',
              data: that.chartData.sl_xx,
            },
            {
              name: "栈桥运输达成率",
              type: 'bar',
              data: that.chartData.sl_zq,
            }
          ]
          this.legend = ['原煤入洗达成率', '栈桥运输达成率']
          this.getChartOption("数量指标评分");
          this.alarmInfo = `今日得分:${this.alarm.sl.fen}。${this.alarm.sl.alarmMsg}。${this.alarm.sl.adjust}`
        } else if (this.dataForm.valueType === "质量") {
          this.series = [
            {
              name: "洗小块灰分",
              type: 'bar',
              data: that.chartData.zl_xxk_hf,
            },
            {
              name: "洗小块水分",
              type: 'bar',
              data: that.chartData.zl_xxk_sf,
            },
            {
              name: "洗小块热值",
              type: 'bar',
              data: that.chartData.zl_xxk_rz,
            },
            {
              name: "洗中块灰分",
              type: 'bar',
              data: that.chartData.zl_xzk_hf,
            },
            {
              name: "洗中块水分",
              type: 'bar',
              data: that.chartData.zl_xzk_sf,
            },
            {
              name: "洗中块热值",
              type: 'bar',
              data: that.chartData.zl_xzk_rz,
            },
            {
              name: "混煤灰分",
              type: 'bar',
              data: that.chartData.zl_hm_hf,
            },
            {
              name: "混煤水分",
              type: 'bar',
              data: that.chartData.zl_hm_sf,
            },
            {
              name: "混煤热值",
              type: 'bar',
              data: that.chartData.zl_hm_rz,
            }
          ]
          this.legend = ['洗小块灰分', '洗小块水分', "洗小块热值", '洗中块灰分', '洗中块水分', "洗中块热值", '混煤灰分', '混煤水分', "混煤热值"]
          this.getChartOption("质量指标评分");
          this.alarmInfo = `今日得分:${this.alarm.zl.fen}。${this.alarm.zl.alarmMsg}。${this.alarm.zl.adjust}`
        } else if (this.dataForm.valueType === "生产消耗") {
          this.series = [
            {
              name: "介耗指标评分",
              type: 'bar',
              data: that.chartData.scxh_jh,
            },
            {
              name: "药耗指标评分",
              type: 'bar',
              data: that.chartData.scxh_yh,
            },
            {
              name: "电耗指标评分",
              type: 'bar',
              data: that.chartData.scxh_dh,
            },
            {
              name: "水耗指标评分",
              type: 'bar',
              data: that.chartData.scxh_sh,
            }
          ]
          this.legend = ['介耗指标评分', '药耗指标评分', "电耗指标评分", "水耗指标评分"]
          this.getChartOption("生产消耗指标评分");
          this.alarmInfo = `今日得分:${this.alarm.xh.fen}。${this.alarm.xh.alarmMsg}。${this.alarm.xh.adjust}`
        } else if (this.dataForm.valueType === "过程控制") {
          this.series = [
            {
              name: "块煤灰分",
              type: 'bar',
              data: that.chartData.gckz_kmhf,
            },
            {
              name: "末煤灰分",
              type: 'bar',
              data: that.chartData.gckz_mmhf,
            },
            {
              name: "1#低压风机",
              type: 'bar',
              data: that.chartData.gckz_1FJ,
            },
            {
              name: "2#低压风机",
              type: 'bar',
              data: that.chartData.gckz_2FJ,
            },
            {
              name: "401底流浓度",
              type: 'bar',
              data: that.chartData.gckz_401DL,
            },
            {
              name: "402底流浓度",
              type: 'bar',
              data: that.chartData.gckz_402DL,
            },
            {
              name: "501底流浓度",
              type: 'bar',
              data: that.chartData.gckz_501DL,
            },
            {
              name: "配煤混合煤热值",
              type: 'bar',
              data: that.chartData.gckz_HHM_RZ,
            }
          ]
          this.legend = ['块煤灰分', '末煤灰分', "1#低压风机", "2#低压风机", "401底流浓度", "402底流浓度", "501底流浓度", "配煤混合煤热值"]
          this.getChartOption("过程控制指标评分");
          this.alarmInfo = `今日得分:${this.alarm.kz.fen}。${this.alarm.kz.alarmMsg}。${this.alarm.kz.adjust}`
        } else if (this.dataForm.valueType === "管理") {
          this.series = [
            {
              name: "检修率",
              type: 'bar',
              data: that.chartData.gl_jxl,
            },
            {
              name: "生产运行评价",
              type: 'bar',
              data: that.chartData.gl_kjl,
            },
            {
              name: "考勤率",
              type: 'bar',
              data: that.chartData.gl_kql,
            }
          ]
          this.legend = ['检修率', '生产运行评价', "考勤率"]
          this.getChartOption("管理指标评分");
          this.alarmInfo = `今日得分:${this.alarm.gl.fen}。${this.alarm.gl.alarmMsg}。${this.alarm.gl.adjust}`
        }
      },
      getChartOption(titleText) {
        this.chartOption = {
          title: {
            text: titleText,
          },
          tooltip: {
            trigger: "axis"
          },
          legend: {
            data: this.legend,
            right: '10%'
          },
          xAxis: {
            type: "category",
            data: this.chartData.xData,
          },
          yAxis: {
            type: 'value',
            min: 0,//最小
            max: 100,//最大
          },
          series: this.series
        };
      },
      getFenClass(fen) {
        if (Number(fen) >= 60) {
          return 'fen-nor';
        } else {
          return 'fen-low';
        }
      }
    },
  };
</script>
<style scoped>
  .fen-low {
    color: #F45354;
    font-weight: 600;
  }
  .fen-nor {
    color: #00c2ff;
    font-weight: 600;
  }
  .his-pf-content-item-title-value {
    width: 30%;
    font-weight: 400;
    font-size: 20px;
    color: #00C2FF;
    text-align: center;
    margin-top: -5px;
  }
  .his-pf-content-item-title-text {
    width: 70%;
  }
  .his-pf-content-item-content {
    width: 100%;
    height: 50px;
    background: #F7F8FA;
    border-radius: 4px 4px 4px 4px;
    text-align: left;
    padding: 2px;
    margin-top: -5px;
  }
  .his-pf-content-item-title {
    width: 100%;
    height: 30px;
    display: flex;
    flex-direction: row;
  }
  .his-pf-content-item {
    width: 100%;
    height: 80px;
  }
  .his-pf-content {
    width: 100%;
    height: 100%;
  }
  .his-pf {
    width: 100%;
    height: 300px;
    padding: 10px 0 10px 0;
    margin-left: -5px;
    margin-right: -5px;
    margin-top: 20px;
  }
  .yesterday-pf-title-value {
    width: 30%;
    font-weight: 400;
    font-size: 20px;
    color: #00C2FF;
    text-align: center;
  }
  .yesterday-pf-title-text > p {
    margin-top: 0;
    margin-bottom: 5px;
  }
  .today-pf-title-text {
    width: 70%;
  }
  .yesterday-pf-title {
    width: 100%;
    height: 40px;
    display: flex;
    flex-direction: row;
    padding: 10px 0 10px 0;
    margin-left: -5px;
    margin-right: -5px;
  }
  .yesterday-pf {
    width: 100%;
    height: 100px;
  }
  .today-pf-content-value {
    width: 70%;
    background: #F7F8FA;
    border-radius: 4px 4px 4px 4px;
    text-align: left;
    padding: 2px;
  }
  .today-pf-content-title {
    width: 30%;
    padding: 5px 5px 5px 0;
    text-align: center;
    font-size: 12px;
  }
  .today-pf-content {
    height: 60px;
    width: 100%;
    display: flex;
    flex-direction: row;
    padding: 5px;
  }
  .today-pf-title-value {
    width: 50%;
    font-weight: 400;
    font-size: 36px;
    color: #4BCB11;
    text-align: center;
  }
  .today-pf-title-text > p {
    margin-top: 0;
    margin-bottom: 5px;
  }
  .today-pf-title-text {
    width: 50%;
  }
  .today-pf-title {
    width: 100%;
    height: 50px;
    display: flex;
    flex-direction: row;
    padding: 10px 0 10px 0;
    margin-left: -5px;
    margin-right: -5px;
  }
  .today-pf {
    width: 100%;
    height: 100px;
  }
  .box-card {
    width: 100%;
    height: 100%;
  }
  .index-eval-right {
    width: 25%;
    height: 100%;
  }
  .index-eval-left {
    width: 75%;
    height: 100%;
    padding-right: 10px;
  }
  .mod-prod-index-eval {
    width: 100%;
    height: calc(calc(100vh - 48px - 38px - 35px));
    display: flex;
    flex-direction: row;
  }
  .pc-text {
    height: 60px;
    width: 100%;
    display: flex;
    flex-direction: row;
    padding: 5px;
    background: #F7F8FA;
    font-size: 16px;
  }
</style>
src/views/modules/analysis/product-coal-trend-analysis.vue
对比新文件
@@ -0,0 +1,369 @@
<template>
  <el-card shadow="never" class="aui-card--fill" v-loading="loading">
    <div v-for="(data, index) in dataList" :key="index" class="Border">
      <el-card shadow="never" class="aui-card--fill" style="margin-top: 5px">
          <el-row type="flex" justify="space-around">
            <el-col :span="4" style="margin-top: 40px" class="Border_l">
              <el-row>
                <el-col :span="12">
                  <div style="width: 100%; text-align: left; font-size: 18px">
                    当前值
                  </div>
                  <div
                    style="
                      width: 100%;
                      height: 30px;
                      margin-top: 10px;
                      margin-bottom: 10px;
                      color: #000000;
                      font-size: 24px;
                    "
                  >
                    <span>{{ data.currentValue }}</span>
                    <span style="font-size: 14px">{{data.unit}}</span>
                  </div>
                </el-col>
                <el-col :span="12">
                  <div style="width: 100%; text-align: left; font-size: 18px">
                    分析长度
                  </div>
                  <div
                    style="
                      width: 100%;
                      height: 30px;
                      margin-top: 10px;
                      margin-bottom: 10px;
                      color: #000000;
                      font-size: 24px;
                    "
                  >
                    <span>{{ data.length }}</span
                    ><span style="font-size: 14px">天</span>
                  </div>
                </el-col>
              </el-row>
    <!--          <el-button type="default" @onclick="viewHistoryData(bfg1Data)">-->
    <!--          查看历史</el-button>-->
            </el-col>
            <el-col :span="19">
              <div>
                <div :id="data.chartCode" style="margin-top: 20px" class="ecbox"></div>
              </div>
            </el-col>
          </el-row>
              <el-row>
            <el-col :span="12" class="Border_down" align="left">
              <el-row
                type="flex"
                justify="center"
                align="middle"
                style="height: 5vh"
              >
                <el-col :span="5" style="padding-top:5vh">
                  <span style="font-size: 16px; font-weight: 600">
                    整体趋势{{data.trend}}
                    <i :class="data.iconClass"></i>
                  </span>
                </el-col>
                <el-col :span="5" style="padding-top:5vh">
                  <el-row style="font-size: 14px">
                    <span>平均值</span>
                  </el-row>
                  <el-row style="font-size: 14px">
                    <span>{{data.trendValue.mean_value}}</span>
                  </el-row>
                </el-col>
                <el-col :span="5" style="padding-top:5vh">
                  <el-row style="font-size: 14px">
                    <span>最大值</span>
                  </el-row>
                  <el-row style="font-size: 14px">
                    <span>{{data.trendValue.max_value}}</span>
                  </el-row>
                </el-col>
                <el-col :span="5" style="padding-top:5vh">
                  <el-row style="font-size: 14px">
                    <span>最小值</span>
                  </el-row>
                  <el-row style="font-size: 14px">
                    <span>{{data.trendValue.min_value}}</span>
                  </el-row>
                </el-col>
              </el-row>
            </el-col>
            <el-col :span="12" class="Border_down" align="left">
              <el-row style="margin-left: 2vh; margin-top: 1vh">
                <span style="font-size: 14px; font-weight: 600">调度建议</span>
              </el-row>
              <el-row>
                <el-col
                  :span="23"
                  class="Border_text"
                  style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                    style="
                      margin-left: 2vh;
                      font-size: 18px;
                      font-family: '楷体';
                      font-weight: 600;
                      color: red;
                    "
                    >{{data.dispatchSug}}</span>
                </el-col>
              </el-row>
            </el-col>
          </el-row>
      </el-card>
    </div>
  </el-card>
</template>
<script>
import * as echarts from "echarts";
import {getSeriesData} from '@/utils/mathUtils'
export default {
  data() {
    return {
      radio: '产率',
      loading: false,
      dataList:[],
      prepareDataList:{},
      page:"wash",
      bfg1Data: {
        alarmList: {},
      },
      chartsName:{
        'A010040':'混煤产量',
        'A010041':'洗小块产量',
        'A010042':'洗中块产量',
        'A010019':'混煤灰分',
        'A010043':'混煤水分',
        'A010044':'混煤硫分',
        'A010020':'混煤热值'
      },
      defaultDispatchSug:{
        'A010040;1':'建议近期多加关注洗选环节与混煤环节,防止问题累积',
        'A010040;2':'建议检查末煤洗选与小块煤洗选环节的设备情况,减少给煤机开启率',
        'A010040;-1':'建议近期多加关注洗选环节与混煤环节,防止问题累积',
        'A010040;-2':'建议检查末煤洗选与小块煤洗选环节的设备情况,增加给煤机开启率',
        'A010041;1':'建议近期多加关注浅槽洗选环节,防止问题累积',
        'A010041;2':'建议检查浅槽洗选环节的设备情况,减少洗小块产量',
        'A010041;-1':'建议近期多加关注浅槽洗选环节,防止问题累积',
        'A010041;-2':'建议检查浅槽洗选环节的设备情况,增加洗小块产量',
        'A010042;1':'建议近期多加关注浅槽洗选环节,防止问题累积',
        'A010042;2':'建议检查浅槽洗选环节的设备情况,减少洗中块产量',
        'A010042;-1':'建议近期多加关注浅槽洗选环节,防止问题累积',
        'A010042;-2':'建议检查浅槽洗选环节的设备情况,增加洗中块产量',
        'A010019;1':'建议近期多加关注混煤配比环节,防止问题累积',
        'A010019;2':'建议检查灰分传感器设备与混煤过程,同时注意外运混煤质量调整',
        'A010019;-1':'煤质变好,注意外运混煤质量调整',
        'A010019;-2':'建议检查灰分传感器设备与混煤过程,同时注意外运混煤质量调整',
        'A010043;1':'建议近期多加关注混煤水分情况,同时注意外运混煤质量调整',
        'A010043;2':'建议检查水分传感器设备与混煤过程,同时注意外运混煤质量调整',
        'A010043;-1':'建议近期多加关注混煤水分情况,同时注意外运混煤质量调整',
        'A010043;-2':'建议检查水分传感器设备与混煤过程,同时注意外运混煤质量调整',
        'A010044;1':'建议近期多加关注混煤配比环节,防止问题累积',
        'A010044;2':'建议检查硫分传感器设备与混煤过程,同时注意外运混煤质量调整',
        'A010044;-1':'煤质变好,注意外运混煤质量调整',
        'A010044;-2':'建议检查硫分传感器设备与混煤过程,同时注意外运混煤质量调整',
        'A010020;1':'煤质变好,注意外运混煤质量调整',
        'A010020;2':'建议检查热值传感器设备与混煤过程,同时注意外运混煤质量调整',
        'A010020;-1':'建议近期多加关注混煤配比环节,防止问题累积',
        'A010020;-2':'建议检查热值传感器设备与混煤过程,同时注意外运混煤质量调整',
      }
    };
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      window.addEventListener("resize", this.handleResize);
      Promise.all([
        this.getPageParamDataList()
      ]).then(() => {
        if (this.prepareDataList.length !== 0) {
          this.getDataList();
        }
      })
    },
    getPageParamDataList(){
      return this.$http.get(`/iailab-ntt-model/param/page/${this.page}`).then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.prepareDataList = res.data
      })
    },
    getDataList() {
      this.loading = true
      let that = this
      let params = []
      this.prepareDataList.forEach((data) => {
        params.push(data.chartCode)
      })
      this.$http.post(`/iailab-ntt-data/api/data/ind-item/values-trend`, params).then(({data: res}) => {
        this.loading = false
        if (res.code !== 0) {
          console.log(res.msg)
          return
        }
        this.prepareDataList.forEach((data) => {
          data.dataValue = res.data['values'][data.chartCode]
          //获取当前值数据,获取最后一个有值的数据
          for (let i = data.dataValue.length - 1; i >= 0; i--) {
            if (data.dataValue[i].dataValue) {
              data.currentValue = data.dataValue[i].dataValue
              break
            }
          }
          data.trendValue = res.data['trend'][data.chartCode]
          let slopeFlag = data.trendValue.slope_flag
          //判断整体趋势,根据趋势值修改趋势后面的图标,生成建议值
          let scopeValue = ''
          switch (slopeFlag) {
            case 1:
              data.trend = '上升'
              data.iconClass = 'el-icon-top'
              scopeValue = '略有上升趋势,'
              break
            case 2:
              data.trend = '上升'
              data.iconClass = 'el-icon-top'
              scopeValue = '上升趋势过大,'
              break
            case -1:
              data.trend = '下降'
              data.iconClass = 'el-icon-bottom'
              scopeValue = '略有下降趋势,'
              break
            case -2:
              data.trend = '下降'
              data.iconClass = 'el-icon-bottom'
              scopeValue = '下降趋势过大,'
              break
          }
          //生成调度建议
          let defaultSug = this.defaultDispatchSug[data.chartCode+';'+slopeFlag]
          //生成调度建议
          if(slopeFlag === 0 ){
            data.trend = '平稳'
            data.dispatchSug = '生产正常,暂无建议'
          }else {
            data.dispatchSug = this.chartsName[data.chartCode] + scopeValue + defaultSug
          }
          this.dataList.push(data)
          setTimeout(function () {
            that.getCharts(data);
          }, 1000)
        })
      })
    },
    // getCharts() {
    //   let that = this
    //     this.$http.get(`/iailab-ntt-model/analysis/raw/${this.page}`).then(({data: res}) => {
    //       if (res.code !== 0) {
    //         return this.$message.error(res.msg)
    //       }
    //       this.dataList=res.data
    //       this.dataList.forEach((data, index) => {
    //         setTimeout(function() {
    //           that.getLines(data,index);
    //         }, 1000)
    //         });
    //     }).catch(() => {
    //     })
    //   },
    getCharts(data) {
      let myChart = this.$echarts.init(document.getElementById(data.chartCode));
      let valueData = data.dataValue
      let chartData = []
      let xAxis = []
      valueData.forEach((item) =>{
        xAxis.push(item.dataTime)
        if (item.dataValue && item.dataValue >= 0) {
          chartData.push([item.dataTime, item.dataValue])
        }
      })
      let chartTitle = this.chartsName[data.chartCode]
      let trendS = getSeriesData(data.trendValue.slope, data.trendValue.bias, xAxis.length)
      var option = {
        title: {
          text: chartTitle,
        },
        tooltip: {
          trigger: "axis",
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: xAxis,
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            name: chartTitle,
            type: "line",
            smooth: true,
            stack: "Total",
            data: chartData,
          },
          {
            name: '趋势',
            data: trendS,
            type: 'line',
            smooth: true,
            showSymbol: false,
            color: '#FFAA5D'
          }
        ],
      };
      if (option && typeof option === "object") {
        myChart.setOption(option);
      }
    },
    handleResize() {
      this.dataList.forEach((data, index) => {
        var myChart = echarts.getInstanceByDom(
          document.getElementById("wash" + index)
        );
        myChart.resize();
      });
    },
  },
  beforeDestroy() {
    window.removeEventListener("resize", this.handleResize);
  },
};
</script>
<style scoped>
.ecbox {
  width: 100%;
  height: 30vh;
}
.Border {
  height: 42vh+40px;
}
.Border_l {
  height: 20vh;
}
.Border_down {
  border: 1px solid    #F2F3F5;
  height: 12vh;
}
.Border_text {
  background-color:     #F2F3F5;
  border: 1px solid    #F2F3F5;
  height: 7vh;
}
</style>
src/views/modules/analysis/product-comprehensive-analysis.vue
对比新文件
@@ -0,0 +1,579 @@
<template>
  <div>
    <el-card shadow="never" class="aui-card--fill" style="margin-top: 5px">
      <el-row>
        <el-col :span="5">
          <el-radio-group v-model="radio" size="small" @change="change()">
            <el-radio-button label="分选"></el-radio-button>
            <el-radio-button label="浓缩压滤"></el-radio-button>
            <el-radio-button label="鼓风"></el-radio-button>
            <el-radio-button label="外运"></el-radio-button>
          </el-radio-group>
        </el-col>
      </el-row>
    </el-card>
    <el-card shadow="never" class="aui-card--fill" v-loading="loading">
      <div v-for="(data, index) in dataList" :key="index" class="Border" >
        <el-card shadow="never" class="aui-card--fill" style="margin-top: 5px">
          <el-row type="flex" justify="space-around">
            <el-col :span="4" style="margin-top: 40px" class="Border_l">
              <el-row>
                <el-col :span="12">
                  <div style="width: 100%; text-align: left; font-size: 18px">
                    当前值
                  </div>
                  <div
                    style="
                      width: 100%;
                      height: 30px;
                      margin-top: 10px;
                      margin-bottom: 10px;
                      color: #000000;
                      font-size: 24px;
                    "
                  >
                    <span>{{ data.currentValue }}</span>
                    <span style="font-size: 14px">{{data.unit}}</span>
                  </div>
                </el-col>
                <el-col :span="12">
                  <div style="width: 100%; text-align: left; font-size: 18px">
                    分析长度
                  </div>
                  <div
                    style="
                      width: 100%;
                      height: 30px;
                      margin-top: 10px;
                      margin-bottom: 10px;
                      color: #000000;
                      font-size: 24px;
                    "
                  >
                    <span>{{ data.length }}</span
                    ><span style="font-size: 14px">天</span>
                  </div>
                </el-col>
              </el-row>
    <!--          <el-button type="default" @onclick="viewHistoryData(bfg1Data)"> -->
    <!--          查看历史</el-button>-->
            </el-col>
            <el-col :span="19">
              <div>
                <div :id="'raw' + index" style="margin-top: 20px" class="ecbox"></div>
              </div>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12" class="Border_down" align="left">
              <el-row
                type="flex"
                justify="center"
                align="middle"
                style="height: 5vh"
              >
                <el-col :span="5" style="padding-top:5vh">
                  <span style="font-size: 16px; font-weight: 600">
                    整体趋势{{data.trend}}
                    <i :class="data.iconClass"></i>
                  </span>
                </el-col>
                <el-col :span="5" style="padding-top:5vh">
                  <el-row style="font-size: 14px">
                    <span>平均值</span>
                  </el-row>
                  <el-row style="font-size: 14px">
                    <span>{{data.trendValue.mean_value}}</span>
                  </el-row>
                </el-col>
                <el-col :span="5" style="padding-top:5vh">
                  <el-row style="font-size: 14px">
                    <span>最大值</span>
                  </el-row>
                  <el-row style="font-size: 14px">
                    <span>{{data.trendValue.max_value}}</span>
                  </el-row>
                </el-col>
                <el-col :span="5" style="padding-top:5vh">
                  <el-row style="font-size: 14px">
                    <span>最小值</span>
                  </el-row>
                  <el-row style="font-size: 14px">
                    <span>{{data.trendValue.min_value}}</span>
                  </el-row>
                </el-col>
              </el-row>
            </el-col>
            <el-col :span="12" class="Border_down" align="left">
            <el-row style="margin-left: 2vh; margin-top: 1vh">
              <span style="font-size: 14px; font-weight: 600">调度建议</span>
            </el-row>
            <el-row>
                <el-col
                  :span="18"
                  class="Border_text"
                  style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                    style="
                      margin-left: 2vh;
                      font-size: 18px;
                      font-family: '楷体';
                      font-weight: 600;
                      color: red;
                    "
                    >{{data.overSlopeSug}}</span>
                </el-col>
                <el-col
                :span="5"
                class="Border_text"
                style="margin-top: 1vh; padding-top: 10px"
                ></el-col>
            </el-row>
            </el-col>
          </el-row>
        </el-card>
      </div>
    </el-card>
<!--    <el-card shadow="never" class="aui-card&#45;&#45;fill" v-loading="loading" >-->
<!--      <div v-for="(data, index) in dataList" :key="index" class="Border" >-->
<!--        <el-card shadow="never" class="aui-card&#45;&#45;fill" style="margin-top: 5px">-->
<!--          <el-row type="flex" justify="space-around">-->
<!--            <el-col :span="4" style="margin-top: 40px" class="Border_l">-->
<!--              <el-row>-->
<!--                <el-col :span="12">-->
<!--                  <div style="width: 100%; text-align: left; font-size: 18px">-->
<!--                    当前值-->
<!--                  </div>-->
<!--                  <div-->
<!--                          style="-->
<!--                  width: 100%;-->
<!--                  height: 30px;-->
<!--                  margin-top: 10px;-->
<!--                  margin-bottom: 10px;-->
<!--                  color: #000000;-->
<!--                  font-size: 24px;-->
<!--                "-->
<!--                  >-->
<!--                    <span>{{ data.currentValue }}</span>-->
<!--                    <span style="font-size: 14px">{{data.unit}}</span>-->
<!--                  </div>-->
<!--                </el-col>-->
<!--                <el-col :span="12">-->
<!--                  <div style="width: 100%; text-align: left; font-size: 18px">-->
<!--                    分析长度-->
<!--                  </div>-->
<!--                  <div-->
<!--                          style="-->
<!--                  width: 100%;-->
<!--                  height: 30px;-->
<!--                  margin-top: 10px;-->
<!--                  margin-bottom: 10px;-->
<!--                  color: #000000;-->
<!--                  font-size: 24px;-->
<!--                "-->
<!--                  >-->
<!--                <span>{{ data.length }}</span-->
<!--                ><span style="font-size: 14px">天</span>-->
<!--                  </div>-->
<!--                </el-col>-->
<!--              </el-row>-->
<!--              &lt;!&ndash;            <el-button type="default" @onclick="viewHistoryData(bfg1Data)">&ndash;&gt;-->
<!--              &lt;!&ndash;              查看历史</el-button>&ndash;&gt;-->
<!--            </el-col>-->
<!--            <el-col :span="19">-->
<!--              <div>-->
<!--                <div :id="'raw' + index" style="margin-top: 20px" class="ecbox"></div>-->
<!--              </div>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--          <el-row>-->
<!--            <el-col :span="12" class="Border_down" align="left">-->
<!--              <el-row-->
<!--                      type="flex"-->
<!--                      justify="center"-->
<!--                      align="middle"-->
<!--                      style="height: 5vh"-->
<!--              >-->
<!--                <el-col :span="5" style="padding-top:5vh">-->
<!--              <span style="font-size: 16px; font-weight: 600">-->
<!--                整体趋势下降-->
<!--                <i class="el-icon-bottom"></i>-->
<!--              </span>-->
<!--                </el-col>-->
<!--                <el-col :span="5" style="padding-top:5vh">-->
<!--                  <el-row style="font-size: 14px">-->
<!--                    <span>历史平均值</span>-->
<!--                  </el-row>-->
<!--                  <el-row style="font-size: 14px">-->
<!--                    <span>15.4%</span>-->
<!--                  </el-row>-->
<!--                </el-col>-->
<!--                <el-col :span="5" style="padding-top:5vh">-->
<!--                  <el-row style="font-size: 14px">-->
<!--                    <span>历史最大值</span>-->
<!--                  </el-row>-->
<!--                  <el-row style="font-size: 14px">-->
<!--                    <span>15.7%</span>-->
<!--                  </el-row>-->
<!--                </el-col>-->
<!--                <el-col :span="5" style="padding-top:5vh">-->
<!--                  <el-row style="font-size: 14px">-->
<!--                    <span>近期最大值</span>-->
<!--                  </el-row>-->
<!--                  <el-row style="font-size: 14px">-->
<!--                    <span>15.7%</span>-->
<!--                  </el-row>-->
<!--                </el-col>-->
<!--              </el-row>-->
<!--            </el-col>-->
<!--            <el-col :span="12" class="Border_down" align="left">-->
<!--              <el-row style="margin-left: 2vh; margin-top: 1vh">-->
<!--                <span style="font-size: 14px; font-weight: 600">调度建议</span>-->
<!--              </el-row>-->
<!--              <el-row>-->
<!--                <el-col-->
<!--                        :span="18"-->
<!--                        class="Border_text"-->
<!--                        style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"-->
<!--                ><span-->
<!--                        style="-->
<!--                  margin-left: 2vh;-->
<!--                  font-size: 18px;-->
<!--                  font-family: '楷体';-->
<!--                  font-weight: 600;-->
<!--                  color: red;-->
<!--                "-->
<!--                >暂无调度建议</span-->
<!--                ></el-col-->
<!--                >-->
<!--                <el-col-->
<!--                        :span="5"-->
<!--                        class="Border_text"-->
<!--                        style="margin-top: 1vh; padding-top: 10px"-->
<!--                >2024-03-24 8:54</el-col-->
<!--                >-->
<!--              </el-row>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--        </el-card>-->
<!--      </div>-->
<!--    </el-card>-->
  </div>
</template>
<script>
  import * as echarts from "echarts";
  import {getSeriesData} from '@/utils/mathUtils'
  export default {
    data() {
      return {
        page:"fx",
        radio: "分选",
        loading: false,
        bfg1Data: {
          alarmList: {},
        },
        dataList:[],
        chartsName:{},
        wyChartsName:{
          'A010060':'地销混煤',
          'A010061':'洗中块外运',
          'A010062':'洗小块外运',
          'A010063':'矸石外运',
          'A010064':'小块转载',
          'A010065':'火车外运吨数',
          'A010066':'火车外运列数'
        },
        fxChartsName:{},
        nsylChartsName:{},
        gfChartsName:{},
      };
    },
    mounted() {
      this.init()
    },
    methods: {
      init() {
        window.addEventListener("resize", this.handleResize);
        this.chartsName = this.wyChartsName
        this.getPointDataList()
      },
      change(){
        console.log(this.radio);
        this.loading = true
        if(this.radio=="分选"){
          this.chartsName = this.fxChartsName
          this.page="fx"
          this.getPointDataList()
        }else if(this.radio=="浓缩压滤"){
          this.chartsName = this.nsylChartsName
          this.page="nsyl"
          this.getPointDataList()
        }else if(this.radio=="鼓风"){
          this.chartsName = this.gfChartsName
          this.page="gf"
          this.getPointDataList()
        }else if(this.radio=="外运"){
          this.chartsName = this.wyChartsName
          this.page="wy"
          Promise.all([
            this.getPageParamDataList()
          ]).then(() => {
            if (this.prepareDataList.length !== 0) {
              this.getDataList();
            }
          })
        }
      },
      getPageParamDataList(){
        return this.$http.get(`/iailab-ntt-model/param/page/${this.page}`).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.prepareDataList = res.data
        })
      },
      getDataList() {
        this.loading = true
        let that = this
        let params = []
        this.prepareDataList.forEach((data) => {
          params.push(data.chartCode)
        })
        this.$http.post(`/iailab-ntt-data/api/data/ind-item/values-trend`, params).then(({data: res}) => {
          this.loading = false
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          this.dataList = []
          this.prepareDataList.forEach((data, index) => {
            data.dataValue = res.data['values'][data.chartCode]
            //获取当前值数据,获取最后一个有值的数据
            for (let i = data.dataValue.length - 1; i >= 0; i--) {
              if (data.dataValue[i].dataValue) {
                data.currentValue = data.dataValue[i].dataValue
                break
              }
            }
            data.trendValue = res.data['trend'][data.chartCode]
            let slopeFlag = data.trendValue.slope_flag
            //判断整体趋势,根据趋势值修改趋势后面的图标,生成建议值
            let scopeValue = ''
            switch (slopeFlag) {
              case 1:
                data.trend = '上升'
                data.iconClass = 'el-icon-top'
                scopeValue = '略大'
                break
              case 2:
                data.trend = '上升'
                data.iconClass = 'el-icon-top'
                scopeValue = '过大'
                break
              case -1:
                data.trend = '下降'
                data.iconClass = 'el-icon-bottom'
                scopeValue = '略小'
                break
              case -2:
                data.trend = '下降'
                data.iconClass = 'el-icon-bottom'
                scopeValue = '过小'
                break
            }
            //生成调度建议
            let xAxis = []
            data.dataValue.forEach((item) =>{
              xAxis.push(item.dataTime)
            })
            if(slopeFlag === 0 ){
              data.trend = '平稳'
              data.overSlopeSug = '暂无调度建议'
            }else {
              let startTime = xAxis[0]
              let endTime = xAxis[xAxis.length - 1]
              data.overSlopeSug = startTime + '到' + endTime + ',' + this.chartsName[data.chartCode] + '趋势' + data.trend + '幅度' + scopeValue + ',请及时关注'
            }
            data.chartName = this.chartsName[data.chartCode]
            this.dataList.push(data)
            setTimeout(function () {
              that.getCharts(data,index);
            }, 1000)
          })
        })
      },
      getPointDataList() {
        this.loading = true
        let that = this
        this.$http.get(`/iailab-ntt-model/param/page/point/${this.page}`).then(({data: res}) => {
          this.loading = false
          if (res.code !== 0) {
            console.log(res.msg)
            return
          }
          this.dataList = res.data
          res.data.forEach((data,index) => {
            data.chartCode = data.pointNo
            //获取当前值数据,获取最后一个有值的数据
            for (let i = data.dataValue.length - 1; i >= 0; i--) {
              if (data.dataValue[i].dataValue) {
                data.currentValue = data.dataValue[i].dataValue
                break
              }
            }
            setTimeout(function () {
              that.getCharts(data,index);
            }, 1000)
          })
        })
      },
      getCharts(data,index) {
        let a = document.getElementById('raw' + index)
        let myChart = this.$echarts.init(document.getElementById('raw' + index))
        let valueData = data.dataValue
        let chartData = []
        let xAxis = []
        valueData.forEach((item) =>{
          xAxis.push(item.dataTime)
          if (item.dataValue && item.dataValue >= 0) {
            chartData.push([item.dataTime, item.dataValue])
          }
        })
        let trendDate = getSeriesData(data.trendValue.slope, data.trendValue.bias, xAxis.length)
        var option = {
          title: {
            text: data.chartName,
          },
          tooltip: {
            trigger: "axis",
          },
          grid: {
            left: "3%",
            right: "4%",
            bottom: "3%",
            containLabel: true,
          },
          xAxis: {
            type: "category",
            boundaryGap: false,
            data: xAxis,
          },
          yAxis: {
            type: "value",
          },
          series: [
            {
              name: data.chartName,
              type: "line",
              smooth: true,
              stack: "Total",
              data: chartData,
            },
            {
              name: '趋势',
              data: trendDate,
              type: 'line',
              smooth: true,
              showSymbol: false,
              color: '#FFAA5D'
            }
          ],
        };
        if (option && typeof option === "object") {
          myChart.setOption(option);
        }
        return option;
      },
      // getCharts() {
      //   this.loading = true
      //   let that = this
      //   this.$http.get(`/iailab-ntt-model/analysis/raw/${this.page}`).then(({data: res}) => {
      //     this.loading = false
      //     if (res.code !== 0) {
      //       return this.$message.error(res.msg)
      //     }
      //     this.dataList=res.data
      //     this.dataList.forEach((data, index) => {
      //       setTimeout(function() {
      //         that.getLines(data,index);
      //       }, 1000)
      //     });
      //   }).catch(() => {})
      // },
      // getLines(data,id) {
      //   let myChart = this.$echarts.init(
      //           document.getElementById("raw" + id)
      //   );
      //   var option = {
      //     title: {
      //       text: data.barLineDTO.valueName,
      //     },
      //     tooltip: {
      //       trigger: "axis",
      //     },
      //     grid: {
      //       left: "3%",
      //       right: "4%",
      //       bottom: "3%",
      //       containLabel: true,
      //     },
      //     xAxis: {
      //       type: "category",
      //       boundaryGap: false,
      //       data: data.barLineDTO.categories,
      //     },
      //     yAxis: {
      //       type: "value",
      //     },
      //     series: [
      //       {
      //         name: data.barLineDTO.series[0].name,
      //         type: "line",
      //         smooth: true,
      //         stack: "Total",
      //         data: data.barLineDTO.series[0].data,
      //       },
      //     ],
      //   };
      //   if (option && typeof option === "object") {
      //     myChart.setOption(option);
      //   }
      // },
      handleResize() {
        this.dataList.forEach((data, index) => {
          var myChart = echarts.getInstanceByDom(
                  document.getElementById(data.chartCode)
          );
          myChart.resize();
        });
      },
    },
    beforeDestroy() {
      window.removeEventListener("resize", this.handleResize);
    },
  };
</script>
<style scoped>
  .ecbox {
    width: 100%;
    height: 30vh;
  }
  .Border {
    height: 42vh+40px;
  }
  .Border_l {
    height: 20vh;
  }
  .Border_down {
    border: 1px solid    #F2F3F5;
    height: 12vh;
  }
  .Border_text {
    background-color:     #F2F3F5;
    border: 1px solid    #F2F3F5;
    height: 7vh;
  }
</style>
src/views/modules/analysis/quality/index.vue
对比新文件
@@ -0,0 +1,1312 @@
<template>
  <el-card shadow="never" class="aui-card--fill">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="原煤煤质趋势" name="first">
        <el-form :inline="true" :model="raw.dataForm">
          <el-form-item>
            <el-date-picker
                v-model="raw.dataForm.startDate"
                type="date"
                placeholder="选择开始时间"
                value-format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-date-picker
                v-model="raw.dataForm.endDate"
                type="date"
                placeholder="选择结束时间"
                value-format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button :loading="raw.hf.loading" @click="init1">查询</el-button>
          </el-form-item>
        </el-form>
        <div class="scrollable-container">
          <!--原煤灰分-->
          <el-card shadow="never" class="aui-card--fill" v-loading="raw.hf.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ raw.hf.currentValue }}</span>
                      <span style="font-size: 14px">{{raw.hf.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ raw.hf.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-ymhf" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{raw.hf.trend}}
                <i :class="raw.hf.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.hf.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.hf.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.hf.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{raw.hf.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--原煤水分-->
          <el-card shadow="never" class="aui-card--fill" v-loading="raw.sf.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ raw.sf.currentValue }}</span>
                      <span style="font-size: 14px">{{raw.sf.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ raw.sf.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-ymsf" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{raw.sf.trend}}
                <i :class="raw.sf.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.sf.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.sf.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.sf.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{raw.sf.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--原煤硫分-->
          <el-card shadow="never" class="aui-card--fill" v-loading="raw.lf.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ raw.lf.currentValue }}</span>
                      <span style="font-size: 14px">{{raw.lf.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ raw.lf.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-ymlf" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{raw.lf.trend}}
                <i :class="raw.lf.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.lf.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.lf.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.lf.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{raw.lf.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--原煤热值-->
          <el-card shadow="never" class="aui-card--fill" v-loading="raw.rz.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ raw.rz.currentValue }}</span>
                      <span style="font-size: 14px">{{raw.rz.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ raw.rz.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-ymrz" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{raw.rz.trend}}
                <i :class="raw.rz.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.rz.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.rz.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{raw.rz.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{raw.rz.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
        </div>
      </el-tab-pane>
      <el-tab-pane label="商品煤煤质趋势" name="second">
        <el-form :inline="true" :model="hm.dataForm">
          <el-form-item>
            <el-date-picker
                v-model="hm.dataForm.startDate"
                type="date"
                placeholder="选择开始时间"
                value-format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-date-picker
                v-model="hm.dataForm.endDate"
                type="date"
                placeholder="选择结束时间"
                value-format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button :loading="hm.hf.loading" @click="init2">查询</el-button>
          </el-form-item>
        </el-form>
        <div class="scrollable-container">
          <!--混煤灰分-->
          <el-card shadow="never" class="aui-card--fill" v-loading="hm.hf.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ hm.hf.currentValue }}</span>
                      <span style="font-size: 14px">{{hm.hf.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ hm.hf.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-hmhf" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{hm.hf.trend}}
                <i :class="hm.hf.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.hf.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.hf.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.hf.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{hm.hf.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--混煤水分-->
          <el-card shadow="never" class="aui-card--fill" v-loading="hm.sf.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ hm.sf.currentValue }}</span>
                      <span style="font-size: 14px">{{hm.sf.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ hm.sf.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-hmsf" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{hm.sf.trend}}
                <i :class="hm.sf.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.sf.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.sf.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.sf.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{hm.sf.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--混煤硫分-->
          <el-card shadow="never" class="aui-card--fill" v-loading="hm.lf.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ hm.lf.currentValue }}</span>
                      <span style="font-size: 14px">{{hm.lf.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ hm.lf.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-hmlf" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{hm.lf.trend}}
                <i :class="hm.lf.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.lf.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.lf.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.lf.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{hm.lf.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
          <!--混煤热值-->
          <el-card shadow="never" class="aui-card--fill" v-loading="hm.rz.loading">
            <el-row type="flex" justify="space-around">
              <el-col :span="4" style="margin-top: 40px" class="Border_l">
                <el-row>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      当前值
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                      <span>{{ hm.rz.currentValue }}</span>
                      <span style="font-size: 14px">{{hm.rz.unit}}</span>
                    </div>
                  </el-col>
                  <el-col :span="12">
                    <div style="width: 100%; text-align: left; font-size: 18px">
                      分析长度
                    </div>
                    <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                    >
                <span>{{ hm.rz.length }}</span
                ><span style="font-size: 14px">天</span>
                    </div>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="19">
                <div>
                  <div id="any-hmrz" style="margin-top: 20px" class="ecbox"></div>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" class="Border_down" align="left">
                <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
                >
                  <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{hm.rz.trend}}
                <i :class="hm.rz.iconClass"></i>
              </span>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>平均值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.rz.trendValue.mean_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最大值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.rz.trendValue.max_value}}</span>
                    </el-row>
                  </el-col>
                  <el-col :span="5" style="padding-top:5vh">
                    <el-row style="font-size: 14px">
                      <span>最小值</span>
                    </el-row>
                    <el-row style="font-size: 14px">
                      <span>{{hm.rz.trendValue.min_value}}</span>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
              <el-col :span="12" class="Border_down" align="left">
                <el-row style="margin-left: 2vh; margin-top: 1vh">
                  <span style="font-size: 14px; font-weight: 600">调度建议</span>
                </el-row>
                <el-row>
                  <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
                  ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
                  >{{hm.rz.dispatchSug}}</span>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </el-card>
        </div>
      </el-tab-pane>
    </el-tabs>
  </el-card>
</template>
<script>
  import {getSeriesData} from '@/utils/mathUtils'
  export default {
    data() {
      return {
        activeName: 'first',
        raw: {
          dataForm: {
            startDate: '',
            endDate: '',
          },
          hf: {
            loading: false,
            page: 'rowCoal',
            paramCode: 'ymhf',
            chartName: '原煤灰分',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: ''
          },
          sf: {
            loading: false,
            page: 'rowCoal',
            paramCode: 'ymsf',
            chartName: '原煤水分',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: ''
          },
          lf: {
            loading: false,
            page: 'rowCoal',
            paramCode: 'ymlf',
            chartName: '原煤硫分',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: ''
          },
          rz: {
            loading: false,
            page: 'rowCoal',
            paramCode: 'ymrz',
            chartName: '原煤热值',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: ''
          }
        },
        hm: {
          dataForm: {
            startDate: '',
            endDate: '',
          },
          hf: {
            loading: false,
            page: 'wash',
            paramCode: 'hmhf',
            chartName: '混煤灰分',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: ''
          },
          sf: {
            loading: false,
            page: 'wash',
            paramCode: 'hmsf',
            chartName: '混煤水分',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: ''
          },
          lf: {
            loading: false,
            page: 'wash',
            paramCode: 'hmlf',
            chartName: '混煤硫分',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: ''
          },
          rz: {
            loading: false,
            page: 'wash',
            paramCode: 'hmrz',
            chartName: '混煤热值',
            chartCode: '',
            chart: {},
            length: 0,
            unit: '',
            maxSlope: 0,
            minSlope: 0,
            currentValue: 0,
            trend: '',
            iconClass: '',
            trendValue: {
              mean_value: '',
              max_value: '',
              min_value: '',
            },
            dispatchSug: ''
          }
        }
      }
    },
    mounted() {
      this.init1()
    },
    methods: {
      init1() {
        this.getChartData(this.raw.hf, this.raw.dataForm)
        this.getChartData(this.raw.sf, this.raw.dataForm)
        this.getChartData(this.raw.lf, this.raw.dataForm)
        this.getChartData(this.raw.rz, this.raw.dataForm)
      },
      init2() {
        this.getChartData(this.hm.hf, this.hm.dataForm)
        this.getChartData(this.hm.sf, this.hm.dataForm)
        this.getChartData(this.hm.lf, this.hm.dataForm)
        this.getChartData(this.hm.rz, this.hm.dataForm)
      },
      getChartData(chartData, dataForm) {
        let myChart = this.$echarts.init(document.getElementById("any-" + chartData.paramCode));
        chartData.loading = true
        this.$http.get(`/iailab-ntt-model/any/ind-item/trend/`, {
          params: {
            startDate: dataForm.startDate,
            endDate: dataForm.endDate,
            page: chartData.page,
            paramCode: chartData.paramCode
          }
        }).then(({data: res}) => {
          chartData.loading = false
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          chartData.chartCode = res.data.chartCode
          chartData.length = res.data.length
          chartData.unit = res.data.unit
          chartData.maxSlope = res.data.maxSlope
          chartData.minSlope = res.data.minSlope
          chartData.currentValue = res.data.currentValue
          chartData.trend = res.data.trend
          chartData.iconClass = res.data.iconClass
          chartData.trendValue = res.data.trendValue
          chartData.dispatchSug = res.data.dispatchSug
          let valueData = []
          let xAxis = []
          res.data.valueList.forEach((item) => {
            xAxis.push(item.dataTime)
            if (item.dataValue && item.dataValue >= 0) {
              valueData.push([item.dataTime, item.dataValue])
            }
          })
          let length = 0
          if (xAxis.length > 0 && valueData.length > 0) {
            length = xAxis.indexOf(valueData[valueData.length - 1][0]) + 1 || xAxis.length
          }
          let trendDate = getSeriesData(chartData.trendValue.slope, chartData.trendValue.bias, length)
          let option = {
            title: {
              text: chartData.chartName,
            },
            tooltip: {
              trigger: "axis",
            },
            grid: {
              left: "3%",
              right: "4%",
              bottom: "3%",
              containLabel: true,
            },
            xAxis: {
              type: "category",
              boundaryGap: false,
              data: xAxis,
            },
            yAxis: {
              type: "value",
            },
            series: [
              {
                name: chartData.chartName,
                type: "line",
                smooth: true,
                stack: "Total",
                data: valueData,
              },
              {
                name: '趋势',
                data: trendDate,
                type: 'line',
                smooth: true,
                showSymbol: false,
                color: '#FFAA5D'
              }
            ],
          };
          if (option && typeof option === "object") {
            myChart.setOption(option);
          }
        })
      },
      handleClick(tab, event) {
        let that = this
        if ('first' === tab.name) {
          setTimeout(function () {
            that.init1()
          }, 500)
        } else if ('second' === tab.name) {
          setTimeout(function () {
            that.init2()
          }, 500)
        }
      }
    }
  }
</script>
<style scoped>
  .scrollable-container {
    overflow: auto;
    width: 100%;
    margin: -10px;
    height: calc(calc(100vh - 48px - 38px - 35px - 150px));
  }
  .ecbox {
    width: 100%;
    height: 30vh;
  }
  .Border {
    height: 42vh;
  }
  .Border_l {
    height: 20vh;
  }
  .Border_down {
    border: 1px solid #F2F3F5;
    height: 12vh;
  }
  .Border_text {
    background-color: #F2F3F5;
    border: 1px solid #F2F3F5;
    height: 7vh;
  }
</style>
src/views/modules/analysis/raw-coal-trend-analysis.vue
对比新文件
@@ -0,0 +1,349 @@
<template>
  <el-card shadow="never" class="aui-card--fill" v-loading="loading">
    <div v-for="(data, index) in dataList" :key="index" class="Border" style="margin-top: 5px">
      <el-card shadow="never" class="aui-card--fill" >
        <el-row type="flex" justify="space-around">
          <el-col :span="4" style="margin-top: 40px" class="Border_l">
            <el-row>
              <el-col :span="12">
                <div style="width: 100%; text-align: left; font-size: 18px">
                  当前值
                </div>
                <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                >
                  <span>{{ data.currentValue }}</span>
                  <span style="font-size: 14px">{{data.unit}}</span>
                </div>
              </el-col>
              <el-col :span="12">
                <div style="width: 100%; text-align: left; font-size: 18px">
                  分析长度
                </div>
                <div
                        style="
                  width: 100%;
                  height: 30px;
                  margin-top: 10px;
                  margin-bottom: 10px;
                  color: #000000;
                  font-size: 24px;
                "
                >
                <span>{{ data.length }}</span
                ><span style="font-size: 14px">天</span>
                </div>
              </el-col>
            </el-row>
            <!--            <el-button type="default" @onclick="viewHistoryData(bfg1Data)">-->
            <!--              查看历史</el-button>-->
          </el-col>
          <el-col :span="19">
            <div>
              <div :id="data.chartCode" style="margin-top: 20px" class="ecbox"></div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="Border_down" align="left">
            <el-row
                    type="flex"
                    justify="center"
                    align="middle"
                    style="height: 5vh"
            >
              <el-col :span="5" style="padding-top:5vh">
              <span style="font-size: 16px; font-weight: 600">
                整体趋势{{data.trend}}
                <i :class="data.iconClass"></i>
              </span>
              </el-col>
              <el-col :span="5" style="padding-top:5vh">
                <el-row style="font-size: 14px">
                  <span>平均值</span>
                </el-row>
                <el-row style="font-size: 14px">
                  <span>{{data.trendValue.mean_value}}</span>
                </el-row>
              </el-col>
              <el-col :span="5" style="padding-top:5vh">
                <el-row style="font-size: 14px">
                  <span>最大值</span>
                </el-row>
                <el-row style="font-size: 14px">
                  <span>{{data.trendValue.max_value}}</span>
                </el-row>
              </el-col>
              <el-col :span="5" style="padding-top:5vh">
                <el-row style="font-size: 14px">
                  <span>最小值</span>
                </el-row>
                <el-row style="font-size: 14px">
                  <span>{{data.trendValue.min_value}}</span>
                </el-row>
              </el-col>
            </el-row>
          </el-col>
          <el-col :span="12" class="Border_down" align="left">
            <el-row style="margin-left: 2vh; margin-top: 1vh">
              <span style="font-size: 14px; font-weight: 600">调度建议</span>
            </el-row>
            <el-row>
              <el-col
                      :span="23"
                      class="Border_text"
                      style="margin-left: 2vh; margin-top: 1vh; padding-top: 10px"
              ><span
                      style="
                  margin-left: 2vh;
                  font-size: 18px;
                  font-family: '楷体';
                  font-weight: 600;
                  color: red;
                "
              >{{data.dispatchSug}}</span>
              </el-col>
            </el-row>
          </el-col>
        </el-row>
      </el-card>
    </div>
  </el-card>
</template>
<script>
import * as echarts from "echarts";
import {getSeriesData} from '@/utils/mathUtils'
export default {
  data() {
    return {
      radio: '产率',
      loading: false,
      dataList: [],
      prepareDataList:{},
      page:"rowCoal",
      bfg1Data: {
        alarmList: {},
      },
      chartsName:{
        'A010039':'原煤入洗量',
        'A010001':'原煤灰分',
        'A010037':'原煤水分',
        'A010038':'原煤硫分',
        'A010018':'原煤热值'
      },
      defaultDispatchSug:{
        'A010039;1':'建议近期多加关注洗选环节产量情况,防止问题累积',
        'A010039;2':'建议检查原煤生产与洗选环节设备情况,减少原煤入洗量',
        'A010039;-1':'建议近期多加关注洗选环节产量情况,防止问题累积',
        'A010039;-2':'建议检查原煤生产与洗选环节设备情况,增加原煤入洗量',
        'A010001;1':'建议近期多加关注原煤灰分情况,同时注意配煤质量',
        'A010001;2':'建议检查灰分传感器设备,同时注意配煤质量',
        'A010001;-1':'煤质变好,注意配煤质量',
        'A010001;-2':'建议检查灰分传感器设备,同时注意配煤质量',
        'A010038;1':'建议近期多加关注原煤硫分情况,同时注意配煤质量',
        'A010038;2':'建议检查硫分传感器设备,同时注意配煤质量',
        'A010038;-1':'煤质变好,注意配煤质量',
        'A010038;-2':'建议检查硫分传感器设备,同时注意配煤质量',
        'A010037;1':'建议近期多加关注原煤水分情况,同时注意配煤质量',
        'A010037;2':'建议检查水分传感器设备,同时注意配煤质量',
        'A010037;-1':'建议近期多加关注原煤水分情况,同时注意配煤质量',
        'A010037;-2':'建议检查水分传感器设备,同时注意配煤质量',
        'A010018;1':'建议近期多加关注原煤热值情况,同时注意配煤质量',
        'A010018;2':'建议检查热值传感器设备,同时注意配煤质量',
        'A010018;-1':'建议近期多加关注原煤热值情况,同时注意配煤质量',
        'A010018;-2':'建议检查热值传感器设备,同时注意配煤质量',
      }
    };
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      window.addEventListener("resize", this.handleResize);
      Promise.all([
        this.getPageParamDataList()
      ]).then(() => {
        if (this.prepareDataList.length !== 0) {
          this.getDataList();
        }
      })
    },
    getPageParamDataList(){
      return this.$http.get(`/iailab-ntt-model/param/page/${this.page}`).then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.prepareDataList = res.data
      })
    },
    getDataList() {
      this.loading = true
      let that = this
      let params = []
      this.prepareDataList.forEach((data) => {
        params.push(data.chartCode)
      })
      this.$http.post(`/iailab-ntt-data/api/data/ind-item/values-trend`, params).then(({data: res}) => {
        this.loading = false
        if (res.code !== 0) {
          console.log(res.msg)
          return
        }
        this.prepareDataList.forEach((data) => {
          data.dataValue = res.data['values'][data.chartCode]
          //获取当前值数据,获取最后一个有值的数据
          for (let i = data.dataValue.length - 1; i >= 0; i--) {
            if (data.dataValue[i].dataValue) {
              data.currentValue = data.dataValue[i].dataValue
              break
            }
          }
          data.trendValue = res.data['trend'][data.chartCode]
          this.getDispatchSug(data)
          this.dataList.push(data)
          setTimeout(function () {
            that.getCharts(data);
          }, 1000)
        })
      })
    },
    getDispatchSug(data){
      //判断整体趋势,根据趋势值修改趋势后面的图标,生成建议值
      let scopeValue = ''
      let slopeFlag = data.trendValue.slope_flag
      switch (slopeFlag) {
        case 1:
          data.trend = '上升'
          data.iconClass = 'el-icon-top'
          scopeValue = '略有上升趋势,'
          break
        case 2:
          data.trend = '上升'
          data.iconClass = 'el-icon-top'
          scopeValue = '上升趋势过大,'
          break
        case -1:
          data.trend = '下降'
          data.iconClass = 'el-icon-bottom'
          scopeValue = '略有下降趋势,'
          break
        case -2:
          data.trend = '下降'
          data.iconClass = 'el-icon-bottom'
          scopeValue = '下降趋势过大,'
          break
      }
      //生成调度建议
      let defaultSug = this.defaultDispatchSug[data.chartCode+';'+slopeFlag]
      if(slopeFlag === 0 ){
        data.trend = '平稳'
        data.dispatchSug = '生产正常,暂无建议'
      }else {
        data.dispatchSug = this.chartsName[data.chartCode] + scopeValue + defaultSug
      }
    },
    getCharts(data) {
      let myChart = this.$echarts.init(document.getElementById(data.chartCode));
      let chartTitle = this.chartsName[data.chartCode]
      let valueData = data.dataValue
      let chartData = []
      let xAxis = []
      valueData.forEach((item) =>{
        xAxis.push(item.dataTime)
        if (item.dataValue && item.dataValue >= 0) {
          chartData.push([item.dataTime, item.dataValue])
        }
      })
      let trendDate = getSeriesData(data.trendValue.slope, data.trendValue.bias, xAxis.length)
      var option = {
        title: {
          text: chartTitle,
        },
        tooltip: {
          trigger: "axis",
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: xAxis,
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            name: chartTitle,
            type: "line",
            smooth: true,
            stack: "Total",
            data: chartData,
          },
          {
            name: '趋势',
            data: trendDate,
            type: 'line',
            smooth: true,
            showSymbol: false,
            color: '#FFAA5D'
          }
        ],
      };
      if (option && typeof option === "object") {
        myChart.setOption(option);
      }
      return option;
    },
    handleResize() {
      this.dataList.forEach((data, index) => {
        var myChart = echarts.getInstanceByDom(
                document.getElementById(index)
        );
        myChart.resize();
      });
    },
  },
  beforeDestroy() {
    window.removeEventListener("resize", this.handleResize);
  },
};
</script>
<style scoped>
  .ecbox {
    width: 100%;
    height: 30vh;
  }
  .Border {
    height: 42vh+40px;
  }
  .Border_l {
    height: 20vh;
  }
  .Border_down {
    border: 1px solid    #F2F3F5;
    height: 12vh;
  }
  .Border_text {
    background-color:     #F2F3F5;
    border: 1px solid    #F2F3F5;
    height: 7vh;
  }
</style>
src/views/modules/analysis/store-dependable-analysis-add-or-update.vue
src/views/modules/analysis/store-dependable-analysis.vue
对比新文件
@@ -0,0 +1,272 @@
<template>
  <el-card shadow="never" class="aui-card--fill">
    <div>
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-date-picker
              v-model="dataForm.startTime"
              type="datetime"
              placeholder="选择开始时间"
              value-format="yyyy-MM-dd HH:mm:ss"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-date-picker
              v-model="dataForm.endTime"
              type="datetime"
              placeholder="选择结束时间"
              value-format="yyyy-MM-dd HH:mm:ss"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-input v-model="dataForm.judgement" placeholder="评价" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="searchDataList()">查询</el-button>
        </el-form-item>
      </el-form>
      <div class="chart-boday">
        <bar-line :option="chartOption" style="height: 400px;"></bar-line>
      </div>
      <el-table
          :data="dataList"
          border
          v-loading="dataListLoading"
          style="width: 100%;">
        <el-table-column
            type="index"
            align="center"
            width="50"
            label="序号"
        >
        </el-table-column>
        <el-table-column
            prop="dateTime"
            header-align="center"
            align="center"
            label="日期时间"
            min-width="200">
        </el-table-column>
        <el-table-column
            prop="judgement"
            header-align="center"
            align="center"
            label="评价"
            min-width="100">
        </el-table-column>
        <el-table-column
            prop="score"
            header-align="center"
            align="center"
            label="分数"
            min-width="100">
          <template slot-scope="scope">
            <span :class="getFenClass(scope.row.score)">
                {{scope.row.score}}
              </span>
          </template>
        </el-table-column>
        <el-table-column
            prop="analysis"
            header-align="center"
            align="left"
            label="分析"
            min-width="500">
        </el-table-column>
      </el-table>
      <el-pagination
          @size-change="sizeChangeHandle"
          @current-change="currentChangeHandle"
          :current-page="pageIndex"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="pageSize"
          :total="totalPage"
          layout="total, sizes, prev, pager, next, jumper">
      </el-pagination>
    </div>
  </el-card>
</template>
<script>
  import BarLine from "@/components/chart/bar-line.vue";
  import {stringToJSON} from '@/utils/jsonUtils'
  export default {
    components: {BarLine},
    data() {
      return {
        loading: false,
        dataForm: {
          startTime: '',
          endTime: '',
          judgement: ''
        },
        dataList: [],
        pageIndex: 1,
        pageSize: 10,
        totalPage: 0,
        dataListLoading: false,
        dataListSelections: [],
        chartOption: {},
        chartData: {
          xData: [],
          sub_indicator_score: [],
          analysis: '',
          score: '',
        }
      }
    },
    mounted() {
      this.getDataList()
      this.getChartData()
    },
    methods: {
      searchDataList() {
        this.pageIndex = 1
        this.getDataList()
      },
      getChartData() {
        let that = this
        this.loading = true
        this.$http.get(`/iailab-ntt-model/api/model/model-result/list`, {
          params: {
            modelCode: 'storage_reliability',
            lastHour: 24 * 7,
            isAsc: true,
            startDate: this.dataForm.startDate,
            endDate: this.dataForm.endDate,
          }
        }).then(({data: res}) => {
          this.loading = false
          this.resetFields(this.chartData)
          let xData = []
          let subScoreDevice = []
          let subScoreVolume = []
          let subScoreState = []
          res.data.forEach(function (item) {
            xData.push(item.resultTime.toString().substr(0, 10))
            let sub_indicator_score = stringToJSON(item.sub_indicator_score)
            subScoreDevice.push(sub_indicator_score[0])
            subScoreVolume.push(sub_indicator_score[1])
            subScoreState.push(sub_indicator_score[2])
            let series = [
              {
                name: "设备可靠性",
                type: 'bar',
                data: subScoreDevice,
              },
              {
                name: "仓储与外运",
                type: 'bar',
                data: subScoreVolume,
              },
              {
                name: "仓可用状态",
                type: 'bar',
                data: subScoreState,
              }
            ]
            this.chartOption = {
              title: {
                text: '',
              },
              tooltip: {
                trigger: "axis"
              },
              legend: {
                data: ['设备可靠性', '仓储与外运', '仓可用状态'],
                right: '10%'
              },
              xAxis: {
                type: "category",
                data: xData,
              },
              yAxis: {
                type: 'value',
                min: 0,//最小
                max: 100,//最大
              },
              series: series
            };
          }, this)
        })
      },
      resetFields(obj) {
        for (let key in obj) {
          if (obj[key] instanceof Array) {
            obj[key] = []
          } else if (obj[key] instanceof Object) {
            this.resetFields(obj[key])
          } else {
            obj[key] = ''
          }
        }
      },
      // 获取数据列表
      getDataList() {
        this.dataListLoading = true
        this.$http.get(`/iailab-ntt-model/api/model/model-result/list`, {})
        this.$http({
          url: '/iailab-ntt-model/any/store/page',
          method: 'get',
          params: this.$http.adornParams({
            'modelId': '705a3452-0594-4aba-a49e-f77626bc1d78',
            'page': this.pageIndex,
            'limit': this.pageSize,
            'startTime': this.dataForm.startTime,
            'endTime': this.dataForm.endTime,
            'judgement': this.dataForm.judgement
          })
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.dataList = data.data.list
            this.totalPage = data.data.total
          } else {
            this.dataList = []
            this.totalPage = 0
          }
          this.dataListLoading = false
        })
      },
      // 每页数
      sizeChangeHandle(val) {
        this.pageSize = val
        this.pageIndex = 1
        this.getDataList()
      },
      // 当前页
      currentChangeHandle(val) {
        this.pageIndex = val
        this.getDataList()
      },
      // 多选
      selectionChangeHandle(val) {
        this.dataListSelections = val
      },
      getFenClass(fen) {
        if (Number(fen) >= 60) {
          return 'fen-nor';
        } else {
          return 'fen-low';
        }
      }
    }
  }
</script>
<style scoped>
  .fen-low {
    color: #F45354;
    font-weight: 600;
  }
  .fen-nor {
    color: #00c2ff;
    font-weight: 600;
  }
</style>
src/views/modules/analysis/update-system-weight.vue
对比新文件
@@ -0,0 +1,104 @@
<template>
  <el-dialog :visible.sync="visible" title="指标评价体系权重分配" :close-on-click-modal="false"
             :close-on-press-escape="false" width="30%">
        <el-form label-position="left" label-width="80px" :model="dataForm">
        <el-form-item label="数量">
            <el-input-number v-model="dataForm.number"></el-input-number>&nbsp;&nbsp;&nbsp;%
            <el-slider v-model="dataForm.number"></el-slider>
        </el-form-item>
        <el-form-item label="质量">
            <el-input-number v-model="dataForm.quality"></el-input-number>&nbsp;&nbsp;&nbsp;%
            <el-slider v-model="dataForm.quality"></el-slider>
        </el-form-item>
        <el-form-item label="生产消耗">
            <el-input-number v-model="dataForm.consume"></el-input-number>&nbsp;&nbsp;&nbsp;%
            <el-slider v-model="dataForm.consume"></el-slider>
        </el-form-item>
            <el-form-item label="过程控制">
            <el-input-number v-model="dataForm.process"></el-input-number>&nbsp;&nbsp;&nbsp;%
            <el-slider v-model="dataForm.process"></el-slider>
        </el-form-item>
            <el-form-item label="管理">
            <el-input-number v-model="dataForm.manage"></el-input-number>&nbsp;&nbsp;&nbsp;%
            <el-slider v-model="dataForm.manage"></el-slider>
        </el-form-item>
        </el-form>
            <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
    </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      visible: false,
      pid:0,
      dataForm: {
        number: "",
        quality: "",
        consume: "",
        process:"",
        manage:""
      },
    };
  },
  methods: {
    init() {
      this.visible = true;
      this.$nextTick(() => {
        this.getDataList()
      });
    },
    getDataList() {
      this.$http.get(`/iailab-ntt-model/index/evaluate/systemWeightList`)
        .then(({ data }) => {
           if (data && data.code === 0) {
            this.dataForm.number=Number(data.data.SYS0001);
            this.dataForm.quality=Number(data.data.SYS0002);
            this.dataForm.consume=Number(data.data.SYS0003);
            this.dataForm.process=Number(data.data.SYS0004);
            this.dataForm.manage=Number(data.data.SYS0005);
            }
        })
        .catch((error) => {
          console.error(error);
        });
    },
    // 表单提交
    dataFormSubmit() {
      this.loading = true
      if(this.dataForm.number+this.dataForm.quality+this.dataForm.consume+this.dataForm.process+this.dataForm.manage==100){
        this.$http.post('/iailab-ntt-model/index/evaluate/updataSystemWeight', this.dataForm).then(({ data: res }) => {
          this.loading = false
           if (res.code !== 0) {
              return this.$message.error(res.msg)
            }
            this.$message({
              message: this.$t('prompt.success'),
              type: 'success',
              duration: 500,
              onClose: () => {
                this.visible = false
                this.$emit('refreshDataList')
              }
            })
        }).catch(() => {})
      }else{
         this.$alert('各权重之和必须为100%', {
          confirmButtonText: '确定',
        });
        }
    },
    beforeCloseHandle(done) {
      this.dataList = [];
      done();
    },
  },
  props: {
    row: Object,
  },
};
</script>
src/views/modules/analysis/update-weight.vue
对比新文件
@@ -0,0 +1,88 @@
<template>
  <el-dialog :visible.sync="visible" title="指标评价体系权重分配" :close-on-click-modal="false"
             :close-on-press-escape="false" width="30%">
        <el-form label-position="left" label-width="80px" :model="dataForm">
        <el-form-item label="数量">
            <el-input-number v-model="dataForm.number"></el-input-number>&nbsp;&nbsp;&nbsp;%
            <el-slider v-model="dataForm.number"></el-slider>
        </el-form-item>
        <el-form-item label="质量">
            <el-input-number v-model="dataForm.quality"></el-input-number>&nbsp;&nbsp;&nbsp;%
            <el-slider v-model="dataForm.quality"></el-slider>
        </el-form-item>
        <el-form-item label="生产消耗">
            <el-input-number v-model="dataForm.consume"></el-input-number>&nbsp;&nbsp;&nbsp;%
            <el-slider v-model="dataForm.consume"></el-slider>
        </el-form-item>
            <el-form-item label="过程控制">
            <el-input-number v-model="dataForm.process"></el-input-number>&nbsp;&nbsp;&nbsp;%
            <el-slider v-model="dataForm.process"></el-slider>
        </el-form-item>
            <el-form-item label="管理">
            <el-input-number v-model="dataForm.manage"></el-input-number>&nbsp;&nbsp;&nbsp;%
            <el-slider v-model="dataForm.manage"></el-slider>
        </el-form-item>
        </el-form>
            <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
    </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      visible: false,
      dataForm: {
        number: "",
        quality: "",
        consume: "",
        process:"",
        manage:""
      },
    };
  },
  methods: {
    init(row) {
      this.visible = true;
      this.$nextTick(() => {
      });
    },
    getDataList() {
      this.$http({
        url: "/iailab-ntt-data/api/data/tag/current/oadp",
        method: "post",
        data: [this.dataForm.id],
      })
        .then(({ data }) => {
           if (data && data.code === 0) {
            this.dataForm.value = data.data[this.dataForm.id].value;
            this.dataForm.timestamp = data.data[this.dataForm.id].timestamp;
             }
        })
        .catch((error) => {
          console.error(error);
        });
    },
    // 表单提交
    dataFormSubmit() {
        console.log(this.dataForm.number+this.dataForm.quality+this.dataForm.consume+this.dataForm.process+this.dataForm.manage==100)
     if (!(this.dataForm.number+this.dataForm.quality+this.dataForm.consume+this.dataForm.process+this.dataForm.manage==100)) {
         this.$alert('各权重之和必须为100%', {
          confirmButtonText: '确定',
        });
        }
    },
    beforeCloseHandle(done) {
      this.dataList = [];
      done();
    },
  },
  props: {
    row: Object,
  },
};
</script>
src/views/modules/app/device/main-device-add-or-update.vue
对比新文件
@@ -0,0 +1,180 @@
<template>
    <el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
      <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
        <el-form-item prop="deviceName" :label="$t('deviceMsg.deviceName')">
          <el-input v-model="dataForm.deviceName" :placeholder="$t('deviceMsg.deviceName')"></el-input>
        </el-form-item>
        <el-form-item prop="deviceNo" :label="$t('deviceMsg.deviceNo')" :class="{ 'is-required': !dataForm.deviceNo }">
          <el-input v-model="dataForm.deviceNo" :placeholder="$t('deviceMsg.deviceNo')"></el-input>
        </el-form-item>
        <el-form-item prop="deptName" :label="$t('deviceMsg.deptName')">
          <ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :dept-name.sync="dataForm.deptName"></ren-dept-tree>
        </el-form-item>
        <el-form-item prop="productModel" :label="$t('deviceMsg.productModel')">
          <el-input v-model="dataForm.productModel" :placeholder="$t('deviceMsg.productModel')"></el-input>
        </el-form-item>
        <el-form-item prop="deviceArea" :label="$t('deviceMsg.deviceArea')">
          <el-input v-model="dataForm.deviceArea" :placeholder="$t('deviceMsg.deviceArea')"></el-input>
        </el-form-item>
        <el-form-item prop="deviceState" :label="$t('deviceMsg.deviceState')" size="mini">
          <el-radio-group v-model="dataForm.deviceState">
            <el-radio :label="'0'">{{ $t('deviceMsg.deviceState0') }}</el-radio>
            <el-radio :label="'1'">{{ $t('deviceMsg.deviceState1') }}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item prop="electricState" :label="$t('deviceMsg.electricState')" size="mini">
          <el-radio-group v-model="dataForm.electricState">
            <el-radio :label="'0'">{{ $t('deviceMsg.electricState0') }}</el-radio>
            <el-radio :label="'1'">{{ $t('deviceMsg.electricState1') }}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item prop="remarks" :label="$t('deviceMsg.remarks')">
          <el-input v-model="dataForm.remarks" :placeholder="$t('deviceMsg.remarks')"></el-input>
        </el-form-item>
      </el-form>
      <template slot="footer">
        <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
        <el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
      </template>
    </el-dialog>
  </template>
  <script>
  import debounce from 'lodash/debounce'
  import { isEmail, isMobile } from '@/utils/validate'
  export default {
    data () {
      return {
        visible: false,
        roleList: [],
        roleIdListDefault: [],
        dataForm: {
          id: '',
          deviceName: '',
          deviceNo: '',
          deptId: '',
          deptName: '',
          productModel: '',
          deviceArea: '',
          deviceState: "1",
          electricState: "0",
          remarks: ''
        }
      }
    },
    computed: {
      dataRule () {
        var validateDeviceNo = (rule, value, callback) => {
          const title= /[^\a-\z\A-\Z0-9]/g
          if (!this.dataForm.deviceNo && !/\S/.test(value)) {
            return callback(new Error(this.$t('validate.required')))
          }
          if (/[\u4E00-\u9FA5]/g.test(value)) {
          return callback(new Error(this.$t('deviceMsg.errMessage')))
        }
          callback()
        }
        return {
          deviceName: [
            { required: true, message: this.$t('validate.required'), trigger: 'blur' }
          ],
          // deviceNo: [
          //   { required: true, message: this.$t('validate.required'), trigger: 'blur' }
          // ],
          deviceNo: [
            { validator: validateDeviceNo, trigger: 'blur' }
          ],
          deptName: [
            { required: true, message: this.$t('validate.required'), trigger: 'change' }
          ]
        }
      }
    },
    methods: {
      init () {
        this.visible = true
        this.dataForm.deptId = ''
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          this.roleIdListDefault = []
          Promise.all([
            this.getRoleList()
          ]).then(() => {
            if (this.dataForm.id) {
              this.getInfo()
            }
          })
        })
      },
      // 获取角色列表
      getRoleList () {
        return this.$http.get('/iailab-ntt-system/sys/role/list').then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.roleList = res.data
        }).catch(() => {})
      },
      // 获取信息
      getInfo () {
        this.$http.get(`/iailab-ntt-coal-app/api/web/device/getId/${this.dataForm.id}`).then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.dataForm = {
            ...this.dataForm,
            ...res.data,
            roleIdList: []
          }
          // 角色配置, 区分是否为默认角色
          for (var i = 0; i < res.data.roleIdList.length; i++) {
            if (this.roleList.filter(item => item.id === res.data.roleIdList[i])[0]) {
              this.dataForm.roleIdList.push(res.data.roleIdList[i])
              continue
            }
            this.roleIdListDefault.push(res.data.roleIdList[i])
          }
        }).catch(() => {})
      },
      // 表单提交
      dataFormSubmitHandle: debounce(function () {
        this.$refs['dataForm'].validate((valid) => {
          if (!valid) {
            return false
          }
          this.$http[!this.dataForm.id ? 'post' : 'put']('/iailab-ntt-coal-app/api/web/device/save', {
            ...this.dataForm,
            // roleIdList: [
            //   ...this.dataForm.roleIdList,
            //   ...this.roleIdListDefault
            // ]
          }).then(({ data: res }) => {
            if (res.code !== 0) {
              return this.$message.error(res.msg)
            }
            this.$message({
              message: this.$t('prompt.success'),
              type: 'success',
              duration: 500,
              onClose: () => {
                this.visible = false
                this.$emit('refreshDataList')
              }
            })
          }).catch(() => {})
        })
      }, 1000, { 'leading': true, 'trailing': false })
    }
  }
  </script>
  <style lang="scss">
  .mod-sys__user {
    .role-list {
      .el-select {
        width: 100%;
      }
    }
  }
  </style>
src/views/modules/app/device/main-device.vue
对比新文件
@@ -0,0 +1,92 @@
<template>
    <el-card shadow="never" class="aui-card--fill">
      <div class="mod-sys__user">
        <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
          <el-form-item>
            <el-input v-model="dataForm.deviceName" :placeholder="$t('deviceMsg.deviceName')" clearable></el-input>
          </el-form-item>
          <el-form-item>
            <el-input v-model="dataForm.deviceNo" :placeholder="$t('deviceMsg.deviceNo')" clearable></el-input>
          </el-form-item>
          <el-form-item>
            <el-button @click="getDataList()">{{ $t('query') }}</el-button>
          </el-form-item>
          <el-form-item>
            <el-button v-if="$hasPermission('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
          </el-form-item>
          <el-form-item>
            <el-button v-if="$hasPermission('sys:user:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
          </el-form-item>
        </el-form>
        <el-table
          v-loading="dataListLoading"
          :data="dataList"
          border
          @selection-change="dataListSelectionChangeHandle"
          @sort-change="dataListSortChangeHandle"
          style="width: 100%;">
          <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
          <el-table-column prop="deviceName" :label="$t('deviceMsg.deviceName')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="deviceNo" :label="$t('deviceMsg.deviceNo')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="deptName" :label="$t('deviceMsg.deptName')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="deviceState" :label="$t('deviceMsg.deviceState')" header-align="center" align="center">
            <template slot-scope="scope">
              <el-tag v-if="scope.row.deviceState == '0'" size="small" type="danger">{{ $t('deviceMsg.deviceState0') }}</el-tag>
              <el-tag v-else size="small" type="success">{{ $t('deviceMsg.deviceState1') }}</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="electricState" :label="$t('deviceMsg.electricState')" header-align="center" align="center">
            <template slot-scope="scope">
              <el-tag v-if="scope.row.electricState === '0'" size="small" type="danger">{{ $t('deviceMsg.electricState0') }}</el-tag>
              <el-tag v-else size="small" type="success">{{ $t('deviceMsg.electricState1') }}</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="createDate" :label="$t('deviceMsg.createDate')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="remarks" :label="$t('deviceMsg.remarks')" header-align="center" align="center"></el-table-column>
          <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
            <template slot-scope="scope">
              <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
              <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          :current-page="page"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="limit"
          :total="total"
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="pageSizeChangeHandle"
          @current-change="pageCurrentChangeHandle">
        </el-pagination>
        <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
      </div>
    </el-card>
  </template>
  <script>
  import mixinViewModule from '../until/app-view-module'
  import AddOrUpdate from './main-device-add-or-update.vue'
  export default {
    mixins: [mixinViewModule],
    data () {
      return {
        mixinViewModuleOptions: {
          getDataListURL: '/iailab-ntt-coal-app/api/web/device/select/page/list',
          getDataListIsPage: true,
          deleteURL: '/iailab-ntt-coal-app/api/web/device/delete',
          deleteIsBatch: true,
        },
        dataForm: {
          deviceName: '',
          deviceNo: ''
        }
      }
    },
    components: {
      AddOrUpdate
    }
  }
  </script>
   -->
src/views/modules/app/device/relation-device-add-or-update.vue
对比新文件
@@ -0,0 +1,155 @@
<template>
    <el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
      <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
        <el-form-item prop="deptName" :label="$t('relatedDeviceMsg.deptName')">
          <ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :dept-name.sync="dataForm.deptName"></ren-dept-tree>
        </el-form-item>
        <el-form-item prop="hostDevice" :label="$t('relatedDeviceMsg.hostDevice')" class="device-list">
          <el-select  v-model="dataForm.hostDevice"  @change="deviceChange($event)" placeholder="请选择">
            <el-option v-for="item in dataForm.deviceList" :key="item.id" :label="item.deviceName" :value="{id:item.id,deviceName:item.deviceName}" ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="repeatDevice" :label="$t('relatedDeviceMsg.repeatDevice')" class="device-list">
            <el-select v-model="dataForm.repeatDevice" multiple :placeholder="$t('relatedDeviceMsg.repeatDevice')">
             <el-option v-for="repeat in repeatList" :key="repeat.id" :label="repeat.deviceName" :value="repeat.deviceName"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item prop="remarks" :label="$t('deviceMsg.remarks')">
          <el-input v-model="dataForm.remarks" :placeholder="$t('deviceMsg.remarks')"></el-input>
        </el-form-item>
      </el-form>
      <template slot="footer">
        <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
        <el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
      </template>
    </el-dialog>
  </template>
  <script>
  import debounce from 'lodash/debounce'
  export default {
    data () {
      return {
        visible: false,
        repeatList: [],
        dataForm: {
          id: '',
          deptId: '',
          deptName: '',
          hostDeviceId: '',
          hostDevice: '',
          deviceList: [],
          repeatDevice: '',
          remarks: ''
        }
      }
    },
    computed: {
      dataRule () {
        return {
          deptName: [
            { required: true, message: this.$t('validate.required'), trigger: 'blur' }
          ],
          hostDevice: [
            { required: true, message: this.$t('validate.required'), trigger: 'blur' }
          ],
          repeatDevice: [
            { required: true, message: this.$t('validate.required'), trigger: 'change' }
          ]
        }
      },
    },
    methods: {
      init () {
        this.visible = true
        this.dataForm.deptId = ''
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          this.roleIdListDefault = []
          Promise.all([
            this.getDeviceName()
          ]).then(() => {
            if (this.dataForm.id) {
              this.getInfo()
            }
          })
        })
      },
      getDeviceName(){
        return this.$http.get('/iailab-ntt-coal-app/api/web/relationDevice/select/deviceName/list').then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.dataForm.deviceList = res.data;
        }).catch(() => {})
      },
      // 获取信息
      getInfo () {
        this.$http.get(`/iailab-ntt-coal-app/api/web/relationDevice/getId/${this.dataForm.id}`).then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.dataForm = {
            ...this.dataForm,
            ...res.data,
            roleIdList: []
          }
          // 角色配置, 区分是否为默认角色
          for (var i = 0; i < res.data.roleIdList.length; i++) {
            if (this.roleList.filter(item => item.id === res.data.roleIdList[i])[0]) {
              this.dataForm.roleIdList.push(res.data.roleIdList[i])
              continue
            }
            this.roleIdListDefault.push(res.data.roleIdList[i])
          }
        }).catch(() => {})
      },
      // 表单提交
      dataFormSubmitHandle: debounce(function () {
        this.$refs['dataForm'].validate((valid) => {
          if (!valid) {
            return false
          }
          this.$http[!this.dataForm.id ? 'post' : 'put']('/iailab-ntt-coal-app/api/web/relationDevice/save', {
            ...this.dataForm,
          }).then(({ data: res }) => {
            if (res.code !== 0) {
              return this.$message.error(res.msg)
            }
            this.$message({
              message: this.$t('prompt.success'),
              type: 'success',
              duration: 500,
              onClose: () => {
                this.visible = false
                this.$emit('refreshDataList')
              }
            })
          }).catch(() => {})
        })
      }, 1000, { 'leading': true, 'trailing': false }),
      deviceChange(event){
        this.dataForm.hostDeviceId = event.id;
        this.dataForm.hostDevice = event.deviceName;
        return this.$http.get(`/iailab-ntt-coal-app/api/web/relationDevice/select/repeatName/list/${this.dataForm.hostDeviceId}`).then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.repeatList = res.data
        }).catch(() => {})
      }
    }
  }
  </script>
  <style lang="scss">
  .mod-sys__user {
    .device-list {
      .el-select {
        width: 100%;
      }
    }
  }
  </style>
src/views/modules/app/device/relation-device.vue
对比新文件
@@ -0,0 +1,74 @@
<template>
    <el-card shadow="never" class="aui-card--fill">
      <div class="mod-sys__user">
        <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
          <el-form-item>
            <el-input v-model="dataForm.hostDevice" :placeholder="$t('relatedDeviceMsg.hostDevice')" clearable></el-input>
          </el-form-item>
          <el-form-item>
            <el-button @click="getDataList()">{{ $t('query') }}</el-button>
          </el-form-item>
          <el-form-item>
            <el-button v-if="$hasPermission('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
          </el-form-item>
          <el-form-item>
            <el-button v-if="$hasPermission('sys:user:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
          </el-form-item>
        </el-form>
        <el-table
          v-loading="dataListLoading"
          :data="dataList"
          border
          @selection-change="dataListSelectionChangeHandle"
          @sort-change="dataListSortChangeHandle"
          style="width: 100%;">
          <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
          <el-table-column prop="deptName" :label="$t('relatedDeviceMsg.deptName')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="hostDevice" :label="$t('relatedDeviceMsg.hostDevice')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="repeatDevice" :label="$t('relatedDeviceMsg.repeatDevice')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="createDate" :label="$t('relatedDeviceMsg.createDate')" header-align="center" align="center"></el-table-column>
          <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
            <template slot-scope="scope">
              <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
              <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          :current-page="page"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="limit"
          :total="total"
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="pageSizeChangeHandle"
          @current-change="pageCurrentChangeHandle">
        </el-pagination>
        <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
      </div>
    </el-card>
  </template>
  <script>
  import mixinViewModule from '../until/app-view-module'
  import AddOrUpdate from './relation-device-add-or-update.vue'
  export default {
    mixins: [mixinViewModule],
    data () {
      return {
        mixinViewModuleOptions: {
          getDataListURL: '/iailab-ntt-coal-app/api/web/relationDevice/select/page/list',
          getDataListIsPage: true,
          deleteURL: '/iailab-ntt-coal-app/api/web/relationDevice/delete',
          deleteIsBatch: true,
        },
        dataForm: {
            hostDevice: ''
        }
      }
    },
    components: {
      AddOrUpdate
    }
  }
  </script>
src/views/modules/app/electric/send-electric-history-list.vue
对比新文件
@@ -0,0 +1,87 @@
<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-sys__user">
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <span>申请日期:</span>
          <el-date-picker v-model="dataForm.startDate" type="date"></el-date-picker>
        </el-form-item>
        <el-form-item>至</el-form-item>
        <el-form-item>
          <el-date-picker v-model="dataForm.endDate" type="date"></el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-input v-model="dataForm.sendElectricDevice" :placeholder="$t('deviceSendElectric.sendElectricDevice')" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="getDataList()">{{ $t('query') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
        </el-form-item>
      </el-form>
      <el-table
        v-loading="dataListLoading"
        :data="dataList"
        border
        @selection-change="dataListSelectionChangeHandle"
        @sort-change="dataListSortChangeHandle"
        style="width: 100%;">
        <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
        <el-table-column prop="deptName" :label="$t('deviceSendElectric.deptName')" header-align="center" align="center"></el-table-column>
        <el-table-column prop="applyDate" :label="$t('deviceSendElectric.applyDate')" width="100" header-align="center" align="center" :formatter="formatterTime"></el-table-column>
        <el-table-column prop="repairName" :label="$t('deviceSendElectric.repairName')" width="120" header-align="center" align="center"></el-table-column>
        <el-table-column prop="orderId" :label="$t('deviceSendElectric.orderId')" width="125" header-align="center" align="center"></el-table-column>
        <el-table-column prop="planHour" :label="$t('deviceSendElectric.planHour')" header-align="center" align="center"></el-table-column>
        <el-table-column prop="sendElectricDevice" :label="$t('deviceSendElectric.sendElectricDevice')" width="100" header-align="center" align="center"></el-table-column>
        <el-table-column prop="sendElectricOtherDevice" :label="$t('deviceSendElectric.sendElectricOtherDevice')" width="120" header-align="center" align="center"></el-table-column>
        <el-table-column prop="influenceRange" :label="$t('deviceSendElectric.influenceRange')" header-align="center" align="center"></el-table-column>
        <el-table-column prop="applyPreson" :label="$t('deviceSendElectric.applyPreson')" header-align="center" align="center"></el-table-column>
        <el-table-column prop="createDate" :label="$t('deviceSendElectric.createDate')" header-align="center" width="120" align="center"></el-table-column>
        <el-table-column prop="applyConfirmPreson" :label="$t('deviceSendElectric.applyConfirmPreson')" width="120" header-align="center" align="center"></el-table-column>
        <el-table-column prop="carryoutPreson" :label="$t('deviceSendElectric.carryoutPreson')" header-align="center" align="center"></el-table-column>
        <el-table-column prop="carryoutConfirmPreson" :label="$t('deviceSendElectric.carryoutConfirmPreson')" width="120" header-align="center" align="center"></el-table-column>
        <el-table-column prop="finishPreson" :label="$t('deviceSendElectric.finishPreson')" header-align="center" width="80" align="center"></el-table-column>
        <el-table-column prop="finishConfirmPreson" :label="$t('deviceSendElectric.finishConfirmPreson')" header-align="center" width="100" align="center"></el-table-column>
      </el-table>
      <el-pagination
      :current-page="page"
      :page-sizes="[10, 20, 50, 100]"
      :page-size="limit"
      :total="total"
      layout="total, sizes, prev, pager, next, jumper"
      @size-change="pageSizeChangeHandle"
      @current-change="pageCurrentChangeHandle">
    </el-pagination>
    </div>
  </el-card>
</template>
<script>
import mixinViewModule from '../until/app-view-module'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/iailab-ntt-coal-app/api/web/device-send-electric/select/history/list',
        getDataListIsPage: true,
        exportURL: '/iailab-ntt-coal-app/api/web/device-send-electric/export'
      },
      dataForm: {
        startDate: '',
        endDate:'',
        sendElectricDevice: ''
      },
    }
  },
  methods:{
    // 截取时间 只展示年月日
    formatterTime(row, column) {
      let data = row[column.property]
      return /\d{4}-\d{1,2}-\d{1,2}/g.exec(data)
    },
  }
}
</script>
src/views/modules/app/electric/stop-electric-history-list.vue
对比新文件
@@ -0,0 +1,88 @@
<template>
    <el-card shadow="never" class="aui-card--fill">
      <div class="mod-sys__user">
        <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
          <el-form-item>
            <span>申请日期:</span>
            <el-date-picker v-model="dataForm.startDate" type="date"></el-date-picker>
          </el-form-item>
          <el-form-item>至</el-form-item>
          <el-form-item>
            <el-date-picker v-model="dataForm.endDate" type="date"></el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-input v-model="dataForm.stopElectricDevice" :placeholder="$t('deviceStopElectric.stopElectricDevice')" clearable></el-input>
          </el-form-item>
          <el-form-item>
            <el-button @click="getDataList()">{{ $t('query') }}</el-button>
          </el-form-item>
          <el-form-item>
            <el-button  type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
          </el-form-item>
        </el-form>
        <el-table
          v-loading="dataListLoading"
          :data="dataList"
          border
          @selection-change="dataListSelectionChangeHandle"
          @sort-change="dataListSortChangeHandle"
          style="width: 100%;">
          <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
          <el-table-column prop="deptName" :label="$t('deviceStopElectric.deptName')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="applyDate" :label="$t('deviceStopElectric.applyDate')" width="100" header-align="center" align="center" :formatter="formatterTime"></el-table-column>
          <el-table-column prop="repairName" :label="$t('deviceStopElectric.repairName')" width="120" header-align="center" align="center"></el-table-column>
          <el-table-column prop="orderId" :label="$t('deviceStopElectric.orderId')" width="125" header-align="center" align="center"></el-table-column>
          <el-table-column prop="planHour" :label="$t('deviceStopElectric.planHour')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="stopElectricDevice" :label="$t('deviceStopElectric.stopElectricDevice')" width="100" header-align="center" align="center"></el-table-column>
          <el-table-column prop="stopElectricOtherDevice" :label="$t('deviceStopElectric.stopElectricOtherDevice')" width="120" header-align="center" align="center"></el-table-column>
          <el-table-column prop="influenceRange" :label="$t('deviceStopElectric.influenceRange')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="applyPreson" :label="$t('deviceStopElectric.applyPreson')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="createDate" :label="$t('deviceStopElectric.createDate')" header-align="center" width="120" align="center"></el-table-column>
          <el-table-column prop="applyConfirmPreson" :label="$t('deviceStopElectric.applyConfirmPreson')" width="120" header-align="center" align="center"></el-table-column>
          <el-table-column prop="carryoutPreson" :label="$t('deviceStopElectric.carryoutPreson')" header-align="center" align="center"></el-table-column>
          <el-table-column prop="carryoutConfirmPreson" :label="$t('deviceStopElectric.carryoutConfirmPreson')" width="120" header-align="center" align="center"></el-table-column>
          <el-table-column prop="finishPreson" :label="$t('deviceStopElectric.finishPreson')" header-align="center" width="80" align="center"></el-table-column>
          <el-table-column prop="finishConfirmPreson" :label="$t('deviceStopElectric.finishConfirmPreson')" header-align="center" width="100" align="center"></el-table-column>
        </el-table>
        <el-pagination
        :current-page="page"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="limit"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle">
      </el-pagination>
      </div>
    </el-card>
  </template>
  <script>
  import mixinViewModule from '../until/app-view-module'
  export default {
    mixins: [mixinViewModule],
    data () {
      return {
        mixinViewModuleOptions: {
          getDataListURL: '/iailab-ntt-coal-app/api/web/device-stop-electric/select/history/list',
          getDataListIsPage: true,
          exportURL: '/iailab-ntt-coal-app/api/web/device-stop-electric/export'
        },
        dataForm: {
          startDate: '',
          endDate:'',
          stopElectricDevice: ''
        },
      }
    },
    methods:{
      // 截取时间 只展示年月日
      formatterTime(row, column) {
        let data = row[column.property]
        return /\d{4}-\d{1,2}-\d{1,2}/g.exec(data)
      },
    }
  }
  </script>
src/views/modules/app/until/app-view-module.js
对比新文件
@@ -0,0 +1,163 @@
import Cookies from 'js-cookie'
import qs from 'qs'
export default {
  data () {
    /* eslint-disable */
    return {
      // 设置属性
      mixinViewModuleOptions: {
        createdIsNeed: true,       // 此页面是否在创建时,调用查询数据列表接口?
        activatedIsNeed: false,    // 此页面是否在激活(进入)时,调用查询数据列表接口?
        getDataListURL: '',       // 数据列表接口,API地址
        getDataListIsPage: false, // 数据列表接口,是否需要分页?
        deleteURL: '',            // 删除接口,API地址
        deleteIsBatch: false,     // 删除接口,是否需要批量?
        deleteIsBatchKey: 'id',   // 删除接口,批量状态下由那个key进行标记操作?比如:pid,uid...
        exportURL: ''             // 导出接口,API地址
      },
      // 默认属性
      dataForm: {},               // 查询条件
      dataList: [],               // 数据列表
      order: '',                  // 排序,asc/desc
      orderField: '',             // 排序,字段
      page: 1,                    // 当前页码
      limit: 10,                  // 每页数
      total: 0,                   // 总条数
      dataListLoading: false,     // 数据列表,loading状态
      dataListSelections: [],     // 数据列表,多选项
      addOrUpdateVisible: false   // 新增/更新,弹窗visible状态
    }
    /* eslint-enable */
  },
  created () {
    if (this.mixinViewModuleOptions.createdIsNeed) {
      this.query()
    }
  },
  activated () {
    if (this.mixinViewModuleOptions.activatedIsNeed) {
      this.query()
    }
  },
  methods: {
    // 获取数据列表
    query () {
      this.dataListLoading = true
      this.$http.get(
        this.mixinViewModuleOptions.getDataListURL,
        {
          params: {
            order: this.order,
            orderField: this.orderField,
            page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null,
            limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null,
            ...this.dataForm
          }
        }
      ).then(({ data: res }) => {
        this.dataListLoading = false
        if (res.code !== 0) {
          this.dataList = []
          this.total = 0
          return this.$message.error(res.msg)
        }
        this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.records : res.data
        this.total = this.mixinViewModuleOptions.getDataListIsPage ? Number(res.data.total) : 0
      }).catch(() => {
        this.dataListLoading = false
      })
    },
    // 多选
    dataListSelectionChangeHandle (val) {
      this.dataListSelections = val
    },
    // 排序
    dataListSortChangeHandle (data) {
      if (!data.order || !data.prop) {
        this.order = ''
        this.orderField = ''
        return false
      }
      this.order = data.order.replace(/ending$/, '')
      this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase()
      this.query()
    },
    // 分页, 每页条数
    pageSizeChangeHandle (val) {
      this.page = 1
      this.limit = val
      this.query()
    },
    // 分页, 当前页
    pageCurrentChangeHandle (val) {
      this.page = val
      this.query()
    },
    getDataList: function () {
      this.page = 1
      this.query()
    },
    // 新增 / 修改
    addOrUpdateHandle (id) {
      this.addOrUpdateVisible = true
      this.$nextTick(() => {
        this.$refs.addOrUpdate.dataForm.id = id
        this.$refs.addOrUpdate.init()
      })
    },
    // 关闭当前窗口
    closeCurrentTab (data) {
      var tabName = this.$store.state.contentTabsActiveName
      this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
      if (this.$store.state.contentTabs.length <= 0) {
        this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'
        return false
      }
      if (tabName === this.$store.state.contentTabsActiveName) {
        this.$router.push({ name: this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1].name })
      }
    },
    // 删除
    deleteHandle (id) {
      if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {
        return this.$message({
          message: this.$t('prompt.deleteBatch'),
          type: 'warning',
          duration: 500
        })
      }
      this.$confirm(this.$t('prompt.info', { 'handle': this.$t('delete') }), this.$t('prompt.title'), {
        confirmButtonText: this.$t('confirm'),
        cancelButtonText: this.$t('cancel'),
        type: 'warning'
      }).then(() => {
        this.$http.delete(
          `${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id}`,
          this.mixinViewModuleOptions.deleteIsBatch ? {
            'data': id ? [id] : this.dataListSelections.map(item => item[this.mixinViewModuleOptions.deleteIsBatchKey])
          } : {}
        ).then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.$message({
            message: this.$t('prompt.success'),
            type: 'success',
            duration: 500,
            onClose: () => {
              this.query()
            }
          })
        }).catch(() => {})
      }).catch(() => {})
    },
    // 导出
    exportHandle () {
      var params = qs.stringify({
        'token': Cookies.get('token'),
        ...this.dataForm
      })
      window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}`
    }
  }
}
src/views/modules/control/components/gf-right-status.vue
对比新文件
@@ -0,0 +1,363 @@
<template>
  <div id="status-data">
    <dv-border-box-12>
      <div class="status-bar">
        <dv-border-box-8 :reverse="true" :dur="20" style="height: 100%;width: 100%">
          <div class="status-card">
            <div class="status-card-content">
              <div class="status-card-title"><i class="el-icon-cpu"></i><span
                  class="status-card-title-text">通讯状态</span>
              </div>
              <div class="status-card-body">
                <span v-if="opcStatus === '0'" style="color: #ff4d51">异常</span>
                <span v-else style="color: #5daf34">正常</span>
              </div>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div class="log-list">
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="log-title">
            <div class="log-title-text">1#低压风机日志</div>
            <div class="log-title-more">
              <el-button type="text" style="padding: 0; margin: 0;"
                         @click="showRunLog('separation_control', '1#低压风机日志')">详情
              </el-button>
            </div>
          </div>
        </dv-border-box-8>
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="log-title">
            <div class="log-title-text">2#低压风机日志</div>
            <div class="log-title-more">
              <el-button type="text" style="padding: 0; margin: 0;"
                         @click="showRunLog('separation_control', '2#低压风机日志')">详情
              </el-button>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div class="chart-mv">
        <div class="chart-item">
          <dv-border-box-13>
            <div class="chart-content">
              <div class="chart-title">标题示例</div>
              <div class="chart-body">
                <div ref="chartGF1" class="chart-line"></div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
        <div class="chart-item">
          <dv-border-box-13>
            <div class="chart-content">
              <div class="chart-title">标题示例</div>
              <div class="chart-body">
                <div ref="chartGF2" class="chart-line"></div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
      </div>
    </dv-border-box-12>
    <!-- 弹窗, 预测 -->
    <run-log v-if="runLogVisible" ref="runLog"></run-log>
  </div>
</template>
<script>
import RunLog from "@/views/modules/control/components/run-log.vue";
export default {
  components: {RunLog},
  data() {
    return {
      chartGF1: {},
      chartGF2: {},
      opcStatus: '0',
      runLogVisible: false,
    }
  },
  mounted() {
    this.chartGF1 = this.$echarts.init(this.$refs.chartGF1);
    this.chartGF2 = this.$echarts.init(this.$refs.chartGF2);
    let that = this;
    that.init()
    that.refresh()
    setInterval(function () {
      that.init()
    }, 10000)
    setInterval(function () {
      that.refresh()
    }, 5000)
  },
  methods: {
    init() {
      this.getChartData(this.chartGF1, {code: 'fxcv'})
      this.getChartData(this.chartGF2, {code: 'fxdv'})
    },
    refresh() {
      this.getOpcStatus()
    },
    showRunLog(modelCode, title) {
      this.runLogVisible = true
      this.$nextTick(() => {
        this.$refs.runLog.title = title
        this.$refs.runLog.dataForm.modelCode = modelCode
        this.$refs.runLog.init()
      })
    },
    getOpcStatus() {
      this.$http.get('/api/postal-status/WatchDogSTS').then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.opcStatus = res.data
      }).catch(() => {
      })
    },
    getChartData(chart, params) {
      let option = {
        title: {
          text: name
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          right: '70',
          textStyle: {
            // 图例文字的样式
            color: '#fff',
            fontSize: 14,
            padding: [2, 0, 0, 2],
            fontWeight: 100,
          },
        },
        grid: {
          top: '25%',
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value',
          splitLine: {
            show: false
          },
          axisLine: {
            show: true,
            onZero: false,
            color: '#FFFFFF',
          },
          axisTick: {show: true},
          axisLabel: {
            formatter: '{value}'
          }
        },
        series: [
          {
            name: '图例1',
            data: [150, 230, 282, 218, 135, 147, 260],
            type: 'line',
            smooth: true,
            showSymbol: true,
            color: '#00C2FF'
          },
          {
            name: '图例2',
            data: [260, 147, 218, 135, 290, 260, 230],
            type: 'line',
            smooth: true,
            showSymbol: true,
            color: '#FFAA5D'
          }
        ]
      };
      option && chart.setOption(option);
    }
  }
}
</script>
<style scoped>
.list-title {
  padding-top: 20px;
  padding-left: 20px;
  padding-bottom: 0px;
  text-align: left;
  display: flex;
  flex-direction: row;
}
.number-item {
  width: 100%;
  height: 22%;
  padding: 12px;
  margin-top: -2px;
}
.number-item p:first-child {
  margin: 0;
  font-size: 12px;
  color: #FFFFFF;
}
.number-item p:last-child {
  margin: 0;
  padding: 2px;
  font-size: 20px;
  font-weight: 600;
  color: #46bd87;
}
.number-item:hover {
  box-shadow: 0 10px 26px 0 rgba(48, 55, 66, 0.5); /* 鼠标悬浮时盒子出现的阴影 */
  background-color: rgba(102, 177, 255, 0.1);
}
.number-text {
  background-color: rgba(102, 177, 255, 0.1);
}
.log-title {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  background-color: rgba(102, 177, 255, 0.1);
}
.log-title-text {
  width: 70%;
  color: #59C5F3;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding-top: 23px;
}
.log-title-more {
  width: 30%;
  font-size: 14px;
  padding-top: 23px;
}
.list-title-text {
  width: 85%;
  font-size: 14px;
  font-weight: 600;
  color: #59C5F3;
}
.number-body {
  width: 100%;
  height: 90%;
  padding: 5px 5px 0 5px;
  display: flex;
  flex-direction: row;
}
.list-body {
  width: 100%;
  height: 90%;
  padding: 10px;
}
.status-card-title-text {
  color: #59C5F3;
  padding-left: 5px;
}
.status-card-body {
  height: 100%;
  padding-left: 100px;
  margin-top: 0px;
  padding-top: 0px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.status-card-title {
  color: #59C5F3;
}
.status-card-content {
  padding: 12px;
  background-color: rgba(102, 177, 255, 0.1);
}
.status-card {
  width: 100%;
  height: 100%;
  padding: 5px;
}
.status-bar {
  width: 53%;
  height: 8%;
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
}
.log-list {
  width: 100%;
  height: 8%;
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
}
#status-data {
  width: 100%;
  height: 100%;
  padding: 5px;
  display: flex;
  flex-direction: column;
}
.chart-mv {
  width: 100%;
  height: 84%;
  padding: 5px;
}
.chart-item {
  width: 100%;
  height: 50%;
}
.chart-content {
  width: 100%;
  height: 100%;
  padding: 10px;
}
.chart-title {
  padding: 5px;
  color: #59C5F3;
}
.chart-body {
  width: 100%;
  height: 90%;
  background-color: rgba(102, 177, 255, 0.1);
}
.chart-line {
  width: 100%;
  height: 100%;
}
</style>
src/views/modules/control/components/nsyl-right-status.vue
对比新文件
@@ -0,0 +1,495 @@
<template>
  <div id="status-data">
    <dv-border-box-12>
      <div class="status-bar">
        <dv-border-box-8 :reverse="true" :dur="20" style="height: 100%;width: 100%">
          <div class="status-card">
            <div class="status-card-content">
              <div class="status-card-title"><i class="el-icon-cpu"></i><span
                  class="status-card-title-text">通讯状态</span>
              </div>
              <div class="status-card-body">
                <span v-if="opcStatus === '0'" style="color: #ff4d51">异常</span>
                <span v-else style="color: #5daf34">正常</span>
              </div>
            </div>
          </div>
        </dv-border-box-8>
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="status-card">
            <div class="status-card-content">
              <div class="status-card-title"><i class="el-icon-mouse"></i><span
                  class="status-card-title-text">加药控制</span>
              </div>
              <div class="status-card-body">
                <span v-if="controllerIcadOnsts === '0'" style="color: #ff4d51">手动</span>
                <span v-else style="color: #5daf34">自动</span>
              </div>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div class="log-list">
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="log-title">
            <div class="log-title-text">旋流器浓缩日志</div>
            <div class="log-title-more">
              <el-button type="text" style="padding: 0; margin: 0;"
                         @click="showRunLog('separation_control', '旋流器浓缩日志')">详情
              </el-button>
            </div>
          </div>
        </dv-border-box-8>
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="log-title">
            <div class="log-title-text">浅槽浓缩日志</div>
            <div class="log-title-more">
              <el-button type="text" style="padding: 0; margin: 0;"
                         @click="showRunLog('separation_control', '浅槽浓缩日志')">详情
              </el-button>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div class="chart-mv">
        <div class="chart-item">
          <dv-border-box-13>
            <div class="chart-content">
              <div class="chart-title">加药控制变量(MV)</div>
              <div class="chart-body">
                <div ref="chartJYMV" class="chart-line"></div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
        <div class="chart-item">
          <dv-border-box-13>
            <div class="chart-content">
              <div class="chart-title">加药被控变量(CV)</div>
              <div class="chart-body">
                <div ref="chartJYCV" class="chart-line"></div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
      </div>
    </dv-border-box-12>
    <!-- 弹窗, 预测 -->
    <run-log v-if="runLogVisible" ref="runLog"></run-log>
  </div>
</template>
<script>
import RunLog from "@/views/modules/control/components/run-log.vue";
export default {
  components: {RunLog},
  data() {
    return {
      chartJYMV: {},
      chartJYCV: {},
      opcStatus: '0',
      controlModel: 0,
      controllerIcadOnsts: '0', // 智能分选控制器启动状态
      predictValueVisible: false,
      predictValue: {
        densityPredict: {
          name: '合介密度(kg/L)',
          modelId: 'd992e966-d7ba-48d9-95b7-9adae8b7eec4',
          modelCode: 'DensityPredict',
          resultKey: 'preDensity',
          pointNo: '8039',
          runTime: '',
          value: 0,
        },
        dosingsystempreYin1: {
          name: '阴离子泵1#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yin_1',
          pointNo: '8134',
          runTime: '',
          value: 0,
        },
        dosingsystempreYin2: {
          name: '阴离子泵2#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yin_2',
          pointNo: '8135',
          runTime: '',
          value: 0,
        },
        dosingsystempreYang1: {
          name: '阳离子泵1#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yang_1',
          pointNo: '8129',
          runTime: '',
          value: 0,
        },
        dosingsystempreYang2: {
          name: '阳离子泵2#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yang_2',
          pointNo: '8130',
          runTime: '',
          value: 0,
        }
      },
      runLogVisible: false,
    }
  },
  mounted() {
    this.chartJYMV = this.$echarts.init(this.$refs.chartJYMV);
    this.chartJYCV = this.$echarts.init(this.$refs.chartJYCV);
    let that = this;
    that.init()
    that.refresh()
    setInterval(function () {
      that.init()
    }, 10000)
  },
  methods: {
    init() {
      this.getPredictValue(this.predictValue.densityPredict)
      this.getChartData(this.chartJYMV, {code: 'qcmv'})
      this.getChartData(this.chartJYCV, {code: 'qccv'})
    },
    refresh() {
      this.getOpcStatus()
      this.getControllerIcadOnsts()
    },
    getPredictValue(modelParams) {
      this.$http.get(`/api/model-result/${modelParams.modelCode}`).then(({data: res}) => {
        if (res.code !== 0) {
          console.log("url=/api/model-result,params=" + modelParams.modelCode)
          return this.$message.error(res.msg)
        }
        modelParams.value = res.data[modelParams.resultKey]
        modelParams.runTime = res.data['result_time']
      }).catch(() => {
      })
    },
    viewPredictValue(modelParams) {
      this.predictValueVisible = true
      this.$nextTick(() => {
        this.$refs.predictValue.init(modelParams)
      })
    },
    showRunLog(modelCode, title) {
      this.runLogVisible = true
      this.$nextTick(() => {
        this.$refs.runLog.title = title
        this.$refs.runLog.dataForm.modelCode = modelCode
        this.$refs.runLog.init()
      })
    },
    getControllerIcadOnsts() {
      this.$http.get('/api/postal-status/Controller_ICAD_ONSTS').then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.controllerIcadOnsts = res.data
      }).catch(() => {
      })
    },
    getOpcStatus() {
      this.$http.get('/api/postal-status/WatchDogSTS').then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.opcStatus = res.data
      }).catch(() => {
      })
    },
    getLogFx() {
      this.$http.get('/api/log/last-fx', {params: {limit: 3}}).then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.fxConfig = {
          header: ['时间', '结果'],
          rowNum: 3,
          waitTime: 10000,
          columnWidth: [350, 500],
          align: ['center'],
          headerBGC: '#1981f6',
          headerHeight: 40,
          oddRowBGC: 'rgba(0, 44, 81, 0.8)',
          evenRowBGC: 'rgba(10, 29, 50, 0.8)',
          data: res.data
        }
      }).catch(() => {
      })
    },
    getLogJy() {
      this.$http.get('/api/log/last-jy', {params: {limit: 3}}).then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.jyConfig = {
          header: ['时间', '结果'],
          rowNum: 3,
          waitTime: 10000,
          columnWidth: [350, 500],
          align: ['center'],
          headerBGC: '#1981f6',
          headerHeight: 40,
          oddRowBGC: 'rgba(0, 44, 81, 0.8)',
          evenRowBGC: 'rgba(10, 29, 50, 0.8)',
          data: res.data
        }
      }).catch(() => {
      })
    },
    getChartData(chart, params) {
      let option = {
        title: {
          text: name
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          right: '70',
          textStyle: {
            // 图例文字的样式
            color: '#fff',
            fontSize: 14,
            padding: [2, 0, 0, 2],
            fontWeight: 100,
          },
        },
        grid: {
          top: '25%',
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value',
          splitLine: {
            show: false
          },
          axisLine: {
            show: true,
            onZero: false,
            color: '#FFFFFF',
          },
          axisTick: {show: true},
          axisLabel: {
            formatter: '{value}'
          }
        },
        series: [
          {
            name: '灰分',
            data: [150, 230, 282, 218, 135, 147, 260],
            type: 'line',
            smooth: true,
            showSymbol: true,
            color: '#00C2FF'
          },
          {
            name: '热值',
            data: [260, 147, 218, 135, 290, 260, 230],
            type: 'line',
            smooth: true,
            showSymbol: true,
            color: '#FFAA5D'
          }
        ]
      };
      option && chart.setOption(option);
    }
  }
}
</script>
<style scoped>
.list-title {
  padding-top: 20px;
  padding-left: 20px;
  padding-bottom: 0px;
  text-align: left;
  display: flex;
  flex-direction: row;
}
.number-item {
  width: 100%;
  height: 22%;
  padding: 12px;
  margin-top: -2px;
}
.number-item p:first-child {
  margin: 0;
  font-size: 12px;
  color: #FFFFFF;
}
.number-item p:last-child {
  margin: 0;
  padding: 2px;
  font-size: 20px;
  font-weight: 600;
  color: #46bd87;
}
.number-item:hover {
  box-shadow: 0 10px 26px 0 rgba(48, 55, 66, 0.5); /* 鼠标悬浮时盒子出现的阴影 */
  background-color: rgba(102, 177, 255, 0.1);
}
.number-text {
  background-color: rgba(102, 177, 255, 0.1);
}
.log-title {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  background-color: rgba(102, 177, 255, 0.1);
}
.log-title-text {
  width: 70%;
  color: #59C5F3;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding-top: 23px;
}
.log-title-more {
  width: 30%;
  font-size: 14px;
  padding-top: 23px;
}
.list-title-text {
  width: 85%;
  font-size: 14px;
  font-weight: 600;
  color: #59C5F3;
}
.number-body {
  width: 100%;
  height: 90%;
  padding: 5px 5px 0 5px;
  display: flex;
  flex-direction: row;
}
.list-body {
  width: 100%;
  height: 90%;
  padding: 10px;
}
.status-card-title-text {
  color: #59C5F3;
  padding-left: 5px;
}
.status-card-body {
  height: 100%;
  padding-left: 100px;
  margin-top: 0px;
  padding-top: 0px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.status-card-title {
  color: #59C5F3;
}
.status-card-content {
  padding: 12px;
  background-color: rgba(102, 177, 255, 0.1);
}
.status-card {
  width: 100%;
  height: 100%;
  padding: 5px;
}
.status-bar {
  width: 100%;
  height: 8%;
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
}
.log-list {
  width: 100%;
  height: 8%;
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
}
#status-data {
  width: 100%;
  height: 100%;
  padding: 5px;
  display: flex;
  flex-direction: column;
}
.chart-mv {
  width: 100%;
  height: 84%;
  padding: 5px;
}
.chart-item {
  width: 100%;
  height: 50%;
}
.chart-content {
  width: 100%;
  height: 100%;
  padding: 10px;
}
.chart-title {
  padding: 5px;
  color: #59C5F3;
}
.chart-body {
  width: 100%;
  height: 90%;
  background-color: rgba(102, 177, 255, 0.1);
}
.chart-line {
  width: 100%;
  height: 100%;
}
</style>
src/views/modules/control/components/pmpc-right-status.vue
对比新文件
@@ -0,0 +1,358 @@
<template>
  <div id="status-data">
    <dv-border-box-12>
      <div class="status-bar">
        <dv-border-box-8 :reverse="true" :dur="20" style="height: 100%;width: 100%">
          <div class="status-card">
            <div class="status-card-content">
              <div class="status-card-title"><i class="el-icon-cpu"></i><span
                  class="status-card-title-text">通讯状态</span>
              </div>
              <div class="status-card-body">
                <span v-if="opcStatus === '0'" style="color: #ff4d51">异常</span>
                <span v-else style="color: #5daf34">正常</span>
              </div>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div class="log-list">
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="log-title">
            <div class="log-title-text">配煤配仓日志</div>
            <div class="log-title-more">
              <el-button type="text" style="padding: 0; margin: 0;"
                         @click="showRunLog('separation_control', '配煤配仓日志')">详情
              </el-button>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div class="chart-mv">
        <div class="chart-item">
          <dv-border-box-13>
            <div class="chart-content">
              <div class="chart-title">重介分选控制变量(MV)</div>
              <div class="chart-body">
                <div ref="chartPMPC1" class="chart-line"></div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
        <div class="chart-item">
          <dv-border-box-13>
            <div class="chart-content">
              <div class="chart-title">重介分选被控变量(CV)</div>
              <div class="chart-body">
                <div ref="chartPMPC2" class="chart-line"></div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
      </div>
    </dv-border-box-12>
    <!-- 弹窗, 预测 -->
    <run-log v-if="runLogVisible" ref="runLog"></run-log>
  </div>
</template>
<script>
import RunLog from "@/views/modules/control/components/run-log.vue";
export default {
  components: {RunLog},
  data() {
    return {
      chartPMPC1: {},
      chartPMPC2: {},
      opcStatus: '0',
      controlModel: 0,
      runLogVisible: false
    }
  },
  mounted() {
    this.chartPMPC1 = this.$echarts.init(this.$refs.chartPMPC1);
    this.chartPMPC2 = this.$echarts.init(this.$refs.chartPMPC2);
    let that = this;
    that.init()
    that.refresh()
    setInterval(function () {
      that.init()
    }, 10000)
    setInterval(function () {
      that.refresh()
    }, 5000)
  },
  methods: {
    init() {
      this.getChartData(this.chartPMPC1, {code: 'fxcv'})
      this.getChartData(this.chartPMPC2, {code: 'fxdv'})
    },
    refresh() {
      this.getOpcStatus()
    },
    showRunLog(modelCode, title) {
      this.runLogVisible = true
      this.$nextTick(() => {
        this.$refs.runLog.title = title
        this.$refs.runLog.dataForm.modelCode = modelCode
        this.$refs.runLog.init()
      })
    },
    getOpcStatus() {
      this.$http.get('/api/postal-status/WatchDogSTS').then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.opcStatus = res.data
      }).catch(() => {
      })
    },
    getChartData(chart, params) {
      let option = {
        title: {
          text: name
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          right: '70',
          textStyle: {
            // 图例文字的样式
            color: '#fff',
            fontSize: 14,
            padding: [2, 0, 0, 2],
            fontWeight: 100,
          },
        },
        grid: {
          top: '25%',
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value',
          splitLine: {
            show: false
          },
          axisLine: {
            show: true,
            onZero: false,
            color: '#FFFFFF',
          },
          axisTick: {show: true},
          axisLabel: {
            formatter: '{value}'
          }
        },
        series: [
          {
            name: '图例1',
            data: [150, 230, 282, 218, 135, 147, 260],
            type: 'line',
            smooth: true,
            showSymbol: true,
            color: '#00C2FF'
          },
          {
            name: '图例2',
            data: [260, 147, 218, 135, 290, 260, 230],
            type: 'line',
            smooth: true,
            showSymbol: true,
            color: '#FFAA5D'
          }
        ]
      };
      option && chart.setOption(option);
    }
  }
}
</script>
<style scoped>
.list-title {
  padding-top: 20px;
  padding-left: 20px;
  padding-bottom: 0px;
  text-align: left;
  display: flex;
  flex-direction: row;
}
.number-item {
  width: 100%;
  height: 22%;
  padding: 12px;
  margin-top: -2px;
}
.number-item p:first-child {
  margin: 0;
  font-size: 12px;
  color: #FFFFFF;
}
.number-item p:last-child {
  margin: 0;
  padding: 2px;
  font-size: 20px;
  font-weight: 600;
  color: #46bd87;
}
.number-item:hover {
  box-shadow: 0 10px 26px 0 rgba(48, 55, 66, 0.5); /* 鼠标悬浮时盒子出现的阴影 */
  background-color: rgba(102, 177, 255, 0.1);
}
.number-text {
  background-color: rgba(102, 177, 255, 0.1);
}
.log-title {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  background-color: rgba(102, 177, 255, 0.1);
}
.log-title-text {
  width: 70%;
  color: #59C5F3;
  font-size: 14px;
  font-weight: 600;
  padding-left: 23px;
  padding-top: 23px;
}
.log-title-more {
  width: 30%;
  font-size: 14px;
  text-align: right;
  padding-right: 29px;
  padding-top: 23px;
}
.list-title-text {
  width: 85%;
  font-size: 14px;
  font-weight: 600;
  color: #59C5F3;
}
.number-body {
  width: 100%;
  height: 90%;
  padding: 5px 5px 0 5px;
  display: flex;
  flex-direction: row;
}
.list-body {
  width: 100%;
  height: 90%;
  padding: 10px;
}
.status-card-title-text {
  color: #59C5F3;
  padding-left: 5px;
}
.status-card-body {
  height: 100%;
  padding-left: 100px;
  margin-top: 0px;
  padding-top: 0px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.status-card-title {
  color: #59C5F3;
}
.status-card-content {
  padding: 12px;
  background-color: rgba(102, 177, 255, 0.1);
}
.status-card {
  width: 100%;
  height: 100%;
  padding: 5px;
}
.status-bar {
  width: 53%;
  height: 8%;
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
}
.log-list {
  width: 100%;
  height: 8%;
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
}
#status-data {
  width: 100%;
  height: 100%;
  padding: 5px;
  display: flex;
  flex-direction: column;
}
.chart-mv {
  width: 100%;
  height: 84%;
  padding: 5px;
}
.chart-item {
  width: 100%;
  height: 50%;
}
.chart-content {
  width: 100%;
  height: 100%;
  padding: 10px;
}
.chart-title {
  padding: 5px;
  color: #59C5F3;
}
.chart-body {
  width: 100%;
  height: 90%;
  background-color: rgba(102, 177, 255, 0.1);
}
.chart-line {
  width: 100%;
  height: 100%;
}
</style>
src/views/modules/control/components/qcfx-right-status.vue
对比新文件
@@ -0,0 +1,496 @@
<template>
  <div id="status-data">
    <dv-border-box-12>
      <div class="status-bar">
        <dv-border-box-8 :reverse="true" :dur="20" style="height: 100%;width: 100%">
          <div class="status-card">
            <div class="status-card-content">
              <div class="status-card-title"><i class="el-icon-cpu"></i><span
                  class="status-card-title-text">通讯状态</span>
              </div>
              <div class="status-card-body">
                <span v-if="opcStatus === '0'" style="color: #ff4d51">异常</span>
                <span v-else style="color: #5daf34">正常</span>
              </div>
            </div>
          </div>
        </dv-border-box-8>
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="status-card">
            <div class="status-card-content">
              <div class="status-card-title"><i class="el-icon-mouse"></i><span
                  class="status-card-title-text">浅槽分选控制</span>
              </div>
              <div class="status-card-body">
                <span v-if="controllerIhmsOnsts === '0'" style="color: #ff4d51">手动</span>
                <span v-else style="color: #5daf34">自动</span>
              </div>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div class="log-list">
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="log-title">
            <div class="log-title-text">307浅槽日志</div>
            <div class="log-title-more">
              <el-button type="text" style="padding: 0; margin: 0;"
                         @click="showRunLog('separation_control', '307浅槽日志')">详情
              </el-button>
            </div>
          </div>
        </dv-border-box-8>
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="log-title">
            <div class="log-title-text">308浅槽日志</div>
            <div class="log-title-more">
              <el-button type="text" style="padding: 0; margin: 0;"
                         @click="showRunLog('separation_control', '308浅槽日志')">详情
              </el-button>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div class="predict-value">
        <dv-border-box-13>
          <div class="list-title">
            <span class="list-title-text">预测值</span>
          </div>
          <div class="number-body">
            <div class="number-item" @click="viewPredictValue(predictValue.densityPredict)">
              <p class="number-text">合介密度(kg/L)</p>
              <p>{{ predictValue.densityPredict.value }}</p>
            </div>
            <div class="number-item" @click="viewPredictValue(predictValue.dosingsystempreYin1)">
              <p class="number-text">阴离子泵1#频率</p>
              <p>{{ predictValue.dosingsystempreYin1.value }}</p>
            </div>
            <div class="number-item" @click="viewPredictValue(predictValue.dosingsystempreYin2)">
              <p class="number-text">阴离子泵2#频率</p>
              <p>{{ predictValue.dosingsystempreYin2.value }}</p>
            </div>
            <div class="number-item" @click="viewPredictValue(predictValue.dosingsystempreYang1)">
              <p class="number-text">阳离子泵1#频率</p>
              <p>{{ predictValue.dosingsystempreYang1.value }}</p>
            </div>
            <div class="number-item" @click="viewPredictValue(predictValue.dosingsystempreYang2)">
              <p class="number-text">阳离子泵2#频率</p>
              <p>{{ predictValue.dosingsystempreYang2.value }}</p>
            </div>
          </div>
        </dv-border-box-13>
      </div>
      <div class="chart-mv">
        <div class="chart-item">
          <dv-border-box-13>
            <div class="chart-content">
              <div class="chart-title">浅槽分选控制变量(MV)</div>
              <div class="chart-body">
                <div ref="chartQCMV" class="chart-line"></div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
        <div class="chart-item">
          <dv-border-box-13>
            <div class="chart-content">
              <div class="chart-title">浅槽分选被控变量(CV)</div>
              <div class="chart-body">
                <div ref="chartQCCV" class="chart-line"></div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
      </div>
    </dv-border-box-12>
    <!-- 弹窗, 预测 -->
    <run-log v-if="runLogVisible" ref="runLog"></run-log>
  </div>
</template>
<script>
import RunLog from "@/views/modules/control/components/run-log.vue";
export default {
  components: {RunLog},
  data() {
    return {
      chartQCMV: {},
      chartQCCV: {},
      opcStatus: '0',
      controlModel: 0,
      controllerIhmsOnsts: '0', // 智能分选控制器启动状态
      predictValueVisible: false,
      predictValue: {
        densityPredict: {
          name: '合介密度(kg/L)',
          modelId: 'd992e966-d7ba-48d9-95b7-9adae8b7eec4',
          modelCode: 'DensityPredict',
          resultKey: 'preDensity',
          pointNo: '8039',
          runTime: '',
          value: 0,
        },
        dosingsystempreYin1: {
          name: '阴离子泵1#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yin_1',
          pointNo: '8134',
          runTime: '',
          value: 0,
        },
        dosingsystempreYin2: {
          name: '阴离子泵2#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yin_2',
          pointNo: '8135',
          runTime: '',
          value: 0,
        },
        dosingsystempreYang1: {
          name: '阳离子泵1#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yang_1',
          pointNo: '8129',
          runTime: '',
          value: 0,
        },
        dosingsystempreYang2: {
          name: '阳离子泵2#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yang_2',
          pointNo: '8130',
          runTime: '',
          value: 0,
        }
      },
      runLogVisible: false,
    }
  },
  mounted() {
    this.chartQCMV = this.$echarts.init(this.$refs.chartQCMV);
    this.chartQCCV = this.$echarts.init(this.$refs.chartQCCV);
    let that = this;
    that.init()
    that.refresh()
    setInterval(function () {
      that.init()
    }, 10000)
    setInterval(function () {
      that.refresh()
    }, 5000)
  },
  methods: {
    init() {
      this.getPredictValue(this.predictValue.densityPredict)
      this.getChartData(this.chartQCMV, {code: 'fxcv'})
      this.getChartData(this.chartQCCV, {code: 'fxdv'})
    },
    refresh() {
      this.getOpcStatus()
      this.getControllerIhmsOnsts()
      this.getControllerIcadOnsts()
    },
    getPredictValue(modelParams) {
      this.$http.get(`/api/model-result/${modelParams.modelCode}`).then(({data: res}) => {
        if (res.code !== 0) {
          console.log("url=/api/model-result,params=" + modelParams.modelCode)
          return this.$message.error(res.msg)
        }
        modelParams.value = res.data[modelParams.resultKey]
        modelParams.runTime = res.data['result_time']
      }).catch(() => {
      })
    },
    viewPredictValue(modelParams) {
      this.predictValueVisible = true
      this.$nextTick(() => {
        this.$refs.predictValue.init(modelParams)
      })
    },
    showRunLog(modelCode, title) {
      this.runLogVisible = true
      this.$nextTick(() => {
        this.$refs.runLog.title = title
        this.$refs.runLog.dataForm.modelCode = modelCode
        this.$refs.runLog.init()
      })
    },
    getControllerIhmsOnsts() {
      this.$http.get('/api/postal-status/Controller_IHMS_ONSTS').then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.controllerIhmsOnsts = res.data
      }).catch(() => {
      })
    },
    getOpcStatus() {
      this.$http.get('/api/postal-status/WatchDogSTS').then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.opcStatus = res.data
      }).catch(() => {
      })
    },
    getChartData(chart, params) {
      let option = {
        title: {
          text: name
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          right: '70',
          textStyle: {
            // 图例文字的样式
            color: '#fff',
            fontSize: 14,
            padding: [2, 0, 0, 2],
            fontWeight: 100,
          },
        },
        grid: {
          top: '25%',
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value',
          splitLine: {
            show: false
          },
          axisLine: {
            show: true,
            onZero: false,
            color: '#FFFFFF',
          },
          axisTick: {show: true},
          axisLabel: {
            formatter: '{value}'
          }
        },
        series: [
          {
            name: '灰分',
            data: [150, 230, 282, 218, 135, 147, 260],
            type: 'line',
            smooth: true,
            showSymbol: true,
            color: '#00C2FF'
          },
          {
            name: '热值',
            data: [260, 147, 218, 135, 290, 260, 230],
            type: 'line',
            smooth: true,
            showSymbol: true,
            color: '#FFAA5D'
          }
        ]
      };
      option && chart.setOption(option);
    }
  }
}
</script>
<style scoped>
.list-title {
  padding-top: 20px;
  padding-left: 20px;
  padding-bottom: 0px;
  text-align: left;
  display: flex;
  flex-direction: row;
}
.number-item {
  width: 100%;
  height: 22%;
  padding: 12px;
  margin-top: -2px;
}
.number-item p:first-child {
  margin: 0;
  font-size: 12px;
  color: #FFFFFF;
}
.number-item p:last-child {
  margin: 0;
  padding: 2px;
  font-size: 20px;
  font-weight: 600;
  color: #46bd87;
}
.number-item:hover {
  box-shadow: 0 10px 26px 0 rgba(48, 55, 66, 0.5); /* 鼠标悬浮时盒子出现的阴影 */
  background-color: rgba(102, 177, 255, 0.1);
}
.number-text {
  background-color: rgba(102, 177, 255, 0.1);
}
.log-title {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  background-color: rgba(102, 177, 255, 0.1);
}
.log-title-text {
  width: 70%;
  color: #59C5F3;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding-top: 23px;
}
.log-title-more {
  width: 30%;
  font-size: 14px;
  padding-top: 23px;
}
.list-title-text {
  width: 85%;
  font-size: 14px;
  font-weight: 600;
  color: #59C5F3;
}
.number-body {
  width: 100%;
  height: 90%;
  padding: 5px 5px 0 5px;
  display: flex;
  flex-direction: row;
}
.list-body {
  width: 100%;
  height: 90%;
  padding: 10px;
}
.status-card-title-text {
  color: #59C5F3;
  padding-left: 5px;
}
.status-card-body {
  height: 100%;
  padding-left: 100px;
  margin-top: 0px;
  padding-top: 0px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.status-card-title {
  color: #59C5F3;
}
.status-card-content {
  padding: 12px;
  background-color: rgba(102, 177, 255, 0.1);
}
.status-card {
  width: 100%;
  height: 100%;
  padding: 5px;
}
.status-bar {
  width: 100%;
  height: 8%;
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
}
.log-list {
  width: 100%;
  height: 8%;
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
}
.predict-value {
  width: 100%;
  height: 14%;
  padding: 5px;
}
#status-data {
  width: 100%;
  height: 100%;
  padding: 5px;
  display: flex;
  flex-direction: column;
}
.chart-mv {
  width: 100%;
  height: 70%;
  padding: 5px;
}
.chart-item {
  width: 100%;
  height: 50%;
}
.chart-content {
  width: 100%;
  height: 100%;
  padding: 10px;
}
.chart-title {
  padding: 5px;
  color: #59C5F3;
}
.chart-body {
  width: 100%;
  height: 90%;
  background-color: rgba(102, 177, 255, 0.1);
}
.chart-line {
  width: 100%;
  height: 100%;
}
</style>
src/views/modules/control/components/run-log.vue
对比新文件
@@ -0,0 +1,58 @@
<template>
  <el-dialog
      :title="title"
      :modal="false"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :visible.sync="visible">
    <div class="mod-mcs__runlog}">
<!--      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">-->
<!--        <el-form-item>-->
<!--          <el-input v-model="dataForm.modelCode" placeholder="模型代码" clearable></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item>-->
<!--          <el-button @click="getDataList()">{{ $t('query') }}</el-button>-->
<!--        </el-form-item>-->
<!--      </el-form>-->
      <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
        <el-table-column prop="runTime" label="运行时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="runResult" label="运行结果" header-align="center" align="left" min-width="300"></el-table-column>
      </el-table>
<!--      <el-pagination-->
<!--          :current-page="page"-->
<!--          :page-sizes="[5, 20, 50]"-->
<!--          :page-size="limit"-->
<!--          :total="total"-->
<!--          layout="total, sizes, prev, pager, next, jumper"-->
<!--          @size-change="pageSizeChangeHandle"-->
<!--          @current-change="pageCurrentChangeHandle">-->
<!--      </el-pagination>-->
    </div>
  </el-dialog>
</template>
<script>
  import mixinViewModule from '@/mixins/view-module'
  export default {
    mixins: [mixinViewModule],
    data() {
      return {
        mixinViewModuleOptions: {
          getDataListURL: '/api/mcs/runlog/page',
          getDataListIsPage: true,
        },
        visible: false,
        title: '',
        dataForm: {
          modelCode: '0',
        }
      }
    },
    methods: {
      init() {
        this.visible = true
        this.getDataList()
      }
    }
  }
</script>
src/views/modules/control/components/zjfx-right-status.vue
对比新文件
@@ -0,0 +1,489 @@
<template>
  <div id="status-data">
    <dv-border-box-12>
      <div class="status-bar">
        <dv-border-box-8 :reverse="true" :dur="20" style="height: 100%;width: 100%">
          <div class="status-card">
            <div class="status-card-content">
              <div class="status-card-title"><i class="el-icon-cpu"></i><span
                  class="status-card-title-text">通讯状态</span>
              </div>
              <div class="status-card-body">
                <span v-if="opcStatus === '0'" style="color: #ff4d51">异常</span>
                <span v-else style="color: #5daf34">正常</span>
              </div>
            </div>
          </div>
        </dv-border-box-8>
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="status-card">
            <div class="status-card-content">
              <div class="status-card-title"><i class="el-icon-mouse"></i><span
                  class="status-card-title-text">重介分选控制</span>
              </div>
              <div class="status-card-body">
                <span v-if="controllerIhmsOnsts === '0'" style="color: #ff4d51">手动</span>
                <span v-else style="color: #5daf34">自动</span>
              </div>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div class="log-list">
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="log-title">
            <div class="log-title-text">3318重介日志</div>
            <div class="log-title-more">
              <el-button type="text" style="padding: 0; margin: 0;"
                         @click="showRunLog('separation_control', '3318重介日志')">详情
              </el-button>
            </div>
          </div>
        </dv-border-box-8>
        <dv-border-box-8 :reverse="true" :dur="20">
          <div class="log-title">
            <div class="log-title-text">3319重介日志</div>
            <div class="log-title-more">
              <el-button type="text" style="padding: 0; margin: 0;"
                         @click="showRunLog('separation_control', '3319重介日志')">详情
              </el-button>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div class="predict-value">
        <dv-border-box-13>
          <div class="list-title">
            <span class="list-title-text">预测值</span>
          </div>
          <div class="number-body">
            <div class="number-item" @click="viewPredictValue(predictValue.densityPredict)">
              <p class="number-text">合介密度(kg/L)</p>
              <p>{{ predictValue.densityPredict.value }}</p>
            </div>
            <div class="number-item" @click="viewPredictValue(predictValue.dosingsystempreYin1)">
              <p class="number-text">阴离子泵1#频率</p>
              <p>{{ predictValue.dosingsystempreYin1.value }}</p>
            </div>
            <div class="number-item" @click="viewPredictValue(predictValue.dosingsystempreYin2)">
              <p class="number-text">阴离子泵2#频率</p>
              <p>{{ predictValue.dosingsystempreYin2.value }}</p>
            </div>
            <div class="number-item" @click="viewPredictValue(predictValue.dosingsystempreYang1)">
              <p class="number-text">阳离子泵1#频率</p>
              <p>{{ predictValue.dosingsystempreYang1.value }}</p>
            </div>
            <div class="number-item" @click="viewPredictValue(predictValue.dosingsystempreYang2)">
              <p class="number-text">阳离子泵2#频率</p>
              <p>{{ predictValue.dosingsystempreYang2.value }}</p>
            </div>
          </div>
        </dv-border-box-13>
      </div>
      <div class="chart-mv">
        <div class="chart-item">
          <dv-border-box-13>
            <div class="chart-content">
              <div class="chart-title">重介分选控制变量(MV)</div>
              <div class="chart-body">
                <div ref="chartZJMV" class="chart-line"></div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
        <div class="chart-item">
          <dv-border-box-13>
            <div class="chart-content">
              <div class="chart-title">重介分选被控变量(CV)</div>
              <div class="chart-body">
                <div ref="chartZJCV" class="chart-line"></div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
      </div>
    </dv-border-box-12>
    <!-- 弹窗, 预测 -->
    <run-log v-if="runLogVisible" ref="runLog"></run-log>
  </div>
</template>
<script>
import RunLog from "@/views/modules/control/components/run-log.vue";
export default {
  components: {RunLog},
  data() {
    return {
      chartZJMV: {},
      chartZJCV: {},
      colors: ['#ff5ca9', '#0ff5f5'],
      opcStatus: '0',
      controlModel: 0,
      controllerIhmsOnsts: '0', // 智能分选控制器启动状态
      predictValueVisible: false,
      predictValue: {
        densityPredict: {
          name: '合介密度(kg/L)',
          modelId: 'd992e966-d7ba-48d9-95b7-9adae8b7eec4',
          modelCode: 'DensityPredict',
          resultKey: 'preDensity',
          pointNo: '8039',
          runTime: '',
          value: 0,
        },
        dosingsystempreYin1: {
          name: '阴离子泵1#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yin_1',
          pointNo: '8134',
          runTime: '',
          value: 0,
        },
        dosingsystempreYin2: {
          name: '阴离子泵2#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yin_2',
          pointNo: '8135',
          runTime: '',
          value: 0,
        },
        dosingsystempreYang1: {
          name: '阳离子泵1#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yang_1',
          pointNo: '8129',
          runTime: '',
          value: 0,
        },
        dosingsystempreYang2: {
          name: '阳离子泵2#频率',
          modelId: 'e4e0f04a-3d6a-45b2-9713-95019d370c57',
          modelCode: 'Dosingsystempre',
          resultKey: 'Pump_yang_2',
          pointNo: '8130',
          runTime: '',
          value: 0,
        }
      },
      runLogVisible: false,
    }
  },
  mounted() {
    this.chartZJMV = this.$echarts.init(this.$refs.chartZJMV);
    this.chartZJCV = this.$echarts.init(this.$refs.chartZJCV);
    let that = this;
    that.init()
    that.refresh()
    setInterval(function () {
      that.init()
    }, 10000)
  },
  methods: {
    init() {
      this.getPredictValue(this.predictValue.densityPredict)
      // this.getPredictValue(this.predictValue.dosingsystempreYin1)
      // this.getPredictValue(this.predictValue.dosingsystempreYin2)
      // this.getPredictValue(this.predictValue.dosingsystempreYang1)
      // this.getPredictValue(this.predictValue.dosingsystempreYang2)
      this.getChartData(this.chartZJMV, {code: 'fxcv'})
      this.getChartData(this.chartZJCV, {code: 'fxdv'})
    },
    refresh() {
      this.getOpcStatus()
      this.getControllerIhmsOnsts()
    },
    getPredictValue(modelParams) {
      this.$http.get(`/iailab-ntt-model/api/model/model-result/${modelParams.modelCode}`).then(({data: res}) => {
        if (res.code !== 0) {
          console.log("url=/api/model-result,params=" + modelParams.modelCode)
          return this.$message.error(res.msg)
        }
        modelParams.value = res.data[modelParams.resultKey]
        modelParams.runTime = res.data['result_time']
      }).catch(() => {
      })
    },
    showRunLog(modelCode, title) {
      this.runLogVisible = true
      this.$nextTick(() => {
        this.$refs.runLog.title = title
        this.$refs.runLog.dataForm.modelCode = modelCode
        this.$refs.runLog.init()
      })
    },
    getControllerIhmsOnsts() {
      this.$http.get('/iailab-ntt-system/api/system/postal-status/Controller_IHMS_ONSTS').then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.controllerIhmsOnsts = res.data
      }).catch(() => {
      })
    },
    getOpcStatus() {
      this.$http.get('/iailab-ntt-system/api/system/postal-status/WatchDogSTS').then(({data: res}) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.opcStatus = res.data
      }).catch(() => {
      })
    },
    getChartData(chart, params) {
      let option = {
        title: {
          text: name
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          right: '70',
          textStyle: {
            // 图例文字的样式
            color: '#fff',
            fontSize: 14,
            padding: [2, 0, 0, 2],
            fontWeight: 100,
          },
        },
        grid: {
          top: '25%',
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value',
          splitLine: {
            show: false
          },
          axisLine: {
            show: true,
            onZero: false,
            color: '#FFFFFF',
          },
          axisTick: {show: true},
          axisLabel: {
            formatter: '{value}'
          }
        },
        series: [
          {
            name: '灰分',
            data: [150, 230, 282, 218, 135, 147, 260],
            type: 'line',
            smooth: true,
            showSymbol: true,
            color: '#00C2FF'
          },
          {
            name: '热值',
            data: [260, 147, 218, 135, 290, 260, 230],
            type: 'line',
            smooth: true,
            showSymbol: true,
            color: '#FFAA5D'
          }
        ]
      };
      option && chart.setOption(option);
    }
  }
}
</script>
<style scoped>
.list-title {
  padding-top: 20px;
  padding-left: 20px;
  padding-bottom: 0px;
  text-align: left;
  display: flex;
  flex-direction: row;
}
.number-item {
  width: 100%;
  height: 22%;
  padding: 12px;
  margin-top: -2px;
}
.number-item p:first-child {
  margin: 0;
  font-size: 12px;
  color: #FFFFFF;
}
.number-item p:last-child {
  margin: 0;
  padding: 2px;
  font-size: 20px;
  font-weight: 600;
  color: #46bd87;
}
.number-item:hover {
  box-shadow: 0 10px 26px 0 rgba(48, 55, 66, 0.5); /* 鼠标悬浮时盒子出现的阴影 */
  background-color: rgba(102, 177, 255, 0.1);
}
.number-text {
  background-color: rgba(102, 177, 255, 0.1);
}
.log-title {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  background-color: rgba(102, 177, 255, 0.1);
}
.log-title-text {
  width: 70%;
  color: #59C5F3;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding-top: 23px;
}
.log-title-more {
  width: 30%;
  font-size: 14px;
  padding-top: 23px;
}
.list-title-text {
  width: 85%;
  font-size: 14px;
  font-weight: 600;
  color: #59C5F3;
}
.number-body {
  width: 100%;
  height: 90%;
  padding: 5px 5px 0 5px;
  display: flex;
  flex-direction: row;
}
.list-body {
  width: 100%;
  height: 90%;
  padding: 10px;
}
.status-card-title-text {
  color: #59C5F3;
  padding-left: 5px;
}
.status-card-body {
  height: 100%;
  padding-left: 100px;
  margin-top: 0px;
  padding-top: 0px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.status-card-title {
  color: #59C5F3;
}
.status-card-content {
  padding: 12px;
  background-color: rgba(102, 177, 255, 0.1);
}
.status-card {
  width: 100%;
  height: 100%;
  padding: 5px;
}
.status-bar {
  width: 100%;
  height: 8%;
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
}
.log-list {
  width: 100%;
  height: 8%;
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
}
.predict-value {
  width: 100%;
  height: 14%;
  padding: 5px;
}
#status-data {
  width: 100%;
  height: 100%;
  padding: 5px;
  display: flex;
  flex-direction: column;
}
.chart-mv {
  width: 100%;
  height: 70%;
  padding: 5px;
}
.chart-item {
  width: 100%;
  height: 50%;
}
.chart-content {
  width: 100%;
  height: 100%;
  padding: 10px;
}
.chart-title {
  padding: 5px;
  color: #59C5F3;
}
.chart-body {
  width: 100%;
  height: 90%;
  background-color: rgba(102, 177, 255, 0.1);
}
.chart-line {
  width: 100%;
  height: 100%;
}
</style>
src/views/modules/control/gf.vue
对比新文件
@@ -0,0 +1,76 @@
<template>
  <div class="data-content">
    <div id="meta2d_4"></div>
    <div class="data-right-status">
      <gf-right-status></gf-right-status>
    </div>
  </div>
</template>
<script>
import {Meta2d} from '@/utils/meta2d.js'
import GfRightStatus from "@/views/modules/control/components/gf-right-status.vue";
let meta2d = null
export default {
  name: 'meta2d_4',
  components: {GfRightStatus},
  data() {
    return {
      meta2d: {}
    };
  },
  mounted() {
    this.initMeta2d();
  },
  destroyed() {
    meta2d?.destroy();
  },
  methods: {
    initMeta2d() {
      meta2d = new Meta2d("meta2d_4")
      window.registerCommonDiagram();
      this._fetch("/json/data-gf.json", function (text) {
        let data = JSON.parse(text);
        data.locked = 1;
        meta2d.open(data);
        meta2d.fitView(true, 4);
      });
    },
    _fetch(url, cb) {
      let xhr = new XMLHttpRequest();
      xhr.open("GET", url, true);
      xhr.send();
      xhr.onreadystatechange = function () {
        if (xhr.readyState == 4 && xhr.status == 200) {
          cb && cb(xhr.responseText);
        }
      };
    },
  },
};
</script>
<style scoped>
.data-content {
  background-color: #000A30;
  background-size: 100% 100%;
  position: relative;
  height: 48vw;
  width: 87vw;
  display: flex;
  flex-direction: row;
}
#meta2d_4 {
  position: relative !important;
  width: 75%;
  height: 100%;
}
.data-right-status {
  width: 25%;
  height: 100%;
}
</style>
src/views/modules/control/img/bg.png
src/views/modules/control/img/gf.png
src/views/modules/control/img/nsyl.png
src/views/modules/control/img/pmpc.png
src/views/modules/control/img/qcfx.png
src/views/modules/control/img/zjfx.png
src/views/modules/control/index.vue
对比新文件
@@ -0,0 +1,83 @@
<template>
  <el-card shadow="never" class="aui-card--fill">
    <div id="data-view">
            <div id="title-bar">
                <div class="title-text">
                    <div class="main-title-text">
                        智能分选及加药控制模块
                    </div>
                </div>
            </div>
            <div id="data-body">
                <div id="data-scada">
                    <zjfx></zjfx>
                </div>
            </div>
    </div>
  </el-card>
</template>
<script>
import Zjfx from './zjfx.vue'
export default {
    components: {
        Zjfx
    },
    data() {
        return {}
    }
}
</script>
<style scoped>
#right-status {
    width: 10%;
    height: 100%;
}
#data-foot {
    width: 100%;
    height: 38%;
}
#data-scada {
    width: 90%;
    height: calc(100% - 5px);
}
#data-body {
    width: 100%;
    height: 58%;
    padding-top: 5px;
    display: flex;
}
.title-text {
    width: 20%;
    height: 100%;
}
.main-title-text {
    padding-top: 5px;
    font-size: 20px;
    font-family: 黑体;
    text-align: center;
}
#title-bar {
    width: 100%;
    height: 4%;
    padding: 5px;
    display: flex;
    justify-content: center;
    background-color: rgba(102, 177, 255, 0.2);
}
#data-view {
    width: 100%;
    height: 100%;
    background-color: #030409;
    color: #fff;
}
</style>
src/views/modules/control/nsyl.vue
对比新文件
@@ -0,0 +1,76 @@
<template>
  <div class="data-content">
    <div id="meta2d_3"></div>
    <div class="data-right-status">
      <nsyl-right-status></nsyl-right-status>
    </div>
  </div>
</template>
<script>
import {Meta2d} from '@/utils/meta2d.js'
import NsylRightStatus from "@/views/modules/control/components/nsyl-right-status.vue";
let meta2d = null
export default {
  name: 'meta2d_3',
  components: {NsylRightStatus},
  data() {
    return {
      meta2d: {}
    };
  },
  mounted() {
    this.initMeta2d();
  },
  destroyed() {
    meta2d?.destroy();
  },
  methods: {
    initMeta2d() {
      meta2d = new Meta2d("meta2d_3")
      window.registerCommonDiagram();
      this._fetch("/json/data-nsyl.json", function (text) {
        let data = JSON.parse(text);
        data.locked = 1;
        meta2d.open(data);
        meta2d.fitView(true, 4);
      });
    },
    _fetch(url, cb) {
      let xhr = new XMLHttpRequest();
      xhr.open("GET", url, true);
      xhr.send();
      xhr.onreadystatechange = function () {
        if (xhr.readyState == 4 && xhr.status == 200) {
          cb && cb(xhr.responseText);
        }
      };
    },
  },
};
</script>
<style scoped>
.data-content {
  background-color: #000A30;
  background-size: 100% 100%;
  position: relative;
  height: 48vw;
  width: 87vw;
  display: flex;
  flex-direction: row;
}
#meta2d_3 {
  position: relative !important;
  width: 75%;
  height: 100%;
}
.data-right-status {
  width: 25%;
  height: 100%;
}
</style>
src/views/modules/control/pmpc.vue
对比新文件
@@ -0,0 +1,76 @@
<template>
  <div class="data-content">
    <div id="meta2d_5"></div>
    <div class="data-right-status">
      <pmpc-right-status></pmpc-right-status>
    </div>
  </div>
</template>
<script>
import {Meta2d} from '@/utils/meta2d.js'
import PmpcRightStatus from "@/views/modules/control/components/pmpc-right-status.vue";
let meta2d = null
export default {
  name: 'meta2d_5',
  components: {PmpcRightStatus},
  data() {
    return {
      meta2d: {}
    };
  },
  mounted() {
    this.initMeta2d();
  },
  destroyed() {
    meta2d?.destroy();
  },
  methods: {
    initMeta2d() {
      meta2d = new Meta2d("meta2d_5")
      window.registerCommonDiagram();
      this._fetch("/json/data-pmpc.json", function (text) {
        let data = JSON.parse(text);
        data.locked = 1;
        meta2d.open(data);
        meta2d.fitView(true, 4);
      });
    },
    _fetch(url, cb) {
      let xhr = new XMLHttpRequest();
      xhr.open("GET", url, true);
      xhr.send();
      xhr.onreadystatechange = function () {
        if (xhr.readyState == 4 && xhr.status == 200) {
          cb && cb(xhr.responseText);
        }
      };
    },
  },
};
</script>
<style scoped>
.data-content {
  background-color: #000A30;
  background-size: 100% 100%;
  position: relative;
  height: 48vw;
  width: 87vw;
  display: flex;
  flex-direction: row;
}
#meta2d_5 {
  position: relative !important;
  width: 75%;
  height: 100%;
}
.data-right-status {
  width: 25%;
  height: 100%;
}
</style>
src/views/modules/control/qcfx.vue
对比新文件
@@ -0,0 +1,76 @@
<template>
  <div class="data-content">
    <div id="meta2d_1"></div>
    <div class="data-right-status">
      <qcfx-right-status></qcfx-right-status>
    </div>
  </div>
</template>
<script>
import {Meta2d} from '@/utils/meta2d.js'
import QcfxRightStatus from "@/views/modules/control/components/qcfx-right-status.vue";
let meta2d = null
export default {
  name: 'meta2d_1',
  components: {QcfxRightStatus},
  data() {
    return {
      meta2d: {}
    };
  },
  mounted() {
    this.initMeta2d();
  },
  destroyed() {
    meta2d?.destroy();
  },
  methods: {
    initMeta2d() {
      meta2d = new Meta2d("meta2d_1")
      window.registerCommonDiagram();
      this._fetch("/json/data-qcfx.json", function (text) {
        let data = JSON.parse(text);
        data.locked = 1;
        meta2d.open(data);
        meta2d.fitView(true, 4);
      });
    },
    _fetch(url, cb) {
      let xhr = new XMLHttpRequest();
      xhr.open("GET", url, true);
      xhr.send();
      xhr.onreadystatechange = function () {
        if (xhr.readyState == 4 && xhr.status == 200) {
          cb && cb(xhr.responseText);
        }
      };
    },
  },
};
</script>
<style scoped>
.data-content {
  background-color: #000A30;
  background-size: 100% 100%;
  position: relative;
  height: 48vw;
  width: 87vw;
  display: flex;
  flex-direction: row;
}
#meta2d_1 {
  position: relative !important;
  width: 75%;
  height: 100%;
}
.data-right-status {
  width: 25%;
  height: 100%;
}
</style>
src/views/modules/control/zjfx.vue
对比新文件
@@ -0,0 +1,76 @@
<template>
  <div class="data-content">
    <div id="meta2d_2"></div>
    <div class="data-right-status">
      <zjfx-right-status></zjfx-right-status>
    </div>
  </div>
</template>
<script>
import {Meta2d} from '@/utils/meta2d.js'
import ZjfxRightStatus from "@/views/modules/control/components/zjfx-right-status.vue";
let meta2d = null
export default {
  name: 'meta2d_2',
  components: {ZjfxRightStatus},
  data() {
    return {
      meta2d: {}
    };
  },
  mounted() {
    this.initMeta2d();
  },
  destroyed() {
    meta2d?.destroy();
  },
  methods: {
    initMeta2d() {
      meta2d = new Meta2d("meta2d_2")
      window.registerCommonDiagram();
      this._fetch("/json/data-zjfx.json", function (text) {
        let data = JSON.parse(text);
        data.locked = 1;
        meta2d.open(data);
        meta2d.fitView(true, 4);
      });
    },
    _fetch(url, cb) {
      let xhr = new XMLHttpRequest();
      xhr.open("GET", url, true);
      xhr.send();
      xhr.onreadystatechange = function () {
        if (xhr.readyState == 4 && xhr.status == 200) {
          cb && cb(xhr.responseText);
        }
      };
    },
  },
};
</script>
<style scoped>
.data-content {
  background-color: #000A30;
  background-size: 100% 100%;
  position: relative;
  height: 48vw;
  width: 87vw;
  display: flex;
  flex-direction: row;
}
#meta2d_2 {
  position: relative !important;
  width: 75%;
  height: 100%;
}
.data-right-status {
  width: 25%;
  height: 100%;
}
</style>
src/views/modules/data/apigateway/api-app-add-or-update.vue
对比新文件
@@ -0,0 +1,98 @@
<template>
  <el-dialog
    :title="!dataForm.id ? '新增' : '修改'"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="100px">
      <el-form-item label="应用名称" prop="appName">
        <el-input v-model="dataForm.appName" placeholder="应用名称"></el-input>
      </el-form-item>
      <el-form-item label="账号" prop="appKey">
        <el-input v-model="dataForm.appKey" placeholder="账号"></el-input>
      </el-form-item>
      <el-form-item label="密码" prop="appSecret">
        <el-input v-model="dataForm.appSecret" placeholder="密码"></el-input>
      </el-form-item>
      <el-form-item label="应用描述" prop="appDesc">
        <el-input v-model="dataForm.appDesc" placeholder="应用描述"></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button :loading="loading" type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>
<script>
  export default {
    data () {
      return {
        visible: false,
        loading: false,
        dataForm: {
          id: '',
          appName: '',
          appSecret:'',
          appKey: '',
          appDesc: ''
        },
        dataRule: {
          appName: [
            { required: true, message: '应用名称不能为空', trigger: 'blur' }
          ]
        }
      }
    },
    methods: {
      init (id) {
        this.dataForm.id = id || 0
        this.visible = true
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          if (this.dataForm.id) {
            this.getInfo()
          }
        })
      },
      // 获取信息
      getInfo() {
        this.$http.get(`/data/api-gateway/app/info/${this.dataForm.id}`).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.dataForm = {
            ...this.dataForm,
            ...res.data
          }
        }).catch(() => {
        })
      },
      // 表单提交
      dataFormSubmit () {
        this.$refs['dataForm'].validate((valid) => {
          if (!valid) {
            return false
          }
          this.loading = true
          this.$http['post'](`/data/api-gateway/app/${!this.dataForm.id ? 'add' : 'update'}`, this.dataForm).then(({data: res}) => {
            this.loading = false
            if (res.code !== 0) {
              return this.$message.error(res.msg)
            }
            this.$message({
              message: this.$t('prompt.success'),
              type: 'success',
              duration: 500,
              onClose: () => {
                this.visible = false
                this.$emit('refreshDataList')
              }
            })
          }).catch(() => {
          })
        })
      }
    }
  }
</script>
src/views/modules/data/apigateway/api-app-grant-api.vue
对比新文件
@@ -0,0 +1,101 @@
<template>
  <el-dialog
    title="API授权"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <el-tree
      :data="treeData"
      :props="defaultProps"
      node-key="id"
      ref="apiListTree"
      show-checkbox>
    </el-tree>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>
<script>
  export default {
    data () {
      return {
        visible: false,
        dataForm: {
          id: '',
          appName: '',
          appKey: '',
          appSecret: '',
          appDesc: ''
        },
        apiAuthorizedIdList: [],
        defaultProps: {
          children: 'children',
          label: 'label'
        },
        treeData: []
      }
    },
    methods: {
      init (id) {
        this.dataForm.id = id || 0
        this.visible = true
        this.$nextTick(() => {
          if (this.dataForm.id) {
            this.$http({
              url: `/data/api-gateway/info/group-tree`,
              method: 'get',
              params: this.$http.adornParams()
            }).then(({data}) => {
              if (data && data.code === 0) {
                this.treeData = data.data
              }
              this.$refs.apiListTree.setCheckedKeys([])
            }).then(() => {
              this.$http({
                url: `/data/api-gateway/app/info/${this.dataForm.id}`,
                method: 'get',
                params: this.$http.adornParams()
              }).then(({data}) => {
                if (data && data.code === 0) {
                  this.dataForm.appName = data.data.appName
                  this.dataForm.appKey = data.data.appKey
                  this.dataForm.appSecret = data.data.appSecret
                  this.dataForm.appDesc = data.data.appDesc
                  if (data.data.apiAuthorizedList && data.data.apiAuthorizedList.length > 0) {
                    this.apiAuthorizedIdList = data.data.apiAuthorizedList.map(function (item) {
                      return item.apiId
                    })
                    this.$refs.apiListTree.setCheckedKeys(this.apiAuthorizedIdList)
                  }
                }
              })
            })
          }
        })
      },
      // 表单提交
      dataFormSubmit () {
        this.$http({
          url: `/data/api-gateway/authorized/grant-api/${this.dataForm.id}`,
          method: 'post',
          data: this.$http.adornData([].concat(this.$refs.apiListTree.getCheckedKeys(), this.$refs.apiListTree.getHalfCheckedKeys()), false)
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
                this.visible = false
                this.$emit('refreshDataList')
              }
            })
          } else {
            this.$message.error(data.msg)
          }
        })
      }
    }
  }
</script>
src/views/modules/data/apigateway/api-app-limit-setting.vue
对比新文件
@@ -0,0 +1,98 @@
<template>
  <el-dialog
    title="限流策略配置"
    append-to-body="true"
    width="30%"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="100px">
      <el-form-item label="限流策略(分)" prop="limitMin">
        <el-input-number v-model="dataForm.limitMin"
                         controls-position="right"
                         :min="0" :max="100000"></el-input-number>
      </el-form-item>
      <el-form-item label="限流策略(时)" prop="limitHour">
        <el-input-number v-model="dataForm.limitHour"
                         controls-position="right"
                         :min="0" :max="100000"></el-input-number>
      </el-form-item>
      <el-form-item label="限流策略(天)" prop="limitDay">
        <el-input-number v-model="dataForm.limitDay"
                         controls-position="right"
                         :min="0" :max="100000"></el-input-number>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>
<script>
  export default {
    data () {
      return {
        visible: false,
        dataForm: {
          id: '',
          limitMin: '',
          limitHour: '',
          limitDay: ''
        }
      }
    },
    methods: {
      init (id) {
        this.dataForm.id = id || 0
        this.visible = true
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          if (this.dataForm.id) {
            this.$http({
              url: `/data/api-gateway/authorized/info/${this.dataForm.id}`,
              method: 'get',
              params: this.$http.adornParams()
            }).then(({data}) => {
              if (data && data.code === 0) {
                this.dataForm.limitMin = data.data.limitMin
                this.dataForm.limitHour = data.data.limitHour
                this.dataForm.limitDay = data.data.limitDay
              }
            })
          }
        })
      },
      // 表单提交
      dataFormSubmit () {
        this.$refs['dataForm'].validate((valid) => {
          if (valid) {
            this.$http({
              url: `/data/api-gateway/authorized/${!this.dataForm.id ? 'add' : 'update'}`,
              method: 'post',
              data: this.$http.adornData({
                'id': this.dataForm.id || undefined,
                'limitMin': this.dataForm.limitMin,
                'limitHour': this.dataForm.limitHour,
                'limitDay': this.dataForm.limitDay
              })
            }).then(({data}) => {
              if (data && data.code === 0) {
                this.$message({
                  message: '操作成功',
                  type: 'success',
                  duration: 1500,
                  onClose: () => {
                    this.visible = false
                    this.$emit('refreshDataList')
                  }
                })
              } else {
                this.$message.error(data.msg)
              }
            })
          }
        })
      }
    }
  }
</script>
src/views/modules/data/apigateway/api-app-view.vue
对比新文件
@@ -0,0 +1,220 @@
<template>
  <el-dialog
    title="详情"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <el-divider content-position="left">基本信息</el-divider>
    <el-form :model="dataForm" ref="dataForm" label-width="100px">
      <el-form-item label="应用名称:" prop="appName">
        {{dataForm.appName}}
      </el-form-item>
      <el-form-item label="appKey:" prop="appName">
        {{dataForm.appKey}}
      </el-form-item>
      <el-form-item label="appSecret:" prop="appName">
        {{dataForm.appSecret}}
      </el-form-item>
      <el-form-item label="应用描述:" prop="appName">
        {{dataForm.appDesc}}
      </el-form-item>
    </el-form>
    <el-divider content-position="left">已授权API</el-divider>
    <el-table
      :data="dataList"
      border
      v-loading="dataListLoading"
      style="width: 100%;">
      <el-table-column
        type="index"
        header-align="center"
        align="center"
        width="50">
      </el-table-column>
      <el-table-column
        prop="serverName"
        header-align="center"
        align="center"
        width="200"
        label="服务名称">
      </el-table-column>
      <el-table-column
        prop="apiName"
        header-align="center"
        align="center"
        width="200"
        label="API名称">
      </el-table-column>
      <el-table-column
        prop="apiAddress"
        header-align="center"
        align="center"
        label="URL">
      </el-table-column>
<!--      <el-table-column-->
<!--        prop="limitMin"-->
<!--        header-align="center"-->
<!--        align="center"-->
<!--        width="120"-->
<!--        label="限流策略(分)">-->
<!--      </el-table-column>-->
<!--      <el-table-column-->
<!--        prop="limitHour"-->
<!--        header-align="center"-->
<!--        align="center"-->
<!--        width="120"-->
<!--        label="限流策略(时)">-->
<!--      </el-table-column>-->
<!--      <el-table-column-->
<!--        prop="limitDay"-->
<!--        header-align="center"-->
<!--        align="center"-->
<!--        width="120"-->
<!--        label="限流策略(天)">-->
<!--      </el-table-column>-->
      <el-table-column
        fixed="right"
        header-align="center"
        align="center"
        width="80"
        label="操作">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="cancelAuthorization(scope.row.id)">取消授权</el-button>
<!--          <el-button type="text" size="small" @click="limitSetting(scope.row.id)">限流配置</el-button>-->
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="sizeChangeHandle"
      @current-change="currentChangeHandle"
      :current-page="pageIndex"
      :page-sizes="[10, 20, 50, 100]"
      :page-size="pageSize"
      :total="totalPage"
      layout="total, sizes, prev, pager, next, jumper">
    </el-pagination>
    <!-- 弹窗, 新增 / 修改 -->
    <limit-setting v-if="limitSettingVisible" ref="limitSetting" @refreshDataList="getDataList"></limit-setting>
  </el-dialog>
</template>
<script>
  import LimitSetting from './api-app-limit-setting'
  export default {
    components: {
      LimitSetting
    },
    data () {
      return {
        visible: false,
        dataForm: {
          id: '',
          appName: '',
          appKey: '',
          appSecret: '',
          appDesc: ''
        },
        dataList: [],
        pageIndex: 1,
        pageSize: 10,
        totalPage: 0,
        dataListLoading: false,
        dataListSelections: [],
        limitSettingVisible: false
      }
    },
    methods: {
      init (id) {
        this.dataForm.id = id || 0
        this.visible = true
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          if (this.dataForm.id) {
            this.$http({
              url: `/data/api-gateway/app/info/${this.dataForm.id}`,
              method: 'get',
              params: this.$http.adornParams()
            }).then(({data}) => {
              if (data && data.code === 0) {
                this.dataForm.appName = data.data.appName
                this.dataForm.appKey = data.data.appKey
                this.dataForm.appSecret = data.data.appSecret
                this.dataForm.appDesc = data.data.appDesc
              }
            })
          }
        })
        this.getDataList()
      },
      cancelAuthorization (id) {
        this.$confirm(`确定取消授权?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$http({
            url: '/data/api-gateway/authorized/delete',
            method: 'post',
            data: this.$http.adornData({
              id: id
            })
          }).then(({data}) => {
            if (data && data.code === 0) {
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                  this.getDataList()
                }
              })
            } else {
              this.$message.error(data.msg)
            }
          })
        }).catch(() => {})
      },
      limitSetting (id) {
        this.limitSettingVisible = true
        this.$nextTick(() => {
          this.$refs.limitSetting.init(id)
        })
      },
      // 获取数据列表
      getDataList () {
        this.dataListLoading = true
        this.$http({
          url: '/data/api-gateway/authorized/list',
          method: 'get',
          params: this.$http.adornParams({
            'page': this.pageIndex,
            'limit': this.pageSize,
            'appId': this.dataForm.id
          })
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.dataList = data.page.list
            this.totalPage = data.page.totalCount
          } else {
            this.dataList = []
            this.totalPage = 0
          }
          this.dataListLoading = false
        })
      },
      // 每页数
      sizeChangeHandle (val) {
        this.pageSize = val
        this.pageIndex = 1
        this.getDataList()
      },
      // 当前页
      currentChangeHandle (val) {
        this.pageIndex = val
        this.getDataList()
      },
      // 多选
      selectionChangeHandle (val) {
        this.dataListSelections = val
      }
    }
  }
</script>
src/views/modules/data/apigateway/api-app.vue
对比新文件
@@ -0,0 +1,205 @@
<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-api-app">
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-input v-model="dataForm.appName" placeholder="应用名称" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-input v-model="dataForm.appKey" placeholder="账号" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="getDataList()">查询</el-button>
          <el-button type="primary" @click="addOrUpdateHandle()">新增</el-button>
        </el-form-item>
      </el-form>
      <el-table
              :data="dataList"
              border
              v-loading="dataListLoading"
              style="width: 100%;">
        <el-table-column
                type="index"
                header-align="center"
                align="center"
                width="50">
        </el-table-column>
        <el-table-column
                prop="appName"
                header-align="center"
                align="center"
                label="应用名称">
        </el-table-column>
        <el-table-column
                prop="appKey"
                header-align="center"
                align="center"
                label="账号">
        </el-table-column>
        <el-table-column
                prop="appSecret"
                header-align="center"
                align="center"
                label="密码">
        </el-table-column>
        <el-table-column
                prop="appDesc"
                header-align="center"
                align="center"
                label="应用描述">
        </el-table-column>
        <el-table-column
                prop="statusName"
                header-align="center"
                align="center"
                label="状态">
        </el-table-column>
        <el-table-column
                fixed="right"
                header-align="center"
                align="center"
                width="200"
                label="操作">
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="authorizationHandle(scope.row.id)">授权</el-button>
            <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
            <el-button type="text" size="small" @click="viewHandle(scope.row.id)">详情</el-button>
            <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
              @size-change="sizeChangeHandle"
              @current-change="currentChangeHandle"
              :current-page="pageIndex"
              :page-sizes="[10, 20, 50, 100]"
              :page-size="pageSize"
              :total="totalPage"
              layout="total, sizes, prev, pager, next, jumper">
      </el-pagination>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
      <!-- 弹窗, 详情 -->
      <detail-view v-if="detailViewVisible" ref="detailView"></detail-view>
      <!-- 弹窗, API授权 -->
      <grant-api v-if="grantApiVisible" ref="grantApi"></grant-api>
    </div>
  </el-card>
</template>
<script>
  import AddOrUpdate from './api-app-add-or-update'
  import DetailView from './api-app-view'
  import GrantApi from './api-app-grant-api'
  export default {
    data () {
      return {
        dataForm: {
          appName: '',
          appKey: ''
        },
        dataList: [],
        pageIndex: 1,
        pageSize: 10,
        totalPage: 0,
        dataListLoading: false,
        dataListSelections: [],
        addOrUpdateVisible: false,
        detailViewVisible: false,
        grantApiVisible: false
      }
    },
    components: {
      AddOrUpdate,
      DetailView,
      GrantApi
    },
    activated () {
      this.getDataList()
    },
    mounted () {
      this.getDataList()
    },
    methods: {
      // 获取数据列表
      getDataList () {
        this.dataListLoading = true
        this.$http({
          url: '/data/api-gateway/app/list',
          method: 'get',
          params: this.$http.adornParams({
            'page': this.pageIndex,
            'limit': this.pageSize,
            'appName': this.dataForm.appName,
            'appKey': this.dataForm.appKey
          })
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.dataList = data.page.list
            this.totalPage = data.page.totalCount
          } else {
            this.dataList = []
            this.totalPage = 0
          }
          this.dataListLoading = false
        })
      },
      // 每页数
      sizeChangeHandle (val) {
        this.pageSize = val
        this.pageIndex = 1
        this.getDataList()
      },
      // 当前页
      currentChangeHandle (val) {
        this.pageIndex = val
        this.getDataList()
      },
      // 多选
      selectionChangeHandle (val) {
        this.dataListSelections = val
      },
      // 新增 / 修改
      addOrUpdateHandle (id) {
        this.addOrUpdateVisible = true
        this.$nextTick(() => {
          this.$refs.addOrUpdate.init(id)
        })
      },
      viewHandle (id) {
        this.detailViewVisible = true
        this.$nextTick(() => {
          this.$refs.detailView.init(id)
        })
      },
      authorizationHandle (id) {
        this.grantApiVisible = true
        this.$nextTick(() => {
          this.$refs.grantApi.init(id)
        })
      },
      // 删除
      deleteHandle (id) {
        this.$confirm(`确定对选中项进行删除操作?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$http['post'](`/data/api-gateway/app/delete`, {id: id}).then(({ data: res }) => {
            if (res.code !== 0) {
              return this.$message.error(res.msg)
            }
            this.$message({
              message: this.$t('prompt.success'),
              type: 'success',
              duration: 500,
              onClose: () => {
                this.getDataList()
              }
            })
          }).catch(() => {})
        }).catch(() => {})
      }
    }
  }
</script>
src/views/modules/data/apigateway/api-group-add-or-update.vue
对比新文件
@@ -0,0 +1,90 @@
<template>
  <el-dialog
    :title="!dataForm.id ? '新增' : '修改'"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="100px">
      <el-form-item label="分组名称" prop="groupName">
        <el-input v-model="dataForm.groupName" placeholder="分组名称"></el-input>
      </el-form-item>
      <el-form-item label="分组描述" prop="groupDesc">
        <el-input v-model="dataForm.groupDesc" placeholder="分组描述"></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>
<script>
  export default {
    data () {
      return {
        visible: false,
        loading: false,
        dataForm: {
          id: '',
          groupName: '',
          groupDesc: ''
        },
        dataRule: {
          groupName: [
            { required: true, message: '分组名称不能为空', trigger: 'blur' }
          ]
        }
      }
    },
    methods: {
      init (id) {
        this.dataForm.id = id || 0
        this.visible = true
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          if (this.dataForm.id) {
            this.getInfo()
          }
        })
      },
      // 获取信息
      getInfo() {
        this.$http.get(`/data/api-gateway/group/info/${this.dataForm.id}`).then(({data: res}) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.dataForm = {
            ...this.dataForm,
            ...res.data
          }
        }).catch(() => {
        })
      },
      // 表单提交
      dataFormSubmit () {
        this.$refs['dataForm'].validate((valid) => {
          if (!valid) {
            return false
          }
          this.loading = true
          this.$http['post'](`/data/api-gateway/group/${!this.dataForm.id ? 'add' : 'update'}`, this.dataForm).then(({data: res}) => {
            this.loading = false
            if (res.code !== 0) {
              return this.$message.error(res.msg)
            }
            this.$message({
              message: this.$t('prompt.success'),
              type: 'success',
              duration: 500,
              onClose: () => {
                this.visible = false
                this.$emit('refreshDataList')
              }
            })
          }).catch(() => {
          })
        })
      }
    }
  }
</script>
在上述文件截断后对比
src/views/modules/data/apigateway/api-group.vue src/views/modules/data/apigateway/api-info-add-or-update.vue src/views/modules/data/apigateway/api-info.vue src/views/modules/data/apigateway/api-server-add-or-update.vue src/views/modules/data/apigateway/api-server.vue src/views/modules/data/channel/components/data-tag-chart.vue src/views/modules/data/channel/components/data-tag-current.vue src/views/modules/data/channel/kingio-add-or-update.vue src/views/modules/data/channel/kingio-tag-add-or-update.vue src/views/modules/data/channel/kingio-tag.vue src/views/modules/data/channel/kingio.vue src/views/modules/data/channel/modbus-add-or-update.vue src/views/modules/data/channel/modbus-tag-add-or-update.vue src/views/modules/data/channel/modbus-tag.vue src/views/modules/data/channel/modbus.vue src/views/modules/data/channel/opcda-add-or-update.vue src/views/modules/data/channel/opcda-tag-add-or-update.vue src/views/modules/data/channel/opcda-tag.vue src/views/modules/data/channel/opcda.vue src/views/modules/data/channel/opcua-add-or-update.vue src/views/modules/data/channel/opcua-tag-add-or-update.vue src/views/modules/data/channel/opcua-tag.vue src/views/modules/data/channel/opcua.vue src/views/modules/data/coal/out-quality.vue src/views/modules/data/coal/preventive-plan-add-or-update.vue src/views/modules/data/coal/preventive-plan.vue src/views/modules/data/coal/prod-plan-month-add-or-update.vue src/views/modules/data/coal/prod-plan-month.vue src/views/modules/data/coal/prod-plan-year-add-or-update.vue src/views/modules/data/coal/prod-plan-year.vue src/views/modules/data/coal/prod-quality-bc-add-or-update.vue src/views/modules/data/coal/prod-quality-bc.vue src/views/modules/data/coal/zcxt-plan-month.vue src/views/modules/data/coal/zcxt-plan-year.vue src/views/modules/data/da/point-add-or-update.vue src/views/modules/data/da/point-chart.vue src/views/modules/data/da/point-set.vue src/views/modules/data/da/point-view.vue src/views/modules/data/da/point.vue src/views/modules/data/http/api-add-or-update.vue src/views/modules/data/http/api.vue src/views/modules/data/http/components/data-tag-chart.vue src/views/modules/data/http/tags/tag-add-or-update.vue src/views/modules/data/http/tags/tag-current.vue src/views/modules/data/http/tags/tag.vue src/views/modules/data/http/token-add-or-update.vue src/views/modules/data/http/token-view.vue src/views/modules/data/http/token.vue src/views/modules/data/indexdata/clock-add-or-update.vue src/views/modules/data/indexdata/clock.vue src/views/modules/data/indexdata/item-add-or-update.vue src/views/modules/data/indexdata/item.vue src/views/modules/data/indexdata/value.vue src/views/modules/data/job/schedule-add-or-update.vue src/views/modules/data/job/schedule-log.vue src/views/modules/data/job/schedule.vue src/views/modules/data/oadp/configinfo/components/data-tag-chart.vue src/views/modules/data/oadp/configinfo/components/data-tag-current.vue src/views/modules/data/oadp/configinfo/modbus-add-or-update.vue src/views/modules/data/oadp/configinfo/modbus-tag-add-or-update.vue src/views/modules/data/oadp/configinfo/modbus-tag.vue src/views/modules/data/oadp/configinfo/modbus.vue src/views/modules/data/oadp/configinfo/opcda-add-or-update.vue src/views/modules/data/oadp/configinfo/opcda-tag-add-or-update.vue src/views/modules/data/oadp/configinfo/opcda-tag.vue src/views/modules/data/oadp/configinfo/opcda.vue src/views/modules/data/oadp/configinfo/opcua-add-or-update.vue src/views/modules/data/oadp/configinfo/opcua-tag-add-or-update.vue src/views/modules/data/oadp/configinfo/opcua-tag.vue src/views/modules/data/oadp/configinfo/opcua.vue src/views/modules/data/oadp/tags/tag-value.vue src/views/modules/data/oadp/tags/tag.vue src/views/modules/data/point/da-data-point-add-or-update.vue src/views/modules/data/point/da-data-point-chart.vue src/views/modules/data/point/da-data-point-view.vue src/views/modules/data/point/da-data-point.vue src/views/modules/data/point/da-data-source-add-or-update.vue src/views/modules/data/point/da-data-source.vue src/views/modules/data/point/da-data-type-add-or-update.vue src/views/modules/data/point/da-data-type.vue src/views/modules/data/point/da-min-freq-add-or-update.vue src/views/modules/data/point/da-min-freq.vue src/views/modules/data/point/da-point-type-add-or-update.vue src/views/modules/data/point/da-point-type.vue src/views/modules/data/point/da-store-type-add-or-update.vue src/views/modules/data/point/da-store-type.vue src/views/modules/data/point/data-device-add-or-update.vue src/views/modules/data/point/data-device.vue src/views/modules/data/point/data-jkxt-add-or-update.vue src/views/modules/data/point/data-jkxt.vue src/views/modules/data/point/data-point-add-or-update.vue src/views/modules/data/point/data-point-chart.vue src/views/modules/data/point/data-point-view.vue src/views/modules/data/point/data-point.vue src/views/modules/data/pointrelation/data-point-relation-add-or-update.vue src/views/modules/data/pointrelation/data-point-relation-chart.vue src/views/modules/data/pointrelation/data-point-relation-view.vue src/views/modules/data/pointrelation/data-point-relation.vue src/views/modules/decision/components/decision-evaluate.vue src/views/modules/decision/device-account-add-or-update.vue src/views/modules/decision/device-account-history-add-or-update.vue src/views/modules/decision/device-account-history.vue src/views/modules/decision/device-account.vue src/views/modules/decision/device-breakdown.vue src/views/modules/decision/device-fault-add-or-update.vue src/views/modules/decision/device-fault.vue src/views/modules/decision/device-health-alarm-info.vue src/views/modules/decision/device-health-alarm.vue src/views/modules/decision/device-health-evaluate-setting.vue src/views/modules/decision/device-health-evaluate.vue src/views/modules/decision/device-monitor.vue src/views/modules/decision/device-plan-time-setting.vue src/views/modules/decision/device-trend.vue src/views/modules/decision/img/bg.png src/views/modules/decision/img/设备健康监控.png src/views/modules/decision/img/设备故障库.png src/views/modules/decision/img/设备评价.png src/views/modules/decision/index.vue src/views/modules/device/health-evaluate-add-or-update.vue src/views/modules/device/health-evaluate.vue src/views/modules/device/health-report-view.vue src/views/modules/device/health-report.vue src/views/modules/home/index.vue src/views/modules/ind/item-add-or-update.vue src/views/modules/ind/item.vue src/views/modules/job/schedule-add-or-update.vue src/views/modules/job/schedule-log.vue src/views/modules/job/schedule.vue src/views/modules/knowledge/distribution-curves-chart.vue src/views/modules/knowledge/document-add-or-update.vue src/views/modules/knowledge/document.vue src/views/modules/knowledge/document_bak.vue src/views/modules/knowledge/img/model.png src/views/modules/knowledge/img/model_1.png src/views/modules/knowledge/img/model_2.png src/views/modules/knowledge/img/model_all.png src/views/modules/knowledge/img/文档库.png src/views/modules/knowledge/model-api.vue src/views/modules/knowledge/model-log.vue src/views/modules/knowledge/model.vue src/views/modules/knowledge/wash-curves-chart.vue src/views/modules/mcs/schedule-add-or-update.vue src/views/modules/mcs/schedule-log.vue src/views/modules/mcs/schedule.vue src/views/modules/mcs/st-model-add-or-update.vue src/views/modules/mcs/st-model-doc-add-or-update.vue src/views/modules/mcs/st-model-log.vue src/views/modules/mcs/st-model.vue src/views/modules/mcs/st-schedule-add-or-update.vue src/views/modules/mcs/st-schedule-energy-type-add-or-update.vue src/views/modules/mcs/st-schedule-energy-type.vue src/views/modules/mcs/st-schedule-model-add-or-update.vue src/views/modules/mcs/st-schedule-model-user-param-chart.vue src/views/modules/mcs/st-schedule-model-user-param.vue src/views/modules/mcs/st-schedule-model.vue src/views/modules/mcs/st-schedule-object-add-or-update.vue src/views/modules/mcs/st-schedule-object.vue src/views/modules/mcs/st-schedule-predict-item-add-or-update.vue src/views/modules/mcs/st-schedule-predict-item.vue src/views/modules/mcs/st-schedule-user-add-or-update.vue src/views/modules/mcs/st-schedule-user.vue src/views/modules/mcs/st-schedule.vue src/views/modules/scada/components/control-index.vue src/views/modules/scada/components/gf.vue src/views/modules/scada/components/nsyl.vue src/views/modules/scada/components/pmpc.vue src/views/modules/scada/components/qcfx.vue src/views/modules/scada/components/run-log.vue src/views/modules/scada/components/ylyf-left.vue src/views/modules/scada/components/ylyf-right.vue src/views/modules/scada/components/ylyf.vue src/views/modules/scada/components/zjfx.vue src/views/modules/scada/index.vue src/views/modules/scada/meta2d/scada-gf.vue src/views/modules/scada/meta2d/scada-nsyl.vue src/views/modules/scada/meta2d/scada-pmpc.vue src/views/modules/scada/meta2d/scada-qcfx.vue src/views/modules/scada/meta2d/scada-ylyf.vue src/views/modules/scada/meta2d/scada-zjfx.vue