| | |
| | | <button class="btn-blue" @click="searchTool" :disabled="loadingTools">搜索</button> |
| | | </view> |
| | | <view class="tool-list"> |
| | | <button v-for="tool in filteredTools" :key="tool.no" class="tool-btn" @click="selectTool(tool)"> |
| | | <button v-for="tool in filteredTools" |
| | | :key="tool.no" |
| | | class="tool-btn" |
| | | :class="{ active: activeToolNo === tool.no }" |
| | | @click="selectTool(tool)"> |
| | | {{ tool.no }} | {{ tool.name }} |
| | | </button> |
| | | </view> |
| | |
| | | return { |
| | | machineNo: '',//机台编码 |
| | | workOrderNo: '',//工单号 |
| | | activeToolNo: '', // 当前选中的刀具编号 |
| | | pageIndex: 1, |
| | | pageSize: 18, |
| | | total: 0, |
| | |
| | | this.selectedToolNo = tool.no; |
| | | this.toolName = tool.name; |
| | | this.toolModel = tool.model; |
| | | this.activeToolNo = tool.no; // 记录选中 |
| | | }, |
| | | confirmTool() { |
| | | this.showToolDialog = false; |
| | |
| | | box-sizing: border-box; |
| | | margin: 5px 1% 5px 0; |
| | | padding: 8px 16px; |
| | | background: #fff; /* 常态白色 */ |
| | | background: #00A2E9; |
| | | border: 1px solid #ccc; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | color: #333; /* 常态深色字 */ |
| | | color: #333; |
| | | text-align: left; |
| | | transition: background 0.15s, color 0.15s; |
| | | } |
| | | |
| | | .tool-btn:active { |
| | | background: #e0e0e0; /* 按下变灰 */ |
| | | .tool-btn.active { |
| | | background: #e0e0e0; /* 选中时变灰 */ |
| | | color: #888; |
| | | } |
| | | |