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
4850cd88
Commit
4850cd88
authored
Dec 27, 2022
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改流程中心样式,新版消息平台
parent
e1371d2e
Pipeline
#65951
passed with stages
Changes
18
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
2579 additions
and
46 deletions
+2579
-46
index.jsx
src/components/ImageDb/index.jsx
+15
-0
index.less
src/components/ImageDb/index.less
+0
-0
WorkflowHomePage.jsx
...ges/bsmanager/workOrder/workflowEdit/WorkflowHomePage.jsx
+29
-15
WorkflowHomePage.less
...es/bsmanager/workOrder/workflowEdit/WorkflowHomePage.less
+49
-11
ConfigNodeMsg.jsx
...flowChartComponents/nodeModalComponents/ConfigNodeMsg.jsx
+2
-5
index.less
src/pages/platformCenter/messageManage/index.less
+35
-0
indexNew.jsx
src/pages/platformCenter/messageManage/indexNew.jsx
+237
-0
VisibleIISAgentConfigNew.jsx
...ge/components/IISAgentConfig/VisibleIISAgentConfigNew.jsx
+577
-0
RoleModalNew.jsx
...age/projectManage/components/RolseSelect/RoleModalNew.jsx
+126
-0
EnterpriseWeChatConfig.jsx
...anage/schemeDetails/components/EnterpriseWeChatConfig.jsx
+307
-0
PlatformConfig.jsx
...messageManage/schemeDetails/components/PlatformConfig.jsx
+370
-0
PlatformConfig.less
...essageManage/schemeDetails/components/PlatformConfig.less
+30
-0
ShortMessageConfig.jsx
...ageManage/schemeDetails/components/ShortMessageConfig.jsx
+188
-0
WeChatConfig.jsx
...r/messageManage/schemeDetails/components/WeChatConfig.jsx
+232
-0
schemeDetails.jsx
...tformCenter/messageManage/schemeDetails/schemeDetails.jsx
+299
-0
schemeDetails.less
...formCenter/messageManage/schemeDetails/schemeDetails.less
+30
-0
config.js
src/routes/config.js
+22
-8
messagemanage.js
src/services/messagemanage/messagemanage.js
+31
-7
No files found.
src/components/ImageDb/index.jsx
0 → 100644
View file @
4850cd88
/*
* @Author: dengchao 754083046@qq.com
* @Date: 2022-12-14 14:44:25
* @LastEditors: dengchao 754083046@qq.com
* @LastEditTime: 2022-12-14 14:55:12
* @FilePath: \maintenance\src\components\ImageLibrary\index.jsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
const
ImageLibrary
=
()
=>
{
return
<
div
>
index
</
div
>;
};
export
default
ImageLibrary
;
src/components/ImageDb/index.less
0 → 100644
View file @
4850cd88
src/pages/bsmanager/workOrder/workflowEdit/WorkflowHomePage.jsx
View file @
4850cd88
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
classnames
from
'classnames'
;
import
{
Tabs
,
Input
,
message
,
Modal
}
from
'antd'
;
import
{
Tabs
,
Input
,
message
,
Modal
,
Button
}
from
'antd'
;
import
{
PlusOutlined
,
EditOutlined
,
DeleteOutlined
,
ExclamationCircleOutlined
,
HighlightOutlined
,
}
from
'@ant-design/icons'
;
import
FlowModal
from
'./workFlowComponents/FlowModal'
;
import
FlowGroupModal
from
'./workFlowComponents/FlowGroupModal'
;
...
...
@@ -43,11 +44,12 @@ const WorkflowHomePage = () => {
WFGetAllFlow
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
flowNameList
=
[];
let
list
=
res
.
data
.
map
(
item
=>
{
let
list
=
res
.
data
.
map
(
(
item
,
index
)
=>
{
item
.
children
.
forEach
(
ele
=>
{
flowNameList
.
push
(
ele
.
FlowName
);
});
item
.
isOld
=
true
;
item
.
bgType
=
(
index
+
1
)
%
5
;
return
item
;
});
setFlowList
(
list
);
...
...
@@ -214,10 +216,10 @@ const WorkflowHomePage = () => {
</
Tabs
>
</
div
>
</
div
>
<
div
className=
{
styles
.
right
}
onClick=
{
addFlowGroup
}
>
{
/*
<div className={styles.right} onClick={addFlowGroup}>
<div className={styles.icon} />
<div>新增分组</div>
</
div
>
</div>
*/
}
</
div
>
<
div
className=
{
styles
.
controlBox
}
>
<
div
className=
{
styles
.
left
}
>
...
...
@@ -251,23 +253,35 @@ const WorkflowHomePage = () => {
</
div
>
<
div
className=
{
styles
.
groupBox
}
>
{
item
.
children
.
map
(
ele
=>
(
<
div
className=
{
styles
.
flowBox
}
type=
{
(
index
+
1
)
%
5
}
key=
{
ele
.
Code
}
onClick=
{
()
=>
chooseNode
(
ele
)
}
>
<
div
className=
{
styles
.
flowBox
}
type=
{
item
.
bgType
}
key=
{
ele
.
Code
}
>
<
div
className=
{
styles
.
header
}
>
<
div
className=
{
styles
.
title
}
>
{
ele
.
FlowName
}
</
div
>
<
div
className=
{
styles
.
delete
}
>
<
DeleteOutlined
onClick=
{
e
=>
delFlow
(
ele
,
e
)
}
/>
</
div
>
<
div
className=
{
styles
.
editBtn
}
onClick=
{
e
=>
editFlow
(
ele
,
e
)
}
>
<
EditOutlined
/>
编辑
修改
</
div
>
</
div
>
<
div
className=
{
styles
.
imgBox
}
>
<
div
className=
{
styles
.
mask
}
>
<
div
className=
{
styles
.
lookDetail
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
chooseNode
(
ele
)
}
>
设计
</
Button
>
{
/* <HighlightOutlined onClick={e => chooseNode(ele, e)} /> */
}
</
div
>
<
div
className=
{
styles
.
delete
}
>
<
Button
style=
{
{
background
:
'#5a5d69'
,
border
:
'#5a5d69'
}
}
type=
"primary"
onClick=
{
e
=>
delFlow
(
ele
,
e
)
}
>
删除
</
Button
>
{
/* <DeleteOutlined onClick={e => delFlow(ele, e)} /> */
}
</
div
>
</
div
>
<
img
src=
{
`${window.location.origin}/${
ele.PreviewImage
...
...
@@ -276,7 +290,7 @@ const WorkflowHomePage = () => {
/>
</
div
>
<
div
className=
{
styles
.
bottom
}
>
<
div
className=
{
styles
.
left
}
>
创建人
:
{
ele
.
CreateUser
||
'--'
}
</
div
>
<
div
className=
{
styles
.
left
}
>
拥有者
:
{
ele
.
CreateUser
||
'--'
}
</
div
>
<
div
className=
{
styles
.
right
}
>
更新于
{
ele
.
UpdateTime
||
'--'
}
</
div
>
</
div
>
</
div
>
...
...
src/pages/bsmanager/workOrder/workflowEdit/WorkflowHomePage.less
View file @
4850cd88
...
...
@@ -43,6 +43,10 @@
border-bottom: none;
}
.ant-tabs-tab .anticon {
margin-right: 0;
}
.ant-tabs-tab-active {
border-top: 2px solid #3D78FF;
border-bottom: none;
...
...
@@ -163,9 +167,10 @@
display: flex;
flex-direction: column;
justify-content: space-between;
cursor: pointer;
//
cursor: pointer;
transition: transform 0.5s;
margin-bottom: 5px;
position: relative;
.header {
display: flex;
...
...
@@ -183,17 +188,12 @@
}
.delete {
color: #FE5557;
cursor: pointer;
font-size: 16px;
margin-top: 22px;
}
.editBtn {
font-size: 14px;
display: flex;
margin-left:
31
px;
margin-left:
46
px;
width: 67px;
margin-top: 11px;
justify-content: center;
...
...
@@ -203,6 +203,43 @@
}
}
.mask {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
left: 50%;
transform: translateX(-50%);
width: 333px;
height: 141px;
border-radius: 0 20px 20px 20px;
font-size: 16px;
.delete {
display: none;
}
.lookDetail {
display: none;
margin-right: 10px;
}
}
.mask:hover {
background-color: rgba(0, 0, 0, 0.8);
.lookDetail {
display: block;
}
.delete {
display: block;
cursor: pointer;
}
}
.imgBox {
display: flex;
justify-content: center;
...
...
@@ -211,6 +248,7 @@
margin-top: 1px;
height: 130px;
overflow: hidden;
img {
width: 320px;
}
...
...
@@ -251,9 +289,9 @@
}
}
.flowBox:hover {
transform: translateY(-10px);
}
//
.flowBox:hover {
//
transform: translateY(-10px);
//
}
}
}
}
...
...
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/flowChartComponents/nodeModalComponents/ConfigNodeMsg.jsx
View file @
4850cd88
...
...
@@ -343,16 +343,13 @@ const ConfigNodeMsg = (props, ref) => {
<
Form
.
Item
label=
"移交方式"
name=
"Handover"
>
<
Radio
.
Group
>
<
Radio
value=
"移交选择人"
>
移交选择人
</
Radio
>
<
Radio
value=
"自处理"
style=
{
{
display
:
editMsg
.
NodeType
===
'1'
?
'none'
:
'block'
}
}
>
<
Radio
value=
"自处理"
style=
{
{
display
:
editMsg
.
NodeType
===
'1'
?
'none'
:
'flex'
}
}
>
自处理
</
Radio
>
<
Radio
value=
"移交默认人"
>
移交默认人
</
Radio
>
<
Radio
value=
"移交发起人"
style=
{
{
display
:
editMsg
.
NodeType
===
'1'
?
'none'
:
'
block
'
}
}
style=
{
{
display
:
editMsg
.
NodeType
===
'1'
?
'none'
:
'
flex
'
}
}
>
移交发起人
</
Radio
>
...
...
src/pages/platformCenter/messageManage/index.less
0 → 100644
View file @
4850cd88
.pageContent {
height: 100%;
width: 100%;
padding: 20px;
background-color: #fff;
.header {
margin-bottom: 15px;
}
.content {
height: calc(100% - 35px);
:global {
.ant-table-wrapper {
height: 100%;
.ant-table {
height: 100%;
.ant-table-container {
height: 100%;
border: 1px solid #f0f0f0;
.ant-table-content {
height: 100%;
}
}
}
}
}
}
}
\ No newline at end of file
src/pages/platformCenter/messageManage/indexNew.jsx
0 → 100644
View file @
4850cd88
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
{
Tabs
,
Table
,
Form
,
Input
,
Button
,
Tooltip
,
Tag
,
Space
,
Popconfirm
,
message
}
from
'antd'
;
import
{
FundViewOutlined
,
EditTwoTone
,
DeleteOutlined
}
from
'@ant-design/icons'
;
import
{
GetMessageConfigs
,
DelMessageConfigs
}
from
'@/services/messagemanage/messagemanage'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
styles
from
'./index.less'
;
const
{
TabPane
}
=
Tabs
;
const
{
Search
}
=
Input
;
const
HostManager
=
()
=>
{
const
history
=
useHistory
();
const
[
dataList
,
setDataList
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
searchValue
=
useRef
();
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
getData
();
},
[]);
const
getData
=
query
=>
{
setLoading
(
true
);
GetMessageConfigs
({
keyword
:
query
}).
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
code
===
0
)
{
setDataList
(
res
.
data
);
}
else
{
message
.
error
(
res
.
msg
);
}
});
};
const
onChage
=
value
=>
{
searchValue
.
current
=
value
.
target
.
value
;
};
const
onSearch
=
value
=>
{
getData
(
value
);
};
const
changeDesc
=
value
=>
{
history
.
push
({
pathname
:
`/platform/SchemeDetailNew`
,
state
:
{
schemeMsg
:
value
},
});
};
// 消息发送测试
const
TestDesc
=
()
=>
{};
// 删除消息
const
DeleteProject
=
val
=>
{
DelMessageConfigs
({
Id
:
val
.
Id
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
message
.
success
(
'删除成功'
);
getData
(
searchValue
.
current
);
}
else
{
message
.
error
(
res
.
msg
);
}
});
};
const
columns
=
[
{
title
:
'序号'
,
dataIndex
:
'ID'
,
align
:
'center'
,
key
:
'ID'
,
width
:
60
,
render
:
(
text
,
record
,
index
)
=>
<
span
>
{
index
+
1
}
</
span
>,
},
{
title
:
'方案名称'
,
dataIndex
:
'SchemeName'
,
align
:
'center'
,
key
:
'SchemeName'
,
render
:
(
text
,
record
)
=>
<
div
>
{
text
===
null
||
!
text
?
'-'
:
text
}
</
div
>,
},
{
title
:
'推送组'
,
dataIndex
:
'TimeJobGroup'
,
key
:
'TimeJobGroup'
,
align
:
'center'
,
ellipsis
:
true
,
width
:
500
,
render
:
(
text
,
record
)
=>
(
<
span
>
<
Tooltip
placement=
"topLeft"
title=
{
text
.
map
(
item
=>
item
.
name
).
join
(
','
)
}
>
{
text
.
map
(
item
=>
item
.
name
).
join
(
','
)
||
'--'
}
</
Tooltip
>
</
span
>
),
},
{
title
:
'消息平台'
,
dataIndex
:
'Platform'
,
align
:
'center'
,
key
:
'Platform'
,
width
:
'100px'
,
render
:
record
=>
{
if
(
record
.
PlatformStatus
===
1
)
{
return
<
Tag
color=
"success"
>
开
</
Tag
>;
}
return
<
Tag
color=
"processing"
>
关
</
Tag
>;
},
},
{
title
:
'短信推送'
,
dataIndex
:
'SMS'
,
align
:
'center'
,
key
:
'SMS'
,
width
:
'100px'
,
render
:
record
=>
{
if
(
record
.
PlatformStatus
===
1
)
{
return
<
Tag
color=
"success"
>
开
</
Tag
>;
}
return
<
Tag
color=
"processing"
>
关
</
Tag
>;
},
},
{
title
:
'公众号推送'
,
dataIndex
:
'Wechat'
,
align
:
'center'
,
key
:
'Wechat'
,
width
:
'100px'
,
render
:
record
=>
{
if
(
record
.
PlatformStatus
===
1
)
{
return
<
Tag
color=
"success"
>
开
</
Tag
>;
}
return
<
Tag
color=
"processing"
>
关
</
Tag
>;
},
},
{
title
:
'企业微信推送'
,
dataIndex
:
'WorkWechat'
,
align
:
'center'
,
key
:
'WorkWechat'
,
width
:
'110px'
,
render
:
record
=>
{
if
(
record
.
PlatformStatus
===
1
)
{
return
<
Tag
color=
"success"
>
开
</
Tag
>;
}
return
<
Tag
color=
"processing"
>
关
</
Tag
>;
},
},
{
title
:
'是否启用'
,
dataIndex
:
'IsEnable'
,
align
:
'center'
,
key
:
'IsEnable'
,
width
:
'100px'
,
render
:
record
=>
{
if
(
record
===
1
)
{
return
<
Tag
color=
"success"
>
是
</
Tag
>;
}
return
<
Tag
color=
"processing"
>
否
</
Tag
>;
},
},
{
title
:
'操作'
,
width
:
250
,
align
:
'center'
,
ellipsis
:
true
,
render
:
(
text
,
record
)
=>
(
<
Space
>
{
/* <Tooltip title="测试">
<FundViewOutlined
style={{ fontSize: '16px', color: '#1890FF' }}
onClick={() => {
TestDesc(record);
}}
/>
</Tooltip> */
}
<
Tooltip
title=
"编辑"
>
<
EditTwoTone
style=
{
{
fontSize
:
'16px'
,
color
:
'#e86060'
}
}
onClick=
{
()
=>
{
changeDesc
(
record
);
}
}
/>
</
Tooltip
>
<
Popconfirm
title=
"是否删除方案?"
okText=
"确认"
cancelText=
"取消"
onConfirm=
{
()
=>
{
DeleteProject
(
record
);
}
}
>
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#e86060'
}
}
/>
</
Popconfirm
>
</
Space
>
),
},
];
return
(
<
div
className=
{
styles
.
pageContent
}
>
<
div
className=
{
styles
.
header
}
>
<
Form
name=
{
form
}
layout=
"inline"
>
<
Form
.
Item
>
<
Search
placeholder=
"请输入方案名称"
onChange=
{
onChage
}
onSearch=
{
onSearch
}
enterButton
allowClear
/>
</
Form
.
Item
>
<
Form
.
Item
>
<
Button
onClick=
{
()
=>
{
history
.
push
({
pathname
:
`/platform/schemeDetailNew`
,
state
:
{
schemeMsg
:
null
},
});
}
}
>
新增
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
<
div
className=
{
styles
.
content
}
>
<
Table
loading=
{
loading
}
bordered
columns=
{
columns
}
dataSource=
{
dataList
}
pagination=
{
false
}
rowKey=
"Id"
scroll=
{
{
y
:
'calc(100% - 55px)'
}
}
/>
</
div
>
</
div
>
);
};
export
default
HostManager
;
src/pages/platformCenter/messageManage/projectManage/components/IISAgentConfig/VisibleIISAgentConfigNew.jsx
0 → 100644
View file @
4850cd88
import
React
,
{
useEffect
,
useState
,
forwardRef
,
useImperativeHandle
}
from
'react'
;
import
SiteModal
from
'@/components/Modal/SiteModa'
;
import
{
Checkbox
,
Input
,
Button
,
Card
,
InputNumber
,
Form
,
Radio
,
DatePicker
,
Switch
,
Select
,
message
,
}
from
'antd'
;
import
HourOfDaySelect
from
'./HourOfDaySelect'
;
import
DayOfWeekSelect
from
'./DayOfWeekSelect'
;
import
styles
from
'./VisibleIISAgentConfig.less'
;
import
moment
from
'moment'
;
import
{
tr
}
from
'voca'
;
import
{
EditOutlined
,
InfoCircleOutlined
}
from
'@ant-design/icons'
;
const
{
Item
}
=
Form
;
const
{
TextArea
}
=
Input
;
let
unitType
=
{
Hour
:
'小时'
,
Minute
:
'分钟'
,
Second
:
'秒'
};
const
hours
=
{
'1'
:
'星期一'
,
'2'
:
'星期二'
,
'3'
:
'星期三'
,
'4'
:
'星期四'
,
'5'
:
'星期五'
,
'6'
:
'星期六'
,
'7'
:
'星期天'
,
};
const
VisibleIISAgentConfig
=
(
props
,
ref
)
=>
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
previewVisible
,
setPreviewVisible
]
=
useState
(
false
);
const
[
selectRole
,
setSelectRole
]
=
useState
([]);
const
[
isReentrant
,
setIsReentrant
]
=
useState
(
false
);
const
[
postCheck
,
setPostCheck
]
=
useState
(
false
);
const
[
reenCheck
,
setReenCheck
]
=
useState
(
false
);
const
[
logCheck
,
setLogCheck
]
=
useState
(
false
);
const
[
isEndTimeShow
,
setIsEndTimeShow
]
=
useState
(
false
);
const
[
isLoopShow
,
setIsLoopShow
]
=
useState
(
false
);
const
[
isDayLoopShow
,
setIsDayLoopShow
]
=
useState
(
false
);
const
[
isWeekLoopShow
,
setIsWeekLoopShow
]
=
useState
(
false
);
const
[
waitCheck
,
setWaitCheck
]
=
useState
(
false
);
const
[
isUse
,
setIsUse
]
=
useState
(
true
);
const
[
interval
,
setInterval
]
=
useState
(
1
);
const
[
loop_unit
,
setLoop_unit
]
=
useState
(
'Hour'
);
const
[
exeType
,
setExeType
]
=
useState
(
true
);
const
[
isType
,
setIsType
]
=
useState
(
'重复执行'
);
const
[
isTypeValue
,
setIsTypeValue
]
=
useState
(
'ByLoop'
);
const
[
time_out
,
setTime_out
]
=
useState
(
30
);
const
[
weekData
,
setWeekData
]
=
useState
([]);
const
[
exeTime
,
setExeTime
]
=
useState
(
moment
().
format
(
'YYYY-MM-DD 00:00:00'
));
const
[
selectValues
,
setSelectValues
]
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
dateFormat
=
'YYYY-MM-DD HH:mm:ss'
;
const
{
agentConfig
,
value
,
onIISAgentSubmit
}
=
props
;
useImperativeHandle
(
ref
,
()
=>
({
setPreviewVisible
,
}));
useEffect
(()
=>
{
if
(
agentConfig
)
{
let
startTime
=
agentConfig
.
LoopMode
===
'ByOnce'
?
moment
(
new
Date
(
new
Date
().
toLocaleDateString
()),
'YYYY-MM-DD 00:00:00'
).
add
(
1
,
'days'
)
:
moment
(
new
Date
(
new
Date
().
toLocaleDateString
()),
'YYYY-MM-DD 00:00:00'
);
form
.
setFieldsValue
({
is_enable
:
agentConfig
.
Enabled
,
url_type
:
agentConfig
.
Absolute
?
true
:
false
,
url_path
:
agentConfig
.
Url
,
request_header
:
agentConfig
.
CustomHeader
,
plan_type
:
agentConfig
.
LoopMode
,
start_time
:
agentConfig
.
StartFrom
?
moment
(
agentConfig
.
StartFrom
,
dateFormat
)
:
startTime
,
end_time
:
agentConfig
.
EndAt
?
moment
(
agentConfig
.
EndAt
,
dateFormat
)
:
null
,
loop_mode
:
agentConfig
.
LoopMode
,
interval
:
agentConfig
.
Interval
,
loop_unit
:
agentConfig
.
LoopUnit
,
hour_of_day
:
agentConfig
.
HourOfDay
&&
agentConfig
.
HourOfDay
.
split
(
','
),
day_of_week
:
agentConfig
.
DayOfWeek
,
time_out
:
agentConfig
.
Timeout
||
30
,
post_state
:
agentConfig
.
UsePostState
,
reentrant
:
agentConfig
.
AllowReentrant
,
enable_log
:
agentConfig
.
AllowLog
,
});
let
startTimeValue
=
agentConfig
.
LoopMode
===
'ByOnce'
?
moment
()
.
add
(
1
,
'days'
)
.
format
(
'YYYY-MM-DD 00:00:00'
)
:
moment
().
format
(
'YYYY-MM-DD 00:00:00'
);
setExeTime
(
agentConfig
.
StartFrom
?
agentConfig
.
StartFrom
:
startTimeValue
);
setIsUse
(
agentConfig
.
Enabled
);
changeLoopMode
(
agentConfig
.
LoopMode
);
setReenCheck
(
agentConfig
.
AllowReentrant
);
setPostCheck
(
agentConfig
.
UsePostState
);
setLogCheck
(
agentConfig
.
AllowLog
);
setInterval
(
agentConfig
.
Interval
);
setLoop_unit
(
agentConfig
.
LoopUnit
);
setWaitCheck
(
agentConfig
.
UseTimeout
||
false
);
setTime_out
(
agentConfig
.
Timeout
);
if
(
agentConfig
.
LoopMode
===
'ByOnce'
)
{
setIsType
(
'执行一次'
);
form
.
setFieldsValue
({
type
:
'执行一次'
,
});
setExeType
(
false
);
}
else
{
setIsType
(
'重复执行'
);
form
.
setFieldsValue
({
type
:
'重复执行'
,
});
if
(
agentConfig
.
LoopMode
===
'ByDay'
)
{
setSelectValues
(
agentConfig
.
HourOfDay
.
split
(
','
));
}
else
if
(
agentConfig
.
LoopMode
===
'ByWeek'
)
{
setWeekData
(
agentConfig
.
DayOfWeek
.
split
(
','
));
}
setExeType
(
true
);
}
}
else
{
form
.
setFieldsValue
({
type
:
'重复执行'
,
url_type
:
false
,
loop_mode
:
'ByLoop'
,
start_time
:
moment
(
new
Date
(
new
Date
().
toLocaleDateString
()),
'YYYY-MM-DD 00:00:00'
),
});
setExeTime
(
moment
().
format
(
'YYYY-MM-DD 00:00:00'
));
setIsType
(
'重复执行'
);
changeLoopMode
(
'ByLoop'
);
setIsUse
(
true
);
setInterval
(
1
);
setLoop_unit
(
'Hour'
);
}
},
[
agentConfig
]);
useEffect
(()
=>
{
if
(
value
)
{
form
.
setFieldsValue
({
name
:
value
,
});
setSelectRole
(
props
.
value
);
}
},
[
props
]);
const
handleCancel
=
()
=>
{
setPreviewVisible
(
false
);
};
const
handleOk
=
async
()
=>
{
let
fv
=
form
.
getFieldValue
();
if
(
(
fv
.
loop_mode
===
'ByDay'
&&
!
selectValues
.
length
)
||
(
fv
.
loop_mode
===
'ByWeek'
&&
!
weekData
.
length
)
)
{
message
.
warning
(
'请选择计划执行日'
);
return
false
;
}
let
data
=
{
Url
:
fv
.
url_path
,
CustomHeader
:
fv
.
request_header
||
''
,
StartFrom
:
fv
.
start_time
&&
fv
.
start_time
.
format
(
dateFormat
),
EndAt
:
fv
.
end_time
&&
fv
.
end_time
.
format
(
dateFormat
),
LoopMode
:
fv
.
loop_mode
===
'ByOnce'
?
'ByLoop'
:
fv
.
loop_mode
,
LoopUnit
:
loop_unit
,
MonthOfYear
:
null
,
WeekOfMonth
:
null
,
DayOfWeek
:
fv
.
day_of_week
?
fv
.
day_of_week
.
toString
()
:
''
,
DayOfMonth
:
null
,
HourOfDay
:
fv
.
hour_of_day
&&
fv
.
hour_of_day
.
toString
(),
Interval
:
interval
.
toString
(),
UsePostState
:
fv
.
post_state
,
AllowReentrant
:
fv
.
reentrant
,
AllowLog
:
fv
.
enable_log
,
Enabled
:
isUse
,
Timeout
:
fv
.
time_out
?
parseInt
(
fv
.
time_out
)
:
30
,
Absolute
:
fv
.
url_type
,
SiteInfo
:
null
,
Name
:
fv
.
name
,
Tolerate
:
null
,
UseTimeout
:
waitCheck
,
};
fv
.
time_out
?
(
data
.
MillisecondsTimeout
=
parseInt
(
fv
.
time_out
))
:
''
;
setPreviewVisible
(
false
);
(
await
onIISAgentSubmit
)
&&
onIISAgentSubmit
(
data
);
};
const
handleClick
=
()
=>
{
if
(
value
)
{
setPreviewVisible
(
true
);
}
else
{
message
.
error
(
'请先输入方案名称!'
);
}
};
const
onPostChange
=
value
=>
{
setIsReentrant
(
value
);
setPostCheck
(
value
);
form
.
setFieldsValue
({
post_state
:
value
,
});
};
const
onReenChange
=
value
=>
{
setReenCheck
(
value
);
form
.
setFieldsValue
({
reentrant
:
value
,
});
};
const
onLogChange
=
value
=>
{
setLogCheck
(
value
);
form
.
setFieldsValue
({
enable_log
:
value
,
});
};
const
changeLoopMode
=
value
=>
{
setIsTypeValue
(
value
);
switch
(
value
)
{
case
'ByOnce'
:
setIsEndTimeShow
(
false
);
setIsLoopShow
(
true
);
setIsWeekLoopShow
(
false
);
setIsDayLoopShow
(
false
);
break
;
case
'ByLoop'
:
setIsEndTimeShow
(
true
);
setIsLoopShow
(
true
);
setIsWeekLoopShow
(
false
);
setIsDayLoopShow
(
false
);
break
;
case
'ByDay'
:
setIsEndTimeShow
(
true
);
setIsLoopShow
(
false
);
setIsWeekLoopShow
(
false
);
setIsDayLoopShow
(
true
);
break
;
case
'ByWeek'
:
setIsEndTimeShow
(
true
);
setIsLoopShow
(
false
);
setIsWeekLoopShow
(
true
);
setIsDayLoopShow
(
true
);
break
;
}
};
const
onLoopModeChange
=
e
=>
{
changeLoopMode
(
e
.
target
.
value
);
if
(
e
.
target
.
value
===
'ByLoop'
)
{
form
.
setFieldsValue
({
hour_of_day
:
''
,
day_of_week
:
''
,
});
}
};
const
onChange
=
value
=>
{
setIsUse
(
value
);
};
const
handleExe
=
e
=>
{
let
obj
=
form
.
getFieldValue
();
let
value
=
e
.
target
.
value
;
setIsType
(
value
);
if
(
value
===
'执行一次'
)
{
changeLoopMode
(
'ByOnce'
);
setLoop_unit
(
'Second'
);
form
.
setFieldsValue
({
loop_mode
:
'ByOnce'
,
hour_of_day
:
''
,
day_of_week
:
''
,
end_time
:
obj
.
start_time
,
});
if
(
!
agentConfig
)
{
form
.
setFieldsValue
({
start_time
:
moment
(
new
Date
(
new
Date
().
toLocaleDateString
()),
'YYYY-MM-DD 00:00:00'
).
add
(
1
,
'days'
,
),
end_time
:
moment
(
new
Date
(
new
Date
().
toLocaleDateString
()),
'YYYY-MM-DD 00:00:00'
).
add
(
1
,
'days'
,
),
});
setExeTime
(
moment
()
.
add
(
1
,
'days'
)
.
format
(
'YYYY-MM-DD 00:00:00'
),
);
}
setExeType
(
false
);
}
else
{
changeLoopMode
(
'ByLoop'
);
setExeType
(
true
);
form
.
setFieldsValue
({
loop_mode
:
'ByLoop'
,
end_time
:
''
,
});
if
(
!
agentConfig
)
{
form
.
setFieldsValue
({
start_time
:
moment
(
new
Date
(
new
Date
().
toLocaleDateString
()),
'YYYY-MM-DD 00:00:00'
),
hour_of_day
:
''
,
day_of_week
:
''
,
});
setExeTime
(
moment
().
format
(
'YYYY-MM-DD 00:00:00'
));
}
}
};
const
onWait
=
e
=>
{
setWaitCheck
(
e
);
};
const
changeUnit
=
e
=>
{
setLoop_unit
(
e
);
};
const
changeInterval
=
e
=>
{
setInterval
(
e
);
};
const
InputTimeOut
=
e
=>
{
setTime_out
(
e
);
};
const
changeStartTime
=
e
=>
{
const
time
=
moment
(
e
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
setExeTime
(
time
);
let
obj
=
form
.
getFieldValue
();
if
(
obj
.
loop_mode
===
'ByOnce'
)
setLoop_unit
(
'Second'
);
console
.
log
(
time
,
'time'
);
// form.setFieldsValue({
// end_time: time,
// });
};
const
changeDay
=
data
=>
{
console
.
log
(
'data'
,
data
);
if
(
data
)
setSelectValues
(
data
);
};
const
changeWeek
=
data
=>
{
if
(
data
)
setWeekData
(
data
);
};
return
(
<
div
className=
{
styles
.
agent_container
}
>
{
/* <Input value={selectRole} disabled={true} />
<div className={styles.select_btn} onClick={handleClick}>
<EditOutlined style={{ fontSize: '18px' }} />
</div> */
}
<
SiteModal
{
...
props
}
title=
"编辑定时任务"
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
style=
{
{
top
:
100
,
borderRadius
:
'20px'
}
}
width=
"800px"
destroyOnClose
cancelText=
"取消"
okText=
"确认"
forceRender
visible=
{
previewVisible
}
onOk=
{
()
=>
handleOk
()
}
confirmLoading=
{
loading
}
onCancel=
{
handleCancel
}
>
<
div
className=
{
styles
.
IISAgent_container
}
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
18
}
}
>
<
Item
label=
"计划名称"
name=
"name"
>
<
Input
placeholder=
"请输入计划名称"
disabled=
{
true
}
/>
</
Item
>
<
Item
label=
"URL路径"
>
<
Item
label=
""
name=
"url_type"
style=
{
{
marginBottom
:
'0.2rem'
}
}
>
<
Radio
.
Group
>
<
Radio
value=
{
false
}
>
相对路径(便于配置迁移)
</
Radio
>
<
Radio
value=
{
true
}
>
绝对路径(用于外链)
</
Radio
>
</
Radio
.
Group
>
</
Item
>
<
Item
label=
""
name=
"url_path"
style=
{
{
marginBottom
:
'0'
}
}
>
<
TextArea
rows=
{
3
}
placeholder=
"请输入URL名称"
/>
</
Item
>
</
Item
>
<
Item
label=
"请求头"
name=
"request_header"
>
<
Input
placeholder=
"请求头,选填"
/>
</
Item
>
<
Item
label=
"计划类型"
name=
"type"
>
<
Radio
.
Group
onChange=
{
handleExe
}
>
<
Radio
.
Button
value=
"重复执行"
>
重复执行
</
Radio
.
Button
>
<
Radio
.
Button
value=
"执行一次"
>
执行一次
</
Radio
.
Button
>
</
Radio
.
Group
>
</
Item
>
{
exeType
&&
(
<
Item
label=
"执行方式"
name=
"loop_mode"
>
<
Radio
.
Group
onChange=
{
onLoopModeChange
}
>
<
Radio
value=
{
'ByLoop'
}
>
循环
</
Radio
>
<
Radio
value=
{
'ByDay'
}
>
每天
</
Radio
>
<
Radio
value=
{
'ByWeek'
}
>
每周
</
Radio
>
</
Radio
.
Group
>
</
Item
>
)
}
<
Item
label=
"开始时间"
wrapperCol=
{
{
span
:
28
}
}
style=
{
{
marginBottom
:
'0'
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Item
label=
""
name=
"start_time"
style=
{
{
marginRight
:
'1rem'
}
}
>
<
DatePicker
showTime
onChange=
{
changeStartTime
}
/>
</
Item
>
{
isEndTimeShow
&&
(
<
Item
label=
"结束时间"
name=
"end_time"
>
<
DatePicker
showTime
/>
</
Item
>
)
}
</
div
>
</
Item
>
{
isLoopShow
&&
isType
===
'重复执行'
&&
(
<
Card
style=
{
{
width
:
600
,
margin
:
'0 0 1rem 3.6rem'
,
height
:
'8rem'
}
}
>
<
div
className=
{
styles
.
loopShow
}
>
<
span
>
每
</
span
>
<
InputNumber
min=
{
0
}
value=
{
interval
}
style=
{
{
margin
:
'0 0.5rem'
}
}
onChange=
{
changeInterval
}
placeholder=
"请输入循环周期"
/>
<
Select
value=
{
loop_unit
}
onChange=
{
changeUnit
}
style=
{
{
width
:
'8rem'
,
margin
:
'0 0.5rem'
}
}
>
<
Select
.
Option
value=
"Hour"
>
小时
</
Select
.
Option
>
<
Select
.
Option
value=
"Minute"
>
分钟
</
Select
.
Option
>
<
Select
.
Option
value=
"Second"
>
秒
</
Select
.
Option
>
</
Select
>
<
span
>
执行一次
</
span
>
</
div
>
</
Card
>
)
}
{
isDayLoopShow
&&
(
<
Item
label=
"日循环"
name=
"hour_of_day"
>
<
HourOfDaySelect
changeDay=
{
changeDay
}
/>
</
Item
>
)
}
{
isWeekLoopShow
&&
(
<
Item
label=
"周循环"
name=
"day_of_week"
>
<
DayOfWeekSelect
changeWeek=
{
changeWeek
}
/>
</
Item
>
)
}
{
isTypeValue
===
'ByDay'
?
!
selectValues
.
length
&&
(
<
span
style=
{
{
color
:
'#f00'
}
}
className=
{
styles
.
exeTime
}
>
<
InfoCircleOutlined
style=
{
{
marginRight
:
'0.2rem'
}
}
/>
必须选择计划执行时刻
</
span
>
)
:
''
}
{
isTypeValue
===
'ByWeek'
?
!
weekData
.
length
&&
(
<
span
style=
{
{
color
:
'#f00'
}
}
className=
{
styles
.
exeTime
}
>
<
InfoCircleOutlined
style=
{
{
marginRight
:
'0.2rem'
}
}
/>
必须选择计划执行时刻
</
span
>
)
:
''
}
<
Item
label=
"说明"
>
<
div
style=
{
{
color
:
'#909EB6FF'
,
fontSize
:
'12px'
}
}
>
{
isType
===
'执行一次'
&&
<
span
>
在
{
exeTime
}
执行一次
</
span
>
}
{
isType
===
'重复执行'
&&
isTypeValue
===
'ByDay'
&&
(
<
span
style=
{
{
color
:
selectValues
.
length
?
'#909EB6FF'
:
'#f00'
}
}
>
从
{
exeTime
}
开始
{
selectValues
.
length
?
',在每天'
:
''
}
{
selectValues
.
length
?
selectValues
.
map
((
item
,
index
)
=>
{
return
item
.
length
>
1
?
`${item}:00${index == selectValues.length - 1 ? '' : ','}`
:
`0${item}:00${index == selectValues.length - 1 ? '' : ','}`
;
})
:
''
}
{
selectValues
.
length
?
'执行'
:
''
}
</
span
>
)
}
{
isType
===
'重复执行'
&&
isTypeValue
===
'ByWeek'
&&
(
<
span
style=
{
{
color
:
weekData
.
length
?
'#909EB6FF'
:
'#f00'
}
}
>
从
{
exeTime
}
开始
{
weekData
.
length
?
',在每周'
:
''
}
{
weekData
.
length
?
weekData
.
map
((
item
,
index
)
=>
{
return
`${hours[item]}${index == weekData.length - 1 ? '' : ','}`
;
})
:
''
}
{
weekData
.
length
&&
selectValues
.
length
?
selectValues
.
map
((
item
,
index
)
=>
{
return
item
.
length
>
1
?
`${item}:00${index == selectValues.length - 1 ? '' : ','}`
:
`0${item}:00${index == selectValues.length - 1 ? '' : ','}`
;
})
:
''
}{
' '
}
{
weekData
.
length
?
'执行'
:
''
}
</
span
>
)
}
{
isType
===
'重复执行'
&&
isTypeValue
===
'ByLoop'
&&
(
<
span
style=
{
{
color
:
'#909EB6FF'
}
}
>
从
{
exeTime
}
开始,每
{
interval
}
{
unitType
[
loop_unit
]
}
执行一次。
</
span
>
)
}
</
div
>
</
Item
>
<
Item
label=
"其他设置"
wrapperCol=
{
{
span
:
28
}
}
style=
{
{
marginBottom
:
'0'
}
}
>
{
' '
}
<
div
style=
{
{
display
:
'flex'
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Item
name=
"wait"
style=
{
{
marginRight
:
'0.5rem'
}
}
>
<
Switch
checkedChildren=
"开启"
unCheckedChildren=
"关闭"
onChange=
{
onWait
}
checked=
{
waitCheck
}
/>
</
Item
>
<
div
style=
{
{
paddingTop
:
'0.3rem'
}
}
>
请求等待时间(单位:秒)
</
div
>
</
div
>
{
waitCheck
&&
(
<
Item
name=
"time_out"
>
<
div
>
<
InputNumber
value=
{
time_out
}
onChange=
{
InputTimeOut
}
/>
</
div
>
</
Item
>
)
}
</
div
>
</
Item
>
<
Item
label=
" "
wrapperCol=
{
{
span
:
28
}
}
colon=
{
false
}
style=
{
{
marginBottom
:
'0'
}
}
>
{
' '
}
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Item
name=
"post_state"
style=
{
{
marginRight
:
'0.5rem'
}
}
>
<
Switch
checkedChildren=
"开启"
unCheckedChildren=
"关闭"
onChange=
{
onPostChange
}
checked=
{
postCheck
}
/>
</
Item
>
<
div
style=
{
{
paddingTop
:
'0.3rem'
}
}
>
使用POST维持状态(上一次返回结果传入下一次请求)
</
div
>
</
div
>
</
Item
>
<
Item
label=
" "
wrapperCol=
{
{
span
:
28
}
}
colon=
{
false
}
style=
{
{
marginBottom
:
'0'
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Item
style=
{
{
marginRight
:
'0.5rem'
}
}
name=
"reentrant"
>
<
Switch
checkedChildren=
"开启"
unCheckedChildren=
"关闭"
onChange=
{
onReenChange
}
disabled=
{
isReentrant
}
checked=
{
reenCheck
}
/>
</
Item
>
<
div
style=
{
{
paddingTop
:
'0.3rem'
}
}
>
允许重入(上一次未执行完,也会执行下一次请求)
</
div
>
</
div
>
</
Item
>
<
Item
label=
" "
wrapperCol=
{
{
span
:
28
}
}
colon=
{
false
}
style=
{
{
marginBottom
:
'0'
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Item
name=
"enable_log"
style=
{
{
marginRight
:
'0.5rem'
}
}
>
<
Switch
checkedChildren=
"开启"
unCheckedChildren=
"关闭"
onChange=
{
onLogChange
}
checked=
{
logCheck
}
/>
</
Item
>
<
div
style=
{
{
paddingTop
:
'0.3rem'
}
}
>
记录日志(小于每分钟一次的请求不会记录)
</
div
>
</
div
>
</
Item
>
<
Item
label=
"禁用计划"
style=
{
{
color
:
'#f00'
}
}
name=
"is_enable"
>
<
Switch
checkedChildren=
"开启"
unCheckedChildren=
"关闭"
checked=
{
isUse
}
onChange=
{
onChange
}
/>
</
Item
>
</
Form
>
</
div
>
</
SiteModal
>
</
div
>
);
};
export
default
forwardRef
(
VisibleIISAgentConfig
);
src/pages/platformCenter/messageManage/projectManage/components/RolseSelect/RoleModalNew.jsx
0 → 100644
View file @
4850cd88
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Modal
,
Checkbox
}
from
'antd'
;
import
{
RoleGroupList
}
from
'@/services/messagemanage/messagemanage'
;
import
styles
from
'./RoleModal.less'
;
const
CheckboxGroup
=
Checkbox
.
Group
;
const
RoleModal
=
porps
=>
{
const
{
visible
,
rolCallBack
,
onCancel
,
selectValue
}
=
porps
;
const
[
roleList
,
setRoleList
]
=
useState
([]);
// 角色列表
useEffect
(()
=>
{
if
(
visible
)
{
let
hasCheckList
=
selectValue
?
selectValue
.
split
(
'|'
)
:
[];
console
.
log
(
hasCheckList
,
'hasCheckList'
);
RoleGroupList
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
roleListData
=
res
.
data
.
roleList
;
// 给子角色分类放到外面来
roleListData
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
child
.
length
>
0
)
{
item
.
child
.
forEach
((
val
,
i
)
=>
{
val
.
visibleTitle
=
`
${
item
.
visibleTitle
}
(
${
val
.
visibleTitle
}
)`
;
roleListData
.
splice
(
index
+
1
+
i
,
0
,
val
);
});
}
});
let
list
=
roleListData
.
map
(
item
=>
{
let
checkedList
=
[];
// 已选
let
options
=
[];
// 数据源
let
indeterminate
=
false
;
// 有选中但没全选样式
let
checkAll
=
false
;
// 全选样式
options
=
item
.
roleList
.
map
(
val
=>
{
let
value
=
JSON
.
stringify
({
value
:
Number
(
val
.
roleID
),
label
:
val
.
roleName
});
hasCheckList
.
forEach
(
ele
=>
{
if
(
value
===
ele
)
{
checkedList
.
push
(
ele
);
}
});
return
value
;
});
// console.log(options, 'options');
if
(
checkedList
.
length
===
options
.
length
&&
checkedList
.
length
>
0
)
{
checkAll
=
true
;
}
if
(
checkedList
.
length
<
options
.
length
&&
checkedList
.
length
>
0
)
{
indeterminate
=
true
;
}
return
{
options
,
checkedList
,
checkAll
,
indeterminate
,
visibleTitle
:
item
.
visibleTitle
,
};
});
console
.
log
(
list
,
'list'
);
setRoleList
(
list
);
}
});
console
.
log
(
selectValue
,
'selectValue'
);
}
},
[
visible
]);
// 多选change事件
const
onCheckAllChange
=
(
e
,
index
)
=>
{
let
newCheckList
=
JSON
.
parse
(
JSON
.
stringify
(
roleList
));
newCheckList
[
index
].
checkedList
=
e
.
target
.
checked
?
newCheckList
[
index
].
options
:
[];
newCheckList
[
index
].
indeterminate
=
false
;
newCheckList
[
index
].
checkAll
=
e
.
target
.
checked
;
setRoleList
(
newCheckList
);
};
// 单选change事件
const
onChange
=
(
list
,
index
)
=>
{
let
newCheckList
=
JSON
.
parse
(
JSON
.
stringify
(
roleList
));
newCheckList
[
index
].
checkedList
=
list
;
newCheckList
[
index
].
indeterminate
=
!!
list
.
length
&&
list
.
length
<
newCheckList
[
index
].
options
.
length
;
newCheckList
[
index
].
checkAll
=
list
.
length
===
newCheckList
[
index
].
options
.
length
;
setRoleList
(
newCheckList
);
};
return
(
<
div
>
<
Modal
title=
"选择推送人"
visible=
{
visible
}
onOk=
{
()
=>
rolCallBack
(
roleList
)
}
width=
"900px"
onCancel=
{
onCancel
}
maskClosable=
{
false
}
destroyOnClose
centered
>
<
div
className=
{
styles
.
checkContainer
}
>
{
roleList
.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
.
checkContent
}
key=
{
item
.
visibleTitle
}
>
<
div
className=
{
styles
.
topCheckbox
}
>
<
Checkbox
indeterminate=
{
item
.
indeterminate
}
onChange=
{
e
=>
onCheckAllChange
(
e
,
index
)
}
checked=
{
item
.
checkAll
}
>
{
item
.
visibleTitle
}
</
Checkbox
>
</
div
>
<
div
className=
{
styles
.
bottomCheckbox
}
>
<
CheckboxGroup
value=
{
item
.
checkedList
}
onChange=
{
list
=>
onChange
(
list
,
index
)
}
style=
{
{
display
:
'flex'
,
flexWrap
:
'wrap'
}
}
>
{
item
.
options
.
map
(
val
=>
(
<
Checkbox
key=
{
val
}
value=
{
val
}
>
{
JSON
.
parse
(
val
).
label
}
</
Checkbox
>
))
}
</
CheckboxGroup
>
</
div
>
</
div
>
))
}
</
div
>
</
Modal
>
</
div
>
);
};
export
default
RoleModal
;
src/pages/platformCenter/messageManage/schemeDetails/components/EnterpriseWeChatConfig.jsx
0 → 100644
View file @
4850cd88
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Form
,
Input
,
Select
,
Space
,
TreeSelect
,
Empty
,
Switch
,
Button
,
message
}
from
'antd'
;
import
{
FolderFilled
,
FileOutlined
,
MobileOutlined
}
from
'@ant-design/icons'
;
import
{
AddWorkWechatStatus
}
from
'@/services/messagemanage/messagemanage'
;
const
{
Option
}
=
Select
;
const
{
TextArea
}
=
Input
;
const
{
TreeNode
}
=
TreeSelect
;
const
typeList
=
[
{
name
:
'文字'
,
value
:
1
},
{
name
:
'卡片'
,
value
:
2
},
{
name
:
'图文'
,
value
:
3
},
{
name
:
'图片'
,
value
:
4
},
];
const
EnterpriseWeChatConfig
=
props
=>
{
const
{
menuMoblieList
,
formValue
,
id
}
=
props
;
const
[
flag
,
setFlag
]
=
useState
(
0
);
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
getFormData
();
},
[]);
const
getFormData
=
()
=>
{
console
.
log
(
formValue
,
'formValue'
);
if
(
formValue
)
{
form
.
setFieldsValue
({
...
formValue
,
WorkWechatStatus
:
formValue
.
WorkWechatStatus
===
1
});
}
};
// 监听表单
const
changeValue
=
(
changedFields
,
allFields
)
=>
{
// console.log(Object.keys(changedFields), allFields, 'changedFields');
if
(
Object
.
keys
(
changedFields
)[
0
]
===
'WorkWechatContent'
)
{
let
regex
=
/
\{
@
(
.+
?)\}
/g
;
let
originalList
=
allFields
.
lines
||
[];
let
list
=
changedFields
.
WorkWechatContent
.
match
(
regex
)?.
map
(
item
=>
{
let
Name
=
item
.
substring
(
2
,
item
.
length
-
1
);
let
orgItem
=
originalList
.
find
(
ele
=>
ele
.
Name
===
Name
);
return
{
Name
,
Description
:
orgItem
?
orgItem
.
Description
:
''
,
DefaultValue
:
orgItem
?
orgItem
.
DefaultValue
:
''
,
};
});
if
(
list
)
{
form
.
setFieldsValue
({
lines
:
list
});
}
else
{
form
.
setFieldsValue
({
lines
:
[]
});
}
}
if
(
Object
.
keys
(
changedFields
)[
0
]
===
'WorkWechatType'
)
{
setFlag
(
flag
+
1
);
}
};
const
mapAppTree
=
org
=>
{
const
haveChildren
=
Array
.
isArray
(
org
.
children
)
&&
org
.
children
.
length
>
0
;
let
icon
;
let
value
=
org
.
id
;
if
(
org
.
menuType
===
'MiniAppsingleStation'
)
{
value
=
org
.
stationID
;
icon
=
<
MobileOutlined
/>;
}
if
(
org
.
menuType
===
'MiniAppMenuGroup'
||
org
.
menuType
===
'"MiniAppMenuGroupTwo"'
)
{
value
=
org
.
id
;
icon
=
<
FolderFilled
/>;
}
if
(
org
.
menuType
===
'MiniAppMenuThree'
||
org
.
menuType
===
'MiniAppMenu'
)
{
icon
=
<
FileOutlined
style=
{
{
color
:
'#1890ff'
}
}
/>;
value
=
org
.
pageUrl
||
org
.
id
;
}
return
(
<
TreeNode
value=
{
value
}
title=
{
org
.
text
}
icon=
{
icon
}
key=
{
value
}
disabled=
{
org
.
menuType
!==
'MiniAppMenuThree'
&&
org
.
menuType
!==
'MiniAppMenu'
}
>
{
haveChildren
?
org
.
children
.
map
(
item
=>
mapAppTree
(
item
))
:
null
}
</
TreeNode
>
);
};
const
onFinish
=
()
=>
{
if
(
!
id
)
{
message
.
error
(
'请保存基础信息'
);
return
;
}
let
value
=
form
.
getFieldsValue
(
true
);
AddWorkWechatStatus
({
...
value
,
WorkWechatStatus
:
value
.
WorkWechatStatus
?
1
:
0
,
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
message
.
success
(
'保存成功'
);
}
else
{
message
.
error
(
res
.
msg
);
}
});
};
return
(
<
div
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
2
}
}
wrapperCol=
{
{
span
:
22
}
}
onValuesChange=
{
changeValue
}
labelAlign=
"left"
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Form
.
Item
label=
"消息类型"
name=
"WorkWechatType"
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
19
}
}
style=
{
{
width
:
'400px'
,
display
:
'block'
}
}
>
<
Select
placeholder=
"请选择消息类型"
>
{
typeList
.
map
(
item
=>
(
<
Option
value=
{
item
.
value
}
key=
{
item
.
value
}
>
{
item
.
name
}
</
Option
>
))
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
"企业应用ID"
name=
"WorkWechatAppID"
style=
{
{
width
:
'400px'
,
display
:
'block'
}
}
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
19
}
}
>
<
Input
placeholder=
"请填写企业应用ID"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"是否开启"
name=
"WorkWechatStatus"
valuePropName=
"checked"
style=
{
{
width
:
'400px'
,
display
:
'block'
}
}
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
19
}
}
>
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
/>
</
Form
.
Item
>
</
div
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Form
.
Item
label=
"标题"
name=
"WorkWechatTitle"
style=
{
{
width
:
'400px'
,
display
:
form
.
getFieldValue
(
'WorkWechatType'
)
===
2
||
form
.
getFieldValue
(
'WorkWechatType'
)
===
3
?
'block'
:
'none'
,
}
}
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
19
}
}
>
<
Input
placeholder=
"请填写标题"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"底部文字"
name=
"WorkWechatBtnText"
style=
{
{
width
:
'400px'
,
display
:
form
.
getFieldValue
(
'WorkWechatType'
)
===
2
?
'block'
:
'none'
,
}
}
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
19
}
}
>
<
Input
placeholder=
"请填写底部文字"
/>
</
Form
.
Item
>
</
div
>
<
Form
.
Item
label=
"图片路径"
name=
"WorkWechatImgUrl"
style=
{
{
width
:
'1200px'
,
display
:
form
.
getFieldValue
(
'WorkWechatType'
)
===
3
||
form
.
getFieldValue
(
'WorkWechatType'
)
===
4
?
'block'
:
'none'
,
}
}
>
<
Input
placeholder=
"请填写底部文字"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"跳转路径"
name=
"WorkWechatUrl"
style=
{
{
display
:
form
.
getFieldValue
(
'WorkWechatType'
)
===
3
||
form
.
getFieldValue
(
'WorkWechatType'
)
===
2
?
'block'
:
'none'
,
width
:
'1200px'
,
}
}
>
<
Input
placeholder=
"请填写跳转路径"
/>
{
/* <TreeSelect
showSearch
treeNodeFilterProp="title"
treeNodeLabelProp="value"
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择功能路径"
allowClear
treeDefaultExpandAll
treeIcon
>
{menuMoblieList ? (
menuMoblieList.map(item => mapAppTree(item))
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</TreeSelect> */
}
</
Form
.
Item
>
<
Form
.
Item
label=
"内容"
name=
"WorkWechatContent"
style=
{
{
display
:
form
.
getFieldValue
(
'WorkWechatType'
)
!==
4
?
'block'
:
'none'
,
width
:
'1200px'
,
}
}
>
<
TextArea
rows=
{
4
}
placeholder=
"请输入内容"
/>
</
Form
.
Item
>
<
Form
.
List
name=
"lines"
>
{
fields
=>
(
<
div
style=
{
{
display
:
form
.
getFieldValue
(
'WorkWechatType'
)
!==
4
?
'block'
:
'none'
,
}
}
>
{
fields
.
map
(({
key
,
name
,
...
restField
})
=>
(
<
Space
key=
{
key
}
style=
{
{
display
:
'flex'
,
marginBottom
:
8
,
}
}
align=
"baseline"
>
<
Form
.
Item
{
...
restField
}
label=
"参数名"
name=
{
[
name
,
'Name'
]
}
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
>
<
Input
readOnly
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'Description'
]
}
label=
"含义"
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
// rules=
{[
//
{
// required: true,
// message: '请填写含义',
//
},
// ]
}
>
<
Input
placeholder=
"请填写含义"
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'DefaultValue'
]
}
label=
"默认值"
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
// rules=
{[
//
{
// required: true,
// message: '请填写默认值',
//
},
// ]
}
>
<
Input
placeholder=
"请填写默认值"
/>
</
Form
.
Item
>
{
/* <MinusCircleOutlined onClick={() => remove(name)} /> */
}
</
Space
>
))
}
{
/* <Form.Item>
<Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}>
Add field
</Button>
</Form.Item> */
}
</
div
>
)
}
</
Form
.
List
>
<
Form
.
Item
>
<
Button
type=
"primary"
onClick=
{
onFinish
}
>
保存
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
);
};
export
default
EnterpriseWeChatConfig
;
src/pages/platformCenter/messageManage/schemeDetails/components/PlatformConfig.jsx
0 → 100644
View file @
4850cd88
/* eslint-disable global-require */
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Form
,
Input
,
Select
,
Space
,
TreeSelect
,
Empty
,
Switch
,
Button
,
message
}
from
'antd'
;
import
ReactQuill
from
'react-quill'
;
import
'react-quill/dist/quill.snow.css'
;
import
{
DeleteOutlined
,
PictureOutlined
,
DesktopOutlined
,
FolderFilled
,
FileOutlined
,
MobileOutlined
,
}
from
'@ant-design/icons'
;
import
{
AddPlatformStatus
}
from
'@/services/messagemanage/messagemanage'
;
import
{
GetMessageIcon
}
from
'@/services/messagemanage/messagemanage'
;
import
styles
from
'./PlatformConfig.less'
;
import
PreviewModal
from
'../../schemeDetail/PreviewModal'
;
const
{
Option
}
=
Select
;
const
{
TreeNode
}
=
TreeSelect
;
const
typeList
=
[
{
name
:
'通用报警'
,
value
:
1
},
{
name
:
'工单通知'
,
value
:
2
},
{
name
:
'系统通知'
,
value
:
3
},
{
name
:
'自定义'
,
value
:
4
},
];
const
modules
=
{
// toolbar: { container: '#toolbar' },
toolbar
:
[
[{
size
:
[
'small'
,
false
,
'large'
,
'huge'
]
}],
// custom dropdown
[{
header
:
[
1
,
2
,
3
,
4
,
5
,
6
,
false
]
}],
[{
color
:
[]
},
{
background
:
[]
}],
[{
font
:
[]
}],
[{
align
:
[]
}],
[
'bold'
,
'italic'
,
'underline'
,
'strike'
,
'blockquote'
],
[{
list
:
'ordered'
},
{
list
:
'bullet'
},
{
indent
:
'-1'
},
{
indent
:
'+1'
}],
[
'clean'
],
// 清空
],
};
const
defaultWebIcon
=
require
(
'../../../../../assets/images/icons/imgNone.png'
);
// 默认图标
const
PlatformConfig
=
props
=>
{
const
{
menuWebList
,
menuMoblieList
,
formValue
,
id
}
=
props
;
const
[
iconMaskShow
,
setIconMaskShow
]
=
useState
(
false
);
const
[
previewModal
,
setPreviewModal
]
=
useState
(
false
);
// 图片选择
const
[
imgDataList
,
setImgDataList
]
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
getMessageIcon
();
getFormData
();
},
[]);
const
getFormData
=
()
=>
{
console
.
log
(
formValue
,
'formValue'
);
if
(
formValue
)
{
form
.
setFieldsValue
({
...
formValue
,
PlatformIcon
:
`
${
window
.
location
.
origin
}
/
${
formValue
.
PlatformIcon
}
`
,
PlatformStatus
:
formValue
.
PlatformStatus
===
1
,
});
if
(
!
formValue
?.
PlatformIcon
)
{
form
.
setFieldsValue
({
PlatformIcon
:
defaultWebIcon
});
}
}
};
// 获取图片库
const
getMessageIcon
=
()
=>
{
GetMessageIcon
().
then
(
res
=>
{
setImgDataList
(
res
.
data
);
});
};
const
callBackSubmit
=
value
=>
{
console
.
log
(
value
,
'lvaue'
);
form
.
setFieldsValue
({
PlatformIcon
:
`
${
window
.
location
.
origin
}
/
${
value
}
`
});
};
// 监听表单
const
changeValue
=
(
changedFields
,
allFields
)
=>
{
// console.log(Object.keys(changedFields), allFields, 'changedFields');
if
(
Object
.
keys
(
changedFields
)[
0
]
===
'PlatformContent'
)
{
let
regex
=
/
\{
@
(
.+
?)\}
/g
;
let
originalList
=
allFields
.
lines
||
[];
let
list
=
changedFields
.
PlatformContent
.
match
(
regex
)?.
map
(
item
=>
{
let
Name
=
item
.
substring
(
2
,
item
.
length
-
1
);
let
orgItem
=
originalList
.
find
(
ele
=>
ele
.
Name
===
Name
);
return
{
Name
,
Description
:
orgItem
?
orgItem
.
Description
:
''
,
DefaultValue
:
orgItem
?
orgItem
.
DefaultValue
:
''
,
};
});
if
(
list
)
{
form
.
setFieldsValue
({
lines
:
list
});
}
else
{
form
.
setFieldsValue
({
lines
:
[]
});
}
}
};
const
mapTree
=
org
=>
{
const
haveChildren
=
Array
.
isArray
(
org
.
children
)
&&
org
.
children
.
length
>
0
;
let
icon
;
let
value
=
org
.
id
;
if
(
org
.
menuType
===
'Web4singleStation'
)
{
value
=
org
.
stationID
;
icon
=
<
DesktopOutlined
/>;
}
if
(
org
.
menuType
===
'Web4MenuGroup'
)
{
value
=
org
.
id
;
icon
=
<
FolderFilled
/>;
}
if
(
org
.
menuType
===
'Web4Menu'
)
{
icon
=
<
FileOutlined
style=
{
{
color
:
'#1890ff'
}
}
/>;
value
=
org
.
pageUrl
;
}
return
(
<
TreeNode
value=
{
value
}
title=
{
org
.
text
}
key=
{
value
}
icon=
{
icon
}
disabled=
{
org
.
menuType
!==
'Web4Menu'
}
>
{
haveChildren
?
org
.
children
.
map
(
item
=>
mapTree
(
item
))
:
null
}
</
TreeNode
>
);
};
const
mapAppTree
=
org
=>
{
const
haveChildren
=
Array
.
isArray
(
org
.
children
)
&&
org
.
children
.
length
>
0
;
let
icon
;
let
value
=
org
.
id
;
if
(
org
.
menuType
===
'MiniAppsingleStation'
)
{
value
=
org
.
stationID
;
icon
=
<
MobileOutlined
/>;
}
if
(
org
.
menuType
===
'MiniAppMenuGroup'
||
org
.
menuType
===
'"MiniAppMenuGroupTwo"'
)
{
value
=
org
.
id
;
icon
=
<
FolderFilled
/>;
}
if
(
org
.
menuType
===
'MiniAppMenuThree'
||
org
.
menuType
===
'MiniAppMenu'
)
{
icon
=
<
FileOutlined
style=
{
{
color
:
'#1890ff'
}
}
/>;
value
=
org
.
pageUrl
||
org
.
id
;
}
return
(
<
TreeNode
value=
{
value
}
title=
{
org
.
text
}
icon=
{
icon
}
key=
{
value
}
disabled=
{
org
.
menuType
!==
'MiniAppMenuThree'
&&
org
.
menuType
!==
'MiniAppMenu'
}
>
{
haveChildren
?
org
.
children
.
map
(
item
=>
mapAppTree
(
item
))
:
null
}
</
TreeNode
>
);
};
const
onFinish
=
()
=>
{
if
(
!
id
)
{
message
.
error
(
'请保存基础信息'
);
return
;
}
let
value
=
form
.
getFieldsValue
(
true
);
console
.
log
(
value
);
let
PlatformIcon
=
value
.
PlatformIcon
===
defaultWebIcon
?
''
:
new
URL
(
value
.
PlatformIcon
).
pathname
;
if
(
value
)
AddPlatformStatus
({
...
value
,
PlatformIcon
,
PlatformStatus
:
value
.
PlatformStatus
?
1
:
0
,
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
message
.
success
(
'保存成功'
);
}
else
{
message
.
error
(
res
.
msg
);
}
});
};
return
(
<
div
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
2
}
}
wrapperCol=
{
{
span
:
22
}
}
onValuesChange=
{
changeValue
}
labelAlign=
"left"
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Form
.
Item
label=
"消息类型"
name=
"PlatformType"
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
20
}
}
style=
{
{
width
:
'400px'
,
marginRight
:
'15px'
,
display
:
'block'
}
}
>
<
Select
placeholder=
"请选择消息类型"
allowClear
>
{
typeList
.
map
(
item
=>
(
<
Option
value=
{
item
.
value
}
key=
{
item
.
value
}
>
{
item
.
name
}
</
Option
>
))
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
"消息标题"
name=
"PlatformTitle"
style=
{
{
width
:
'400px'
,
display
:
'block'
}
}
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
20
}
}
>
<
Input
placeholder=
"请填写消息标题"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"是否开启"
name=
"PlatformStatus"
valuePropName=
"checked"
style=
{
{
width
:
'400px'
,
display
:
'block'
}
}
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
20
}
}
>
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
/>
</
Form
.
Item
>
</
div
>
<
Form
.
Item
label=
"网页跳转路径"
name=
"PlatformWebUrl"
style=
{
{
display
:
'block'
,
width
:
'1200px'
}
}
>
<
TreeSelect
showSearch
treeNodeFilterProp=
"title"
treeNodeLabelProp=
"value"
dropdownStyle=
{
{
maxHeight
:
400
,
overflow
:
'auto'
}
}
placeholder=
"请选择功能路径"
allowClear
treeDefaultExpandAll
treeIcon
>
{
menuWebList
?
(
menuWebList
.
map
(
item
=>
mapTree
(
item
))
)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
)
}
</
TreeSelect
>
</
Form
.
Item
>
<
Form
.
Item
label=
"APP跳转路径"
name=
"PlatformAppUrl"
style=
{
{
display
:
'block'
,
width
:
'1200px'
}
}
>
<
TreeSelect
showSearch
treeNodeFilterProp=
"title"
treeNodeLabelProp=
"value"
dropdownStyle=
{
{
maxHeight
:
400
,
overflow
:
'auto'
}
}
placeholder=
"请选择功能路径"
allowClear
treeDefaultExpandAll
treeIcon
>
{
menuMoblieList
?
(
menuMoblieList
.
map
(
item
=>
mapAppTree
(
item
))
)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
)
}
</
TreeSelect
>
</
Form
.
Item
>
<
Form
.
Item
label=
"图标"
style=
{
{
display
:
'block'
}
}
>
<
div
className=
{
styles
.
formImg
}
onMouseEnter=
{
()
=>
{
if
(
form
.
getFieldValue
(
'PlatformIcon'
)
!==
defaultWebIcon
)
{
setIconMaskShow
(
true
);
}
}
}
onMouseLeave=
{
()
=>
setIconMaskShow
(
false
)
}
>
<
div
className=
{
styles
.
mask
}
style=
{
{
display
:
iconMaskShow
?
'flex'
:
'none'
}
}
>
<
DeleteOutlined
className=
{
styles
.
icon
}
onClick=
{
()
=>
form
.
setFieldsValue
({
PlatformIcon
:
defaultWebIcon
})
}
/>
<
PictureOutlined
className=
{
styles
.
icon
}
onClick=
{
()
=>
setPreviewModal
(
true
)
}
/>
</
div
>
<
Form
.
Item
name=
"PlatformIcon"
valuePropName=
"src"
initialValue=
{
defaultWebIcon
}
>
<
img
alt=
""
onClick=
{
()
=>
setPreviewModal
(
true
)
}
/>
</
Form
.
Item
>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
label=
"内容"
name=
"PlatformContent"
style=
{
{
display
:
'block'
,
width
:
'1200px'
,
height
:
'200px'
,
marginBottom
:
'45px'
}
}
>
<
ReactQuill
style=
{
{
height
:
'150px'
}
}
placeholder=
"请输入内容"
modules=
{
modules
}
theme=
"snow"
// 主题
/>
</
Form
.
Item
>
<
Form
.
List
name=
"lines"
>
{
fields
=>
(
<>
{
fields
.
map
(({
key
,
name
,
...
restField
})
=>
(
<
Space
key=
{
key
}
style=
{
{
display
:
'flex'
,
marginBottom
:
8
,
}
}
align=
"baseline"
>
<
Form
.
Item
{
...
restField
}
label=
"参数名"
name=
{
[
name
,
'Name'
]
}
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
>
<
Input
readOnly
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'Description'
]
}
label=
"含义"
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
>
<
Input
placeholder=
"请填写含义"
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'DefaultValue'
]
}
label=
"默认值"
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
>
<
Input
placeholder=
"请填写默认值"
/>
</
Form
.
Item
>
{
/* <MinusCircleOutlined onClick={() => remove(name)} /> */
}
</
Space
>
))
}
{
/* <Form.Item>
<Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}>
Add field
</Button>
</Form.Item> */
}
</>
)
}
</
Form
.
List
>
<
Form
.
Item
>
<
Button
type=
"primary"
onClick=
{
onFinish
}
>
保存
</
Button
>
</
Form
.
Item
>
</
Form
>
<
PreviewModal
visible=
{
previewModal
}
onCancel=
{
()
=>
{
setPreviewModal
(
false
);
}
}
keepImgeUrl=
{
form
.
getFieldValue
(
'PlatformIcon'
)?.
replace
(
`${window.location.origin}/`
,
''
)
}
imgDataList=
{
imgDataList
}
callBackSubmit=
{
callBackSubmit
}
/>
</
div
>
);
};
export
default
PlatformConfig
;
src/pages/platformCenter/messageManage/schemeDetails/components/PlatformConfig.less
0 → 100644
View file @
4850cd88
.formImg {
position: relative;
width: 80px;
height: 80px;
.mask {
position: absolute;
display: flex;
align-items: center;
justify-content: space-around;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .6);
z-index: 1;
cursor: pointer;
.icon {
font-size: 24px;
color: #fff;
}
}
img {
width: 80px;
height: 80px;
cursor: pointer;
background-color: #ccc;
}
}
\ No newline at end of file
src/pages/platformCenter/messageManage/schemeDetails/components/ShortMessageConfig.jsx
0 → 100644
View file @
4850cd88
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Form
,
Input
,
Select
,
Space
,
TreeSelect
,
Empty
,
Switch
,
Button
,
message
}
from
'antd'
;
import
{
DeleteOutlined
}
from
'@ant-design/icons'
;
import
{
AddSMSStatus
}
from
'@/services/messagemanage/messagemanage'
;
const
{
Option
}
=
Select
;
const
{
TextArea
}
=
Input
;
const
typeList
=
[
{
name
:
'通用报警'
,
value
:
1
},
{
name
:
'系统通知'
,
value
:
2
},
{
name
:
'自定义'
,
value
:
3
},
];
const
ShortMessageConfig
=
props
=>
{
const
{
formValue
,
id
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
getFormData
();
},
[]);
const
getFormData
=
()
=>
{
console
.
log
(
formValue
,
'formValue'
);
if
(
formValue
)
{
form
.
setFieldsValue
({
...
formValue
,
SMSStaus
:
formValue
.
SMSStaus
===
1
});
}
};
// 监听表单
const
changeValue
=
(
changedFields
,
allFields
)
=>
{
// console.log(Object.keys(changedFields), allFields, 'changedFields');
if
(
Object
.
keys
(
changedFields
)[
0
]
===
'SMSContent'
)
{
let
regex
=
/
\{
@
(
.+
?)\}
/g
;
let
originalList
=
allFields
.
lines
||
[];
let
list
=
changedFields
.
SMSContent
.
match
(
regex
)?.
map
(
item
=>
{
let
Name
=
item
.
substring
(
2
,
item
.
length
-
1
);
let
orgItem
=
originalList
.
find
(
ele
=>
ele
.
Name
===
Name
);
return
{
Name
,
Description
:
orgItem
?
orgItem
.
Description
:
''
,
DefaultValue
:
orgItem
?
orgItem
.
DefaultValue
:
''
,
};
});
if
(
list
)
{
form
.
setFieldsValue
({
lines
:
list
});
}
else
{
form
.
setFieldsValue
({
lines
:
[]
});
}
}
};
const
onFinish
=
()
=>
{
if
(
!
id
)
{
message
.
error
(
'请保存基础信息'
);
return
;
}
let
value
=
form
.
getFieldsValue
(
true
);
AddSMSStatus
({
...
value
,
SMSStaus
:
value
.
SMSStaus
?
1
:
0
,
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
message
.
success
(
'保存成功'
);
}
else
{
message
.
error
(
res
.
msg
);
}
});
};
return
(
<
div
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
2
}
}
wrapperCol=
{
{
span
:
22
}
}
onValuesChange=
{
changeValue
}
labelAlign=
"left"
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Form
.
Item
label=
"消息类型"
name=
"SMSType"
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
20
}
}
style=
{
{
width
:
'400px'
,
marginRight
:
'15px'
,
display
:
'block'
}
}
>
<
Select
placeholder=
"请选择消息类型"
allowClear
>
{
typeList
.
map
(
item
=>
(
<
Option
value=
{
item
.
value
}
key=
{
item
.
value
}
>
{
item
.
name
}
</
Option
>
))
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
"短信编号"
name=
"SMSNumber"
style=
{
{
width
:
'400px'
,
display
:
'block'
}
}
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
20
}
}
>
<
Input
placeholder=
"请填写消息标题"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"是否开启"
name=
"SMSStaus"
valuePropName=
"checked"
style=
{
{
width
:
'400px'
,
display
:
'block'
}
}
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
20
}
}
>
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
/>
</
Form
.
Item
>
</
div
>
<
Form
.
Item
label=
"内容"
name=
"SMSContent"
style=
{
{
display
:
'block'
,
width
:
'1200px'
}
}
>
<
TextArea
rows=
{
4
}
placeholder=
"请输入内容"
/>
</
Form
.
Item
>
<
Form
.
List
name=
"lines"
>
{
fields
=>
(
<>
{
fields
.
map
(({
key
,
name
,
...
restField
})
=>
(
<
Space
key=
{
key
}
style=
{
{
display
:
'flex'
,
marginBottom
:
8
,
}
}
align=
"baseline"
>
<
Form
.
Item
{
...
restField
}
label=
"参数名"
name=
{
[
name
,
'Name'
]
}
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
>
<
Input
readOnly
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'Description'
]
}
label=
"含义"
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
// rules=
{[
//
{
// required: true,
// message: '请填写含义',
//
},
// ]
}
>
<
Input
placeholder=
"请填写含义"
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'DefaultValue'
]
}
label=
"默认值"
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
// rules=
{[
//
{
// required: true,
// message: '请填写默认值',
//
},
// ]
}
>
<
Input
placeholder=
"请填写默认值"
/>
</
Form
.
Item
>
{
/* <MinusCircleOutlined onClick={() => remove(name)} /> */
}
</
Space
>
))
}
{
/* <Form.Item>
<Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}>
Add field
</Button>
</Form.Item> */
}
</>
)
}
</
Form
.
List
>
<
Form
.
Item
>
<
Button
type=
"primary"
onClick=
{
onFinish
}
>
保存
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
);
};
export
default
ShortMessageConfig
;
src/pages/platformCenter/messageManage/schemeDetails/components/WeChatConfig.jsx
0 → 100644
View file @
4850cd88
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Form
,
Input
,
Select
,
Space
,
TreeSelect
,
Empty
,
Switch
,
Button
,
message
}
from
'antd'
;
import
{
FolderFilled
,
FileOutlined
,
MobileOutlined
}
from
'@ant-design/icons'
;
import
{
AddWechatStatus
}
from
'@/services/messagemanage/messagemanage'
;
const
{
Option
}
=
Select
;
const
{
TextArea
}
=
Input
;
const
{
TreeNode
}
=
TreeSelect
;
const
typeList
=
[{
name
:
'报警通知'
,
value
:
1
},
{
name
:
'运行简报'
,
value
:
2
}];
const
WeChatConfig
=
props
=>
{
const
{
menuMoblieList
,
formValue
,
id
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
getFormData
();
},
[]);
const
getFormData
=
()
=>
{
console
.
log
(
formValue
,
'formValue'
);
if
(
formValue
)
{
form
.
setFieldsValue
({
...
formValue
,
WechatStaus
:
formValue
.
WechatStaus
===
1
});
}
};
// 监听表单
const
changeValue
=
(
changedFields
,
allFields
)
=>
{
// console.log(Object.keys(changedFields), allFields, 'changedFields');
if
(
Object
.
keys
(
changedFields
)[
0
]
===
'WechatContent'
)
{
let
regex
=
/
\{
@
(
.+
?)\}
/g
;
let
originalList
=
allFields
.
lines
||
[];
let
list
=
changedFields
.
WechatContent
.
match
(
regex
)?.
map
(
item
=>
{
let
Name
=
item
.
substring
(
2
,
item
.
length
-
1
);
let
orgItem
=
originalList
.
find
(
ele
=>
ele
.
Name
===
Name
);
return
{
Name
,
Description
:
orgItem
?
orgItem
.
Description
:
''
,
DefaultValue
:
orgItem
?
orgItem
.
DefaultValue
:
''
,
};
});
if
(
list
)
{
form
.
setFieldsValue
({
lines
:
list
});
}
else
{
form
.
setFieldsValue
({
lines
:
[]
});
}
}
};
const
mapAppTree
=
org
=>
{
const
haveChildren
=
Array
.
isArray
(
org
.
children
)
&&
org
.
children
.
length
>
0
;
let
icon
;
let
value
=
org
.
id
;
if
(
org
.
menuType
===
'MiniAppsingleStation'
)
{
value
=
org
.
stationID
;
icon
=
<
MobileOutlined
/>;
}
if
(
org
.
menuType
===
'MiniAppMenuGroup'
||
org
.
menuType
===
'"MiniAppMenuGroupTwo"'
)
{
value
=
org
.
id
;
icon
=
<
FolderFilled
/>;
}
if
(
org
.
menuType
===
'MiniAppMenuThree'
||
org
.
menuType
===
'MiniAppMenu'
)
{
icon
=
<
FileOutlined
style=
{
{
color
:
'#1890ff'
}
}
/>;
value
=
org
.
pageUrl
||
org
.
id
;
}
return
(
<
TreeNode
value=
{
value
}
title=
{
org
.
text
}
icon=
{
icon
}
key=
{
value
}
disabled=
{
org
.
menuType
!==
'MiniAppMenuThree'
&&
org
.
menuType
!==
'MiniAppMenu'
}
>
{
haveChildren
?
org
.
children
.
map
(
item
=>
mapAppTree
(
item
))
:
null
}
</
TreeNode
>
);
};
const
onFinish
=
()
=>
{
if
(
!
id
)
{
message
.
error
(
'请保存基础信息'
);
return
;
}
let
value
=
form
.
getFieldsValue
(
true
);
AddWechatStatus
({
...
value
,
WechatStaus
:
value
.
WechatStaus
?
1
:
0
,
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
message
.
success
(
'保存成功'
);
}
else
{
message
.
error
(
res
.
msg
);
}
});
};
return
(
<
div
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
2
}
}
wrapperCol=
{
{
span
:
22
}
}
onValuesChange=
{
changeValue
}
labelAlign=
"left"
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Form
.
Item
label=
"消息类型"
name=
"WechatType"
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
20
}
}
style=
{
{
width
:
'400px'
,
marginRight
:
'15px'
,
display
:
'block'
}
}
>
<
Select
placeholder=
"请选择消息类型"
allowClear
>
{
typeList
.
map
(
item
=>
(
<
Option
value=
{
item
.
value
}
key=
{
item
.
value
}
>
{
item
.
name
}
</
Option
>
))
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
"模板编号"
name=
"WechatCode"
style=
{
{
width
:
'400px'
,
display
:
'block'
}
}
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
20
}
}
>
<
Input
placeholder=
"请填写消息标题"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"是否开启"
name=
"WechatStaus"
valuePropName=
"checked"
style=
{
{
width
:
'400px'
,
display
:
'block'
}
}
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
20
}
}
>
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
/>
</
Form
.
Item
>
</
div
>
<
Form
.
Item
label=
"跳转路径"
name=
"WechatUrl"
style=
{
{
display
:
'block'
,
width
:
'1200px'
}
}
>
<
Input
placeholder=
"请填写跳转路径"
/>
{
/* <TreeSelect
showSearch
treeNodeFilterProp="title"
treeNodeLabelProp="value"
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择功能路径"
allowClear
treeDefaultExpandAll
treeIcon
>
{menuMoblieList ? (
menuMoblieList.map(item => mapAppTree(item))
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</TreeSelect> */
}
</
Form
.
Item
>
<
Form
.
Item
label=
"内容"
name=
"WechatContent"
style=
{
{
display
:
'block'
,
width
:
'1200px'
}
}
>
<
TextArea
rows=
{
6
}
placeholder=
"请输入内容"
/>
</
Form
.
Item
>
<
Form
.
List
name=
"lines"
>
{
fields
=>
(
<>
{
fields
.
map
(({
key
,
name
,
...
restField
})
=>
(
<
Space
key=
{
key
}
style=
{
{
display
:
'flex'
,
marginBottom
:
8
,
}
}
align=
"baseline"
>
<
Form
.
Item
{
...
restField
}
label=
"参数名"
name=
{
[
name
,
'Name'
]
}
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
>
<
Input
readOnly
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'Description'
]
}
label=
"含义"
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
// rules=
{[
//
{
// required: true,
// message: '请填写含义',
//
},
// ]
}
>
<
Input
placeholder=
"请填写含义"
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'DefaultValue'
]
}
label=
"默认值"
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
// rules=
{[
//
{
// required: true,
// message: '请填写默认值',
//
},
// ]
}
>
<
Input
placeholder=
"请填写默认值"
/>
</
Form
.
Item
>
{
/* <MinusCircleOutlined onClick={() => remove(name)} /> */
}
</
Space
>
))
}
{
/* <Form.Item>
<Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}>
Add field
</Button>
</Form.Item> */
}
</>
)
}
</
Form
.
List
>
<
Form
.
Item
>
<
Button
type=
"primary"
onClick=
{
onFinish
}
>
保存
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
);
};
export
default
WeChatConfig
;
src/pages/platformCenter/messageManage/schemeDetails/schemeDetails.jsx
0 → 100644
View file @
4850cd88
import
React
,
{
useState
,
useEffect
,
useRef
,
useCallback
}
from
'react'
;
import
{
Button
,
Form
,
Input
,
Switch
,
Tooltip
,
Divider
,
Collapse
,
PageHeader
,
message
}
from
'antd'
;
import
{
FieldTimeOutlined
,
UsergroupAddOutlined
}
from
'@ant-design/icons'
;
import
{
getWebModuleTree
}
from
'@/services/webConfig/api'
;
import
{
getMiniAppModuleTree
}
from
'@/services/mobileConfig/api'
;
import
{
AddMessageConfigs
,
UpdateMessageConfigs
,
AddIISAgentConfig
,
}
from
'@/services/messagemanage/messagemanage'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
PlatformConfig
from
'./components/PlatformConfig'
;
import
ShortMessageConfig
from
'./components/ShortMessageConfig'
;
import
WeChatConfig
from
'./components/WeChatConfig'
;
import
EnterpriseWeChatConfig
from
'./components/EnterpriseWeChatConfig'
;
import
RoleModal
from
'../projectManage/components/RolseSelect/RoleModalNew'
;
import
VisibleIISAgentConfig
from
'../projectManage/components/IISAgentConfig/VisibleIISAgentConfigNew'
;
import
styles
from
'./schemeDetails.less'
;
const
{
Panel
}
=
Collapse
;
const
SchemeDetails
=
props
=>
{
const
history
=
useHistory
();
const
{
schemeMsg
}
=
props
.
location
.
state
;
const
[
baseForm
]
=
Form
.
useForm
();
const
[
menuWebList
,
setMenuWebList
]
=
useState
([]);
// web菜单列表
const
[
menuMoblieList
,
setMenuMoblieList
]
=
useState
([]);
// app菜单列表
const
[
IISConfig
,
setIISConfig
]
=
useState
(
null
);
// 定时计划配置
const
[
showRoleModal
,
setShowRoleModal
]
=
useState
(
false
);
// 推送组选择角色弹窗
const
[
flag
,
setFlag
]
=
useState
(
0
);
const
schemeTypeList
=
useRef
({});
const
schemeId
=
useRef
();
const
timePlan
=
useRef
();
const
roleSelect
=
useRef
([]);
useEffect
(()
=>
{
console
.
log
(
schemeMsg
,
'schemeMsg'
);
getFormData
();
getWebTree
();
getAppTRee
();
},
[]);
const
getFormData
=
()
=>
{
if
(
!
schemeMsg
)
{
return
;
}
roleSelect
.
current
=
schemeMsg
.
TimeJobGroup
.
map
(
item
=>
JSON
.
stringify
({
value
:
item
.
id
,
label
:
item
.
name
,
}),
);
console
.
log
(
roleSelect
.
current
,
'roleSelect.current'
);
baseForm
.
setFieldsValue
({
SchemeName
:
schemeMsg
.
SchemeName
,
TimeJobGroup
:
schemeMsg
.
TimeJobGroup
.
map
(
item
=>
item
.
name
).
join
(
','
),
TimeJobOpen
:
schemeMsg
.
TimeJobOpen
===
1
,
IsEnable
:
schemeMsg
.
IsEnable
===
1
,
});
setFlag
(
flag
+
1
);
};
// 获取apptree数据
const
getAppTRee
=
()
=>
{
getMiniAppModuleTree
({
userMode
:
'super'
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
list
=
res
.
data
.
find
(
item
=>
item
.
id
===
'MiniAppSite'
);
let
applist
=
list
.
children
.
map
(
item
=>
({
...
item
,
children
:
item
.
children
[
1
].
children
,
}));
setMenuMoblieList
(
applist
);
}
else
{
message
.
error
(
res
.
msg
);
}
})
.
catch
(
err
=>
{
message
.
error
(
'网络异常请稍后再试'
);
});
};
const
getWebTree
=
()
=>
{
getWebModuleTree
(
'super'
)
.
then
(
res
=>
{
const
{
code
,
data
}
=
res
;
if
(
code
===
0
)
{
let
list
=
data
.
find
(
item
=>
item
.
id
===
'Web4SingleStation'
);
let
weblist
=
list
.
children
.
map
(
item
=>
({
...
item
,
children
:
item
.
children
[
1
].
children
,
}));
setMenuWebList
(
weblist
);
}
else
{
message
.
error
(
res
.
msg
);
}
})
.
catch
(
err
=>
{
message
.
error
(
'网络异常请稍后再试'
);
});
};
const
headerRender
=
value
=>
{
return
value
;
};
// 角色回调函数
const
rolCallBack
=
useCallback
(
list
=>
{
console
.
log
(
list
,
'list'
);
let
strList
=
[];
roleSelect
.
current
=
[];
if
(
list
.
length
>
0
)
{
list
.
forEach
(
item
=>
{
item
.
checkedList
.
forEach
(
ele
=>
{
strList
.
push
(
JSON
.
parse
(
ele
).
label
);
roleSelect
.
current
.
push
(
ele
);
});
});
baseForm
.
setFieldsValue
({
TimeJobGroup
:
strList
.
join
(
','
)
});
setShowRoleModal
(
false
);
}
});
// 定时计划
const
onIISAgentSubmit
=
val
=>
{
console
.
log
(
val
,
'valfadsf'
);
setIISConfig
(
val
);
};
const
onFinish
=
()
=>
{
let
val
=
baseForm
.
getFieldsValue
(
true
);
let
obj
=
{
SchemeName
:
val
.
SchemeName
,
IsEnable
:
val
.
IsEnable
?
1
:
0
,
TimeJobOpen
:
val
.
TimeJobOpen
?
1
:
0
,
TimeJobGroup
:
roleSelect
.
current
.
map
(
item
=>
JSON
.
parse
(
item
).
value
).
join
(
','
),
};
if
(
schemeMsg
)
{
UpdateMessageConfigs
({
...
obj
,
id
:
schemeMsg
.
Id
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
message
.
success
(
'保存成功'
);
saveIISAgentConfig
();
}
else
{
message
.
error
(
res
.
msg
);
}
});
}
else
{
AddMessageConfigs
(
obj
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
schemeId
.
current
=
res
.
data
;
setFlag
(
flag
+
1
);
message
.
success
(
'保存成功'
);
saveIISAgentConfig
();
}
else
{
message
.
error
(
res
.
msg
);
}
});
}
};
const
saveIISAgentConfig
=
()
=>
{
if
(
IISConfig
)
{
AddIISAgentConfig
(
IISConfig
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
// message.success('保存成功');
}
else
{
message
.
error
(
res
.
msg
);
}
});
}
};
return
(
<
div
className=
{
styles
.
detailContent
}
>
<
PageHeader
className=
"site-page-header"
onBack=
{
()
=>
history
.
push
({
pathname
:
'/platform/notificationNew'
,
})
}
title=
"返回"
subTitle=
""
/>
<
div
className=
{
styles
.
configContent
}
>
<
Divider
orientation=
"left"
style=
{
{
borderTopColor
:
'#99bbe8'
,
color
:
'#15428b'
,
fontWeight
:
700
,
}
}
>
基础设置
</
Divider
>
<
Form
form=
{
baseForm
}
layout=
"inline"
>
<
Form
.
Item
label=
"方案名称"
name=
"SchemeName"
>
<
Input
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"是否启用"
name=
"IsEnable"
valuePropName=
"checked"
>
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"启用定时计划"
name=
"TimeJobOpen"
valuePropName=
"checked"
>
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"推送组"
>
<
Input
.
Group
compact
style=
{
{
display
:
'flex'
,
}
}
>
<
Form
.
Item
name=
"TimeJobGroup"
>
<
Input
readOnly
/>
</
Form
.
Item
>
<
Tooltip
title=
"选择推送组"
>
<
Button
icon=
{
<
UsergroupAddOutlined
/>
}
onClick=
{
()
=>
setShowRoleModal
(
true
)
}
/>
</
Tooltip
>
</
Input
.
Group
>
</
Form
.
Item
>
<
Form
.
Item
label=
"定时计划"
>
<
Input
.
Group
compact
style=
{
{
display
:
'flex'
,
}
}
>
{
/* <Input /> */
}
<
Tooltip
title=
"配置定时计划"
>
<
Button
icon=
{
<
FieldTimeOutlined
/>
}
onClick=
{
()
=>
{
setFlag
(
flag
+
1
);
timePlan
.
current
.
setPreviewVisible
(
true
);
}
}
/>
</
Tooltip
>
</
Input
.
Group
>
</
Form
.
Item
>
<
Form
.
Item
>
<
Button
type=
"primary"
onClick=
{
onFinish
}
>
保存
</
Button
>
</
Form
.
Item
>
</
Form
>
<
Divider
orientation=
"left"
style=
{
{
borderTopColor
:
'#99bbe8'
,
color
:
'#15428b'
,
fontWeight
:
700
,
}
}
>
方案管理
</
Divider
>
<
Collapse
accordion
defaultActiveKey=
{
[
'1'
]
}
>
<
Panel
header=
{
headerRender
(
'平台消息配置'
)
}
key=
"1"
>
<
PlatformConfig
id=
{
schemeMsg
?
schemeMsg
?.
Id
:
schemeId
.
current
}
menuWebList=
{
menuWebList
}
menuMoblieList=
{
menuMoblieList
}
formValue=
{
schemeMsg
?.
Platform
}
/>
</
Panel
>
<
Panel
header=
{
headerRender
(
'短信消息配置'
)
}
key=
"2"
>
<
ShortMessageConfig
formValue=
{
schemeMsg
?.
SMS
}
id=
{
schemeMsg
?
schemeMsg
?.
Id
:
schemeId
.
current
}
/>
</
Panel
>
<
Panel
header=
{
headerRender
(
'微信公众号配置'
)
}
key=
"3"
>
<
WeChatConfig
menuMoblieList=
{
menuMoblieList
}
formValue=
{
schemeMsg
?.
Wechat
}
id=
{
schemeMsg
?
schemeMsg
?.
Id
:
schemeId
.
current
}
/>
</
Panel
>
<
Panel
header=
{
headerRender
(
'企业微信配置'
)
}
key=
"4"
>
<
EnterpriseWeChatConfig
menuMoblieList=
{
menuMoblieList
}
formValue=
{
schemeMsg
?.
WorkWechat
}
id=
{
schemeMsg
?
schemeMsg
?.
Id
:
schemeId
.
current
}
/>
</
Panel
>
</
Collapse
>
</
div
>
<
RoleModal
selectValue=
{
roleSelect
.
current
.
join
(
'|'
)
}
visible=
{
showRoleModal
}
rolCallBack=
{
roleList
=>
rolCallBack
(
roleList
)
}
onCancel=
{
()
=>
{
setShowRoleModal
(
false
);
}
}
/>
<
VisibleIISAgentConfig
ref=
{
timePlan
}
agentConfig=
{
schemeMsg
?.
AgentConfig
}
value=
{
baseForm
.
getFieldValue
(
'SchemeName'
)
}
onIISAgentSubmit=
{
onIISAgentSubmit
}
/>
</
div
>
);
};
export
default
SchemeDetails
;
src/pages/platformCenter/messageManage/schemeDetails/schemeDetails.less
0 → 100644
View file @
4850cd88
.detailContent {
position: relative;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
background-color: #fff;
border-radius: 5px;
padding: 15px;
:global {
.ant-page-heade {
padding: 0;
}
}
.header {
display: flex;
justify-content: right;
margin-bottom: 10px;
padding-right: 25px;
}
.configContent {
flex: 1;
overflow-y: scroll;
padding: 5px;
}
}
\ No newline at end of file
src/routes/config.js
View file @
4850cd88
...
...
@@ -114,9 +114,12 @@ const PanoramaConfig = asyncComponent(() =>
import
(
'@/pages/platformCenter/gis/panoramaConfig/index'
),
);
const
MessageManager
=
asyncComponent
(()
=>
import
(
'@/pages/platformCenter/messageManage'
));
// const SchemeDetail = asyncComponent(() =>
// import('@/pages/platformCenter/messageManage/schemeDetails/schemeDetails'),
// );
const
MessageManagerNew
=
asyncComponent
(()
=>
import
(
'@/pages/platformCenter/messageManage/indexNew'
),
);
const
SchemeDetailNew
=
asyncComponent
(()
=>
import
(
'@/pages/platformCenter/messageManage/schemeDetails/schemeDetails'
),
);
const
SchemeDetail
=
asyncComponent
(()
=>
import
(
'@/pages/platformCenter/messageManage/schemeDetail/schemeDetail'
),
);
...
...
@@ -333,11 +336,11 @@ export default {
hideMenu
:
true
,
component
:
FlowNode
,
},
{
path
:
'/biz/workflow/editor'
,
name
:
'工作流编辑'
,
component
:
Workflow
,
},
//
{
//
path: '/biz/workflow/editor',
//
name: '工作流编辑',
//
component: Workflow,
//
},
{
path
:
'/biz/workflow/center'
,
name
:
'流程中心'
,
...
...
@@ -429,6 +432,17 @@ export default {
name
:
'消息中心'
,
component
:
MessageManager
,
},
// {
// path: '/platform/notificationNew',
// name: '消息中心(新)',
// component: MessageManagerNew,
// },
{
path
:
'/platform/SchemeDetailNew'
,
name
:
'模板编辑'
,
component
:
SchemeDetailNew
,
hideMenu
:
true
,
},
{
path
:
'/platform/schemeDetail'
,
name
:
'模板编辑'
,
...
...
src/services/messagemanage/messagemanage.js
View file @
4850cd88
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-03-23 10:46:01
* @LastEditors: leizhe
* @Author: dengchao 754083046@qq.com
* @Date: 2022-11-28 19:05:07
* @LastEditors: dengchao 754083046@qq.com
* @LastEditTime: 2022-12-27 11:18:37
* @FilePath: \maintenance\src\services\messagemanage\messagemanage.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
get
,
post
,
PUBLISH_SERVICE
,
CITY_SERVICE
}
from
'@/services/index'
;
...
...
@@ -45,4 +46,28 @@ export const GetGroupUserTree = param =>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GetGroupUserTree`
,
param
);
// 获取图片路径接口
export
const
GetMessageIcon
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/GetMessageIcon`
,
param
);
\ No newline at end of file
export
const
GetMessageIcon
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/GetMessageIcon`
,
param
);
// 查询新消息平台配置
export
const
GetMessageConfigs
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/GetMessageConfigs`
,
param
);
// 新增消息平台方案配置
export
const
AddMessageConfigs
=
param
=>
post
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/AddMessage_Configs`
,
param
);
// 修改消息平台方案配置
export
const
UpdateMessageConfigs
=
param
=>
post
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/UpdateMessage_Configs`
,
param
);
// 添加或修改平台弹框配置
export
const
AddPlatformStatus
=
param
=>
post
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/AddPlatformStatus`
,
param
);
// 添加或修改短信推送配置
export
const
AddSMSStatus
=
param
=>
post
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/AddSMSStatus`
,
param
);
// 添加或修改微信公众号推送配置
export
const
AddWechatStatus
=
param
=>
post
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/AddWechatStatus`
,
param
);
// 添加或修改企业微信推送设置
export
const
AddWorkWechatStatus
=
param
=>
post
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/AddWorkWechatStatus`
,
param
);
// 删除
export
const
DelMessageConfigs
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/MessageConfig/DelMessage_Configs`
,
param
);
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