Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
5fb640516f
@ -629,10 +629,12 @@ const delServiceForm = (data: AddModelServiceType & UpdateModelServiceType) => {
|
||||
const attributeVisible = ref(false)
|
||||
const attributeFormTitle = ref(AttributeDialogTitleStateType['add'])
|
||||
const attributeFormDataTypeOptions: { value: attributeTypeDataType }[] = [
|
||||
{ value: 'int4' },
|
||||
{ value: 'int8' },
|
||||
{ value: 'float4' },
|
||||
{ value: 'float8' },
|
||||
{ value: 'float' },
|
||||
{ value: 'double' },
|
||||
{ value: 'tinyint' },
|
||||
{ value: 'smallint' },
|
||||
{ value: 'int' },
|
||||
{ value: 'bigint' },
|
||||
]
|
||||
const originAttributeForm: AddModelAttributeType & UpdateModelAttributeType = {
|
||||
id: null,
|
||||
@ -657,6 +659,8 @@ const attributeForm = ref<AddModelAttributeType & UpdateModelAttributeType>(JSON
|
||||
const attributeTypeChange = (value: ModelAttributeType) => {
|
||||
if (value === 140) {
|
||||
attributeForm.value.dataType = ''
|
||||
}else{
|
||||
attributeForm.value.dataType = 'float'
|
||||
}
|
||||
}
|
||||
|
||||
@ -796,15 +800,6 @@ const attributeAndServiceRules = {
|
||||
serviceName: [{ required: true, message: '请输入方法名称', trigger: 'blur' }],
|
||||
serviceType: [{ required: true, message: '请选择方法类型', trigger: 'change' }],
|
||||
porder: [{ required: true, message: '请输入序号', trigger: 'blur' }],
|
||||
dataType: {
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (attributeForm.value.attributeType !== 140 && !value) {
|
||||
callback(new Error('请选择数据类型'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const addModelAttributeAndService = () => {
|
||||
|
@ -65,7 +65,7 @@ export enum ModelAttributeFieldsEnums {
|
||||
'highSpeed' = '是否高频',
|
||||
'subSystem' = '子系统',
|
||||
'dataType' = '数据类型',
|
||||
'visible'='是否可见',
|
||||
'visible' = '是否可见',
|
||||
'revision' = '乐观锁',
|
||||
'createdBy' = '创建人',
|
||||
'createdTime' = '创建时间',
|
||||
@ -96,7 +96,7 @@ export type GetModelAttributeType = {
|
||||
pageNum: number
|
||||
}
|
||||
|
||||
export type attributeTypeDataType = 'int4' | 'int8' | 'float4' | 'float8'
|
||||
export type attributeTypeDataType = "float" | "double" | "tinyint" | "smallint" | "int" | "bigint"
|
||||
export type AddModelAttributeType = {
|
||||
iotModelId: string
|
||||
attributeCode: string
|
||||
@ -105,7 +105,7 @@ export type AddModelAttributeType = {
|
||||
porder: number | null
|
||||
highSpeed: 0 | 1 | boolean
|
||||
subSystem: string
|
||||
dataType: ''
|
||||
dataType: attributeTypeDataType | ''
|
||||
visible: 0 | 1 | boolean
|
||||
revision: number
|
||||
createdBy?: string
|
||||
|
Loading…
Reference in New Issue
Block a user