From 5119b69fdafd369085c699cfbda06532099db835 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Mon, 01 Sep 2025 19:11:48 +0800
Subject: [PATCH] feat:更新设备管理和注册管理
---
src/views/device/components/DockControlPanel.vue | 16 +++
src/views/device/components/DeviceSettingBox.vue | 13 +-
src/utils/device-setting.js | 154 +++++++++++++++---------------
src/views/device/components/use-device-setting.js | 21 +--
src/views/device/airport.vue | 28 +++++
src/api/device/device.js | 11 ++
6 files changed, 146 insertions(+), 97 deletions(-)
diff --git a/src/api/device/device.js b/src/api/device/device.js
index 0e9cf9d..b3c9d62 100644
--- a/src/api/device/device.js
+++ b/src/api/device/device.js
@@ -144,10 +144,19 @@
})
}
-// 设备下线
+// 注销
export const deviceOffline = (dockSn) => {
return request({
url: `/drone-device-core/manage/api/v1/devices/deviceOffline?dockSn=${dockSn}`,
method: 'get',
})
}
+
+// 设备下线
+export const devicesUpdate = (param) => {
+ return request({
+ url: `/drone-device-core/manage/api/v1/devices/update`,
+ method: 'post',
+ data: param
+ })
+}
\ No newline at end of file
diff --git a/src/utils/device-setting.js b/src/utils/device-setting.js
index b5f356e..86cbc26 100644
--- a/src/utils/device-setting.js
+++ b/src/utils/device-setting.js
@@ -11,37 +11,38 @@
/**
* 根据osd 更新信息
- * @param deviceSetting
+ * @param deviceSetting.value
* @param deviceInfo
* @returns
*/
export function updateDeviceSettingInfoByOsd(deviceSetting, deviceInfo) {
- const { device, dock, gateway } = deviceInfo || {}
- if (!deviceSetting) {
+ // const { device, dock, gateway } = deviceInfo.value || {}
+ let device = deviceInfo?? {}
+ if (!deviceSetting.value) {
return
}
// 夜航灯
let nightLightsState = ""
if (isNil(device?.night_lights_state)) {
- deviceSetting[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].editable = false
- deviceSetting[
+ deviceSetting.value[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].editable = false
+ deviceSetting.value[
DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET
].value = DEFAULT_PLACEHOLDER
nightLightsState = DEFAULT_PLACEHOLDER
} else {
- deviceSetting[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].editable = true
+ deviceSetting.value[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].editable = true
nightLightsState = device?.night_lights_state
if (nightLightsState === NightLightsStateEnum.CLOSE) {
- deviceSetting[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].value = "关闭"
+ deviceSetting.value[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].value = "关闭"
} else if (nightLightsState === NightLightsStateEnum.OPEN) {
- deviceSetting[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].value = "开启"
+ deviceSetting.value[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].value = "开启"
} else {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET
].value = DEFAULT_PLACEHOLDER
}
}
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET
].trueValue = nightLightsState
@@ -49,169 +50,169 @@
let heightLimit = device?.height_limit
if (isNil(heightLimit) || heightLimit === 0) {
heightLimit = DEFAULT_PLACEHOLDER
- deviceSetting[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].editable = false
+ deviceSetting.value[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].editable = false
} else {
- deviceSetting[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].editable = true
+ deviceSetting.value[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].editable = true
}
- deviceSetting[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].trueValue = heightLimit
- deviceSetting[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].value =
+ deviceSetting.value[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].trueValue = heightLimit
+ deviceSetting.value[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].value =
heightLimit + Unit_M
// 限远
let distanceLimitStatus = ""
if (isNil(device?.distance_limit_status?.state)) {
distanceLimitStatus = DEFAULT_PLACEHOLDER
- deviceSetting[DeviceSettingKeyEnum.DISTANCE_LIMIT_SET].editable = false
- deviceSetting[
+ deviceSetting.value[DeviceSettingKeyEnum.DISTANCE_LIMIT_SET].editable = false
+ deviceSetting.value[
DeviceSettingKeyEnum.DISTANCE_LIMIT_SET
].value = DEFAULT_PLACEHOLDER
} else {
- deviceSetting[DeviceSettingKeyEnum.DISTANCE_LIMIT_SET].editable = true
+ deviceSetting.value[DeviceSettingKeyEnum.DISTANCE_LIMIT_SET].editable = true
distanceLimitStatus = device?.distance_limit_status?.state
if (distanceLimitStatus === DistanceLimitStatusEnum.UNSET) {
- deviceSetting[DeviceSettingKeyEnum.DISTANCE_LIMIT_SET].value = "关闭"
+ deviceSetting.value[DeviceSettingKeyEnum.DISTANCE_LIMIT_SET].value = "关闭"
} else if (distanceLimitStatus === DistanceLimitStatusEnum.SET) {
const distanceLimit = device?.distance_limit_status?.distance_limit
if (distanceLimit) {
- deviceSetting[DeviceSettingKeyEnum.DISTANCE_LIMIT_SET].value =
+ deviceSetting.value[DeviceSettingKeyEnum.DISTANCE_LIMIT_SET].value =
distanceLimit + Unit_M
} else {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.DISTANCE_LIMIT_SET
].value = DEFAULT_PLACEHOLDER
}
} else {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.DISTANCE_LIMIT_SET
].value = DEFAULT_PLACEHOLDER
}
}
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.DISTANCE_LIMIT_SET
].trueValue = distanceLimitStatus
// 避障
if (isNil(device?.obstacle_avoidance)) {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON
].editable = false
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON
].value = DEFAULT_PLACEHOLDER
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON
].trueValue = DEFAULT_PLACEHOLDER
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE
].editable = false
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE
].value = DEFAULT_PLACEHOLDER
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE
].trueValue = DEFAULT_PLACEHOLDER
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE
].editable = false
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE
].value = DEFAULT_PLACEHOLDER
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE
].trueValue = DEFAULT_PLACEHOLDER
} else {
const { horizon, upside, downside } = device.obstacle_avoidance || {}
if (isNil(horizon)) {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON
].editable = false
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON
].value = DEFAULT_PLACEHOLDER
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON
].trueValue = DEFAULT_PLACEHOLDER
} else {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON
].editable = false
if (horizon === ObstacleAvoidanceStatusEnum.CLOSE) {
- deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON].value =
+ deviceSetting.value[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON].value =
"关闭"
} else if (horizon === ObstacleAvoidanceStatusEnum.OPEN) {
- deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON].value =
+ deviceSetting.value[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON].value =
"开启"
} else {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON
].value = DEFAULT_PLACEHOLDER
}
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON
].trueValue = horizon
}
if (isNil(upside)) {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE
].editable = false
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE
].value = DEFAULT_PLACEHOLDER
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE
].trueValue = DEFAULT_PLACEHOLDER
} else {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE
].editable = false
if (upside === ObstacleAvoidanceStatusEnum.CLOSE) {
- deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE].value =
+ deviceSetting.value[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE].value =
"关闭"
} else if (upside === ObstacleAvoidanceStatusEnum.OPEN) {
- deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE].value =
+ deviceSetting.value[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE].value =
"开启"
} else {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE
].value = DEFAULT_PLACEHOLDER
}
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE
].trueValue = upside
}
if (isNil(downside)) {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE
].editable = false
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE
].value = DEFAULT_PLACEHOLDER
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE
].trueValue = DEFAULT_PLACEHOLDER
} else {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE
].editable = false
if (downside === ObstacleAvoidanceStatusEnum.CLOSE) {
- deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE].value =
+ deviceSetting.value[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE].value =
"关闭"
} else if (downside === ObstacleAvoidanceStatusEnum.OPEN) {
- deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE].value =
+ deviceSetting.value[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE].value =
"开启"
} else {
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE
].value = DEFAULT_PLACEHOLDER
}
- deviceSetting[
+ deviceSetting.value[
DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE
].trueValue = downside
}
}
- return deviceSetting
+ return deviceSetting.value
}
// 更新formModel
@@ -219,8 +220,9 @@
deviceSettingFormModelFromOsd,
deviceInfo
) {
- const { device, dock, gateway } = deviceInfo || {}
- if (!deviceSettingFormModelFromOsd) {
+ // const { device, dock, gateway } = deviceInfo || {}
+ let device = deviceInfo?? {}
+ if (!deviceSettingFormModelFromOsd.value) {
return
}
// 夜航灯
@@ -229,17 +231,17 @@
!isNil(nightLightsState) &&
nightLightsState === NightLightsStateEnum.OPEN
) {
- deviceSettingFormModelFromOsd.nightLightsState = true
+ deviceSettingFormModelFromOsd.value.nightLightsState = true
} else {
- deviceSettingFormModelFromOsd.nightLightsState = false
+ deviceSettingFormModelFromOsd.value.nightLightsState = false
}
// 限高
const heightLimit = device?.height_limit
if (isNil(heightLimit) || heightLimit === 0) {
- deviceSettingFormModelFromOsd.heightLimit = 20
+ deviceSettingFormModelFromOsd.value.heightLimit = 20
} else {
- deviceSettingFormModelFromOsd.heightLimit = heightLimit
+ deviceSettingFormModelFromOsd.value.heightLimit = heightLimit
}
// 限远
@@ -248,36 +250,36 @@
!isNil(distanceLimitStatus) &&
distanceLimitStatus === DistanceLimitStatusEnum.SET
) {
- deviceSettingFormModelFromOsd.distanceLimitStatus.state = true
- deviceSettingFormModelFromOsd.distanceLimitStatus.distanceLimit =
+ deviceSettingFormModelFromOsd.value.distanceLimitStatus.state = true
+ deviceSettingFormModelFromOsd.value.distanceLimitStatus.distanceLimit =
device?.distance_limit_status?.distance_limit || 15
} else {
- deviceSettingFormModelFromOsd.distanceLimitStatus.state = false
- deviceSettingFormModelFromOsd.distanceLimitStatus.distanceLimit = 15
+ deviceSettingFormModelFromOsd.value.distanceLimitStatus.state = false
+ deviceSettingFormModelFromOsd.value.distanceLimitStatus.distanceLimit = 15
}
// 避障
if (isNil(device?.obstacle_avoidance)) {
- deviceSettingFormModelFromOsd.obstacleAvoidanceHorizon = false
- deviceSettingFormModelFromOsd.obstacleAvoidanceUpside = false
- deviceSettingFormModelFromOsd.obstacleAvoidanceDownside = false
+ deviceSettingFormModelFromOsd.value.obstacleAvoidanceHorizon = false
+ deviceSettingFormModelFromOsd.value.obstacleAvoidanceUpside = false
+ deviceSettingFormModelFromOsd.value.obstacleAvoidanceDownside = false
} else {
const { horizon, upside, downside } = device.obstacle_avoidance || {}
if (!isNil(horizon) && horizon === ObstacleAvoidanceStatusEnum.OPEN) {
- deviceSettingFormModelFromOsd.obstacleAvoidanceHorizon = true
+ deviceSettingFormModelFromOsd.value.obstacleAvoidanceHorizon = true
} else {
- deviceSettingFormModelFromOsd.obstacleAvoidanceHorizon = false
+ deviceSettingFormModelFromOsd.value.obstacleAvoidanceHorizon = false
}
if (!isNil(upside) && upside === ObstacleAvoidanceStatusEnum.OPEN) {
- deviceSettingFormModelFromOsd.obstacleAvoidanceUpside = true
+ deviceSettingFormModelFromOsd.value.obstacleAvoidanceUpside = true
} else {
- deviceSettingFormModelFromOsd.obstacleAvoidanceUpside = false
+ deviceSettingFormModelFromOsd.value.obstacleAvoidanceUpside = false
}
if (!isNil(downside) && downside === ObstacleAvoidanceStatusEnum.OPEN) {
- deviceSettingFormModelFromOsd.obstacleAvoidanceDownside = true
+ deviceSettingFormModelFromOsd.value.obstacleAvoidanceDownside = true
} else {
- deviceSettingFormModelFromOsd.obstacleAvoidanceDownside = false
+ deviceSettingFormModelFromOsd.value.obstacleAvoidanceDownside = false
}
}
- return deviceSettingFormModelFromOsd
+ return deviceSettingFormModelFromOsd.value
}
diff --git a/src/views/device/airport.vue b/src/views/device/airport.vue
index 8ff0905..4d0a7c1 100644
--- a/src/views/device/airport.vue
+++ b/src/views/device/airport.vue
@@ -74,6 +74,11 @@
<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="d">
+ <el-button type="primary" text icon="el-icon-collection" v-if="!scope.row.status" @click.stop="dockNotLine(scope.row)">
+ {{ scope.row.hidden_flag == 1 ? '设备上线' : '设备下线'}}
+ </el-button>
+ </el-dropdown-item>
<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>
@@ -190,7 +195,8 @@
ota,
getDeviceFirmwareList,
getDevices,
- deviceOffline
+ deviceOffline,
+ devicesUpdate
} from '@/api/device/device'
import { deleteByOssId, addOrUpdate as addOrUpdateOssBind } from '@/api/device/ossBind'
import { getListPage as getOssList } from '@/api/resource/oss'
@@ -926,6 +932,26 @@
that.$refs.firmwareManage.init(row)
})
},
+ // 设备下线
+ dockNotLine(row) {
+ ElMessageBox.confirm('确定下线该设备吗?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ })
+ .then(() => {
+ let hidden_flag = row.hidden_flag === 1?0:1
+ devicesUpdate({id:row.id, hidden_flag:hidden_flag})
+ .then(res => {
+ ElMessage.success('下线成功')
+ this.init()
+ })
+ .catch(error => {
+ ElMessage.error('下线失败')
+ })
+ })
+ .catch(() => { })
+ },
// 版本回退点击事件
rollFirmware (row) {
if (row.status == 0) {
diff --git a/src/views/device/components/DeviceSettingBox.vue b/src/views/device/components/DeviceSettingBox.vue
index 92a4b44..1b25451 100644
--- a/src/views/device/components/DeviceSettingBox.vue
+++ b/src/views/device/components/DeviceSettingBox.vue
@@ -312,7 +312,7 @@
</template>
<script setup>
-import { defineProps, ref, watch } from 'vue';
+import { defineProps, inject, ref, watch } from 'vue';
import { ELocalStorageKey } from '@/types'
import { cloneDeep } from 'lodash';
import { initDeviceSetting, initDeviceSettingFormModel, DeviceSettingKeyEnum } from '@/types/device-setting';
@@ -326,16 +326,19 @@
// const props = defineProps();
const props = defineProps(['sn', 'deviceInfo'])
-const deviceSetting = ref(cloneDeep(initDeviceSetting));
-const deviceSettingFormModelFromOsd = ref(cloneDeep(initDeviceSettingFormModel));
+// const deviceSetting = ref(cloneDeep(initDeviceSetting));
+// const deviceSettingFormModelFromOsd = ref(cloneDeep(initDeviceSettingFormModel));
const deviceSettingFormModel = ref(cloneDeep(initDeviceSettingFormModel)); // 真实使用的formModel
+const deviceSetting = inject('deviceSetting')
+const deviceSettingFormModelFromOsd = inject('deviceSettingFormModelFromOsd')
// 根据设备osd信息更新信息
watch(
() => props.deviceInfo,
value => {
- updateDeviceSettingInfoByOsd(deviceSetting.value, value);
- updateDeviceSettingFormModelByOsd(deviceSettingFormModelFromOsd.value, value);
+ // console.log('9999',value)
+ // updateDeviceSettingInfoByOsd(deviceSetting, value);
+ // updateDeviceSettingFormModelByOsd(deviceSettingFormModelFromOsd, value);
// console.log('deviceInfo', value)
},
{
diff --git a/src/views/device/components/DockControlPanel.vue b/src/views/device/components/DockControlPanel.vue
index cf2eb78..bc4a330 100644
--- a/src/views/device/components/DockControlPanel.vue
+++ b/src/views/device/components/DockControlPanel.vue
@@ -82,6 +82,8 @@
import { cmdList as baseCmdList } from '@/types/device-cmd'
import { useDockControl } from './use-dock-control'
import { EDockModeCode } from '@/types/device'
+import { updateDeviceSettingFormModelByOsd, updateDeviceSettingInfoByOsd } from '@/utils/device-setting';
+import { initDeviceSetting, initDeviceSettingFormModel } from '@/types/device-setting';
import { updateDeviceCmdInfoByOsd, updateDeviceCmdInfoByExecuteInfo } from '@/utils/device-cmd'
import { setThermalCurrentPaletteStyle, setPhotoStorageSet, setVideoStorageSet, getLiveStatus, setStreamsSwitch, photoAndVideoCmd } from '@/api/device-setting'
import DeviceSettingBox from './DeviceSettingBox.vue'
@@ -89,12 +91,21 @@
import { useConnectWebSocket } from '@/utils/websocket/connect-websocket';
import { getWebsocketUrl } from '@/utils/websocket/config';
import EventBus from '@/utils/eventBus';
+import { cloneDeep } from 'lodash';
const valueStyle = ref(0)
const cameraModeValue = ref(0)
const videoValue = ref("zoom")
const photo_storage_settings = ref([])
const video_storage_settings = ref([])
+
+
+
+let deviceSetting = ref(cloneDeep(initDeviceSetting));
+const deviceSettingFormModelFromOsd = ref(cloneDeep(initDeviceSettingFormModel));
+
+provide('deviceSetting', deviceSetting)
+provide('deviceSettingFormModelFromOsd', deviceSettingFormModelFromOsd)
// 定义一个数据videoList
const videoList = reactive([])
@@ -222,7 +233,7 @@
watch(
() => Store.getters.deviceState,
value => {
- // console.log('设备状态变化', value)
+ // console.log('设备状态变化', value.deviceInfo[props.deviceInfo.child_sn])
if (props.sn && (value.currentSn === props.deviceInfo.child_sn || value.currentSn === props.deviceInfo.device_sn)) {
debugStatus.value = value.dockInfo[props.deviceInfo.device_sn]?.basic_osd?.mode_code === EDockModeCode.Remote_Debugging
const devices = {}
@@ -240,6 +251,9 @@
}
deviceInfo = ref(value.deviceInfo[props.deviceInfo.child_sn])
updateDeviceCmdInfoByOsd(cmdList.value, devices)
+ // by cpz
+ updateDeviceSettingInfoByOsd(deviceSetting, value.deviceInfo[props.deviceInfo.child_sn]);
+ updateDeviceSettingFormModelByOsd(deviceSettingFormModelFromOsd, value.deviceInfo[props.deviceInfo.child_sn])
}
},
{
diff --git a/src/views/device/components/use-device-setting.js b/src/views/device/components/use-device-setting.js
index c1d803f..258c6bf 100644
--- a/src/views/device/components/use-device-setting.js
+++ b/src/views/device/components/use-device-setting.js
@@ -52,20 +52,15 @@
// 设置设备属性
async function setDeviceProps(sn, body) {
try {
- const { code, message: msg } = await putDeviceProps(sn, body);
- console.log(code,messages)
- if (code === 0) {
- ElMessage({
- message: '设备属性设置成功!',
- type: 'success',
- });
- }
- throw msg;
+ await putDeviceProps(sn, body).then(res => {
+ if (res.data.code === 0) {
+ ElMessage({
+ message: '设备属性设置成功!',
+ type: 'success',
+ });
+ }
+ });
} catch (e) {
- // ElMessage({
- // message: '设备属性设置失败',
- // type: 'error',
- // });
return false;
}
}
--
Gitblit v1.9.3