chore(backend,frontend): 移除设备位置管理全链路功能与相关代码

- 删除后端所有机器位置相关的API接口、缓存逻辑与后台同步任务
- 移除前端的机器位置导航入口、地图页面与管理代码
- 将原机器地图页面重构为车票查询页面
- 调整Lua程序的默认版本号
- 删除无用的.gitignore文件
- 优化前端页面的代码格式与导航结构
This commit is contained in:
2026-07-11 16:05:20 +08:00
parent 4fe3a24eaf
commit 1d9f08d5c6
14 changed files with 112 additions and 448 deletions
+3 -20
View File
@@ -22,8 +22,8 @@ const pool = mysql.createPool({
});
const DEFAULT_LUA_VERSIONS = {
ticketmachine: 'v1.5.18',
gate: 'v1.5.18'
ticketmachine: 'v1.5.8',
gate: 'v1.5.8'
};
function normalizeLuaVersions(input) {
@@ -64,8 +64,7 @@ const cache = {
icCardIndex: {},
icCardEvents: [],
statsTicket: [],
statsGate: [],
machineLocations: {}
statsGate: []
};
const DataService = {
@@ -95,9 +94,6 @@ const DataService = {
if (configs.length > 0) cache.config = normalizeConfig(configs[0].v);
else await conn.query('INSERT INTO kv_store (k, v) VALUES (?, ?)', ['config', JSON.stringify(cache.config)]);
const [machLocs] = await conn.query('SELECT v FROM kv_store WHERE k = ?', ['machine_locations']);
if (machLocs.length > 0) cache.machineLocations = machLocs[0].v || {};
const [stations] = await conn.query('SELECT data FROM stations');
cache.stations = stations.map(r => r.data);
@@ -526,19 +522,6 @@ const DataService = {
}),
saveExport: () => {
try { fs.writeFileSync(paths.export, JSON.stringify(DataService.buildExportPayload(), null, 2)); } catch(e){}
},
getMachineLocations: () => cache.machineLocations,
updateMachineLocation: async (deviceId, data) => {
cache.machineLocations[deviceId] = {
...cache.machineLocations[deviceId],
...data,
last_update_ts: Date.now()
};
try {
await pool.query('INSERT INTO kv_store (k, v) VALUES (?, ?) ON DUPLICATE KEY UPDATE v = VALUES(v)',
['machine_locations', JSON.stringify(cache.machineLocations)]);
} catch(e) { console.error('updateMachineLocation error', e); }
}
};