Browse Source

完善调试页面

feature/debug
LiLongLong 5 months ago
parent
commit
ea1d833afe
  1. 6
      .env
  2. 29
      src/services/globalCmd/cmdTypes.ts
  3. 48
      src/services/globalCmd/globalCmd.ts
  4. 64
      src/services/httpRequest.ts
  5. 43
      src/services/txn.ts
  6. 458
      src/views/debug/index.vue
  7. 15
      src/views/debug/type.ts
  8. 39
      src/views/spurtPrint/index.vue
  9. 2
      vite.config.ts

6
.env

@ -1,3 +1,3 @@
VITE_API_HOST=window.location.hostname
VITE_API_PORT=80
VITE_WS_PATH=/api/v1/app/ws/state
VITE_API_HOST=192.168.1.199
VITE_API_PORT=8090
VITE_WS_PATH=/ws

29
src/services/globalCmd/cmdTypes.ts

@ -0,0 +1,29 @@
export type OperationCmd =
| "moveMotorToPosition" // 移动电机
export type ControlType = {
valveType: string,
isOpen: Boolean
}
export type SyringeType = {
rotationSpeed: string | number,
direction: string | number,
time: string | number,
}
type PositionType = {
x:string | number
y:string | number
}
type PositionListType = [PositionType]
export type workType = {
direction: string
space: string | number
nitrogenFlowVelocity : string | number
nitrogenAirPressure : string | number
matrixFlowVelocity : string | number
voltage : string | number
height : string | number
movementSpeed : string | number
position: PositionListType
}

48
src/services/globalCmd/globalCmd.ts

@ -0,0 +1,48 @@
import httpRequest, { type BaseResponse } from "../httpRequest";
import { addTxnRecord } from "../txn";
import type { OperationCmd, ControlType, SyringeType, workType } from "./cmdTypes";
//移动电机
export function moveMotorToPosition(params: { commandName: string; params: Record<string, any> }) {
const commandId = addTxnRecord({ ...params, category: "debug" });
return httpRequest<BaseResponse<string>>({ url: "api/cmd/moveMotorToPosition", params: { ...params, commandId }, method: "POST" });
}
//切换清洗管路
export function switchThreeWayValve(params: { type: string }) {
const commandId = addTxnRecord({ ...params, category: "debug" });
return httpRequest<BaseResponse<string>>({ url: "/cmd/switchThreeWayValve", params: { ...params, commandId }, method: "POST" });
}
//氮气三路
export function controlValve(params:ControlType) {
const commandId = addTxnRecord({ ...params, category: "debug" });
return httpRequest<BaseResponse<string>>({ url: "/cmd/controlValve", params: { ...params, commandId }, method: "POST" });
}
//电压控制 开启
export function turnOnHighVoltage(params:{voltage: string | number}) {
const commandId = addTxnRecord({ ...params, category: "debug" });
return httpRequest<BaseResponse<string>>({ url: "/cmd/turnOnHighVoltage", params: { ...params, commandId }, method: "POST" });
}
//电压控制 关闭
export function turnOffHighVoltage() {
return httpRequest<BaseResponse<string>>({ url: "/cmd/turnOffHighVoltage", params: {}, method: "POST" });
}
//注射泵开启
export function turnOnSyringePump(params:SyringeType) {
return httpRequest<BaseResponse<string>>({ url: "/cmd/turnOnSyringePump", params: {...params}, method: "POST" });
}
//注射泵关闭
export function turnOffSyringePump() {
return httpRequest<BaseResponse<string>>({ url: "/cmd/turnOffSyringePump", params: {}, method: "POST" });
}
//开始喷涂
export function startWork(params:workType) {
return httpRequest<BaseResponse<string>>({ url: "/cmd/startWork", params, method: "POST" });
}

64
src/services/httpRequest.ts

