chore: 初始化台孚数字孪生 TFvue3
This commit is contained in:
36
public/config.js
Normal file
36
public/config.js
Normal file
@@ -0,0 +1,36 @@
|
||||
// config.js
|
||||
const dtConfig = {
|
||||
serverAddress: 'http://124.220.32.217:41100/api/database/command',
|
||||
// serverAddress: 'http://192.168.1.133:41100/api/database/command',
|
||||
mqttIp: '124.220.32.217',
|
||||
// mqttIp: '192.168.1.182',
|
||||
mqttPort: '8083',
|
||||
topBoxTitle: '智能三轴机床数字孪生系统',
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user