| | |
| | | </el-table-column> |
| | | <el-table-column prop="plcIp" label="PLC IP" width="130" /> |
| | | <el-table-column prop="plcType" label="PLC类型" width="100" /> |
| | | <el-table-column prop="moduleName" label="模块名称" min-width="120" /> |
| | | <el-table-column prop="moduleName" label="模块名称" min-width="60" /> |
| | | <el-table-column prop="isPrimary" label="主控设备" width="100" align="center"> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.isPrimary" type="success" size="small">主控</el-tag> |
| | |
| | | {{ formatDateTime(scope.row.lastHeartbeat) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="200" fixed="right"> |
| | | <el-table-column label="操作" width="300" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button type="primary" size="small" @click="editDevice(scope.row)"> |
| | | 编辑 |
| | | </el-button> |
| | | <el-button type="warning" size="small" :loading="plcOperationLoading" @click="handleSinglePlcRequest(scope.row)"> |
| | | <el-button type="warning" size="small" :loading="plcOperationLoading" @click.stop="handleSinglePlcRequest(scope.row, $event)"> |
| | | PLC请求 |
| | | </el-button> |
| | | <el-button type="success" size="small" @click="healthCheck(scope.row)"> |
| | |
| | | } |
| | | } |
| | | |
| | | const handleSinglePlcRequest = (row) => executePlcOperation([row.id || row.deviceId], 'request') |
| | | const handleSinglePlcReport = (row) => executePlcOperation([row.id || row.deviceId], 'report') |
| | | const handleSinglePlcReset = (row) => executePlcOperation([row.id || row.deviceId], 'reset') |
| | | const handleSinglePlcRequest = (row, event) => { |
| | | if (event) { |
| | | event.stopPropagation() |
| | | } |
| | | executePlcOperation([row.id || row.deviceId], 'request') |
| | | } |
| | | const handleSinglePlcReport = (row, event) => { |
| | | if (event) { |
| | | event.stopPropagation() |
| | | } |
| | | executePlcOperation([row.id || row.deviceId], 'report') |
| | | } |
| | | const handleSinglePlcReset = (row, event) => { |
| | | if (event) { |
| | | event.stopPropagation() |
| | | } |
| | | executePlcOperation([row.id || row.deviceId], 'reset') |
| | | } |
| | | |
| | | const batchPlcRequest = () => executePlcOperation(getSelectedDeviceIds(), 'request') |
| | | const batchPlcReport = () => executePlcOperation(getSelectedDeviceIds(), 'report') |