【代码评审】IoT:物模型的管理哈

pull/622/MERGE
YunaiV 2024-12-16 20:52:20 +08:00
parent 773b8dead2
commit fe3715c40c
7 changed files with 10 additions and 1 deletions

View File

@ -51,6 +51,7 @@ export enum ProductFunctionAccessModeEnum {
READ_ONLY = 'r' // 只读 READ_ONLY = 'r' // 只读
} }
// TODO @puhui999getProductThingModelPage => getThingModelPage 哈,不用带 product 前缀
// IoT 产品物模型 API // IoT 产品物模型 API
export const ThinkModelFunctionApi = { export const ThinkModelFunctionApi = {
// 查询产品物模型分页 // 查询产品物模型分页

View File

@ -74,8 +74,9 @@ import {
} from './dataSpecs' } from './dataSpecs'
import { ThingModelProperty } from '@/api/iot/thinkmodelfunction' import { ThingModelProperty } from '@/api/iot/thinkmodelfunction'
/** 物模型数据 */ /** IoT 物模型数据 */
defineOptions({ name: 'ThingModelDataSpecs' }) defineOptions({ name: 'ThingModelDataSpecs' })
const props = defineProps<{ modelValue: any }>() const props = defineProps<{ modelValue: any }>()
const emits = defineEmits(['update:modelValue']) const emits = defineEmits(['update:modelValue'])
const property = useVModel(props, 'modelValue', emits) as Ref<ThingModelProperty> const property = useVModel(props, 'modelValue', emits) as Ref<ThingModelProperty>

View File

@ -9,6 +9,7 @@
> >
<el-form-item label="功能类型" prop="type"> <el-form-item label="功能类型" prop="type">
<el-radio-group v-model="formData.type"> <el-radio-group v-model="formData.type">
<!-- TODO @puhui999从字典拿 -->
<el-radio-button :value="1"> 属性</el-radio-button> <el-radio-button :value="1"> 属性</el-radio-button>
<el-radio-button :value="2"> 服务</el-radio-button> <el-radio-button :value="2"> 服务</el-radio-button>
<el-radio-button :value="3"> 事件</el-radio-button> <el-radio-button :value="3"> 事件</el-radio-button>
@ -46,10 +47,12 @@ import { IOT_PROVIDE_KEY } from '@/views/iot/utils/constants'
import { DataSpecsDataType } from './config' import { DataSpecsDataType } from './config'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
// TODO @puhui999
defineOptions({ name: 'IoTProductThingModelForm' }) defineOptions({ name: 'IoTProductThingModelForm' })
const product = inject<Ref<ProductVO>>(IOT_PROVIDE_KEY.PRODUCT) // const product = inject<Ref<ProductVO>>(IOT_PROVIDE_KEY.PRODUCT) //
// TODO @puhui999 = =
const { t } = useI18n() const { t } = useI18n()
const message = useMessage() const message = useMessage()

View File

@ -26,6 +26,7 @@ import { DataSpecsDataType, dataTypeOptions } from '../config'
/** 数组型的 dataSpecs 配置组件 */ /** 数组型的 dataSpecs 配置组件 */
defineOptions({ name: 'ThingModelArrayTypeDataSpecs' }) defineOptions({ name: 'ThingModelArrayTypeDataSpecs' })
const props = defineProps<{ modelValue: any }>() const props = defineProps<{ modelValue: any }>()
const emits = defineEmits(['update:modelValue']) const emits = defineEmits(['update:modelValue'])
const dataSpecs = useVModel(props, 'modelValue', emits) as Ref<any> const dataSpecs = useVModel(props, 'modelValue', emits) as Ref<any>

View File

@ -29,6 +29,7 @@ import {
/** 枚举型的 dataSpecs 配置组件 */ /** 枚举型的 dataSpecs 配置组件 */
defineOptions({ name: 'ThingModelEnumTypeDataSpecs' }) defineOptions({ name: 'ThingModelEnumTypeDataSpecs' })
const props = defineProps<{ modelValue: any }>() const props = defineProps<{ modelValue: any }>()
const emits = defineEmits(['update:modelValue']) const emits = defineEmits(['update:modelValue'])
const dataSpecsList = useVModel(props, 'modelValue', emits) as Ref<DataSpecsEnumOrBoolDataVO[]> const dataSpecsList = useVModel(props, 'modelValue', emits) as Ref<DataSpecsEnumOrBoolDataVO[]>

View File

@ -34,6 +34,7 @@ import { DataSpecsNumberDataVO } from '../config'
/** 数值型的 dataSpecs 配置组件 */ /** 数值型的 dataSpecs 配置组件 */
defineOptions({ name: 'ThingModelNumberTypeDataSpecs' }) defineOptions({ name: 'ThingModelNumberTypeDataSpecs' })
const props = defineProps<{ modelValue: any }>() const props = defineProps<{ modelValue: any }>()
const emits = defineEmits(['update:modelValue']) const emits = defineEmits(['update:modelValue'])
const dataSpecs = useVModel(props, 'modelValue', emits) as Ref<DataSpecsNumberDataVO> const dataSpecs = useVModel(props, 'modelValue', emits) as Ref<DataSpecsNumberDataVO>

View File

@ -1,3 +1,4 @@
<!-- TODO 目录应该是 thinkModel -->
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->