15 changed files with 47 additions and 1177 deletions
-
255src/components/system/Check/index.vue
-
53src/components/systemConfig/Edit/index.vue
-
17src/layouts/default.vue
-
63src/libs/utils.ts
-
2src/main.ts
-
89src/types/debug.d.ts
-
12src/types/exit.d.ts
-
11src/types/point.d.ts
-
26src/types/task.d.ts
-
61src/views/channel/index.vue
-
52src/views/craft/index.vue
-
438src/views/debug/index.vue
-
2src/views/log/index.vue
-
59src/views/point/index.vue
-
84src/views/user/index.vue
@ -1,255 +0,0 @@ |
|||
<script lang="ts" setup> |
|||
import { getSelfFinish } from 'apis/self' |
|||
import { ElMessageBox } from 'element-plus' |
|||
import { socket } from 'libs/socket' |
|||
import { useHomeStore } from 'stores/homeStore' |
|||
import { useSystemStore } from 'stores/systemStore' |
|||
import { onMounted, ref } from 'vue' |
|||
|
|||
const emits = defineEmits(['close']) |
|||
const homeStore = useHomeStore() |
|||
const systemStore = useSystemStore() |
|||
|
|||
const checkMap = ref(new Map([ |
|||
['zOrigin', { status: '', ignoreKey: 'zOriginIsIgnore', name: 'Z轴回原点', params: { commandId: '', command: `check_z_origin`, params: {} } }], |
|||
['xyOrigin', { status: '', ignoreKey: 'xyOriginIsIgnore', name: '机械臂回原点', params: { commandId: '', command: `check_xy_origin`, params: {} } }], |
|||
['titrationOrigin', { status: '', ignoreKey: 'titrationOriginIsIgnore', name: '滴定电机回原点', params: { commandId: '', command: `check_titration_motor_origin`, params: {} } }], |
|||
['shakeOrigin', { status: '', ignoreKey: 'shakeOriginIsIgnore', name: '摇匀电机回原点', params: { commandId: '', command: `check_shake_motor_origin`, params: {} } }], |
|||
['stirOrigin', { status: '', ignoreKey: 'stirOriginIsIgnore', name: '磁子投放电机回原点', params: { commandId: '', command: `check_stir_motor_origin`, params: {} } }], |
|||
])) |
|||
|
|||
const checkList = ref<any[]>([]) |
|||
|
|||
onMounted(async () => { |
|||
socket.init(receiveMessage1, 'cmd_debug') |
|||
socket.init(receiveMessage2, 'cmd_response') |
|||
socket.init(receiveMessageSelfMove, 'self_move_test') |
|||
await ElMessageBox.confirm( |
|||
'设备转运机械臂、滴定电机、摇匀电机、磁子投放电机,请确认机械臂行进路径无杂物', |
|||
'提示', |
|||
{ |
|||
confirmButtonText: '确认', |
|||
showClose: false, |
|||
showCancelButton: false, |
|||
closeOnClickModal: false, |
|||
closeOnPressEscape: false, |
|||
type: 'warning', |
|||
customClass: 'init-message', |
|||
}, |
|||
) |
|||
const keys = [...checkMap.value.keys()] |
|||
for (let i = 0; i < keys.length; i++) { |
|||
checkList.value.push(checkMap.value.get(keys[i])) |
|||
} |
|||
}) |
|||
|
|||
let currentCommandId = '' |
|||
|
|||
const receiveMessage1 = (data: Socket.cmdData) => { |
|||
data.commandId === currentCommandId && systemStore.pushSystemList(data) |
|||
} |
|||
const receiveMessage2 = (data: Socket.cmdData) => { |
|||
data.commandId === currentCommandId && systemStore.pushSystemList(data) |
|||
const item = checkList.value.find(item => item.params.commandId === data.commandId) |
|||
if (item && data.commandId === item.params.commandId && ['success', 'error'].includes(data.status)) { |
|||
item.status = data.status |
|||
} |
|||
} |
|||
|
|||
const commandHandle = async (data: any) => { |
|||
data.params.commandId = currentCommandId = Date.now().toString() |
|||
await homeStore.sendControl(data!.params) |
|||
} |
|||
|
|||
const onConfirm = async () => { |
|||
await getSelfFinish(true) |
|||
emits('close') |
|||
} |
|||
|
|||
const percentage = ref(0) |
|||
|
|||
const checkHandle = async () => { |
|||
activeStep.value = 1 |
|||
await ElMessageBox.confirm( |
|||
'设备即将开始自检', |
|||
'提示', |
|||
{ |
|||
confirmButtonText: '确认', |
|||
showClose: false, |
|||
showCancelButton: false, |
|||
closeOnClickModal: false, |
|||
closeOnPressEscape: false, |
|||
type: 'warning', |
|||
customClass: 'init-message', |
|||
}, |
|||
) |
|||
currentCommandId = Date.now().toString() |
|||
const params = { |
|||
commandId: currentCommandId, |
|||
command: 'check_move_test', |
|||
params: {}, |
|||
} |
|||
await homeStore.sendControl(params) |
|||
} |
|||
|
|||
const checkTextList = ref<{ title: string, type: 'success' | 'error' }[]>([]) |
|||
|
|||
const selfAgain = ref(true) |
|||
const receiveMessageSelfMove = (data: any) => { |
|||
checkTextList.value.push(data) |
|||
percentage.value = data.schedule |
|||
if (data.type === 'error') { |
|||
selfAgain.value = true |
|||
} |
|||
} |
|||
const activeStep = ref(0) |
|||
|
|||
const checkAgain = async () => { |
|||
selfAgain.value = false |
|||
checkTextList.value = [] |
|||
percentage.value = 0 |
|||
currentCommandId = Date.now().toString() |
|||
const params = { |
|||
commandId: currentCommandId, |
|||
command: 'check_move_test', |
|||
params: {}, |
|||
} |
|||
await homeStore.sendControl(params) |
|||
selfAgain.value = true |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<FtDialog visible title="设备初始化" width="60%"> |
|||
<!-- <el-steps style="max-width: 600px" :active="activeStep" finish-status="success"> |
|||
<el-step title="初始化" /> |
|||
<el-step title="自检" /> |
|||
<el-step title="设备状态" /> |
|||
</el-steps> --> |
|||
<div v-if="activeStep === 0" class="check-main"> |
|||
<div v-for="item in checkList" :key="item.name" class="check-item"> |
|||
<el-tag>{{ item.name }}</el-tag> |
|||
<el-icon v-if="item.status === 'success'" color="#26D574"> |
|||
<CircleCheckFilled /> |
|||
</el-icon> |
|||
<el-icon v-else-if="item.status === 'error'" color="#FE0A0A"> |
|||
<CircleCloseFilled /> |
|||
</el-icon> |
|||
<el-icon v-else-if="item.status === ''" class="el-icon--loading"> |
|||
<Loading /> |
|||
</el-icon> |
|||
<el-icon v-else-if="item.status === 'ignore'"> |
|||
<More /> |
|||
</el-icon> |
|||
<ft-button v-if="!['ignore', 'success'].includes(item.status)" type="primary" size="small" :click-handle="() => commandHandle(item)"> |
|||
回原点 |
|||
</ft-button> |
|||
<!-- <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)"> |
|||
取消忽略 |
|||
</ft-button> --> |
|||
</div> |
|||
</div> |
|||
<div v-if="activeStep === 1" class="check-box"> |
|||
<div class="progress-box"> |
|||
<p>自检进度: </p> |
|||
<el-progress |
|||
:stroke-width="20" |
|||
:percentage="percentage" |
|||
/> |
|||
</div> |
|||
<ul> |
|||
<li v-for="(item, index) in checkTextList" :key="index"> |
|||
<span :style="{ color: item.type === 'success' ? '#14A656' : '#DF1515' }">{{ item.title }}</span> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
|
|||
<template #footer> |
|||
<div style="height: 40px"> |
|||
<FtButton v-if="activeStep === 0 && checkList.every(item => ['success', 'ignore'].includes(item.status))" type="primary" :click-handle="checkHandle"> |
|||
下一步 |
|||
</FtButton> |
|||
<FtButton v-if="activeStep === 1 && selfAgain" type="primary" :click-handle="checkAgain"> |
|||
重新自检 |
|||
</FtButton> |
|||
<FtButton v-if="activeStep === 1" :click-handle="onConfirm"> |
|||
关闭 |
|||
</FtButton> |
|||
</div> |
|||
</template> |
|||
</FtDialog> |
|||
</template> |
|||
|
|||
<style scoped> |
|||
.check-box { |
|||
height: 30vh; |
|||
ul { |
|||
li { |
|||
margin: 3px 0; |
|||
} |
|||
} |
|||
} |
|||
.progress-box { |
|||
width: 100%; |
|||
height: 40px; |
|||
display: flex; |
|||
align-items: center; |
|||
p { |
|||
margin-right: 10px; |
|||
} |
|||
span { |
|||
margin-left: 10px; |
|||
} |
|||
.el-progress { |
|||
width: 80%; |
|||
} |
|||
} |
|||
.check-main{ |
|||
height: 25vh; |
|||
overflow: auto; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: flex-start; |
|||
margin-top: 20px; |
|||
} |
|||
|
|||
.check-item { |
|||
width: 100%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
margin-bottom: 10px; |
|||
.el-tag { |
|||
width: 50%; |
|||
} |
|||
.el-icon { |
|||
margin: 0 10px; |
|||
font-size: 18px; |
|||
} |
|||
} |
|||
|
|||
.check-status{ |
|||
display: grid; |
|||
grid-template-columns: 2fr 1fr 1fr; |
|||
margin-top: 5px; |
|||
height: 30px; |
|||
} |
|||
@keyframes spin { |
|||
0% { |
|||
transform: rotate(0deg); |
|||
} |
|||
100% { |
|||
transform: rotate(360deg); |
|||
} |
|||
} |
|||
|
|||
.el-icon.el-icon--loading { |
|||
animation: spin 1s linear infinite; |
|||
} |
|||
.ft-button { |
|||
width:120px |
|||
} |
|||
</style> |
@ -1,53 +0,0 @@ |
|||
<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 lang="pug"> |
|||
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="请输入值") |
|||
</template> |
|||
|
|||
<style scoped lang="stylus"> |
|||
.el-tag |
|||
margin-right 5px |
|||
</style> |
@ -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 |
|||
} |
|||
|
|||
} |
@ -1,12 +0,0 @@ |
|||
declare namespace Exit { |
|||
interface ExitModal { |
|||
openModal: () => void |
|||
} |
|||
|
|||
interface Axis { |
|||
name: string |
|||
icon: string |
|||
value: 'x' | 'y' | 'z' |
|||
color: string |
|||
} |
|||
} |
@ -1,11 +0,0 @@ |
|||
declare namespace Point { |
|||
interface Point extends UpdateParams { |
|||
name: string |
|||
code: string |
|||
type: string |
|||
} |
|||
interface UpdateParams { |
|||
id?: number |
|||
position?: string |
|||
} |
|||
} |
@ -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 |
|||
} |
|||
} |
@ -1,61 +0,0 @@ |
|||
<script setup lang="ts"> |
|||
import { getSolsList } from 'apis/solution' |
|||
import { onMounted, ref } from 'vue' |
|||
import { getChannelList } from '@/apis/channel' |
|||
|
|||
onMounted(async () => { |
|||
await getList() |
|||
await getSolutionList() |
|||
}) |
|||
|
|||
const channelList = ref<Channel.ChannelItem[]>([]) |
|||
|
|||
const solutionList = ref<Solution.SolutionItem[]>([]) |
|||
|
|||
const getList = async () => { |
|||
channelList.value = await getChannelList() |
|||
} |
|||
|
|||
const getSolutionList = async () => { |
|||
solutionList.value = (await getSolsList()).list |
|||
} |
|||
</script> |
|||
|
|||
<template lang="pug"> |
|||
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") 确认修改 |
|||
</template> |
|||
|
|||
<style scoped lang="stylus"> |
|||
.home-container |
|||
background transparent !important |
|||
box-shadow none !important |
|||
padding 150px 30px !important |
|||
display grid |
|||
grid-template-columns 1fr 1fr 1fr 1fr |
|||
gap 50px |
|||
.el-card |
|||
display flex |
|||
flex-direction column |
|||
border-radius 20px |
|||
:deep(.el-card__header) |
|||
background rgba(0, 65, 124, 0.05) |
|||
text-align center |
|||
padding 10px |
|||
:deep(.el-card__body) |
|||
flex 1 |
|||
.content-box { |
|||
height 100% |
|||
width 100% |
|||
display flex |
|||
flex-direction column |
|||
align-items center |
|||
justify-content space-evenly |
|||
} |
|||
</style> |
@ -1,438 +0,0 @@ |
|||
<script lang="ts" setup> |
|||
import { socket } from 'libs/socket' |
|||
import { cmdNameMap, formatDateTime } from 'libs/utils' |
|||
import { useDebugStore } from 'stores/debugStore' |
|||
import { useSystemStore } from 'stores/systemStore' |
|||
import { onMounted, onUnmounted, ref } from 'vue' |
|||
|
|||
const systemStore = useSystemStore() |
|||
|
|||
const debugStore = useDebugStore() |
|||
|
|||
let currentCommandId = '' |
|||
|
|||
onMounted(() => { |
|||
socket.init(receiveMessage, 'cmd_debug') |
|||
socket.init(receiveMessage, 'cmd_response') |
|||
}) |
|||
|
|||
onUnmounted(() => { |
|||
socket.unregisterCallback(receiveMessage, 'cmd_debug') |
|||
socket.unregisterCallback(receiveMessage, 'cmd_response') |
|||
}) |
|||
|
|||
const receiveMessage = (data: Socket.cmdData) => { |
|||
data.commandId === currentCommandId && systemStore.pushSystemList(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() }) |
|||
} |
|||
} |
|||
|
|||
const savePositionVisible = ref(false) |
|||
|
|||
const commandHandle = async (command: string, params?: unknown) => { |
|||
currentCommandId = Date.now().toString() |
|||
const data = { |
|||
commandId: currentCommandId, |
|||
command, |
|||
params, |
|||
} |
|||
await debugStore.sendControl(data) |
|||
} |
|||
</script> |
|||
|
|||
<template lang="pug"> |
|||
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") |
|||
</template> |
|||
|
|||
<style lang="stylus" scoped> |
|||
.debug-content |
|||
overflow hidden |
|||
max-height 100% |
|||
.button-content |
|||
height 40px |
|||
.card-content |
|||
height calc(100% - 40px) |
|||
overflow auto |
|||
|
|||
.el-card |
|||
margin-bottom 10px |
|||
|
|||
:deep(.el-card__header) |
|||
padding 5px 10px |
|||
background rgba(0, 0, 0, 0.03) |
|||
|
|||
.el-input, .el-select |
|||
width 100% |
|||
|
|||
.el-form-item |
|||
margin-bottom 10px |
|||
margin-right 0 |
|||
|
|||
.card-header |
|||
display flex |
|||
align-items center |
|||
justify-content space-between |
|||
|
|||
.select-label |
|||
margin-right 10px |
|||
|
|||
:deep(.el-card__body) |
|||
padding 10px 5px |
|||
|
|||
.el-form-item__content |
|||
.ft-button |
|||
margin-bottom 10px |
|||
|
|||
.button-box |
|||
display flex |
|||
justify-content center |
|||
|
|||
:deep(.el-form-item).button-center |
|||
.el-form-item__content |
|||
width 100% |
|||
display flex |
|||
justify-content center |
|||
|
|||
.stop-button |
|||
margin-right 8px |
|||
font-weight 900 |
|||
margin-left 3px |
|||
|
|||
.el-divider |
|||
margin 15px 0 |
|||
</style> |
@ -1,59 +0,0 @@ |
|||
<script setup lang="ts"> |
|||
import { getPointList } from 'apis/point' |
|||
import Edit from 'components/point/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: '类型', |
|||
key: 'type', |
|||
}, |
|||
{ |
|||
title: '坐标', |
|||
key: 'position', |
|||
}, |
|||
] |
|||
</script> |
|||
|
|||
<template> |
|||
<div> |
|||
<FtTable ref="tableRef" :columns="columns" has-header :btn-list="btnList" :get-data-fn="getPointList" @edit="edit" /> |
|||
<Edit v-if="upDataVisible" @ok="ok" @cancel="cancel" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
</style> |
@ -1,84 +0,0 @@ |
|||
<script setup lang="ts"> |
|||
import { delUser, userList } from 'apis/user' |
|||
import Edit from 'components/user/Edit/index.vue' |
|||
import { ElMessageBox } from 'element-plus' |
|||
import { FtMessage } from 'libs/message' |
|||
import { cloneDeep } from 'lodash' |
|||
import { useSystemStore } from 'stores/systemStore' |
|||
import { useTemplateRef } from 'vue' |
|||
|
|||
const systemStore = useSystemStore() |
|||
|
|||
const btnList = systemStore.systemStatus.currentUser?.fixedUser === 'ENABLE' |
|||
? [ |
|||
{ |
|||
name: '新增', |
|||
type: 'primary', |
|||
serverUrl: 'add', |
|||
serverCondition: 0, |
|||
}, |
|||
{ |
|||
name: '编辑', |
|||
type: 'primary', |
|||
serverUrl: 'edit', |
|||
serverCondition: 1, |
|||
}, |
|||
{ |
|||
name: '删除', |
|||
type: 'danger', |
|||
serverUrl: 'del', |
|||
serverCondition: 2, |
|||
}, |
|||
] |
|||
: [] |
|||
const columns = [ |
|||
{ |
|||
type: 'selection', |
|||
selectable: (row: any) => { |
|||
return (row.fixedUser !== 'ENABLE') || row.username === systemStore.systemStatus.currentUser?.username |
|||
}, |
|||
}, |
|||
{ |
|||
title: '账号', |
|||
key: 'username', |
|||
}, |
|||
{ |
|||
title: '用户名', |
|||
key: 'nickname', |
|||
}, |
|||
] |
|||
|
|||
const tableRef = useTemplateRef('tableRef') |
|||
|
|||
const del = async (selectedRows: any) => { |
|||
const ids = selectedRows.map((item: any) => item.id) |
|||
await ElMessageBox.confirm('确定删除当前选中的行?', '消息', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning', |
|||
}) |
|||
await delUser(ids) |
|||
FtMessage.success('删除成功') |
|||
tableRef.value?.initData() |
|||
} |
|||
|
|||
const addVisible = ref(false) |
|||
|
|||
const currentData = ref({}) |
|||
const addHandle = () => { |
|||
currentData.value = {} |
|||
addVisible.value = true |
|||
} |
|||
|
|||
const editHandle = (data: any) => { |
|||
currentData.value = cloneDeep(data[0]) |
|||
console.log(currentData.value) |
|||
addVisible.value = true |
|||
} |
|||
</script> |
|||
|
|||
<template lang="pug"> |
|||
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") |
|||
</template> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue