Lufaneng 5 months ago
parent d8f18e55b7
commit d73f6a1189

@ -343,9 +343,7 @@ const tasks = computed(() => [startTask.value, stopTask.value, middleTask.value]
const deviceMode = ref(0) const deviceMode = ref(0)
const currentMode = ref(0) const currentMode = ref(0)
RPC.post('/m9z/getDeviceMode', { comm_uid: commit_uid }).then(res => {
currentMode.value = res
})
const changeMode = () => { const changeMode = () => {
modeActive.value = currentMode.value modeActive.value = currentMode.value
@ -385,7 +383,7 @@ const getTask = () => {
middleTaskLoading.value = false middleTaskLoading.value = false
}) })
} }
getTask()
const addTask = () => { const addTask = () => {
middleTask.value.push({ middleTask.value.push({
@ -473,11 +471,6 @@ const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四
const sunriseTime = ref('') const sunriseTime = ref('')
const sunsetTime = ref('') const sunsetTime = ref('')
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
})
// //
const updateTime = () => { const updateTime = () => {
const now = new Date() const now = new Date()
@ -549,8 +542,24 @@ const restartSystem = () => {
} }
let timeInterval = null let timeInterval = null
const isOnline = ref(false)
onMounted(() => { onMounted(() => {
RPC.post('/lightm/rtu/isOnline', { commUid: commit_uid }).then(res => {
console.log('/lightm/rtu/isOnlin', res)
isOnline.value = res
if (isOnline.value) {
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
})
RPC.post('/m9z/getDeviceMode', { comm_uid: commit_uid }).then(res => {
currentMode.value = res
})
getTask()
} else {
ElMessage.error('设备不在线')
}
})
updateTime() updateTime()
timeInterval = setInterval(updateTime, 1000) timeInterval = setInterval(updateTime, 1000)
}) })

@ -237,7 +237,8 @@ const getDeviceTime = () => {
isUpDateTimeing.value = false isUpDateTimeing.value = false
}) })
} }
getDeviceTime()
const isOnline = ref(false)
const setDeviceTime = () => { const setDeviceTime = () => {
timeLoading.value = true timeLoading.value = true
@ -251,29 +252,8 @@ const setDeviceTime = () => {
const week = ref('') const week = ref('')
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']; const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
const phaseLoading = ref(true) const phaseLoading = ref(false)
RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
powerPhases.value[0].voltage = res.aVoltage ? res.aVoltage + 'V' : '0V'
powerPhases.value[0].current = res.aElectricCurrent ? res.aElectricCurrent + 'A' : '0A'
powerPhases.value[0].power = res.aPower ? res.aPower + 'kW' : '0kW'
powerPhases.value[0].factor = res.aPowerFactor ? res.aPowerFactor : 0
powerPhases.value[1].voltage = res.bVoltage ? res.bVoltage + 'V' : '0V'
powerPhases.value[1].current = res.bElectricCurrent ? res.bElectricCurrent + 'A' : '0A'
powerPhases.value[1].power = res.bPower ? res.bPower + 'kW' : '0kW'
powerPhases.value[1].factor = res.bPowerFactor ? res.bPowerFactor : 0
powerPhases.value[2].voltage = res.cVoltage ? res.cVoltage + 'V' : '0V'
powerPhases.value[2].current = res.cElectricCurrent ? res.cElectricCurrent + 'A' : '0A'
powerPhases.value[2].power = res.cPower ? res.cPower + 'kW' : '0kW'
powerPhases.value[2].factor = res.cPowerFactor ? res.cPowerFactor : 0
energyParams.value.activeEnergy = res.activeEnergy ? res.activeEnergy + 'kW·h' : '0kW·h'
energyParams.value.activePower = res.activePower ? res.activePower + 'kW' : '0kW'
energyParams.value.powerFactor = res.powerFactor ? res.powerFactor : 0
}).finally(() => {
phaseLoading.value = false
})
// //
const powerPhases = ref([ const powerPhases = ref([
@ -420,7 +400,7 @@ const getInfo = () => {
infoLoading.value = false infoLoading.value = false
}) })
} }
getInfo()
const refresh = () => { const refresh = () => {
getInfo() getInfo()
@ -469,10 +449,6 @@ watch(info, () => {
const sunriseTime = ref('') const sunriseTime = ref('')
const sunsetTime = ref('') const sunsetTime = ref('')
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
})
// //
const updateTime = () => { const updateTime = () => {
@ -611,6 +587,9 @@ const restartSystem = () => {
} }
const changeMode = () => { const changeMode = () => {
if (!isOnline.value) {
return ElMessage.error('设备不在线')
}
ElMessageBox.confirm( ElMessageBox.confirm(
`此操作将切换到${info.value.disable ? '自动' : '手动'}模式,是否继续?`, `此操作将切换到${info.value.disable ? '自动' : '手动'}模式,是否继续?`,
'提示', '提示',
@ -633,6 +612,43 @@ let timeInterval = null
onMounted(() => { onMounted(() => {
updateTime() updateTime()
timeInterval = setInterval(updateTime, 1000) timeInterval = setInterval(updateTime, 1000)
RPC.post('/lightm/rtu/isOnline', { commUid: commit_uid }).then(res => {
console.log('/lightm/rtu/isOnlin', res)
isOnline.value = res
if (isOnline.value) {
getInfo()
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
})
phaseLoading.value = true
RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
powerPhases.value[0].voltage = res.aVoltage ? res.aVoltage + 'V' : '0V'
powerPhases.value[0].current = res.aElectricCurrent ? res.aElectricCurrent + 'A' : '0A'
powerPhases.value[0].power = res.aPower ? res.aPower + 'kW' : '0kW'
powerPhases.value[0].factor = res.aPowerFactor ? res.aPowerFactor : 0
powerPhases.value[1].voltage = res.bVoltage ? res.bVoltage + 'V' : '0V'
powerPhases.value[1].current = res.bElectricCurrent ? res.bElectricCurrent + 'A' : '0A'
powerPhases.value[1].power = res.bPower ? res.bPower + 'kW' : '0kW'
powerPhases.value[1].factor = res.bPowerFactor ? res.bPowerFactor : 0
powerPhases.value[2].voltage = res.cVoltage ? res.cVoltage + 'V' : '0V'
powerPhases.value[2].current = res.cElectricCurrent ? res.cElectricCurrent + 'A' : '0A'
powerPhases.value[2].power = res.cPower ? res.cPower + 'kW' : '0kW'
powerPhases.value[2].factor = res.cPowerFactor ? res.cPowerFactor : 0
energyParams.value.activeEnergy = res.activeEnergy ? res.activeEnergy + 'kW·h' : '0kW·h'
energyParams.value.activePower = res.activePower ? res.activePower + 'kW' : '0kW'
energyParams.value.powerFactor = res.powerFactor ? res.powerFactor : 0
}).finally(() => {
phaseLoading.value = false
})
getDeviceTime()
} else {
ElMessage.error('设备不在线')
}
})
}) })
onUnmounted(() => { onUnmounted(() => {

@ -474,10 +474,15 @@ const getInfo = () => {
// sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : '' // sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
// }) // })
} }
getInfo()
const timer = setInterval(() => { const timer = setInterval(() => {
getInfo() RPC.post('/lightm/rtu/isOnline', { commUid: commit_uid }).then(res => {
console.log('/lightm/rtu/isOnlin', res)
isOnline.value = res
if (isOnline.value) {
getInfo()
}
})
}, 30000) }, 30000)
onUnmounted(() => { onUnmounted(() => {
@ -594,7 +599,17 @@ const restartSystem = () => {
let timeInterval = null let timeInterval = null
const isOnline = ref(false)
onMounted(() => { onMounted(() => {
RPC.post('/lightm/rtu/isOnline', { commUid: commit_uid }).then(res => {
console.log('/lightm/rtu/isOnlin', res)
isOnline.value = res
if (isOnline.value) {
getInfo()
} else {
ElMessage.error('设备不在线')
}
})
updateTime() updateTime()
timeInterval = setInterval(updateTime, 1000) timeInterval = setInterval(updateTime, 1000)
}) })

@ -200,317 +200,9 @@ const RiseSetOption = [
{ label: '延后60分钟', value: -60 }, { label: '延后60分钟', value: -60 },
] ]
RPC.post('/m9z/getLgnLatData', { comm_uid: commit_uid }).then((res) => {
formField.value.lat = res.lat
formField.value.lgn = res.lgn
formField.value.loc = res.loc
})
RPC.post('/m9z/getSunRiseSet', { comm_uid: commit_uid }).then((res) => {
formField.value.rise = res.rise
formField.value.set = res.set
})
RPC.post('/m9z/getDeviceTime', { comm_uid: commit_uid }).then((res) => {
deviceTime.value = res.deviceTime
})
RPC.post('/m9z/getAllSubLoopParameter', { comm_uid: commit_uid }).then((res) => {
subLoopParameter.value = res
// subLoopParameter.value = {
// "subLoopData": [
// {
// "DCVoltage": 0.5,
// "DCCurrent": 0,
// "DimmingValue": 70,
// "AlarmStatus": 9,
// "AlarmCode": "09 01",
// "RelayStatus": 1,
// "LoopAddress": "0x1",
// "SubModuleCount": 1,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": [
// {
// "OutputVoltage": 0,
// "OutputCurrent": 0,
// "CurrentPWMDuty": 0,
// "VoltagePWMDuty": 0,
// "DeviceAddress": "0x0",
// "ModuleLoopAddress": "0x0",
// "CurrentLimitPct": 0,
// "OperatingMode": 0,
// "ModuleVersion": 0,
// "RatedVoltageDuty": 0,
// "RatedCurrentDuty": 0,
// "RatedOutputVoltage": 0,
// "RatedOutputCurrent": 0
// }
// ]
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x1",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x2",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x4",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// }
// ],
// "totalP": 0
// }
})
const address = ref('') const address = ref('')
RPC.post('/adl400/getMsgAddress', { comm_uid: commit_uid }).then((res) => {
address.value = res
})
const week = ref('') const week = ref('')
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
@ -579,7 +271,325 @@ const goBack = () => {
let timeInterval = null let timeInterval = null
const isOnline = ref(false)
onMounted(() => { onMounted(() => {
RPC.post('/lightm/rtu/isOnline', { commUid: commit_uid }).then(res => {
console.log('/lightm/rtu/isOnlin', res)
isOnline.value = res
if (isOnline.value) {
RPC.post('/adl400/getMsgAddress', { comm_uid: commit_uid }).then((res) => {
address.value = res
})
RPC.post('/m9z/getLgnLatData', { comm_uid: commit_uid }).then((res) => {
formField.value.lat = res.lat
formField.value.lgn = res.lgn
formField.value.loc = res.loc
})
RPC.post('/m9z/getSunRiseSet', { comm_uid: commit_uid }).then((res) => {
formField.value.rise = res.rise
formField.value.set = res.set
})
RPC.post('/m9z/getDeviceTime', { comm_uid: commit_uid }).then((res) => {
deviceTime.value = res.deviceTime
})
RPC.post('/m9z/getAllSubLoopParameter', { comm_uid: commit_uid }).then((res) => {
subLoopParameter.value = res
// subLoopParameter.value = {
// "subLoopData": [
// {
// "DCVoltage": 0.5,
// "DCCurrent": 0,
// "DimmingValue": 70,
// "AlarmStatus": 9,
// "AlarmCode": "09 01",
// "RelayStatus": 1,
// "LoopAddress": "0x1",
// "SubModuleCount": 1,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": [
// {
// "OutputVoltage": 0,
// "OutputCurrent": 0,
// "CurrentPWMDuty": 0,
// "VoltagePWMDuty": 0,
// "DeviceAddress": "0x0",
// "ModuleLoopAddress": "0x0",
// "CurrentLimitPct": 0,
// "OperatingMode": 0,
// "ModuleVersion": 0,
// "RatedVoltageDuty": 0,
// "RatedCurrentDuty": 0,
// "RatedOutputVoltage": 0,
// "RatedOutputCurrent": 0
// }
// ]
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x1",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x2",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "",
// "RelayStatus": 0,
// "LoopAddress": "0x4",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": null
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// },
// {
// "DCVoltage": 0,
// "DCCurrent": 0,
// "DimmingValue": 0,
// "AlarmStatus": 0,
// "AlarmCode": "00 00",
// "RelayStatus": 0,
// "LoopAddress": "0x0",
// "SubModuleCount": 0,
// "Reserved": [
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ],
// "Modules": []
// }
// ],
// "totalP": 0
// }
})
} else {
ElMessage.error('设备不在线')
}
})
updateTime() updateTime()
timeInterval = setInterval(updateTime, 1000) timeInterval = setInterval(updateTime, 1000)
}) })

@ -59,7 +59,8 @@ export default defineConfig({
open: true, open: true,
proxy: { proxy: {
'/jsonrpc': { '/jsonrpc': {
target: 'https://lamp.ruixininfo.com', // target: 'https://lamp.ruixininfo.com',
target: 'https://smart-light.ruixininfo.com',
// target: 'http://171.208.94.46:7070', // target: 'http://171.208.94.46:7070',
changeOrigin: true, changeOrigin: true,
secure: false, secure: false,

Loading…
Cancel
Save