|
@ -3,7 +3,8 @@ import WifiConnSvg from 'assets/images/wifi-conn.svg' |
|
|
import WifiUnconnSvg from 'assets/images/wifi-unconn.svg' |
|
|
import WifiUnconnSvg from 'assets/images/wifi-unconn.svg' |
|
|
import ErrorEventsModal from 'components/system/ErrorEventsModal.vue' |
|
|
import ErrorEventsModal from 'components/system/ErrorEventsModal.vue' |
|
|
import NetReconnection from 'components/system/NetReconnection.vue' |
|
|
import NetReconnection from 'components/system/NetReconnection.vue' |
|
|
import { formatDateTime, openFullscreen } from 'libs/utils' |
|
|
|
|
|
|
|
|
import { delToken } from 'libs/token' |
|
|
|
|
|
import { formatDateTime } from 'libs/utils' |
|
|
import { authRoutes } from 'router/routes' |
|
|
import { authRoutes } from 'router/routes' |
|
|
import { useDeviceStore } from 'stores/deviceStore' |
|
|
import { useDeviceStore } from 'stores/deviceStore' |
|
|
import { computed, onMounted, onUnmounted, ref, watch, watchEffect } from 'vue' |
|
|
import { computed, onMounted, onUnmounted, ref, watch, watchEffect } from 'vue' |
|
@ -38,12 +39,6 @@ const liquidDrainState = ref(liquidStore.liquidDrainWorkState) |
|
|
const deviceState = ref(deviceStore.deviceState) |
|
|
const deviceState = ref(deviceStore.deviceState) |
|
|
const sealInfo = ref(sealStore.sealInfo) |
|
|
const sealInfo = ref(sealStore.sealInfo) |
|
|
const websocketConnected = ref(systemStore.websocketConnected) |
|
|
const websocketConnected = ref(systemStore.websocketConnected) |
|
|
let touchStartTime = 0 |
|
|
|
|
|
let touchCount = 0 |
|
|
|
|
|
|
|
|
|
|
|
const userData = localStorage.getItem('user') |
|
|
|
|
|
const userInfo = userData ? JSON.parse(userData) : {} |
|
|
|
|
|
const userRole = userInfo.roleType || '' |
|
|
|
|
|
|
|
|
|
|
|
const deviceType = __DEVICE_TYPE__ |
|
|
const deviceType = __DEVICE_TYPE__ |
|
|
|
|
|
|
|
@ -57,31 +52,37 @@ const menuList = computed(() => { |
|
|
) { |
|
|
) { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
return !(item.name === 'debug' && userRole !== 'admin') |
|
|
|
|
|
|
|
|
return !(item.name === 'debug' && systemStore.systemUser?.name !== 'admin') |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
|
|
|
runSystemTime(systemStore.systemTime) |
|
|
|
|
|
console.log(systemStore.systemUser) |
|
|
// 连续3次点击任意地方,全屏显示 |
|
|
// 连续3次点击任意地方,全屏显示 |
|
|
onFullScreen() |
|
|
|
|
|
|
|
|
// onFullScreen() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const onFullScreen = () => { |
|
|
|
|
|
document.body.addEventListener('touchstart', (event) => { |
|
|
|
|
|
const now = Date.now() |
|
|
|
|
|
const timeDiff = now - touchStartTime |
|
|
|
|
|
if (timeDiff < 300 && timeDiff > 0) { |
|
|
|
|
|
touchCount++ |
|
|
|
|
|
if (touchCount === 3) { |
|
|
|
|
|
event.preventDefault() |
|
|
|
|
|
openFullscreen() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
touchCount = 1 |
|
|
|
|
|
} |
|
|
|
|
|
touchStartTime = now |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// const touchStartTime = 0 |
|
|
|
|
|
// const touchCount = 0 |
|
|
|
|
|
|
|
|
|
|
|
// const onFullScreen = () => { |
|
|
|
|
|
// document.body.addEventListener('touchstart', (event) => { |
|
|
|
|
|
// const now = Date.now() |
|
|
|
|
|
// const timeDiff = now - touchStartTime |
|
|
|
|
|
// if (timeDiff < 300 && timeDiff > 0) { |
|
|
|
|
|
// touchCount++ |
|
|
|
|
|
// if (touchCount === 3) { |
|
|
|
|
|
// event.preventDefault() |
|
|
|
|
|
// openFullscreen() |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// else { |
|
|
|
|
|
// touchCount = 1 |
|
|
|
|
|
// } |
|
|
|
|
|
// touchStartTime = now |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
const showDeviceStateName = () => { |
|
|
const showDeviceStateName = () => { |
|
|
if (deviceState.value.state?.toLocaleLowerCase() !== 'idle') { |
|
|
if (deviceState.value.state?.toLocaleLowerCase() !== 'idle') { |
|
@ -103,10 +104,6 @@ const showDeviceStateName = () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
|
runSystemTime(systemStore.systemTime) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
watchEffect(() => { |
|
|
watchEffect(() => { |
|
|
deviceInfo.value = deviceStore.deviceInfo |
|
|
deviceInfo.value = deviceStore.deviceInfo |
|
|
websocketConnected.value = systemStore.websocketConnected |
|
|
websocketConnected.value = systemStore.websocketConnected |
|
@ -158,6 +155,8 @@ const onLogout = () => { |
|
|
} |
|
|
} |
|
|
FtMessageBox.warning('请确认是否退出登录?').then(() => { |
|
|
FtMessageBox.warning('请确认是否退出登录?').then(() => { |
|
|
localStorage.removeItem('user') |
|
|
localStorage.removeItem('user') |
|
|
|
|
|
delToken() |
|
|
|
|
|
useSystemStore().updateUser(null) |
|
|
router.push('/login') |
|
|
router.push('/login') |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|