diff --git a/src/components/system/Check/index.vue b/src/components/system/Check/index.vue deleted file mode 100644 index 56d85a9..0000000 --- a/src/components/system/Check/index.vue +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - {{ item.name }} - - - - - - - - - - - - - - 回原点 - - - - - - - 自检进度: - - - - - {{ item.title }} - - - - - - - - 下一步 - - - 重新自检 - - - 关闭 - - - - - - - diff --git a/src/components/systemConfig/Edit/index.vue b/src/components/systemConfig/Edit/index.vue deleted file mode 100644 index c149c5d..0000000 --- a/src/components/systemConfig/Edit/index.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - - 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-form-item(label="code") - el-tag {{ form.code }} - el-form-item(label="值" prop="value") - ft-input(v-model="form.value" placeholder="请输入值") - - - diff --git a/src/layouts/default.vue b/src/layouts/default.vue index 186c9af..6803fb0 100644 --- a/src/layouts/default.vue +++ b/src/layouts/default.vue @@ -5,13 +5,13 @@ import logoutIcon from 'assets/images/logout.svg' import manualIcon from 'assets/images/manual.svg' import powerIcon from 'assets/images/power.svg' import FtDatetime from 'components/common/FTDatetime/index.vue' -import Check from 'components/system/Check/index.vue' import Delay from 'components/system/Delay/index.vue' import Stop from 'components/system/Stop/index.vue' import { ElMessageBox } from 'element-plus' import { useActivateDebug } from 'hooks/useActivateDebug' import { FtMessage } from 'libs/message' import { isClose, socket } from 'libs/socket' +import { cmdNameMap, formatDateTime } from 'libs/utils' import { authRoutes } from 'router/routes' import { useDebugStore } from 'stores/debugStore' import { useSystemStore } from 'stores/systemStore' @@ -26,6 +26,8 @@ const router = useRouter() onMounted(async () => { socket.init(receiveMessage, 'alarm') socket.init(receiveMessage1, 'warn') + socket.init(receiveMessage2, 'cmd_debug') + socket.init(receiveMessage2, 'cmd_response') if (!systemStore.systemStatus.currentUser) { await router.push('/login') } @@ -36,9 +38,19 @@ onMounted(async () => { onUnmounted(() => { socket.unregisterCallback(receiveMessage, 'alarm') - socket.unregisterCallback(receiveMessage, 'warn') + socket.unregisterCallback(receiveMessage1, 'warn') + socket.unregisterCallback(receiveMessage2, 'cmd_debug') + socket.unregisterCallback(receiveMessage2, 'cmd_response') }) +const receiveMessage2 = (data: Socket.cmdData) => { + console.log('cmd_debug', data) + if (['start', 'success', 'fail'].includes(data.status)) { + const cmdName = cmdNameMap[data.command as keyof typeof cmdNameMap] || data.command + systemStore.insertLog({ cmdName, status: data.status as System.SystemLog['status'], time: formatDateTime() }) + } +} + let flag = false const receiveMessage1 = (data: any) => { @@ -252,7 +264,6 @@ const remoteControlState = computed(() => { div(class="footer-right") FtDatetime FtStream(:visible="systemStore.streamVisible") - Check(v-if="isCheck" @close="isCheck = false") Stop(v-if="systemStore.systemStatus.emergencyStop") Delay(v-if="delayVisible" @ok="delayVisible = false" @close="delayVisible = false") diff --git a/src/libs/utils.ts b/src/libs/utils.ts index 83bf26b..dd1cdff 100644 --- a/src/libs/utils.ts +++ b/src/libs/utils.ts @@ -1,63 +1,8 @@ export const cmdNameMap = { - liquid_motor_move_to: '加液电机绝对移动', - liquid_motor_origin: '加液电机回原点', - liquid_motor_stop: '加液电机停止', - liquid_motor_move_by: '加液电机相对移动', - liquid_pump_start: '加液泵开始', - liquid_pump_add: '加液', - liquid_pump_reduce: '抽液', - liquid_pump_stop: '停止加液泵', - liquid_valve_open_thin: '阀门切换到稀硝酸通道', - liquid_valve_open_thick: '阀门切换到浓硝酸通道', - liquid_valve_open_water: '阀门切换到蒸馏水通道', - liquid_valve_open_waste: '阀门切换到废液通道', - liquid_valve_open_vacant: '阀门关闭', - heater_start: '开始加热', - heater_stop: '停止加热', - fan_start: '打开风扇', - fan_stop: '关闭风扇', - x_origin: 'x轴电机回原点', - x_stop: 'x轴电机停止', - x_move_to: 'x轴电机绝对移动', - x_move_by: 'x轴电机相对移动', - z_stop: 'z轴电机停止', - z_origin: 'z轴电机回原点', - z_move_to: 'z轴电机绝对移动', - z_move_by: 'z轴电机相对移动', - liquid_add: '加液', - liquid_reduce: '抽取溶液', - clean_start: '开始清洗', - liquid_pre_fill_start: '开始预充', - liquid_pre_fill_stop: '停止预充', - dry_start: '开始烘干', - dry_stop: '停止烘干', - anneal_start: '开始退火', - anneal_stop: '停止退火', - move_to_heat_area: '移至加热区', - move_to_liquid_area: '移至加液区', - move_to_feed_area: '移至上/下料区', - transfer_z_origin: 'z轴回原点', - transfer_x_origin: 'x轴回原点', - door_origin: '门电机回原点', - dual_robot_origin: '加液机械臂回原点', - move_to_anneal_area: '移至退火位', - beep_open: '蜂鸣器开启', - beep_close: '蜂鸣器关闭', - enable_all_motor: '使能所有电机', - disable_all_motor: '失能所有电机', - stop_all_motor: '停止所有电机', - x_enable: '使能x轴电机', - x_disable: '失能x轴电机', - z_enable: '使能z轴电机', - z_disable: '失能z轴电机', - liquid_motor_enable: '使能加液臂电机', - liquid_motor_disable: '失能加液臂电机', - door_enable: '使能门电机', - door_disable: '失能门电机', - out_tray: '取出托盘', - move_test: '自检', - liquid_pre_fill_when_launch: '开机预充', - + pump_rotate_start: '泵开始转动', + pump_rotate_stop: '泵停止转动', + solution_pre_fill_start: '预充', + solution_add_start: '加液', } export const generateColors = (count: number): string[] => { diff --git a/src/main.ts b/src/main.ts index 9f426d1..3993004 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import * as ElementPlusIconsVue from '@element-plus/icons-vue' import FtButton from 'components/common/FTButton/index.vue' import FtChart from 'components/common/FTChart/index.vue' -import FtDatetime from 'components/common/FTDateTime/index.vue' +import FtDatetime from 'components/common/FTDatetime/index.vue' import FtDialog from 'components/common/FTDialog/index.vue' import FtInput from 'components/common/FTInput/index.vue' import FtStream from 'components/common/FTStream/index.vue' diff --git a/src/types/debug.d.ts b/src/types/debug.d.ts deleted file mode 100644 index 7144bff..0000000 --- a/src/types/debug.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -declare namespace Debug { - interface DebugStore { - formData: FormData - } - interface FormData { - heatArea: HeatArea - transferModule: TransferModule - peristalticPumpData: PeristalticPump - titrationModule: TitrationModule - lightModule: LightModule - stirMotor: StirMotor - } - - interface StirMotor { - absolute: MotorData & { - motorCode: 'stir_motor_1' | 'stir_motor_2' - } - relative: MotorData & { - motorCode: 'stir_motor_1' | 'stir_motor_2' - } - } - - interface TitrationModule { - absolute: MotorData & { - motorCode: 'titration_motor_1' | 'titration_motor_2' - } - relative: MotorData & { - motorCode: 'titration_motor_1' | 'titration_motor_2' - } - } - - interface LightModule { - color: 'red' | 'green' | 'yellow' - } - - interface HeatArea { - heatModuleCode: 'heat_module_1' | 'heat_module_2' - temperature?: number - } - - interface MotorData { - distance?: number - speed?: number - times?: number - position?: number - } - - interface RoboticArmMotorData { - angle?: number - speed?: number - times?: number - position?: number - } - - interface PumpData { - speed?: number - distance?: number - direction?: 'forward' | 'backward' - } - - interface PeristalticPump { - ceramicPump: PumpData & { - pumpCode: 'ceramic_pump_1' | 'ceramic_pump_2' - } - brushlessPump: PumpData & { - pumpCode: 'brushless_pump_1' | 'brushless_pump_2' | 'brushless_pump_3' | 'brushless_pump_4' | 'brushless_pump_5' | 'brushless_pump_6' | 'brushless_pump_7' | 'brushless_pump_8' | 'brushless_pump_9' | 'brushless_pump_10' - } - stepPump: PumpData & { - pumpCode: 'step_pump_1' | 'step_pump_2' | 'step_pump_3' - } - } - - interface TransferModule { - bigMotorData: { - absolute: RoboticArmMotorData - relative: RoboticArmMotorData - } - smallMotorData: { - absolute: RoboticArmMotorData - relative: RoboticArmMotorData - } - zMotorData: { - absolute: MotorData - relative: MotorData - } - clawMotorData: MotorData - } - -} diff --git a/src/types/exit.d.ts b/src/types/exit.d.ts deleted file mode 100644 index 4fdc6cd..0000000 --- a/src/types/exit.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare namespace Exit { - interface ExitModal { - openModal: () => void - } - - interface Axis { - name: string - icon: string - value: 'x' | 'y' | 'z' - color: string - } -} diff --git a/src/types/point.d.ts b/src/types/point.d.ts deleted file mode 100644 index 63633b7..0000000 --- a/src/types/point.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare namespace Point { - interface Point extends UpdateParams { - name: string - code: string - type: string - } - interface UpdateParams { - id?: number - position?: string - } -} diff --git a/src/types/task.d.ts b/src/types/task.d.ts deleted file mode 100644 index a273163..0000000 --- a/src/types/task.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -declare namespace Task { - - interface TaskAdd { - name: string - } - interface TaskQuery extends System.Page { - name: string - } - interface Task { - id: number - name: string - status: 1 | 2 - isDeleted: 0 | 1 - createTime: string - startTime: string - endTime: string - updateTime: string - steps: Step[] - } - interface Step { - id: number - taskId: number - stepDescription: string - createTime: string - } -} diff --git a/src/views/channel/index.vue b/src/views/channel/index.vue deleted file mode 100644 index 4c02696..0000000 --- a/src/views/channel/index.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - div.home-container - el-card(v-for="item in channelList" :key="item.id") - template(#header) - span {{ item.name }} - div.content-box - el-select(v-model="item.solutionId" placeholder="请选择溶液" ) - el-option(v-for="item in solutionList" :key="item.id" :label="item.name" :value="item.id") - ft-button(type="primary") 确认修改 - - - diff --git a/src/views/craft/index.vue b/src/views/craft/index.vue index 0977897..0800361 100644 --- a/src/views/craft/index.vue +++ b/src/views/craft/index.vue @@ -105,36 +105,30 @@ const delHandle = async (id: number | undefined) => { let currentCommandId = '' // 正转 反转 const pumpRotate = async (direction: string) => { - currentCommandId = Date.now().toString() - if (direction === 'FORWARD') { - const params = { - commandId: currentCommandId, - command: 'pump_rotate_start', - params: { - direction: 'FORWARD', - position: form.value.revolutions, - solutionId: form.value.solutionId, - concentration: form.value.concentration, - }, - } - await homeStore.sendControl(params) + const valid = await formRef.value.validate() + if (!valid) { + return } - else { - const params = { - commandId: currentCommandId, - command: 'pump_rotate_start', - params: { - direction: 'BACKWARD', - solutionId: form.value.solutionId, - concentration: form.value.concentration, - position: form.value.revolutions, - }, - } - await homeStore.sendControl(params) + currentCommandId = Date.now().toString() + + const params = { + commandId: currentCommandId, + command: 'pump_rotate_start', + params: { + direction, + position: form.value.revolutions, + solutionId: form.value.solutionId, + concentration: form.value.concentration, + }, } + await homeStore.sendControl(params) } // 停止 const pumpStop = async () => { + const valid = await formRef.value.validate() + if (!valid) { + return + } currentCommandId = Date.now().toString() const params = { commandId: currentCommandId, @@ -148,6 +142,10 @@ const pumpStop = async () => { } // 预充 const pumpPreFill = async () => { + const valid = await formRef.value.validate() + if (!valid) { + return + } currentCommandId = Date.now().toString() const params = { commandId: currentCommandId, @@ -161,6 +159,10 @@ const pumpPreFill = async () => { } // 加液 const pumpAddSolution = async () => { + const valid = await formRef.value.validate() + if (!valid) { + return + } currentCommandId = Date.now().toString() const params = { commandId: currentCommandId, diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue deleted file mode 100644 index c7052cd..0000000 --- a/src/views/debug/index.vue +++ /dev/null @@ -1,438 +0,0 @@ - - - - div.debug-content - el-row.button-content - el-col(:span="8") - div.button-box - ft-button(type="primary", :click-handle="() => commandHandle('enable_all_motor')") - | 使能所有电机 - el-col(:span="8") - div.button-box - ft-button(type="primary", :click-handle="() => commandHandle('disable_all_motor')") - | 失能所有电机 - el-col(:span="8") - div.button-box - ft-button(type="primary", :click-handle="() => commandHandle('stop_all_motor')") - | 停止所有电机 - el-row(:gutter="10", class="card-content") - el-col(:span="8") - el-card - template(#header) - div.card-header - span 转运模组 - el-divider 机械臂-大臂 - div.card-box - el-form - el-form-item(label="角度") - el-input(v-model="debugStore.formData.transferModule.bigMotorData.relative.angle", type="number", placeholder="请输入角度") - template(#append) - | ° - el-form-item(label="速度") - el-input(v-model="debugStore.formData.transferModule.bigMotorData.relative.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item(label="循环") - el-input(v-model="debugStore.formData.transferModule.bigMotorData.relative.times", type="number", placeholder="请输入次数") - template(#append) - | 次 - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('robotic_arm_big_move_by', { ...debugStore.formData.transferModule.bigMotorData.relative, angle: debugStore.formData.transferModule.bigMotorData.relative.angle })") - | 左转 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('robotic_arm_big_stop')") - | 停止 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('robotic_arm_big_move_by', { ...debugStore.formData.transferModule.bigMotorData.relative, angle: -(debugStore.formData.transferModule.bigMotorData.relative.angle ?? 0) })") - | 右转 - ft-button(type="primary", size="small", :click-handle="() => commandHandle('robotic_arm_big_origin')") - | 回原点 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('robotic_arm_big_enable')") - | 电机使能 - ft-button(size="small", :click-handle="() => commandHandle('robotic_arm_big_disable')") - | 电机失能 - el-form-item(label="角度") - el-input(v-model="debugStore.formData.transferModule.bigMotorData.absolute.angle", type="number", placeholder="请输入目标角度") - template(#append) - | ° - el-form-item(label="速度") - el-input(v-model="debugStore.formData.transferModule.bigMotorData.absolute.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('robotic_arm_big_move_to', debugStore.formData.transferModule.bigMotorData.absolute)") - | 开始 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('robotic_arm_big_stop')") - | 停止 - el-divider 机械臂-小臂 - div.card-box - el-form - el-form-item(label="角度") - el-input(v-model="debugStore.formData.transferModule.smallMotorData.relative.angle", type="number", placeholder="请输入角度") - template(#append) - | ° - el-form-item(label="速度") - el-input(v-model="debugStore.formData.transferModule.smallMotorData.relative.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item(label="循环") - el-input(v-model="debugStore.formData.transferModule.smallMotorData.relative.times", type="number", placeholder="请输入次数") - template(#append) - | 次 - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('robotic_arm_small_move_by', { ...debugStore.formData.transferModule.smallMotorData.relative, distance: debugStore.formData.transferModule.smallMotorData.relative.angle })") - | 左转 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('robotic_arm_small_stop')") - | 停止 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('robotic_arm_small_move_by', { ...debugStore.formData.transferModule.smallMotorData.relative, distance: -(debugStore.formData.transferModule.smallMotorData.relative.angle ?? 0) })") - | 右转 - ft-button(type="primary", size="small", :click-handle="() => commandHandle('robotic_arm_small_origin')") - | 回原点 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('robotic_arm_small_enable')") - | 电机使能 - ft-button(size="small", :click-handle="() => commandHandle('robotic_arm_small_disable')") - | 电机失能 - el-form-item(label="角度") - el-input(v-model="debugStore.formData.transferModule.smallMotorData.absolute.angle", type="number", placeholder="请输入目标角度") - template(#append) - | ° - el-form-item(label="速度") - el-input(v-model="debugStore.formData.transferModule.smallMotorData.absolute.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('robotic_arm_small_move_to', debugStore.formData.transferModule.smallMotorData.absolute)") - | 开始 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('robotic_arm_small_stop')") - | 停止 - el-divider Z轴电机 - div.card-box - el-form - el-form-item(label="距离") - el-input(v-model="debugStore.formData.transferModule.zMotorData.relative.distance", type="number", placeholder="请输入距离") - template(#append) - | mm - el-form-item(label="速度") - el-input(v-model="debugStore.formData.transferModule.zMotorData.relative.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item(label="循环") - el-input(v-model="debugStore.formData.transferModule.zMotorData.relative.times", type="number", placeholder="请输入次数") - template(#append) - | 次 - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('z_move_by', { ...debugStore.formData.transferModule.zMotorData.relative, distance: debugStore.formData.transferModule.zMotorData.relative.distance })") - | 前进 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('z_stop')") - | 停止 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('z_move_by', { ...debugStore.formData.transferModule.zMotorData.relative, distance: -(debugStore.formData.transferModule.zMotorData.relative.distance ?? 0) })") - | 后退 - ft-button(type="primary", size="small", :click-handle="() => commandHandle('z_origin')") - | 回原点 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('z_enable')") - | 电机使能 - ft-button(size="small", :click-handle="() => commandHandle('z_disable')") - | 电机失能 - el-divider 夹爪电机 - div.card-box - el-form - el-form-item(label="距离") - el-input(v-model="debugStore.formData.transferModule.clawMotorData.distance", type="number", placeholder="请输入距离") - template(#append) - | mm - el-form-item(label="速度") - el-input(v-model="debugStore.formData.transferModule.clawMotorData.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item(label="循环") - el-input(v-model="debugStore.formData.transferModule.clawMotorData.times", type="number", placeholder="请输入次数") - template(#append) - | 次 - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('claw_open', { ...debugStore.formData.transferModule.clawMotorData, distance: debugStore.formData.transferModule.clawMotorData.distance })") - | 打开 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('claw_open', { ...debugStore.formData.transferModule.clawMotorData, distance: -(debugStore.formData.transferModule.clawMotorData.distance ?? 0) })") - | 闭合 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('claw_stop', {})") - | 停止 - el-col(:span="8") - el-card - template(#header) - div.card-header - span 蠕动泵 - el-divider 陶瓷蠕动泵 - div.card-box - el-form - el-form-item(label="距离") - el-input(v-model="debugStore.formData.peristalticPumpData.ceramicPump.distance", type="number", placeholder="请输入距离") - template(#append) - | mL - el-form-item(label="速度") - el-input(v-model="debugStore.formData.peristalticPumpData.ceramicPump.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item(label="泵") - el-select(v-model="debugStore.formData.peristalticPumpData.ceramicPump.pumpCode", placeholder="请选择泵") - el-option(v-for="item in 2", :key="item", :label="`泵-${item}`", :value="`ceramic_pump_${item}`") - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('ceramic_pump_move', { ...debugStore.formData.peristalticPumpData.ceramicPump})") - | 移动 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('ceramic_pump_open', { ...debugStore.formData.peristalticPumpData.ceramicPump, direction: 'forward' })") - | 正转 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('ceramic_pump_close', debugStore.formData.peristalticPumpData.ceramicPump)") - | 停止 - ft-button(size="small", type="primary", class="stop-button", :click-handle="() => commandHandle('ceramic_pump_open', { ...debugStore.formData.peristalticPumpData.ceramicPump, direction: 'backward' })") - | 反转 - el-divider 无刷蠕动泵 - div.card-box - el-form - el-form-item(label="距离") - el-input(v-model="debugStore.formData.peristalticPumpData.brushlessPump.distance", type="number", placeholder="请输入距离") - template(#append) - | mL - el-form-item(label="速度") - el-input(v-model="debugStore.formData.peristalticPumpData.brushlessPump.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item(label="泵") - el-select(v-model="debugStore.formData.peristalticPumpData.brushlessPump.pumpCode", placeholder="请选择泵") - el-option(v-for="item in 10", :key="item", :label="`泵-${item}`", :value="`brushless_pump_${item}`") - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('brushless_pump_move', { ...debugStore.formData.peristalticPumpData.brushlessPump})") - | 正转 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('brushless_pump_open', { ...debugStore.formData.peristalticPumpData.brushlessPump, direction: 'forward' })") - | 正转 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('brushless_pump_close',{ ...debugStore.formData.peristalticPumpData.brushlessPump})") - | 停止 - ft-button(size="small", type="primary", class="stop-button", :click-handle="() => commandHandle('brushless_pump_open', { ...debugStore.formData.peristalticPumpData.brushlessPump, direction: 'backward' })") - | 反转 - el-divider 步进蠕动泵 - div.card-box - el-form - el-form-item(label="距离") - el-input(v-model="debugStore.formData.peristalticPumpData.stepPump.distance", type="number", placeholder="请输入距离") - template(#append) - | mL - el-form-item(label="速度") - el-input(v-model="debugStore.formData.peristalticPumpData.stepPump.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item(label="泵") - el-select(v-model="debugStore.formData.peristalticPumpData.stepPump.pumpCode", type="number", placeholder="请选择泵") - el-option(v-for="item in 3", :key="item", :label="`泵-${item}`", :value="`step_pump_${item}`") - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('step_pump_move', { ...debugStore.formData.peristalticPumpData.stepPump})") - | 移动 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('step_pump_open', { ...debugStore.formData.peristalticPumpData.stepPump, direction: 'forward' })") - | 正转 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('step_pump_close',{ ...debugStore.formData.peristalticPumpData.stepPump})") - | 停止 - ft-button(size="small", type="primary", class="stop-button", :click-handle="() => commandHandle('step_pump_open', { ...debugStore.formData.peristalticPumpData.stepPump, direction: 'backward' })") - | 反转 - el-card - template(#header) - div.card-header - span 滴定移动电机 - div.card-box - el-form - el-form-item(label="距离") - el-input(v-model="debugStore.formData.titrationModule.relative.distance", type="number", placeholder="请输入距离") - template(#append) - | mm - el-form-item(label="速度") - el-input(v-model="debugStore.formData.titrationModule.relative.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item(label="循环") - el-input(v-model="debugStore.formData.titrationModule.relative.times", type="number", placeholder="请输入次数") - template(#append) - | 次 - el-form-item(label="电机") - el-select(v-model="debugStore.formData.titrationModule.relative.motorCode", placeholder="请选择电机") - el-option(v-for="item in 2", :key="item", :label="`电机${item}`", :value="`titration_motor_${item}`") - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('titration_motor_move_by', { ...debugStore.formData.titrationModule.relative, distance: debugStore.formData.titrationModule.relative.distance })") - | 相对移动 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('titration_motor_stop', { motorCode: debugStore.formData.titrationModule.relative.motorCode })") - | 停止 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('titration_motor_move_to', { ...debugStore.formData.titrationModule.relative, position: -(debugStore.formData.titrationModule.relative.distance ?? 0) })") - | 绝对移动 - ft-button(type="primary", size="small", :click-handle="() => commandHandle('titration_motor_origin', { motorCode: debugStore.formData.titrationModule.relative.motorCode })") - | 回原点 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('titration_motor_enable', { motorCode: debugStore.formData.titrationModule.relative.motorCode })") - | 电机使能 - ft-button(size="small", :click-handle="() => commandHandle('titration_motor_disable', { motorCode: debugStore.formData.titrationModule.relative.motorCode })") - | 电机失能 - el-col(:span="8") - el-card - template(#header) - div.card-header - span 加热模组 - el-divider 加热棒 - div.card-box - el-form - el-form-item(label="温度") - el-input(v-model="debugStore.formData.heatArea.temperature", type="number", placeholder="请输入温度") - template(#append) - | ℃ - el-form-item(label="区域") - el-select(v-model="debugStore.formData.heatArea.heatModuleCode", placeholder="请选择区域") - el-option(v-for="item in 2", :key="item", :label="`加热区${item}`", :value="`heat_module_${item}`") - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('heater_start', debugStore.formData.heatArea)") - | 开始加热 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('heater_stop', debugStore.formData.heatArea)") - | 停止加热 - el-card - template(#header) - div.card-header - span 指示灯 - div.card-box - el-form - el-form-item(label="颜色") - el-select(v-model="debugStore.formData.lightModule.color", placeholder="请选择颜色") - el-option(v-for="item in [{ value: 'red', label: '红色' }, { value: 'yellow', label: '黄色' }, { value: 'green', label: '绿色' }]", :key="item.value", :label="item.label", :value="item.value") - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('light_open', { ...debugStore.formData.lightModule })") - | 开启 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('light_close')") - | 关闭 - el-card - template(#header) - div.card-header - span 磁子搅拌电机 - div.card-box - el-form - el-form-item(label="距离") - el-input(v-model="debugStore.formData.stirMotor.relative.distance", type="number", placeholder="请输入距离") - template(#append) - | mm - el-form-item(label="速度") - el-input(v-model="debugStore.formData.stirMotor.relative.speed", type="number", placeholder="请输入速度") - template(#append) - | rpm/min - el-form-item(label="循环") - el-input(v-model="debugStore.formData.stirMotor.relative.times", type="number", placeholder="请输入次数") - template(#append) - | 次 - el-form-item(label="电机") - el-select(v-model="debugStore.formData.stirMotor.relative.motorCode", placeholder="请选择电机") - el-option(v-for="item in 2", :key="item", :label="`电机${item}`", :value="`stir_motor_${item}`") - el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('stir_motor_move_by', { ...debugStore.formData.stirMotor.relative, distance: debugStore.formData.stirMotor.relative.distance })") - | 前进 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('stir_motor_stop', { motorCode: debugStore.formData.stirMotor.relative.motorCode })") - | 停止 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('stir_motor_move_by', { ...debugStore.formData.stirMotor.relative, distance: -(debugStore.formData.stirMotor.relative.distance ?? 0) })") - | 后退 - ft-button(type="primary", size="small", :click-handle="() => commandHandle('stir_motor_origin', { motorCode: debugStore.formData.stirMotor.relative.motorCode })") - | 回原点 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('stir_motor_enable', { motorCode: debugStore.formData.stirMotor.relative.motorCode })") - | 电机使能 - ft-button(size="small", :click-handle="() => commandHandle('stir_motor_disable', { motorCode: debugStore.formData.stirMotor.relative.motorCode })") - | 电机失能 - el-divider 磁子投放 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('magnet_open')") - | 打开磁子投放开关 - ft-button(size="small", :click-handle="() => commandHandle('magnet_close')") - | 关闭磁子投放开关 - SavePosition(v-if="savePositionVisible", @ok="savePositionVisible = false", @cancel="savePositionVisible = false") - - - diff --git a/src/views/log/index.vue b/src/views/log/index.vue index c6f4be8..7136d6d 100644 --- a/src/views/log/index.vue +++ b/src/views/log/index.vue @@ -58,7 +58,7 @@ const columns = [ title: '通道', key: 'channelCode', render: (row: Log.LogItem) => { - return h(ElTag, {}, channelMap[row.channelCode as keyof typeof channelMap]) + return h(ElTag, {}, () => channelMap[row.channelCode as keyof typeof channelMap]) }, }, { diff --git a/src/views/point/index.vue b/src/views/point/index.vue deleted file mode 100644 index 1fd6a87..0000000 --- a/src/views/point/index.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - diff --git a/src/views/user/index.vue b/src/views/user/index.vue deleted file mode 100644 index cc24be2..0000000 --- a/src/views/user/index.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - div - FtTable(ref="tableRef", has-header, has-page, :columns="columns", :btn-list="btnList", :get-data-fn="userList", @add="addHandle", @edit="editHandle", @del="del") - Edit(v-if="addVisible", :data="currentData", @ok="addVisible = false;tableRef?.initData()", @cancel="addVisible = false") -
自检进度: