1.修复物模型列表无限加载的问题 2.修复物模型管理页面添加,TSL,编辑,删除,功能类型选项功能不用问题 3.修复TSL按钮物模型接口没有的问题 4.修复物模型新增编辑页面的属性不能正常编辑修改问题美化显示 iot设备管理问题 1.修复新增编辑页面缺少字段相关组件 2.修复设备详情中子页面不显示问题 3.修复设备详情子页面物模型数据页面不显示问题 4.修复模拟设备右侧不显示问题 右侧溢出,改为上下分栏 Signed-off-by: Administrator <425053404@qq.com>
73 lines
1.9 KiB
Vue
73 lines
1.9 KiB
Vue
<!-- 产品的物模型表单(service 项) -->
|
||
<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 {
|
||
IoTThingModelParamDirectionEnum,
|
||
IoTThingModelServiceCallTypeEnum,
|
||
} from '#/views/iot/utils/constants';
|
||
|
||
import ThingModelInputOutputParam from './ThingModelInputOutputParam.vue';
|
||
|
||
/** IoT 物模型服务 */
|
||
defineOptions({ name: 'ThingModelService' });
|
||
|
||
const props = defineProps<{ isStructDataSpecs?: boolean; modelValue: any }>();
|
||
const emits = defineEmits(['update:modelValue']);
|
||
const service = useVModel(props, 'modelValue', emits) as Ref<any>;
|
||
|
||
/** 默认选中,ASYNC 异步 */
|
||
watch(
|
||
() => service.value.callType,
|
||
(val: string | undefined) =>
|
||
isEmpty(val) &&
|
||
(service.value.callType = IoTThingModelServiceCallTypeEnum.ASYNC.value),
|
||
{ immediate: true },
|
||
);
|
||
</script>
|
||
|
||
<template>
|
||
<Form.Item
|
||
:rules="[{ required: true, message: '请选择调用方式', trigger: 'change' }]"
|
||
label="调用方式"
|
||
name="service.callType"
|
||
>
|
||
<Radio.Group v-model:value="service.callType">
|
||
<Radio
|
||
v-for="callType in Object.values(IoTThingModelServiceCallTypeEnum)"
|
||
:key="callType.value"
|
||
:value="callType.value"
|
||
>
|
||
{{ callType.label }}
|
||
</Radio>
|
||
</Radio.Group>
|
||
</Form.Item>
|
||
<Form.Item label="输入参数">
|
||
<ThingModelInputOutputParam
|
||
v-model="service.inputParams"
|
||
:direction="IoTThingModelParamDirectionEnum.INPUT"
|
||
/>
|
||
</Form.Item>
|
||
<Form.Item label="输出参数">
|
||
<ThingModelInputOutputParam
|
||
v-model="service.outputParams"
|
||
:direction="IoTThingModelParamDirectionEnum.OUTPUT"
|
||
/>
|
||
</Form.Item>
|
||
</template>
|
||
|
||
<style lang="scss" scoped>
|
||
:deep(.ant-form-item) {
|
||
.ant-form-item {
|
||
margin-bottom: 0;
|
||
}
|
||
}
|
||
</style>
|