@ -0,0 +1,64 @@
import { Subject } from "rxjs";
export interface BaseResponse<T = unknown> {
success: boolean;
code: string;
msg: string;
data: T;
}
type HttpReqParam = {
url: string;
method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
params?: Record<string, any>;
encode?: "form" | "json"; // 入参编码类型
headers?: Record<string, any>;
};
export type ApiException = "invalidToken" | "serverError";
const exceptionSub = new Subject<ApiException>();
export const exceptionOb = exceptionSub.asObservable();
function extHandle(res: BaseResponse) {
if (res.code === "A0230") {
// 访问令牌无效或已过期
exceptionSub.next("invalidToken");
}
return {
...res,
success: res.code === "00000",
};
}
export default async function httpRequest<T>({ url, method = "GET", params = {}, encode = "json", headers = {} }: HttpReqParam) {
const token = sessionStorage.getItem("token");
if (token) {
headers = { Authorization: token, ...headers };
}
if (method === "GET") {
const query = urlEncode(params);
const _url = query ? url + "?" + query : url;
const res = await fetch(_url, { headers });
return res.json().then(res => extHandle(res) as T);
} else {
const body = encode === "json" ? JSON.stringify(params) : urlEncode(params);
const _headers =
encode === "json"
? { "Content-Type": "application/json; charset=utf-8", ...headers }
: { "Content-Type": "application/x-www-form-urlencoded; charset=utf-8", ...headers };
const res = await fetch(url, { method, headers: _headers, body });
return res.json().then(res => extHandle(res) as T);
}
}
export function urlEncode(params?: Record<string, any>) {
let query = "";
if (params && Object.keys(params).length > 0) {
const qs = [];
for (let attr in params) {
qs.push(`${attr}=${encodeURIComponent(params[attr])}`);
}
query = qs.join("&");
}
return query;
}

43
src/services/txn.ts

@ -0,0 +1,43 @@
import type { OperationCmd } from "./globalCmd/cmdTypes";
let _lastTimestamp = 0;
export function generateTxnNo() {
const txnNo = Date.now();
// 确保前后两条指令的txn 不一样
if (txnNo !== _lastTimestamp) {
if (txnNo < _lastTimestamp) {
_lastTimestamp++;
} else {
_lastTimestamp = txnNo;
}
} else {
_lastTimestamp = txnNo + 1;
}
return _lastTimestamp;
}
type DebugCmdRecord = {
category: "debug";
commandName: string;
params: Record<string, any>;
};
type TxnRecord = Partial<DebugCmdRecord>;
const txnCmdMap: Record<string, TxnRecord> = {};
export function addTxnRecord(val: TxnRecord) {
const txn = generateTxnNo().toString();
txnCmdMap[txn] = val;
return txn;
}
export function getTxnRecord(txn: string, category: TxnRecord["category"]) {
const record = txnCmdMap[txn];
// 只有属于指定category时,才返回,且返回后删除记录,节约内存
if (record && record.category === category) {
delete txnCmdMap[txn];
return record;
}
return undefined;
}

458
src/views/debug/index.vue

