【代码评审】IoT:物模型的管理哈
parent
773b8dead2
commit
fe3715c40c
|
@ -51,6 +51,7 @@ export enum ProductFunctionAccessModeEnum {
|
||||||
READ_ONLY = 'r' // 只读
|
READ_ONLY = 'r' // 只读
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @puhui999:getProductThingModelPage => getThingModelPage 哈,不用带 product 前缀
|
||||||
// IoT 产品物模型 API
|
// IoT 产品物模型 API
|
||||||
export const ThinkModelFunctionApi = {
|
export const ThinkModelFunctionApi = {
|
||||||
// 查询产品物模型分页
|
// 查询产品物模型分页
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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[]>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<!-- TODO 目录,应该是 thinkModel 哈。 -->
|
||||||
<template>
|
<template>
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
|
|
Loading…
Reference in New Issue