From fbc5bc7c7e2684862ed68e49a6ba765024aac83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E4=BA=91=E9=B9=8F?= Date: Fri, 18 Oct 2024 14:42:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=A8=A1=E5=9E=8B=EF=BC=9A1=E3=80=81?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=B1=9E=E6=80=A7=E8=A1=A8=E5=8D=95dataType?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=8F=90=E4=BE=9B=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=202=E3=80=81=E4=BF=AE=E6=94=B9dataType?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/backend/auth/model/index.vue | 21 +++++++------------ .../src/views/backend/auth/model/type.ts | 6 +++--- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/ui/dasadmin/src/views/backend/auth/model/index.vue b/ui/dasadmin/src/views/backend/auth/model/index.vue index 560d7d1e..e4c59d7b 100644 --- a/ui/dasadmin/src/views/backend/auth/model/index.vue +++ b/ui/dasadmin/src/views/backend/auth/model/index.vue @@ -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(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 = () => { diff --git a/ui/dasadmin/src/views/backend/auth/model/type.ts b/ui/dasadmin/src/views/backend/auth/model/type.ts index 88b73044..da173f66 100644 --- a/ui/dasadmin/src/views/backend/auth/model/type.ts +++ b/ui/dasadmin/src/views/backend/auth/model/type.ts @@ -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