Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
5c68383a
提交
5c68383a
authored
5月 26, 2019
作者:
sin-ning@aliyun.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 添加 签名、短信模板
上级
c3206ec5
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
514 行增加
和
630 行删除
+514
-630
smsTemplateList.js
admin-web/src/models/sms/smsTemplateList.js
+56
-0
SignList.js
admin-web/src/pages/Sms/SignList.js
+3
-4
SignList.less
admin-web/src/pages/Sms/SignList.less
+0
-311
SignListModal.js
admin-web/src/pages/Sms/SignListModal.js
+3
-3
TemplateList.js
admin-web/src/pages/Sms/TemplateList.js
+263
-1
TemplateList.less
admin-web/src/pages/Sms/TemplateList.less
+0
-311
TemplateListModal.js
admin-web/src/pages/Sms/TemplateListModal.js
+101
-0
TemplateListSearch.js
admin-web/src/pages/Sms/TemplateListSearch.js
+61
-0
sms.js
admin-web/src/services/sms.js
+26
-0
dictionary.js
admin-web/src/utils/dictionary.js
+1
-0
没有找到文件。
admin-web/src/models/sms/smsTemplateList.js
0 → 100644
浏览文件 @
5c68383a
import
{
pageTemplate
,
addTemplate
,
updateTemplate
,
deletedTemplate
}
from
'../../services/sms'
;
export
default
{
namespace
:
'smsTemplateList'
,
state
:
{
list
:
[],
},
effects
:
{
*
page
({
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
pageTemplate
,
payload
);
if
(
response
.
code
===
0
)
{
yield
put
({
type
:
'pageSuccess'
,
payload
:
response
.
data
,
});
}
},
*
add
({
payload
},
{
call
})
{
const
{
params
,
callback
}
=
payload
;
const
response
=
yield
call
(
addTemplate
,
params
);
if
(
response
.
code
===
0
)
{
if
(
callback
)
{
callback
(
response
);
}
}
},
*
update
({
payload
},
{
call
})
{
const
{
params
,
callback
}
=
payload
;
const
response
=
yield
call
(
updateTemplate
,
params
);
if
(
response
.
code
===
0
)
{
if
(
callback
)
{
callback
(
response
);
}
}
},
*
deleted
({
payload
},
{
call
})
{
const
{
params
,
callback
}
=
payload
;
const
response
=
yield
call
(
deletedTemplate
,
params
);
if
(
callback
)
{
callback
(
response
);
}
},
},
reducers
:
{
pageSuccess
(
state
,
{
payload
})
{
const
{
data
}
=
payload
;
return
{
...
state
,
list
:
data
,
};
},
},
};
admin-web/src/pages/Sms/SignList.js
浏览文件 @
5c68383a
...
@@ -7,7 +7,7 @@ import DictionaryText from '../../components/Dictionary/DictionaryText';
...
@@ -7,7 +7,7 @@ import DictionaryText from '../../components/Dictionary/DictionaryText';
import
dictionary
from
'../../utils/dictionary'
;
import
dictionary
from
'../../utils/dictionary'
;
import
styles
from
'../List/TableList.less'
;
import
styles
from
'../List/TableList.less'
;
import
SignListSearch
from
'./SignListSearch'
;
import
SignListSearch
from
'./SignListSearch'
;
import
SignList
Update
from
'./SignListUpdate
'
;
import
SignList
Modal
from
'./SignListModal
'
;
@
connect
(({
smsSignList
,
loading
})
=>
({
@
connect
(({
smsSignList
,
loading
})
=>
({
smsSignList
,
smsSignList
,
...
@@ -26,7 +26,7 @@ class SignList extends PureComponent {
...
@@ -26,7 +26,7 @@ class SignList extends PureComponent {
// init page 参数
// init page 参数
this
.
current
=
1
;
this
.
current
=
1
;
this
.
total
=
0
;
this
.
total
=
0
;
this
.
size
=
2
0
;
this
.
size
=
1
0
;
this
.
searchParams
=
{};
this
.
searchParams
=
{};
// 查询 page
// 查询 page
...
@@ -80,7 +80,6 @@ class SignList extends PureComponent {
...
@@ -80,7 +80,6 @@ class SignList extends PureComponent {
okText
:
'确认'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
cancelText
:
'取消'
,
onOk
:
()
=>
{
onOk
:
()
=>
{
console
.
log
(
'OK'
);
dispatch
({
dispatch
({
type
:
'smsSignList/deleted'
,
type
:
'smsSignList/deleted'
,
payload
:
{
payload
:
{
...
@@ -249,7 +248,7 @@ class SignList extends PureComponent {
...
@@ -249,7 +248,7 @@ class SignList extends PureComponent {
/
>
/
>
<
/Card
>
<
/Card
>
<
SignList
Update
<
SignList
Modal
initData
=
{
sign
}
initData
=
{
sign
}
title
=
{
title
}
title
=
{
title
}
visible
=
{
visible
}
visible
=
{
visible
}
...
...
admin-web/src/pages/Sms/SignList.less
浏览文件 @
5c68383a
@import '~antd/lib/style/themes/default.less';
@import '~antd/lib/style/themes/default.less';
@import '~@/utils/utils.less';
@import '~@/utils/utils.less';
.standardList {
:global {
.ant-card-head {
border-bottom: none;
}
.ant-card-head-title {
padding: 24px 0;
line-height: 32px;
}
.ant-card-extra {
padding: 24px 0;
}
.ant-list-pagination {
margin-top: 24px;
text-align: right;
}
.ant-avatar-lg {
width: 48px;
height: 48px;
line-height: 48px;
}
}
.headerInfo {
position: relative;
text-align: center;
& > span {
display: inline-block;
margin-bottom: 4px;
color: @text-color-secondary;
font-size: @font-size-base;
line-height: 22px;
}
& > p {
margin: 0;
color: @heading-color;
font-size: 24px;
line-height: 32px;
}
& > em {
position: absolute;
top: 0;
right: 0;
width: 1px;
height: 56px;
background-color: @border-color-split;
}
}
.listContent {
display: flex;
flex: 1;
flex-direction: row;
font-size: 0;
.listContentItem {
flex: 1;
margin-left: 40px;
color: @text-color-secondary;
font-size: @font-size-base;
vertical-align: middle;
> span {
line-height: 20px;
}
> p {
margin-top: 4px;
margin-bottom: 0;
line-height: 22px;
}
}
}
.extraContentSearch {
width: 272px;
margin-left: 16px;
}
}
@media screen and (max-width: @screen-xs) {
.standardList {
:global {
.ant-list-item-content {
display: block;
flex: none;
width: 100%;
}
.ant-list-item-action {
margin-left: 0;
}
}
.listContent {
margin-left: 0;
& > div {
margin-left: 0;
}
}
.listCard {
:global {
.ant-card-head-title {
overflow: visible;
}
}
}
}
}
@media screen and (max-width: @screen-sm) {
.standardList {
.extraContentSearch {
width: 100%;
margin-left: 0;
}
.headerInfo {
margin-bottom: 16px;
& > em {
display: none;
}
}
}
}
@media screen and (max-width: @screen-md) {
.standardList {
.listContent {
& > div {
display: block;
}
& > div:last-child {
top: 0;
width: 100%;
}
}
}
.listCard {
:global {
.ant-radio-group {
display: block;
margin-bottom: 8px;
}
}
}
}
@media screen and (max-width: @screen-lg) and (min-width: @screen-md) {
.standardList {
.listContent {
& > div {
display: block;
}
& > div:last-child {
top: 0;
width: 100%;
}
}
}
}
@media screen and (max-width: @screen-xl) {
.standardList {
.listContent {
& > div {
margin-left: 24px;
}
& > div:last-child {
top: 0;
}
}
}
}
@media screen and (max-width: 1400px) {
.standardList {
.listContent {
text-align: right;
& > div:last-child {
top: 0;
}
}
}
}
.standardListForm {
:global {
.ant-form-item {
margin-bottom: 12px;
&:last-child {
margin-bottom: 32px;
padding-top: 4px;
}
}
}
}
.formResult {
width: 100%;
[class^='title'] {
margin-bottom: 8px;
}
}
.tableListForm {
:global {
.ant-form-item {
display: flex;
margin-right: 0;
margin-bottom: 24px;
> .ant-form-item-label {
width: auto;
padding-right: 8px;
line-height: 32px;
}
.ant-form-item-control {
line-height: 32px;
}
}
.ant-form-item-control-wrapper {
flex: 1;
}
}
.submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
}
@media screen and (max-width: @screen-lg) {
.tableListForm :global(.ant-form-item) {
margin-right: 24px;
}
}
@media screen and (max-width: @screen-md) {
.tableListForm :global(.ant-form-item) {
margin-right: 8px;
}
}
// 订单content
.orderGroup {
@padding-slid: 10px;
@solid-color: rgba(167, 157, 160, 0.92);
@header-background: rgba(210, 219, 238, 0.99);
display: flex;
flex: 1;
flex-direction: column;
justify-content: flex-start;
.header {
display: flex;
flex: 1;
justify-content: space-between;
padding-right: @padding-slid;
padding-left: @padding-slid;
font-weight: bold;
font-size: 15px;
line-height: 35px;
background-color: @header-background;
}
.goodsContainer {
:first-child {
border-top: none;
border-bottom: none;
}
:last-child {
border-bottom: none;
}
}
.orderGoods {
display: flex;
flex: 2;
flex-direction: row;
width: 500px;
border: 1px solid @solid-color;
}
.order {
display: flex;
flex: 1;
flex-direction: row;
padding-right: @padding-slid;
padding-left: @padding-slid;
line-height: 100px;
border: 1px solid @solid-color;
.contentItem {
display: flex;
flex: 1;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
> div {
line-height: 30px;
}
.columnName {
font-weight: bold;
font-size: 12px;
}
}
.image {
width: 80px;
height: 80px;
}
}
}
admin-web/src/pages/Sms/SignList
Update
.js
→
admin-web/src/pages/Sms/SignList
Modal
.js
浏览文件 @
5c68383a
...
@@ -8,7 +8,7 @@ import dictionary from '../../utils/dictionary';
...
@@ -8,7 +8,7 @@ import dictionary from '../../utils/dictionary';
*
*
* @type {React.ComponentClass<RcBaseFormProps & Omit<FormComponentProps, keyof FormComponentProps>>}
* @type {React.ComponentClass<RcBaseFormProps & Omit<FormComponentProps, keyof FormComponentProps>>}
*/
*/
const
SignList
Update
=
Form
.
create
()(
props
=>
{
const
SignList
Modal
=
Form
.
create
()(
props
=>
{
const
{
onOk
,
onCancel
,
visible
,
title
,
form
,
initData
=
{}
}
=
props
;
const
{
onOk
,
onCancel
,
visible
,
title
,
form
,
initData
=
{}
}
=
props
;
const
{
getFieldDecorator
,
validateFields
}
=
props
.
form
;
const
{
getFieldDecorator
,
validateFields
}
=
props
.
form
;
...
@@ -57,7 +57,7 @@ const SignListUpdate = Form.create()(props => {
...
@@ -57,7 +57,7 @@ const SignListUpdate = Form.create()(props => {
message
:
'请选择平台'
,
message
:
'请选择平台'
,
},
},
],
],
initialValue
:
`
${
initData
.
platform
}
`
,
initialValue
:
initData
.
platform
,
})(
<
DictionarySelect
dicKey
=
{
dictionary
.
SMS_PLATFORM
}
/>
)
}
})(
<
DictionarySelect
dicKey
=
{
dictionary
.
SMS_PLATFORM
}
/>
)
}
<
/Form.Item
>
<
/Form.Item
>
<
/Form
>
<
/Form
>
...
@@ -65,4 +65,4 @@ const SignListUpdate = Form.create()(props => {
...
@@ -65,4 +65,4 @@ const SignListUpdate = Form.create()(props => {
);
);
});
});
export
default
SignList
Update
;
export
default
SignList
Modal
;
admin-web/src/pages/Sms/TemplateList.js
浏览文件 @
5c68383a
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
Card
,
Divider
,
Table
,
Modal
,
Button
}
from
'antd'
;
import
{
connect
}
from
'dva'
;
import
PageHeaderWrapper
from
'@/components/PageHeaderWrapper'
;
import
PageHeaderWrapper
from
'@/components/PageHeaderWrapper'
;
import
DictionaryText
from
'../../components/Dictionary/DictionaryText'
;
import
dictionary
from
'../../utils/dictionary'
;
import
styles
from
'../List/TableList.less'
;
import
TemplateListSearch
from
'./TemplateListSearch'
;
import
TemplateListModal
from
'./TemplateListModal'
;
@
connect
(({
smsTemplateList
,
loading
})
=>
({
smsTemplateList
,
loading
:
loading
.
models
.
smsTemplateList
,
}))
class
TemplateList
extends
PureComponent
{
class
TemplateList
extends
PureComponent
{
state
=
{
visible
:
false
,
title
:
'添加模板'
,
// 添加签名 修改签名
type
:
'add'
,
// add update
id
:
''
,
sign
:
{},
};
componentDidMount
()
{
// init page 参数
this
.
current
=
1
;
this
.
total
=
0
;
this
.
size
=
10
;
this
.
searchParams
=
{};
// 查询 page
this
.
queryPage
();
}
queryPage
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
current
,
total
,
size
,
searchParams
}
=
this
;
dispatch
({
type
:
'smsTemplateList/page'
,
payload
:
{
current
,
total
,
size
,
...
searchParams
,
},
});
};
handleSearch
=
searchParams
=>
{
this
.
searchParams
=
searchParams
;
this
.
queryPage
();
};
handleAddShow
=
()
=>
{
this
.
setState
({
visible
:
true
,
type
:
'add'
,
title
:
'添加模板'
,
});
};
handleUpdateShow
=
sign
=>
{
const
{
id
}
=
sign
;
this
.
setState
({
visible
:
true
,
type
:
'update'
,
title
:
'更新模板'
,
id
,
sign
,
});
};
handleDeleted
=
({
id
,
sign
})
=>
{
const
{
dispatch
}
=
this
.
props
;
Modal
.
confirm
({
title
:
`提示消息`
,
content
:
`确认删除
${
sign
}
签名吗`
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
()
=>
{
dispatch
({
type
:
'smsTemplateList/deleted'
,
payload
:
{
params
:
{
id
,
},
callback
:
()
=>
{
this
.
queryPage
();
},
},
});
},
onCancel
()
{
console
.
log
(
'Cancel'
);
},
});
};
handleCancel
=
()
=>
{
this
.
setState
({
visible
:
false
,
});
};
handleOk
=
fields
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
type
,
id
}
=
this
.
state
;
if
(
type
===
'add'
)
{
dispatch
({
type
:
'smsTemplateList/add'
,
payload
:
{
params
:
{
...
fields
,
},
callback
:
()
=>
{
this
.
handleCancel
();
this
.
queryPage
();
},
},
});
}
else
if
(
type
===
'update'
)
{
dispatch
({
type
:
'smsTemplateList/update'
,
payload
:
{
params
:
{
id
,
...
fields
,
},
callback
:
()
=>
{
this
.
handleCancel
();
this
.
queryPage
();
},
},
});
}
};
handleTableChange
=
pagination
=>
{
const
{
pageSize
,
current
}
=
pagination
;
this
.
size
=
pageSize
;
this
.
current
=
current
;
this
.
queryPage
();
};
render
()
{
render
()
{
return
<
PageHeaderWrapper
>
template
-
list
<
/PageHeaderWrapper>
;
// props
const
{
loading
,
smsTemplateList
}
=
this
.
props
;
const
{
list
,
total
,
index
,
size
}
=
smsTemplateList
;
const
{
visible
,
title
,
type
,
sign
}
=
this
.
state
;
const
columns
=
[
{
title
:
'ID'
,
dataIndex
:
'id'
,
key
:
'id'
,
},
{
title
:
'签名'
,
dataIndex
:
'sign'
,
key
:
'sign'
,
// eslint-disable-next-line no-shadow
render
({
sign
})
{
return
<
div
>
{
sign
}
<
/div>
;
},
},
{
title
:
'签名'
,
dataIndex
:
'template'
,
key
:
'template'
,
},
{
title
:
'短信平台'
,
dataIndex
:
'platform'
,
key
:
'platform'
,
render
(
platform
)
{
return
(
<
div
>
<
DictionaryText
dicKey
=
{
dictionary
.
SMS_PLATFORM
}
dicValue
=
{
platform
}
/
>
<
/div
>
);
},
},
{
title
:
'审核状态'
,
dataIndex
:
'applyStatus'
,
key
:
'applyStatus'
,
render
(
applyStatus
)
{
return
(
<
div
>
<
DictionaryText
dicKey
=
{
dictionary
.
SMS_APPLY_STATUS
}
dicValue
=
{
applyStatus
}
/
>
<
/div
>
);
},
},
{
title
:
'更新时间'
,
dataIndex
:
'updateTime'
,
key
:
'updateTime'
,
width
:
200
,
render
(
updateTime
)
{
return
<
div
>
{
updateTime
}
<
/div>
;
},
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
width
:
200
,
render
(
createTime
)
{
return
<
div
>
{
createTime
}
<
/div>
;
},
},
{
title
:
'操作'
,
render
:
row
=>
{
return
(
<
div
>
<
a
onClick
=
{
this
.
handleUpdateShow
.
bind
(
this
,
row
)}
>
修改
<
/a
>
<
Divider
type
=
"vertical"
/>
<
a
onClick
=
{
this
.
handleDeleted
.
bind
(
this
,
row
)}
>
删除
<
/a
>
<
/div
>
);
},
},
];
const
pagination
=
{
total
,
index
,
pageSize
:
size
,
};
return
(
<
PageHeaderWrapper
>
<
Card
>
<
div
className
=
{
styles
.
tableListForm
}
>
<
TemplateListSearch
handleSearch
=
{
this
.
handleSearch
}
/
>
<
/div
>
<
br
/>
<
div
>
<
Button
icon
=
"plus"
onClick
=
{
this
.
handleAddShow
}
>
添加签名
<
/Button
>
<
/div
>
<
br
/>
<
Table
loading
=
{
loading
}
rowKey
=
"id"
dataSource
=
{
list
}
columns
=
{
columns
}
pagination
=
{
pagination
}
onChange
=
{
this
.
handleTableChange
}
/
>
<
/Card
>
<
TemplateListModal
initData
=
{
sign
}
title
=
{
title
}
visible
=
{
visible
}
type
=
{
type
}
onOk
=
{
this
.
handleOk
}
onCancel
=
{
this
.
handleCancel
}
/
>
<
/PageHeaderWrapper
>
);
}
}
}
}
...
...
admin-web/src/pages/Sms/TemplateList.less
浏览文件 @
5c68383a
@import '~antd/lib/style/themes/default.less';
@import '~antd/lib/style/themes/default.less';
@import '~@/utils/utils.less';
@import '~@/utils/utils.less';
.standardList {
:global {
.ant-card-head {
border-bottom: none;
}
.ant-card-head-title {
padding: 24px 0;
line-height: 32px;
}
.ant-card-extra {
padding: 24px 0;
}
.ant-list-pagination {
margin-top: 24px;
text-align: right;
}
.ant-avatar-lg {
width: 48px;
height: 48px;
line-height: 48px;
}
}
.headerInfo {
position: relative;
text-align: center;
& > span {
display: inline-block;
margin-bottom: 4px;
color: @text-color-secondary;
font-size: @font-size-base;
line-height: 22px;
}
& > p {
margin: 0;
color: @heading-color;
font-size: 24px;
line-height: 32px;
}
& > em {
position: absolute;
top: 0;
right: 0;
width: 1px;
height: 56px;
background-color: @border-color-split;
}
}
.listContent {
display: flex;
flex: 1;
flex-direction: row;
font-size: 0;
.listContentItem {
flex: 1;
margin-left: 40px;
color: @text-color-secondary;
font-size: @font-size-base;
vertical-align: middle;
> span {
line-height: 20px;
}
> p {
margin-top: 4px;
margin-bottom: 0;
line-height: 22px;
}
}
}
.extraContentSearch {
width: 272px;
margin-left: 16px;
}
}
@media screen and (max-width: @screen-xs) {
.standardList {
:global {
.ant-list-item-content {
display: block;
flex: none;
width: 100%;
}
.ant-list-item-action {
margin-left: 0;
}
}
.listContent {
margin-left: 0;
& > div {
margin-left: 0;
}
}
.listCard {
:global {
.ant-card-head-title {
overflow: visible;
}
}
}
}
}
@media screen and (max-width: @screen-sm) {
.standardList {
.extraContentSearch {
width: 100%;
margin-left: 0;
}
.headerInfo {
margin-bottom: 16px;
& > em {
display: none;
}
}
}
}
@media screen and (max-width: @screen-md) {
.standardList {
.listContent {
& > div {
display: block;
}
& > div:last-child {
top: 0;
width: 100%;
}
}
}
.listCard {
:global {
.ant-radio-group {
display: block;
margin-bottom: 8px;
}
}
}
}
@media screen and (max-width: @screen-lg) and (min-width: @screen-md) {
.standardList {
.listContent {
& > div {
display: block;
}
& > div:last-child {
top: 0;
width: 100%;
}
}
}
}
@media screen and (max-width: @screen-xl) {
.standardList {
.listContent {
& > div {
margin-left: 24px;
}
& > div:last-child {
top: 0;
}
}
}
}
@media screen and (max-width: 1400px) {
.standardList {
.listContent {
text-align: right;
& > div:last-child {
top: 0;
}
}
}
}
.standardListForm {
:global {
.ant-form-item {
margin-bottom: 12px;
&:last-child {
margin-bottom: 32px;
padding-top: 4px;
}
}
}
}
.formResult {
width: 100%;
[class^='title'] {
margin-bottom: 8px;
}
}
.tableListForm {
:global {
.ant-form-item {
display: flex;
margin-right: 0;
margin-bottom: 24px;
> .ant-form-item-label {
width: auto;
padding-right: 8px;
line-height: 32px;
}
.ant-form-item-control {
line-height: 32px;
}
}
.ant-form-item-control-wrapper {
flex: 1;
}
}
.submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
}
@media screen and (max-width: @screen-lg) {
.tableListForm :global(.ant-form-item) {
margin-right: 24px;
}
}
@media screen and (max-width: @screen-md) {
.tableListForm :global(.ant-form-item) {
margin-right: 8px;
}
}
// 订单content
.orderGroup {
@padding-slid: 10px;
@solid-color: rgba(167, 157, 160, 0.92);
@header-background: rgba(210, 219, 238, 0.99);
display: flex;
flex: 1;
flex-direction: column;
justify-content: flex-start;
.header {
display: flex;
flex: 1;
justify-content: space-between;
padding-right: @padding-slid;
padding-left: @padding-slid;
font-weight: bold;
font-size: 15px;
line-height: 35px;
background-color: @header-background;
}
.goodsContainer {
:first-child {
border-top: none;
border-bottom: none;
}
:last-child {
border-bottom: none;
}
}
.orderGoods {
display: flex;
flex: 2;
flex-direction: row;
width: 500px;
border: 1px solid @solid-color;
}
.order {
display: flex;
flex: 1;
flex-direction: row;
padding-right: @padding-slid;
padding-left: @padding-slid;
line-height: 100px;
border: 1px solid @solid-color;
.contentItem {
display: flex;
flex: 1;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
> div {
line-height: 30px;
}
.columnName {
font-weight: bold;
font-size: 12px;
}
}
.image {
width: 80px;
height: 80px;
}
}
}
admin-web/src/pages/Sms/TemplateListModal.js
0 → 100644
浏览文件 @
5c68383a
import
React
from
'react'
;
import
{
Form
,
Input
,
Modal
}
from
'antd'
;
import
DictionarySelect
from
'../../components/Dictionary/DictionarySelect'
;
import
dictionary
from
'../../utils/dictionary'
;
/**
* table 查询
*
* @type {React.ComponentClass<RcBaseFormProps & Omit<FormComponentProps, keyof FormComponentProps>>}
*/
const
SignListModal
=
Form
.
create
()(
props
=>
{
const
{
onOk
,
onCancel
,
visible
,
title
,
form
,
initData
=
{}
}
=
props
;
const
{
getFieldDecorator
,
validateFields
}
=
props
.
form
;
function
handleOk
(
e
)
{
e
.
preventDefault
();
validateFields
((
err
,
fields
)
=>
{
const
searchParams
=
fields
;
if
(
onOk
)
{
onOk
(
searchParams
);
form
.
resetFields
();
}
});
}
function
handleCancel
()
{
if
(
onCancel
)
{
onCancel
();
}
}
const
formItemLayout
=
{
labelCol
:
{
span
:
4
},
wrapperCol
:
{
span
:
18
},
};
return
(
<
Modal
title
=
{
title
}
visible
=
{
visible
}
onOk
=
{
handleOk
}
onCancel
=
{
handleCancel
}
>
<
Form
>
<
Form
.
Item
{...
formItemLayout
}
label
=
"签名"
>
{
getFieldDecorator
(
'smsSignId'
,
{
rules
:
[
{
required
:
true
,
message
:
'请输入签名'
,
},
],
initialValue
:
initData
.
sign
?
initData
.
sign
.
id
:
null
,
})(
<
Input
placeholder
=
"请输入签名"
/>
)}
<
/Form.Item
>
<
Form
.
Item
{...
formItemLayout
}
label
=
"类型"
>
{
getFieldDecorator
(
'smsType'
,
{
rules
:
[
{
required
:
true
,
message
:
'请选择短信类型'
,
},
],
initialValue
:
initData
.
smsType
,
})(
<
DictionarySelect
placeholder
=
"请选择短信类型"
dicKey
=
{
dictionary
.
SMS_TYPE
}
/>
)
}
<
/Form.Item
>
<
Form
.
Item
{...
formItemLayout
}
label
=
"平台"
>
{
getFieldDecorator
(
'platform'
,
{
rules
:
[
{
required
:
true
,
message
:
'请选择平台'
,
},
],
initialValue
:
initData
.
platform
,
})(
<
DictionarySelect
placeholder
=
"请选择平台"
dicKey
=
{
dictionary
.
SMS_PLATFORM
}
/>
)
}
<
/Form.Item
>
<
Form
.
Item
{...
formItemLayout
}
label
=
"模板Code"
>
{
getFieldDecorator
(
'templateCode'
,
{
rules
:
[
{
required
:
true
,
message
:
'短信平台的Code'
,
},
],
initialValue
:
initData
.
templateCode
,
})(
<
Input
placeholder
=
"第三方平台Code"
/>
)}
<
/Form.Item
>
<
Form
.
Item
{...
formItemLayout
}
label
=
"模板"
>
{
getFieldDecorator
(
'template'
,
{
rules
:
[
{
required
:
true
,
message
:
'请输入短信模板'
,
},
],
initialValue
:
initData
.
template
,
})(
<
Input
.
TextArea
placeholder
=
"请输入模板"
rows
=
{
4
}
/>
)
}
<
/Form.Item
>
<
/Form
>
<
/Modal
>
);
});
export
default
SignListModal
;
admin-web/src/pages/Sms/TemplateListSearch.js
0 → 100644
浏览文件 @
5c68383a
import
React
from
'react'
;
import
{
Button
,
Col
,
Form
,
Input
,
Row
}
from
'antd'
;
const
FormItem
=
Form
.
Item
;
/**
* table 查询
*
* @type {React.ComponentClass<RcBaseFormProps & Omit<FormComponentProps, keyof FormComponentProps>>}
*/
const
SignListSearch
=
Form
.
create
()(
props
=>
{
const
{
handleSearch
}
=
props
;
const
{
getFieldDecorator
,
validateFields
,
form
}
=
props
.
form
;
function
onSubmit
(
e
)
{
e
.
preventDefault
();
validateFields
((
err
,
fields
)
=>
{
const
searchParams
=
fields
;
if
(
handleSearch
)
{
handleSearch
(
searchParams
);
}
});
}
function
handleFormReset
()
{
form
.
resetFields
();
}
return
(
<
Form
onSubmit
=
{
onSubmit
}
layout
=
"inline"
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"编号"
>
{
getFieldDecorator
(
'id'
)(
<
Input
placeholder
=
"请输入ID"
/>
)}
<
/FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"签名"
>
{
getFieldDecorator
(
'smsSignId'
)(
<
Input
placeholder
=
"请输入签名"
/>
)}
<
/FormItem
>
<
/Col
>
<
/Row
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
span
>
<
Button
type
=
"primary"
htmlType
=
"submit"
>
查询
<
/Button
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
handleFormReset
}
>
重置
<
/Button
>
<
/span
>
<
/Col
>
<
/Row
>
<
/Form
>
);
});
export
default
SignListSearch
;
admin-web/src/services/sms.js
浏览文件 @
5c68383a
...
@@ -26,3 +26,29 @@ export async function deletedSign(params) {
...
@@ -26,3 +26,29 @@ export async function deletedSign(params) {
method
:
'DELETE'
,
method
:
'DELETE'
,
});
});
}
}
// template
export
async
function
pageTemplate
(
params
)
{
return
request
(
`/admin-api/admins/sms/template/page?
${
stringify
(
params
)}
`
,
{
method
:
'GET'
,
});
}
export
async
function
addTemplate
(
params
)
{
return
request
(
`/admin-api/admins/sms/template/add?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
});
}
export
async
function
updateTemplate
(
params
)
{
return
request
(
`/admin-api/admins/sms/template/update?
${
stringify
(
params
)}
`
,
{
method
:
'PUT'
,
});
}
export
async
function
deletedTemplate
(
params
)
{
return
request
(
`/admin-api/admins/sms/template/deleted?
${
stringify
(
params
)}
`
,
{
method
:
'DELETE'
,
});
}
admin-web/src/utils/dictionary.js
浏览文件 @
5c68383a
...
@@ -12,6 +12,7 @@ const DictionaryConstants = {
...
@@ -12,6 +12,7 @@ const DictionaryConstants = {
ORDER_RETURN_SERVICE_TYPE
:
'order_return_service_type'
,
ORDER_RETURN_SERVICE_TYPE
:
'order_return_service_type'
,
// sms
// sms
SMS_TYPE
:
'sms_type'
,
SMS_PLATFORM
:
'sms_platform'
,
SMS_PLATFORM
:
'sms_platform'
,
SMS_APPLY_STATUS
:
'sms_apply_status'
,
SMS_APPLY_STATUS
:
'sms_apply_status'
,
};
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论