Browse Source

优化样式及字体

master
LiLongLong 1 month ago
parent
commit
2b8c4d7b50
  1. 28
      src/app.vue
  2. 2
      src/assets/styles/common.scss
  3. 3
      src/assets/styles/element.scss
  4. 41
      src/components/common/CascadingSelectModal/index.vue
  5. 31
      src/components/common/SelectModal/index.vue
  6. 17
      src/components/formula/FormulaConfig.vue
  7. 2
      src/components/formula/FormulaTable.vue
  8. 8
      src/components/home/Environment.vue
  9. 3
      src/components/home/HomeLogLevel.vue
  10. 2
      src/components/home/HomeOperation.vue
  11. 37
      src/components/home/HomeSetting.vue
  12. 4
      src/components/seal/DashboardChart.vue
  13. 5
      src/components/setting/Device.vue
  14. 2
      src/components/setting/SystemDate.vue
  15. 7
      src/components/system/NetReconnection.vue
  16. 4
      src/layouts/default.vue
  17. 14
      src/libs/constant.ts
  18. 13
      src/libs/socket.ts
  19. 4
      src/stores/formulaStore.ts
  20. 24
      src/stores/homeStore.ts
  21. 20
      src/views/audit/index.vue
  22. 55
      src/views/debug/index.vue
  23. 1
      src/views/login/index.vue
  24. 26
      src/views/seal/index.vue
  25. 27
      src/views/setting/index.vue

28
src/app.vue

@ -29,9 +29,9 @@ let timer: any = null // 进度条定时器
onBeforeMount(async () => {
startProgress() //
// 2
// setInterval(async () => {
// await readH2o2Data()
// }, 3000)
setInterval(async () => {
await readH2o2Data()
}, 3000)
})
/**
@ -84,17 +84,17 @@ const startProgress = () => {
* @function 读取过氧化氢传感器数据
* @desc 轮询获取环境传感器数据并更新到主页状态
*/
// const readH2o2Data = async () => {
// const envParams = {
// fnName: 'readH2O2SensorData',
// className: 'FrontEndRealtimeDisplayContentMgr',
// params: {},
// }
// const resData = await sendCmd(envParams)
// if (resData.val.length) {
// homeStore.updateHomeData(resData.val)
// }
// }
const readH2o2Data = async () => {
const envParams = {
fnName: 'readH2O2SensorData',
className: 'FrontEndRealtimeDisplayContentMgr',
params: {},
}
await sendCmd(envParams)
// if (resData.val.length) {
// homeStore.updateHomeData(resData.val)
// }
}
/**
* @function 初始化核心数据

2
src/assets/styles/common.scss

@ -1,6 +1,6 @@
/* CSS Document */
html {
font-family: 'PingFangSC-Regular', 'PingFang SC', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
font-family: serif !important;
height: 100vh;
font-size: 14px;
}

3
src/assets/styles/element.scss

