fix(ticketmachine): 修复站点缓存与匹配问题,优化数据处理逻辑
- 配置更新时清空singleSegments缓存,确保UI重新渲染 - 支持stations、stops、站点列表、站点四种站点列表键名 - 为站点与票价代码添加标准化处理,提升跨格式匹配准确性 - 同步更新线路选择渲染的站点列表提取逻辑 - 新增test-db.js测试脚本用于数据服务验证 - 新增空的data.json文件作为数据存储占位
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
const DataService = require('./server/services/data');
|
||||
async function run() {
|
||||
try {
|
||||
await DataService.init();
|
||||
const lines = DataService.getLines();
|
||||
console.log("Line 0 stops:", lines[0]?.stops, lines[0]?.['站序'], lines[0]?.['站点列表']);
|
||||
console.log("Line 0 name:", lines[0]?.name, lines[0]?.['线路名称']);
|
||||
const fares = DataService.getFares();
|
||||
console.log("Fare 0:", fares[0]);
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
run();
|
||||
Reference in New Issue
Block a user