Lufaneng 10 months ago
parent b089550502
commit 64aa95531c

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

Loading…
Cancel
Save