chore(backend,frontend): 移除设备位置管理全链路功能与相关代码
- 删除后端所有机器位置相关的API接口、缓存逻辑与后台同步任务 - 移除前端的机器位置导航入口、地图页面与管理代码 - 将原机器地图页面重构为车票查询页面 - 调整Lua程序的默认版本号 - 删除无用的.gitignore文件 - 优化前端页面的代码格式与导航结构
This commit is contained in:
@@ -64,9 +64,6 @@
|
||||
<div class="nav-item" :class="{active: currentView === 'faremap'}" @click="currentView = 'faremap'">
|
||||
<span class="nav-icon"><i class="fas fa-map"></i></span> 票价地图
|
||||
</div>
|
||||
<div class="nav-item" :class="{active: currentView === 'machinemap'}" @click="currentView = 'machinemap'">
|
||||
<span class="nav-icon"><i class="fas fa-map-marker-alt"></i></span> 机器位置
|
||||
</div>
|
||||
<div class="nav-item" :class="{active: currentView === 'tickets'}" @click="currentView = 'tickets'">
|
||||
<span class="nav-icon"><i class="fas fa-ticket-alt"></i></span> 车票记录
|
||||
</div>
|
||||
@@ -644,99 +641,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 机器位置 -->
|
||||
<div v-if="currentView === 'machinemap'">
|
||||
<div class="card">
|
||||
<h3>设备分布图</h3>
|
||||
<p class="text-muted">机器位置与状态 (每 60 秒自动更新)</p>
|
||||
<div class="map-container" style="position: relative; width: 100%; height: 600px; background: #1a1a1a; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1);">
|
||||
<!-- We can use a simple coordinate mapping here. -->
|
||||
<!-- First, calculate bounds to normalize coordinates -->
|
||||
<div v-if="Object.keys(machineLocations).length === 0" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #666;">
|
||||
暂无机器坐标数据
|
||||
</div>
|
||||
<template v-else>
|
||||
<!-- Map markers -->
|
||||
<div v-for="(loc, id) in machineLocations" :key="id"
|
||||
class="map-marker"
|
||||
:style="{
|
||||
position: 'absolute',
|
||||
left: getMapX(loc.x) + '%',
|
||||
top: getMapY(loc.z) + '%',
|
||||
transform: 'translate(-50%, -50%)',
|
||||
cursor: 'pointer',
|
||||
zIndex: selectedMachineId === id ? 10 : 1
|
||||
}"
|
||||
@click="selectedMachineId = id"
|
||||
>
|
||||
<div :class="['marker-icon', loc.type === 'Gate' ? 'gate' : 'ticket']"
|
||||
:style="{
|
||||
width: '20px', height: '20px', borderRadius: '50%',
|
||||
background: loc.type === 'Gate' ? '#ff9800' : '#4ade80',
|
||||
border: '2px solid #fff',
|
||||
boxShadow: '0 0 10px rgba(0,0,0,0.5)'
|
||||
}">
|
||||
</div>
|
||||
<div v-if="selectedMachineId === id" class="marker-popup"
|
||||
style="position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); background: #333; padding: 10px; border-radius: 6px; width: max-content; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 20; color: white; text-align: center;">
|
||||
<div style="font-weight: bold; margin-bottom: 4px;">{{ loc.device_id || id }}</div>
|
||||
<div style="font-size: 0.85em; color: #aaa;">类型: {{ loc.type === 'Gate' ? '检票机' : '售票机' }}</div>
|
||||
<div v-if="loc.type === 'Gate'" style="font-size: 0.85em; color: #aaa;">
|
||||
模式: {{ loc.gate_mode === 'entry' ? '进站' : (loc.gate_mode === 'exit' ? '出站' : '双向') }}
|
||||
</div>
|
||||
<div style="font-size: 0.85em; color: #aaa;">站点: {{ loc.station || loc.station_code || '未知' }}</div>
|
||||
<div style="font-size: 0.8em; color: #888; margin-top: 4px;">坐标: {{ loc.x }}, {{ loc.y }}, {{ loc.z }}</div>
|
||||
<div style="margin-top: 8px;">
|
||||
<button class="btn sm primary" @click.stop="openEditMachineModal(id)">编辑</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 编辑机器位置 Modal -->
|
||||
<div v-if="showEditMachineModal" class="jr-admin-modal-overlay" @click.self="showEditMachineModal = false">
|
||||
<div class="jr-admin-modal">
|
||||
<div class="jr-admin-modal-header">
|
||||
<h3>编辑设备位置 - {{ editMachineForm.device_id }}</h3>
|
||||
<button class="jr-admin-modal-close" @click="showEditMachineModal = false"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<div class="jr-admin-modal-body">
|
||||
<div class="jr-admin-form-group">
|
||||
<label>站点代码 / 名称</label>
|
||||
<input type="text" v-model="editMachineForm.station_code" class="jr-admin-input">
|
||||
</div>
|
||||
<div class="jr-admin-form-group" style="display: flex; gap: 10px;">
|
||||
<div style="flex: 1;">
|
||||
<label>X 坐标</label>
|
||||
<input type="number" v-model="editMachineForm.x" class="jr-admin-input">
|
||||
</div>
|
||||
<div style="flex: 1;">
|
||||
<label>Y 坐标</label>
|
||||
<input type="number" v-model="editMachineForm.y" class="jr-admin-input">
|
||||
</div>
|
||||
<div style="flex: 1;">
|
||||
<label>Z 坐标</label>
|
||||
<input type="number" v-model="editMachineForm.z" class="jr-admin-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="jr-admin-form-group">
|
||||
<label>类型</label>
|
||||
<select v-model="editMachineForm.type" class="jr-admin-input">
|
||||
<option value="TicketMachine">售票机</option>
|
||||
<option value="Gate">检票机</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jr-admin-modal-footer">
|
||||
<button class="btn" @click="showEditMachineModal = false">取消</button>
|
||||
<button class="btn primary" @click="saveMachineLocation">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 车票记录 -->
|
||||
<div v-if="currentView === 'tickets'">
|
||||
<div class="grid">
|
||||
|
||||
Reference in New Issue
Block a user