TMS Ship Entry — Auto-Fill for Shipping Management System
Overview
Extract 14 fields from 5 certificate images (Ownership/AIS/Nationality/Inspection/Operating) and auto-fill into the TMS system's "New Ship" modal form via xbrowser CDP.
Trigger Scenarios
- User uploads 5 ship certificate images
- User says "录入这艘船" (enter this ship) + images
- User says "新增" or a ship name (modal already open)
Required Setup
powershell -ExecutionPolicy Bypass -File setup.ps1
This auto-detects the QClaw install path and sets QCLAW_HOME environment variable.
Dependencies
- QClaw runtime + xbrowser skill (browser: Edge)
tms-ship-entryskill installed- Edge browser logged into TMS (https://tms.dljsq.com)
- Account: 卢洁
File Structure
scripts/config.ps1— QClaw path auto-detectionscripts/tms_fill.js— browser IIFE template (label-based field finder + React-compatible setter)scripts/tms_fill.ps1— main dispatch: click "新增" → detect modal → fill 14 fields → parse logscripts/tms_verify.ps1— debug: read back actual field values from modalscripts/fill_ship.bat— double-click wrapperdata/tms_ships.ps1— ship data hashtable (add new ships here)docs/TMS船舶录入完整工作流.md— Chinese detailed docs
Quick Start
# 1. Add ship to data file (edit tms_ships.ps1)
# 2. Open TMS "新增" modal in Edge
# 3. Auto-fill:
powershell -ExecutionPolicy Bypass -File scripts/tms_fill.ps1 -Ship "港航润杨6023"
# 4. Manual: ship type, carrier name, 6×images, submit
Known Caveats
- Always scope to
.ant-modal-body— top search bar has duplicate fields - Dimension field label is "船舶尺度(长×宽×深)" not inside
.ant-form-item atob()alone corrupts UTF-8 — useTextDecoder().decode(Uint8Array.from(atob(b64),...)).ps1files must be UTF-8 with BOM- Set
[Console]::OutputEncoding = UTF8before capturing xbrowser output