|
|
|
|
@ -200,19 +200,99 @@ const RiseSetOption = [
|
|
|
|
|
{ label: '延后60分钟', value: -60 },
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
RPC.post('/m9z/getLgnLatData', { comm_uid: commit_uid }).then((res) => {
|
|
|
|
|
|
|
|
|
|
const address = ref('')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const week = ref('')
|
|
|
|
|
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
|
|
|
|
|
// 更新时间
|
|
|
|
|
const updateTime = () => {
|
|
|
|
|
const now = new Date()
|
|
|
|
|
const year = now.getFullYear()
|
|
|
|
|
const month = String(now.getMonth() + 1).padStart(2, '0')
|
|
|
|
|
const day = String(now.getDate()).padStart(2, '0')
|
|
|
|
|
const hours = String(now.getHours()).padStart(2, '0')
|
|
|
|
|
const minutes = String(now.getMinutes()).padStart(2, '0')
|
|
|
|
|
const seconds = String(now.getSeconds()).padStart(2, '0')
|
|
|
|
|
|
|
|
|
|
week.value = weekDays[now.getDay()]
|
|
|
|
|
currentTime.value = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const restartSystem = () => {
|
|
|
|
|
ElMessageBox.confirm(`此操作将远程重启,是否继续?`, '提示', {
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
}).then(() => {
|
|
|
|
|
RPC.post('/m9z/setRestart', { comm_uid: commit_uid }).then((res) => {
|
|
|
|
|
ElMessage.success('远程重启成功')
|
|
|
|
|
getInfo()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const save = () => {
|
|
|
|
|
ElMessageBox.confirm(`此操作将保存配置,是否继续?`, '提示', {
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
}).then(() => {
|
|
|
|
|
const params = {
|
|
|
|
|
comm_uid: commit_uid,
|
|
|
|
|
lat: Number(formField.value.lat),
|
|
|
|
|
lgn: Number(formField.value.lgn),
|
|
|
|
|
loc_str: formField.value.loc,
|
|
|
|
|
rise: Number(formField.value.rise),
|
|
|
|
|
set: Number(formField.value.set),
|
|
|
|
|
}
|
|
|
|
|
Promise.all(
|
|
|
|
|
RPC.post('/m9z/setDeviceLgnLatAndSunRsTime', params),
|
|
|
|
|
RPC.post('/m9z/setDeviceTime', { comm_uid: commit_uid, device_time: deviceTime.value }),
|
|
|
|
|
).then((res) => {
|
|
|
|
|
ElMessage.success('操作成功')
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const currentTableData = ref([])
|
|
|
|
|
const currentTitle = ref('')
|
|
|
|
|
const isShowDialog = ref(false)
|
|
|
|
|
const openDialog = (item) => {
|
|
|
|
|
isShowDialog.value = true
|
|
|
|
|
currentTableData.value = item.Modules
|
|
|
|
|
currentTitle.value = item.LoopAddress
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 返回主界面
|
|
|
|
|
const goBack = () => {
|
|
|
|
|
router.push('/')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let timeInterval = null
|
|
|
|
|
|
|
|
|
|
const isOnline = ref(false)
|
|
|
|
|
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) => {
|
|
|
|
|
})
|
|
|
|
|
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) => {
|
|
|
|
|
})
|
|
|
|
|
RPC.post('/m9z/getDeviceTime', { comm_uid: commit_uid }).then((res) => {
|
|
|
|
|
deviceTime.value = res.deviceTime
|
|
|
|
|
})
|
|
|
|
|
RPC.post('/m9z/getAllSubLoopParameter', { comm_uid: commit_uid }).then((res) => {
|
|
|
|
|
})
|
|
|
|
|
RPC.post('/m9z/getAllSubLoopParameter', { comm_uid: commit_uid }).then((res) => {
|
|
|
|
|
subLoopParameter.value = res
|
|
|
|
|
// subLoopParameter.value = {
|
|
|
|
|
// "subLoopData": [
|
|
|
|
|
@ -505,81 +585,11 @@ RPC.post('/m9z/getAllSubLoopParameter', { comm_uid: commit_uid }).then((res) =>
|
|
|
|
|
// ],
|
|
|
|
|
// "totalP": 0
|
|
|
|
|
// }
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const address = ref('')
|
|
|
|
|
RPC.post('/adl400/getMsgAddress', { comm_uid: commit_uid }).then((res) => {
|
|
|
|
|
address.value = res
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const week = ref('')
|
|
|
|
|
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
|
|
|
|
|
// 更新时间
|
|
|
|
|
const updateTime = () => {
|
|
|
|
|
const now = new Date()
|
|
|
|
|
const year = now.getFullYear()
|
|
|
|
|
const month = String(now.getMonth() + 1).padStart(2, '0')
|
|
|
|
|
const day = String(now.getDate()).padStart(2, '0')
|
|
|
|
|
const hours = String(now.getHours()).padStart(2, '0')
|
|
|
|
|
const minutes = String(now.getMinutes()).padStart(2, '0')
|
|
|
|
|
const seconds = String(now.getSeconds()).padStart(2, '0')
|
|
|
|
|
|
|
|
|
|
week.value = weekDays[now.getDay()]
|
|
|
|
|
currentTime.value = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const restartSystem = () => {
|
|
|
|
|
ElMessageBox.confirm(`此操作将远程重启,是否继续?`, '提示', {
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
}).then(() => {
|
|
|
|
|
RPC.post('/m9z/setRestart', { comm_uid: commit_uid }).then((res) => {
|
|
|
|
|
ElMessage.success('远程重启成功')
|
|
|
|
|
getInfo()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const save = () => {
|
|
|
|
|
ElMessageBox.confirm(`此操作将保存配置,是否继续?`, '提示', {
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
}).then(() => {
|
|
|
|
|
const params = {
|
|
|
|
|
comm_uid: commit_uid,
|
|
|
|
|
lat: Number(formField.value.lat),
|
|
|
|
|
lgn: Number(formField.value.lgn),
|
|
|
|
|
loc_str: formField.value.loc,
|
|
|
|
|
rise: Number(formField.value.rise),
|
|
|
|
|
set: Number(formField.value.set),
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error('设备不在线')
|
|
|
|
|
}
|
|
|
|
|
Promise.all(
|
|
|
|
|
RPC.post('/m9z/setDeviceLgnLatAndSunRsTime', params),
|
|
|
|
|
RPC.post('/m9z/setDeviceTime', { comm_uid: commit_uid, device_time: deviceTime.value }),
|
|
|
|
|
).then((res) => {
|
|
|
|
|
ElMessage.success('操作成功')
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const currentTableData = ref([])
|
|
|
|
|
const currentTitle = ref('')
|
|
|
|
|
const isShowDialog = ref(false)
|
|
|
|
|
const openDialog = (item) => {
|
|
|
|
|
isShowDialog.value = true
|
|
|
|
|
currentTableData.value = item.Modules
|
|
|
|
|
currentTitle.value = item.LoopAddress
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 返回主界面
|
|
|
|
|
const goBack = () => {
|
|
|
|
|
router.push('/')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let timeInterval = null
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
updateTime()
|
|
|
|
|
timeInterval = setInterval(updateTime, 1000)
|
|
|
|
|
})
|
|
|
|
|
|