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
488800b3
authored
Dec 15, 2024
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能完善】IOT: 物模型数组数据类型组件完善
parent
1d112d56
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
8 deletions
+49
-8
src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue
+13
-1
src/views/iot/product/product/detail/ThingModel/config.ts
+0
-6
src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelArrayTypeDataSpecs.vue
+34
-0
src/views/iot/product/product/detail/ThingModel/dataSpecs/index.ts
+2
-1
No files found.
src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue
View file @
488800b3
...
@@ -47,12 +47,21 @@
...
@@ -47,12 +47,21 @@
<el-form-item
label=
"时间格式"
prop=
"date"
v-if=
"formData.dataType === DataSpecsDataType.DATE"
>
<el-form-item
label=
"时间格式"
prop=
"date"
v-if=
"formData.dataType === DataSpecsDataType.DATE"
>
<el-input
disabled
class=
"w-255px!"
placeholder=
"String类型的UTC时间戳(毫秒)"
/>
<el-input
disabled
class=
"w-255px!"
placeholder=
"String类型的UTC时间戳(毫秒)"
/>
</el-form-item>
</el-form-item>
<!-- 数组型配置-->
<ThingModelArrayTypeDataSpecs
v-model=
"formData.dataSpecs"
v-if=
"formData.dataType === DataSpecsDataType.ARRAY"
/>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
useVModel
}
from
'@vueuse/core'
import
{
useVModel
}
from
'@vueuse/core'
import
{
DataSpecsDataType
,
dataTypeOptions
}
from
'./config'
import
{
DataSpecsDataType
,
dataTypeOptions
}
from
'./config'
import
{
ThingModelEnumTypeDataSpecs
,
ThingModelNumberTypeDataSpecs
}
from
'./dataSpecs'
import
{
ThingModelArrayTypeDataSpecs
,
ThingModelEnumTypeDataSpecs
,
ThingModelNumberTypeDataSpecs
}
from
'./dataSpecs'
/** 物模型数据 */
/** 物模型数据 */
defineOptions
({
name
:
'ThingModelDataSpecs'
})
defineOptions
({
name
:
'ThingModelDataSpecs'
})
...
@@ -91,6 +100,9 @@ const handleChange = (dataType: any) => {
...
@@ -91,6 +100,9 @@ const handleChange = (dataType: any) => {
})
})
}
}
break
break
case
DataSpecsDataType
.
ARRAY
:
formData
.
value
.
dataSpecs
.
dataType
=
DataSpecsDataType
.
ARRAY
break
}
}
}
}
</
script
>
</
script
>
...
...
src/views/iot/product/product/detail/ThingModel/config.ts
View file @
488800b3
...
@@ -10,12 +10,6 @@ export interface DataSpecsNumberDataVO {
...
@@ -10,12 +10,6 @@ export interface DataSpecsNumberDataVO {
unitName
:
string
// 单位的名称
unitName
:
string
// 单位的名称
}
}
/** dataSpecs 文本型数据结构 */
export
interface
DataSpecsTextDataVO
{
dataType
:
'TEXT'
length
:
number
}
/** dataSpecs 枚举型数据结构 */
/** dataSpecs 枚举型数据结构 */
export
interface
DataSpecsEnumOrBoolDataVO
{
export
interface
DataSpecsEnumOrBoolDataVO
{
dataType
:
'enum'
|
'bool'
dataType
:
'enum'
|
'bool'
...
...
src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelArrayTypeDataSpecs.vue
0 → 100644
View file @
488800b3
<
template
>
<el-form-item
label=
"元素类型"
prop=
"childDataType"
>
<el-radio-group
v-model=
"dataSpecs.childDataType"
>
<template
v-for=
"item in dataTypeOptions"
:key=
"item.value"
>
<el-radio
:value=
"item.value"
v-if=
"
!(
[DataSpecsDataType.ENUM, DataSpecsDataType.ARRAY, DataSpecsDataType.DATE] as any[]
).includes(item.value)
"
>
{{
item
.
label
}}
</el-radio>
</
template
>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"元素个数"
prop=
"size"
>
<el-input
v-model=
"dataSpecs.size"
placeholder=
"请输入数组中的元素个数"
/>
</el-form-item>
</template>
<
script
lang=
"ts"
setup
>
import
{
useVModel
}
from
'@vueuse/core'
import
{
DataSpecsDataType
,
dataTypeOptions
}
from
'../config'
/** 数值型的 dataSpecs 配置组件 */
defineOptions
({
name
:
'ThingModelArrayTypeDataSpecs'
})
const
props
=
defineProps
<
{
modelValue
:
any
}
>
()
const
emits
=
defineEmits
([
'update:modelValue'
])
const
dataSpecs
=
useVModel
(
props
,
'modelValue'
,
emits
)
as
Ref
<
any
>
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
src/views/iot/product/product/detail/ThingModel/dataSpecs/index.ts
View file @
488800b3
import
ThingModelEnumTypeDataSpecs
from
'./ThingModelEnumTypeDataSpecs.vue'
import
ThingModelEnumTypeDataSpecs
from
'./ThingModelEnumTypeDataSpecs.vue'
import
ThingModelNumberTypeDataSpecs
from
'./ThingModelNumberTypeDataSpecs.vue'
import
ThingModelNumberTypeDataSpecs
from
'./ThingModelNumberTypeDataSpecs.vue'
import
ThingModelArrayTypeDataSpecs
from
'./ThingModelArrayTypeDataSpecs.vue'
export
{
ThingModelEnumTypeDataSpecs
,
ThingModelNumberTypeDataSpecs
}
export
{
ThingModelEnumTypeDataSpecs
,
ThingModelNumberTypeDataSpecs
,
ThingModelArrayTypeDataSpecs
}
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