Browse Source

fix:重新自检; 首页按钮布局

master
guoapeng 2 months ago
parent
commit
d115718fb0
  1. 2
      src/apis/crafts.ts
  2. 3
      src/apis/system.ts
  3. 318
      src/components/check1/index.vue
  4. 49
      src/components/craft/AddCraft/index.vue
  5. 0
      src/components/home/Countdown/Countdown.vue
  6. 6
      src/components/home/ExecuteCraft/index.vue
  7. 2
      src/components/home/Tube/index.vue
  8. 35
      src/components/system/Check/index.vue
  9. 60
      src/components/system/EditDate/index.vue
  10. 0
      src/components/system/Stop/index.vue
  11. 59
      src/components/systemConfig/Edit/index.vue
  12. 22
      src/layouts/default.vue
  13. 1
      src/libs/utils.ts
  14. 2
      src/router/index.ts
  15. 11
      src/router/routes.ts
  16. 6
      src/stores/systemStore.ts
  17. 6
      src/types/system.d.ts
  18. 123
      src/views/home/index.vue
  19. 59
      src/views/systemConfig/index.vue

2
src/apis/crafts.ts

@ -30,5 +30,5 @@ export const craftstatus = (): Promise<CraftTypes.CraftState[]> => http.get(`/mo
export const craftstatusByHeatId = (heatId: string): Promise<CraftTypes.CraftState> => http.get(`/monitor/crafts/status/${heatId}`)
export const craftList = (): Promise<any> => http.get(`/crafts/monitor/list`)
export const craftRestart = (monitorId: string): Promise<CraftTypes.CraftState> => http.post(`/crafts/restart`, { monitorId })
export const craftRestore = (isRestore: boolean): Promise<null> => http.get(`/crafts/restore/${isRestore}`)
export const craftRestore = (isRestore: boolean): Promise<null> => http.get(`/crafts/restore/isRestore=${isRestore}`)
export const craftRemove = (monitorId: string): Promise<CraftTypes.CraftState> => http.delete(`/crafts/remove`, { params: { monitorId } })

3
src/apis/system.ts

@ -7,3 +7,6 @@ export const getPoint = (motor: string): Promise<string> => http.get(`/motor/pos
export const requireOutTray = (): Promise<{ moduleCode: string }[]> => http.get('/self-test/require-out-tray')
export const setIgnoreItem = (params: { ignoreSelfTestType: string, ignore: boolean }): Promise<null> => http.post('/self-test/set-ignore-item', params)
export const getTime = (): Promise<number> => http.get('/sys/datetime')
export const setTime = (params: { datetime?: string }): Promise<number> => http.post('/sys/datetime', params)
export const configList = (): Promise<number> => http.get('/sys/config-list')
export const updateConfig = (params: System.SystemConfig): Promise<number> => http.post('/sys/update-config', params)

318
src/components/check1/index.vue

@ -1,318 +0,0 @@
<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { socket } from 'libs/socket'
import { useHomeStore } from 'stores/homeStore'
import { useSystemStore } from 'stores/systemStore'
import { onMounted, onUnmounted, ref } from 'vue'
import { getSelfFinish, getSelfStatus } from '@/apis/self'
interface SelfStatus {
name: string
isOrign: boolean
value: string
type: string
}
const emits = defineEmits(['close'])
const homeStore = useHomeStore()
const systemStore = useSystemStore()
const loading = ref(false)
onMounted(() => {
socket.init(receiveMessage, 'cmd_debug')
socket.init(receiveMessage, 'cmd_response')
onStartSelfTest()
})
onUnmounted(() => {
clearInterval(patrolTimes.value)
socket.unregisterCallback(receiveMessage, 'cmd_debug')
socket.unregisterCallback(receiveMessage, 'cmd_response')
})
const receiveMessage = (data: Socket.cmdData) => {
data.commandId === currentCommandId && systemStore.pushSystemList(data)
}
const onStartSelfTest = () => {
patrolSelfStatus()
}
const statusMap: Record<string, Record<string, string>> = {
doorOrigin: {
name: '门',
value: '',
type: 'door',
},
shakeOrigin: {
name: '摇匀电机',
value: '',
type: 'shake',
},
gantryXOrigin: {
name: '机械臂x轴',
value: 'x',
type: 'axis',
},
gantryYOrigin: {
name: '机械臂y轴',
value: 'y',
type: 'axis',
},
gantryZOrigin: {
name: '机械臂z轴',
value: 'z',
type: 'axis',
},
dualRobotOrigin: {
name: '加液机械臂',
value: '',
type: 'liquid',
},
// dualRobotJoint2Origin: {
// name: '02',
// value: 'smallArm',
// type: 'liquid',
// },
capLiftingOrigin: {
name: '拍子电机升降',
value: '',
type: 'cap',
},
trayLifting01Origin: {
name: '加热区01托盘升降',
value: 'heat_module_01',
type: 'heat',
},
trayLifting02Origin: {
name: '加热区02托盘升降',
value: 'heat_module_02',
type: 'heat',
},
trayLifting03Origin: {
name: '加热区03托盘升降',
value: 'heat_module_03',
type: 'heat',
},
trayLifting04Origin: {
name: '加热区04托盘升降',
value: 'heat_module_04',
type: 'heat',
},
trayLifting05Origin: {
name: '加热区05托盘升降',
value: 'heat_module_05',
type: 'heat',
},
trayLifting06Origin: {
name: '加热区06托盘升降',
value: 'heat_module_06',
type: 'heat',
},
}
const patrolTimes = ref()
const patrolSelfStatus = () => {
loading.value = true
patrolTimes.value = setInterval(() => {
querySelfStatus()
}, 1000)
}
const deviceStatusList = ref<SelfStatus[]>([])
const selfStateComplete = ref(false)
const querySelfStatus = () => {
const orignStatusList = []
getSelfStatus().then((res) => {
console.log('res', res)
loading.value = false
if (res) {
try {
const list: SelfStatus[] = []
const keys = Object.keys(res)
keys.forEach((item) => {
list.push({
name: statusMap[item].name,
isOrign: res[item],
value: statusMap[item].value,
type: statusMap[item].type,
})
if (res[item]) {
orignStatusList.push(item)
}
if (orignStatusList.length === keys.length) {
clearInterval(patrolTimes.value)
selfStateComplete.value = true
}
})
deviceStatusList.value = list
console.log('deviceStatusList', list)
}
catch (e) {
console.log('error', e)
}
}
}).catch(() => {
loading.value = false
})
}
const resetOrign = (item: SelfStatus) => {
if (item.type === 'door') {
door_origin()
}
if (item.type === 'shake') {
shake_origin()
}
else if (item.value === 'x' || item.value === 'y' || item.value === 'z') {
gantry_origin(item.value)
}
else if (item.type === 'liquid') {
dual_robot_origin()
}
else if (item.type === 'heat') {
tray_lifting_origin(item.value)
}
else if (item.type === 'cap') {
cap_lifting_origin()
}
}
const shake_origin = async () => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: `shake_origin`,
params: {},
}
await homeStore.sendControl(params)
}
const door_origin = async () => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: `door_origin`,
params: {},
}
await homeStore.sendControl(params)
}
// TODO
// const currentPumpId = ref()
// const onPumpChange = (value: string) => {
// currentPumpId.value = value
// }
// const onPumpEmpty = () => {
// console.log('===currentPumpId===', currentPumpId.value)
// }
let currentCommandId = ''
const gantry_origin = async (motor: 'x' | 'y' | 'z') => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: `gantry_${motor}_origin`,
params: {},
}
await homeStore.sendControl(params)
}
const dual_robot_origin = async () => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'dual_robot_origin',
params: {},
}
await homeStore.sendControl(params)
}
const cap_lifting_origin = async () => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'cap_lifting_origin',
params: {},
}
await homeStore.sendControl(params)
}
const tray_lifting_origin = async (heatId: string) => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'tray_lifting_origin',
params: {
heatId,
},
}
await homeStore.sendControl(params)
}
const onComplete = () => {
getSelfFinish().then(() => {
ElMessage.success('自检完成')
emits('close')
})
}
// const cancel = () => {
// emits('update:checking', false)
// visible.value = false
// }
</script>
<template>
<FtDialog visible title="自检" width="50%">
<div v-loading="loading" class="check-main">
<!-- <div v-if="type !== 'cancel'"> -->
<!-- <span style="color: red">所有电机回原点后才可操作</span> -->
<!-- </div> -->
<div class="check-status">
<h3>名称</h3>
<h3>是否在原点</h3>
<h3 style="text-align: center;">
操作
</h3>
</div>
<div v-for="(item) in deviceStatusList" :key="item.name" class="check-status">
<div>
{{ item.name }}
</div>
<div style="margin-left: 2rem;">
<el-icon v-if="!item.isOrign" style="color:red;font-size: 25px;">
<CloseBold />
</el-icon>
<el-icon v-else style="color:#25be25;font-size: 25px;">
<Select />
</el-icon>
</div>
<div v-if="!item.isOrign" style="text-align: center;">
<ft-button type="primary" :click-handle="() => resetOrign(item)">
回原点
</ft-button>
</div>
</div>
</div>
<template #footer>
<FtButton :disabled="!selfStateComplete" :click-handle="onComplete">
关闭
</FtButton>
</template>
</FtDialog>
</template>
<style scoped>
.check-main{
height: 70vh;
overflow: auto;
}
.check-status{
display: grid;
grid-template-columns: 2fr 1fr 1fr;
margin-top: 5px;
height: 30px;
}
</style>

