|
|
|
|
@ -11,7 +11,7 @@
|
|
|
|
|
<h1>手动控制</h1>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="system-status">
|
|
|
|
|
<!-- <span>系统已运行:{{ systemRuntime }}</span> -->
|
|
|
|
|
<span>设备时间:{{ deviceTime ? dayjs(deviceTime).format('YYYY-MM-DD HH:mm') : '' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@ -175,12 +175,9 @@
|
|
|
|
|
设备号:{{ commit_uid }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="bottom_item">
|
|
|
|
|
<!-- <el-button class="restart-button" @click="restartSystem">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<RefreshRight />
|
|
|
|
|
</el-icon>
|
|
|
|
|
远程重启
|
|
|
|
|
</el-button> -->
|
|
|
|
|
<el-button class="restart-button" :loading="timeLoading" @click="setDeviceTime">
|
|
|
|
|
同步时间
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button class="restart-button" @click="refresh">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<RefreshRight />
|
|
|
|
|
@ -224,10 +221,33 @@ const commit_uid = localStorage.getItem('central_control_comm_uid')
|
|
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const currentTime = ref('')
|
|
|
|
|
const deviceTime = ref('')
|
|
|
|
|
const systemRuntime = ref('38分钟')
|
|
|
|
|
const brightnessDialogVisible = ref(false)
|
|
|
|
|
const currentBrightness = ref(50)
|
|
|
|
|
const selectedChannelName = ref(null)
|
|
|
|
|
const timeLoading = ref(false)
|
|
|
|
|
|
|
|
|
|
const isUpDateTimeing = ref(false)
|
|
|
|
|
const getDeviceTime = () => {
|
|
|
|
|
isUpDateTimeing.value = true
|
|
|
|
|
RPC.post('/m9z/getDeviceTime', { comm_uid: commit_uid }).then(res => {
|
|
|
|
|
deviceTime.value = res.deviceTime
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
isUpDateTimeing.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
getDeviceTime()
|
|
|
|
|
|
|
|
|
|
const setDeviceTime = () => {
|
|
|
|
|
timeLoading.value = true
|
|
|
|
|
RPC.post('/m9z/setDeviceTime', { comm_uid: commit_uid, device_time: dayjs().format('YYYY-MM-DD HH:mm:ss') }).then(res => {
|
|
|
|
|
ElMessage.success('同步时间成功')
|
|
|
|
|
getDeviceTime()
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
timeLoading.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const week = ref('')
|
|
|
|
|
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
|
|
|
|
|
@ -459,6 +479,9 @@ const updateTime = () => {
|
|
|
|
|
week.value = weekDays[now.getDay()]
|
|
|
|
|
|
|
|
|
|
currentTime.value = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
|
|
|
|
if (deviceTime.value && !isUpDateTimeing.value) {
|
|
|
|
|
deviceTime.value = dayjs(deviceTime.value).valueOf() + 1000
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 切换回路状态
|
|
|
|
|
@ -653,7 +676,7 @@ onUnmounted(() => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.system-status {
|
|
|
|
|
min-width: 200px;
|
|
|
|
|
min-width: 300px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: 300;
|
|
|
|
|
width: 270px;
|
|
|
|
|
|