36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
// 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)
|
||
}
|