| | |
| | | const workspaceId = localStorage.getItem(ELocalStorageKey.WorkspaceId) || '' |
| | | |
| | | export const putDeviceProps = (deviceSn, body) => { |
| | | console.log(deviceSn, body, workspaceId, '8888') |
| | | return request({ |
| | | url: `/drone-device-core/manage/api/v1/devices/${workspaceId}/devices/${deviceSn}/property`, |
| | | method: 'put', |
| | | body, |
| | | data: body, |
| | | }) |
| | | } |
| | | |
| | | export const putDevicePropsNew = (deviceSn, body, workspaceId) => { |
| | | return request({ |
| | | url: `/drone-device-core/manage/api/v1/devices/${workspaceId}/devices/${deviceSn}/property`, |
| | | method: 'put', |
| | | body, |
| | | }) |
| | | } |
| | | /** |
| | | * 设置调色盘 |
| | | * @param {机场编码} deviceSn |
| | |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-dropdown> |
| | | <el-button type="primary" text icon="el-icon-paperclip" v-if="permission.oss_set">更 多</el-button> |
| | | <el-button type="primary" text icon="el-icon-more" v-if="permission.oss_set">更 多</el-button> |
| | | <template #dropdown v-if="scope.row.domain == 3"> |
| | | <el-dropdown-menu teleported> |
| | | <el-dropdown-item command="a"> |
| | |
| | | v-if="permission.rang_con && scope.row.domain == 3" |
| | | @click.stop="handleOpenRemoteDebugging(scope.row, scope.index)">远程调试</el-button> |
| | | </el-dropdown-item> |
| | | <el-dropdown-item command="d"><el-button type="primary" text icon="el-icon-setting" v-if="permission.fly_device_offline" |
| | | <el-dropdown-item command="d"><el-button type="primary" text icon="el-icon-collection" v-if="permission.fly_device_offline" |
| | | @click.stop="rollFirmware(scope.row)">固件版本管理</el-button> |
| | | </el-dropdown-item> |
| | | <el-dropdown-item command="e"><el-button type="primary" text icon="el-icon-setting" v-if="permission.fly_device_offline" |
| | | <el-dropdown-item command="e"><el-button type="primary" text icon="el-icon-document-delete" v-if="permission.fly_device_offline" |
| | | @click.stop="handleDeviceOffline(scope.row)">注销</el-button> |
| | | </el-dropdown-item> |
| | | </el-dropdown-menu> |
| | |
| | | <template #dropdown v-else> |
| | | <el-dropdown-menu teleported> |
| | | <el-dropdown-item command="a"> |
| | | <el-button type="primary" text icon="el-icon-paperclip" @click.stop="rowDel(scope.row, scope.index)">删除</el-button> |
| | | <el-button type="primary" text icon="el-icon-circle-close" @click.stop="rowDel(scope.row, scope.index)">删除</el-button> |
| | | </el-dropdown-item> |
| | | <el-dropdown-item command="a"> |
| | | <el-button type="primary" text icon="el-icon-paperclip" v-if="permission.operate_password_set" @click.stop="handleOperatePassword(scope.row, scope.index)">操控密码设置</el-button> |
| | | <el-button type="primary" text icon="el-icon-key" v-if="permission.operate_password_set" @click.stop="handleOperatePassword(scope.row, scope.index)">操控密码设置</el-button> |
| | | </el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </template> |
| | |
| | | deviceSetting.value[settingKey].popConfirm.loading = true; |
| | | const body = genDevicePropsBySettingKey(settingKey, deviceSettingFormModel.value); |
| | | localStorage.setItem(ELocalStorageKey.WorkspaceId, props.deviceInfo.workspace_id) |
| | | await setDeviceProps(props.sn, body, props.deviceInfo.workspace_id); |
| | | await setDeviceProps(props.sn, body); |
| | | deviceSetting.value[settingKey].popConfirm.loading = false; |
| | | deviceSetting.value[settingKey].popConfirm.visible = false; |
| | | } |
| | |
| | | |
| | | <style lang="scss" scoped> |
| | | .device-setting-wrapper { |
| | | border-bottom: 1px solid #515151; |
| | | //border-bottom: 1px solid #515151; |
| | | |
| | | .device-setting-header { |
| | | font-size: 14px; |
| | |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | import { putDeviceProps, putDevicePropsNew } from '@/api/device-setting'; |
| | | import { putDeviceProps } from '@/api/device-setting'; |
| | | import { |
| | | DeviceSettingKeyEnum, |
| | | ObstacleAvoidanceStatusEnum, |
| | | NightLightsStateEnum, |
| | | DistanceLimitStatusEnum, |
| | | } from '@/types/device-setting'; |
| | | import { messages } from '@/lang'; |
| | | |
| | | export function useDeviceSetting() { |
| | | // 生成参数 |
| | |
| | | } |
| | | |
| | | // 设置设备属性 |
| | | async function setDeviceProps(sn, body, workspaceId) { |
| | | async function setDeviceProps(sn, body) { |
| | | try { |
| | | const { code, message: msg } = await putDevicePropsNew(sn, body, workspaceId); |
| | | const { code, message: msg } = await putDeviceProps(sn, body); |
| | | console.log(code,messages) |
| | | if (code === 0) { |
| | | return true; |
| | | ElMessage({ |
| | | message: '设备属性设置成功!', |
| | | type: 'success', |
| | | }); |
| | | } |
| | | throw msg; |
| | | } catch (e) { |
| | | ElMessage({ |
| | | message: '设备属性设置失败', |
| | | type: 'error', |
| | | }); |
| | | // ElMessage({ |
| | | // message: '设备属性设置失败', |
| | | // type: 'error', |
| | | // }); |
| | | return false; |
| | | } |
| | | } |