机型配置
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>设置 - AGV 拍摄系统</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css?v=20260514m">
|
||||
<link rel="stylesheet" href="/static/css/style.css?v=20260515a">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
@@ -70,63 +70,54 @@
|
||||
<section class="card">
|
||||
<h2>📦 机型配置</h2>
|
||||
|
||||
<!-- 添加新机型 -->
|
||||
<div class="form-section" style="background:#1a2332;padding:16px;border-radius:8px;margin-bottom:20px">
|
||||
<h3 style="margin-top:0">添加新机型</h3>
|
||||
<div class="form-row">
|
||||
<div class="form-group" style="flex:1">
|
||||
<label>机型名称</label>
|
||||
<input type="text" v-model="newModelName" placeholder="例如:SMT-A" style="width:100%;padding:8px;border:1px solid #2a3441;border-radius:4px">
|
||||
</div>
|
||||
<div class="form-group" style="flex:1">
|
||||
<label>机型ID(数值)</label>
|
||||
<input type="number" v-model.number="newModelId" placeholder="例如:100" style="width:100%;padding:8px;border:1px solid #2a3441;border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group" style="flex:1">
|
||||
<label>描述</label>
|
||||
<input type="text" v-model="newModelDesc" placeholder="描述信息" style="width:100%;padding:8px;border:1px solid #2a3441;border-radius:4px">
|
||||
</div>
|
||||
<div class="form-group" style="flex:1">
|
||||
<label>备注</label>
|
||||
<input type="text" v-model="newModelNotes" placeholder="备注信息" style="width:100%;padding:8px;border:1px solid #2a3441;border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary" @click="addModel" style="margin-top:8px">➕ 添加机型</button>
|
||||
<!-- 添加机型按钮 -->
|
||||
<div style="display:flex;justify-content:flex-end;margin-bottom:16px">
|
||||
<button class="btn btn-primary" @click="showAddModelModal = true">➕ 添加机型</button>
|
||||
</div>
|
||||
|
||||
<!-- 机型列表 -->
|
||||
<!-- 机型表格列表 -->
|
||||
<div v-if="models.length === 0" style="text-align:center;color:#9aa0a6;padding:40px">
|
||||
<p>暂无机型配置,请添加新机型</p>
|
||||
<p>暂无机型配置,请点击上方按钮添加</p>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<div v-for="m in models" :key="m.id" style="border:1px solid #2a3441;border-radius:8px;margin-bottom:20px;overflow:hidden">
|
||||
<!-- 机型头部 -->
|
||||
<div style="background:#1b3a2f;padding:12px 16px;display:flex;justify-content:space-between;align-items:center">
|
||||
<div>
|
||||
<strong style="font-size:16px">{% raw %}{ m.name }{% endraw %}</strong>
|
||||
<span style="margin-left:12px;color:#9aa0a6;font-size:13px">ID: {% raw %}{ m.id }{% endraw %}</span>
|
||||
<span v-if="m.description" style="margin-left:12px;color:#9aa0a6;font-size:13px">{% raw %}{ m.description }{% endraw %}</span>
|
||||
<span v-if="m.notes" style="margin-left:12px;color:#9aa0a6;font-size:13px">【{% raw %}{ m.notes }{% endraw %}】</span>
|
||||
</div>
|
||||
<div style="display:flex;gap:8px">
|
||||
<button class="btn btn-danger btn-small" @click="deleteModel(m.id)">🗑️ 删除机型</button>
|
||||
</div>
|
||||
</div>
|
||||
<table v-else style="width:100%;border-collapse:collapse;margin-bottom:16px">
|
||||
<thead>
|
||||
<tr style="background:#1a2332;text-align:left">
|
||||
<th style="padding:10px 12px;border-bottom:1px solid #2a3441;color:#9aa0a6;font-size:13px">ID</th>
|
||||
<th style="padding:10px 12px;border-bottom:1px solid #2a3441;color:#9aa0a6;font-size:13px">机型名称</th>
|
||||
<th style="padding:10px 12px;border-bottom:1px solid #2a3441;color:#9aa0a6;font-size:13px">描述</th>
|
||||
<th style="padding:10px 12px;border-bottom:1px solid #2a3441;color:#9aa0a6;font-size:13px">备注</th>
|
||||
<th style="padding:10px 12px;border-bottom:1px solid #2a3441;color:#9aa0a6;font-size:13px;text-align:center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="m in models" :key="m.id" style="border-bottom:1px solid #1a2332">
|
||||
<td style="padding:10px 12px">{% raw %}{{ m.id }}{% endraw %}</td>
|
||||
<td style="padding:10px 12px"><strong>{% raw %}{{ m.name }}{% endraw %}</strong></td>
|
||||
<td style="padding:10px 12px;color:#9aa0a6">{% raw %}{{ m.description || '—' }}{% endraw %}</td>
|
||||
<td style="padding:10px 12px;color:#9aa0a6">{% raw %}{{ m.notes || '—' }}{% endraw %}</td>
|
||||
<td style="padding:10px 12px;text-align:center;white-space:nowrap">
|
||||
<button class="btn btn-secondary btn-small" @click="expandedModelId = expandedModelId === m.id ? null : m.id">🤲 姿态</button>
|
||||
<button class="btn btn-danger btn-small" @click="deleteModel(m.id)" style="margin-left:6px">🗑️ 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 姿态展开面板 -->
|
||||
<div v-if="expandedModelId" style="border:1px solid #2a3441;border-radius:8px;overflow:hidden;margin-bottom:16px">
|
||||
<div v-for="m in models.filter(m => m.id === expandedModelId)" :key="m.id">
|
||||
<!-- 正面姿态 -->
|
||||
<div style="padding:16px;background:#0f1923">
|
||||
<h4 style="margin:0 0 12px 0;color:#388e3c">🟢 正面姿态</h4>
|
||||
<div v-for="pose in m.poses.filter(p => p.photo_type === 'front')" :key="pose.id" style="background:#0f1923;padding:12px;border-radius:6px;margin-bottom:8px">
|
||||
<div v-for="pose in m.poses.filter(p => p.photo_type === 'front')" :key="pose.id" style="background:#0f1923;padding:12px;border:1px solid #2a3441;border-radius:6px;margin-bottom:8px">
|
||||
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px">
|
||||
<strong>{% raw %}{ pose.name or '正面姿态' }{% endraw %}</strong>
|
||||
<strong>{% raw %}{{ pose.name || '正面姿态' }}{% endraw %}</strong>
|
||||
<button class="btn btn-danger btn-small" @click="deletePose(m.id, pose.id)">删除</button>
|
||||
</div>
|
||||
<div style="display:flex;gap:8px;flex-wrap:wrap">
|
||||
<div v-for="j in 6" :key="j" style="display:flex;align-items:center;gap:4px">
|
||||
<span style="font-size:12px;color:#9aa0a6">J{% raw %}{ j }{% endraw %}</span>
|
||||
<div v-for="j in 6" :key="j" style="display:flex;align-items:center;gap:4px">
|
||||
<span style="font-size:12px;color:#9aa0a6">J{% raw %}{{ j }}{% endraw %}</span>
|
||||
<button class="btn btn-small" @click="adjustPoseAngle(m.id, pose.id, j-1, -0.5)" style="width:24px;height:24px;padding:0;font-size:12px">-</button>
|
||||
<input type="number" step="0.5"
|
||||
:value="pose.arm_angles && pose.arm_angles[j-1] !== undefined ? pose.arm_angles[j-1] : 0"
|
||||
@@ -135,13 +126,12 @@
|
||||
<button class="btn btn-small" @click="adjustPoseAngle(m.id, pose.id, j-1, 0.5)" style="width:24px;height:24px;padding:0;font-size:12px">+</button>
|
||||
<span style="font-size:11px;color:#999">°</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top:8px;display:flex;gap:8px">
|
||||
<button class="btn btn-secondary btn-small" @click="refreshPoseAngles(m.id, pose.id)">🔄 刷新角度</button>
|
||||
<button class="btn btn-primary btn-small" @click="applyPoseAngles(m.id, pose.id)">✅ 应用角度</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加正面姿态 -->
|
||||
<div style="margin-top:8px">
|
||||
<div style="display:flex;gap:8px;align-items:center;flex-wrap:wrap">
|
||||
<input type="text" v-model="newPoseForm[m.id + '_front']"
|
||||
@@ -152,12 +142,12 @@
|
||||
<div style="margin-top:6px;font-size:12px;color:#9aa0a6">
|
||||
当前机械臂角度:
|
||||
<span v-if="currentAngles && currentAngles.length">
|
||||
J{% raw %}{ currentAngles[0] ? currentAngles[0].toFixed(1) : '—' }{% endraw %}°
|
||||
J{% raw %}{ currentAngles[1] ? currentAngles[1].toFixed(1) : '—' }{% endraw %}°
|
||||
J{% raw %}{ currentAngles[2] ? currentAngles[2].toFixed(1) : '—' }{% endraw %}°
|
||||
J{% raw %}{ currentAngles[3] ? currentAngles[3].toFixed(1) : '—' }{% endraw %}°
|
||||
J{% raw %}{ currentAngles[4] ? currentAngles[4].toFixed(1) : '—' }{% endraw %}°
|
||||
J{% raw %}{ currentAngles[5] ? currentAngles[5].toFixed(1) : '—' }{% endraw %}°
|
||||
J{% raw %}{{ currentAngles[0] ? currentAngles[0].toFixed(1) : '—' }}{% endraw %}°
|
||||
J{% raw %}{{ currentAngles[1] ? currentAngles[1].toFixed(1) : '—' }}{% endraw %}°
|
||||
J{% raw %}{{ currentAngles[2] ? currentAngles[2].toFixed(1) : '—' }}{% endraw %}°
|
||||
J{% raw %}{{ currentAngles[3] ? currentAngles[3].toFixed(1) : '—' }}{% endraw %}°
|
||||
J{% raw %}{{ currentAngles[4] ? currentAngles[4].toFixed(1) : '—' }}{% endraw %}°
|
||||
J{% raw %}{{ currentAngles[5] ? currentAngles[5].toFixed(1) : '—' }}{% endraw %}°
|
||||
</span>
|
||||
<span v-else>(未连接机械臂)</span>
|
||||
</div>
|
||||
@@ -165,16 +155,16 @@
|
||||
</div>
|
||||
|
||||
<!-- 背面姿态 -->
|
||||
<div style="padding:16px;background:#0f19238f8">
|
||||
<div style="padding:16px;background:#0d1420">
|
||||
<h4 style="margin:0 0 12px 0;color:#d32f2f">🔴 背面姿态</h4>
|
||||
<div v-for="pose in m.poses.filter(p => p.photo_type === 'back')" :key="pose.id" style="background:#0f1923;padding:12px;border-radius:6px;margin-bottom:8px">
|
||||
<div v-for="pose in m.poses.filter(p => p.photo_type === 'back')" :key="pose.id" style="background:#0f1923;padding:12px;border:1px solid #2a3441;border-radius:6px;margin-bottom:8px">
|
||||
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px">
|
||||
<strong>{% raw %}{ pose.name or '背面姿态' }{% endraw %}</strong>
|
||||
<strong>{% raw %}{{ pose.name || '背面姿态' }}{% endraw %}</strong>
|
||||
<button class="btn btn-danger btn-small" @click="deletePose(m.id, pose.id)">删除</button>
|
||||
</div>
|
||||
<div style="display:flex;gap:8px;flex-wrap:wrap">
|
||||
<div v-for="j in 6" :key="j" style="display:flex;align-items:center;gap:4px">
|
||||
<span style="font-size:12px;color:#9aa0a6">J{% raw %}{ j }{% endraw %}</span>
|
||||
<div v-for="j in 6" :key="j" style="display:flex;align-items:center;gap:4px">
|
||||
<span style="font-size:12px;color:#9aa0a6">J{% raw %}{{ j }}{% endraw %}</span>
|
||||
<button class="btn btn-small" @click="adjustPoseAngle(m.id, pose.id, j-1, -0.5)" style="width:24px;height:24px;padding:0;font-size:12px">-</button>
|
||||
<input type="number" step="0.5"
|
||||
:value="pose.arm_angles && pose.arm_angles[j-1] !== undefined ? pose.arm_angles[j-1] : 0"
|
||||
@@ -183,13 +173,12 @@
|
||||
<button class="btn btn-small" @click="adjustPoseAngle(m.id, pose.id, j-1, 0.5)" style="width:24px;height:24px;padding:0;font-size:12px">+</button>
|
||||
<span style="font-size:11px;color:#999">°</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top:8px;display:flex;gap:8px">
|
||||
<button class="btn btn-secondary btn-small" @click="refreshPoseAngles(m.id, pose.id)">🔄 刷新角度</button>
|
||||
<button class="btn btn-primary btn-small" @click="applyPoseAngles(m.id, pose.id)">✅ 应用角度</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加背面姿态 -->
|
||||
<div style="margin-top:8px">
|
||||
<div style="display:flex;gap:8px;align-items:center;flex-wrap:wrap">
|
||||
<input type="text" v-model="newPoseForm[m.id + '_back']"
|
||||
@@ -201,6 +190,36 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 添加机型 Modal -->
|
||||
<div v-if="showAddModelModal" class="modal-overlay" @click.self="showAddModelModal = false">
|
||||
<div class="modal-box" style="min-width:420px">
|
||||
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:14px">
|
||||
<h3 style="margin:0">📦 添加新机型</h3>
|
||||
<button class="btn-icon" @click="showAddModelModal = false">✕</button>
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom:12px">
|
||||
<label>机型名称</label>
|
||||
<input type="text" v-model="newModelName" placeholder="例如:SMT-A" style="width:100%;padding:8px;border:1px solid #2a3441;border-radius:4px">
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom:12px">
|
||||
<label>机型ID(数值)</label>
|
||||
<input type="number" v-model.number="newModelId" placeholder="例如:100" style="width:100%;padding:8px;border:1px solid #2a3441;border-radius:4px">
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom:12px">
|
||||
<label>描述</label>
|
||||
<input type="text" v-model="newModelDesc" placeholder="描述信息" style="width:100%;padding:8px;border:1px solid #2a3441;border-radius:4px">
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom:12px">
|
||||
<label>备注</label>
|
||||
<input type="text" v-model="newModelNotes" placeholder="备注信息" style="width:100%;padding:8px;border:1px solid #2a3441;border-radius:4px">
|
||||
</div>
|
||||
<div class="btn-row">
|
||||
<button class="btn btn-primary" @click="addModel">✅ 确认添加</button>
|
||||
<button class="btn btn-secondary" @click="showAddModelModal = false">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -520,7 +539,7 @@
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/vue3.global.prod.js?v=20260514m"></script>
|
||||
<script src="/static/js/setting.js?v=20260514m"></script>
|
||||
<script src="/static/js/vue3.global.prod.js?v=20260515a"></script>
|
||||
<script src="/static/js/setting.js?v=20260515a"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user