refactor:【antd】【iot】统一组件文件命名规则,调整导入路径以匹配小写格式

This commit is contained in:
haohao
2025-11-15 12:03:48 +08:00
parent ef5b7e9c07
commit 7e6dd0a4df
88 changed files with 95 additions and 92 deletions

View File

@@ -0,0 +1,66 @@
<!-- 产品的物模型表单event -->
<script lang="ts" setup>
import type { Ref } from 'vue';
import { watch } from 'vue';
import { isEmpty } from '@vben/utils';
import { useVModel } from '@vueuse/core';
import { Form, Radio } from 'ant-design-vue';
import {
IoTThingModelEventTypeEnum,
IoTThingModelParamDirectionEnum,
} from '#/views/iot/utils/constants';
import ThingModelInputOutputParam from './thing-model-input-output-param.vue';
/** IoT 物模型事件 */
defineOptions({ name: 'ThingModelEvent' });
const props = defineProps<{ isStructDataSpecs?: boolean; modelValue: any }>();
const emits = defineEmits(['update:modelValue']);
const thingModelEvent = useVModel(props, 'modelValue', emits) as Ref<any>;
// 默认选中INFO 信息
watch(
() => thingModelEvent.value.type,
(val: string | undefined) =>
isEmpty(val) &&
(thingModelEvent.value.type = IoTThingModelEventTypeEnum.INFO.value),
{ immediate: true },
);
</script>
<template>
<Form.Item
:rules="[{ required: true, message: '请选择事件类型', trigger: 'change' }]"
label="事件类型"
name="event.type"
>
<Radio.Group v-model:value="thingModelEvent.type">
<Radio
v-for="eventType in Object.values(IoTThingModelEventTypeEnum)"
:key="eventType.value"
:value="eventType.value"
>
{{ eventType.label }}
</Radio>
</Radio.Group>
</Form.Item>
<Form.Item label="输出参数">
<ThingModelInputOutputParam
v-model="thingModelEvent.outputParams"
:direction="IoTThingModelParamDirectionEnum.OUTPUT"
/>
</Form.Item>
</template>
<style lang="scss" scoped>
:deep(.ant-form-item) {
.ant-form-item {
margin-bottom: 0;
}
}
</style>