Files
workGit/数字孪生可视化大屏vue源码/ZhongLianZhongKeVue3TV/public/config.js
2026-05-23 14:11:26 +08:00

36 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// config.js
const dtConfig = {
iframeAddress: 'http://127.0.0.1:10095/#/',
serverAddress: 'http://localhost:10096/submit/MESCommonBase.ashx',
mqttIp: '127.0.0.1',
mqttPort: '8083',
titleBoxTitle: '起重装备机加线数字孪生系统',
mqttTopic: 'SCADAMain/demo_device_mqtt_tfjj',
timeout: 15000,
// 设备运行履刷新时间配置(毫秒)
equipmentRuntimeHistoryRefreshInterval: 60000,
// 伺服负载曲线刷新时间配置(毫秒)
ServoLoadCurveRefreshInterval: 5000,
// OEE刷新时间配置毫秒
OEEAnalysisRefreshInterval: 5000,
//质量管理轮播时间配置(毫秒)
QualityManagementRefreshInterval: 6000,
// 报警刷新时间配置(毫秒)
WarningRefreshInterval: 5000,
}
// 更新 MQTT Topic 的方法
const updateMqttTopic = (newTopic) => {
dtConfig.mqttTopic = newTopic
// 同时更新到 localStorage 以便其他页面使用
localStorage.setItem('mqttTopic', newTopic)
console.log('MQTT Topic 已更新:', newTopic)
}
// 确保在全局对象上设置配置
if (typeof window !== 'undefined') {
window.dt_Config = dtConfig
window.updateMqttTopic = updateMqttTopic
// console.log('全局配置已设置:', dtConfig)
}