Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ca035932
authored
Dec 27, 2024
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能完善】IOT: ThingModel 表单编辑回显
parent
44d634c8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
6 deletions
+24
-6
src/utils/dict.ts
+2
-2
src/views/iot/thingmodel/ThingModelForm.vue
+19
-1
src/views/iot/thingmodel/dataSpecs/ThingModelNumberDataSpecs.vue
+1
-1
src/views/iot/thingmodel/index.vue
+2
-2
No files found.
src/utils/dict.ts
View file @
ca035932
...
@@ -236,9 +236,9 @@ export enum DICT_TYPE {
...
@@ -236,9 +236,9 @@ export enum DICT_TYPE {
IOT_DATA_FORMAT
=
'iot_data_format'
,
// IOT 数据格式
IOT_DATA_FORMAT
=
'iot_data_format'
,
// IOT 数据格式
IOT_PROTOCOL_TYPE
=
'iot_protocol_type'
,
// IOT 接入网关协议
IOT_PROTOCOL_TYPE
=
'iot_protocol_type'
,
// IOT 接入网关协议
IOT_DEVICE_STATUS
=
'iot_device_status'
,
// IOT 设备状态
IOT_DEVICE_STATUS
=
'iot_device_status'
,
// IOT 设备状态
IOT_
PRODUCT_THING_MODEL_TYPE
=
'iot_produc
t_thing_model_type'
,
// IOT 产品功能类型
IOT_
THING_MODEL_TYPE
=
'io
t_thing_model_type'
,
// IOT 产品功能类型
IOT_DATA_TYPE
=
'iot_data_type'
,
// IOT 数据类型
IOT_DATA_TYPE
=
'iot_data_type'
,
// IOT 数据类型
IOT_
PRODUCT_THING_MODEL_UNIT
=
'iot_produc
t_thing_model_unit'
,
// IOT 物模型单位
IOT_
THING_MODEL_UNIT
=
'io
t_thing_model_unit'
,
// IOT 物模型单位
IOT_RW_TYPE
=
'iot_rw_type'
,
// IOT 读写类型
IOT_RW_TYPE
=
'iot_rw_type'
,
// IOT 读写类型
IOT_PLUGIN_DEPLOY_TYPE
=
'iot_plugin_deploy_type'
,
// IOT 插件部署类型
IOT_PLUGIN_DEPLOY_TYPE
=
'iot_plugin_deploy_type'
,
// IOT 插件部署类型
IOT_PLUGIN_STATUS
=
'iot_plugin_status'
,
// IOT 插件状态
IOT_PLUGIN_STATUS
=
'iot_plugin_status'
,
// IOT 插件状态
...
...
src/views/iot/thingmodel/ThingModelForm.vue
View file @
ca035932
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,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"
>
<el-radio-button
<el-radio-button
v-for=
"dict in getIntDictOptions(DICT_TYPE.IOT_
PRODUCT_
THING_MODEL_TYPE)"
v-for=
"dict in getIntDictOptions(DICT_TYPE.IOT_THING_MODEL_TYPE)"
:key=
"dict.value"
:key=
"dict.value"
:value=
"dict.value"
:value=
"dict.value"
>
>
...
@@ -103,6 +103,24 @@ const open = async (type: string, id?: number) => {
...
@@ -103,6 +103,24 @@ const open = async (type: string, id?: number) => {
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
formData
.
value
=
await
ThingModelApi
.
getThingModel
(
id
)
formData
.
value
=
await
ThingModelApi
.
getThingModel
(
id
)
// 情况一:属性初始化
if
(
isEmpty
(
formData
.
value
.
property
))
{
formData
.
value
.
dataType
=
DataSpecsDataType
.
INT
formData
.
value
.
property
=
{
dataType
:
DataSpecsDataType
.
INT
,
dataSpecs
:
{
dataType
:
DataSpecsDataType
.
INT
}
}
}
// 情况二:服务初始化
if
(
isEmpty
(
formData
.
value
.
service
))
{
formData
.
value
.
service
=
{}
}
// 情况三:事件初始化
if
(
isEmpty
(
formData
.
value
.
event
))
{
formData
.
value
.
event
=
{}
}
}
finally
{
}
finally
{
formLoading
.
value
=
false
formLoading
.
value
=
false
}
}
...
...
src/views/iot/thingmodel/dataSpecs/ThingModelNumberDataSpecs.vue
View file @
ca035932
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
@
change=
"unitChange"
@
change=
"unitChange"
>
>
<el-option
<el-option
v-for=
"(item, index) in getStrDictOptions(DICT_TYPE.IOT_
PRODUCT_
THING_MODEL_UNIT)"
v-for=
"(item, index) in getStrDictOptions(DICT_TYPE.IOT_THING_MODEL_UNIT)"
:key=
"index"
:key=
"index"
:label=
"item.label + '-' + item.value"
:label=
"item.label + '-' + item.value"
:value=
"item.label + '-' + item.value"
:value=
"item.label + '-' + item.value"
...
...
src/views/iot/thingmodel/index.vue
View file @
ca035932
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
placeholder=
"请选择功能类型"
placeholder=
"请选择功能类型"
>
>
<el-option
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.IOT_
PRODUCT_
THING_MODEL_TYPE)"
v-for=
"dict in getIntDictOptions(DICT_TYPE.IOT_THING_MODEL_TYPE)"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
<el-table
v-loading=
"loading"
:data=
"list"
:show-overflow-tooltip=
"true"
:stripe=
"true"
>
<el-table
v-loading=
"loading"
:data=
"list"
:show-overflow-tooltip=
"true"
:stripe=
"true"
>
<el-table-column
align=
"center"
label=
"功能类型"
prop=
"type"
>
<el-table-column
align=
"center"
label=
"功能类型"
prop=
"type"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.IOT_
PRODUCT_
THING_MODEL_TYPE"
:value=
"scope.row.type"
/>
<dict-tag
:type=
"DICT_TYPE.IOT_THING_MODEL_TYPE"
:value=
"scope.row.type"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"功能名称"
prop=
"name"
/>
<el-table-column
align=
"center"
label=
"功能名称"
prop=
"name"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment