Browse Source

fix:按钮状态;预充指令

master
guoapeng 3 months ago
parent
commit
3b8024bf97
  1. 2
      src/app.vue
  2. 22
      src/components/common/FTStream/index.vue
  3. 1
      src/libs/utils.ts
  4. 69
      src/views/home/index.vue

2
src/app.vue

@ -8,7 +8,7 @@ const systemStore = useSystemStore()
onMounted(async () => {
const res = await getStatus()
console.log(res)
systemStore.updateSystemStatus(res)
// systemStore.updateSystemStatus(res)
startProgress()
})

22
src/components/common/FTStream/index.vue

@ -156,17 +156,17 @@ const handleMouseUp = () => {
}
/* 定义过渡效果 */
.mask-fade-enter-active, .mask-fade-leave-active {
transition: transform 0.5s ease;
}
.mask-fade-enter-from {
transform: translateX(100%);
}
.mask-fade-leave-to {
transform: translateX(100%);
}
//.mask-fade-enter-active, .mask-fade-leave-active {
// transition: transform 0.5s ease;
//}
//
//.mask-fade-enter-from {
// transform: translateX(100%);
//}
//
//.mask-fade-leave-to {
// transform: translateX(100%);
//}
:deep(.el-timeline-item__timestamp.is-bottom) {
white-space: pre-wrap; /* 保留空格和换行符,允许自动换行 */
word-wrap: break-word; /* 允许长单词或URL强制断行 */

1
src/libs/utils.ts

@ -51,6 +51,7 @@ export const cmdNameMap = {
cap_lifting_origin: '拍子电机回原点',
tray_lifting_origin: '加热区托盘电机回原点',
door_origin: '门电机回原点',
filled_solution: '预充管路',
}
export const generateColors = (count: number): string[] => {

69
src/views/home/index.vue

@ -68,7 +68,37 @@ const setTemperature = (id: string) => {
}
const addLiquidVisible = ref(false)
const filled_solution = async () => {
if (!systemStore.systemStatus.solutionModule.idle) {
FtMessage.warning('加液区正在工作,请稍后操作')
return
}
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'filled_solution',
params: { },
}
await homeStore.sendControl(params)
}
const addLiquid = async () => {
if (!systemStore.systemStatus.solutionModule.idle) {
FtMessage.warning('加液区正在工作,请稍后操作')
return
}
await ElMessageBox.confirm(
'管路是否已预充?',
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
showClose: false,
closeOnClickModal: false,
type: 'warning',
},
)
await ElMessageBox.confirm(
'请确认加液区是否有托盘?',
'提示',
@ -125,6 +155,10 @@ const move_to_heat_area = async () => {
FtMessage.warning('请选择一个加热区')
return
}
if (systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.trayStatus === 1) {
FtMessage.warning('所选加热区有托盘')
return
}
await ElMessageBox.confirm(
'请确认加液区是否有托盘?',
'提示',
@ -154,6 +188,10 @@ const move_to_solution_area = async () => {
FtMessage.warning('请选择一个加热区')
return
}
if (systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.trayStatus === 0) {
FtMessage.warning('所选加热区无托盘')
return
}
await ElMessageBox.confirm(
'请确认加液区无托盘?',
'提示',
@ -190,6 +228,10 @@ const heat_start = async () => {
FtMessage.warning('请先设置温度')
return
}
if (systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.heating) {
FtMessage.warning('已经在加热了')
return
}
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
@ -208,6 +250,10 @@ const heat_stop = async () => {
FtMessage.warning('请选择一个加热区')
return
}
if (!systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.heating) {
FtMessage.warning('加热区未加热')
return
}
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
@ -225,6 +271,10 @@ const tray_up = async () => {
FtMessage.warning('请选择一个加热区')
return
}
if (systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.trayUp === 1) {
FtMessage.warning('托盘已抬起')
return
}
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
@ -242,6 +292,10 @@ const tray_down = async () => {
FtMessage.warning('请选择一个加热区')
return
}
if (systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.trayUp === 0) {
FtMessage.warning('托盘已降下')
return
}
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
@ -254,6 +308,10 @@ const tray_down = async () => {
}
const shake_start = async () => {
if (systemStore.systemStatus.solutionModule.shaking) {
FtMessage.warning('已经在摇匀了')
return
}
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
@ -265,6 +323,10 @@ const shake_start = async () => {
}
const shake_stop = async () => {
if (!systemStore.systemStatus.solutionModule.shaking) {
FtMessage.warning('加液区没有在摇匀')
return
}
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
@ -341,7 +403,12 @@ const take_photo = async () => {
<!-- </el-col> -->
<!-- </el-row> -->
<el-row :gutter="10">
<el-col :span="24">
<el-col :span="12">
<ft-button :click-handle="filled_solution">
预充管路
</ft-button>
</el-col>
<el-col :span="12">
<ft-button @click="addLiquid">
添加溶液
</ft-button>

Loading…
Cancel
Save