| | |
| | | <template #status="{ text }"> |
| | | <span v-if="text" class="flex-row flex-align-center"> |
| | | <span class="mr5" style="width: 12px; height: 12px; border-radius: 50%; background-color: green;" /> |
| | | <span>Online</span> |
| | | <span>在线</span> |
| | | </span> |
| | | <span class="flex-row flex-align-center" v-else> |
| | | <span class="mr5" style="width: 12px; height: 12px; border-radius: 50%; background-color: red;" /> |
| | | <span>Offline</span> |
| | | <span>离线</span> |
| | | </span> |
| | | </template> |
| | | <!-- 操作 --> |
| | |
| | | <div class="editable-row-operations"> |
| | | <!-- 编辑态操作 --> |
| | | <div v-if="editableData[record.device_sn]"> |
| | | <a-tooltip title="Confirm changes"> |
| | | <a-tooltip title="保存"> |
| | | <span @click="save(record)" style="color: #28d445;"><CheckOutlined /></span> |
| | | </a-tooltip> |
| | | <a-tooltip title="Modification canceled"> |
| | | <a-tooltip title="取消"> |
| | | <span @click="() => delete editableData[record.device_sn]" style="color: #e70102;"><CloseOutlined /></span> |
| | | </a-tooltip> |
| | | </div> |
| | |
| | | <a-tooltip v-if="current.indexOf(EDeviceTypeName.Dock) !== -1" title="设备日志"> |
| | | <CloudServerOutlined @click="showDeviceLogUploadRecord(record)"/> |
| | | </a-tooltip> |
| | | <a-tooltip v-if="current.indexOf(EDeviceTypeName.Dock) !== -1" title="Hms Info"> |
| | | <a-tooltip v-if="current.indexOf(EDeviceTypeName.Dock) !== -1" title="Hms信息"> |
| | | <FileSearchOutlined @click="showHms(record)"/> |
| | | </a-tooltip> |
| | | <a-tooltip title="Edit"> |
| | | <a-tooltip title="编辑"> |
| | | <EditOutlined @click="edit(record)"/> |
| | | </a-tooltip> |
| | | <a-tooltip title="Delete"> |
| | | <a-tooltip title="删除"> |
| | | <DeleteOutlined @click="() => { deleteTip = true, deleteSn = record.device_sn }"/> |
| | | </a-tooltip> |
| | | </div> |
| | |
| | | |
| | | </a-table> |
| | | <a-modal v-model:visible="deleteTip" width="450px" :closable="false" centered :okButtonProps="{ danger: true }" @ok="unbind"> |
| | | <p class="pt10 pl20" style="height: 50px;">Delete device from workspace?</p> |
| | | <p class="pt10 pl20" style="height: 50px;">确定从项目中删除该设备吗?</p> |
| | | <template #title> |
| | | <div class="flex-row flex-justify-center"> |
| | | <span>Delete devices</span> |
| | | <span>确定</span> |
| | | </div> |
| | | </template> |
| | | </a-modal> |
| | |
| | | import DeviceLogUploadRecordDrawer from '/@/components/devices/device-log/DeviceLogUploadRecordDrawer.vue' |
| | | import DeviceHmsDrawer from '/@/components/devices/device-hms/DeviceHmsDrawer.vue' |
| | | import { message, notification } from 'ant-design-vue' |
| | | |
| | | import { useMyStore } from '/@/store' |
| | | interface DeviceData { |
| | | device: Device[] |
| | | } |
| | | |
| | | const loading = ref(true) |
| | | const store = useMyStore() |
| | | const loading = ref(false) |
| | | const deleteTip = ref<boolean>(false) |
| | | const deleteSn = ref<string>() |
| | | const columns: ColumnProps[] = [ |
| | |
| | | } |
| | | type Pagination = TableState['pagination'] |
| | | |
| | | const workspaceId: string = localStorage.getItem(ELocalStorageKey.WorkspaceId) || '' |
| | | const workspaceId = computed(() => store.state.common.projectId) |
| | | const editableData: UnwrapRef<Record<string, Device>> = reactive({}) |
| | | const current = ref([EDeviceTypeName.Aircraft]) |
| | | |
| | |
| | | selectedDevice, |
| | | onDeviceUpgrade, |
| | | onUpgradeDeviceOk |
| | | } = useDeviceFirmwareUpgrade(workspaceId) |
| | | } = useDeviceFirmwareUpgrade(workspaceId.value) |
| | | |
| | | function onDeviceUpgradeWs (payload: DeviceCmdExecuteInfo) { |
| | | updateDevicesByWs(data.device, payload) |
| | |
| | | if (!closeLoading) { |
| | | loading.value = true |
| | | } |
| | | getBindingDevices(workspaceId, getPaginationBody(), domain).then(res => { |
| | | getBindingDevices(workspaceId.value, getPaginationBody(), domain).then(res => { |
| | | if (res.code !== 0) { |
| | | loading.value = false |
| | | return |
| | | } |
| | | const resData: Device[] = res.data.list |
| | |
| | | paginationProp.total = res.data.pagination.total |
| | | paginationProp.current = res.data.pagination.page |
| | | paginationProp.pageSize = res.data.pagination.page_size |
| | | loading.value = false |
| | | }).catch(e => { |
| | | loading.value = false |
| | | }) |
| | | } |
| | |
| | | // 保存 |
| | | function save (record: Device) { |
| | | delete editableData[record.device_sn] |
| | | updateDevice({ nickname: record.nickname }, workspaceId, record.device_sn) |
| | | updateDevice({ nickname: record.nickname }, workspaceId.value, record.device_sn) |
| | | } |
| | | |
| | | // 删除 |