| | |
| | | import { useRoute, useRouter } from 'vue-router' |
| | | import { createDeviceCollector, getDeviceCollector, getDiscoveredCollectorList, updateDeviceCollector } from '@/api/deviceCollectors' |
| | | import type { CollectorPayload } from '@/stores/deviceCollectors' |
| | | import DeviceRelatedTests from '@/components/DeviceRelatedTests.vue' |
| | | |
| | | const route = useRoute() |
| | | const router = useRouter() |
| | |
| | | |
| | | const form = reactive<CollectorPayload>({ |
| | | deviceCode: '', ip: '', mac: '', name: '', manufacturer: '', model: '', channelCount: 1, |
| | | remark: '', onlineStatus: '离线', testStatus: '空闲', currentTest: '-', status: '启用', |
| | | remark: '', onlineStatus: '离线', relatedTests: [], status: '启用', |
| | | }) |
| | | |
| | | async function loadEditingCollector() { |
| | |
| | | model: device.model, |
| | | channelCount: device.channelCount, |
| | | onlineStatus: device.onlineStatus, |
| | | testStatus: device.testStatus, |
| | | currentTest: device.currentTest, |
| | | relatedTests: [], |
| | | }) |
| | | deviceDialogVisible.value = false |
| | | ElMessage.success(`已选择设备 ${device.deviceCode}`) |
| | |
| | | <div><span>IP</span><strong class="mono-value">{{ form.ip || '-' }}</strong></div> |
| | | <div><span>MAC</span><strong class="mono-value">{{ form.mac || '-' }}</strong></div> |
| | | <div><span>在线状态</span><strong :class="form.onlineStatus === '在线' ? 'online-value' : 'offline-value'">{{ form.deviceCode ? form.onlineStatus : '-' }}</strong></div> |
| | | <div><span>测试状态</span><strong>{{ form.deviceCode ? form.testStatus : '-' }}</strong></div> |
| | | <div><span>当前测试</span><strong :title="form.currentTest">{{ form.deviceCode ? form.currentTest : '-' }}</strong></div> |
| | | <div><span>关联测试</span><DeviceRelatedTests :tests="form.relatedTests" /></div> |
| | | </div> |
| | | |
| | | <div class="detail-form"> |