diff --git a/ui/dasadmin/.env.development b/ui/dasadmin/.env.development
index c8c70d94..d5455a0b 100644
--- a/ui/dasadmin/.env.development
+++ b/ui/dasadmin/.env.development
@@ -6,9 +6,10 @@ VITE_BASE_PATH = './'
# 代理配置(开发使用),必须在一行中
# 本地
- # VITE_APP_PROXY=[["/api","http://10.65.57.55:8080/api"]]
+# VITE_APP_PROXY=[["/api","http://192.168.130.12:8080/api"]]
# 线上
VITE_APP_PROXY=[["/api","https://test.jsspisoft.com/api"]]
+
diff --git a/ui/dasadmin/src/views/backend/auth/model/index.vue b/ui/dasadmin/src/views/backend/auth/model/index.vue
index 054f7ead..0858f3dd 100644
--- a/ui/dasadmin/src/views/backend/auth/model/index.vue
+++ b/ui/dasadmin/src/views/backend/auth/model/index.vue
@@ -185,13 +185,28 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -201,6 +216,9 @@
+
+
+
提交
@@ -278,7 +296,9 @@ import {
ModelAttributeTableType,
ModelServiceTableType,
ModelServiceFieldsEnums,
+ ModelAttributeType,
AttributeDialogTitleStateType,
+ attributeTypeDataType,
serviceDialogTitleStateType,
GetModelServiceType,
GetModelAttributeType,
@@ -533,6 +553,7 @@ const getAttributeList = (type?: radioGroupType, value?: string) => {
? '离散量'
: item.attributeType!,
highSpeed: item.highSpeed === 1,
+ visible: item.visible === 1,
}
})
pageTotal.value = res.total
@@ -607,6 +628,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' },
+]
const originAttributeForm: AddModelAttributeType & UpdateModelAttributeType = {
id: null,
iotModelId: '',
@@ -615,7 +642,9 @@ const originAttributeForm: AddModelAttributeType & UpdateModelAttributeType = {
attributeType: null,
porder: null,
highSpeed: false,
- subsystem:'',
+ subsystem: '',
+ dataType: '',
+ visible: true,
revision: 1,
createdBy: undefined,
createdTime: undefined,
@@ -625,6 +654,12 @@ const originAttributeForm: AddModelAttributeType & UpdateModelAttributeType = {
const attributeFormRef = ref()
const attributeForm = ref(JSON.parse(JSON.stringify(originAttributeForm)))
+const attributeTypeChange = (value: ModelAttributeType) => {
+ if (value === 140) {
+ attributeForm.value.dataType = ''
+ }
+}
+
const closeAttributeForm = () => {
attributeVisible.value = false
attributeForm.value = JSON.parse(JSON.stringify(originAttributeForm))
@@ -633,11 +668,12 @@ const closeAttributeForm = () => {
const submitAttributeForm = () => {
attributeFormRef.value?.validate((valid: boolean) => {
if (valid) {
+ const copyFormData = JSON.parse(JSON.stringify(attributeForm.value))
+ copyFormData.highSpeed = copyFormData.highSpeed ? 1 : 0
+ copyFormData.visible = copyFormData.visible ? 1 : 0
if (attributeFormTitle.value === AttributeDialogTitleStateType['add']) {
- const addFormData = JSON.parse(JSON.stringify(attributeForm.value))
- addFormData.iotModelId = curContextMenuTreeData.value!.id!
- addFormData.highSpeed = addFormData.highSpeed ? 1 : 0
- addModelAttributeReq(addFormData)
+ copyFormData.iotModelId = curContextMenuTreeData.value!.id!
+ addModelAttributeReq(copyFormData)
.then((res) => {
if (res.success) {
ElMessage.success('新增物模型属性成功')
@@ -651,9 +687,7 @@ const submitAttributeForm = () => {
ElMessage.error(err?.response?.data?.msg ?? '新增失败')
})
} else if (attributeFormTitle.value === AttributeDialogTitleStateType['edit']) {
- const updateForm = JSON.parse(JSON.stringify(attributeForm.value))
- updateForm.highSpeed = updateForm.highSpeed ? 1 : 0
- updateModelAttributeReq(updateForm)
+ updateModelAttributeReq(copyFormData)
.then((res) => {
if (res.success) {
ElMessage.success('修改物模型属性成功')
@@ -964,4 +998,10 @@ $paginationHeight: 32px;
}
}
}
+.formRowStyle {
+ display: flex;
+ .el-select {
+ width: 184px;
+ }
+}
diff --git a/ui/dasadmin/src/views/backend/auth/model/type.ts b/ui/dasadmin/src/views/backend/auth/model/type.ts
index 8c510b26..ee7c2da2 100644
--- a/ui/dasadmin/src/views/backend/auth/model/type.ts
+++ b/ui/dasadmin/src/views/backend/auth/model/type.ts
@@ -62,8 +62,10 @@ export enum ModelAttributeFieldsEnums {
'attributeType' = '属性类型value',
'attributeTypeName' = '属性类型',
'porder' = '序号',
- 'highSpeed'='是否高频',
- 'subsystem'='子系统',
+ 'highSpeed' = '是否高频',
+ 'subsystem' = '子系统',
+ 'dataType' = '数据类型',
+ 'visible'='是否可见',
'revision' = '乐观锁',
'createdBy' = '创建人',
'createdTime' = '创建时间',
@@ -94,14 +96,17 @@ export type GetModelAttributeType = {
pageNum: number
}
+export type attributeTypeDataType = 'int4' | 'int8' | 'float4' | 'float8'
export type AddModelAttributeType = {
iotModelId: string
attributeCode: string
attributeName: string
attributeType: ModelAttributeType | null
porder: number | null
- highSpeed:0|1|boolean
- subsystem:string
+ highSpeed: 0 | 1 | boolean
+ subsystem: string
+ dataType: ''
+ visible: 0 | 1 | boolean
revision: number
createdBy?: string
createdTime?: string