Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
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
ReactWeb5
CivManage
Commits
db608237
Commit
db608237
authored
Nov 24, 2021
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决消息平台推送毛板配置编辑模态显示信息错误问题
parent
ef05c932
Pipeline
#38628
skipped with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
48 deletions
+52
-48
AddModal.jsx
...nter/messageManage/templateManage/components/AddModal.jsx
+1
-7
EditModal.jsx
...ter/messageManage/templateManage/components/EditModal.jsx
+51
-41
No files found.
src/pages/platformCenter/messageManage/templateManage/components/AddModal.jsx
View file @
db608237
...
@@ -64,7 +64,7 @@ const AddModal = props => {
...
@@ -64,7 +64,7 @@ const AddModal = props => {
title=
"模板添加"
title=
"模板添加"
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
style=
{
{
top
:
200
,
borderRadius
:
'20px'
}
}
style=
{
{
top
:
200
,
borderRadius
:
'20px'
}
}
width=
"8
0
0px"
width=
"8
2
0px"
destroyOnClose
destroyOnClose
cancelText=
"取消"
cancelText=
"取消"
okText=
"确认"
okText=
"确认"
...
@@ -233,12 +233,6 @@ const AddModal = props => {
...
@@ -233,12 +233,6 @@ const AddModal = props => {
label=
"解析规则"
label=
"解析规则"
name=
"analysis_params"
name=
"analysis_params"
labelCol=
{
{
span
:
6
}
}
labelCol=
{
{
span
:
6
}
}
rules=
{
[
{
required
:
true
,
message
:
'请输入解析规则'
,
},
]
}
>
>
<
TextArea
rows=
{
2
}
style=
{
{
width
:
'96%'
}
}
placeholder=
"param1|param2|param3|param4"
/>
<
TextArea
rows=
{
2
}
style=
{
{
width
:
'96%'
}
}
placeholder=
"param1|param2|param3|param4"
/>
</
Item
>
</
Item
>
...
...
src/pages/platformCenter/messageManage/templateManage/components/EditModal.jsx
View file @
db608237
...
@@ -6,15 +6,15 @@ import { Form, Input, notification, Select, Row, Col } from 'antd'
...
@@ -6,15 +6,15 @@ import { Form, Input, notification, Select, Row, Col } from 'antd'
const
{
Item
}
=
Form
;
const
{
Item
}
=
Form
;
const
{
TextArea
}
=
Input
;
const
{
TextArea
}
=
Input
;
const
EditModal
=
props
=>
{
const
EditModal
=
props
=>
{
const
{
option
}
=
props
;
const
{
option
,
visible
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
[
templateName
,
setTemplateName
]
=
useState
([]);
const
[
templateName
,
setTemplateName
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
flag
,
setFlag
]
=
useState
(
0
)
const
onSubmit
=
()
=>
{
const
onSubmit
=
()
=>
{
form
.
submit
()
form
.
submit
()
}
}
const
onSubmitSuccess
=
()
=>
{
const
onSubmitSuccess
=
()
=>
{
const
result
=
form
.
getFieldValue
()
const
result
=
form
.
getFieldValue
()
...
@@ -22,20 +22,36 @@ const EditModal = props => {
...
@@ -22,20 +22,36 @@ const EditModal = props => {
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
// console.log(props)
// if(props.template.type=='企业微信'){
// form.setFieldsValue({type:'企业微信'})
// }
// let aa
// if(props.template.third_id==null){
// aa=props.template.weixin
// }
// if(props.template.weixin==null){
// aa=props.template.third_id
// }
form
.
setFieldsValue
({
form
.
setFieldsValue
({
name
:
props
.
template
.
name
,
name
:
props
.
template
.
name
,
type
:
props
.
template
.
type
,
type
:
props
.
template
.
type
,
third_name
:
props
.
template
.
third_name
,
third_name
:
props
.
template
.
third_name
,
third_id
:
props
.
template
.
third_id
||
props
.
template
.
weixin
,
third_id
:
props
.
template
.
third_id
,
weixin
:
props
.
template
.
weixin
,
params
:
props
.
template
.
template_params1
,
params
:
props
.
template
.
template_params1
,
param1
:
props
.
template
.
template_params2
,
param1
:
props
.
template
.
template_params2
,
desc
:
props
.
template
.
desc
,
desc
:
props
.
template
.
desc
,
analysis_params
:
props
.
template
.
analysis_params
,
analysis_params
:
props
.
template
.
analysis_params
,
})
})
console
.
log
(
form
.
getFieldsValue
().
type
)
if
(
option
)
{
if
(
option
)
{
setTemplateName
(
option
.
filter
(
item
=>
item
.
Type
===
props
.
template
.
type
))
setTemplateName
(
option
.
filter
(
item
=>
item
.
Type
===
props
.
template
.
type
))
}
}
},
[
props
.
template
])
},
[
props
.
template
])
const
layout
=
{
const
layout
=
{
...
@@ -65,13 +81,14 @@ const EditModal = props => {
...
@@ -65,13 +81,14 @@ const EditModal = props => {
third_id
:
value
third_id
:
value
})
})
}
}
return
(
return
(
<
SiteModal
<
SiteModal
{
...
props
}
{
...
props
}
title=
"模板编辑"
title=
"模板编辑"
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
style=
{
{
top
:
200
,
borderRadius
:
'20px'
}
}
style=
{
{
top
:
200
,
borderRadius
:
'20px'
}
}
width=
"8
0
0px"
width=
"8
2
0px"
destroyOnClose
destroyOnClose
cancelText=
"取消"
cancelText=
"取消"
okText=
"确认"
okText=
"确认"
...
@@ -114,9 +131,7 @@ const EditModal = props => {
...
@@ -114,9 +131,7 @@ const EditModal = props => {
</
Item
>
</
Item
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
{
form
.
getFieldsValue
().
type
==
'企业微信'
||
props
.
template
.
type
==
'企业微信'
?
{
form
.
getFieldsValue
().
type
!==
'企业微信'
?
<>
<>
<
Row
gutter=
{
24
}
>
<
Row
gutter=
{
24
}
>
<
Col
span=
{
11
}
>
<
Col
span=
{
11
}
>
...
@@ -130,39 +145,33 @@ const EditModal = props => {
...
@@ -130,39 +145,33 @@ const EditModal = props => {
},
},
]
}
]
}
>
>
<
Select
<
Select
style=
{
{
width
:
'11.5rem'
}
}
onChange=
{
(
value
)
=>
onChangeType1
(
value
)
}
placeholder=
"请选择模板名称"
>
placeholder=
"请选择模板名称"
<
Select
.
Option
value=
"普通文本"
>
普通文本
</
Select
.
Option
>
onChange=
{
(
value
,
option
)
=>
onChange
(
value
,
option
)
}
<
Select
.
Option
value=
"文字卡片"
>
文字卡片
</
Select
.
Option
>
<
Select
.
Option
value=
"图片消息"
>
图片消息
</
Select
.
Option
>
>
<
Select
.
Option
value=
"图片"
>
图片
</
Select
.
Option
>
{
templateName
&&
templateName
.
length
>
0
&&
templateName
.
map
((
item
,
index
)
=>
(
<
Option
value=
{
item
.
Name
}
key=
{
item
.
Name
+
index
}
code=
{
item
.
Code
}
>
{
item
.
Name
}
</
Option
>
))
}
</
Select
>
</
Select
>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
11
}
>
<
Col
span=
{
11
}
>
<
Item
<
Item
label=
"第三方模板编号"
label=
"企业微信应用id"
name=
"third_id"
// labelCol=
{{
span
:
11
}}
name=
"weixin"
rules=
{
[
rules=
{
[
{
{
required
:
true
,
required
:
true
,
message
:
'请输入
第三方模板编
号'
,
message
:
'请输入
企业微信
号'
,
},
},
]
}
]
}
>
>
<
Input
placeholder=
"请输入
模板名称
"
/>
<
Input
placeholder=
"请输入
企业微信号
"
/>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
</>
:
</>
:
<>
<>
<
Row
gutter=
{
24
}
>
<
Row
gutter=
{
24
}
>
<
Col
span=
{
11
}
>
<
Col
span=
{
11
}
>
<
Item
<
Item
label=
"第三方模板名称"
label=
"第三方模板名称"
...
@@ -174,30 +183,37 @@ const EditModal = props => {
...
@@ -174,30 +183,37 @@ const EditModal = props => {
},
},
]
}
]
}
>
>
<
Select
style=
{
{
width
:
'12rem'
}
}
onChange=
{
(
value
)
=>
onChangeType1
(
value
)
}
placeholder=
"请选择模板名称"
>
<
Select
<
Select
.
Option
value=
"普通文本"
>
普通文本
</
Select
.
Option
>
placeholder=
"请选择模板名称"
<
Select
.
Option
value=
"文字卡片"
>
文字卡片
</
Select
.
Option
>
onChange=
{
(
value
,
option
)
=>
onChange
(
value
,
option
)
}
<
Select
.
Option
value=
"图片消息"
>
图片消息
</
Select
.
Option
>
<
Select
.
Option
value=
"图片"
>
图片
</
Select
.
Option
>
>
{
templateName
&&
templateName
.
length
>
0
&&
templateName
.
map
((
item
,
index
)
=>
(
<
Option
value=
{
item
.
Name
}
key=
{
item
.
Name
+
index
}
code=
{
item
.
Code
}
>
{
item
.
Name
}
</
Option
>
))
}
</
Select
>
</
Select
>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
11
}
>
<
Col
span=
{
11
}
>
<
Item
<
Item
label=
"企业微信应用id"
label=
"第三方模板编号"
labelCol=
{
{
span
:
11
}
}
name=
"third_id"
name=
"weixin"
rules=
{
[
rules=
{
[
{
{
required
:
true
,
required
:
true
,
message
:
'请输入
企业微信
号'
,
message
:
'请输入
第三方模板编
号'
,
},
},
]
}
]
}
>
>
<
Input
placeholder=
"请输入
企业微信号
"
/>
<
Input
placeholder=
"请输入
模板名称
"
/>
</
Item
>
</
Item
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
</>
</>
}
}
<
Row
gutter=
{
24
}
>
<
Row
gutter=
{
24
}
>
...
@@ -255,12 +271,6 @@ const EditModal = props => {
...
@@ -255,12 +271,6 @@ const EditModal = props => {
labelCol=
{
{
span
:
3
}
}
labelCol=
{
{
span
:
3
}
}
style=
{
{
marginLeft
:
'1.4rem'
}
}
style=
{
{
marginLeft
:
'1.4rem'
}
}
name=
"analysis_params"
name=
"analysis_params"
rules=
{
[
{
required
:
true
,
message
:
'请输入参数解析'
,
},
]
}
>
>
<
TextArea
rows=
{
2
}
placeholder=
"param1|param2|param3|param4"
/>
<
TextArea
rows=
{
2
}
placeholder=
"param1|param2|param3|param4"
/>
</
Item
>
</
Item
>
...
...
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