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
dd1eb5de
authored
Feb 22, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码评审】IoT:物模型
parent
67fb5ecf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
src/utils/index.ts
+2
-2
src/views/iot/thingmodel/config.ts
+1
-3
No files found.
src/utils/index.ts
View file @
dd1eb5de
import
{
toNumber
}
from
'lodash-es'
import
{
toNumber
}
from
'lodash-es'
/**
/**
*
*
...
@@ -459,7 +459,7 @@ export function jsonParse(str: string) {
...
@@ -459,7 +459,7 @@ export function jsonParse(str: string) {
try
{
try
{
return
JSON
.
parse
(
str
)
return
JSON
.
parse
(
str
)
}
catch
(
e
)
{
}
catch
(
e
)
{
// console.error
(`str[${str}] 不是一个 JSON 字符串`)
console
.
log
(
`str[
${
str
}
] 不是一个 JSON 字符串`
)
return
''
return
''
}
}
}
}
src/views/iot/thingmodel/config.ts
View file @
dd1eb5de
import
{
isEmpty
}
from
'@/utils/is'
import
{
isEmpty
}
from
'@/utils/is'
/** dataSpecs 数值型数据结构 */
/** dataSpecs 数值型数据结构 */
export
interface
DataSpecsNumberDataVO
{
export
interface
DataSpecsNumberDataVO
{
...
@@ -21,7 +21,6 @@ export interface DataSpecsEnumOrBoolDataVO {
...
@@ -21,7 +21,6 @@ export interface DataSpecsEnumOrBoolDataVO {
}
}
/** 属性值的数据类型 */
/** 属性值的数据类型 */
// TODO @puhui999:这个枚举类,要不放到 dict 里? 这个全是当常量来使用的不好放 dict 里 🤣
export
const
DataSpecsDataType
=
{
export
const
DataSpecsDataType
=
{
INT
:
'int'
,
INT
:
'int'
,
FLOAT
:
'float'
,
FLOAT
:
'float'
,
...
@@ -35,7 +34,6 @@ export const DataSpecsDataType = {
...
@@ -35,7 +34,6 @@ export const DataSpecsDataType = {
}
as
const
}
as
const
/** 物体模型数据类型配置项 */
/** 物体模型数据类型配置项 */
// TODO @puhui999:搞到字典里;label 只使用()部分,就是整数型、单精度浮点型等,这种哈。这样,拼接 value(label) 就可以渲染出来,通用性更强
export
const
dataTypeOptions
=
[
export
const
dataTypeOptions
=
[
{
value
:
DataSpecsDataType
.
INT
,
label
:
'整数型'
},
{
value
:
DataSpecsDataType
.
INT
,
label
:
'整数型'
},
{
value
:
DataSpecsDataType
.
FLOAT
,
label
:
'单精度浮点型'
},
{
value
:
DataSpecsDataType
.
FLOAT
,
label
:
'单精度浮点型'
},
...
...
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