| | |
| | | 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 |
| | |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | labelWidth: 100, |
| | | searchSpan: 4, |
| | | search: true, |
| | | // searchSpan: 4, |
| | | // search: true, |
| | | slot: true, |
| | | width: 100, |
| | | |
| | |
| | | labelWidth: 130, |
| | | width: 110, |
| | | }, |
| | | // { |
| | | // label: '设备状态', |
| | | // prop: 'mode_code', |
| | | // addDisplay: false, |
| | | // editDisplay: false, |
| | | // viewDisplay: false, |
| | | // labelWidth: 130, |
| | | // slot: true, |
| | | // width: 110, |
| | | { |
| | | label: '设备状态', |
| | | prop: 'mode_code', |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | labelWidth: 130, |
| | | searchSpan: 4, |
| | | search: true, |
| | | type: 'select', |
| | | dicData: [ |
| | | { label: '在线', value: 4 }, |
| | | { label: '离线', value: 0 }, |
| | | { label: '远程调试', value: 2 }, |
| | | ], |
| | | slot: true, |
| | | width: 110, |
| | | |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: '请输入机场状态', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | // }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入机场状态', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | |
| | | |
| | | <script setup> |
| | | import { defineProps, ref, watch } from 'vue'; |
| | | import { ELocalStorageKey } from '@/types' |
| | | import { cloneDeep } from 'lodash'; |
| | | import { initDeviceSetting, initDeviceSettingFormModel, DeviceSettingKeyEnum } from '@/types/device-setting'; |
| | | import { |
| | |
| | | async function onConfirm(settingKey) { |
| | | deviceSetting.value[settingKey].popConfirm.loading = true; |
| | | const body = genDevicePropsBySettingKey(settingKey, deviceSettingFormModel.value); |
| | | console.log(body, '顶顶顶顶顶') |
| | | await setDeviceProps(props.sn, body); |
| | | localStorage.setItem(ELocalStorageKey.WorkspaceId, props.deviceInfo.workspace_id) |
| | | await setDeviceProps(props.sn, body, props.deviceInfo.workspace_id); |
| | | deviceSetting.value[settingKey].popConfirm.loading = false; |
| | | deviceSetting.value[settingKey].popConfirm.visible = false; |
| | | } |
| | |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | import { putDeviceProps } from '@/api/device-setting'; |
| | | import { putDeviceProps, putDevicePropsNew } from '@/api/device-setting'; |
| | | import { |
| | | DeviceSettingKeyEnum, |
| | | ObstacleAvoidanceStatusEnum, |
| | |
| | | } |
| | | |
| | | // 设置设备属性 |
| | | async function setDeviceProps(sn, body) { |
| | | async function setDeviceProps(sn, body, workspaceId) { |
| | | try { |
| | | const { code, message: msg } = await putDeviceProps(sn, body); |
| | | const { code, message: msg } = await putDevicePropsNew(sn, body, workspaceId); |
| | | if (code === 0) { |
| | | return true; |
| | | } |
| | |
| | | dependencies: |
| | | ms "2.0.0" |
| | | |
| | | "decimal.js@^10.4.3": |
| | | "integrity" "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" |
| | | "resolved" "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.4.3.tgz" |
| | | "version" "10.4.3" |
| | | decimal.js@^10.4.3: |
| | | version "10.4.3" |
| | | resolved "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.4.3.tgz" |
| | | integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== |
| | | |
| | | "decimal@^0.0.2": |
| | | "integrity" "sha512-puX1+D5GlpXYH0kDejnu8F2jsGLKRePc7eOznNjqMbA2otl7AzvubrvvZVmOvRCHhsqeAPKNcAxHHbevsH/1qg==" |
| | | "resolved" "https://registry.npmmirror.com/decimal/-/decimal-0.0.2.tgz" |
| | | "version" "0.0.2" |
| | | decimal@^0.0.2: |
| | | version "0.0.2" |
| | | resolved "https://registry.npmmirror.com/decimal/-/decimal-0.0.2.tgz" |
| | | integrity sha512-puX1+D5GlpXYH0kDejnu8F2jsGLKRePc7eOznNjqMbA2otl7AzvubrvvZVmOvRCHhsqeAPKNcAxHHbevsH/1qg== |
| | | |
| | | "deep-equal@^1.0.0", "deep-equal@1.x": |
| | | "integrity" "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==" |
| | | "resolved" "https://registry.npmmirror.com/deep-equal/-/deep-equal-1.1.2.tgz" |
| | | "version" "1.1.2" |
| | | deep-equal@^1.0.0, deep-equal@1.x: |
| | | version "1.1.2" |
| | | resolved "https://registry.npmmirror.com/deep-equal/-/deep-equal-1.1.2.tgz" |
| | | integrity sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg== |
| | | dependencies: |
| | | is-arguments "^1.1.1" |
| | | is-date-object "^1.0.5" |