Initial commit: Epson ePOS Node backend + Vue3 UI (printer matricial2)
This commit is contained in:
60
README.md
Normal file
60
README.md
Normal file
@@ -0,0 +1,60 @@
|
||||
Printer Central (Epson ePOS)
|
||||
|
||||
Resumen
|
||||
- Backend Node.js que envía comandos ePOS-Print vía SOAP a una impresora Epson configurada en HTTPS con certificado autofirmado.
|
||||
- Frontend Vue 3 (Vite) con glassmorphism en escala de grises para escribir texto y activar funciones: alineación, fuente, tamaño, estilos, feed, corte, cajón, QR y código de barras. También permite componer un lote de operaciones genéricas.
|
||||
|
||||
Requisitos
|
||||
- Node.js 18+ (probado con v22) y npm.
|
||||
|
||||
Instalación y ejecución
|
||||
1) Instalar dependencias:
|
||||
npm install
|
||||
|
||||
2) Configurar destino (opcional, valores por defecto entre paréntesis):
|
||||
export PRINTER_HOST=192.168.87.147 # IP/DNS de la impresora
|
||||
export PRINTER_DEVICE_ID=matricial2 # DeviceId
|
||||
export PRINTER_TIMEOUT_MS=60000 # Timeout ePOS
|
||||
|
||||
3) Desarrollo con hot reload (cliente + servidor):
|
||||
npm run dev
|
||||
|
||||
- Frontend (Vite + Vue 3) en http://localhost:5173
|
||||
- Proxy /api → http://localhost:3030 (Express)
|
||||
- El servidor se recarga con nodemon al cambiar archivos en src/
|
||||
|
||||
4) Producción (build del cliente + servidor Express):
|
||||
npm run build # genera assets en public/
|
||||
npm start # sirve API y estáticos desde public/ (por defecto en :3030)
|
||||
|
||||
API principal
|
||||
- POST /api/print
|
||||
Body JSON: { operations: [ { op: string, ...attrs }, ... ] }
|
||||
Construye el cuerpo de <epos-print> según las operaciones y lo envía dentro de un sobre SOAP a:
|
||||
https://PRINTER_HOST/cgi-bin/epos/service.cgi?devid=PRINTER_DEVICE_ID&timeout=PRINTER_TIMEOUT_MS
|
||||
|
||||
Operaciones soportadas (clave op)
|
||||
- text { value }
|
||||
- textLang { lang }
|
||||
- textAlign { align: left|center|right }
|
||||
- textRotate { rotate: boolean }
|
||||
- textLineSpace { linespc }
|
||||
- textFont { font: font_a|font_b|... }
|
||||
- textSmooth { smooth: boolean }
|
||||
- textDouble { dw: boolean, dh: boolean }
|
||||
- textSize { width: 1..8, height: 1..8 }
|
||||
- textStyle { reverse?: boolean, ul?: boolean, em?: boolean, color?: color_1..color_4 }
|
||||
- textPosition { x }
|
||||
- textVPosition { y }
|
||||
- feed {}
|
||||
- feedUnit { unit }
|
||||
- feedLine { line }
|
||||
- feedPosition { pos }
|
||||
- cut { type: no_feed|feed|reserve|no_feed_fullcut|feed_fullcut|reserve_fullcut }
|
||||
- pulse { drawer?: drawer_1|drawer_2, time?: pulse_100|...|pulse_500 }
|
||||
- barcode { data, type, hri, font, width, height }
|
||||
- qrcode { data, model, level, size }
|
||||
|
||||
Notas
|
||||
- El backend desactiva la verificación TLS (self-signed) únicamente para la conexión con la impresora.
|
||||
- Si necesitas más funciones (logo/imágenes, páginas, líneas, etc.), se pueden añadir fácilmente replicando los métodos del ePOSBuilder oficial.
|
||||
Reference in New Issue
Block a user