husq
2023-09-25 f2346c813c022d871a9bf5e8b75c0db46ee80116
src/pages/page-web/projects/devices.vue
@@ -130,11 +130,11 @@
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 store = useMyStore()
const loading = ref(false)
const deleteTip = ref<boolean>(false)
const deleteSn = ref<string>()
@@ -243,7 +243,7 @@
}
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])
@@ -257,7 +257,7 @@
  selectedDevice,
  onDeviceUpgrade,
  onUpgradeDeviceOk
} = useDeviceFirmwareUpgrade(workspaceId)
} = useDeviceFirmwareUpgrade(workspaceId.value)
function onDeviceUpgradeWs (payload: DeviceCmdExecuteInfo) {
  updateDevicesByWs(data.device, payload)
@@ -301,7 +301,7 @@
  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
@@ -340,7 +340,7 @@
// 保存
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)
}
// 删除