Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gjjs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fukai
vue-gjjs
Commits
767f42e2
Commit
767f42e2
authored
Mar 31, 2023
by
李少勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改校验相关问题
parent
b0ca9b52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
index.js
src/business/gitopn/event/index.js
+18
-15
No files found.
src/business/gitopn/event/index.js
View file @
767f42e2
...
...
@@ -21,9 +21,6 @@ export default {
},
// 检核
async
handleCheck
()
{
// this.$refs['modelForm'].validate((valid) => {
// console.log('valid', valid)
// })
const
loading
=
this
.
loading
(
'正在校验数据'
);
const
rtnmsg
=
await
Api
.
post
(
'/service/gitopn/checkAll'
,
{
...
this
.
model
,
...
...
@@ -31,19 +28,25 @@ export default {
userId
:
window
.
sessionStorage
.
userId
||
'ZL'
,
});
if
(
rtnmsg
.
respCode
===
SUCCESS
)
{
console
.
log
(
'=====校验'
,
rtnmsg
)
// this.updateValueSet(rtnmsg.codeSet);
let
errorRules
=
rtnmsg
.
data
Object
.
keys
(
errorRules
).
map
((
ruleKey
)
=>
{
// 此处判断是为了区分,如果在前端做了校验后端也校验了就不采用自定义校验规则
if
(
!
this
.
rules
[
ruleKey
])
{
this
.
rules
[
ruleKey
]
=
[
{
validator
:
(
rule
,
value
,
callback
)
=>
{
callback
(
new
Error
(
errorRules
[
ruleKey
]))
},
trigger
:
[
'change'
,
'blur'
]
}
]
}
})
console
.
log
(
'rules'
,
this
.
rules
)
this
.
$refs
[
'modelForm'
].
validate
((
valid
)
=>
{
console
.
log
(
'valid'
,
valid
)
})
}
// if (rtnmsg.respCode === SUCCESS) {
// const fieldErrors = rtnmsg.fieldErrors;
// this.updateModel(rtnmsg.data);
// if (fieldErrors && Object.keys(fieldErrors).length === 0) {
// // 清除之前的校验状态
// this.getRoot().$refs.modelForm.clearValidate();
// return;
// }
// }
// this.$notify({
// title: '成功',
// message: '校验成功',
...
...
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