@ -1,141 +1,234 @@
<template>
<main>
<div class="debug_axis">
<div class="axis">
<div>X轴</div>
<input v-model="machineryForm.x" type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[80px]" />
<div class="ml-[10px]">毫米</div>
</div>
<div class="axis ml-[100px]">
Y轴
<input v-model="machineryForm.y" type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[80px]" />
<div class="ml-[10px]">毫米</div>
</div>
<div class="axis ml-[100px]">
Z轴
<input v-model="machineryForm.z" type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[80px]" />
<div class="ml-[10px]">毫米</div>
</div>
<div class="ml-[200px]">
<el-button type="primary" @click="onMoveMachinery">移动</el-button>
</div>
<div class="ml-[20px]">
<el-tabs v-model="activeName" class="demo-tabs">
<el-tab-pane label="设备调试" name="debug"></el-tab-pane>
<el-tab-pane label="应用调试" name="app"></el-tab-pane>
</el-tabs>
</div>
<div class="debug_main">
<div class="debug_left">
<div class="mt-[10px]">
<el-row>
<el-col :span="5" class="text-right">
电压控制器
</el-col>
<el-col :span="6" class="ml-[20px]">
<input placeholder='0~5000v' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</el-col>
<el-col :span="4">
<el-button type="primary">确定</el-button>
</el-col>
</el-row>
<div v-if="activeName == 'debug'">
<div class="debug_axis">
<div class="axis">
<div>X轴</div>
<input v-model="machineryForm.X" type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[80px]" />
<div class="ml-[10px]">毫米</div>
<div class="ml-[10px]">
<el-button type="primary" @click="onMoveMachinery('X')">移动</el-button>
</div>
</div>
<div class="axis ml-[100px]">
Y轴
<input v-model="machineryForm.Y" type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[80px]" />
<div class="ml-[10px]">毫米</div>
<div class="ml-[10px]">
<el-button type="primary" @click="onMoveMachinery('Y')">移动</el-button>
</div>
</div>
<div class="axis ml-[100px]">
Z轴
<input v-model="machineryForm.Z" type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[80px]" />
<div class="ml-[10px]">毫米</div>
<div class="ml-[10px]">
<el-button type="primary" @click="onMoveMachinery('Z')">移动</el-button>
</div>
</div>
</div>
<div class="debug_main">
<div class="debug_left">
<div class="mt-[10px]">
<el-row>
<el-col :span="6" class="text-right">
电压控制器
</el-col>
<el-col :span="6" class="ml-[20px]">
<input v-model="voltageValue" placeholder='0~5000v' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</el-col>
<el-col :span="8">
<el-button type="primary" @click="onTurnOnHighVoltage">开启</el-button>
<el-button @click="onTurnOffHighVoltage">关闭</el-button>
</el-col>
</el-row>
<el-divider />
<el-row class="mt-[10px] ">
<el-col :span="4" class="text-right">
注射泵
</el-col>
<el-col :span="20">
<div class="ml-[20px]">
<input v-model="syringeForm.rotationSpeed" placeholder='转速' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />毫米/秒杀
</div>
<div class="mt-[10px] ml-[20px]">
<input v-model="syringeForm.time" placeholder='时间' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</div>
<div class="ml-[20px] mt-[10px]">
方向
<el-radio v-model="syringeForm.direction" value="0">后退</el-radio>
<el-radio v-model="syringeForm.direction" value="1">前进</el-radio>
<el-button type="primary" class="ml-[20px]" @click="onTurnOnSyringePump">开始</el-button>
<el-button type="primary" class="ml-[20px]" @click="onTurnOffSyringePump">关闭</el-button>
</div>
</el-col>
</el-row>
<el-divider />
<el-row class="mt-[10px]">
<el-col :span="6" class="text-right">
湿度
</el-col>
<el-col :span="6" class="ml-[20px]">
<input placeholder='湿度' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</el-col>
<el-col :span="4">
<el-button type="primary">确定</el-button>
</el-col>
</el-row>
<el-divider />
<el-row class="mt-[10px]">
<el-col :span="6" class="text-right">
电机速度
</el-col>
<el-col :span="7" class="ml-[20px]">
<input placeholder='速度' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
毫米
</el-col>
<el-col :span="4" class="ml-[10px]">
<el-button type="primary">确定</el-button>
</el-col>
</el-row>
<el-row class="mt-[10px]">
<el-col :span="6" class="text-right">
电机移动时间
</el-col>
<el-col :span="7" class="ml-[20px]">
<input placeholder='时间' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</el-col>
<el-col :span="4" class="ml-[10px]">
<el-button type="primary">确定</el-button>
</el-col>
</el-row>
<el-divider />
<el-row class="mt-[10px]">
<el-col :span="6" class="text-right">
推基质容量
</el-col>
<el-col :span="6" class="ml-[20px]">
<input placeholder='容量' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />ml
</el-col>
<el-col :span="4" class="ml-[10px]">
<el-button type="primary">确定</el-button>
</el-col>
</el-row>
<el-row class="mt-[10px]">
<el-col :span="6" class="text-right">
预充基质
</el-col>
<el-col :span="6" class="ml-[20px]">
<input placeholder='容量' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />ml
</el-col>
<el-col :span="4" class="ml-[10px]">
<el-button type="primary">确定</el-button>
</el-col>
</el-row>
</div>
</div>
<div class="debug_right">
<div>
<el-button type="primary">急停</el-button>
</div>
<el-divider />
<el-row class="mt-[10px] ">
<el-col :span="5" class="text-right">
注射泵
</el-col>
<el-col :span="16">
<div class="ml-[20px]">
<input placeholder='转速' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />毫米/秒杀
</div>
<div class="mt-[10px] ml-[20px]">
<input placeholder='时间' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</div>
<div class="ml-[20px] mt-[10px]">
方向
<el-radio v-model="direction" value="0">后退</el-radio>
<el-radio v-model="direction" value="1">前进</el-radio>
<el-button type="primary" class="ml-[20px]">确定</el-button>
</div>
</el-col>
</el-row>
<div>
<div>切换三通</div>
<el-button type="primary" @cick="onSwitchThreeWayValve('clean')">管路切换到基质</el-button>
<el-button type="primary" @cick="onSwitchThreeWayValve('spray')">管路切换到清洗</el-button>
</div>
<el-divider />
<el-row class="mt-[10px]">
<el-col :span="5" class="text-right">
湿度
</el-col>
<el-col :span="6" class="ml-[20px]">
<input placeholder='湿度' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</el-col>
<el-col :span="4">
<el-button type="primary">确定</el-button>
</el-col>
</el-row>
<div>
<div>气压阀</div>
<el-button type="primary" @click="onControlValve('Cleaning')">打开清洗阀</el-button>
<el-button type="primary" @click="onControlValve('Nozzle')">打开喷嘴阀</el-button>
<el-button type="primary" @click="onControlValve('Dehumidification')">打开除湿阀</el-button>
</div>
<el-divider />
<el-row class="mt-[10px]">
<el-col :span="5" class="text-right">
行间距
</el-col>
<el-col :span="6" class="ml-[20px]">
<input placeholder='行间距' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</el-col>
<el-col :span="4" class="ml-[10px]">
<el-button type="primary">确定</el-button>
</el-col>
</el-row>
<div class="mt-[10px]">
<el-button type="primary">关闭电压控制器</el-button>
</div>
<el-divider />
<el-row class="mt-[10px]">
<el-col :span="5" class="text-right">
推基质容量
</el-col>
<el-col :span="6" class="ml-[20px]">
<input placeholder='容量' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />ml
</el-col>
<el-col :span="4" class="ml-[10px]">
<el-button type="primary">确定</el-button>
</el-col>
</el-row>
<el-row class="mt-[10px]">
<el-col :span="5" class="text-right">
玻片区域
</el-col>
<el-col :span="12" class="ml-[20px]">
<div>起始坐标</div>
<div>
X:<input placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
Y:<input placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</div>
<div class="mt-[10px]">结束坐标</div>
<div class="flex">
X:<input placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
Y:<input placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
<el-button type="primary" class="ml-[10px]">确定</el-button>
</div>
</el-col>
</el-row>
<div class="h-[13rem] bg-[#f4f4f4] p-[10px]">
<div>状态反馈区</div>
</div>
</div>
</div>
<div class="debug_right">
<div>
<el-button type="primary">急停</el-button>
</div>
<el-divider />
<div>
<div>切换三通</div>
<el-button type="primary">管路切换到基质</el-button>
<el-button type="primary">管路切换到清洗</el-button>
</div>
<el-divider />
<div>
<div>气压阀</div>
<el-button type="primary">打开清洗阀</el-button>
<el-button type="primary">打开喷嘴阀</el-button>
<el-button type="primary">打开除湿阀</el-button>
</div>
<el-divider />
<div class="mt-[10px]">
<el-button type="primary">关闭电压控制器</el-button>
</div>
<el-divider />
<div class="h-[13rem] bg-[#f4f4f4] p-[10px]">
<div>状态反馈区</div>
</div>
</div>
<div v-if="activeName == 'app'">
<div class="bg-[#FBFBFB] h-[75vh] p-[10px]">
<el-row class="mt-[10px]">
<el-col :span="3" class="text-right">
开始喷涂
</el-col>
<el-col :span="12" class="ml-[20px]">
<div>喷涂方向</div>
<div>
<el-radio-group v-model="workForm.direction">
<el-radio :value="1">横向</el-radio>
<el-radio :value="2">纵向</el-radio>
</el-radio-group>
</div>
<div class="mt-[20px]">
行间距
<input v-model="workForm.space" placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
毫米
</div>
<div class="mt-[20px]">
氮气流速
<input v-model="workForm.nitrogenFlowVelocity" placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
毫米/
</div>
<div class="mt-[20px]">
氮气气压
<input v-model="workForm.matrixFlowVelocity" placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
Mp
</div>
<div class="mt-[20px]">
电压
<input v-model="workForm.voltage " placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
V
</div>
<div class="mt-[20px]">
喷针距离玻片高度
<input v-model="workForm.height " placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
毫米
</div>
<div class="mt-[20px]">
移速
<input v-model="workForm.movementSpeed" placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
毫米/
</div>
<div>起始坐标</div>
<div>
X:<input v-model="startAxis.x" placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
Y:<input v-model="startAxis.y" placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</div>
<div class="mt-[10px]">结束坐标</div>
<div class="flex">
X:<input v-model="endAxis.x" placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
Y:<input v-model="endAxis.y" placeholder='' type="text" class="border-none outline-none h-[34px] bg-[#E8ECF7] text-primary font-medium rounded-md text-lg text-center w-[100px]" />
</div>
<div class="mt-[20px] text-center">
<el-button type="primary" class="ml-[10px] w-[100px]" @click="onStartWork">&nbsp;&nbsp;&nbsp;&nbsp;</el-button>
</div>
</el-col>
</el-row>
</div>
</div>
</main>
@ -143,9 +236,24 @@
<script lang="ts" setup>
import { ref, onMounted, onUnmounted } from 'vue'
import { createWebSocket, sharedWsUrl } from "@/services/socket";
import type { MachineryType } from './type'
import type { ControlNitrogen, MachineryType, SyringeType } from './type'
import {
moveMotorToPosition,
switchThreeWayValve,
controlValve,
turnOnHighVoltage,
turnOffHighVoltage,
turnOnSyringePump,
turnOffSyringePump,
startWork
} from "@/services/globalCmd/globalCmd";
const activeName = ref('debug')
const voltageValue = ref()
const syringeForm = ref<Partial<SyringeType>>({})
const workForm = ref<Record<string, string>>({})
const startAxis = ref<any>({})
const endAxis = ref<any>({})
let subscription:any
let wsClient:any
onMounted(()=>{
//websocket
const wsClient = createWebSocket(sharedWsUrl);
@ -159,26 +267,96 @@
subscription && subscription.unsubscribe();
});
const direction = ref()
const machineryForm = ref<Partial <MachineryType>>({})
const abc = ref<Record<string,string>>({})
const onMoveMachinery = () => {
const params = machineryForm
wsClient.send(JSON.stringify(params))
const machineryForm = ref<Record<string, string>>({})
const onMoveMachinery = (axis:string) => {
if(!axis)return;
const x = parseFloat(parseFloat(machineryForm.value[axis]).toFixed(1));
console.log('x-------', x)
return;
const params = {
commandName:'moveMotorToPosition',
params: <MachineryType>{
axis,
position:parseFloat(machineryForm.value[axis])
}
}
moveMotorToPosition(params).then(res => {
console.log('-----moveMotorToPosition----res---', res)
})
}
const onSwitchThreeWayValve = (type:string) => {
switchThreeWayValve({type}).then(res => {
console.log('---onSwitchThreeWayValve---res---', res)
})
}
const onControlValve = (type:ControlNitrogen) => {
const params = {
valveType:type,
isOpen:true
}
controlValve(params).then(res => {
console.log('---onControlValve---res---', res)
})
}
//
const onTurnOnHighVoltage = () => {
turnOnHighVoltage({voltage: voltageValue.value}).then(res => {
console.log('---onTurnOnHighVoltage- 电压控制 on --res---', res)
})
}
//
const onTurnOffHighVoltage = () => {
turnOffHighVoltage().then(res => {
console.log('---onTurnOffHighVoltage- 电压控制 off--res---', res)
})
}
//
const onTurnOnSyringePump = () => {
// SyringeType
const params = <SyringeType>{
...syringeForm.value
}
turnOnSyringePump(params).then(res => {
console.log('---onTurnOffHighVoltage- 电压控制 off--res---', res)
})
}
const onTurnOffSyringePump = () => {
turnOffSyringePump().then(res => {
})
}
const onStartWork = () => {
const params = <any>{
...workForm.value,
position:<any>[
startAxis.value,
endAxis.value
]
}
console.log('params---', params)
startWork(params).then(res => {
console.log('startWork-----', startWork)
})
}
</script>
<style lang="scss" scoped>
div{
color: #0349A8;
}
button{
.el-button--primary{
background: linear-gradient(90deg, #0657c0 24%, #096ae0 101%);;
}
.debug_axis{
height: 3rem;
background: #FBFBFB;
margin-top:3.125rem;
margin-left: 3.5rem;
margin-right: 3.5rem;
border-radius: 6px;

15
src/views/debug/type.ts

@ -1,5 +1,12 @@
export type MachineryType = {
x: string | number
y: string | number
z: string | number
}
axis: string,
position: string | number
}
export type ControlNitrogen = 'Dehumidification' | 'Cleaning' | 'Nozzle'
export type SyringeType = {
rotationSpeed: string | number,
direction: string | number,
time: string | number,
}

39
src/views/spurtPrint/index.vue

@ -1,20 +1,33 @@
<template>
<main class="spurt_print">
<div class="spurt_print_btn">
<el-button>新增工艺</el-button>
<el-button>编辑</el-button>
<div class="spurt_print_btn ml-[3rem]">
<el-button type="primary">新增工艺</el-button>
<el-button type="default">编辑</el-button>
<el-button>删除</el-button>
</div>
<div class="w-[90vw] ml-[3rem] mt-[2rem] h-[70vh]">
<el-table :data="tableData" stripe style="width: 100%">
<el-table-column prop="name" label="基质名称" width="180" />
<el-table-column prop="craftName" label="工艺名称" width="180" />
<el-table-column prop="line" label="喷涂路线" />
</el-table>
</div>
</main>
<footer>
<footer class="footer">
<el-pagination class="pagination" layout="prev, pager, next" :total="50" />
</footer>
</template>
<script lang="ts" setup>
const tableData = [
{
craftName: '1',
name: '1',
line: '1',
}
]
</script>
<style lang="scss" scoped>
button{
.el-button--primary{
background: linear-gradient(90deg, #0657c0 24%, #096ae0 101%);;
}
.spurt_print{
@ -22,4 +35,16 @@
margin-top: 2rem;
}
}
.footer{
display: flex;
justify-content: end;
position: relative;
.pagination{
position: absolute;
bottom: 0;
right: 3rem;
}
}
</style>

2
vite.config.ts

@ -18,7 +18,7 @@ export default defineConfig({
port: 5175,
proxy: {
"/api": {
target: "http://192.168.1.125:8080",
target: "http://192.168.1.199:8090",
// target: "http://localhost:8080",
changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, ''),

Loading…
Cancel
Save