49
src/components/craft/AddCraft/index.vue

@ -138,7 +138,6 @@ const stepMap = {
method: 'anneal',
params: {
temperature: undefined,
feedTemperature: undefined,
time: undefined,
description: undefined,
minutes: undefined,
@ -232,7 +231,7 @@ const addStep = (data: any) => {
</template>
</el-input>
</template>
<template v-else-if="['heat', 'dry'].includes(item.method)">
<template v-else-if="['heat', 'dry', 'anneal'].includes(item.method)">
<el-input v-model.number="item.params.temperature" type="number" size="small" placeholder="退火温度">
<template #append>
@ -259,52 +258,6 @@ const addStep = (data: any) => {
</el-select>
<span class="unit-text"></span>
</template>
<div v-else-if="['anneal'].includes(item.method)" class="info-box">
<div>
<el-input
v-model.number="item.params.temperature"
type="number"
size="small"
placeholder="退火温度"
>
<template #append>
</template>
</el-input>
<el-input
v-model.number="item.params.feedTemperature"
type="number"
size="small"
placeholder="下料温度"
>
<template #append>
</template>
</el-input>
</div>
<div>
<el-select
v-model="item.params.minutes"
style="width: 70px"
clearable
size="small"
placeholder="请选择"
>
<el-option v-for="i in 60" :key="i" :label="i" :value="i" />
</el-select>
<span class="unit-text"></span>
<el-select
v-model="item.params.seconds"
style="width: 70px"
clearable
size="small"
placeholder="请选择"
>
<el-option v-for="i in 60" :key="i" :label="i" :value="i" />
</el-select>
<span class="unit-text"></span>
</div>
</div>
<el-icon style="margin-left: auto" @click="() => form.stepList.splice(index, 1)">
<Close />
</el-icon>

0
src/components/common/Countdown.vue → src/components/home/Countdown/Countdown.vue

6
src/components/home/ExecuteCraft/index.vue

@ -48,7 +48,7 @@ const okHandle = async () => {
heatId: useHomeStore().heatAreaList.find(item => item.selected)?.value,
...form.value,
})
FtMessage.success('工艺已开始')
FtMessage.success('预设已开始')
emits('ok')
}
catch (error) {
@ -120,8 +120,8 @@ const checkChange = () => {
</div>
</div>
</el-form-item>
<el-form-item label="工艺" prop="craftId">
<el-select v-model="form.craftId" placeholder="请选择工艺">
<el-form-item label="预设" prop="craftId">
<el-select v-model="form.craftId" placeholder="请选择预设">
<el-option-group
v-for="group in oreList"
:key="group.id"

2
src/components/home/Tube/index.vue

@ -5,7 +5,7 @@ import errorIcon from 'assets/images/error.svg'
import ingIcon from 'assets/images/ing.svg'
import successIcon from 'assets/images/success.svg'
import waitIcon from 'assets/images/wait.svg'
import CountDown from 'components/common/Countdown.vue'
import CountDown from 'components/home/Countdown/Countdown.vue'
import { useHomeStore } from 'stores/homeStore'
import { useSystemStore } from 'stores/systemStore'
import { computed, ref } from 'vue'

35
src/components/check/index.vue → src/components/system/Check/index.vue

@ -12,10 +12,10 @@ const homeStore = useHomeStore()
const systemStore = useSystemStore()
const checkMap = ref(new Map([
['dualRobotOrigin', { status: '', ignoreKey: 'dualRobotOriginIsIgnore', name: '加液机械臂回原点', params: { commandId: '', command: `dual_robot_origin`, params: {} } }],
['transferZOrigin', { status: '', ignoreKey: 'transferZOriginIsIgnore', name: 'z轴回原点', params: { commandId: '', command: `transfer_z_origin`, params: {} } }],
['transferXOrigin', { status: '', ignoreKey: 'transferXOriginIsIgnore', name: 'x轴回原点', params: { commandId: '', command: `transfer_x_origin`, params: {} } }],
['doorOrigin', { status: '', ignoreKey: 'doorOriginIsIgnore', name: '门电机回原点', params: { commandId: '', command: `door_origin`, params: {} } }],
['dualRobotOrigin', { status: '', ignoreKey: 'dualRobotOriginIsIgnore', name: '加液机械臂回原点', params: { commandId: '', command: `dual_robot_origin`, params: {} } }],
]))
const checkList = ref<any[]>([])
@ -110,11 +110,15 @@ const checkHandle = async () => {
await homeStore.sendControl(params)
}
const checkTextList = ref<string[]>([])
const checkTextList = ref<{ title: string, type: 'success' | 'error' }[]>([])
const selfAgain = ref(false)
const receiveMessageSelfMove = (data: any) => {
checkTextList.value.push(data.title)
checkTextList.value.push(data)
percentage.value = data.schedule
if (data.type === 'error') {
selfAgain.value = true
}
}
const activeStep = ref(0)
@ -165,11 +169,23 @@ const ignore = async (item: any) => {
const ignoreFalse = async (item: any) => {
await setIgnoreItem({
ignoreSelfTestType: item.ignoreKey,
ignoreSelfTestType: 'door_origin_is_ignore',
ignore: false,
})
item.status = 'error'
}
const checkAgain = async () => {
selfAgain.value = false
checkTextList.value = []
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'move_test',
params: {},
}
await homeStore.sendControl(params)
}
</script>
<template>
@ -194,10 +210,10 @@ const ignoreFalse = async (item: any) => {
<el-icon v-else-if="item.status === 'ignore'">
<More />
</el-icon>
<ft-button v-if="item.status !== 'success'" type="primary" size="small" :click-handle="() => commandHandle(item)">
<ft-button v-if="!['ignore', 'success'].includes(item.status)" type="primary" size="small" :click-handle="() => commandHandle(item)">
回原点
</ft-button>
<ft-button v-if="item.status !== 'ignore' && item.name === '门电机回原点'" size="small" type="primary" :click-handle="() => ignore(item)">
<ft-button v-if="!['ignore', 'success'].includes(item.status) && item.name === '门电机回原点'" size="small" type="primary" :click-handle="() => ignore(item)">
忽略
</ft-button>
<ft-button v-if="item.status === 'ignore' && item.name === '门电机回原点'" size="small" type="danger" :click-handle="() => ignoreFalse(item)">
@ -214,8 +230,8 @@ const ignoreFalse = async (item: any) => {
/>
</div>
<ul>
<li v-for="item in checkTextList" :key="item">
{{ item }}
<li v-for="(item, index) in checkTextList" :key="index">
<span :style="{ color: item.type === 'success' ? '#14A656' : '#DF1515' }">{{ item.title }}</span>
</li>
</ul>
</div>
@ -246,6 +262,9 @@ const ignoreFalse = async (item: any) => {
<FtButton v-if="activeStep === 1 && percentage === 100" type="primary" :click-handle="checkHandle1">
下一步
</FtButton>
<FtButton v-if="activeStep === 1 && selfAgain" type="primary" :click-handle="checkAgain">
重新自检
</FtButton>
<FtButton v-if="activeStep === 2" :click-handle="onConfirm">
关闭
</FtButton>

60
src/components/system/EditDate/index.vue

@ -0,0 +1,60 @@
<script setup lang="ts">
import { setTime } from 'apis/system'
import { FtMessage } from 'libs/message'
import { useSystemStore } from 'stores/systemStore'
import { ref } from 'vue'
const emits = defineEmits(['ok', 'close'])
const form = ref<{ datetime?: string }>({
datetime: useSystemStore().currentTime,
})
const formRef = ref()
const rules = {
datetime: [
{ required: true, message: '请选择时间', trigger: 'change' },
],
}
const okHandle = async () => {
try {
const valid = await formRef.value.validate()
if (!valid) {
return
}
await setTime(form.value)
FtMessage.success('修改成功')
emits('ok')
}
catch (e) {
console.log(e)
}
}
const cancel = () => {
emits('close')
}
</script>
<template>
<ft-dialog visible title="设置日期与时间" width="40%" :ok-handle="okHandle" @cancel="cancel">
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
<el-form-item label="日期与时间" prop="datetime">
<el-date-picker
v-model="form.datetime"
:show-now="false"
format="YYYY-MM-DD hh:mm:ss"
value-format="YYYY-MM-DD hh:mm:ss"
style="width: 100%"
type="datetime"
placeholder="请选择日期和时间"
/>
</el-form-item>
</el-form>
</ft-dialog>
</template>
<style scoped lang="scss">
</style>

0
src/components/Stop/index.vue → src/components/system/Stop/index.vue

59
src/components/systemConfig/Edit/index.vue

@ -0,0 +1,59 @@
<script setup lang="ts">
import { updateConfig } from 'apis/system'
import { FtMessage } from 'libs/message'
import { inject, ref } from 'vue'
const emits = defineEmits(['ok', 'cancel'])
const data = inject('currentData')
const form = ref<System.SystemConfig>(data as System.SystemConfig)
const formRef = ref()
const rules = {
value: [
{ required: true, message: '请输入值', trigger: 'blur' },
],
}
const okHandle = async () => {
try {
const valid = await formRef.value.validate()
if (!valid) {
return
}
await updateConfig(form.value)
FtMessage.success('保存成功')
emits('ok')
}
catch (error) {
console.log(error)
}
}
const cancel = () => {
emits('cancel')
}
</script>
<template>
<FtDialog visible title="编辑" width="30%" :ok-handle="okHandle" @cancel="cancel">
<el-form ref="formRef" label-width="auto" :model="form" :rules="rules" label-suffix=": ">
<el-form-item label="名称">
<el-tag>{{ form.name }}</el-tag>
</el-form-item>
<el-form-item label="code">
<el-tag>{{ form.code }}</el-tag>
</el-form-item>
<el-form-item label="值" prop="value">
<el-input v-model="form.value" placeholder="请输入值" />
</el-form-item>
</el-form>
</FtDialog>
</template>
<style scoped lang="scss">
.el-tag {
margin-right: 5px;
}
</style>

22
src/layouts/default.vue

@ -3,10 +3,11 @@ import { getContainerList } from 'apis/container'
import { craftList, craftRestore } from 'apis/crafts'
import { getSolsList } from 'apis/solution'
import logoutIcon from 'assets/images/logout.svg'
import Check from 'components/check/index.vue'
import CheckCraft from 'components/home/CheckCraft/index.vue'
import Liquid from 'components/home/Liquid/index.vue'
import Stop from 'components/Stop/index.vue'
import Check from 'components/system/Check/index.vue'
import EditDate from 'components/system/EditDate/index.vue'
import Stop from 'components/system/Stop/index.vue'
import { ElMessageBox } from 'element-plus'
import { useActivateDebug } from 'hooks/useActivateDebug'
import { useServerTime } from 'hooks/useServerTime'
@ -32,7 +33,19 @@ watch (() => isClose.value, async (newVal) => {
await checkCraft()
}
})
watch(() => systemStore.systemStatus, () => {
if (!systemStore.systemStatus.currentUser) {
router.push('/login')
}
isCheck.value = !systemStore.systemStatus.selfTest
})
onMounted(async () => {
console.log('systemStatus', systemStore.systemStatus)
if (!systemStore.systemStatus.currentUser) {
console.log(123)
await router.push('/login')
}
solutionList.value = (await getSolsList()).list
if (!systemStore.systemStatus.selfTest && systemStore.systemStatus.currentUser?.username !== 'test') {
isCheck.value = true
@ -114,6 +127,8 @@ const commandHandle = async (command: string, params?: unknown) => {
}
await useDebugStore().sendControl(data)
}
const editDateVisible = ref(false)
</script>
<template>
@ -145,7 +160,7 @@ const commandHandle = async (command: string, params?: unknown) => {
</template>
</el-dropdown>
<div class="time">
<div class="time" @click="editDateVisible = true">
{{ currentTime }}
</div>
<div class="user">
@ -261,6 +276,7 @@ const commandHandle = async (command: string, params?: unknown) => {
<Check v-if="isCheck" @close="isCheck = false" />
<Stop v-if="systemStore.systemStatus.emergencyStop" />
<CheckCraft v-if="checkCraftVisible" @close="checkCraftVisible = false" />
<EditDate v-if="editDateVisible" @close="editDateVisible = false" @ok="editDateVisible = false" />
</el-container>
</template>

1
src/libs/utils.ts

@ -58,6 +58,7 @@ export const cmdNameMap = {
door_enable: '使能门电机',
door_disable: '失能门电机',
out_tray: '取出托盘',
move_test: '自检',
}

2
src/router/index.ts

@ -11,7 +11,7 @@ const router = createRouter({
router.beforeEach((to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => {
const systemStore = useSystemStore()
if (getToken() && (systemStore.systemStatus.currentUser?.username || import.meta.env.FT_NODE_ENV !== 'prod')) {
if (getToken() && (systemStore.systemStatus.currentUser?.username)) {
if (to.name === 'login') {
next({ name: from.name })
}

11
src/router/routes.ts

@ -114,6 +114,17 @@ const authRoutes: RouteRecordRaw[] = [
},
},
{
path: '/systemConfig',
name: 'systemConfig',
component: () => import('views/systemConfig/index.vue'),
meta: {
isDefault: true,
title: '系统配置',
icon: n_setting,
activeIcon: s_setting,
},
},
{
path: '/debug',
name: 'debug',
component: () => import('views/debug/index.vue'),

6
src/stores/systemStore.ts

@ -10,7 +10,11 @@ export const useSystemStore = defineStore('system', {
initComplete: true,
selfTest: true,
emergencyStop: false,
currentUser: null,
currentUser: {
id: 1,
username: 'admin',
nickname: '管理员',
},
currentTasks: null,
doorModule: {
open: false,

6
src/types/system.d.ts

@ -107,4 +107,10 @@ declare namespace System {
list: T[]
total: number
}
interface SystemConfig {
id?: number
name?: string
code?: string
value?: string
}
}

123
src/views/home/index.vue

@ -6,8 +6,8 @@ import ExecuteCraft from 'components/home/ExecuteCraft/index.vue'
import ExtractLiquid from 'components/home/ExtractLiquid/index.vue'
import FillSolution from 'components/home/FillSolution/index.vue'
import SetTemperature from 'components/home/SetTemperature/index.vue'
import StartClean from 'components/home/StartClean/index.vue'
import StartClean from 'components/home/StartClean/index.vue'
import StartExperiment from 'components/home/StartExperiment/index.vue'
import Tube from 'components/home/Tube/index.vue'
import { ElMessageBox } from 'element-plus'
@ -179,50 +179,26 @@ const checkCraftVisible = ref(false)
</div>
<div class="button-box">
<el-row style="width: 100%; height: 100%" :gutter="20">
<el-col :span="6">
<el-col :span="20">
<div style="display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr);grid-template-rows: repeat(4, 1fr);height: 100%">
<ft-button size="large" :click-handle="() => commandHandle('door_open')">
开门
</ft-button>
<ft-button size="large" :click-handle="() => commandHandle('door_close')">
关门
</ft-button>
<ft-button size="large" :click-handle="() => commandHandle('move_to_heat_area', { heatModuleCode: selectedHeatArea!.value })" :disabled="!selectedHeatArea">
移至加热位
</ft-button>
<ft-button size="large" :click-handle="move_to_liquid_area">
移至加液位
</ft-button>
<ft-button size="large" :click-handle="move_to_feed_area">
移至上料区
</ft-button>
<ft-button size="large" :click-handle="move_to_anneal_area">
移至退火位
</ft-button>
<ft-button size="large" :click-handle="trayInHandle">
放入托盘
</ft-button>
<ft-button size="large" :click-handle="() => commandHandle('out_tray', { heatModuleCode: selectedHeatArea!.value })" :disabled="!selectedHeatArea">
取出托盘
</ft-button>
</div>
</el-col>
<el-col :span="6" style="display: grid; gap: 10px; grid-template-columns: repeat(1, 1fr);grid-template-rows: repeat(2, 1fr)">
<div style="display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr);grid-template-rows: repeat(2, 1fr);height: 100%">
<ft-button size="large" @click="startExperimentHandle">
开始记录
</ft-button>
<ft-button size="large" :click-handle="stopExperimentHandle">
结束记录
</ft-button>
<!-- <ft-button size="large" @click="selectCraft"> -->
<!-- 选择预设 -->
<!-- </ft-button> -->
<ft-button size="large" :click-handle="executeCraftHandle">
执行预设
</ft-button>
@ -230,27 +206,21 @@ const checkCraftVisible = ref(false)
异常预设
</ft-button>
</div>
<div style="display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr);grid-template-rows: repeat(2, 1fr)">
<ft-button size="large" @click="cleanVisible = true">
开始清洗
</ft-button>
<ft-button size="large" @click=" fillSolutionVisible = true">
预充管路
</ft-button>
<ft-button size="large" @click="addLiquidVisible = true">
添加溶液
</ft-button>
<ft-button size="large" @click="extractLiquidVisible = true">
抽取溶液
</ft-button>
</div>
</el-col>
<el-col :span="6">
<div style="display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr);grid-template-rows: repeat(4, 1fr);height: 100%">
<el-col :span="4" style="display: grid; gap: 10px; grid-template-columns: repeat(1, 1fr);grid-template-rows: repeat(1, 1fr)">
<div class="manual-box">
<el-popover
placement="top-start"
width="auto"
trigger="click"
>
<template #reference>
<div class="manual-button">
手动操作
</div>
</template>
<template #default>
<div class="container-box">
<ft-button size="large" :disabled="!selectedHeatArea || selectedHeatArea?.label === '退火区'" :click-handle="() => commandHandle('heater_start', { heatModuleCode: selectedHeatArea!.value })">
开始加热
</ft-button>
@ -282,10 +252,34 @@ const checkCraftVisible = ref(false)
<ft-button size="large" :disabled="!selectedHeatArea || selectedHeatArea?.label !== '退火区'" :click-handle="() => commandHandle('anneal_stop', { heatModuleCode: selectedHeatArea!.value })">
停止退火
</ft-button>
</div>
</el-col>
<el-col :span="6">
<div style="display: grid; gap: 10px; grid-template-columns: repeat(1, 1fr);grid-template-rows: repeat(3, 1fr);height: 100%">
<ft-button size="large" :click-handle="() => commandHandle('move_to_heat_area', { heatModuleCode: selectedHeatArea!.value })" :disabled="!selectedHeatArea">
移至加热位
</ft-button>
<ft-button size="large" :click-handle="move_to_liquid_area">
移至加液位
</ft-button>
<ft-button size="large" :click-handle="move_to_feed_area">
移至上料区
</ft-button>
<ft-button size="large" :click-handle="move_to_anneal_area">
移至退火位
</ft-button>
<ft-button size="large" @click="cleanVisible = true">
开始清洗
</ft-button>
<ft-button size="large" @click=" fillSolutionVisible = true">
预充管路
</ft-button>
<ft-button size="large" @click="addLiquidVisible = true">
添加溶液
</ft-button>
<ft-button size="large" @click="extractLiquidVisible = true">
抽取溶液
</ft-button>
<ft-button size="large" :click-handle="() => commandHandle('liquid_motor_origin')">
加液臂回原点
</ft-button>
@ -296,6 +290,9 @@ const checkCraftVisible = ref(false)
x轴回原点
</ft-button>
</div>
</template>
</el-popover>
</div>
</el-col>
</el-row>
</div>
@ -342,4 +339,30 @@ const checkCraftVisible = ref(false)
}
}
.el-col {
height: 100%;
}
.manual-box {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.container-box {
width: 600px;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: repeat(2, 1fr);
gap: 10px;
}
.manual-button {
border:1px solid #1989FA;
color: #1989FA;
width: 100%;
height: 100px;
line-height: 100px;
text-align: center;
border-radius: 10px;
}
</style>

59
src/views/systemConfig/index.vue

@ -0,0 +1,59 @@
<script setup lang="ts">
import { configList } from 'apis/system'
import Edit from 'components/systemConfig/Edit/index.vue'
import { provide, ref, useTemplateRef } from 'vue'
const upDataVisible = ref(false)
const currentData = ref<Point.Point>()
provide('currentData', currentData)
const edit = (data: Point.Point[]) => {
currentData.value = data[0]
upDataVisible.value = true
}
const tableRef = useTemplateRef('tableRef')
const ok = () => {
tableRef.value?.initData()
cancel()
}
const cancel = () => {
upDataVisible.value = false
}
const btnList = [
{
name: '编辑',
type: 'primary',
serverUrl: 'edit',
serverCondition: 1,
},
]
const columns = [
{
type: 'selection',
},
{
title: '名称',
key: 'name',
},
{
title: 'code',
key: 'code',
},
{
title: '值',
key: 'value',
},
]
</script>
<template>
<div>
<FtTable ref="tableRef" :columns="columns" has-header :btn-list="btnList" :get-data-fn="configList" @edit="edit" />
<Edit v-if="upDataVisible" @ok="ok" @cancel="cancel" />
</div>
</template>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save