Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
228bc72c
authored
2025-12-03 13:15:13 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
连接器IP和域名填写一个即可
1 parent
e414f870
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
src/hooks/useValidator.ts
src/views/data_facilitator/settleStart.vue
src/hooks/useValidator.ts
View file @
228bc72
...
...
@@ -220,6 +220,10 @@ export const useValidator = () => {
const
validateIPList
=
():
FormItemRule
=>
{
return
{
validator
:
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
if
(
!
value
)
{
callback
();
return
;
}
let
ips
=
value
?.
split
(
","
);
if
(
!
ips
)
{
callback
(
new
Error
(
`请填写合法的IP地址`
));
...
...
@@ -242,6 +246,10 @@ export const useValidator = () => {
const
validateDomainList
=
():
FormItemRule
=>
{
return
{
validator
:
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
if
(
!
value
)
{
callback
();
return
;
}
let
domains
=
value
?.
split
(
","
);
if
(
!
domains
)
{
callback
(
new
Error
(
`请填写合法的IP地址`
));
...
...
src/views/data_facilitator/settleStart.vue
View file @
228bc72
...
...
@@ -127,7 +127,7 @@ const baseInfoFormItems = ref([
default
:
""
,
placeholder
:
"支持以逗号,分隔的多地址配置,格式IPv4/IPv6"
,
clearable
:
true
,
required
:
tru
e
,
required
:
fals
e
,
block
:
true
,
},
{
...
...
@@ -137,7 +137,7 @@ const baseInfoFormItems = ref([
default
:
""
,
placeholder
:
"支持以逗号,分隔的多个域名配置"
,
clearable
:
true
,
required
:
tru
e
,
required
:
fals
e
,
block
:
true
,
},
]);
...
...
@@ -145,8 +145,8 @@ const baseInfoFormItems = ref([
const
baseInfoFormRules
=
ref
({
connectorName
:
[
required
(
"请填写连接器名称"
)],
accessMethod
:
[
required
(
"请选择接入方式"
)],
ipAddressList
:
[
required
(
"请填写IP地址列表"
),
validateIPList
()],
//TODO,校验IP地址和域名
domainList
:
[
required
(
"请填写域名信息"
),
validateDomainList
()],
ipAddressList
:
[
/*required("请填写IP地址列表"),*/
validateIPList
()],
//TODO,校验IP地址和域名
domainList
:
[
/*required("请填写域名信息"),*/
validateDomainList
()],
});
/** 连接器附属信息表单配置 */
...
...
@@ -499,6 +499,11 @@ const saveDraft = () => {
const
submit
=
()
=>
{
baseInfoFormRef
.
value
.
ruleFormRef
.
validate
((
valid1
,
errorItem1
)
=>
{
let
baseForminline
=
baseInfoFormRef
.
value
.
formInline
;
if
(
!
baseForminline
.
ipAddressList
&&
!
baseForminline
.
domainList
)
{
proxy
.
$ElMessage
.
error
(
'IP地址和域名信息请至少填写一个'
);
return
;
}
if
(
valid1
)
{
addInfoFormRef
.
value
.
ruleFormRef
.
validate
((
valid2
,
errorItem2
)
=>
{
if
(
valid2
)
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment