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 => {
title=
"模板添加"
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
style=
{
{
top
:
200
,
borderRadius
:
'20px'
}
}
width=
"8
0
0px"
width=
"8
2
0px"
destroyOnClose
cancelText=
"取消"
okText=
"确认"
...
...
@@ -233,12 +233,6 @@ const AddModal = props => {
label=
"解析规则"
name=
"analysis_params"
labelCol=
{
{
span
:
6
}
}
rules=
{
[
{
required
:
true
,
message
:
'请输入解析规则'
,
},
]
}
>
<
TextArea
rows=
{
2
}
style=
{
{
width
:
'96%'
}
}
placeholder=
"param1|param2|param3|param4"
/>
</
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'
const
{
Item
}
=
Form
;
const
{
TextArea
}
=
Input
;
const
EditModal
=
props
=>
{
const
{
option
}
=
props
;
const
{
option
,
visible
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
templateName
,
setTemplateName
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
flag
,
setFlag
]
=
useState
(
0
)
const
onSubmit
=
()
=>
{
form
.
submit
()
}
const
onSubmitSuccess
=
()
=>
{
const
result
=
form
.
getFieldValue
()
...
...
@@ -22,20 +22,36 @@ const EditModal = props => {
}
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
({
name
:
props
.
template
.
name
,
type
:
props
.
template
.
type
,
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
,
param1
:
props
.
template
.
template_params2
,
desc
:
props
.
template
.
desc
,
analysis_params
:
props
.
template
.
analysis_params
,
})
console
.
log
(
form
.
getFieldsValue
().
type
)
if
(
option
)
{
setTemplateName
(
option
.
filter
(
item
=>
item
.
Type
===
props
.
template
.
type
))
}
},
[
props
.
template
])
const
layout
=
{
...
...
@@ -65,13 +81,14 @@ const EditModal = props => {
third_id
:
value
})
}
return
(
<
SiteModal
{
...
props
}
title=
"模板编辑"
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
style=
{
{
top
:
200
,
borderRadius
:
'20px'
}
}
width=
"8
0
0px"
width=
"8
2
0px"
destroyOnClose
cancelText=
"取消"
okText=
"确认"
...
...
@@ -114,9 +131,7 @@ const EditModal = props => {
</
Item
>
</
Col
>
</
Row
>
{
form
.
getFieldsValue
().
type
!==
'企业微信'
?
{
form
.
getFieldsValue
().
type
==
'企业微信'
||
props
.
template
.
type
==
'企业微信'
?
<>
<
Row
gutter=
{
24
}
>
<
Col
span=
{
11
}
>
...
...
@@ -130,39 +145,33 @@ const EditModal = props => {
},
]
}
>
<
Select
placeholder=
"请选择模板名称"
onChange=
{
(
value
,
option
)
=>
onChange
(
value
,
option
)
}
>
{
templateName
&&
templateName
.
length
>
0
&&
templateName
.
map
((
item
,
index
)
=>
(
<
Option
value=
{
item
.
Name
}
key=
{
item
.
Name
+
index
}
code=
{
item
.
Code
}
>
{
item
.
Name
}
</
Option
>
))
}
<
Select
style=
{
{
width
:
'11.5rem'
}
}
onChange=
{
(
value
)
=>
onChangeType1
(
value
)
}
placeholder=
"请选择模板名称"
>
<
Select
.
Option
value=
"普通文本"
>
普通文本
</
Select
.
Option
>
<
Select
.
Option
value=
"文字卡片"
>
文字卡片
</
Select
.
Option
>
<
Select
.
Option
value=
"图片消息"
>
图片消息
</
Select
.
Option
>
<
Select
.
Option
value=
"图片"
>
图片
</
Select
.
Option
>
</
Select
>
</
Item
>
</
Col
>
<
Col
span=
{
11
}
>
<
Item
label=
"第三方模板编号"
name=
"third_id"
label=
"企业微信应用id"
// labelCol=
{{
span
:
11
}}
name=
"weixin"
rules=
{
[
{
required
:
true
,
message
:
'请输入
第三方模板编
号'
,
message
:
'请输入
企业微信
号'
,
},
]
}
>
<
Input
placeholder=
"请输入
模板名称
"
/>
<
Input
placeholder=
"请输入
企业微信号
"
/>
</
Item
>
</
Col
>
</
Row
>
</>
:
<>
<
Row
gutter=
{
24
}
>
<
Row
gutter=
{
24
}
>
<
Col
span=
{
11
}
>
<
Item
label=
"第三方模板名称"
...
...
@@ -174,30 +183,37 @@ const EditModal = props => {
},
]
}
>
<
Select
style=
{
{
width
:
'12rem'
}
}
onChange=
{
(
value
)
=>
onChangeType1
(
value
)
}
placeholder=
"请选择模板名称"
>
<
Select
.
Option
value=
"普通文本"
>
普通文本
</
Select
.
Option
>
<
Select
.
Option
value=
"文字卡片"
>
文字卡片
</
Select
.
Option
>
<
Select
.
Option
value=
"图片消息"
>
图片消息
</
Select
.
Option
>
<
Select
.
Option
value=
"图片"
>
图片
</
Select
.
Option
>
<
Select
placeholder=
"请选择模板名称"
onChange=
{
(
value
,
option
)
=>
onChange
(
value
,
option
)
}
>
{
templateName
&&
templateName
.
length
>
0
&&
templateName
.
map
((
item
,
index
)
=>
(
<
Option
value=
{
item
.
Name
}
key=
{
item
.
Name
+
index
}
code=
{
item
.
Code
}
>
{
item
.
Name
}
</
Option
>
))
}
</
Select
>
</
Item
>
</
Col
>
<
Col
span=
{
11
}
>
<
Item
label=
"企业微信应用id"
labelCol=
{
{
span
:
11
}
}
name=
"weixin"
label=
"第三方模板编号"
name=
"third_id"
rules=
{
[
{
required
:
true
,
message
:
'请输入
企业微信
号'
,
message
:
'请输入
第三方模板编
号'
,
},
]
}
>
<
Input
placeholder=
"请输入
企业微信号
"
/>
<
Input
placeholder=
"请输入
模板名称
"
/>
</
Item
>
</
Col
>
</
Row
>
</>
}
<
Row
gutter=
{
24
}
>
...
...
@@ -255,12 +271,6 @@ const EditModal = props => {
labelCol=
{
{
span
:
3
}
}
style=
{
{
marginLeft
:
'1.4rem'
}
}
name=
"analysis_params"
rules=
{
[
{
required
:
true
,
message
:
'请输入参数解析'
,
},
]
}
>
<
TextArea
rows=
{
2
}
placeholder=
"param1|param2|param3|param4"
/>
</
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