Browse Source

优化报警

master
LiLongLong 1 month ago
parent
commit
8bab92b0d9
  1. 2
      package.json
  2. 2
      src/components/formula/FormulaConfig.vue
  3. 8
      src/components/home/Environment.vue
  4. 16
      src/components/home/HomeOperation.vue
  5. 38
      src/components/home/HomeSetting.vue
  6. 1
      src/components/home/LineChart.vue
  7. 50
      src/components/seal/DashboardChart.vue
  8. 9
      src/components/setting/SystemDate.vue
  9. 179
      src/components/system/ErrorEventsModal.vue
  10. 3
      src/layouts/default.vue
  11. 1
      src/router/routes.ts
  12. 12
      src/stores/deviceStore.ts
  13. 6
      src/stores/homeStore.ts
  14. 8
      src/stores/liquidStore.ts
  15. 16
      src/stores/systemStore.ts
  16. 4
      src/views/audit/index.vue
  17. 12
      src/views/home/chart.vue
  18. 15
      src/views/home/index.vue
  19. 32
      src/views/liquid/index.vue
  20. 19
      src/views/seal/index.vue

2
package.json

@ -1,7 +1,7 @@
{ {
"name": "matrix-spray-web", "name": "matrix-spray-web",
"type": "module", "type": "module",
"version": "0.0.9",
"version": "0.0.1",
"description": "", "description": "",
"author": "", "author": "",
"license": "ISC", "license": "ISC",

2
src/components/formula/FormulaConfig.vue

@ -244,7 +244,7 @@ const onAddFormula = () => {
if (res.ackcode === 0) { if (res.ackcode === 0) {
const item = res.rely const item = res.rely
const formulaForm: Record<string, any> = convertValuesToString(formData.value, 'name') const formulaForm: Record<string, any> = convertValuesToString(formData.value, 'name')
formulaForm.name = item.name
// formulaForm.name = item.name
formulaForm.formula_id = item.formula_id formulaForm.formula_id = item.formula_id
onEditFormula(item.formula_id, formulaForm as Formula.FormulaItem) onEditFormula(item.formula_id, formulaForm as Formula.FormulaItem)
} }

8
src/components/home/Environment.vue

@ -3,7 +3,7 @@ import homeInside from 'assets/images/home/home-inside.svg'
import homeProbe1 from 'assets/images/home/home-probe1.svg' import homeProbe1 from 'assets/images/home/home-probe1.svg'
import homeProbe2 from 'assets/images/home/home-probe2.svg' import homeProbe2 from 'assets/images/home/home-probe2.svg'
import { roundNumber } from 'libs/utils' import { roundNumber } from 'libs/utils'
import { onMounted } from 'vue'
import { onMounted, watchEffect } from 'vue'
/** /**
* 环境参数展示组件 * 环境参数展示组件
@ -11,7 +11,7 @@ import { onMounted } from 'vue'
* @props {Object} envParams - 环境参数对象 * @props {Object} envParams - 环境参数对象
* @props {string} lineColor - 线条颜色默认值red * @props {string} lineColor - 线条颜色默认值red
*/ */
defineProps({
const props = defineProps({
envParams: { envParams: {
type: Object, type: Object,
default: () => ({ default: () => ({
@ -29,6 +29,10 @@ defineProps({
}, },
}) })
watchEffect(() => {
console.log('props===', props.envParams)
})
/** /**
* 图片资源映射对象 * 图片资源映射对象
* @type {Record<string, any>} * @type {Record<string, any>}

16
src/components/home/HomeOperation.vue

@ -76,13 +76,19 @@ const handleDisinfectState = (report: Socket.WebSocketResponse<Home.DisinfectSta
* @function 开始消毒操作 * @function 开始消毒操作
* @desc 校验设备状态并发起消毒请求 * @desc 校验设备状态并发起消毒请求
*/ */
const onStartDisinfect = async () => {
const onStartDisinfect = () => {
// //
if (!formulaStore.loglevel) { if (!formulaStore.loglevel) {
FtMessage.warning('请选择消毒等级') FtMessage.warning('请选择消毒等级')
return return
} }
FtMessageBox.warning('请确认是否开始消毒').then(() => {
doStartDisinfect()
})
}
const doStartDisinfect = async () => {
// //
const statusName = getDeviceStatus() const statusName = getDeviceStatus()
if (statusName) { if (statusName) {
@ -114,7 +120,13 @@ const onStartDisinfect = async () => {
* @function 结束消毒操作 * @function 结束消毒操作
* @desc 停止倒计时并发起结束消毒请求 * @desc 停止倒计时并发起结束消毒请求
*/ */
const onFinishDisinfect = async () => {
const onFinishDisinfect = () => {
FtMessageBox.warning('请确认是否结束消毒').then(() => {
doStopDisinfect()
})
}
const doStopDisinfect = async () => {
stopTimer() // stopTimer() //
systemStore.updateLoading(true) systemStore.updateLoading(true)
try { try {

38
src/components/home/HomeSetting.vue

@ -2,7 +2,7 @@
import { FtMessage } from '@/libs/message' import { FtMessage } from '@/libs/message'
import { useFormulaStore } from '@/stores/formulaStore' import { useFormulaStore } from '@/stores/formulaStore'
import { useHomeStore } from '@/stores/homeStore' import { useHomeStore } from '@/stores/homeStore'
import { sendCmd } from 'apis/system'
import { sendCmd, syncSendCmd } from 'apis/system'
import homeChart from 'assets/images/home/home-chart.svg' import homeChart from 'assets/images/home/home-chart.svg'
import homeRunSvg from 'assets/images/home/home-run.svg' import homeRunSvg from 'assets/images/home/home-run.svg'
import homeSettingSvg from 'assets/images/home/home-setting.svg' import homeSettingSvg from 'assets/images/home/home-setting.svg'
@ -66,9 +66,10 @@ const getPressureConfig = async () => {
className: 'PipelinePressureControl', className: 'PipelinePressureControl',
fnName: 'getConfig', fnName: 'getConfig',
} }
const res = await sendCmd(pressureParams)
console.log('res---', res)
homeStore.updatePressureConfig(res)
const res = await syncSendCmd(pressureParams)
if (res.ackcode === 0) {
homeStore.updatePressureConfig(res.rely)
}
} }
/** /**
@ -138,7 +139,7 @@ const onSave = async () => {
* @desc 向设备发送实时参数修改指令 * @desc 向设备发送实时参数修改指令
*/ */
const setRealtimeConfig = async (key: string, val: string) => { const setRealtimeConfig = async (key: string, val: string) => {
await sendCmd({
await syncSendCmd({
className: 'DisinfectionCtrlServiceExt', className: 'DisinfectionCtrlServiceExt',
fnName: 'setRealtimeConfig', fnName: 'setRealtimeConfig',
params: { key, val }, params: { key, val },
@ -202,10 +203,12 @@ const onClose = () => {
<template> <template>
<div class="home-start-opt"> <div class="home-start-opt">
<div class="home-opt-flex"> <div class="home-opt-flex">
<div>
<bt-button <bt-button
button-text="压力控制" button-text="压力控制"
text-size="14px"
text-size="12px"
border-radius="5px" border-radius="5px"
width="8rem"
text-color="#1989fa" text-color="#1989fa"
padding="0.8vw" padding="0.8vw"
@click="onSetPressure" @click="onSetPressure"
@ -214,10 +217,13 @@ const onClose = () => {
<el-icon><Sort /></el-icon> <el-icon><Sort /></el-icon>
</template> </template>
</bt-button> </bt-button>
</div>
<div class="home-opt-ml">
<bt-button <bt-button
button-text="查看图表" button-text="查看图表"
text-size="14px"
text-size="12px"
border-radius="5px" border-radius="5px"
width="7rem"
text-color="#1989fa" text-color="#1989fa"
padding="0.8vw" padding="0.8vw"
:disabled="deviceState" :disabled="deviceState"
@ -227,12 +233,14 @@ const onClose = () => {
<img :src="homeChart" width="15" alt=""> <img :src="homeChart" width="15" alt="">
</template> </template>
</bt-button> </bt-button>
</div>
<div class="home-opt-ml">
<bt-button <bt-button
v-if="deviceState" v-if="deviceState"
button-text="消毒设置" button-text="消毒设置"
text-size="14px"
text-size="12px"
border-radius="5px" border-radius="5px"
width="8rem"
text-color="#1989fa" text-color="#1989fa"
padding="0.8vw" padding="0.8vw"
@click="onDisinfectConfig" @click="onDisinfectConfig"
@ -244,8 +252,9 @@ const onClose = () => {
<bt-button <bt-button
v-else v-else
button-text="运行参数" button-text="运行参数"
text-size="14px"
text-size="12px"
border-radius="5px" border-radius="5px"
width="7rem"
text-color="#1989fa" text-color="#1989fa"
@click="onDisinfectConfig" @click="onDisinfectConfig"
> >
@ -255,6 +264,7 @@ const onClose = () => {
</bt-button> </bt-button>
</div> </div>
</div> </div>
</div>
<ft-dialog v-model="disinfectFormulaVisible" width="80vw" :ok-handle="onSave" @cancel="onClose"> <ft-dialog v-model="disinfectFormulaVisible" width="80vw" :ok-handle="onSave" @cancel="onClose">
<div> <div>
<Config ref="configRef" /> <Config ref="configRef" />
@ -275,10 +285,14 @@ const onClose = () => {
.home-start-opt{ .home-start-opt{
position: absolute; position: absolute;
bottom: 0; bottom: 0;
margin: 1rem;
margin: 0.5rem;
gap: 5px; gap: 5px;
.home-opt-flex{ .home-opt-flex{
display: flex;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
.home-opt-ml{
margin-left: 5px;
}
} }
} }
</style> </style>

1
src/components/home/LineChart.vue

@ -15,7 +15,6 @@ const h2o2SaturationData = ref<(number)[]>([0])
const dataLength = ref(10) const dataLength = ref(10)
watchEffect(() => { watchEffect(() => {
console.log('envData.temp====', props.envData.temp)
temperatureData.value.push(props.envData.temp) temperatureData.value.push(props.envData.temp)
humidityData.value.push(props.envData.rh) humidityData.value.push(props.envData.rh)
h2o2ConcentrationData.value.push(props.envData.rs) h2o2ConcentrationData.value.push(props.envData.rs)

50
src/components/seal/DashboardChart.vue

@ -1,23 +1,33 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useSealStore } from '@/stores/sealStore' import { useSealStore } from '@/stores/sealStore'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { onMounted, ref, watchEffect } from 'vue'
import { onUnmounted, ref, watchEffect } from 'vue'
const sealStore = useSealStore() const sealStore = useSealStore()
const option = ref()
const pressure = ref(0)
onMounted(() => {
const chartDom = document.getElementById('main')!
const myChart = echarts.init(chartDom)
init()
option.value && myChart.setOption(option.value)
})
const chartRef = ref<HTMLElement | null>(null)
const realTimePressure = ref(sealStore.sealInfo.pressure)
let myChart: echarts.ECharts | null = null
watchEffect(() => { watchEffect(() => {
pressure.value = Number(sealStore.sealInfo.pressure)
realTimePressure.value = sealStore.sealInfo.pressure
const pressure = sealStore.sealInfo?.pressure || 0
if (!myChart && chartRef.value) {
initChart() //
}
if (myChart) {
myChart.setOption({
series: [{
data: [{ value: pressure }],
}],
})
}
}) })
const init = () => {
option.value = {
const initChart = () => {
if (!chartRef.value) {
return
}
myChart = echarts.init(chartRef.value)
const option = {
tooltip: { tooltip: {
formatter: '{a} <br/>{b} : {c}%', formatter: '{a} <br/>{b} : {c}%',
}, },
@ -41,22 +51,30 @@ const init = () => {
}, },
data: [ data: [
{ {
value: pressure.value,
value: realTimePressure.value,
}, },
], ],
}, },
], ],
} }
myChart.setOption(option)
}
//
onUnmounted(() => {
if (myChart) {
myChart.dispose() //
myChart = null
} }
})
</script> </script>
<template> <template>
<div id="main" style="width: 40vw; height: 30vw" />
<div ref="chartRef" style="width: 40vw; height: 30vw" />
</template> </template>
<style> <style>
canvas{ canvas{
width: 600px !important;
height: 450px !important;
width: 55vw !important;
height: 63vh !important;
} }
</style> </style>

9
src/components/setting/SystemDate.vue

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { sendCmd } from '@/apis/system'
import { syncSendCmd } from '@/apis/system'
import { FtMessage } from '@/libs/message' import { FtMessage } from '@/libs/message'
import { formatDateTime } from '@/libs/utils' import { formatDateTime } from '@/libs/utils'
import { ref } from 'vue' import { ref } from 'vue'
@ -23,7 +23,7 @@ const onChangeDate = async (value: string) => {
day, day,
}, },
} }
await sendCmd(dateParams)
syncSendCmd(dateParams)
const HMS = splitDate[1].split(':') const HMS = splitDate[1].split(':')
// //
@ -39,9 +39,12 @@ const onChangeDate = async (value: string) => {
second, second,
}, },
} }
await sendCmd(timeParams)
syncSendCmd(timeParams).then((res) => {
if (res.ackcode === 0) {
FtMessage.success('日期设置成功') FtMessage.success('日期设置成功')
} }
})
}
} }
</script> </script>

179
src/components/system/ErrorEventsModal.vue

@ -0,0 +1,179 @@
<script setup lang="ts">
import { syncSendCmd } from '@/apis/system'
import { useDeviceStore } from '@/stores/deviceStore'
import { ref, watchEffect } from 'vue'
const deviceStore = useDeviceStore()
const appEvents = ref<Record<string, any>[]>([])
watchEffect(() => {
appEvents.value = deviceStore.deviceStete.appEvents
})
const confirmClose = (item: Record<string, any>) => {
console.log('item === ', item)
const evenid = item.uuid
const params = {
className: 'AppCore',
fnName: 'appEventConfirm',
params: {
evenid,
},
}
syncSendCmd(params)
}
</script>
<template>
<div v-if="appEvents.length" class="reconnect-modal-overlay">
<div class="reconnect-modal-container">
<h2 class="reconnect-title">
错误信息
</h2>
<ul class="recipe-list">
<li
v-for="(item, index) in appEvents"
:key="index"
>
<span v-if="item.errCheckPoints">
<span v-for="checkItem in item.errCheckPoints" :key="checkItem.ecode">
{{ checkItem.ecodeInfo }}
</span>
</span>
<span v-else>{{ item.description || item.message }}</span>
<div class="actions">
<button class="delete-button" @click.stop="confirmClose(item)">
关闭
</button>
<span class="selected-icon">
<i class="fa fa-check-circle" />
</span>
</div>
</li>
</ul>
</div>
</div>
</template>
<style lang="scss" 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;
width: 40vw;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
text-align: center;
animation: fadeIn 0.3s ease-out;
.recipe-list {
list-style: none;
padding: 0;
margin: 0;
}
.recipe-list li {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
border-radius: 4px;
margin-bottom: 8px;
transition: all 0.2s;
cursor: pointer;
}
.recipe-list li:hover {
background-color: #f5f7fa;
}
.recipe-list li.selected {
background-color: #e6f7ff;
/* border: 1px solid #1890ff; */
/* padding: 9px; */
}
}
.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;
}
.actions {
display: flex;
align-items: center;
}
.view-button, .delete-button {
border: none;
padding: 4px 8px;
border-radius: 3px;
cursor: pointer;
margin-right: 5px;
transition: all 0.3s;
}
.view-button {
background-color: #e6f7ff;
color: #1890ff;
}
.view-button:hover {
background-color: #1890ff;
color: white;
}
.delete-button {
background-color: #ffe6e6;
color: #ff4d4f;
}
.delete-button:hover {
background-color: #ff4d4f;
color: white;
}
.selected-icon {
color: #1890ff;
/* margin-left: 8px; */
}
@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>

3
src/layouts/default.vue

@ -6,6 +6,7 @@ import { useLiquidStore } from '@/stores/liquidStore'
import { useSealStore } from '@/stores/sealStore' import { useSealStore } from '@/stores/sealStore'
import { useSystemStore } from '@/stores/systemStore' import { useSystemStore } from '@/stores/systemStore'
import HomeAlarmSvg from 'assets/images/home/home-alarm.svg' import HomeAlarmSvg from 'assets/images/home/home-alarm.svg'
import ErrorEventsModal from 'components/system/ErrorEventsModal.vue'
import NetReconnection from 'components/system/NetReconnection.vue' import NetReconnection from 'components/system/NetReconnection.vue'
// import ErrorBox from 'libs/modalUtil' // import ErrorBox from 'libs/modalUtil'
import { formatDateTime, openFullscreen } from 'libs/utils' import { formatDateTime, openFullscreen } from 'libs/utils'
@ -145,7 +146,6 @@ const onLogout = () => {
{{ language.name }} {{ language.name }}
</el-option> </el-option>
</el-select> </el-select>
&nbsp;&nbsp;&nbsp;&nbsp;
<bt-button <bt-button
type="primary" type="primary"
button-text="注销" button-text="注销"
@ -176,6 +176,7 @@ const onLogout = () => {
</div> </div>
</footer> </footer>
<NetReconnection v-if="!websocketConnected" /> <NetReconnection v-if="!websocketConnected" />
<ErrorEventsModal />
</el-container> </el-container>
</template> </template>

1
src/router/routes.ts

@ -44,6 +44,7 @@ const authRoutes: RouteRecordRaw[] = [
title: '消毒液', title: '消毒液',
icon: n_liquid, icon: n_liquid,
activeIcon: s_liquid, activeIcon: s_liquid,
keepAlive: true,
}, },
}, },
{ {

12
src/stores/deviceStore.ts

@ -12,9 +12,19 @@ const initDeviceInfo = {
projectType: '', projectType: '',
} }
const initState = {
appEvents: [],
loginUser: {
isLogin: true,
name: '',
roleType: '',
},
state: DEVICE_STATES.IDLE,
}
export const useDeviceStore = defineStore('device', () => { export const useDeviceStore = defineStore('device', () => {
const deviceInfo = ref<Device.DeviceInfo>(initDeviceInfo) const deviceInfo = ref<Device.DeviceInfo>(initDeviceInfo)
const deviceStete = ref({ state: DEVICE_STATES.IDLE }) // 设备状态
const deviceStete = ref<Device.State>(initState) // 设备状态
const updateDeviceInfo = (info: Device.DeviceInfo) => { const updateDeviceInfo = (info: Device.DeviceInfo) => {
deviceInfo.value = info deviceInfo.value = info

6
src/stores/homeStore.ts

@ -1,5 +1,5 @@
import { DEVICE_STATES } from '@/libs/utils' import { DEVICE_STATES } from '@/libs/utils'
import { sendCmd } from 'apis/system'
import { syncSendCmd } from 'apis/system'
import { PARSSURE_DATA } from 'libs/constant' import { PARSSURE_DATA } from 'libs/constant'
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
@ -71,7 +71,7 @@ export const useHomeStore = defineStore('home', () => {
fnName: 'setType', fnName: 'setType',
params: { type }, params: { type },
} }
await sendCmd(pressureTypeParams)
syncSendCmd(pressureTypeParams)
// 正压或负压时保存设置的压力值 // 正压或负压时保存设置的压力值
if (type === 'positivePressure' || type === 'negativePressure') { if (type === 'positivePressure' || type === 'negativePressure') {
@ -81,7 +81,7 @@ export const useHomeStore = defineStore('home', () => {
fnName: 'setIntensity', fnName: 'setIntensity',
params: { intensity }, params: { intensity },
} }
await sendCmd(intensityParams)
syncSendCmd(intensityParams)
} }
} }
} }

8
src/stores/liquidStore.ts

@ -18,6 +18,7 @@ export const useLiquidStore = defineStore('Liquid', () => {
const liquidStateData = ref(liquidItem) const liquidStateData = ref(liquidItem)
const liquidTotal = ref<number>(2500) const liquidTotal = ref<number>(2500)
const liquidPeriod = ref(300) const liquidPeriod = ref(300)
const inputedStopatg = ref<number>(0)
/** /**
* @function updateAddLiquidWorkState * @function updateAddLiquidWorkState
@ -58,6 +59,10 @@ export const useLiquidStore = defineStore('Liquid', () => {
liquidPeriod.value = liquidConfig.updatePeriod liquidPeriod.value = liquidConfig.updatePeriod
} }
const updateinputedStopatg = (inputVal: number) => {
inputedStopatg.value = inputVal
}
return { return {
// 状态属性 // 状态属性
liquidAddWorkState, liquidAddWorkState,
@ -65,11 +70,12 @@ export const useLiquidStore = defineStore('Liquid', () => {
liquidTotal, liquidTotal,
liquidPeriod, liquidPeriod,
liquidStateData, liquidStateData,
inputedStopatg,
// 操作方法 // 操作方法
updateAddLiquidWorkState, updateAddLiquidWorkState,
updateDrainLiquidWorkState, updateDrainLiquidWorkState,
initLiquidConfig, initLiquidConfig,
updateLiquidState, updateLiquidState,
updateinputedStopatg,
} }
}) })

16
src/stores/systemStore.ts

@ -1,4 +1,4 @@
import { sendCmd } from '@/apis/system'
import { syncSendCmd } from '@/apis/system'
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { ref } from 'vue' import { ref } from 'vue'
@ -29,9 +29,9 @@ export const useSystemStore = defineStore('system', () => {
const updateLoading = (loadVal: boolean) => { const updateLoading = (loadVal: boolean) => {
loading.value = loadVal loading.value = loadVal
setTimeout(() => {
loading.value = false
}, 1500)
// setTimeout(() => {
// loading.value = false
// }, 1500)
} }
const updateConnected = (isConnected: boolean) => { const updateConnected = (isConnected: boolean) => {
@ -48,7 +48,7 @@ export const useSystemStore = defineStore('system', () => {
className: 'DisinfectionCtrlServiceExt', className: 'DisinfectionCtrlServiceExt',
fnName: 'startStateReport', fnName: 'startStateReport',
} }
await sendCmd(subParams)
syncSendCmd(subParams)
} }
/** /**
@ -61,7 +61,7 @@ export const useSystemStore = defineStore('system', () => {
className: 'AddLiquidService', className: 'AddLiquidService',
fnName: 'startStateReport', fnName: 'startStateReport',
} }
await sendCmd(subParams)
syncSendCmd(subParams)
} }
/** /**
@ -74,7 +74,7 @@ export const useSystemStore = defineStore('system', () => {
className: 'DrainLiquidService', className: 'DrainLiquidService',
fnName: 'startStateReport', fnName: 'startStateReport',
} }
await sendCmd(subParams)
syncSendCmd(subParams)
} }
/** /**
@ -87,7 +87,7 @@ export const useSystemStore = defineStore('system', () => {
className: 'AirLeakDetectTest', className: 'AirLeakDetectTest',
fnName: 'startStateReport', fnName: 'startStateReport',
} }
await sendCmd(subParams)
syncSendCmd(subParams)
} }
return { return {

4
src/views/audit/index.vue

@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { FtMessage } from '@/libs/message' import { FtMessage } from '@/libs/message'
import { sendCmd } from 'apis/system'
import { sendCmd, syncSendCmd } from 'apis/system'
import { onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
/** /**
@ -63,7 +63,7 @@ const onExportRecord = () => {
fnName: 'exportData', fnName: 'exportData',
params: {}, params: {},
} }
sendCmd(params)
syncSendCmd(params)
.then(() => { .then(() => {
FtMessage.success('导出成功') FtMessage.success('导出成功')
}) })

12
src/views/home/chart.vue

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useFormulaStore } from '@/stores/formulaStore' import { useFormulaStore } from '@/stores/formulaStore'
import { useHomeStore } from '@/stores/homeStore' import { useHomeStore } from '@/stores/homeStore'
import { sendCmd } from 'apis/system'
import { syncSendCmd } from 'apis/system'
import homeFinish from 'assets/images/home/home-finish.svg' import homeFinish from 'assets/images/home/home-finish.svg'
import homeSettingSvg from 'assets/images/home/home-setting.svg' import homeSettingSvg from 'assets/images/home/home-setting.svg'
import Config from 'components/home/Config.vue' import Config from 'components/home/Config.vue'
@ -33,7 +33,6 @@ watchEffect(() => {
disinfectionState.value = homeStore.disinfectionState disinfectionState.value = homeStore.disinfectionState
curStateRemainTime.value = homeStore.curStateRemainTime curStateRemainTime.value = homeStore.curStateRemainTime
isDeviceIdle.value = homeStore.isDeviceIdle isDeviceIdle.value = homeStore.isDeviceIdle
console.log('homeStore.h2O2SensorData---', homeStore.h2O2SensorData)
h2O2SensorData.value = homeStore.h2O2SensorData.map((item, index) => { h2O2SensorData.value = homeStore.h2O2SensorData.map((item, index) => {
return { return {
...item, ...item,
@ -58,9 +57,12 @@ const onFinishDisinfect = async () => {
}, },
} }
loading.value = true loading.value = true
await sendCmd(stopParams)
syncSendCmd(stopParams).then((res) => {
if (res.ackcode === 0) {
loading.value = false loading.value = false
} }
})
}
const onSave = () => { const onSave = () => {
const formData = configRef.value?.getFormData() const formData = configRef.value?.getFormData()
@ -83,7 +85,7 @@ const onClose = () => {
<HomeFormula /> <HomeFormula />
</div> </div>
<div class="line-chart-set"> <div class="line-chart-set">
<bt-button
<!-- <bt-button
button-text="消毒机数据" button-text="消毒机数据"
text-size="14px" text-size="14px"
border-radius="5px" border-radius="5px"
@ -97,7 +99,7 @@ const onClose = () => {
<Operation /> <Operation />
</el-icon> </el-icon>
</template> </template>
</bt-button>
</bt-button> -->
<bt-button <bt-button
button-text="消毒设置" button-text="消毒设置"
text-size="14px" text-size="14px"

15
src/views/home/index.vue

@ -45,6 +45,21 @@ watchEffect(() => {
title: '仓内', title: '仓内',
type: 'inside', type: 'inside',
} }
if (homeStore.h2O2SensorData.length === 2) {
probe1Params.value = {
...homeStore.h2O2SensorData[1],
title: '探头1',
type: 'env1',
}
}
if (homeStore.h2O2SensorData.length === 3) {
probe1Params.value = {
...homeStore.h2O2SensorData[2],
title: '探头2',
type: 'env2',
}
}
} }
}) })

32
src/views/liquid/index.vue

@ -6,7 +6,7 @@ import { useHomeStore } from '@/stores/homeStore'
import { useLiquidStore } from '@/stores/liquidStore' import { useLiquidStore } from '@/stores/liquidStore'
import { useSealStore } from '@/stores/sealStore' import { useSealStore } from '@/stores/sealStore'
import { useSystemStore } from '@/stores/systemStore' import { useSystemStore } from '@/stores/systemStore'
import { sendCmd, subscribeEvent, syncSendCmd } from 'apis/system'
import { subscribeEvent, syncSendCmd } from 'apis/system'
import homeFinish from 'assets/images/home/home-finish.svg' import homeFinish from 'assets/images/home/home-finish.svg'
import homeStart from 'assets/images/home/home-start.svg' import homeStart from 'assets/images/home/home-start.svg'
import SoftKeyboard from 'components/common/SoftKeyboard/index.vue' import SoftKeyboard from 'components/common/SoftKeyboard/index.vue'
@ -101,20 +101,22 @@ const onStartAddLiquid = async () => {
stopatg: Number(stopatg.value), stopatg: Number(stopatg.value),
}, },
} }
systemStore.updateLoading(true)
syncSendCmd(params)
loading.value = true
syncSendCmd(params).finally(() => {
loading.value = false
})
} }
const onStopAddLiquid = () => {
const onStopAddLiquid = async () => {
const params = { const params = {
className: 'AddLiquidService', className: 'AddLiquidService',
fnName: 'stop', fnName: 'stop',
params: {},
} }
systemStore.updateLoading(true)
syncSendCmd(params)
loading.value = true
syncSendCmd(params).finally(() => {
loading.value = false
})
} }
// //
const onStartDrainLiquid = async () => { const onStartDrainLiquid = async () => {
const statusName = getDeviceStatus() const statusName = getDeviceStatus()
@ -125,10 +127,11 @@ const onStartDrainLiquid = async () => {
const params = { const params = {
className: 'DrainLiquidService', className: 'DrainLiquidService',
fnName: 'start', fnName: 'start',
params: {},
} }
systemStore.updateLoading(true)
await sendCmd(params)
loading.value = true
syncSendCmd(params).finally(() => {
loading.value = false
})
} }
const onStopDrainLiquid = async () => { const onStopDrainLiquid = async () => {
@ -139,10 +142,11 @@ const onStopDrainLiquid = async () => {
const params = { const params = {
className: 'DrainLiquidService', className: 'DrainLiquidService',
fnName: 'stop', fnName: 'stop',
params: {},
} }
systemStore.updateLoading(true)
await syncSendCmd(params)
loading.value = true
syncSendCmd(params).finally(() => {
loading.value = false
})
} }
</script> </script>

19
src/views/seal/index.vue

@ -81,7 +81,7 @@ const onStartTest = () => {
className: 'AirLeakDetectTest', className: 'AirLeakDetectTest',
fnName: 'start', fnName: 'start',
params: { params: {
inflationTimeMs: Number(inflationTime.value),
inflationTimeMs: Number(inflationTime.value * 1000), // ms
}, },
} }
loading.value = true loading.value = true
@ -102,11 +102,14 @@ const onFinishTest = () => {
} }
// //
stopPosityveTimer() stopPosityveTimer()
systemStore.updateLoading(true)
loading.value = true loading.value = true
syncSendCmd(stopParams).then(() => {
loading.value = false
syncSendCmd(stopParams).then((res) => {
if (res.ackcode === 0) {
FtMessage.success('测试已停止') FtMessage.success('测试已停止')
}
loading.value = false
}).finally(() => {
loading.value = false
}) })
} }
@ -163,14 +166,14 @@ const stopDisabled = computed(() => {
</div> </div>
<div class="title-text title-text-kpa"> <div class="title-text title-text-kpa">
<span>{{ currentPressure }}</span> <span>{{ currentPressure }}</span>
<span class="title-kpa-pl">KPa</span>
<span class="title-kpa-pl">Kp</span>
</div> </div>
</div> </div>
</div> </div>
<div class="seal-right-btn"> <div class="seal-right-btn">
<div class="seal-input"> <div class="seal-input">
<div class="inflation-time"> <div class="inflation-time">
测试时间
打压时间
</div> </div>
<el-input <el-input
v-model="inflationTime" v-model="inflationTime"
@ -184,7 +187,7 @@ const stopDisabled = computed(() => {
<template #append> <template #append>
<bt-button <bt-button
type="primary" type="primary"
button-text="ms"
button-text=""
bg-color="#2892F3" bg-color="#2892F3"
text-color="#ffffff" text-color="#ffffff"
height="4rem" height="4rem"
@ -267,7 +270,7 @@ const stopDisabled = computed(() => {
.seal-opt{ .seal-opt{
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-top: 8vh;
margin-top: 15vh;
gap: 2rem; gap: 2rem;
.seal-status{ .seal-status{
display: flex; display: flex;

Loading…
Cancel
Save