30 changed files with 1189 additions and 349 deletions
-
30src/apis/system.ts
-
112src/app.vue
-
2src/assets/images/background-login.svg
-
245src/components/formula/FormulaConfig.vue
-
8src/components/formula/FormulaTable.vue
-
28src/components/home/Environment.vue
-
106src/components/home/HomeOperation.vue
-
192src/components/home/HomeSetting.vue
-
58src/components/home/config.vue
-
1src/components/liquid/LiquidLevel.vue
-
4src/components/setting/SystemDate.vue
-
100src/components/system/NetReconnection.vue
-
70src/layouts/default.vue
-
4src/libs/constant.ts
-
10src/libs/countdownTimer.ts
-
12src/libs/socket.ts
-
23src/libs/utils.ts
-
24src/stores/deviceStore.ts
-
70src/stores/formulaStore.ts
-
100src/stores/homeStore.ts
-
4src/stores/initHomeData.ts
-
31src/stores/liquidStore.ts
-
14src/stores/sealStore.ts
-
34src/stores/settingStore.ts
-
64src/stores/systemStore.ts
-
6src/types/system.d.ts
-
64src/views/audit/index.vue
-
19src/views/liquid/index.vue
-
95src/views/login/index.vue
-
8src/views/seal/index.vue
2
src/assets/images/background-login.svg
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,100 @@ |
|||||
|
<script setup lang="ts"> |
||||
|
import { useSystemStore } from '@/stores/systemStore' |
||||
|
import { startTimer, stopTimer } from 'libs/countdownTimer' |
||||
|
import { ref, watchEffect } from 'vue' |
||||
|
import { useRouter } from 'vue-router' |
||||
|
|
||||
|
const systemStore = useSystemStore() |
||||
|
const router = useRouter() |
||||
|
const timer = ref() |
||||
|
|
||||
|
const countdownToReconnection = () => { |
||||
|
startTimer(30 * 1000, (times: string) => { |
||||
|
if (times === '0') { |
||||
|
router.push('/login') |
||||
|
return |
||||
|
} |
||||
|
timer.value = times |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
watchEffect(() => { |
||||
|
if (!systemStore.websocketConnected) { |
||||
|
countdownToReconnection() |
||||
|
} |
||||
|
else { |
||||
|
stopTimer() |
||||
|
} |
||||
|
}) |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<div class="reconnect-modal-overlay"> |
||||
|
<div class="reconnect-modal-container"> |
||||
|
<div class="reconnect-spinner" /> |
||||
|
<h2 class="reconnect-title"> |
||||
|
正在重连中 {{ timer }} |
||||
|
</h2> |
||||
|
<p class="reconnect-message"> |
||||
|
请稍候,系统正在尝试重新连接网格... |
||||
|
</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<style scoped> |
||||
|
.reconnect-modal-overlay { |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
background-color: rgba(0, 0, 0, 0.5); |
||||
|
backdrop-filter: blur(4px); |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
z-index: 9999; |
||||
|
} |
||||
|
|
||||
|
.reconnect-modal-container { |
||||
|
background-color: white; |
||||
|
border-radius: 12px; |
||||
|
padding: 40px; |
||||
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); |
||||
|
text-align: center; |
||||
|
animation: fadeIn 0.3s ease-out; |
||||
|
} |
||||
|
|
||||
|
.reconnect-spinner { |
||||
|
width: 64px; |
||||
|
height: 64px; |
||||
|
border: 6px solid #f3f3f3; |
||||
|
border-radius: 50%; |
||||
|
border-top: 6px solid #3b82f6; |
||||
|
margin: 0 auto 24px; |
||||
|
animation: spin 1s linear infinite; |
||||
|
} |
||||
|
|
||||
|
.reconnect-title { |
||||
|
font-size: 1.12rem; |
||||
|
font-weight: bold; |
||||
|
color: #1f2937; |
||||
|
margin-bottom: 12px; |
||||
|
} |
||||
|
|
||||
|
.reconnect-message { |
||||
|
font-size: 16px; |
||||
|
color: #4b5563; |
||||
|
} |
||||
|
|
||||
|
@keyframes spin { |
||||
|
0% { transform: rotate(0deg); } |
||||
|
100% { transform: rotate(360deg); } |
||||
|
} |
||||
|
|
||||
|
@keyframes fadeIn { |
||||
|
from { opacity: 0; transform: scale(0.95); } |
||||
|
to { opacity: 1; transform: scale(1); } |
||||
|
} |
||||
|
</style> |
@ -1,20 +1,34 @@ |
|||||
import { defineStore } from 'pinia' |
import { defineStore } from 'pinia' |
||||
import { ref } from 'vue' |
import { ref } from 'vue' |
||||
|
|
||||
|
/** |
||||
|
* 密封状态管理模块 |
||||
|
* @module useSealStore |
||||
|
*/ |
||||
export const useSealStore = defineStore('seal', () => { |
export const useSealStore = defineStore('seal', () => { |
||||
|
// 状态定义
|
||||
const sealState = ref('idle') |
const sealState = ref('idle') |
||||
const sealInfo = ref<Seal.SealStateItem>({ |
const sealInfo = ref<Seal.SealStateItem>({ |
||||
pressure: '0', |
pressure: '0', |
||||
workState: 'idle', |
workState: 'idle', |
||||
workStateDisplay: '空闲', |
workStateDisplay: '空闲', |
||||
}) |
}) |
||||
|
|
||||
|
/** |
||||
|
* @function updateSealInfo |
||||
|
* @param {Seal.SealStateItem} dataInfo - 密封状态信息 |
||||
|
* @desc 更新密封状态信息,包括压力值和工作状态 |
||||
|
*/ |
||||
const updateSealInfo = (dataInfo: Seal.SealStateItem) => { |
const updateSealInfo = (dataInfo: Seal.SealStateItem) => { |
||||
sealInfo.value = dataInfo |
sealInfo.value = dataInfo |
||||
} |
} |
||||
|
|
||||
return { |
return { |
||||
|
// 状态属性
|
||||
sealState, |
sealState, |
||||
sealInfo, |
sealInfo, |
||||
|
|
||||
|
// 操作方法
|
||||
updateSealInfo, |
updateSealInfo, |
||||
} |
} |
||||
}) |
}) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue