Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
imac-vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Elements-SY
2023-10-19 14:12:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
39b71ffab0bc9775467a94bce9905e01c59da981
39b71ffa
1 parent
8653715c
modify
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
src/views/allocationConfig/flightAllocConfig/mixins/index.js
src/views/allocationConfig/flightAllocConfig/mixins/index.js
View file @
39b71ff
...
...
@@ -782,29 +782,37 @@ export default {
notDestinationSite
,
}
)
{
let
locationVal
,
notLocationVal
,
repeat
,
validate
;
let
locationVal
,
notLocationVal
,
locationRepeat
,
validateLocation
,
destinationSiteRepeat
;
if
(
isLocation
==
"1"
)
{
// 分隔字符串并且转数组&去除数组空字符串
locationVal
=
location
.
split
(
";"
).
filter
((
str
)
=>
str
!==
""
);
// 是否有重复的
r
epeat
=
new
Set
(
locationVal
).
size
!==
locationVal
.
length
;
locationR
epeat
=
new
Set
(
locationVal
).
size
!==
locationVal
.
length
;
// 校验校验开头以字母或者数字开头的/^[a-zA-Z0-9]*$/
validate
=
locationVal
.
every
((
item
)
=>
/^
[
a-zA-Z0-9
]
*$/
.
test
(
item
));
validateLocation
=
locationVal
.
every
((
item
)
=>
/^
[
a-zA-Z0-9
]
*$/
.
test
(
item
)
);
}
else
{
notLocationVal
=
notLocation
.
split
(
";"
).
filter
((
str
)
=>
str
!==
""
);
repeat
=
new
Set
(
notLocationVal
).
size
!==
notLocationVal
.
length
;
validate
=
locationVal
.
every
((
item
)
=>
/^
[
a-zA-Z0-9
]
*$/
.
test
(
item
));
locationRepeat
=
new
Set
(
notLocationVal
).
size
!==
notLocationVal
.
length
;
validateLocation
=
locationVal
.
every
((
item
)
=>
/^
[
a-zA-Z0-9
]
*$/
.
test
(
item
)
);
}
if
(
r
epeat
)
{
if
(
locationR
epeat
)
{
this
.
routesInfo
[
index
].
locationError
=
"填写的目的地已重复"
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
if
(
!
validate
)
{
if
(
!
validate
Location
)
{
this
.
routesInfo
[
index
].
locationError
=
"目的地之间用分号分隔,例:P1;P2;P3"
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
if
(
!
repeat
&&
validate
)
{
if
(
!
locationRepeat
&&
validateLocation
)
{
this
.
routesInfo
[
index
].
locationError
=
""
;
this
.
$set
(
this
.
routesInfo
,
index
,
this
.
routesInfo
[
index
]);
}
...
...
Please
register
or
login
to post a comment