# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Development Commands

- `npm run dev` - Start development server (runs on http://localhost:8084)
- `npm run lint` - Run ESLint to check code quality 
- `npm run test` - Run unit tests with Mocha
- `npm run unit` - Run Karma unit tests
- `npm run e2e` - Run end-to-end tests with Nightwatch
- `npm run example` - Start example server
- `npm run release` - Publish package to npm registry

## Project Architecture

### Vue.js Version
This project uses **Vue.js 1.0.17** (legacy version). Key differences from modern Vue:
- Uses `ready()` lifecycle hook instead of `mounted()`
- Component registration is different from Vue 2/3
- Uses vue-validator for form validation instead of built-in validation

### Core Structure

**Component Library**: This is a Vue 1.x component library that provides business components for gas utility management systems. All components are globally registered and can be used directly.

**Key Directories**:
- `src/components/` - Main Vue components (80+ components)
- `src/plugins/` - Vue plugins for HTTP, routing, validation, etc.
- `src/stores/` - Data management stores (PagedList, DataModel, TreeList)
- `src/mixins/` - Reusable component behaviors
- `examples/` - Component usage examples
- `docs/` - Component documentation

### Architecture Patterns

**Global Component Registration**: All components are registered globally in `src/all.js` using `Vue.component()`, so they can be used without imports in templates.

**Plugin System**: Heavy use of Vue plugins for:
- HTTP requests (`HttpStore`, `HttpReset`, `HttpBatch`)
- Message boxes and alerts (`MessageBox`, `AlertBox`)
- File operations (`FileUpload`, `FileDownload`)
- Print functionality (`PrintPlugin`)
- Route management (`RoutePlugin`)

**Data Management**: Custom stores handle complex data operations:
- `PagedList` - Pagination and data fetching
- `DataModel` - General data processing
- `SelectStore` - Selection state management
- `TreeList` - Hierarchical data handling

**Bootstrap Integration**: Uses Bootstrap 3.3.6 with custom LESS styling and extensive customization for gas utility business themes.

### Key Components by Category

**Data Display**: `DataGrid`, `List`, `Tree`, `GridTree`, `CriteriaPaged`
**Forms**: `EntityForm`, `Criteria`, `MessageBox`, `FileUpload`
**Navigation**: `TopMenu`, `Route`, `Dynamic`, `Pager`
**Printing**: `FormPrint`, `PrintTable`, `ReportPrint`, `ExportExcel`
**Maps**: `AMap` (Gaode Maps), `AMapLocation`, `AMapTrajectory`
**Business-Specific**: `GaoPaiYi` (document scanner), `HighMeter` (meter reading), `Sign` (digital signatures)

### Development Server Configuration

The dev server (`build/dev-server.js`) runs on port 8084 with:
- Hot reload enabled
- Proxy configuration for API endpoints:
  - `/api` proxies to `http://192.168.50.67:31567`
  - `/XReportView` proxies to `http://127.0.0.1:8001`

### Testing Architecture

**Unit Tests**: Karma + Mocha + Chai setup in `test/unit/`
**E2E Tests**: Nightwatch with Selenium in `test/e2e/`
**Component Testing**: Each component has examples in `examples/[ComponentName]/`

### Legacy Dependencies

**Vue Ecosystem**: vue-resource (HTTP), vue-validator (validation), vue-strap (UI components)
**Build Tools**: Webpack 1.x, Babel 6, ESLint 3
**CSS**: LESS preprocessor with Bootstrap 3 base

## Important Notes

- This is a **legacy Vue 1.x project** - syntax and patterns differ significantly from modern Vue
- Components are business-focused for gas utility management systems
- Extensive Chinese documentation and comments throughout codebase
- All components are pre-registered globally via `all.js` initialization
- Uses custom build pipeline with Webpack 1.x (legacy tooling)