| | |
| | | <span class="form-label" |
| | | >{{ deviceSetting[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].label }}:</span |
| | | > |
| | | <a-switch |
| | | checked-children="开" |
| | | un-checked-children="关" |
| | | v-model:checked="deviceSettingFormModel.nightLightsState" |
| | | <el-switch |
| | | active-text="开" |
| | | inactive-text="关" |
| | | v-model="deviceSettingFormModel.nightLightsState" |
| | | /> |
| | | </div> |
| | | </template> |
| | | <a |
| | | @click=" |
| | | @click.stop=" |
| | | onShowPopConfirm( |
| | | deviceSetting[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].settingKey |
| | | ) |
| | |
| | | <template #formContent> |
| | | <div class="form-content"> |
| | | <span class="form-label" |
| | | >{{ deviceSetting[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].label }}:</span |
| | | >{{ deviceSetting[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].label }}:(m)</span |
| | | > |
| | | <a-input-number |
| | | v-model:value="deviceSettingFormModel.heightLimit" |
| | | <el-input-number |
| | | size="small" |
| | | v-model="deviceSettingFormModel.heightLimit" |
| | | :min="20" |
| | | :max="1500" |
| | | /> |
| | | m |
| | | |
| | | </div> |
| | | </template> |
| | | <a |
| | |
| | | <span class="form-label" |
| | | >{{ deviceSetting[DeviceSettingKeyEnum.DISTANCE_LIMIT_SET].label }}:</span |
| | | > |
| | | <a-switch |
| | | <el-switch |
| | | style="margin-right: 10px" |
| | | checked-children="开" |
| | | un-checked-children="关" |
| | | v-model:checked="deviceSettingFormModel.distanceLimitStatus.state" |
| | | active-text="开" |
| | | inactive-text="关" |
| | | v-model="deviceSettingFormModel.distanceLimitStatus.state" |
| | | /> |
| | | <a-input-number |
| | | v-model:value="deviceSettingFormModel.distanceLimitStatus.distanceLimit" |
| | | <el-input-number |
| | | size="small" |
| | | v-model="deviceSettingFormModel.distanceLimitStatus.distanceLimit" |
| | | :min="15" |
| | | :max="8000" |
| | | /> |
| | |
| | | <span class="form-label" |
| | | >{{ deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON].label }}:</span |
| | | > |
| | | <a-switch |
| | | checked-children="开" |
| | | un-checked-children="关" |
| | | v-model:checked="deviceSettingFormModel.obstacleAvoidanceHorizon" |
| | | <el-switch |
| | | active-text="开" |
| | | inactive-text="关" |
| | | v-model="deviceSettingFormModel.obstacleAvoidanceHorizon" |
| | | /> |
| | | </div> |
| | | </template> |
| | |
| | | <span class="form-label" |
| | | >{{ deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE].label }}:</span |
| | | > |
| | | <a-switch |
| | | checked-children="开" |
| | | un-checked-children="关" |
| | | v-model:checked="deviceSettingFormModel.obstacleAvoidanceUpside" |
| | | <el-switch |
| | | active-text="开" |
| | | inactive-text="关" |
| | | v-model="deviceSettingFormModel.obstacleAvoidanceUpside" |
| | | /> |
| | | </div> |
| | | </template> |
| | |
| | | deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE].label |
| | | }}:</span |
| | | > |
| | | <a-switch |
| | | checked-children="开" |
| | | un-checked-children="关" |
| | | v-model:checked="deviceSettingFormModel.obstacleAvoidanceDownside" |
| | | <el-switch |
| | | active-text="开" |
| | | inactive-text="关" |
| | | v-model="deviceSettingFormModel.obstacleAvoidanceDownside" |
| | | /> |
| | | </div> |
| | | </template> |
| | |
| | | |
| | | <script setup> |
| | | import { defineProps, ref, watch } from 'vue'; |
| | | import { ELocalStorageKey } from '@/types' |
| | | import { cloneDeep } from 'lodash'; |
| | | import { initDeviceSetting, initDeviceSettingFormModel } from '@/types/device-setting'; |
| | | import { initDeviceSetting, initDeviceSettingFormModel, DeviceSettingKeyEnum } from '@/types/device-setting'; |
| | | import { |
| | | updateDeviceSettingInfoByOsd, |
| | | updateDeviceSettingFormModelByOsd, |
| | | } from '@/utils/device-setting'; |
| | | import { useDeviceSetting } from './use-device-setting'; |
| | | import DeviceSettingPopover from './DeviceSettingPopover.vue' |
| | | |
| | | const props = defineProps(); |
| | | // const props = defineProps(); |
| | | const props = defineProps(['sn', 'deviceInfo']) |
| | | |
| | | const deviceSetting = ref(cloneDeep(initDeviceSetting)); |
| | | const deviceSettingFormModelFromOsd = ref(cloneDeep(initDeviceSettingFormModel)); |
| | |
| | | async function onConfirm(settingKey) { |
| | | 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); |
| | | 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; |
| | |
| | | font-weight: 700; |
| | | } |
| | | } |
| | | .control-setting-item-right { |
| | | .el-tooltip__trigger { |
| | | color: #1C5CFF; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |