Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
Project
Project
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
zhaowei
dlink
Commits
32159aff
Commit
32159aff
authored
Mar 27, 2022
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix-211][web]Fix to create form linkage
parent
c73d67d1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
WeChatForm.tsx
dlink-web/src/pages/AlertInstance/components/WeChatForm.tsx
+6
-8
function.ts
dlink-web/src/pages/AlertInstance/function.ts
+2
-2
No files found.
dlink-web/src/pages/AlertInstance/components/WeChatForm.tsx
View file @
32159aff
...
@@ -34,7 +34,6 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -34,7 +34,6 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
}
=
props
;
}
=
props
;
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
console
.
log
(
change
);
setFormVals
({...
formVals
,...
change
});
setFormVals
({...
formVals
,...
change
});
};
};
...
@@ -44,7 +43,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -44,7 +43,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
handleSubmit
(
buildJSONData
(
formVals
,
fieldsValue
));
handleSubmit
(
buildJSONData
(
formVals
,
fieldsValue
));
};
};
const
renderContent
=
()
=>
{
const
renderContent
=
(
vals
)
=>
{
return
(
return
(
<>
<>
<
Divider
>
微信企业号配置
</
Divider
>
<
Divider
>
微信企业号配置
</
Divider
>
...
@@ -66,7 +65,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -66,7 +65,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
<
Radio
value=
'群聊'
>
群聊
</
Radio
>
<
Radio
value=
'群聊'
>
群聊
</
Radio
>
</
Radio
.
Group
>
</
Radio
.
Group
>
</
Form
.
Item
>
</
Form
.
Item
>
{
(
formVals
.
sendType
==
"群聊"
)
&&
{
(
vals
.
sendType
==
"群聊"
)
?
<>
<>
<
Form
.
Item
<
Form
.
Item
name=
"webhook"
name=
"webhook"
...
@@ -86,9 +85,9 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -86,9 +85,9 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
validateTrigger=
{
[
'onChange'
,
'onBlur'
]
}
validateTrigger=
{
[
'onChange'
,
'onBlur'
]
}
label=
"@所有人"
>
label=
"@所有人"
>
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
defaultChecked=
{
formV
als
.
isAtAll
}
/>
defaultChecked=
{
v
als
.
isAtAll
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
{
(
!
formV
als
.
isAtAll
)
&&
{
(
!
v
als
.
isAtAll
)
&&
<
Form
.
Item
<
Form
.
Item
name=
"users"
name=
"users"
label=
"被@用户"
label=
"被@用户"
...
@@ -98,8 +97,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -98,8 +97,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
</
Form
.
Item
>
</
Form
.
Item
>
}
}
</>
</>
}
:
{
(
!
formVals
.
sendType
||
formVals
.
sendType
==
"应用"
)
&&
<>
<>
<
Form
.
Item
<
Form
.
Item
name=
"corpId"
name=
"corpId"
...
@@ -152,7 +150,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
...
@@ -152,7 +150,7 @@ const WeChatForm: React.FC<AlertInstanceFormProps> = (props) => {
name=
"enabled"
name=
"enabled"
label=
"是否启用"
>
label=
"是否启用"
>
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
defaultChecked=
{
formV
als
.
enabled
}
/>
defaultChecked=
{
v
als
.
enabled
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
</>
</>
);
);
...
...
dlink-web/src/pages/AlertInstance/function.ts
View file @
32159aff
import
{
AlertInstanceTableListItem
}
from
"@/pages/AlertInstance/data"
;
import
{
AlertInstanceTableListItem
}
from
"@/pages/AlertInstance/data"
;
export
const
getJSONData
=
(
values
:
AlertInstanceTableListItem
)
=>
{
export
const
getJSONData
=
(
values
:
AlertInstanceTableListItem
)
=>
{
if
(
!
values
||!
values
.
params
||
values
.
params
==
''
){
if
(
!
values
.
params
||
values
.
params
==
''
){
return
{}
;
return
values
;
}
}
let
data
=
JSON
.
parse
(
values
.
params
);
let
data
=
JSON
.
parse
(
values
.
params
);
return
{...
data
,...
values
};
return
{...
data
,...
values
};
...
...
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