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
05245855
authored
Oct 13, 2024
by
安浩浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能优化】优化IOT物模型编辑表单验证规则
parent
18eabfb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
src/views/iot/product/detail/ThinkModelFunctionForm.vue
+6
-9
No files found.
src/views/iot/product/detail/ThinkModelFunctionForm.vue
View file @
05245855
...
...
@@ -138,7 +138,7 @@ const formRules = reactive({
trigger
:
'blur'
},
{
validator
:
(
rule
,
value
,
callback
)
=>
{
validator
:
(
value
,
callback
)
=>
{
const
reservedKeywords
=
[
'set'
,
'get'
,
'post'
,
'property'
,
'event'
,
'time'
,
'value'
]
if
(
reservedKeywords
.
includes
(
value
))
{
callback
(
...
...
@@ -153,12 +153,8 @@ const formRules = reactive({
trigger
:
'blur'
}
],
property
:
{
dataType
:
{
type
:
[{
required
:
true
,
message
:
'数据类型不能为空'
,
trigger
:
'blur'
}]
},
accessMode
:
[{
required
:
true
,
message
:
'读写类型不能为空'
,
trigger
:
'blur'
}]
}
'property.dataType.type'
:
[{
required
:
true
,
message
:
'数据类型不能为空'
,
trigger
:
'blur'
}],
'property.accessMode'
:
[{
required
:
true
,
message
:
'读写类型不能为空'
,
trigger
:
'blur'
}]
})
const
formRef
=
ref
()
...
...
@@ -195,9 +191,9 @@ const submitForm = async () => {
await
ThinkModelFunctionApi
.
updateThinkModelFunction
(
data
)
message
.
success
(
t
(
'common.updateSuccess'
))
}
}
finally
{
dialogVisible
.
value
=
false
// 确保关闭弹框
emit
(
'success'
)
}
finally
{
formLoading
.
value
=
false
}
}
...
...
@@ -231,4 +227,4 @@ const resetForm = () => {
}
formRef
.
value
?.
resetFields
()
}
</
script
>
</
script
>
\ No newline at end of file
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