@ -1,5 +1,5 @@
:root {
// --el-font-size-base: 50px;
--el-font-size-base: 18px;
// --el-button-size: 80px;
@ -14,7 +14,6 @@
//--color-green: #67c23a;
//--color-yellow: #e6a23c;
//--color-blue: --el-color-primary;
--el-font-family: 'PingFangSC-Regular', 'PingFang SC', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
}
.el-dialog {
position: absolute;

41
src/components/common/CascadingSelectModal/index.vue

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { defineEmits, defineProps, onBeforeMount, ref, toRefs } from 'vue'
import { defineEmits, defineProps, onBeforeMount, onMounted, ref, toRefs, watchEffect } from 'vue'
const props = defineProps({
optionsLeft: {
@ -22,15 +22,19 @@ const props = defineProps({
type: Boolean,
default: true,
},
defaultValue: {
type: Number,
default: 0,
},
})
const emits = defineEmits(['confirm', 'cancel'])
const optionsList = ref<HTMLUListElement | null>(null)
const { optionsLeft, options } = toRefs(props)
const tempSelectedLeftValue = ref('positivePressure')
const tempSelectedRightValue = ref()
const tempSelectedRightValue = ref(props.defaultValue)
const tempSelectedValue = ref<string[]>(['positivePressure', '10%'])
@ -43,6 +47,25 @@ onBeforeMount(() => {
filteredOptionsRight.value = options.value.filter(item => item.value)
})
onMounted(() => {
scrollToSelectedItem()
})
const scrollToSelectedItem = () => {
if (!optionsList.value) {
return
}
// liselected
const selectedLi = optionsList.value.querySelector('li.selected')
if (selectedLi) {
const containerRect = optionsList.value.getBoundingClientRect()
const itemRect = selectedLi.getBoundingClientRect()
const offsetTop = itemRect.top - containerRect.top
const scrollTop = offsetTop - (containerRect.height - itemRect.height) / 2
optionsList.value.scrollTop = scrollTop + 10
}
}
const selectOptionLeft = (option: System.Option) => {
if (option.value === 'constantPressure') {
tempSelectedValue.value = [option.value]
@ -67,6 +90,10 @@ const confirmSelection = () => {
const handleCancel = () => {
emits('cancel')
}
watchEffect(() => {
tempSelectedRightValue.value = props.defaultValue
})
</script>
<template>
@ -95,7 +122,7 @@ const handleCancel = () => {
没有找到匹配项
</div>
</div>
<div class="modal-content">
<div ref="optionsList" class="modal-content-right">
<ul class="options-list">
<li
v-for="(option, index) in filteredOptionsRight"
@ -181,6 +208,12 @@ const handleCancel = () => {
padding: 10px 0;
max-height: 15vw;
}
.modal-content-right{
flex: 1;
overflow-y: auto;
padding: 10px 0;
max-height: 15vw;
}
.search-box {
position: relative;

31
src/components/common/SelectModal/index.vue

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed, defineEmits, defineProps, ref, toRefs, watch } from 'vue'
import { computed, defineEmits, defineProps, onMounted, ref, toRefs, watch } from 'vue'
const props = defineProps({
options: {
@ -21,12 +21,29 @@ const props = defineProps({
})
const emits = defineEmits(['confirm', 'cancel'])
const { options, selectedValue } = toRefs(props)
onMounted(() => {
console.log('selectedValue--', props.selectedValue)
scrollToSelectedItem()
})
watch(() => props.options, (newVal) => {
options.value = newVal
})
const optionsList = ref<HTMLUListElement | null>(null)
const scrollToSelectedItem = () => {
if (!optionsList.value) {
return
}
// liselected
const selectedLi = optionsList.value.querySelector('li.selected')
if (selectedLi) {
const containerRect = optionsList.value.getBoundingClientRect()
const itemRect = selectedLi.getBoundingClientRect()
const offsetTop = itemRect.top - containerRect.top
const scrollTop = offsetTop - (containerRect.height - itemRect.height) / 2
optionsList.value.scrollTop = scrollTop + 10
}
}
const tempSelectedValue = ref(selectedValue.value)
@ -55,12 +72,13 @@ const handleCancel = () => {
<i class="fa fa-times"></i>
</button>
</div>
<div class="modal-content">
<div ref="optionsList" class="modal-content" re>
<ul class="options-list">
<li
v-for="(option, index) in filteredOptions"
:key="option.value || index"
:class="{ selected: option.value === tempSelectedValue }"
:class="{ selected: Number(option.value) === Number(tempSelectedValue) }"
class="select-font"
@click="selectOption(option)"
>
{{ option.label }}
@ -240,4 +258,7 @@ const handleCancel = () => {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}
.select-font {
font-size: 20px;
}
</style>

17
src/components/formula/FormulaConfig.vue

@ -95,11 +95,6 @@ onMounted(() => {
})
/**
* 模态框选中的值
*/
const selectedValue = ref()
/**
* 模态框是否打开
*/
const isModalOpen = ref(false)
@ -363,7 +358,8 @@ const openKeyboardType = (labelName: string) => {
:disabled="!item.is_visible_in_setting_page"
@focus="openKeyboard"
/>
<span>{{ labelUnitMap[item.setting_id] }}</span>
<br/>
<div>{{ labelUnitMap[item.setting_id] }}</div>
<!-- <div>{{ `取消范围:${item.val_lower_limit}-${item.val_upper_limit}` }}</div> -->
</template>
<template v-else-if="item.val_type === 'enum'">
@ -421,7 +417,7 @@ const openKeyboardType = (labelName: string) => {
<SelectModal
v-if="isModalOpen"
:options="options"
:selected-value="selectedValue"
:selected-value="formData.loglevel"
placeholder="请选择"
@confirm="handleLogConfirm"
@cancel="handleLogCancel"
@ -431,6 +427,7 @@ const openKeyboardType = (labelName: string) => {
<style lang="scss" scoped>
.formula-form{
font-size: 20px !important;
padding: 5px;
padding-left: 15px;
max-height: 80vh;
@ -468,4 +465,10 @@ const openKeyboardType = (labelName: string) => {
::v-deep .el-form-item{
margin-right: 0;
}
::v-deep .el-input__inner{
height: 6vh;
}
::v-deep .el-form-item{
align-items: center;
}
</style>

2
src/components/formula/FormulaTable.vue

@ -95,7 +95,7 @@ const deleteRecipe = (item: Formula.FormulaItem) => {
:class="{ selected: selectedIndex === index }"
@click="selectRecipe(item, index)"
>
<span>{{ item.name }}</span>
<span style="font-size: 1.5rem">{{ item.name }}</span>
<div class="actions">
<button class="view-button" @click.stop="onStartFormula(item)">
执行配方

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

3
src/components/home/HomeLogLevel.vue

@ -6,7 +6,6 @@ import { ref, watchEffect } from 'vue'
const formulaStore = useFormulaStore()
const options = ref(formulaStore.logLevelOptions)
const loglevel = ref(formulaStore.loglevel)
const selectedValue = ref()
const isModalOpen = ref(false)
watchEffect(() => {
@ -53,7 +52,7 @@ const handleCancel = () => {
<SelectModal
v-if="isModalOpen"
:options="options"
:selected-value="selectedValue"
:selected-value="loglevel"
placeholder="请选择"
@confirm="handleConfirm"
@cancel="handleCancel"

2
src/components/home/HomeOperation.vue

@ -100,7 +100,7 @@ const doStartDisinfect = async () => {
try {
// 使
if (formulaStore.selectedFormulaInfo && formulaStore.selectedFormulaInfo.formula_id) {
await formulaStore.saveDisinfectFormula(formulaStore.selectedFormulaInfo)
await formulaStore.startDisinfectFormula(formulaStore.selectedFormulaInfo)
}
else {
const startParams = {

37
src/components/home/HomeSetting.vue

@ -38,6 +38,7 @@ const disinfectionState = ref(homeStore.disinfectionState) // 消毒状态
const disinfectFormulaVisible = ref(false) //
const selectedByFormulas = ref(cloneDeep(formulaStore.selectedFormulaInfo)) //
const pressureConfig = ref(homeStore.pressureConfig)
const defaultIntensityValue = ref()
/**
* @hook 响应式依赖监听
@ -126,7 +127,7 @@ const onSave = async () => {
}
else { //
if (formData.formula_id) {
await formulaStore.saveDisinfectFormula(formData)
formulaStore.updateSelectedFormulaDataByList(formData)
}
}
onClose() //
@ -170,7 +171,18 @@ const onSetPressure = () => {
optionsLeft.value = leftOptions
optionsRight.value = rightOptions
isModalOpen.value = true
//
syncSendCmd({
className: 'PipelinePressureControl',
fnName: 'getState',
}).then((res) => {
if (res.ackcode === 0) {
defaultIntensityValue.value = res.rely.intensity
homeStore.updateDefaultIntensityValue(res.rely.intensity)
isModalOpen.value = true
}
})
}
/**
@ -206,11 +218,12 @@ const onClose = () => {
<div>
<bt-button
button-text="压力控制"
text-size="12px"
text-size="1.3rem"
border-radius="5px"
width="8rem"
text-color="#1989fa"
padding="0.8vw"
padding="0.2vw"
height="3rem"
@click="onSetPressure"
>
<template #icon>
@ -221,16 +234,17 @@ const onClose = () => {
<div class="home-opt-ml">
<bt-button
button-text="查看图表"
text-size="12px"
text-size="1.3rem"
border-radius="5px"
width="7rem"
height="3rem"
text-color="#1989fa"
padding="0.8vw"
padding="0.2vw"
:disabled="deviceState"
@click="onShowChart"
>
<template #icon>
<img :src="homeChart" width="15" alt="">
<img :src="homeChart" width="12" alt="">
</template>
</bt-button>
</div>
@ -238,11 +252,12 @@ const onClose = () => {
<bt-button
v-if="deviceState"
button-text="消毒设置"
text-size="12px"
text-size="1.3rem"
border-radius="5px"
width="8rem"
text-color="#1989fa"
padding="0.8vw"
padding="0.2vw"
height="3rem"
@click="onDisinfectConfig"
>
<template #icon>
@ -252,10 +267,11 @@ const onClose = () => {
<bt-button
v-else
button-text="运行参数"
text-size="12px"
text-size="1rem"
border-radius="5px"
width="7rem"
text-color="#1989fa"
height="3rem"
@click="onDisinfectConfig"
>
<template #icon>
@ -275,6 +291,7 @@ const onClose = () => {
:options-left="optionsLeft"
:options="optionsRight"
:selected-value="selectedValue"
:default-value="defaultIntensityValue"
placeholder="请选择"
@confirm="handleConfirm"
@cancel="handleCancel"

4
src/components/seal/DashboardChart.vue

@ -74,7 +74,7 @@ onUnmounted(() => {
<style>
canvas{
width: 55vw !important;
height: 63vh !important;
width: 50vw !important;
height: 60vh !important;
}
</style>

5
src/components/setting/Device.vue

@ -4,6 +4,8 @@ import { ref } from 'vue'
const deviceStore = useDeviceStore()
const deviceInfo = ref(deviceStore.deviceInfo)
const screenWidth = ref(window.screen.width)
const screenHeight = ref(window.screen.height)
</script>
<template>
@ -20,6 +22,9 @@ const deviceInfo = ref(deviceStore.deviceInfo)
<div class="device-ul">
<div>初始化状态{{ deviceInfo.deviceTypeInited ? '已初始化' : '未初始化' }}</div>
</div>
<div class="device-ul">
<div>设备屏幕尺寸{{ screenWidth }} {{ screenHeight }}</div>
</div>
</div>
</template>

2
src/components/setting/SystemDate.vue

@ -5,7 +5,6 @@ import { formatDateTime } from '@/libs/utils'
import { ref } from 'vue'
const dateVal = ref(formatDateTime())
const onChangeDate = async (value: string) => {
if (value) {
const splitDate = value.split(' ') //
@ -55,6 +54,7 @@ const onChangeDate = async (value: string) => {
设置日期
<el-date-picker
v-model="dateVal"
style="width: 20rem"
type="datetime"
placeholder="日期:年-月-日 时:分:秒"
format="YYYY-MM-DD HH:mm:ss"

7
src/components/system/NetReconnection.vue

@ -7,6 +7,7 @@ import { useRouter } from 'vue-router'
const systemStore = useSystemStore()
const router = useRouter()
const timer = ref()
const websocketConnected = ref(true)
const countdownToReconnection = () => {
startTimer(30 * 1000, (times: string) => {
@ -19,6 +20,8 @@ const countdownToReconnection = () => {
}
watchEffect(() => {
console.log('systemStore.websocketConnected---', systemStore.websocketConnected)
websocketConnected.value = systemStore.websocketConnected
if (!systemStore.websocketConnected) {
countdownToReconnection()
}
@ -29,14 +32,14 @@ watchEffect(() => {
</script>
<template>
<div class="reconnect-modal-overlay">
<div v-if="!websocketConnected" 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>

4
src/layouts/default.vue

@ -175,7 +175,7 @@ const onLogout = () => {
{{ currentTime }}
</div>
</footer>
<NetReconnection v-if="!websocketConnected" />
<NetReconnection />
<ErrorEventsModal />
</el-container>
</template>
@ -262,7 +262,7 @@ const onLogout = () => {
width: 10rem;
display: flex;
gap: 5px;
font-size: 16px;
font-size: 1.6vw;
background: white;
}
.menu-tags{

14
src/libs/constant.ts

@ -5,16 +5,16 @@ export const HEADER_TOKEN_KEY = 'Authorization'
export const SESSIONSTORAGE_TOKEN_KEY = 'web_token'
export const formulaNameMap: Record<string, any> = {
stoped_gs: '停止过氧化氢溶度',
continued_gs: '继续过氧化氢溶度',
stoped_satur: '停止过氧化氢相对饱和度',
continued_satur: '继续过氧化氢相对饱和度',
max_humidity: '允许消毒最大湿度',
stoped_gs: '停止H2o2浓度',
continued_gs: '继续H2o2浓度',
stoped_satur: '停止H2o2饱和度',
continued_satur: '继续H2o2饱和度',
max_humidity: '消毒最大湿度',
injection_pump_speed: '喷射蠕动泵转速',
pre_heat_time_s: '预热时间',
stoped_humi: '停止相对湿度',
continued_humi: '继续相对湿度',
proportional_valve_default_value: '正负压默认开合比例',
continued_humi: '湿度',
proportional_valve_default_value: '正负压比例',
loglevel: '消毒等级',
}

13
src/libs/socket.ts

@ -14,7 +14,6 @@ export class WebSocketClient {
private eventListeners = new Map<string, ((response: Socket.WebSocketResponse) => void)[]>()
private connectCount = 0
private maxConnectCount = 10
private intervalVal: any = 0
constructor(url: string) {
@ -29,6 +28,8 @@ export class WebSocketClient {
this.isConnecting = false
this.isConnected.value = true
this.connectionError.value = null
this.connectCount = 0
clearInterval(this.intervalVal)
}
socket.onclose = (event) => {
this.isConnected.value = false
@ -164,11 +165,11 @@ export class WebSocketClient {
// 重连逻辑
private reconnect() {
if (this.connectCount > this.maxConnectCount) {
clearInterval(this.intervalVal)
console.log('-----达到最大重连次数,停止重连------')
return
}
// if (this.connectCount > this.maxConnectCount) {
// clearInterval(this.intervalVal)
// console.log('-----达到最大重连次数,停止重连------')
// return
// }
this.isConnecting = true
if (this.socket.readyState !== WebSocket.CLOSED && this.socket.readyState !== WebSocket.CLOSING) {
this.socket.close()

4
src/stores/formulaStore.ts

@ -187,7 +187,7 @@ export const useFormulaStore = defineStore('formula', () => {
* @param {Formula.FormulaItem} formData -
* @desc
*/
const saveDisinfectFormula = async (formData: Formula.FormulaItem) => {
const startDisinfectFormula = async (formData: Formula.FormulaItem) => {
try {
const params = {
className: 'DisinfectionCtrlServiceExt',
@ -225,7 +225,7 @@ export const useFormulaStore = defineStore('formula', () => {
initFormulaList,
updateSelectedFormulaDataByList,
updateFormulaConfigData,
saveDisinfectFormula,
startDisinfectFormula,
updateLogLevel,
resetToDefaultFormula,
getFormualDefaultData,

24
src/stores/homeStore.ts

@ -37,6 +37,7 @@ export const useHomeStore = defineStore('home', () => {
const curStateRemainTime = ref<string>()
const disinfectionState = ref<Home.DisinfectState>(initDisinfectState) // 当前设备消毒状态
let renderTimer: any
const defaultIntensityValue = ref(0)
/**
* @function updateHomeData
@ -79,7 +80,7 @@ export const useHomeStore = defineStore('home', () => {
const intensityParams = {
className: 'PipelinePressureControl',
fnName: 'setIntensity',
params: { intensity },
params: { intensity: Number(intensity) },
}
syncSendCmd(intensityParams)
}
@ -120,18 +121,27 @@ export const useHomeStore = defineStore('home', () => {
return disinfectionState.value.state.toLocaleLowerCase() === DEVICE_STATES.IDLE || disinfectionState.value.state === DEVICE_STATES.FINISHED
})
const updateDefaultIntensityValue = (value: number) => {
defaultIntensityValue.value = value
}
return {
// 状态属性
h2O2SensorData,
disinfectionState,
pressureConfig,
curStateRemainTime,
isDeviceIdle,
// 操作方法
h2O2SensorData,
updateHomeData,
updatePressure,
disinfectionState,
curStateRemainTime,
updateHomeDisinfectionState,
pressureConfig,
updatePressureConfig,
updateHomeRemainTime,
defaultIntensityValue,
updateDefaultIntensityValue,
}
})

20
src/views/audit/index.vue

@ -103,14 +103,12 @@ const handleSelectionChange = (users: Audit.AuditItem[]) => {
@click="onExportRecord"
/>
</div>
<div>
<el-table :data="tableData" stripe style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column prop="usrName" label="操作人" width="100" />
<el-table-column prop="behaviorinfo" label="操作内容" />
<el-table-column prop="date" label="操作时间" />
</el-table>
</div>
<el-table class="audit-table" :data="tableData" stripe style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column prop="usrName" label="操作人" width="150" />
<el-table-column prop="behaviorinfo" label="操作内容" align="center" />
<el-table-column prop="date" label="操作时间" width="300" />
</el-table>
<div class="audit-pagination">
<el-pagination layout="prev, pager, next" :total="totle" @current-change="handleCurrentChange" />
</div>
@ -129,9 +127,13 @@ const handleSelectionChange = (users: Audit.AuditItem[]) => {
margin: 2vw;
}
.audit-pagination{
bottom: 3rem;
bottom: 1rem;
position: absolute;
right: 2rem;
}
.audit-table{
max-height: 67vh;
overflow: auto;
}
}
</style>

55
src/views/debug/index.vue

@ -85,9 +85,9 @@ const onBottomState = () => {}
<div class="dashboard-container">
<main class="main-content">
<!-- 上下布局 -->
<section class="debug-upper">
<section>
<div v-for="(item, index) in h2O2SensorData" :key="index" class="debug-left-lh">
<div class="debug-label">
<div class="debug-label" style="text-align: center;">
{{ index === 0 ? '仓内环境' : item.title }}
</div>
<div>
@ -109,7 +109,7 @@ const onBottomState = () => {}
<div>
<div class="debug-left-lh">
<div class="debug-label">
加液蠕动泵
加液蠕动泵
</div>
<div class="debug-bw">
<bt-button
@ -134,7 +134,7 @@ const onBottomState = () => {}
</div>
<div class="debug-left-lh">
<div class="debug-label">
空压机
空压机
</div>
<div class="debug-bw">
<span class="debug-text">0.00A</span>
@ -155,7 +155,7 @@ const onBottomState = () => {}
</div>
<div class="debug-left-lh">
<div class="debug-label">
加热片
加热片
</div>
<div class="debug-bw">
<span class="debug-text">0.00A</span>
@ -163,21 +163,20 @@ const onBottomState = () => {}
<div>
<bt-button
type="primary"
@click="onOpenHeat"
button-text="打开"
>
</bt-button>
@click="onOpenHeat"
/>
</div>
<div>
<bt-button
@click="onCloseHeat"
button-text="关闭"
@click="onCloseHeat"
/>
</div>
</div>
<div class="debug-left-lh">
<div class="debug-label">
蒸发仓水浸
蒸发仓水浸
</div>
<div class="debug-bw">
<span class="debug-text">没水</span>
@ -185,8 +184,8 @@ const onBottomState = () => {}
<div>
<bt-button
type="primary"
@click="queryEvaporationState"
button-text="读取状态"
@click="queryEvaporationState"
/>
</div>
</div>
@ -196,34 +195,32 @@ const onBottomState = () => {}
<div>
<div class="debug-left-lh">
<div class="debug-label">
注射蠕动泵
注射蠕动泵
</div>
<div class="debug-bw">
<bt-button
type="primary"
@click="onSprayMetor"
button-text="喷射"
>
</bt-button>
@click="onSprayMetor"
/>
</div>
<div>
<bt-button
type="primary"
@click="onRefluxMetor"
button-text="回流"
>
</bt-button>
@click="onRefluxMetor"
/>
</div>
<div>
<bt-button
@click="onClosePump"
button-text="关闭"
@click="onClosePump"
/>
</div>
</div>
<div class="debug-left-lh">
<div class="debug-label">
风机
风机
</div>
<div class="debug-bw">
<span class="debug-text">0.00A</span>
@ -231,20 +228,20 @@ const onBottomState = () => {}
<div>
<bt-button
type="primary"
@click="onOpenFan"
button-text="打开"
@click="onOpenFan"
/>
</div>
<div>
<bt-button
@click="onCloseFan"
button-text="关闭"
@click="onCloseFan"
/>
</div>
</div>
<div class="debug-left-lh">
<div class="debug-label">
设备底部水浸
设备底部水浸
</div>
<div class="debug-bw">
<span class="debug-text">没水</span>
@ -252,8 +249,8 @@ const onBottomState = () => {}
<div>
<bt-button
type="primary"
@click="onBottomState"
button-text="读取状态"
@click="onBottomState"
/>
</div>
</div>
@ -272,9 +269,10 @@ const onBottomState = () => {}
background: $gradient-color;
padding-top: 50px;
padding-left: 30px;
font-size: 20px;
.debug-upper{
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: auto auto;
}
.debug-lower{
@ -284,21 +282,22 @@ const onBottomState = () => {}
.debug-left{
.debug-inside{
display: flex;
gap: 2rem;
gap: 1rem;
}
}
}
.debug-left-lh{
display: flex;
gap: 2rem;
gap: 1rem;
height: $lineHeight;
}
.debug-bw{
width: 8vw;
}
.debug-label{
width: 8vw;
width: 13vw;
text-align: end;
}
.debug-text{
color: #2892F3;

1
src/views/login/index.vue

@ -67,6 +67,7 @@ const loginHandle = async () => {
})
}
catch (e) {
loading.value = false
if (!sys.websocketConnected) {
FtMessage.error('网络连接异常,请检查网络')
return

26
src/views/seal/index.vue

@ -85,13 +85,22 @@ const onStartTest = () => {
},
}
loading.value = true
syncSendCmd(params).then(() => {
syncSendCmd(params).then((res) => {
loading.value = false
FtMessage.success('开始执行密封测试')
//
startPosityveTimer((time) => {
sealRemainTimeS.value = time
})
if (res.ackcode === 0) {
FtMessage.success('开始执行密封测试')
//
startPosityveTimer((time) => {
sealRemainTimeS.value = time
})
}
else {
FtMessage.error('指令发送失败,请稍候再试')
}
}).catch((e) => {
console.log('e----------', e.message)
loading.value = false
FtMessage.error('指令发送失败,请稍候再试')
})
}
const onFinishTest = () => {
@ -259,7 +268,7 @@ const stopDisabled = computed(() => {
box-shadow: 0px 1px 5px 0px rgba(9, 39, 62, 0.15);
background: $gradient-color;
.seal-chart{
margin-left: 1rem;
margin-left: 3rem;
}
.chart-ml{
margin: 3rem;
@ -269,9 +278,8 @@ const stopDisabled = computed(() => {
}
.seal-opt{
display: flex;
justify-content: center;
margin-top: 15vh;
gap: 2rem;
margin-left: 6rem;
.seal-status{
display: flex;
justify-content: center;

27
src/views/setting/index.vue

@ -21,11 +21,12 @@ const selectItem = (menuCode: string) => {
<main class="main-content">
<div class="setting-left">
<div class="menu-container">
<ul>
<ul class="menu-container">
<li
v-for="(item) in settingMenus"
:key="item.code"
:class="{ active: selectedMenuCode === item.code }"
class="setting-menu-li menu-item"
@click="selectItem(item.code)"
>
{{ item.name }}
@ -71,6 +72,9 @@ const selectItem = (menuCode: string) => {
}
.menu-container {
padding: 10px;
.setting-menu-li{
font-size: 1.5rem;
}
}
ul {
list-style-type: none;
@ -79,14 +83,33 @@ const selectItem = (menuCode: string) => {
}
li {
padding: 15px 15px;
height: 6vh;
display: flex;
align-items: center;
border-radius: 10px;
font-family: serif;
height: 5rem;
}
li.active {
// color: #e6f7ff;
background: #e8f3ff;
border-radius: 10px;
color: #2892F3;
}
.menu-container {
width: 100%; /* 占满父容器 */
background: #fff;
// border: 1px solid #eee;
border-radius: 12px;
overflow: hidden; /* 配合圆角,避免阴影/边框溢出 */
}
.menu-item {
padding: 14px 20px; /* 更大触摸区域 */
font-size: 15px; /* 适配手机阅读 */
border-bottom: 1px solid #f5f5f5;
}
/* 最后一项去掉分隔线 */
.menu-item:last-child {
border-bottom: none;
}
</style>
Loading…
Cancel
Save