CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
PadBrowse is a Uni-app manufacturing execution system (MES) application designed for industrial control machines and tablets used in injection molding production lines. It's developed for Guangshen Technology's manufacturing operations.
Framework and Technology Stack
- Framework: Uni-app (Vue 2)
- Build Target: App-Plus (Android/iOS native apps)
- State Management: Vuex
- UI Components: Uni-UI components library + custom components
- Languages: JavaScript, Vue.js, SCSS/CSS
- Key Modules: Camera, Barcode scanning, Bluetooth printing
Build and Development Commands
This is a Uni-app project built for native mobile platforms. Use HBuilderX IDE or Uni-app CLI for development:
Development (local testing):
- Open project in HBuilderX and use built-in preview/debugging tools
- For Android development: Build > Native App-Cloud Packaging
- For local debugging: Run > Run to Mobile Device
Key Development URLs:
- Local debug API: http://localhost:63775/api
- Internal network API: http://192.168.0.94:10055/api
- Server health check: http://192.168.11.251:10054
No traditional npm scripts - this project uses Uni-app's build system through HBuilderX or uni CLI.
Architecture Overview
Core Application Flow
- Device Identification: App auto-detects device MAC address (
store/index.js:14)
- Work Order Management: Multi-work order selection with mold consistency validation
- Production Operations: Tab-based interface for different manufacturing processes
- Data Synchronization: Real-time sync with backend MES system via RESTful APIs
Key API Endpoints
- Device info:
/DevMachine/GetDevMachineByPdaMac
- Work orders:
/Womdaa/GetWomdaasByShow
- Order selection:
/MesOrderSelect/Add and /MesOrderSelect/Remove
- Stored procedures:
/b/esp endpoint
Tab Structure (pages/index.vue)
- Tab 7: Work Order Selection - Multi-order selection with mold validation
- Tab 0: Main Interface - Work order details and production monitoring
- Tab 1: Start/Finish Work - Production time tracking
- Tab 2: Mold Change - Mold management operations
- Tab 3: Machine Adjustment & Inspection - Equipment tuning and QC
- Tab 4: Barcode Printing & Reporting - Production quantity reporting
- Tab 5: e-SOP - Standard operating procedures (PDF viewer)
- Tab 6: Process Parameters - Production parameter management
- Tab 8: Printer Settings - Bluetooth printer configuration
Component Architecture
- WorkOrder.vue: Main production interface component
- WorkOrderStatus.vue: Start/finish work operations
- WorkOrderPrint.vue: Barcode printing and reporting
- PrintInit.vue: Printer setup and Bluetooth connection
- Technology.vue: Process parameter management
- PDFShow.vue: e-SOP document viewer
- mold.vue: Mold change operations
- machine.vue: Machine adjustment and inspection
State Management (store/index.js)
- Server configuration with internal/external network switching
- Primary API endpoint configuration for different environments
- Network status and connection management
Utility Functions (main.js)
- HTTP Requests:
$post, $get, $uni_request methods for API communication
- Authentication:
$login, $logout, user session management
- UI Helpers:
$showMessage, $showDialog for user notifications
- File Operations:
$camera, $fileUpload for image handling
- Date Utilities:
$getDate with multiple format support
Bluetooth Integration (utils/bluetooth.js)
- Native Android Bluetooth API integration via plus.android
- CPCL printing protocol support for industrial printers
- Device pairing and connection management
Key Development Considerations
- App targets Android industrial control machines with specific screen resolutions (1280x800, 1920x1080)
- Device MAC address is critical for machine binding and identification
- Offline capability with local data caching and sync mechanisms
- Auto-update functionality with APK download and silent installation
- Multi-work order support limited to 4 simultaneous orders with same mold requirements
Environment Configuration
- Configure
serverAPI in store for backend API endpoint
- Set device
pdaMac for machine identification
- Update
machineNo for production line assignment
- Bluetooth and camera permissions required for full functionality
File Structure Notes
components/: Production-specific Vue components for different manufacturing operations
utils/: Bluetooth, printing, scanning, and messaging utilities
common/: Global mixins, permissions, and utility functions
static/img/imgMenu/: Extensive collection of production operation icons and images
uni_modules/: Uni-app plugin ecosystem components
unpackage/: Build output and distribution files