review:【antd】【iot】物模型的管理

This commit is contained in:
YunaiV
2025-11-21 11:20:27 +08:00
parent 543e48504b
commit f650d44194
6 changed files with 70 additions and 71 deletions

View File

@@ -1,3 +1,4 @@
<!-- TODO @haohao如果是模块内用的就用 modules 等后面点在看优先级 -->
<script lang="ts" setup>
import type { ThingModelData } from '#/api/iot/thingmodel';
@@ -17,7 +18,6 @@ defineOptions({ name: 'DataDefinition' });
const props = defineProps<{ data: ThingModelData }>();
// 格式化布尔值和枚举值列表为字符串
const formattedDataSpecsList = computed(() => {
if (
!props.data.property?.dataSpecsList ||
@@ -28,9 +28,8 @@ const formattedDataSpecsList = computed(() => {
return props.data.property.dataSpecsList
.map((item) => `${item.value}-${item.name}`)
.join('、');
});
}); // 格式化布尔值和枚举值列表为字符串
// 显示的简短文本(第一个值)
const shortText = computed(() => {
if (
!props.data.property?.dataSpecsList ||
@@ -43,7 +42,7 @@ const shortText = computed(() => {
return count > 1
? `${first.value}-${first.name}${count}`
: `${first.value}-${first.name}`;
});
}); // 显示的简短文本(第一个值)
</script>
<template>
@@ -100,9 +99,8 @@ const shortText = computed(() => {
</template>
<!-- 服务 -->
<div v-if="Number(data.type) === IoTThingModelTypeEnum.SERVICE">
调用方式:{{
getThingModelServiceCallTypeLabel(data.service?.callType as any)
}}
调用方式:
{{ getThingModelServiceCallTypeLabel(data.service?.callType as any) }}
</div>
<!-- 事件 -->
<div v-if="Number(data.type) === IoTThingModelTypeEnum.EVENT">
@@ -111,6 +109,7 @@ const shortText = computed(() => {
</template>
<style lang="scss" scoped>
/** TODO @haohaotindwind */
.data-specs-text {
cursor: help;
border-bottom: 1px dashed #d9d9d9;