Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wms
Project
Project
Details
Activity
Releases
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
wuhao
wms
Commits
76a807e5
Commit
76a807e5
authored
Jun 24, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
df6899c5
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1671 additions
and
148 deletions
+1671
-148
routes.js
config/routes.js
+11
-0
mtable.jsx
src/components/AutoTable/mtable.jsx
+148
-148
index.jsx
src/pages/platform/Sendlist/index.jsx
+151
-0
Formpage.jsx
src/pages/platform/Sendset/Formpage.jsx
+689
-0
fields.js
src/pages/platform/Sendset/fields.js
+255
-0
index.jsx
src/pages/platform/Sendset/index.jsx
+360
-0
platform.js
src/services/platform.js
+15
-0
system.js
src/services/system.js
+42
-0
No files found.
config/routes.js
View file @
76a807e5
...
...
@@ -140,6 +140,17 @@ export default [
name
:
"特殊配置"
,
component
:
"./platform/Specialset"
,
},
{
path
:
"/platform/sendset"
,
name
:
"推送配置"
,
component
:
"./platform/Sendset"
,
},
{
path
:
"/platform/sendlist"
,
name
:
"推送记录"
,
component
:
"./platform/Sendlist"
,
},
{
path
:
"/platform/rule"
,
name
:
"编号规则"
,
...
...
src/components/AutoTable/mtable.jsx
View file @
76a807e5
...
...
@@ -382,7 +382,7 @@ class Mtable extends PureComponent {
},
}
}
scroll=
{
{
x
:
1024
,
x
:
x
??
1024
,
}
}
{
...
tabledataProps
}
{
...
expandable
}
...
...
src/pages/platform/Sendlist/index.jsx
0 → 100644
View file @
76a807e5
import
React
,
{
useEffect
,
useRef
,
useState
}
from
'react'
;
import
{
Button
,
Drawer
}
from
'antd'
;
import
{
connect
,
useModel
}
from
"umi"
;
import
AutoTable
from
'@/components/AutoTable'
;
import
getPrem
from
'@/utils/getPrem'
;
//权限判断fn
import
Details
from
"@/components/Details"
;
let
SendList
=
(
props
)
=>
{
const
{
global
,
dispatch
}
=
props
;
const
actionRef
=
useRef
(),
[
details
,
cdetails
]
=
useState
({
totalTitle
:
"推送记录详情"
,
visible
:
false
,
dataSource
:
{},
totalCard
:
[]
});
let
columns
=
[
{
"title"
:
"推送时间"
,
"dataIndex"
:
"sendTime"
,
"key"
:
"sendTimeList"
,
"valueType"
:
"dateRange"
},
{
"title"
:
"接收用户"
,
"dataIndex"
:
"userName"
,
"key"
:
"userName"
},
{
"title"
:
"推送方式"
,
"dataIndex"
:
"sendMethodName"
,
"key"
:
"sendMethodName"
,
search
:
false
},
{
"title"
:
"推送内容"
,
"dataIndex"
:
"msgContent"
,
"key"
:
"msgContent"
},
{
"title"
:
"状态"
,
"dataIndex"
:
"sendResultName"
,
"key"
:
"sendResult"
,
"valueType"
:
"select"
,
options
:
[
{
"label"
:
"成功"
,
"value"
:
1
},
{
"label"
:
"失败"
,
"value"
:
2
}
]
},
{
title
:
'操作'
,
valueType
:
'option'
,
width
:
120
,
render
:
(
text
,
row
,
_
,
action
)
=>
extraAction
(
text
,
row
,
_
,
action
)
},
]
function
extraAction
(
text
,
record
,
_
,
action
)
{
return
(
<
div
>
{
getPrem
(
true
,
null
,
"查看详情"
,
()
=>
{
cdetails
(
details
=>
{
return
{
...
details
,
visible
:
true
,
dataSource
:
record
,
totalCard
:
[
{
//每一个模块信息
cardTitle
:
'记录详情'
,
itemData
:
[
{
"title"
:
"推送时间"
,
"key"
:
"sendTime"
},
{
"title"
:
"接收用户"
,
"key"
:
"userName"
},
{
"title"
:
"推送方式"
,
"key"
:
"sendMethodName"
},
{
"title"
:
"消息标题"
,
"key"
:
"msgTitle"
,
col
:
{
span
:
24
}
},
{
"title"
:
"消息内容"
,
"key"
:
"msgContent"
,
col
:
{
span
:
24
}
}
]
}
]
}
})
})
}
</
div
>
);
}
// let extrarender = ([<Button type="primary" onClick={() => {
// }}>导出</Button>])
return
(
<
div
>
<
AutoTable
pagetitle=
{
props
.
route
.
name
}
//页面标题
// pageextra={extrarender} //页面操作 新增or批量删除
columns=
{
columns
}
actionRef=
{
actionRef
}
path=
"/ngic-base-business/paMsgSendRecord/queryList"
></
AutoTable
>
<
Drawer
title=
{
details
.
totalTitle
}
closable=
{
true
}
visible=
{
details
.
visible
}
onClose=
{
()
=>
{
cdetails
({
...
details
,
visible
:
false
})
}
}
destroyOnClose=
{
true
}
afterVisibleChange=
{
(
v
)
=>
{
cdetails
({
...
details
,
shown
:
v
})
}
}
width=
"100%"
className=
"drawerDetails"
>
{
details
.
shown
&&
<
Details
{
...
details
}
></
Details
>
}
</
Drawer
>
</
div
>
)
}
export
default
SendList
\ No newline at end of file
src/pages/platform/Sendset/Formpage.jsx
0 → 100644
View file @
76a807e5
import
React
,
{
memo
,
useEffect
,
useRef
,
useState
,
useReducer
}
from
'react'
;
import
{
Image
,
Divider
,
Menu
,
Dropdown
,
Button
,
Modal
,
Row
,
Col
,
Tooltip
,
Drawer
,
Form
,
Input
,
message
,
Typography
}
from
'antd'
;
import
{
connect
,
useRequest
}
from
"umi"
;
import
AutoTable
from
'@/components/AutoTable'
;
import
getPrem
from
'@/utils/getPrem'
;
//权限判断fn
import
InitForm
from
'@/components/InitForm'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
tableField
}
from
"./fields"
;
import
moment
from
"moment"
;
import
{
factory
,
allDepartment
,
allShop
,
allSection
,
roleList
,
currentUserList
}
from
"@/services/system"
;
const
{
TextArea
}
=
Input
,
{
Paragraph
}
=
Typography
;
const
initState
=
{
vs
:
false
,
tableFields
:
{},
iftype
:
{},
tableData
:
[],
hidesTitle
:
true
,
hidesContent
:
true
,
formFields
:
{},
tableLoading
:
false
,
variableVisible
:
false
,
variableExtraparams
:
""
},
sendToArr
=
[
{
"label"
:
"指定人员"
,
"value"
:
1
},
{
"label"
:
"可指定人员"
,
"value"
:
2
},
{
"label"
:
"创建人"
,
"value"
:
3
},
{
"label"
:
"(指定人员)上级领导"
,
"value"
:
4
},
{
"label"
:
"(上个通知人员)上级领导"
,
"value"
:
5
},
{
"label"
:
"选择角色"
,
"value"
:
6
},
{
"label"
:
"选择人员"
,
"value"
:
7
}
],
unitArr
=
[
{
"label"
:
"分钟"
,
"value"
:
1
},
{
"label"
:
"小时"
,
"value"
:
2
},
{
"label"
:
"天"
,
"value"
:
3
}
],
sendProcessArr
=
[
{
label
:
"一级通知"
,
value
:
1
},
{
label
:
"二级通知"
,
value
:
2
},
{
label
:
"三级通知"
,
value
:
3
},
{
label
:
"四级通知"
,
value
:
4
},
{
label
:
"五级通知"
,
value
:
5
},
{
label
:
"六级通知"
,
value
:
6
},
{
label
:
"七级通知"
,
value
:
7
},
{
label
:
"八级通知"
,
value
:
8
}
];
function
reducer
(
state
,
action
)
{
if
(
action
.
type
==
"add"
)
{
return
{
...
state
,
vs
:
true
,
tableFields
:
{
...
action
.
tableFields
},
iftype
:
{
val
:
"add"
,
title
:
"新增基础设置"
,
id
:
""
}
}
}
else
if
(
action
.
type
==
"edit"
)
{
return
{
...
state
,
vs
:
true
,
tableFields
:
{
...
action
.
tableFields
},
iftype
:
{
val
:
"edit"
,
title
:
"修改基础设置"
,
id
:
action
.
curitem
.
id
}
}
}
else
if
(
action
.
type
==
"changeHideTitle"
)
{
return
{
...
state
,
hidesTitle
:
action
.
hidesTitle
}
}
else
if
(
action
.
type
==
"changeHideContent"
)
{
return
{
...
state
,
hidesContent
:
action
.
hidesContent
}
}
else
if
(
action
.
type
==
"changeFormFields"
)
{
return
{
...
state
,
formFields
:
{
...
action
.
formFields
}
}
}
else
if
(
action
.
type
==
"start"
)
{
return
{
...
state
,
formFields
:
{
...
action
.
formFields
},
tableData
:
[...
action
.
tableData
]
}
}
else
if
(
action
.
type
==
"changeTableFields"
)
{
return
{
...
state
,
tableFields
:
{
...
action
.
tableFields
}
}
}
else
if
(
action
.
type
==
"changeTableData"
)
{
return
{
...
state
,
tableData
:
[...
action
.
tableData
],
vs
:
false
,
tableLoading
:
false
}
}
else
if
(
action
.
type
==
"changeLoading"
)
{
return
{
...
state
,
tableLoading
:
true
}
}
else
if
(
action
.
type
==
"changeShown"
)
{
return
{
...
state
,
shown
:
action
.
shown
}
}
else
if
(
action
.
type
==
"openVariable"
)
{
return
{
...
state
,
variableVisible
:
true
,
variableExtraparams
:
action
.
variableExtraparams
}
}
else
if
(
action
.
type
==
"close"
)
{
return
{
...
state
,
vs
:
false
,
iftype
:
{},
tableFields
:
{},
variableVisible
:
false
,
variableExtraparams
:
""
}
}
};
const
Variable
=
(
props
)
=>
{
const
{
businessMsgSceneId
,
dispatch
}
=
props
;
return
<
div
>
<
AutoTable
columns=
{
[
{
"title"
:
"变量名"
,
"dataIndex"
:
"variableName"
,
"key"
:
"variableName"
,
"width"
:
120
},
{
"title"
:
"变量代码"
,
"dataIndex"
:
"variableCode"
,
"key"
:
"variableCode"
,
"search"
:
false
},
{
"title"
:
"复制"
,
"valueType"
:
"option"
,
"search"
:
false
,
render
:
(
_
,
row
)
=>
{
return
<
Paragraph
copyable=
{
{
text
:
row
.
variableCode
,
onCopy
:
()
=>
{
dispatch
({
type
:
"close"
})
}
}
}
>
复制
</
Paragraph
>
}
}
]
}
bordered=
{
false
}
path=
"/ngic-base-business/paBusinessMsgSceneVariable/queryPageBySceneId"
extraparams=
{
{
businessMsgSceneId
}
}
x=
{
"100%"
}
></
AutoTable
>
</
div
>
}
const
Formpage
=
(
props
)
=>
{
const
{
rowMessage
,
reset
,
iftypeParent
}
=
props
;
let
actionRef
=
useRef
(),
ChildRef
=
null
;
function
reload
()
{
actionRef
?.
current
?.
reload
();
ChildRef
?.
onRefresh
();
}
useEffect
(()
=>
{
if
(
iftypeParent
.
val
==
"add"
)
{
for
(
let
i
in
fields
)
{
fields
[
i
].
hides
=
false
;
fields
[
i
].
value
=
null
;
}
}
else
if
(
iftypeParent
.
val
==
"edit"
)
{
let
database
=
getdatabase
(
rowMessage
[
"fitField"
]);
for
(
let
i
in
fields
)
{
fields
[
i
].
value
=
rowMessage
[
i
];
if
(
i
==
"sendMethodType"
)
{
showTitleorContent
(
rowMessage
[
i
]);
form
.
setFieldsValue
({
"sendTitle"
:
rowMessage
.
sendTitle
,
"sendContent"
:
rowMessage
.
sendContent
})
}
if
(
i
==
"fieldId"
&&
rowMessage
[
"fitField"
]
==
1
)
{
fields
[
i
].
hides
=
true
}
else
if
(
i
==
"fieldId"
&&
rowMessage
[
"fitField"
]
!=
1
)
{
fields
[
i
].
hides
=
false
fields
[
i
].
options
=
{
database
,
params
:
{}
}
}
}
}
dispatch
({
type
:
"start"
,
formFields
:
{
...
fields
},
tableData
:
iftypeParent
.
val
==
"add"
?
[]
:
rowMessage
?.
detailList
});
},
[
fields
])
const
{
fields
}
=
props
,
[
form
]
=
Form
.
useForm
(),
[
forms
]
=
Form
.
useForm
(),
[
tableFormRef
]
=
Form
.
useForm
(),
[
state
,
dispatch
]
=
useReducer
(
reducer
,
initState
),
{
vs
,
tableFields
,
iftype
,
tableData
,
hidesTitle
,
hidesContent
,
formFields
,
tableLoading
,
variableVisible
,
shown
,
variableExtraparams
}
=
state
,
columns
=
[
{
"title"
:
"推送流程"
,
"dataIndex"
:
"sendProcessName"
,
"key"
:
"sendProcessName"
,
"search"
:
false
},
{
"title"
:
"推送对象"
,
"dataIndex"
:
"sendToName"
,
"key"
:
"sendToName"
,
"search"
:
false
},
{
"title"
:
"选择对象"
,
"dataIndex"
:
"targetNames"
,
"key"
:
"targetNames"
,
"search"
:
false
},
{
"title"
:
"初始触发时长"
,
"dataIndex"
:
"initialTime"
,
"key"
:
"initialTime"
,
"search"
:
false
},
{
"title"
:
"初始触发时长单位"
,
"dataIndex"
:
"initialUnitName"
,
"key"
:
"initialUnitName"
,
"search"
:
false
},
{
"title"
:
"间隔时长"
,
"dataIndex"
:
"intervalTime"
,
"key"
:
"intervalTime"
,
"search"
:
false
},
{
"title"
:
"间隔时长单位"
,
"dataIndex"
:
"intervalUnitName"
,
"key"
:
"intervalUnitName"
,
"search"
:
false
},
{
"title"
:
"触发次数"
,
"dataIndex"
:
"sendNum"
,
"key"
:
"sendNum"
,
"search"
:
false
},
{
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
extraAction
(
text
,
row
,
_
,
action
)
}
],
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
formatResult
:
(
res
)
=>
res
,
onSuccess
:
(
result
,
params
)
=>
{
if
(
result
.
code
==
"0000"
)
{
reset
&&
reset
();
}
}
});
let
extrarender
=
([
<
Button
size=
{
"middle"
}
type=
"primary"
onClick=
{
()
=>
{
for
(
let
i
in
tableField
)
{
tableField
[
i
].
value
=
null
;
if
(
i
==
"targetIdList"
)
{
tableField
[
i
].
hides
=
true
tableField
[
i
].
value
=
[]
}
if
(
i
==
"initialTime"
)
{
tableField
[
i
].
value
=
0
}
if
(
i
==
"intervalTime"
)
{
tableField
[
i
].
value
=
1
}
if
(
i
==
"sendNum"
)
{
tableField
[
i
].
value
=
1
}
}
dispatch
({
type
:
"add"
,
tableFields
:
tableField
});
}
}
>
新增
</
Button
>
]);
function
extraAction
(
text
,
record
,
_
,
action
)
{
return
(
<
div
>
{
getPrem
(
true
,
null
,
"修改"
,
()
=>
{
for
(
let
j
in
tableField
)
{
tableField
[
j
].
value
=
record
[
j
];
if
(
j
==
"targetIdList"
)
{
if
(
record
.
sendTo
!=
6
&&
record
.
sendTo
!=
7
)
{
tableField
[
j
].
hides
=
true
}
else
{
let
database
=
getformdatabase
(
record
.
sendTo
)
tableField
[
j
].
hides
=
false
tableField
[
j
].
options
=
{
database
,
params
:
{}
}
}
}
dispatch
({
type
:
"edit"
,
tableFields
:
tableField
,
curitem
:
record
});
}
})
}
<
Divider
type=
"vertical"
/>
{
getPrem
(
true
,
"red"
,
"删除"
,
null
,
{
title
:
"确认删除该基础配置?"
,
onConfirm
:
()
=>
{
let
newData
=
tableData
.
filter
(
it
=>
it
.
id
!=
record
.
id
);
dispatch
({
type
:
"changeTableData"
,
tableData
:
newData
});
}
})
}
</
div
>
);
}
let
saveData
=
(
values
,
fn
)
=>
{
dispatch
({
type
:
"changeLoading"
});
const
{
sendTo
,
targetIdList
,
sendProcess
,
initialUnit
,
initialTime
,
intervalTime
,
intervalUnit
,
sendNum
}
=
values
;
let
targetNames
=
[];
let
all
=
async
()
=>
{
if
(
sendTo
==
6
)
{
let
data
=
await
roleList
({});
return
{
newArr
:
data
?.
data
?.
dataList
||
[]
}
}
else
if
(
sendTo
==
7
)
{
let
data
=
await
currentUserList
({});
return
{
newArr
:
data
?.
data
?.
dataList
||
[]
}
}
else
{
return
{
newArr
:
[]
}
}
}
all
().
then
(
res
=>
{
let
dataArr
=
res
.
newArr
;
targetNames
=
dataArr
?.
filter
(
it
=>
targetIdList
?.
indexOf
(
it
.
value
)
>
-
1
)?.
map
(
it
=>
it
.
label
)?.
join
(
","
)
||
""
;
let
params
=
{
sendTo
,
targetNames
,
sendProcess
,
sendProcessName
:
sendProcessArr
.
filter
(
it
=>
it
.
value
==
sendProcess
).
length
>
0
?
sendProcessArr
.
filter
(
it
=>
it
.
value
==
sendProcess
)[
0
].
label
:
""
,
initialUnit
,
initialTime
,
intervalTime
,
intervalUnit
,
sendNum
,
targetIdList
,
id
:
iftype
.
id
?
iftype
.
id
:
moment
().
valueOf
()
+
Math
.
floor
(
Math
.
random
()
*
(
9999
-
1000
))
+
1000
,
sendToName
:
sendToArr
.
filter
(
it
=>
it
.
value
==
sendTo
).
length
>
0
?
sendToArr
.
filter
(
it
=>
it
.
value
==
sendTo
)[
0
].
label
:
""
,
initialUnitName
:
unitArr
.
filter
(
it
=>
it
.
value
==
initialUnit
).
length
>
0
?
unitArr
.
filter
(
it
=>
it
.
value
==
initialUnit
)[
0
].
label
:
""
,
intervalUnitName
:
unitArr
.
filter
(
it
=>
it
.
value
==
intervalUnit
).
length
>
0
?
unitArr
.
filter
(
it
=>
it
.
value
==
intervalUnit
)[
0
].
label
:
""
},
newTable
;
if
(
iftype
.
val
==
"edit"
)
{
newTable
=
tableData
.
map
(
it
=>
{
if
(
it
.
id
==
iftype
.
id
)
{
it
=
{
...
params
}
}
return
it
;
});
}
else
{
newTable
=
[...
tableData
];
newTable
.
unshift
(
params
);
}
dispatch
({
type
:
"changeTableData"
,
tableData
:
newTable
});
})
},
saveForm
=
()
=>
{
let
editId
=
rowMessage
?
{
id
:
rowMessage
.
id
}
:
{},
all
=
async
()
=>
{
let
values
=
await
forms
.
validateFields
(),
valuesc
=
await
form
.
validateFields
();
return
{
values
,
valuesc
}
};
all
().
then
(
res
=>
{
if
(
!
tableData
.
length
)
{
return
message
.
warning
(
"基础配置不可为空!"
)
}
let
detailList
=
tableData
.
map
(
it
=>
{
if
(
iftypeParent
.
val
==
"edit"
)
{
return
{
sendProcess
:
it
.
sendProcess
,
sendTo
:
it
.
sendTo
,
targetIdList
:
it
.
targetIdList
,
initialTime
:
it
.
initialTime
,
initialUnit
:
it
.
initialUnit
,
intervalTime
:
it
.
intervalTime
,
intervalUnit
:
it
.
intervalUnit
,
sendNum
:
it
.
sendNum
,
id
:
it
.
id
&&
typeof
(
it
.
id
)
==
"number"
?
""
:
it
.
id
}
}
else
{
return
{
sendProcess
:
it
.
sendProcess
,
sendTo
:
it
.
sendTo
,
targetIdList
:
it
.
targetIdList
,
initialTime
:
it
.
initialTime
,
initialUnit
:
it
.
initialUnit
,
intervalTime
:
it
.
intervalTime
,
intervalUnit
:
it
.
intervalUnit
,
sendNum
:
it
.
sendNum
}
}
}),
params
=
{
...
res
.
values
,
...
res
.
valuesc
,
detailList
,
...
editId
};
run
({
url
:
"/qj/ngic-base-business/paBusinessMsgOption/save"
,
params
:
{
...
params
}
})
})
};
function
showTitleorContent
(
val
)
{
if
(
val
==
4
)
{
dispatch
({
type
:
"changeHideTitle"
,
hidesTitle
:
false
})
}
else
{
dispatch
({
type
:
"changeHideTitle"
,
hidesTitle
:
false
})
}
if
(
val
==
2
)
{
dispatch
({
type
:
"changeHideContent"
,
hidesContent
:
false
})
}
else
{
dispatch
({
type
:
"changeHideContent"
,
hidesContent
:
false
})
}
};
function
getdatabase
(
val
)
{
let
database
;
switch
(
val
)
{
case
2
:
database
=
factory
break
;
case
3
:
database
=
allDepartment
break
;
case
4
:
database
=
allShop
break
;
case
5
:
database
=
allSection
break
;
}
return
database
;
}
function
getformdatabase
(
val
)
{
let
database
;
switch
(
val
)
{
case
6
:
database
=
roleList
break
;
case
7
:
database
=
currentUserList
break
;
}
return
database
;
}
return
<
div
>
<
InitForm
fields=
{
formFields
}
onChange=
{
(
changedValues
,
allValues
)
=>
{
for
(
let
i
in
changedValues
)
{
if
(
i
==
"sendMethodType"
)
{
showTitleorContent
(
changedValues
[
i
])
}
if
(
i
==
"fitField"
)
{
let
database
=
getdatabase
(
changedValues
[
i
]);
for
(
let
j
in
formFields
)
{
if
(
j
==
"fieldId"
&&
changedValues
[
i
]
==
1
)
{
formFields
[
j
].
hides
=
true
;
}
else
if
(
j
==
"fieldId"
&&
changedValues
[
i
]
!=
1
)
{
formFields
[
j
].
hides
=
false
formFields
[
j
].
options
=
{
database
,
params
:
{}
};
forms
.
setFieldsValue
({
"fieldId"
:
""
})
}
}
dispatch
({
type
:
"changeFormFields"
,
formFields
:
formFields
})
}
}
}
}
actions=
{
(
form
,
submitBtn
)
=>
{
return
null
;
}
}
formRef=
{
forms
}
>
</
InitForm
>
<
Form
form=
{
form
}
>
{
!
hidesTitle
&&
<
Form
.
Item
name=
"sendTitle"
rules=
{
[
{
required
:
true
,
message
:
'请输入推送标题'
,
},
]
}
>
<
div
>
<
div
><
span
style=
{
{
color
:
"#ff4d4f"
}
}
>
*
</
span
>
推送标题
</
div
>
<
TextArea
rows=
{
4
}
defaultValue=
{
iftypeParent
.
val
==
"edit"
?
rowMessage
.
sendTitle
:
""
}
/>
</
div
>
</
Form
.
Item
>
}
{
(
!
hidesTitle
||
!
hidesContent
)
&&
<
Button
type=
"primary"
style=
{
{
marginBottom
:
15
}
}
onClick=
{
()
=>
{
let
params
=
forms
.
getFieldValue
(
"businessMsgSceneId"
);
dispatch
({
type
:
"openVariable"
,
variableExtraparams
:
params
});
}
}
>
查看变量
</
Button
>
}
{
!
hidesContent
&&
<
Form
.
Item
name=
"sendContent"
rules=
{
[
{
required
:
true
,
message
:
'请输入推送内容'
,
},
]
}
>
<
div
>
<
div
><
span
style=
{
{
color
:
"#ff4d4f"
}
}
>
*
</
span
>
推送内容
</
div
>
<
TextArea
rows=
{
4
}
defaultValue=
{
iftypeParent
.
val
==
"edit"
?
rowMessage
.
sendContent
:
""
}
/>
</
div
>
</
Form
.
Item
>
}
</
Form
>
{
!
tableLoading
&&
<
AutoTable
pagetitle=
"基础设置"
pageextra=
{
extrarender
}
columns=
{
columns
}
actionRef=
{
actionRef
}
onRef=
{
node
=>
ChildRef
=
node
}
dataSource=
{
tableData
}
></
AutoTable
>
}
<
div
style=
{
{
display
:
"flex"
,
marginTop
:
15
}
}
>
<
Button
loading=
{
loading
}
type=
"primary"
size=
"large"
style=
{
{
flex
:
1
}
}
onClick=
{
saveForm
}
>
提交
</
Button
>
</
div
>
<
Modal
maskClosable=
{
false
}
title=
{
iftype
.
title
}
visible=
{
vs
}
onCancel=
{
()
=>
dispatch
({
type
:
"close"
})
}
style=
{
{
top
:
20
}
}
footer=
{
false
}
width=
"1000px"
destroyOnClose=
{
true
}
>
<
InitForm
fields=
{
tableFields
}
submitData=
{
(
values
,
fn
)
=>
{
saveData
(
values
,
fn
)
}
}
formRef=
{
tableFormRef
}
onChange=
{
(
changedValues
,
allValues
)
=>
{
for
(
let
i
in
changedValues
)
{
if
(
i
==
"sendTo"
)
{
for
(
let
j
in
tableField
)
{
if
(
j
==
"targetIdList"
)
{
tableFormRef
.
setFieldsValue
({
"targetIdList"
:
[]
});
tableField
[
j
].
value
=
[];
if
(
changedValues
[
i
]
!=
6
&&
changedValues
[
i
]
!=
7
)
{
tableField
[
j
].
hides
=
true
}
else
{
let
database
=
getformdatabase
(
changedValues
[
i
]);
tableField
[
j
].
hides
=
false
tableField
[
j
].
options
=
{
database
,
params
:
{}
}
}
}
}
dispatch
({
type
:
"changeTableFields"
,
tableFields
:
tableField
})
}
}
}
}
>
</
InitForm
>
</
Modal
>
<
Drawer
title=
{
"查看变量"
}
closable=
{
true
}
visible=
{
variableVisible
}
onClose=
{
()
=>
dispatch
({
type
:
"close"
})
}
destroyOnClose=
{
true
}
afterVisibleChange=
{
(
v
)
=>
{
dispatch
({
type
:
"changeShown"
,
shown
:
v
});
}
}
width=
"40%"
>
{
shown
&&
<
Variable
businessMsgSceneId=
{
variableExtraparams
}
dispatch=
{
dispatch
}
/>
}
</
Drawer
>
</
div
>
}
export
default
Formpage
;
\ No newline at end of file
src/pages/platform/Sendset/fields.js
0 → 100644
View file @
76a807e5
import
{
paBusinessMsgScene
}
from
"@/services/platform"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
regValue
from
"@/utils/regValue"
;
let
numReg
=
regValue
(
"integer"
);
const
addFields
=
{
"businessMsgSceneId"
:
{
"value"
:
null
,
"type"
:
"select"
,
"title"
:
"推送类型"
,
"name"
:
[
"businessMsgSceneId"
],
"required"
:
true
,
"options"
:
{
"database"
:
paBusinessMsgScene
,
"params"
:
{}
}
},
"sendMethodType"
:
{
"value"
:
null
,
"type"
:
"select"
,
"title"
:
"推送方式"
,
"name"
:
[
"sendMethodType"
],
"required"
:
true
,
"options"
:
[
{
"label"
:
"企业微信"
,
"value"
:
1
},{
"label"
:
"邮件"
,
"value"
:
2
}
]
},
"fitField"
:
{
"value"
:
null
,
"type"
:
"select"
,
"title"
:
"适用类型"
,
"name"
:
[
"fitField"
],
"required"
:
true
,
"options"
:
[
{
"label"
:
"全部"
,
"value"
:
1
},
{
"label"
:
"组织"
,
"value"
:
2
},
{
"label"
:
"部门"
,
"value"
:
3
},
{
"label"
:
"工厂"
,
"value"
:
4
},
{
"label"
:
"车间"
,
"value"
:
5
}
]
},
"fieldId"
:
{
"value"
:
null
,
"type"
:
"select"
,
"title"
:
"类型名称"
,
"name"
:
[
"fieldId"
],
"required"
:
true
,
"hides"
:
false
,
"options"
:[]
}
},
tableField
=
{
"sendProcess"
:
{
"value"
:
null
,
"type"
:
"select"
,
"title"
:
"推送流程"
,
"name"
:
[
"sendProcess"
],
"required"
:
true
,
options
:[
{
label
:
"一级通知"
,
value
:
1
},
{
label
:
"二级通知"
,
value
:
2
},
{
label
:
"三级通知"
,
value
:
3
},
{
label
:
"四级通知"
,
value
:
4
},
{
label
:
"五级通知"
,
value
:
5
},
{
label
:
"六级通知"
,
value
:
6
},
{
label
:
"七级通知"
,
value
:
7
},
{
label
:
"八级通知"
,
value
:
8
}
]
},
"sendTo"
:
{
"value"
:
null
,
"type"
:
"select"
,
"title"
:
"推送对象"
,
"name"
:
[
"sendTo"
],
"required"
:
true
,
"options"
:
[
{
"label"
:
"指定人员"
,
"value"
:
1
},
{
"label"
:
"可指定人员"
,
"value"
:
2
},
{
"label"
:
"创建人"
,
"value"
:
3
},
{
"label"
:
"(指定人员)上级领导"
,
"value"
:
4
},
{
"label"
:
"(上个通知人员)上级领导"
,
"value"
:
5
},
{
"label"
:
"选择角色"
,
"value"
:
6
},
{
"label"
:
"选择人员"
,
"value"
:
7
}
]
},
"targetIdList"
:
{
"value"
:
null
,
"type"
:
"select"
,
"title"
:
"选择对象"
,
"name"
:
[
"targetIdList"
],
"required"
:
true
,
"options"
:
[],
hides
:
true
,
multiple
:
true
},
"initialTime"
:
{
"value"
:
null
,
"type"
:
"inputnumber"
,
"title"
:
"初始触发时长"
,
"name"
:
[
"initialTime"
],
"required"
:
true
,
min
:
0
,
...
numReg
},
"initialUnit"
:
{
"value"
:
null
,
"type"
:
"select"
,
"title"
:
"初始触发时长单位"
,
"name"
:
[
"initialUnit"
],
"required"
:
true
,
"options"
:
[
{
"label"
:
"分钟"
,
"value"
:
1
},
{
"label"
:
"小时"
,
"value"
:
2
},
{
"label"
:
"天"
,
"value"
:
3
}
]
},
"intervalTime"
:
{
"value"
:
null
,
"type"
:
"inputnumber"
,
"title"
:
"间隔时长"
,
"name"
:
[
"intervalTime"
],
"required"
:
true
,
min
:
1
,
...
numReg
},
"intervalUnit"
:
{
"value"
:
null
,
"type"
:
"select"
,
"title"
:
"间隔时长单位"
,
"name"
:
[
"intervalUnit"
],
"required"
:
true
,
"options"
:
[
{
"label"
:
"分钟"
,
"value"
:
1
},
{
"label"
:
"小时"
,
"value"
:
2
},
{
"label"
:
"天"
,
"value"
:
3
}
]
},
"sendNum"
:
{
"value"
:
null
,
"type"
:
"inputnumber"
,
"title"
:
"触发次数"
,
"name"
:
[
"sendNum"
],
"required"
:
true
,
min
:
1
,
...
numReg
}
};
export
{
addFields
,
tableField
}
\ No newline at end of file
src/pages/platform/Sendset/index.jsx
0 → 100644
View file @
76a807e5
import
React
,
{
memo
,
useEffect
,
useRef
,
useState
,
useReducer
}
from
'react'
;
import
{
Image
,
Divider
,
Menu
,
Dropdown
,
Button
,
Modal
,
Row
,
Col
,
Tooltip
,
Drawer
}
from
'antd'
;
import
{
connect
,
useRequest
}
from
"umi"
;
import
AutoTable
from
'@/components/AutoTable'
;
import
getPrem
from
'@/utils/getPrem'
;
//权限判断fn
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
paBusinessMsgScene
,
paBusinessMsgOption
}
from
"@/services/platform"
;
import
{
addFields
}
from
"./fields"
;
import
Formpage
from
"./Formpage"
;
import
Details
from
"@/components/Details"
;
const
initState
=
{
vs
:
false
,
fields
:
{},
iftype
:
{},
details
:
{
totalTitle
:
""
,
visible
:
false
,
dataSource
:
{},
totalCard
:
[]
},
shown
:
false
,
rowMessage
:
{}
}
function
reducer
(
state
,
action
)
{
if
(
action
.
type
==
"add"
)
{
return
{
...
state
,
vs
:
true
,
fields
:
action
.
fields
,
iftype
:
{
val
:
"add"
,
title
:
"新增推送配置"
},
rowMessage
:
{}
}
}
else
if
(
action
.
type
==
"close"
)
{
return
{
...
state
,
vs
:
false
,
iftype
:
{},
fields
:
{},
details
:
{
totalTitle
:
""
,
visible
:
false
,
dataSource
:
{},
totalCard
:
[]
},
shown
:
false
}
}
else
if
(
action
.
type
==
"edit"
)
{
return
{
...
state
,
vs
:
true
,
fields
:
action
.
fields
,
iftype
:
{
val
:
"edit"
,
title
:
"修改推送配置"
,
id
:
action
.
rowMessage
.
id
},
rowMessage
:
action
.
rowMessage
}
}
else
if
(
action
.
type
==
"seeDetails"
)
{
return
{
...
state
,
details
:
{
totalTitle
:
"推送详情"
,
visible
:
true
,
dataSource
:
{
...
action
.
dataSource
},
totalCard
:
[...
action
.
totalCard
]
}
}
}
else
if
(
action
.
type
==
"changeShown"
)
{
return
{
...
state
,
shown
:
action
.
shown
}
}
}
const
Pushdeploy
=
(
props
)
=>
{
let
actionRef
=
useRef
(),
ChildRef
=
null
;
function
reload
()
{
actionRef
?.
current
?.
reload
();
ChildRef
?.
onRefresh
();
}
const
[
state
,
dispatch
]
=
useReducer
(
reducer
,
initState
),
{
vs
,
fields
,
iftype
,
details
,
shown
,
rowMessage
}
=
state
,
columns
=
[
{
"title"
:
"推送类型"
,
"dataIndex"
:
"msgSceneName"
,
"key"
:
"businessMsgSceneId"
,
"valueType"
:
"select"
,
render
:
(
_
,
row
)
=>
{
return
<
div
style=
{
{
padding
:
'3px 0'
,
overflow
:
'hidden'
,
whiteSpace
:
'nowrap'
,
textOverflow
:
'ellipsis'
}
}
>
<
Tooltip
title=
{
row
.
msgSceneName
}
>
<
a
onClick=
{
()
=>
{
let
commons
=
[
{
"title"
:
"推送类型"
,
"key"
:
"msgSceneName"
},
{
"title"
:
"推送方式"
,
"key"
:
"sendMethodName"
},
{
"title"
:
"适用类型"
,
"key"
:
"fitFieldName"
},
],
table
=
{
"key"
:
"detailList"
,
col
:
{
span
:
24
},
type
:
"table"
,
columns
:
[
{
"title"
:
"推送流程"
,
"dataIndex"
:
"sendProcessName"
,
"key"
:
"sendProcessName"
,
"search"
:
false
},
{
"title"
:
"推送对象"
,
"dataIndex"
:
"sendToName"
,
"key"
:
"sendToName"
,
"search"
:
false
},
{
"title"
:
"选择对象"
,
"dataIndex"
:
"targetNames"
,
"key"
:
"targetNames"
,
"search"
:
false
},
{
"title"
:
"初始触发时长"
,
"dataIndex"
:
"initialTime"
,
"key"
:
"initialTime"
,
"search"
:
false
},
{
"title"
:
"初始触发时长单位"
,
"dataIndex"
:
"initialUnitName"
,
"key"
:
"initialUnitName"
,
"search"
:
false
},
{
"title"
:
"间隔时长"
,
"dataIndex"
:
"intervalTime"
,
"key"
:
"intervalTime"
,
"search"
:
false
},
{
"title"
:
"间隔时长单位"
,
"dataIndex"
:
"intervalUnitName"
,
"key"
:
"intervalUnitName"
,
"search"
:
false
},
{
"title"
:
"触发次数"
,
"dataIndex"
:
"sendNum"
,
"key"
:
"sendNum"
,
"search"
:
false
}
]
},
totalCardsc
,
contentMsg
,
fieldMsg
;
contentMsg
=
{
"title"
:
"推送内容"
,
"key"
:
"sendContent"
,
col
:
{
span
:
24
}
};
if
(
row
.
fitField
==
1
)
{
fieldMsg
=
null
;
}
else
{
fieldMsg
=
{
"title"
:
"类型名称"
,
"key"
:
"fieldName"
}
}
totalCardsc
=
[
{
cardTitle
:
'推送信息'
,
itemData
:
[
...
commons
,
fieldMsg
&&
{
...
fieldMsg
},
contentMsg
&&
{
...
contentMsg
},
]
},
{
cardTitle
:
'基础配置'
,
itemData
:
[
{
...
table
}
]
}
];
totalCardsc
.
map
(
it
=>
{
let
newData
=
it
.
itemData
.
filter
(
item
=>
item
);
it
.
itemData
=
[...
newData
];
})
paBusinessMsgOption
({
id
:
row
.
id
}).
then
(
res
=>
{
if
(
res
.
code
==
"0000"
)
{
let
data
=
res
?.
data
?.
data
||
{};
dispatch
({
type
:
"seeDetails"
,
totalCard
:
[...
totalCardsc
],
dataSource
:
{
...
data
}
})
}
})
}
}
>
{
row
.
msgSceneName
}
</
a
>
</
Tooltip
>
</
div
>
},
options
:
{
database
:
paBusinessMsgScene
,
params
:
{}
}
},
{
"title"
:
"推送方式"
,
"dataIndex"
:
"sendMethodName"
,
"key"
:
"sendMethodName"
,
search
:
false
},
{
"title"
:
"适用类型"
,
"dataIndex"
:
"fitFieldName"
,
"key"
:
"fitField"
,
"valueType"
:
"select"
,
"options"
:
[
{
"label"
:
"全部"
,
"value"
:
1
},
{
"label"
:
"组织"
,
"value"
:
2
},
{
"label"
:
"部门"
,
"value"
:
3
},
{
"label"
:
"工厂"
,
"value"
:
4
},
{
"label"
:
"车间"
,
"value"
:
5
}
]
},
{
"title"
:
"类型名称"
,
"dataIndex"
:
"fieldName"
,
"key"
:
"fieldName"
},
{
"title"
:
"推送内容"
,
"dataIndex"
:
"sendContent"
,
"key"
:
"sendContent"
,
"search"
:
false
},
{
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
extraAction
(
text
,
row
,
_
,
action
)
}
],
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
formatResult
:
(
res
)
=>
res
,
onSuccess
:
(
result
,
params
)
=>
{
if
(
result
.
code
==
"0000"
)
{
reload
();
dispatch
({
type
:
"close"
});
}
}
});
function
extraAction
(
text
,
record
,
_
,
action
)
{
return
(
<
div
>
{
getPrem
(
"paBusinessMsgOption_save"
,
action
,
"修改"
,
()
=>
{
paBusinessMsgOption
({
id
:
record
.
id
}).
then
(
res
=>
{
if
(
res
.
code
==
"0000"
)
{
let
data
=
res
?.
data
?.
data
||
{};
for
(
let
i
in
addFields
)
{
addFields
[
i
].
value
=
data
[
i
]
}
dispatch
({
type
:
"edit"
,
rowMessage
:
data
,
fields
:
addFields
})
}
})
})
}
{
getPrem
(
"paBusinessMsgOption_save"
,
"ifs"
)
&&
<
Divider
type=
"vertical"
/>
}
{
getPrem
(
"paBusinessMsgOption_deleteById"
,
action
,
"删除"
,
null
,
{
title
:
"确认删除该推送配置?"
,
onConfirm
:
()
=>
{
run
({
url
:
"/qj/ngic-base-business/paBusinessMsgOption/deleteById"
,
params
:
{
id
:
record
.
id
}
})
}
})
}
</
div
>
);
};
function
reset
()
{
reload
();
dispatch
({
type
:
"close"
})
}
let
extrarender
=
([
<
Button
disabled=
{
!
getPrem
(
"paBusinessMsgOption_save"
,
"ifs"
)
}
size=
{
"middle"
}
type=
"primary"
onClick=
{
()
=>
{
for
(
let
i
in
addFields
)
{
addFields
[
i
].
value
=
null
;
}
dispatch
({
type
:
"add"
,
fields
:
addFields
});
}
}
>
新增
</
Button
>
]);
return
<
div
>
<
AutoTable
pagetitle=
{
props
.
route
.
name
}
pageextra=
{
extrarender
}
columns=
{
columns
}
bordered=
{
false
}
actionRef=
{
actionRef
}
onRef=
{
node
=>
ChildRef
=
node
}
path=
"/ngic-base-business/paBusinessMsgOption/queryList"
></
AutoTable
>
<
Drawer
title=
{
iftype
.
title
}
closable=
{
true
}
visible=
{
vs
}
onClose=
{
()
=>
dispatch
({
type
:
"close"
})
}
destroyOnClose=
{
true
}
afterVisibleChange=
{
(
v
)
=>
{
dispatch
({
type
:
"changeShown"
,
shown
:
v
});
}
}
width=
"100%"
>
{
shown
&&
<
Formpage
fields=
{
fields
}
rowMessage=
{
rowMessage
}
reset=
{
reset
}
iftypeParent=
{
iftype
}
/>
}
</
Drawer
>
<
Drawer
title=
{
details
.
totalTitle
}
closable=
{
true
}
visible=
{
details
.
visible
}
onClose=
{
()
=>
dispatch
({
type
:
"close"
})
}
destroyOnClose=
{
true
}
afterVisibleChange=
{
(
v
)
=>
{
dispatch
({
type
:
"changeShown"
,
shown
:
v
});
}
}
width=
"100%"
className=
"drawerDetails"
>
{
shown
&&
<
Details
{
...
details
}
></
Details
>
}
</
Drawer
>
</
div
>
}
export
default
Pushdeploy
;
\ No newline at end of file
src/services/platform.js
View file @
76a807e5
...
...
@@ -47,3 +47,18 @@ export async function bmTableFileSelect(params) {
data
:
params
,
});
}
//推送类型下拉
export
async
function
paBusinessMsgScene
(
params
)
{
return
request
(
`/wms/ngic-base-business/paBusinessMsgScene/queryAllForSelect`
,
{
method
:
'POST'
,
data
:
params
,
});
}
//推送配置
export
async
function
paBusinessMsgOption
(
params
)
{
return
request
(
`/wms/ngic-base-business/paBusinessMsgOption/queryById`
,
{
method
:
'POST'
,
data
:
params
,
});
}
\ No newline at end of file
src/services/system.js
View file @
76a807e5
...
...
@@ -43,6 +43,13 @@ export async function storeselectionBox(params) {
data
:
params
,
});
}
//全部部门下拉
export
async
function
allDepartment
(
params
)
{
return
request
(
`/wms/ngic-auth/sysDepartment/query/selectbox/depart`
,
{
method
:
'POST'
,
data
:
params
,
});
}
//根据工厂id查询车间下拉
export
async
function
shopSelectByFactory
(
params
)
{
...
...
@@ -168,3 +175,38 @@ export async function shiftSelectByShopId(params) {
data
:
params
,
});
}
//角色下拉框
export
async
function
roleList
(
params
)
{
return
request
(
`/wms/ngic-auth/sysRole/queryAllSelectList`
,
{
method
:
'POST'
,
data
:
params
,
});
}
//集团下拉框
export
async
function
factory
(
params
)
{
return
request
(
`/wms/ngic-auth/sysDepartment/query/selectbox/factory`
,
{
method
:
'POST'
,
data
:
params
,
});
}
//下拉框---当前公司下
export
async
function
currentUserList
(
params
)
{
return
request
(
`/wms/ngic-auth/sysUser/query/selectbox/current/company`
,
{
method
:
'POST'
,
data
:
params
,
});
}
//当前公司所有工厂下拉
export
async
function
allShop
(
params
)
{
return
request
(
`/wms/ngic-auth/sysShop/query/selectbox/current/company`
,
{
method
:
'POST'
,
data
:
params
,
});
}
//当前公司所有车间下拉
export
async
function
allSection
(
params
)
{
return
request
(
`/wms/ngic-auth/sysSection/query/selectbox`
,
{
method
:
'POST'
,
data
:
params
,
});
}
\ No newline at end of file
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