【代码优化】IoT: 场景联动注释格式统一

This commit is contained in:
puhui999 2025-03-29 13:04:50 +08:00
parent 279d88e729
commit 24cdcd10c1
5 changed files with 11 additions and 10 deletions

View File

@ -106,7 +106,7 @@ const actionConfig = useVModel(props, 'modelValue', emits) as Ref<ActionConfig>
const message = useMessage()
//
/** 初始化执行器结构 */
const initActionConfig = () => {
if (!actionConfig.value) {
actionConfig.value = { type: IotRuleSceneActionTypeEnum.DEVICE_CONTROL } as ActionConfig
@ -140,7 +140,7 @@ const initActionConfig = () => {
}
}
//
/** 产品和设备选择 */
const productTableSelectRef = ref<InstanceType<typeof ProductTableSelect>>()
const deviceTableSelectRef = ref<InstanceType<typeof DeviceTableSelect>>()
const product = ref<ProductVO>()
@ -181,7 +181,7 @@ const handleDeviceSelect = (val: DeviceVO[]) => {
}
}
//
/** 监听执行类型变化,初始化对应配置 */
watch(
() => actionConfig.value.type,
() => {

View File

@ -64,7 +64,7 @@ const props = defineProps<{ modelValue: any }>()
const emits = defineEmits(['update:modelValue'])
const alertConfig = useVModel(props, 'modelValue', emits) as Ref<ActionAlert>
//
/** 初始化告警执行器结构 */
const initAlertConfig = () => {
if (!alertConfig.value) {
alertConfig.value = {
@ -76,7 +76,7 @@ const initAlertConfig = () => {
}
}
//
/** 初始化 */
onMounted(() => {
initAlertConfig()
})

View File

@ -25,9 +25,9 @@ const props = defineProps<{ modelValue: any }>()
const emits = defineEmits(['update:modelValue'])
const dataBridgeId = useVModel(props, 'modelValue', emits)
const dataBridgeList = ref<any[]>([]) //
const dataBridgeList = ref<any[]>([]) /** 数据桥接列表 */
//
/** 获取数据桥接列表 */
const getDataBridgeList = async () => {
dataBridgeList.value = await DataBridgeApi.getSimpleDataBridgeList()
}

View File

@ -111,7 +111,7 @@ watch(
{ deep: true }
)
//
/** 初始化设备控制执行器结构 */
const initDeviceControlConfig = () => {
if (!deviceControlConfig.value) {
deviceControlConfig.value = {
@ -177,7 +177,7 @@ const getUnitName = computed(() => (identifier: string) => {
return ''
})
// productId
/** 监听 productId 变化 */
watch(
() => props.productId,
(newVal) => {
@ -193,7 +193,7 @@ watch(
{ immediate: true }
)
//
/** 监听消息类型变化 */
watch(
() => deviceControlConfig.value.type,
() => {

View File

@ -194,6 +194,7 @@ const removeConditionParameter = (
conditionParameters.splice(index, 1)
}
/** 产品和设备选择引用 */
const productTableSelectRef = ref<InstanceType<typeof ProductTableSelect>>()
const deviceTableSelectRef = ref<InstanceType<typeof DeviceTableSelect>>()
const product = ref<ProductVO>()