Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sass-admin
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj_app
sass-admin
Commits
9fde9c77
Commit
9fde9c77
authored
Oct 22, 2025
by
chengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改ip配置
parent
01dbcb9b
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
299 additions
and
1978 deletions
+299
-1978
build/Ip.js
+1
-1
src/pages/SystemManagement/MessageManagement/index.js
+0
-9
src/pages/SystemManagement/Point/ActiveOption.jsx
+30
-116
src/pages/SystemManagement/Point/CurrencyOption.jsx
+147
-193
src/pages/SystemManagement/Point/Detailed.jsx
+0
-229
src/pages/SystemManagement/Point/EditPointPool.jsx
+0
-86
src/pages/SystemManagement/Point/ModalForm.jsx
+52
-48
src/pages/SystemManagement/Point/PointPool.jsx
+0
-224
src/pages/SystemManagement/Point/exchangeForOption/index.jsx
+0
-151
src/pages/SystemManagement/Point/exchangeForOption/integralExchangeSetting.jsx
+0
-283
src/pages/SystemManagement/Point/exchangeForOption/style.less
+0
-108
src/pages/SystemManagement/Point/exchangeForOption/tradingLogs.jsx
+0
-351
src/pages/SystemManagement/Point/exchangeForOption/tradingLogsFilter.jsx
+0
-125
src/pages/SystemManagement/Point/redux/action.js
+39
-6
src/pages/SystemManagement/Point/redux/api.js
+21
-5
src/pages/SystemManagement/Point/redux/reducer.js
+6
-0
src/pages/SystemManagement/index.js
+0
-31
src/pages/TrainingTools/Question/Create/Base.jsx
+2
-2
src/services/serve.js
+1
-10
No files found.
build/Ip.js
View file @
9fde9c77
var
os
=
require
(
'os'
),
IP
=
'http://47.116.126.39:8080'
,
ifaces
=
os
.
networkInterfaces
()
// 获取本机IP
var
os
=
require
(
'os'
),
IP
=
"http://10.10.12.94:8090"
,
ifaces
=
os
.
networkInterfaces
()
// 获取本机IP
out
:
for
(
var
i
in
ifaces
)
{
for
(
var
j
in
ifaces
[
i
])
{
...
...
src/pages/SystemManagement/MessageManagement/index.js
View file @
9fde9c77
...
...
@@ -424,20 +424,11 @@ class News extends React.Component {
};
render
()
{
const
{
table
,
postNewsTable
,
systemtable
,
postSystemTable
,
customsee
,
postHandleMessage
,
handlemessagetable
,
handlemessagetableget
,
}
=
this
.
props
;
const
{
customcurrent
,
custompageSize
,
systemcurrent
,
systempageSize
,
handleMessagepageSize
,
handleMessagecurrent
,
lookState
,
...
...
src/pages/SystemManagement/Point/ActiveOption.jsx
View file @
9fde9c77
...
...
@@ -25,12 +25,6 @@ import {
}
from
"./redux/action"
;
import
Styles
from
"./index.less"
;
import
ModalForm
from
"./ModalForm"
;
const
Search
=
Input
.
Search
;
const
FormItem
=
Form
.
Item
;
var
companyCode
=
location
.
pathname
.
split
(
"/"
)[
1
];
var
siteCode
=
location
.
pathname
.
split
(
"/"
)[
2
];
class
ActiveOption
extends
React
.
Component
{
state
=
{
visible
:
false
,
...
...
@@ -38,25 +32,12 @@ class ActiveOption extends React.Component {
current
:
"1"
,
pageSize
:
"10"
,
type
:
""
,
values
:
""
,
};
componentDidMount
()
{
this
.
props
.
getPointTable
({
pageNo
:
1
,
pageSize
:
20
});
this
.
props
.
getCodeList
({
code
:
"point_activity"
});
}
//获取头部查询的值
onSearch
=
value
=>
{
this
.
setState
({
values
:
value
});
let
reg
=
/
[
@#
\$
%
\^
&
\*
{}|
\\]
+/g
.
test
(
value
);
if
(
!
reg
)
{
this
.
setState
({
activityName
:
value
},
()
=>
{
this
.
props
.
getPointTable
({
activityName
:
value
});
});
}
else
{
return
message
.
warning
(
"不能输入特殊字符!"
);
}
};
//上架
onShelf
=
record
=>
{
const
{
current
,
pageSize
}
=
this
.
state
;
...
...
@@ -67,7 +48,6 @@ class ActiveOption extends React.Component {
this
.
props
.
getPointTable
({
pageNo
:
current
,
pageSize
:
pageSize
,
activityName
:
this
.
state
.
values
,
});
//bug-11053-liyuan 管理端-积分管理 -积分活动策略 分页控件问题
}
);
...
...
@@ -82,7 +62,6 @@ class ActiveOption extends React.Component {
this
.
props
.
getPointTable
({
pageNo
:
current
,
pageSize
:
pageSize
,
activityName
:
this
.
state
.
values
,
});
//bug-11053-liyuan 管理端-积分管理 -积分活动策略 分页控件问题
}
);
...
...
@@ -101,6 +80,7 @@ class ActiveOption extends React.Component {
const
{
current
,
pageSize
,
record
,
type
,
activityName
}
=
this
.
state
;
const
form
=
this
.
formRef
.
props
.
form
;
form
.
validateFields
((
err
,
values
)
=>
{
console
.
log
(
values
,
record
,
'values'
);
if
(
err
)
{
return
;
}
...
...
@@ -109,17 +89,13 @@ class ActiveOption extends React.Component {
this
.
props
.
postPointModify
(
{
id
:
record
.
id
,
activityName
:
values
.
activityName
,
code
:
values
.
code
,
activityType
:
values
.
activityType
,
multiple
:
values
.
multiple
,
startTime
:
values
.
time
[
0
],
endTime
:
values
.
time
[
1
],
productImg
:
values
.
productImg
,
productName
:
values
.
productName
,
point
:
values
.
point
,
},
{
pageNo
:
current
,
pageSize
:
pageSize
}
,
''
,
()
=>
{
this
.
props
.
getPointTable
({
activityName
:
this
.
state
.
values
,
pageNo
:
current
,
pageSize
:
pageSize
,
});
...
...
@@ -128,17 +104,13 @@ class ActiveOption extends React.Component {
}
else
{
this
.
props
.
postPointAdd
(
{
activityName
:
values
.
activityName
,
code
:
values
.
code
,
activityType
:
values
.
activityType
,
multiple
:
values
.
multiple
,
startTime
:
values
.
time
[
0
],
endTime
:
values
.
time
[
1
],
productImg
:
values
.
productImg
,
productName
:
values
.
productName
,
point
:
values
.
point
,
},
{
pageNo
:
current
,
pageSize
:
pageSize
},
()
=>
{
this
.
props
.
getPointTable
({
activityName
:
this
.
state
.
values
,
pageNo
:
current
,
pageSize
:
pageSize
,
});
...
...
@@ -162,78 +134,41 @@ class ActiveOption extends React.Component {
render
()
{
const
that
=
this
;
const
{
current
,
pageSize
,
activityName
}
=
this
.
state
;
const
{
table
,
getPointTable
,
codeList
}
=
this
.
props
;
const
columns
=
[
{
title
:
"活动策略名称"
,
dataIndex
:
"activityName"
,
key
:
"activityName"
,
//width: 300, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
render
:
text
=>
{
//bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
title
:
"商品图片"
,
dataIndex
:
"productImg"
,
key
:
"productImg"
,
render
:
src
=>
{
return
(
<
span
title=
{
text
}
style=
{
{
display
:
"block"
,
width
:
"200px"
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
whiteSpace
:
"nowrap"
,
cursor
:
"default"
,
}
}
>
{
text
}
</
span
>
<
img
src=
{
src
}
style=
{
{
width
:
65
,
height
:
60
}
}
/>
);
},
},
{
title
:
"积分编号"
,
dataIndex
:
"code"
,
key
:
"code"
,
// width: 200, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
render
:
text
=>
{
return
codeList
?.
data
?.
find
(
item
=>
item
.
code
==
text
).
cnName
;
},
title
:
"商品名称"
,
dataIndex
:
"productName"
,
key
:
"productName"
,
},
{
title
:
"积分类型"
,
dataIndex
:
"activityType"
,
key
:
"activityType"
,
// width: 200, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
render
:
text
=>
{
return
<
span
>
{
text
==
"1"
?
"否"
:
text
}
</
span
>;
},
title
:
"所需积分"
,
dataIndex
:
"point"
,
key
:
"point"
,
},
{
title
:
"积分倍数"
,
dataIndex
:
"multiple"
,
key
:
"multiple"
,
// width: 200, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
render
:
text
=>
{
return
<
span
>
{
text
==
"1"
?
"否"
:
text
}
</
span
>;
},
},
{
title
:
"发放有效期"
,
dataIndex
:
"time"
,
key
:
"time"
,
// width: 400, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
title
:
"创建时间"
,
dataIndex
:
"createTime"
,
key
:
"createTime"
,
render
:
(
text
,
record
)
=>
{
return
(
<
span
>
{
moment
(
record
.
startTime
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
~
{
" "
}
{
moment
(
record
.
endTime
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</
span
>
<
span
>
{
moment
(
record
.
createTime
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</
span
>
);
},
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
300
,
//bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
render
:
(
text
,
record
,
index
)
=>
(
<
span
>
{
record
.
state
==
"2"
?
(
...
...
@@ -270,20 +205,6 @@ class ActiveOption extends React.Component {
""
)
}
<
Divider
type=
"vertical"
/>
<
Link
to=
{
{
pathname
:
"/"
+
companyCode
+
"/"
+
siteCode
+
"/index/manager/point/Detailed-option"
,
state
:
{
record
},
}
}
>
积分明细
</
Link
>
<
Divider
type=
"vertical"
/>
<
Popconfirm
title=
"确定要删除吗?"
okText=
"确定"
...
...
@@ -293,7 +214,6 @@ class ActiveOption extends React.Component {
if
(
res
.
code
===
"1000"
)
{
message
.
success
(
"删除成功"
);
this
.
props
.
getPointTable
({
activityName
:
this
.
state
.
values
,
pageNo
:
this
.
state
.
current
,
pageSize
:
this
.
state
.
pageSize
,
});
...
...
@@ -312,9 +232,9 @@ class ActiveOption extends React.Component {
const
pagination
=
{
showQuickJumper
:
true
,
showSizeChanger
:
true
,
total
:
table
&&
table
.
page
.
pageT
otal
,
showTotal
:
total
=>
`共
${
table
.
page
.
pageT
otal
}
条`
,
pageSize
:
table
&&
table
.
page
.
pageS
ize
,
total
:
table
&&
table
.
t
otal
,
showTotal
:
total
=>
`共
${
table
.
t
otal
}
条`
,
pageSize
:
table
&&
table
.
s
ize
,
onShowSizeChange
(
current
,
pageSize
)
{
getPointTable
({
pageNo
:
current
,
pageSize
:
pageSize
});
that
.
setState
({
current
:
current
,
pageSize
:
pageSize
});
...
...
@@ -326,25 +246,19 @@ class ActiveOption extends React.Component {
};
return
(
<
div
className=
{
Styles
.
list
}
>
<
Breadcrumb
title=
"
活动策略
设置"
/>
<
Breadcrumb
title=
"
商品
设置"
/>
<
div
className=
{
Styles
.
listBtn
}
>
<
div
style=
{
{
float
:
"left"
}
}
>
<
Button
type=
"primary"
onClick=
{
this
.
showModal
}
>
创建活动策略
新增商品
</
Button
>
</
div
>
<
div
style=
{
{
float
:
"right"
}
}
>
<
Search
placeholder=
"请输入活动策略名称"
enterButton
onSearch=
{
this
.
onSearch
}
/>
</
div
>
</
div
>
{
table
?
(
<
Table
columns=
{
columns
}
dataSource=
{
table
.
data
}
dataSource=
{
table
&&
table
.
records
}
pagination=
{
pagination
}
rowKey=
{
record
=>
record
.
id
}
/>
...
...
src/pages/SystemManagement/Point/CurrencyOption.jsx
View file @
9fde9c77
import
React
from
"react"
;
import
{
Form
,
Input
,
Button
,
Radio
,
Upload
,
Ic
on
}
from
"antd"
;
import
{
Input
,
Button
,
Table
,
Modal
,
message
,
Paginati
on
}
from
"antd"
;
import
{
connect
}
from
"react-redux"
;
import
{
gupfetch
}
from
"@/common/UpLoad/redux/actions"
;
import
{
postPointSet
,
postPointEdit
,
excl
}
from
"./redux/action"
;
import
Breadcrumb
from
"@/common/Breadcrumb"
;
import
{
postUserList
,
postPointExchange
,
}
from
"./redux/action"
;
const
Search
=
Input
.
Search
;
const
FormItem
=
Form
.
Item
;
class
CurrencyOption
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
show
:
true
,
//初始话默认显示欢迎页
uploadAction
:
""
,
uploadParams
:
{},
responseList
:
[],
fileList
:
[],
searchValue
:
""
,
userList
:
[],
currentPage
:
1
,
pageSize
:
10
,
total
:
0
,
exchangeModalVisible
:
false
,
selectedUser
:
null
,
deductPoints
:
0
,
loading
:
false
};
this
.
props
.
gupfetch
();
this
.
beforeUpload
=
this
.
beforeUpload
.
bind
(
this
);
this
.
handleUploadChange
=
this
.
handleUploadChange
.
bind
(
this
);
}
componentDidMount
()
{
this
.
props
.
postPointSet
({},
res
=>
{
if
(
res
.
code
==
1000
)
{
this
.
setState
({
show
:
res
.
data
.
state
==
1
?
true
:
false
,
});
// 加载用户列表数据
this
.
props
.
postUserList
({
name
:
""
,
pageNo
:
1
,
pageSize
:
20
});
}
});
// 搜索处理
handleSearch
=
(
value
)
=>
{
this
.
props
.
postUserList
({
name
:
value
,
pageNo
:
1
,
pageSize
:
20
});
}
//上传文件
beforeUpload
(
file
,
fileList
)
{
const
{
param
}
=
this
.
props
;
if
(
param
!==
null
)
{
this
.
setState
({
uploadParams
:
{
Filename
:
param
.
dir
+
"/"
+
file
.
uid
+
"."
+
file
.
name
.
split
(
"."
)[
1
],
key
:
param
.
dir
+
"/"
+
file
.
uid
+
"."
+
file
.
name
.
split
(
"."
)[
1
],
policy
:
param
.
policy
,
OSSAccessKeyId
:
param
.
accessid
,
success_action_status
:
"200"
,
signature
:
param
.
signature
,
},
uploadAction
:
param
.
host
,
});
// 显示兑换弹窗
showExchangeModal
=
(
user
)
=>
{
this
.
setState
({
hostAndDir
:
param
.
host
+
"/"
+
param
.
dir
,
fileList
:
[],
exchangeModalVisible
:
true
,
selectedUser
:
user
,
deductPoints
:
0
});
}
}
//123
handleUploadChange
({
file
,
fileList
})
{
//判断类型`
const
reg
=
/
(
xls|xlsx
)
$/g
;
//正则匹配格式
if
(
!
reg
.
test
(
file
.
name
))
{
message
.
error
(
"文件类型不对"
);
return
false
;
}
let
temp
=
this
.
state
.
fileList
;
if
(
file
.
status
==
"removed"
)
{
temp
=
temp
.
filter
(
item
=>
{
return
item
.
uid
!=
file
.
uid
;
});
this
.
setState
({
fileList
:
temp
,
responseList
:
temp
.
map
(
item
=>
{
return
{
fileName
:
item
.
name
,
fileUrl
:
item
.
fileUrl
?
item
.
fileUrl
:
this
.
state
.
hostAndDir
+
"/"
+
item
.
uid
+
"."
+
item
.
name
.
split
(
"."
)[
1
],
size
:
item
.
size
+
""
,
suffix
:
"."
+
item
.
name
.
split
(
"."
)[
1
],
};
}),
});
}
else
{
temp
.
push
(
fileList
.
pop
());
// 隐藏兑换弹窗
hideExchangeModal
=
()
=>
{
this
.
setState
({
fileList
:
temp
.
map
(
item
=>
{
return
{
uid
:
item
.
uid
,
name
:
item
.
name
,
size
:
item
.
size
,
fileUrl
:
item
.
fileUrl
,
};
}),
exchangeModalVisible
:
false
,
selectedUser
:
null
,
deductPoints
:
0
});
//this.props.gupList(temp);
this
.
setState
({
responseList
:
temp
.
map
(
item
=>
{
return
{
fileName
:
item
.
name
,
fileUrl
:
item
.
fileUrl
?
item
.
fileUrl
:
this
.
state
.
hostAndDir
+
"/"
+
item
.
uid
+
"."
+
item
.
name
.
split
(
"."
)[
1
],
size
:
item
.
size
+
""
,
suffix
:
"."
+
item
.
name
.
split
(
"."
)[
1
],
};
}),
});
}
}
//保存
handleSubmit
=
e
=>
{
e
.
preventDefault
();
this
.
props
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
this
.
props
.
postPointEdit
(
values
);
if
(
this
.
state
.
responseList
.
length
>
0
)
{
this
.
props
.
excl
({
ossUrl
:
this
.
state
.
responseList
[
0
].
fileUrl
});
}
// 处理积分扣除
handleExchange
=
()
=>
{
const
{
deductPoints
,
selectedUser
}
=
this
.
state
;
if
(
!
deductPoints
||
deductPoints
<=
0
)
{
message
.
error
(
"请输入有效的积分数量"
);
return
;
}
});
};
change
(
e
)
{
if
(
e
.
target
.
value
==
0
)
{
this
.
setState
({
show
:
false
,
});
}
else
{
this
.
setState
({
show
:
true
,
});
if
(
deductPoints
>
selectedUser
.
totalPoint
)
{
message
.
error
(
"扣除积分不能超过用户当前积分余额"
);
return
;
}
// 模拟兑换操作
this
.
props
.
postPointExchange
({
userId
:
selectedUser
.
userId
,
point
:
deductPoints
});
this
.
hideExchangeModal
();
// 重新加载列表
this
.
props
.
postUserList
({
name
:
this
.
state
.
searchValue
,
pageNo
:
this
.
state
.
currentPage
,
pageSize
:
this
.
state
.
pageSize
});
}
render
()
{
const
{
form
,
set
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
form
;
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
8
},
const
{
exchangeList
,
postUserList
}
=
this
.
props
;
// 表格列配置
const
columns
=
[
{
title
:
"用户名"
,
dataIndex
:
"userName"
,
key
:
"userName"
,
ellipsis
:
true
,
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
8
},
{
title
:
"姓名"
,
dataIndex
:
"name"
,
key
:
"name"
,
ellipsis
:
true
,
},
};
const
tailFormItemLayout
=
{
wrapperCol
:
{
xs
:
{
span
:
24
,
offset
:
0
,
{
title
:
"积分余额"
,
dataIndex
:
"totalPoint"
,
key
:
"totalPoint"
,
render
:
(
text
)
=>
<
span
style=
{
{
color
:
'#1890ff'
,
fontWeight
:
'bold'
}
}
>
{
text
}
</
span
>,
},
{
title
:
"操作"
,
key
:
"action"
,
render
:
(
text
,
record
)
=>
(
<
Button
type=
"primary"
size=
"small"
onClick=
{
()
=>
this
.
showExchangeModal
(
record
)
}
>
兑换
</
Button
>
),
},
sm
:
{
span
:
16
,
offset
:
8
,
];
const
pagination
=
{
showQuickJumper
:
true
,
showSizeChanger
:
true
,
total
:
exchangeList
&&
exchangeList
.
total
,
showTotal
:
total
=>
`共
${
exchangeList
.
total
}
条`
,
pageSize
:
exchangeList
&&
exchangeList
.
size
,
onShowSizeChange
(
current
,
pageSize
)
{
postUserList
({
pageNo
:
current
,
pageSize
:
pageSize
});
that
.
setState
({
current
:
current
,
pageSize
:
pageSize
});
},
onChange
(
current
,
pageSize
)
{
postUserList
({
pageNo
:
current
,
pageSize
:
pageSize
});
that
.
setState
({
current
:
current
,
pageSize
:
pageSize
});
},
};
return
(
<
div
>
<
Breadcrumb
title=
"积分设置"
/>
<
Form
onSubmit=
{
this
.
handleSubmit
}
>
<
FormItem
{
...
formItemLayout
}
label=
"积分是否启用"
>
{
getFieldDecorator
(
"state"
,
{
initialValue
:
set
?
""
+
set
.
state
+
""
:
"1"
,
})(
<
Radio
.
Group
onChange=
{
e
=>
this
.
change
(
e
)
}
>
<
Radio
value=
"1"
>
启用
</
Radio
>
<
Radio
value=
"0"
>
不启用
</
Radio
>
</
Radio
.
Group
>
)
}
</
FormItem
>
{
/*<FormItem*/
}
{
/*{...formItemLayout}*/
}
{
/*label="积分单位"*/
}
{
/*>*/
}
{
/*{getFieldDecorator('unit', {*/
}
{
/*initialValue: set?set.unit:'积分',*/
}
{
/*rules: [{ required: true, message: '请输入单位名称!' }],*/
}
{
/*})(*/
}
{
/*<Input />*/
}
{
/*)}*/
}
{
/*<p>可设置积分单位</p>*/
}
{
/*</FormItem>*/
}
{
this
.
state
.
show
?
(
<
FormItem
{
...
formItemLayout
}
label=
"积分导入"
>
<
div
>
<
Upload
headers=
{
{
"X-Requested-With"
:
null
}
}
//accept="application/vnd.ms-excel"
fileList=
{
this
.
state
.
fileList
}
action=
{
this
.
state
.
uploadAction
}
data=
{
this
.
state
.
uploadParams
}
beforeUpload=
{
this
.
beforeUpload
}
onChange=
{
this
.
handleUploadChange
}
<
Breadcrumb
title=
"积分兑换"
/>
{
/* 用户积分搜索和兑换功能 */
}
<
div
style=
{
{
marginBottom
:
24
,
background
:
'#fff'
,
padding
:
'16px 24px'
,
borderRadius
:
'4px'
}
}
>
<
div
style=
{
{
marginBottom
:
16
}
}
>
<
Search
placeholder=
"请输入用户名或姓名进行搜索"
onSearch=
{
this
.
handleSearch
}
style=
{
{
width
:
300
}
}
enterButton
/>
</
div
>
<
Table
columns=
{
columns
}
dataSource=
{
exchangeList
&&
exchangeList
.
records
}
rowKey=
{
record
=>
record
.
userId
}
pagination=
{
pagination
}
/>
</
div
>
{
/* 兑换弹窗 */
}
<
Modal
title=
"积分兑换"
visible=
{
this
.
state
.
exchangeModalVisible
}
onOk=
{
this
.
handleExchange
}
onCancel=
{
this
.
hideExchangeModal
}
okText=
"确认兑换"
cancelText=
"取消"
>
<
Button
>
<
Icon
type=
"upload"
/>
导入积分
</
Button
>
</
Upload
>
{
this
.
state
.
selectedUser
&&
(
<
div
>
<
p
>
用户:
{
this
.
state
.
selectedUser
.
name
}
</
p
>
<
p
>
当前积分余额:
<
span
style=
{
{
color
:
'#1890ff'
,
fontWeight
:
'bold'
}
}
>
{
this
.
state
.
selectedUser
.
totalPoint
}
</
span
></
p
>
<
div
style=
{
{
marginTop
:
16
}
}
>
<
label
style=
{
{
display
:
'block'
,
marginBottom
:
8
}
}
>
扣除积分数量:
</
label
>
<
Input
type=
"number"
value=
{
this
.
state
.
deductPoints
}
onChange=
{
(
e
)
=>
this
.
setState
({
deductPoints
:
parseInt
(
e
.
target
.
value
)
||
0
})
}
placeholder=
"请输入要扣除的积分数量"
/>
</
div
>
{
this
.
state
.
fileList
.
length
==
0
?
(
<
div
style=
{
{
color
:
"#ccc"
}
}
>
您还未上传任何数据哦~
</
div
>
)
:
null
}
<
span
>
请上传资源附件(附件格式:xls)
</
span
>
不知道格式?
<
a
href=
"https://fulan-test.oss-cn-hangzhou.aliyuncs.com/test/积分导入模板.xlsx"
>
下载积分模版
</
a
>
</
FormItem
>
)
:
null
}
<
FormItem
{
...
tailFormItemLayout
}
>
<
Button
type=
"primary"
onClick=
{
e
=>
this
.
handleSubmit
(
e
)
}
>
保存
</
Button
>
</
FormItem
>
</
Form
>
</
div
>
)
}
</
Modal
>
</
div
>
);
}
}
const
CurrencyOptionForm
=
Form
.
create
()(
CurrencyOption
);
function
mapStateToProps
(
state
,
ownProps
)
{
return
{
set
:
state
.
point
.
se
t
,
exchangeList
:
state
.
point
.
exchangeLis
t
,
param
:
state
.
uploadParam
.
param
,
};
}
function
mapDispatchToProps
(
dispatch
)
{
return
{
postPointSet
:
(
obj
,
cb
)
=>
dispatch
(
postPointSet
(
obj
,
cb
)),
postPointEdit
:
obj
=>
dispatch
(
postPointEdit
(
obj
)),
excl
:
obj
=>
dispatch
(
excl
(
obj
)),
gupfetch
:
()
=>
dispatch
(
gupfetch
()),
postUserList
:
obj
=>
dispatch
(
postUserList
(
obj
)),
postPointExchange
:
obj
=>
dispatch
(
postPointExchange
(
obj
)),
};
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
CurrencyOption
Form
);
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
CurrencyOption
);
\ No newline at end of file
src/pages/SystemManagement/Point/Detailed.jsx
deleted
100644 → 0
View file @
01dbcb9b
import
React
from
"react"
;
import
{
Form
,
DatePicker
,
Input
,
Button
,
Table
,
Spin
}
from
"antd"
;
import
moment
from
"moment"
;
import
"moment/locale/zh-cn"
;
import
{
connect
}
from
"react-redux"
;
import
{
getPointDetailed
}
from
"./redux/action"
;
import
Breadcrumb
from
"@/common/Breadcrumb"
;
const
{
RangePicker
}
=
DatePicker
;
const
FormItem
=
Form
.
Item
;
//时间格式化
const
dateFormats
=
"YYYY-MM-DD HH:mm:ss"
;
class
Detailed
extends
React
.
Component
{
state
=
{
current
:
"1"
,
pageSize
:
"10"
,
};
componentDidMount
()
{
if
(
history
.
state
.
state
)
{
this
.
props
.
getPointDetailed
({
activityId
:
history
.
state
.
state
.
record
.
id
,
});
}
else
{
this
.
props
.
getPointDetailed
();
}
}
//查询
handleSubmit
=
e
=>
{
// debugger
e
.
preventDefault
();
const
{
// location,
getPointDetailed
}
=
this
.
props
;
this
.
props
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
err
)
console
.
log
(
'11111111111'
,
err
)
//
if
(
!
err
)
{
// if (location.state) {
if
(
history
.
state
.
state
)
{
getPointDetailed
({
// activityId: location.state.record.id,
activityId
:
history
.
state
.
state
.
record
.
id
,
accountName
:
values
.
accountName
,
startTime
:
values
.
time
?
new
Date
(
moment
(
values
.
time
[
0
].
_d
).
format
(
dateFormats
)
).
getTime
()
:
""
,
endTime
:
values
.
time
?
new
Date
(
moment
(
values
.
time
[
1
].
_d
).
format
(
dateFormats
)
).
getTime
()
:
""
,
});
}
else
{
getPointDetailed
({
accountName
:
values
.
accountName
,
startTime
:
values
.
time
?
new
Date
(
moment
(
values
.
time
[
0
].
_d
).
format
(
dateFormats
)
).
getTime
()
:
""
,
endTime
:
values
.
time
?
new
Date
(
moment
(
values
.
time
[
1
].
_d
).
format
(
dateFormats
)
).
getTime
()
:
""
,
});
}
}
});
};
render
()
{
const
that
=
this
;
const
{
form
,
detailed
,
getPointDetailed
,
// location
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
form
;
const
columns
=
[
{
title
:
"时间"
,
dataIndex
:
"time"
,
key
:
"time"
,
render
:
text
=>
{
return
<
span
>
{
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
}
</
span
>;
},
},
{
title
:
"积分"
,
dataIndex
:
"point"
,
key
:
"point"
,
render
:
(
text
,
record
)
=>
{
return
(
<
span
>
{
record
.
flag
==
"1"
?
"+"
:
""
}
{
text
}
</
span
>
);
},
},
{
title
:
"用户名"
,
dataIndex
:
"accountName"
,
key
:
"accountName"
,
render
:
text
=>
{
return
(
<
span
title=
{
text
}
>
{
text
.
length
>
10
?
text
.
substring
(
9
,
0
)
+
"..."
:
text
}
</
span
>
);
},
},
{
title
:
"学习活动类型"
,
dataIndex
:
"learnType"
,
key
:
"learnType"
,
},
{
title
:
"学习活动名称"
,
dataIndex
:
"learnName"
,
key
:
"learnName"
,
render
:
text
=>
{
return
(
<
span
title=
{
text
}
>
{
text
.
length
>
10
?
text
.
substring
(
9
,
0
)
+
"..."
:
text
}
</
span
>
);
},
},
{
title
:
"学习活动来源"
,
dataIndex
:
"learnSource"
,
key
:
"learnSource"
,
},
];
const
pagination
=
{
showQuickJumper
:
true
,
showSizeChanger
:
true
,
total
:
detailed
&&
detailed
.
page
.
pageTotal
,
pageSize
:
detailed
&&
detailed
.
page
.
pageSize
,
showTotal
:
function
()
{
//设置显示一共几条数据
return
detailed
&&
"共计 "
+
detailed
.
page
.
pageTotal
+
" 条"
;
},
// 分页
onShowSizeChange
(
current
,
pageSize
)
{
// if (location.state) {
if
(
history
.
state
.
state
)
{
getPointDetailed
({
// activityId: location.state.record.id,
activityId
:
history
.
state
.
state
.
record
.
id
,
pageNo
:
current
,
pageSize
:
pageSize
,
});
}
else
{
getPointDetailed
({
pageNo
:
current
,
pageSize
:
pageSize
});
}
that
.
setState
({
current
:
current
,
pageSize
:
pageSize
});
},
onChange
(
current
,
pageSize
)
{
// if (location.state) {
if
(
history
.
state
.
state
)
{
getPointDetailed
({
activityId
:
history
.
state
.
state
.
record
.
id
,
pageNo
:
current
,
pageSize
:
pageSize
,
});
}
else
{
getPointDetailed
({
pageNo
:
current
,
pageSize
:
pageSize
});
}
that
.
setState
({
current
:
current
,
pageSize
:
pageSize
});
},
};
return
(
<
div
style=
{
{
padding
:
"0 20px"
}
}
>
<
Breadcrumb
title=
"积分流水明细"
/>
<
Form
layout=
"inline"
onSubmit=
{
this
.
handleSubmit
}
>
<
FormItem
>
{
getFieldDecorator
(
"accountName"
)(
<
Input
placeholder=
"请输入用户名"
/>
)
}
</
FormItem
>
<
FormItem
>
{
getFieldDecorator
(
"time"
)(
<
RangePicker
placeholder=
{
[
"开始时间"
,
"结束时间"
]
}
ranges=
{
{
// Today: [moment(), moment()],
"今天"
:
[
moment
().
startOf
(
'day'
),
moment
().
endOf
(
'day'
)],
//当天零时到当天23时59分59秒 bug-12231-liyuan
// "This Month": [moment(), moment().endOf("month")],
"这个月"
:
[
moment
().
startOf
(
"month"
),
moment
().
endOf
(
"month"
)],
}
}
showTime
format=
"YYYY-MM-DD"
onOk=
{
this
.
onRangePicker
}
/>
)
}
</
FormItem
>
<
FormItem
>
<
Button
type=
"primary"
htmlType=
"submit"
>
查询
</
Button
>
</
FormItem
>
</
Form
>
{
detailed
?
(
<
Table
dataSource=
{
detailed
.
data
}
columns=
{
columns
}
pagination=
{
pagination
}
rowKey=
{
record
=>
record
.
id
}
/>
)
:
(
<
Spin
className=
"cred-spin"
/>
)
}
</
div
>
);
}
}
const
DetailedForm
=
Form
.
create
()(
Detailed
);
function
mapStateToProps
(
state
,
ownProps
)
{
return
{
detailed
:
state
.
point
.
detailed
,
};
}
function
mapDispatchToProps
(
dispatch
)
{
return
{
getPointDetailed
:
obj
=>
dispatch
(
getPointDetailed
(
obj
)),
};
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
DetailedForm
);
src/pages/SystemManagement/Point/EditPointPool.jsx
deleted
100644 → 0
View file @
01dbcb9b
import
React
from
"react"
;
import
{
Button
,
Form
,
Input
,
Radio
,
Switch
,
InputNumber
,
Select
}
from
"antd"
;
import
"./index.less"
;
const
FormItem
=
Form
.
Item
;
const
{
TextArea
}
=
Input
;
const
Option
=
Select
.
Option
;
const
CollectionCreateForm
=
Form
.
create
()(
props
=>
{
const
{
visible
,
onCancel
,
onCreate
,
form
,
editeData
}
=
props
;
const
{
getFieldDecorator
}
=
form
;
const
formItemLayout
=
{
labelCol
:
{
span
:
6
},
wrapperCol
:
{
span
:
14
},
};
function
handleChange
(
value
)
{
console
.
log
(
value
);
// { key: "lucy", label: "Lucy (101)" }
}
return
(
<
Form
layout=
"horizontal"
>
<
FormItem
{
...
formItemLayout
}
label=
"积分池名称"
>
{
getFieldDecorator
(
"title"
,
{
initialValue
:
props
.
editeData
.
name
,
rules
:
[
{
required
:
true
,
message
:
"Please input the title of collection!"
,
},
],
})(<
Input
/>)
}
</
FormItem
>
<
FormItem
{
...
formItemLayout
}
label=
"积分池描述"
>
{
getFieldDecorator
(
"description"
)(<
TextArea
rows=
{
4
}
/>)
}
</
FormItem
>
<
FormItem
{
...
formItemLayout
}
label=
"商城模块开关"
>
{
getFieldDecorator
(
"switch"
,
{
valuePropName
:
"checked"
,
initialValue
:
props
.
editeData
.
flag
===
"启用"
?
true
:
false
,
})(<
Switch
checkedChildren=
"开"
unCheckedChildren=
"关"
/>)
}
</
FormItem
>
<
FormItem
{
...
formItemLayout
}
label=
"积分单位"
>
{
getFieldDecorator
(
"input-number"
,
{
initialValue
:
3
})(
<
InputNumber
min=
{
1
}
max=
{
10
}
/>
)
}
<
span
className=
"ant-form-text"
>
积分
</
span
>
</
FormItem
>
</
Form
>
);
});
class
RegistrationForm
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
searchname
:
""
,
};
// 搜索事件
this
.
onSearch
=
this
.
handleSearch
.
bind
(
this
);
}
//componentWillUnmount(){
// this.props.form.setFieldsValue({
// title:'2'
// })
// }
// 搜索事件
handleSearch
=
event
=>
{
data
.
splice
(
1
,
1
);
this
.
setState
({
data
:
data
,
});
};
render
()
{
const
{
editeData
}
=
this
.
props
;
return
(
<
div
>
<
CollectionCreateForm
editeData=
{
editeData
}
/>
</
div
>
);
}
}
const
EditPointPool
=
Form
.
create
()(
RegistrationForm
);
export
default
EditPointPool
;
src/pages/SystemManagement/Point/ModalForm.jsx
View file @
9fde9c77
...
...
@@ -5,7 +5,29 @@ import moment from "moment";
const
{
RangePicker
}
=
DatePicker
;
const
Option
=
Select
.
Option
;
const
FormItem
=
Form
.
Item
;
// 引入图片裁剪上传组件
import
UploadImageCover
from
"@/common/UploadImageCover"
;
class
activModalForm
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
productImg
:
props
.
record
&&
props
.
record
.
productImg
?
props
.
record
.
productImg
:
""
};
}
// 获取图片URL的回调函数
getImgUrl
=
(
imgUrl
)
=>
{
this
.
setState
({
productImg
:
imgUrl
});
// 同时设置表单字段值
this
.
props
.
form
.
setFieldsValue
({
productImg
:
imgUrl
});
}
render
()
{
const
{
visible
,
...
...
@@ -38,79 +60,61 @@ class activModalForm extends React.Component {
return
(
<
Modal
visible=
{
visible
}
title=
"创建活动策略"
title=
{
type
==
"look"
?
"查看商品"
:
type
==
"edit"
?
"修改商品"
:
"新增商品"
}
okText=
"确定"
onCancel=
{
onCancel
}
onOk=
{
onCreate
}
destroyOnClose
>
<
Form
>
<
FormItem
{
...
formItemLayout
}
label=
"活动名称"
>
{
getFieldDecorator
(
"activityName"
,
{
initialValue
:
record
&&
record
.
activityName
,
{
/* 修改图片字段为支持裁剪的图片上传组件 */
}
<
FormItem
{
...
formItemLayout
}
label=
"图片"
>
{
getFieldDecorator
(
"productImg"
,
{
initialValue
:
record
&&
record
.
productImg
,
rules
:
[
{
required
:
true
,
message
:
"请输入活动名称"
},
{
max
:
200
,
message
:
"活动名称不能超过200个字符!"
},
{
required
:
true
,
message
:
"请上传商品图片"
},
],
})(
<
Input
placeholder=
"请输入活动名称"
<
div
>
<
UploadImageCover
details=
{
record
&&
record
.
productImg
}
getImgUrl=
{
this
.
getImgUrl
}
disabled=
{
type
==
"look"
?
true
:
false
}
preRatio=
{
[
"5/4"
]
}
// 设置图片比例为1:1,适合商品展示
/>
<
div
style=
{
{
marginTop
:
8
,
fontSize
:
12
,
color
:
'#999'
}
}
>
支持jpg、jpeg、png格式,建议尺寸1:1,大小不超过30MB
</
div
>
</
div
>
)
}
</
FormItem
>
<
FormItem
{
...
formItemLayout
}
label=
"活动code"
>
{
getFieldDecorator
(
"code"
,
{
initialValue
:
record
&&
record
.
code
,
rules
:
[{
required
:
true
,
message
:
"请选择活动code"
}],
})(
<
Select
style=
{
{
width
:
"200px"
}
}
placeholder=
"请选择活动code"
>
{
list
}
</
Select
>
)
}
</
FormItem
>
<
FormItem
{
...
formItemLayout
}
label=
"活动类型"
>
{
getFieldDecorator
(
"activityType"
,
{
initialValue
:
record
&&
record
.
activityType
,
<
FormItem
{
...
formItemLayout
}
label=
"商品名称"
>
{
getFieldDecorator
(
"productName"
,
{
initialValue
:
record
&&
record
.
productName
,
rules
:
[
{
required
:
true
,
message
:
"请输入
活动类型
"
},
{
max
:
200
,
message
:
"活动类型不能超过20
0个字符!"
},
{
required
:
true
,
message
:
"请输入
商品名称
"
},
{
max
:
50
,
message
:
"商品名称不能超过5
0个字符!"
},
],
})(
<
Input
placeholder=
"请输入
活动类型
"
placeholder=
"请输入
商品名称
"
disabled=
{
type
==
"look"
?
true
:
false
}
/>
)
}
</
FormItem
>
<
FormItem
{
...
formItemLayout
}
label=
"积分翻倍"
>
{
getFieldDecorator
(
"multiple"
,
{
initialValue
:
record
&&
record
.
multiple
,
rules
:
[{
required
:
true
,
message
:
"请输入翻倍数"
}],
})(
<
InputNumber
min=
{
2
}
disabled=
{
type
==
"look"
?
true
:
false
}
/>
)
}
</
FormItem
>
<
FormItem
{
...
formItemLayout
}
label=
"活动时间"
>
{
getFieldDecorator
(
"time"
,
{
initialValue
:
record
&&
[
moment
(
record
.
startTime
),
moment
(
record
.
endTime
),
],
<
FormItem
{
...
formItemLayout
}
label=
"所需积分"
>
{
getFieldDecorator
(
"point"
,
{
initialValue
:
record
&&
record
.
point
,
rules
:
[
{
type
:
"array"
,
required
:
true
,
message
:
"请输入活动时间!"
},
{
required
:
true
,
message
:
"请输入所需积分"
},
{
type
:
'number'
,
min
:
1
,
message
:
'积分必须大于0'
},
],
})(
<
RangePicker
placeholder=
{
[
"开始时间"
,
"结束时间"
]
}
ranges=
{
{
今天
:
[
moment
(),
moment
().
endOf
(
"month"
)],
这个月
:
[
moment
().
startOf
(
"month"
),
moment
().
endOf
(
"month"
)],
}
}
//bug-11250-liyuan 积分管理 -积分活动策略 时间控件的问题
showTime
format=
"YYYY-MM-DD HH:mm:ss"
onOk=
{
this
.
onRangePicker
}
<
InputNumber
placeholder=
"请输入所需积分"
disabled=
{
type
==
"look"
?
true
:
false
}
min=
{
1
}
style=
{
{
width
:
'100%'
}
}
/>
)
}
</
FormItem
>
...
...
src/pages/SystemManagement/Point/PointPool.jsx
deleted
100644 → 0
View file @
01dbcb9b
import
React
from
"react"
;
import
{
Button
,
Table
,
Icon
,
Select
,
Input
,
Divider
,
Popconfirm
,
Modal
,
}
from
"antd"
;
import
Styles
from
"./index.less"
;
import
EditPointPool
from
"./EditPointPool.jsx"
;
const
Option
=
Select
.
Option
;
const
data
=
[
{
key
:
"1"
,
name
:
"太保总公司积分商城"
,
start
:
"是"
,
flag
:
"启用"
,
},
{
key
:
"2"
,
name
:
"太保总公司积分商城"
,
start
:
"否"
,
flag
:
"停用"
,
},
{
key
:
"3"
,
name
:
"平安总公司积分商城"
,
start
:
"否"
,
flag
:
"启用"
,
},
];
for
(
var
value
of
data
)
{
console
.
log
(
value
.
flag
);
}
class
PointPool
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
searchName
:
""
,
editeData
:
[],
data
:
data
,
};
this
.
columns
=
[
{
title
:
"积分池名称"
,
dataIndex
:
"name"
,
key
:
"name"
,
render
:
text
=>
{
return
(
<
span
title=
{
text
}
>
{
text
.
length
>
10
?
text
.
substring
(
9
,
0
)
+
"..."
:
text
}
</
span
>
);
},
},
{
title
:
"是否独立商城"
,
dataIndex
:
"start"
,
key
:
"start"
,
},
{
title
:
"是否独立商城"
,
dataIndex
:
"flag"
,
key
:
"flag"
,
},
{
title
:
"操作"
,
key
:
"action"
,
render
:
(
text
,
record
,
index
)
=>
(
<
span
>
<
a
href=
"#"
data
-
index=
{
index
}
onClick=
{
()
=>
this
.
handleEdit
(
record
)
}
>
编辑
</
a
>
<
Divider
type=
"vertical"
/>
{
record
.
flag
===
"启用"
?
(
<
Popconfirm
title=
"确定要停用吗?"
okText=
"确定"
cancelText=
"取消"
onConfirm=
{
()
=>
this
.
handleStart
(
record
.
key
)
}
>
<
a
href=
"#"
>
停用
</
a
>
</
Popconfirm
>
)
:
(
<
Popconfirm
title=
"确定要启用吗?"
okText=
"确定"
cancelText=
"取消"
onConfirm=
{
()
=>
this
.
handleStop
(
record
.
key
)
}
>
<
a
href=
"#"
>
启用
</
a
>
</
Popconfirm
>
)
}
<
Divider
type=
"vertical"
/>
<
a
href=
"#"
data
-
index=
{
index
}
>
活动策略
</
a
>
<
Divider
type=
"vertical"
/>
<
a
href=
"#"
data
-
index=
{
index
}
>
发放积分配置
</
a
>
<
Divider
type=
"vertical"
/>
<
a
href=
"#"
data
-
index=
{
index
}
>
积分明细
</
a
>
</
span
>
),
},
];
// 搜索事件
this
.
onSearch
=
this
.
handleSearch
.
bind
(
this
);
// 搜索框输入
this
.
onChange
=
this
.
handleChange
.
bind
(
this
);
// 弹出对话框
this
.
onShowModal
=
this
.
showModal
.
bind
(
this
);
// 关闭对话框
this
.
onHideModal
=
this
.
hideModal
.
bind
(
this
);
// 编辑对话框
this
.
onEditModal
=
this
.
editModal
.
bind
(
this
);
}
// 搜索事件
handleSearch
=
event
=>
{
data
.
splice
(
1
,
1
);
this
.
setState
({
data
:
data
,
});
};
// 搜索框输入
handleChange
=
event
=>
{
this
.
setState
({
searchName
:
event
.
target
.
value
});
};
// 搜索框输入
handleStop
=
key
=>
{
console
.
log
(
key
);
};
// 停用规则
handleStart
=
key
=>
{
console
.
log
(
key
);
};
// 编辑积分池
handleEdit
=
record
=>
{
this
.
setState
({
editeData
:
record
});
this
.
onShowModal
();
};
showModal
=
e
=>
{
this
.
setState
({
visible
:
true
,
type
:
"edit"
,
title
:
"编辑积分池"
,
width
:
"30rem"
,
footer
:
"打*号必须填"
,
clear
:
"false"
,
key
:
"2222"
,
});
};
hideModal
=
e
=>
{
this
.
setState
({
visible
:
false
,
});
};
editModal
=
e
=>
{};
render
()
{
const
columns
=
this
.
columns
;
return
(
<
div
className=
{
Styles
.
list
}
>
<
div
className=
{
Styles
.
listBtn
}
>
<
div
>
<
Input
placeholder=
"请输入项目名称"
value=
{
this
.
state
.
searchName
}
onChange=
{
this
.
onChange
}
style=
{
{
width
:
200
,
marginRight
:
10
}
}
/>
<
Button
type=
"primary"
onClick=
{
this
.
onSearch
}
>
搜索
</
Button
>
</
div
>
</
div
>
<
Table
columns=
{
columns
}
dataSource=
{
this
.
state
.
data
}
/>
<
Modal
key=
{
this
.
state
.
key
}
title=
{
this
.
state
.
title
}
visible=
{
this
.
state
.
visible
}
onOk=
{
this
.
onHideModal
}
onCancel=
{
this
.
onHideModal
}
footer=
{
[
<
p
className=
"comond"
key=
"comond"
>
{
this
.
state
.
footer
}
</
p
>,
<
Button
key=
"back"
size=
"large"
onClick=
{
this
.
onHideModal
}
>
取消
</
Button
>,
<
Button
key=
"submit"
type=
"primary"
size=
"large"
onClick=
{
this
.
onEditModal
}
>
保存
</
Button
>,
]
}
>
<
div
>
<
EditPointPool
editeData=
{
this
.
state
.
editeData
}
/>
</
div
>
</
Modal
>
</
div
>
);
}
}
export
default
PointPool
;
src/pages/SystemManagement/Point/exchangeForOption/index.jsx
deleted
100644 → 0
View file @
01dbcb9b
import
React
,
{
Component
}
from
'react'
;
import
{
Icon
,
Switch
,
Tabs
}
from
"antd"
;
import
Styles
from
"./style.less"
;
import
IntegralExchangeSetting
from
"./integralExchangeSetting"
;
import
TradingLogs
from
"./tradingLogs"
;
import
intl
from
"react-intl-universal"
;
import
{
connect
}
from
"react-redux"
;
import
{
getExchangeSwitch
,
turnOnOrOffSwitch
}
from
"../redux/action"
;
import
Breadcrumb
from
"@/common/Breadcrumb"
;
const
{
TabPane
}
=
Tabs
;
class
PointExchangeOption
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
integralChecked
:
false
,
activeKey
:
"2"
,
refreshConfigCard
:
""
}
}
componentDidMount
()
{
let
_this
=
this
;
this
.
props
.
getExchangeSwitch
({
type
:
10
},
()
=>
{
const
{
switchList
}
=
_this
.
props
;
let
result
=
false
;
if
(
switchList
.
length
&&
switchList
.
length
>
0
)
{
let
resultArr
=
switchList
.
filter
(
item
=>
{
return
parseInt
(
item
.
type
)
==
10
;
});
if
(
resultArr
.
length
>
0
)
{
result
=
resultArr
[
0
].
tokenSwitch
||
false
;
}
}
_this
.
setState
({
integralChecked
:
result
,
activeKey
:
result
?
"1"
:
"2"
,
refreshConfigCard
:
new
Date
().
getTime
()
});
});
}
getExchangeConfig
=
(
type
,
checked
)
=>
{
switch
(
type
)
{
case
"integral"
:
this
.
props
.
turnOnOrOffSwitch
({
type
:
10
,
tokenSwitchBol
:
checked
});
this
.
setState
({
integralChecked
:
checked
,
activeKey
:
checked
?
"1"
:
"2"
,
});
break
;
}
}
tabChange
=
(
activeKey
)
=>
{
this
.
setState
({
activeKey
});
}
render
()
{
const
{
integralChecked
,
activeKey
,
refreshConfigCard
}
=
this
.
state
;
return
<
div
className=
{
Styles
.
exchangeContainer
}
>
<
Breadcrumb
title=
{
intl
.
get
(
"exchangeConfigText23"
)
}
/>
<
div
className=
{
Styles
.
exchangeConfigContainer
}
>
<
div
className=
{
Styles
.
exchangeConfigArea
}
>
<
ExchangeConfigItem
key=
{
refreshConfigCard
}
icon=
{
<
Icon
type=
"pay-circle"
/>
}
data=
{
{
type
:
"integral"
,
name
:
intl
.
get
(
"exchangeConfigText1"
),
desc
:
intl
.
get
(
"exchangeConfigText2"
)
}
}
defaultChecked=
{
integralChecked
}
onChange=
{
this
.
getExchangeConfig
}
/>
</
div
>
</
div
>
<
div
className=
{
Styles
.
exchangeTabsContainer
}
>
<
Tabs
activeKey=
{
activeKey
}
onChange=
{
this
.
tabChange
}
tabBarStyle=
{
{
marginBottom
:
0
}
}
>
{
integralChecked
?
<
TabPane
tab=
{
intl
.
get
(
"exchangeConfigText3"
)
}
key=
"1"
>
<
div
style=
{
{
width
:
"100%"
,
height
:
15
,
backgroundColor
:
"#F0F2F5"
}
}
></
div
>
<
IntegralExchangeSetting
/>
</
TabPane
>
:
""
}
<
TabPane
tab=
{
intl
.
get
(
"exchangeConfigText4"
)
}
key=
"2"
>
<
div
style=
{
{
width
:
"100%"
,
height
:
15
,
backgroundColor
:
"#F0F2F5"
}
}
></
div
>
<
TradingLogs
tabKey=
{
activeKey
}
/>
</
TabPane
>
</
Tabs
>
</
div
>
</
div
>;
}
}
function
mapStateToProps
(
state
,
ownProps
)
{
return
{
switchList
:
state
.
point
.
exchangeSwitchStatusList
,
};
}
function
mapDispatchToProps
(
dispatch
)
{
return
{
getExchangeSwitch
:
(
obj
,
callback
)
=>
dispatch
(
getExchangeSwitch
(
obj
,
callback
)),
turnOnOrOffSwitch
:
(
obj
,
callback
)
=>
dispatch
(
turnOnOrOffSwitch
(
obj
,
callback
)),
};
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
PointExchangeOption
);
const
ExchangeConfigItem
=
({
icon
,
data
,
defaultChecked
,
onChange
})
=>
{
return
<
div
className=
{
Styles
.
exchangeConfigItem
}
>
<
div
className=
{
Styles
.
exchangeConfigIcon
}
>
{
icon
}
</
div
>
<
div
className=
{
Styles
.
exchangeConfigInfo
}
>
<
div
className=
{
Styles
.
exchangeConfigName
}
>
{
data
.
name
}
</
div
>
<
div
className=
{
Styles
.
exchangeConfigDesc
}
>
{
data
.
desc
}
</
div
>
</
div
>
<
div
className=
{
Styles
.
exchangeConfigSwitch
}
>
<
Switch
checkedChildren=
"ON"
unCheckedChildren=
"OFF"
checked=
{
defaultChecked
}
onChange=
{
(
checked
)
=>
onChange
(
data
.
type
,
checked
)
}
/>
</
div
>
</
div
>;
}
\ No newline at end of file
src/pages/SystemManagement/Point/exchangeForOption/integralExchangeSetting.jsx
deleted
100644 → 0
View file @
01dbcb9b
import
React
,
{
Component
}
from
'react'
;
import
{
Form
,
Input
,
Radio
,
Select
,
Button
,
message
}
from
"antd"
;
import
Styles
from
"./style.less"
;
import
intl
from
"react-intl-universal"
;
import
{
connect
}
from
"react-redux"
;
import
{
saveExchangeRule
,
getExchangeRule
}
from
"../redux/action"
;
const
exchangeLimitTypeCodeArr
=
[
""
,
"ALLTIME"
,
"DAY"
,
"WEEK"
,
"MONTH"
,
"QUARTER"
,
"HALFYEAR"
,
"YEAR"
];
class
IntegralExchangeSetting
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
virtualCurrencyName
:
""
,
proportionNumber
:
1
,
exchangeLimit
:
1
,
exchangeLimitType
:
"1"
,
exchangeLimitNumber
:
1
,
}
}
componentDidMount
()
{
let
_this
=
this
;
this
.
props
.
getExchangeRule
(()
=>
{
const
{
exchangeRule
}
=
_this
.
props
;
console
.
log
(
exchangeRule
);
_this
.
setState
({
virtualCurrencyName
:
exchangeRule
.
tokenName
||
""
,
proportionNumber
:
exchangeRule
.
rate
||
1
,
exchangeLimit
:
exchangeRule
.
exchangeCondition
?
2
:
1
,
exchangeLimitType
:
String
(
exchangeLimitTypeCodeArr
.
indexOf
(
exchangeRule
.
ruleType
||
"ALLTIME"
)
),
exchangeLimitNumber
:
exchangeRule
.
ruleTokenCount
||
1
})
});
}
handleSettingSubmit
=
(
e
)
=>
{
e
.
preventDefault
();
let
_this
=
this
;
this
.
props
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
const
{
proportionNumber
,
exchangeLimitNumber
,
exchangeLimitType
,
exchangeLimit
}
=
_this
.
state
;
let
param
=
{
exchangeCondition
:
exchangeLimit
==
1
?
false
:
true
,
rate
:
proportionNumber
,
tokenName
:
values
.
virtualCurrencyName
}
if
(
exchangeLimit
!=
1
)
{
param
.
conditionRuleType
=
exchangeLimitTypeCodeArr
[
parseInt
(
exchangeLimitType
)];
param
.
conditionRuleTokenCount
=
exchangeLimitNumber
;
}
_this
.
props
.
saveExchangeRule
(
param
,
(
res
)
=>
{
if
(
res
.
code
==
"1000"
)
{
message
.
success
(
"SavedSuccessfully!"
);
}
});
console
.
log
(
param
)
}
})
}
getProportionNumber
=
(
e
)
=>
{
let
numberValue
=
parseInt
(
e
.
target
.
value
);
if
(
isNaN
(
numberValue
))
{
this
.
setState
({
proportionNumber
:
1
});
}
else
{
if
(
numberValue
<=
0
){
numberValue
=
1
;
}
this
.
setState
({
proportionNumber
:
Math
.
ceil
(
numberValue
)
});
}
}
getExchangeLimitNumber
=
(
e
)
=>
{
let
numberValue
=
parseInt
(
e
.
target
.
value
);
if
(
isNaN
(
numberValue
))
{
this
.
setState
({
exchangeLimitNumber
:
1
});
}
else
{
if
(
numberValue
<=
0
){
numberValue
=
1
;
}
this
.
setState
({
exchangeLimitNumber
:
Math
.
ceil
(
numberValue
)
});
}
}
getExchangeLimitMode
=
(
e
)
=>
{
this
.
setState
({
exchangeLimit
:
parseInt
(
e
.
target
.
value
)
})
}
getExchangeLimitType
=
(
value
)
=>
{
this
.
setState
({
exchangeLimitType
:
value
})
}
render
()
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
5
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
19
},
},
};
const
{
virtualCurrencyName
,
proportionNumber
,
exchangeLimitNumber
,
exchangeLimit
,
exchangeLimitType
}
=
this
.
state
;
return
<
div
className=
{
Styles
.
exchangeTabsContentContainer
}
>
<
div
className=
{
Styles
.
payByIntegralTitle
}
>
{
intl
.
get
(
"exchangeConfigText6"
)
}
</
div
>
<
Form
{
...
formItemLayout
}
onSubmit=
{
this
.
handleSettingSubmit
}
>
<
Form
.
Item
label=
{
intl
.
get
(
"exchangeConfigText5"
)
}
>
{
getFieldDecorator
(
'virtualCurrencyName'
,
{
rules
:
[
{
required
:
true
,
message
:
intl
.
get
(
"exchangeConfigText7"
),
},
{
max
:
3
,
message
:
intl
.
get
(
"exchangeConfigText7"
)
}
],
initialValue
:
virtualCurrencyName
})(<
Input
style=
{
{
width
:
680
}
}
placeholder=
{
intl
.
get
(
"exchangeConfigText7"
)
}
/>)
}
</
Form
.
Item
>
<
Form
.
Item
label=
{
intl
.
get
(
"exchangeConfigText8"
)
}
>
{
getFieldDecorator
(
'proportion'
,
{
rules
:
[
{
required
:
true
,
message
:
intl
.
get
(
"exchangeConfigText7"
),
}
],
initialValue
:
proportionNumber
})(
<
Input
type=
"hidden"
/>
)
}
<
Input
type=
"number"
step=
{
1
}
style=
{
{
width
:
150
}
}
min=
{
1
}
onChange=
{
this
.
getProportionNumber
}
value=
{
proportionNumber
}
addonAfter=
{
intl
.
get
(
"SystemAdmin42"
)
}
/>
<
span
style=
{
{
marginLeft
:
15
,
marginRight
:
15
}
}
>
:
</
span
>
<
Input
type=
"number"
style=
{
{
width
:
150
}
}
value=
{
1
}
disabled
addonAfter=
{
intl
.
get
(
"exchangeConfigText9"
)
}
/>
<
br
/>
<
span
>
{
intl
.
get
(
"exchangeConfigText10"
)
}
</
span
>
</
Form
.
Item
>
<
Form
.
Item
label=
{
intl
.
get
(
"exchangeConfigText11"
)
}
>
{
getFieldDecorator
(
'range'
,
{
rules
:
[
{
required
:
true
,
message
:
""
,
},
],
initialValue
:
1
})(
<
Radio
checked
disabled
>
{
intl
.
get
(
"exchangeConfigText12"
)
}
</
Radio
>
)
}
</
Form
.
Item
>
<
Form
.
Item
label=
{
intl
.
get
(
"exchangeConfigText13"
)
}
>
{
getFieldDecorator
(
'exchangeConfig'
,
{
rules
:
[
{
required
:
true
,
message
:
""
,
},
],
initialValue
:
exchangeLimit
})(
<
Input
type=
"hidden"
/>
)
}
<
Radio
.
Group
onChange=
{
this
.
getExchangeLimitMode
}
value=
{
exchangeLimit
}
>
<
Radio
value=
{
1
}
>
{
intl
.
get
(
"exchangeConfigText14"
)
}
</
Radio
>
<
Radio
value=
{
2
}
></
Radio
>
</
Radio
.
Group
>
<
Select
value=
{
exchangeLimitType
}
style=
{
{
width
:
350
}
}
onChange=
{
this
.
getExchangeLimitType
}
disabled=
{
exchangeLimit
==
1
?
true
:
false
}
>
<
Select
.
Option
value=
"1"
>
{
intl
.
get
(
"exchangeConfigText22"
)
}
</
Select
.
Option
>
<
Select
.
Option
value=
"2"
>
{
intl
.
get
(
"exchangeConfigText16"
)
}
</
Select
.
Option
>
<
Select
.
Option
value=
"3"
>
{
intl
.
get
(
"exchangeConfigText17"
)
}
</
Select
.
Option
>
<
Select
.
Option
value=
"4"
>
{
intl
.
get
(
"exchangeConfigText18"
)
}
</
Select
.
Option
>
<
Select
.
Option
value=
"5"
>
{
intl
.
get
(
"exchangeConfigText19"
)
}
</
Select
.
Option
>
<
Select
.
Option
value=
"6"
>
{
intl
.
get
(
"exchangeConfigText20"
)
}
</
Select
.
Option
>
<
Select
.
Option
value=
"7"
>
{
intl
.
get
(
"exchangeConfigText21"
)
}
</
Select
.
Option
>
</
Select
>
{
exchangeLimit
!=
1
?
<
Input
type=
"number"
step=
{
1
}
style=
{
{
width
:
150
,
marginLeft
:
15
}
}
min=
{
1
}
onChange=
{
this
.
getExchangeLimitNumber
}
value=
{
exchangeLimitNumber
}
addonAfter=
{
intl
.
get
(
"exchangeConfigText9"
)
}
/>
:
""
}
<
br
/>
<
Button
style=
{
{
marginTop
:
30
}
}
type=
"primary"
htmlType=
"submit"
>
{
intl
.
get
(
"Save"
)
}
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>;
}
}
function
mapStateToProps
(
state
,
ownProps
)
{
return
{
exchangeSwitchStatus
:
state
.
point
.
exchangeSwitchStatus
,
exchangeRule
:
state
.
point
.
exchangeRule
,
};
}
function
mapDispatchToProps
(
dispatch
)
{
return
{
saveExchangeRule
:
(
obj
,
callback
)
=>
dispatch
(
saveExchangeRule
(
obj
,
callback
)),
getExchangeRule
:
(
callback
)
=>
dispatch
(
getExchangeRule
(
callback
)),
};
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
Form
.
create
()(
IntegralExchangeSetting
));
\ No newline at end of file
src/pages/SystemManagement/Point/exchangeForOption/style.less
deleted
100644 → 0
View file @
01dbcb9b
.exchangeContainer {
width: 100%;
.exchangeConfigContainer {
width: 100%;
height: 258px;
border-bottom: 1px solid #F0F0F0;
padding: 24px 16px 0 16px;
.exchangeConfigArea {
width: 100%;
height: 218px;
.exchangeConfigItem {
width: 32%;
height: 218px;
background-color: rgba(66, 133, 244, 0.05);
padding-top: 24px;
padding-right: 16px;
padding-left: 96px;
position: relative;
.exchangeConfigIcon {
width: 96px;
height: 218px;
position: absolute;
left: 0;
top: 0;
text-align: center;
font-size: 56px;
padding-top: 52px;
}
.exchangeConfigSwitch {
position: absolute;
right: 18px;
bottom: 26px;
}
.exchangeConfigInfo {
width: 100%;
.exchangeConfigName {
width: 100%;
height: 28px;
line-height: 28px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
font-size: 20px;
}
.exchangeConfigDesc {
width: 100%;
line-height: 20px;
color: rgba(0, 0, 0, 0.45);
font-weight: 500;
font-size: 14px;
margin-top: 16px;
text-align: justify;
}
}
}
}
}
.exchangeTabsContainer {
width: 100%;
.exchangeTabsContentContainer {
width: 100%;
.payByIntegralTitle {
width: 100%;
padding-left: 32px;
padding-top: 33px;
line-height: 24px;
font-size: 16px;
color: #000;
font-weight: 400;
}
}
}
.tradingLogsContainer {
width: 100%;
padding: 16px;
background-color: white;
.list_btn {
margin-bottom: 16px;
}
}
}
.tradingLogsFilter {
width: 470px;
height: 208px;
background-color: #fff;
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.2);
border-radius: 2px;
padding-top: 15px;
.tradingLogsFilterBtns {
width: 100%;
text-align: center;
}
}
src/pages/SystemManagement/Point/exchangeForOption/tradingLogs.jsx
deleted
100644 → 0
View file @
01dbcb9b
import
React
,
{
Component
}
from
'react'
;
import
Styles
from
"./style.less"
;
import
{
connect
}
from
"react-redux"
;
import
{
Button
,
Table
,
Input
,
Icon
,
message
,
Dropdown
}
from
"antd"
;
import
{
getTradingLogs
,
exportTradingLogs
}
from
"../redux/action"
;
import
TradingLogsFilter
from
"./tradingLogsFilter"
;
import
intl
from
"react-intl-universal"
;
import
func
from
"../../../../util/commonFunc"
;
const
tradingTypeArr
=
{
"100"
:
intl
.
get
(
"exchangeConfigText37"
),
"110"
:
intl
.
get
(
"exchangeConfigText38"
),
"120"
:
intl
.
get
(
"exchangeConfigText39"
),
"180"
:
intl
.
get
(
"exchangeConfigText40"
),
"181"
:
intl
.
get
(
"exchangeConfigText41"
),
"182"
:
intl
.
get
(
"exchangeConfigText42"
),
"200"
:
intl
.
get
(
"exchangeConfigText43"
),
"210"
:
intl
.
get
(
"exchangeConfigText44"
),
"280"
:
intl
.
get
(
"exchangeConfigText45"
),
"281"
:
intl
.
get
(
"exchangeConfigText46"
),
"282"
:
intl
.
get
(
"exchangeConfigText47"
),
"300"
:
intl
.
get
(
"exchangeConfigText48"
),
};
class
TradingLogs
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
tradingLogsKeyword
:
""
,
pageNo
:
1
,
pageSize
:
10
,
tradingType
:
"1"
,
startTime
:
""
,
endTime
:
""
,
tradingLogsTotal
:
0
,
selectedKeys
:
[],
dropDownVisible
:
false
};
// 列名
this
.
columns
=
[
{
title
:
intl
.
get
(
"UserName"
),
dataIndex
:
"username"
,
key
:
"username"
,
render
:
(
text
,
record
)
=>
{
return
<
span
>
{
text
.
length
>
14
?
text
.
slice
(
0
,
14
)
+
"..."
:
text
}
</
span
>
}
},
{
title
:
intl
.
get
(
"Name"
),
dataIndex
:
"name"
,
key
:
"name"
,
render
:
(
text
,
record
)
=>
{
return
<
span
>
{
text
.
length
>
14
?
text
.
slice
(
0
,
14
)
+
"..."
:
text
}
</
span
>
}
},
{
title
:
intl
.
get
(
"exchangeConfigText26"
),
dataIndex
:
"tradingTime"
,
key
:
"tradingTime"
,
},
{
title
:
intl
.
get
(
"exchangeConfigText27"
),
dataIndex
:
"tradingNo"
,
key
:
"tradingNo"
,
render
:
text
=>
(
<
span
>
{
text
}
</
span
>
),
},
{
title
:
intl
.
get
(
"exchangeConfigText28"
),
dataIndex
:
"type"
,
key
:
"type"
,
render
:
text
=>
(
<
span
>
{
tradingTypeArr
[
String
(
text
)]
}
</
span
>
),
},
{
title
:
intl
.
get
(
"Remark"
),
dataIndex
:
"remark"
,
key
:
"remark"
,
render
:
text
=>
text
,
},
,
{
title
:
intl
.
get
(
"exchangeConfigText29"
),
dataIndex
:
"costNumber"
,
key
:
"costNumber"
,
render
:
text
=>
{
return
parseInt
(
text
)
>
0
?
"+"
+
text
:
text
;
},
},
];
}
componentDidMount
()
{
this
.
getTradingLogsList
(
1
);
}
componentWillReceiveProps
(
nextProps
)
{
if
(
nextProps
.
tabKey
!=
this
.
props
.
tabKey
){
this
.
setState
({
dropDownVisible
:
false
})
}
}
//TODO 根据页码获取消费充值列表
getTradingLogsList
(
page
)
{
const
{
getTradingLogs
}
=
this
.
props
;
const
{
pageSize
,
tradingLogsKeyword
,
startTime
,
endTime
,
tradingType
}
=
this
.
state
;
let
_this
=
this
;
let
params
=
{
pageNo
:
page
,
pageSize
:
pageSize
,
kwd
:
tradingLogsKeyword
.
trim
(),
};
if
(
tradingType
!=
"1"
)
{
params
.
type
=
parseInt
(
tradingType
);
}
if
(
startTime
)
{
params
.
startAt
=
startTime
;
}
if
(
endTime
)
{
params
.
endAt
=
endTime
;
}
console
.
log
(
params
);
getTradingLogs
(
params
,
()
=>
{
const
{
tradingLogs
,
tradingLogsTotal
}
=
_this
.
props
;
let
arr
=
[];
arr
=
tradingLogs
&&
tradingLogs
.
map
((
item
,
index
)
=>
{
return
{
key
:
item
.
orderId
,
id
:
item
.
orderId
,
username
:
item
.
name
,
name
:
item
.
fullName
,
tradingTime
:
item
.
createdAt
,
tradingNo
:
item
.
orderId
,
type
:
item
.
type
,
remark
:
item
.
remark
,
costNumber
:
item
.
count
}
});
this
.
setState
({
tradingLogsLists
:
arr
,
tradingLogsTotal
:
tradingLogsTotal
,
pageNo
:
page
});
});
}
// TODO 获取关键词
handleGetValue
=
e
=>
{
const
{
value
}
=
e
.
target
;
this
.
setState
({
tradingLogsKeyword
:
value
,
});
};
// TODO 根据相关数据进行搜索
handleSearch
=
()
=>
{
this
.
getTradingLogsList
(
1
);
};
//TODO 导出明细
exportTradingLogs
=
()
=>
{
const
{
exportTradingLogs
}
=
this
.
props
;
const
{
tradingLogsKeyword
,
startTime
,
endTime
,
tradingType
}
=
this
.
state
;
let
params
=
{
kwd
:
tradingLogsKeyword
.
trim
(),
};
if
(
tradingType
!=
"1"
)
{
params
.
type
=
parseInt
(
tradingType
);
}
if
(
startTime
)
{
params
.
startAt
=
startTime
;
}
if
(
endTime
)
{
params
.
endAt
=
endTime
;
}
exportTradingLogs
(
params
,
(
data
)
=>
{
if
(
data
.
code
==
"1000"
){
message
.
success
(
"导出成功,"
+
data
.
data
);
}
});
}
// TODO 页面大小切换
pageSizeChange
=
(
page
,
size
)
=>
{
let
_this
=
this
;
this
.
setState
({
pageSize
:
size
},
()
=>
{
_this
.
getTradingLogsList
(
1
);
});
}
// TODO 页码切换
pageChange
=
(
page
,
size
)
=>
{
this
.
getTradingLogsList
(
page
);
}
dropDownClick
=
(
e
)
=>
{
e
.
preventDefault
();
const
{
dropDownVisible
}
=
this
.
state
;
this
.
setState
({
dropDownVisible
:
!
dropDownVisible
})
}
dropDownClose
=
()
=>
{
this
.
setState
({
dropDownVisible
:
false
})
}
//TODO 获取高级检索相关数据进行搜索
advancedSearch
=
(
data
)
=>
{
const
{
startTime
,
endTime
,
tradingType
}
=
data
;
let
_this
=
this
;
this
.
setState
({
startTime
,
endTime
,
tradingType
},
()
=>
{
_this
.
getTradingLogsList
(
1
);
});
}
render
()
{
const
{
tradingLogsLists
,
tradingLogsTotal
,
pageSize
,
pageNo
}
=
this
.
state
;
let
pagination
=
{
showQuickJumper
:
true
,
showSizeChanger
:
true
,
pageSizeOptions
:
[
"10"
,
"20"
,
"50"
,
"100"
],
total
:
tradingLogsTotal
,
showTotal
:
total
=>
`共计
${
total
}
条`
,
PageSize
:
pageSize
,
current
:
pageNo
,
onShowSizeChange
:
this
.
pageSizeChange
,
onChange
:
this
.
pageChange
};
// 默认栏目
const
{
columns
}
=
this
;
const
searchBtnStyle
=
{
marginRight
:
10
,
marginBottom
:
10
};
return
(
<
div
className=
{
Styles
.
tradingLogsContainer
}
>
{
/* 展示头部 */
}
<
div
className=
{
Styles
.
list_btn
}
>
<
div
>
<
Input
.
Search
placeholder=
{
intl
.
get
(
"exchangeConfigText24"
)
}
style=
{
{
width
:
250
,
...
searchBtnStyle
}
}
onChange=
{
this
.
handleGetValue
}
onSearch=
{
this
.
handleSearch
}
/>
<
Dropdown
trigger=
{
[
"click"
]
}
placement=
{
"bottomCenter"
}
overlay=
{
<
TradingLogsFilter
dropDownClose=
{
this
.
dropDownClose
}
advancedSearch=
{
this
.
advancedSearch
}
/>
}
visible=
{
this
.
state
.
dropDownVisible
}
>
<
a
className=
"ant-dropdown-link"
style=
{
{
lineHeight
:
"30px"
}
}
onClick=
{
this
.
dropDownClick
}
>
{
intl
.
get
(
"advancedSearch"
)
}
<
Icon
type=
"down"
/>
</
a
>
</
Dropdown
>
<
Button
onClick=
{
this
.
exportTradingLogs
}
style=
{
{
float
:
"right"
,
...
searchBtnStyle
}
}
>
{
intl
.
get
(
"exchangeConfigText25"
)
}
</
Button
>
</
div
>
</
div
>
{
/* 消费充值列表 */
}
<
Table
style=
{
{
marginLeft
:
20
,
marginRight
:
20
,
marginTop
:
10
}
}
columns=
{
columns
}
dataSource=
{
tradingLogsLists
}
pagination=
{
pagination
}
/>
</
div
>
);
}
}
function
mapStateToProps
(
state
,
ownProps
)
{
return
{
tradingLogs
:
state
.
point
.
tradingLogs
,
tradingLogsTotal
:
state
.
point
.
tradingLogsTotal
,
};
}
function
mapDispatchToProps
(
dispatch
)
{
return
{
getTradingLogs
:
(
obj
,
callback
)
=>
dispatch
(
getTradingLogs
(
obj
,
callback
)),
exportTradingLogs
:
(
obj
,
callback
)
=>
dispatch
(
exportTradingLogs
(
obj
,
callback
)),
};
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
TradingLogs
);
src/pages/SystemManagement/Point/exchangeForOption/tradingLogsFilter.jsx
deleted
100644 → 0
View file @
01dbcb9b
import
React
,
{
Component
}
from
'react'
;
import
styles
from
"./style.less"
;
import
{
Form
,
Select
,
DatePicker
,
Button
}
from
"antd"
;
const
Option
=
Select
.
Option
;
const
RangePicker
=
DatePicker
.
RangePicker
;
import
intl
from
"react-intl-universal"
;
class
TradingLogsFilter
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
tradingType
:
"1"
,
startTime
:
""
,
endTime
:
""
,
refreshFilter
:
""
}
}
//获取交易类型
handleTradingType
=
(
value
)
=>
{
this
.
setState
({
tradingType
:
value
,
});
}
handleGetDateRange
=
(
dates
,
dateStrings
)
=>
{
if
(
dates
.
length
==
0
)
{
this
.
setState
({
startTime
:
""
,
endTime
:
""
});
}
}
handleDateRangeOk
=
(
dates
)
=>
{
if
(
dates
.
length
>=
2
)
{
let
startTime
=
dates
[
0
].
valueOf
();
let
endTime
=
dates
[
1
].
valueOf
();
this
.
setState
({
startTime
,
endTime
});
}
}
searchByData
=
()
=>
{
this
.
props
.
advancedSearch
(
this
.
state
);
this
.
props
.
dropDownClose
();
}
resetSearch
=
()
=>
{
this
.
setState
({
tradingType
:
"1"
,
startTime
:
""
,
endTime
:
""
,
siteProtectStatus
:
"0"
,
refreshFilter
:
new
Date
().
getTime
()
});
this
.
props
.
advancedSearch
({
tradingType
:
"1"
,
startTime
:
""
,
endTime
:
""
,
siteProtectStatus
:
"0"
,
});
this
.
props
.
dropDownClose
();
}
render
()
{
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
5
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
19
},
},
};
return
(
<
div
className=
{
styles
.
tradingLogsFilter
}
>
<
Form
{
...
formItemLayout
}
>
<
Form
.
Item
label=
{
intl
.
get
(
"exchangeConfigText28"
)
}
>
<
Select
style=
{
{
width
:
350
}
}
onChange=
{
this
.
handleTradingType
}
value=
{
this
.
state
.
tradingType
}
>
<
Option
value=
"1"
>
{
intl
.
get
(
"all"
)
}
</
Option
>
<
Option
value=
"100"
>
{
intl
.
get
(
"exchangeConfigText30"
)
}
</
Option
>
<
Option
value=
"200"
>
{
intl
.
get
(
"exchangeConfigText31"
)
}
</
Option
>
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
{
intl
.
get
(
"Time"
)
}
>
<
RangePicker
key=
{
this
.
state
.
refreshFilter
}
style=
{
{}
}
showTime=
{
{
format
:
'HH:mm'
}
}
format=
"YYYY-MM-DD HH:mm"
placeholder=
{
[
intl
.
get
(
"StartTime"
),
intl
.
get
(
"EndTime"
)]
}
onChange=
{
this
.
handleGetDateRange
}
onOk=
{
this
.
handleDateRangeOk
}
/>
</
Form
.
Item
>
</
Form
>
<
div
className=
{
styles
.
tradingLogsFilterBtns
}
>
<
Button
style=
{
{
marginRight
:
8
}
}
onClick=
{
this
.
resetSearch
}
>
{
intl
.
get
(
"SystemAdmin16"
)
}
</
Button
>
<
Button
type=
{
"primary"
}
onClick=
{
this
.
searchByData
}
>
{
intl
.
get
(
"Search"
)
}
</
Button
>
</
div
>
</
div
>
)
}
}
export
default
TradingLogsFilter
;
\ No newline at end of file
src/pages/SystemManagement/Point/redux/action.js
View file @
9fde9c77
...
...
@@ -3,6 +3,7 @@ import { message } from "antd";
//积分
export
const
POINT_SET
=
"POINT_SET"
;
export
const
POINT_TABLE
=
"POINT_TABLE"
;
export
const
POINT_EXCHANGE
=
"POINT_EXCHANGE"
;
export
const
POINT_DETAILED
=
"POINT_DETAILED"
;
// 兑换
...
...
@@ -17,13 +18,14 @@ const {
postPointSetApi
,
exclApi
,
postPointEditApi
,
getPointTableApi
,
//商品列表
postPointTableApi
,
postPointShelfApi
,
postPointShelvesApi
,
postPointAddApi
,
postPointModifyApi
,
getPointDetailedApi
,
point
Activity
DelApi
,
point
Product
DelApi
,
getExchangeSwitchApi
,
getExchangeRuleApi
,
...
...
@@ -32,6 +34,9 @@ const {
exportTradingLogsApi
,
turnOnOrOffSwitchApi
,
getCodeListApi
,
//兑换列表
postUserListApi
,
postPointExchangeApi
,
}
=
api
;
//积分通用设置
...
...
@@ -87,16 +92,15 @@ export function postPointEdit(data) {
// Table
export
function
getPointTable
(
data
)
{
console
.
log
(
data
);
return
dispatch
=>
{
// return fetch(pointUrl+`/manage/activity/list`,{type:'GET',data:data})
return
request
({
url
:
ge
tPointTableApi
,
url
:
pos
tPointTableApi
,
data
:
data
,
}).
then
(
res
=>
{
dispatch
({
type
:
POINT_TABLE
,
data
:
res
,
data
:
res
.
data
,
});
});
};
...
...
@@ -208,7 +212,7 @@ export function pointActivityDel(data, callback) {
return
dispatch
=>
{
// return fetch(pointUrl+`/manage/point/details/list`,{type:'GET',data:data})
return
request
({
url
:
point
Activity
DelApi
,
url
:
point
Product
DelApi
,
data
:
data
,
}).
then
(
res
=>
{
callback
(
res
);
...
...
@@ -363,3 +367,31 @@ export function getCodeList(data, callback) {
});
};
}
// 获取积分列表
export
function
postUserList
(
data
,
callback
)
{
return
dispatch
=>
{
return
request
({
url
:
postUserListApi
,
data
:
data
,
}).
then
(
res
=>
{
dispatch
({
type
:
POINT_EXCHANGE
,
data
:
res
.
data
,
});
});
};
}
// 积分兑换
export
function
postPointExchange
(
data
,
callback
)
{
return
dispatch
=>
{
return
request
({
url
:
postPointExchangeApi
,
data
:
data
,
}).
then
(
res
=>
{
if
(
res
.
code
==
"1000"
)
{
message
.
success
(
"兑换成功"
);
}
});
};
}
\ No newline at end of file
src/pages/SystemManagement/Point/redux/api.js
View file @
9fde9c77
...
...
@@ -3,15 +3,31 @@ export default {
postPointSetApi
:
`GET
${
services
.
webManage
}
/point/strategy/view`
,
exclApi
:
`POST
${
services
.
webManage
}
/point/import`
,
postPointEditApi
:
`POST
${
services
.
webManage
}
/point/strategy/update`
,
getPointTableApi
:
`GET
${
services
.
webManage
}
/activity/list`
,
postPointShelfApi
:
`POST
${
services
.
webManage
}
/activity/enabled`
,
postPointShelvesApi
:
`POST
${
services
.
webManage
}
/activity/disabled`
,
postPointAddApi
:
`POST
${
services
.
webManage
}
/activity/insert`
,
postPointModifyApi
:
`POST
${
services
.
webManage
}
/activity/update`
,
getPointDetailedApi
:
`GET
${
services
.
webManage
}
/point/details/list`
,
pointActivityDelApi
:
`POST
${
services
.
webManage
}
/activity/delete`
,
// 商品列表
postPointTableApi
:
`POST
${
services
.
webManage
}
/point/product/list`
,
//新增商品
postPointAddApi
:
`POST
${
services
.
webManage
}
/point/product/insert`
,
//修改商品
postPointModifyApi
:
`POST
${
services
.
webManage
}
/point/product/update`
,
//删除商品
pointProductDelApi
:
`POST
${
services
.
webManage
}
/point/product/delete`
,
//上架
getPointDetailedApi
:
`POST
${
services
.
webManage
}
/point/product/enabled`
,
//下架
pointProductShelvesApi
:
`POST
${
services
.
webManage
}
/point/product/disabled`
,
//兑换管理
//--积分列表
// /manage/point/user/list
// 入参:{"name":"xx", "pageNo":"1", "pageSize":10}
// --积分兑换
// /manage/point/user/exchange
// {"userId":1314, "point": 2}
postUserListApi
:
`POST
${
services
.
webManage
}
/point/user/list`
,
postPointExchangeApi
:
`POST
${
services
.
webManage
}
/point/user/exchange`
,
getExchangeSwitchApi
:
`GET
${
services
.
webMall
}
/student/token/config/switch`
,
getExchangeRuleApi
:
`GET
${
services
.
webMall
}
/manage/tokenExchangeRule/get`
,
saveExchangeRuleApi
:
`POST
${
services
.
webMall
}
/manage/tokenExchangeRule/save`
,
...
...
src/pages/SystemManagement/Point/redux/reducer.js
View file @
9fde9c77
...
...
@@ -9,6 +9,7 @@ const initialState = {
set
:
null
,
table
:
null
,
detailed
:
null
,
exchangeList
:
null
,
codeList
:
[],
exchangeSwitchStatusList
:
[],
exchangeRule
:
{},
...
...
@@ -33,6 +34,11 @@ function point(state = initialState, action) {
return
Object
.
assign
({},
state
,
{
table
:
action
.
data
,
});
//兑换列表
case
"POINT_EXCHANGE"
:
return
Object
.
assign
({},
state
,
{
exchangeList
:
action
.
data
,
});
//积分流水明细
case
"POINT_DETAILED"
:
return
Object
.
assign
({},
state
,
{
...
...
src/pages/SystemManagement/index.js
View file @
9fde9c77
...
...
@@ -172,22 +172,6 @@ const ActiveOption = Loadable({
),
loading
:
SpinLoading
,
});
//积分兑换设置
const
ExchangeForOption
=
Loadable
({
loader
:
()
=>
import
(
/* webpackChunkName: "ExchangeForOption" */
"@/pages/SystemManagement/Point/exchangeForOption/index"
),
loading
:
SpinLoading
,
});
//积分流水明细
const
Detailed
=
Loadable
({
loader
:
()
=>
import
(
/* webpackChunkName: "Detailed" */
"@/pages/SystemManagement/Point/Detailed"
),
loading
:
SpinLoading
,
});
// RulesEngine 规则引擎(推荐管理)
const
RulesEngine
=
Loadable
({
loader
:
()
=>
...
...
@@ -358,11 +342,6 @@ class Online extends React.Component {
path
=
{
`
${
this
.
props
.
match
.
url
}
/message-management`
}
component
=
{()
=>
<
Message
/>
}
/
>
<
Route
path
=
{
`
${
this
.
props
.
match
.
url
}
/underline/underlineclass`
}
component
=
{()
=>
<
div
>
积分管理
<
/div>
}
/>
<
Route
path
=
{
`
${
this
.
props
.
match
.
url
}
/system/sensitiveWords`
}
component
=
{()
=>
<
SensitiveWords
/>
}
...
...
@@ -410,16 +389,6 @@ class Online extends React.Component {
path
=
{
`
${
this
.
props
.
match
.
url
}
/point/active-option`
}
component
=
{()
=>
<
ActiveOption
/>
}
/
>
{
/*积分兑换设置*/
}
<
Route
path
=
{
`
${
this
.
props
.
match
.
url
}
/point/exchange-for-option`
}
component
=
{()
=>
<
ExchangeForOption
/>
}
/
>
{
/*积分流水明细*/
}
<
Route
path
=
{
`
${
this
.
props
.
match
.
url
}
/point/Detailed-option`
}
component
=
{()
=>
<
Detailed
props
=
{
this
.
props
}
/>
}
/>
{
/*规则引擎(推荐管理)*/
}
<
Route
path
=
{
`
${
this
.
props
.
match
.
url
}
/rules-engine-management`
}
...
...
src/pages/TrainingTools/Question/Create/Base.jsx
View file @
9fde9c77
...
...
@@ -377,7 +377,7 @@ class Base extends Component {
style=
{
{
display
:
"inline-block"
}
}
/>
)
}
{
this
.
props
.
iscopy
==
true
?
null
:
(
{
/* {
this.props.iscopy == true ? null : (
<Button
type="primary"
onClick={this.showModal}
...
...
@@ -386,7 +386,7 @@ class Base extends Component {
>
复制问卷
</Button>
)
}
)}
*/
}
</
FormItem
>
<
FormItem
{
...
formItemLayout
}
label=
"业务类型:"
>
{
getFieldDecorator
(
"bizType"
,
{
...
...
src/services/serve.js
View file @
9fde9c77
// let baseUrl = API_CONFIG.BASE_URL;
const
{
IP
}
=
require
(
"../../build/Ip"
);
let
baseUrl
=
"http://10.10.12.94:8090"
;
// let baseUrl = "";
if
(
location
.
host
.
includes
(
"localhost"
))
{
// baseUrl = IP + '/admin';
baseUrl
=
"https://hqjddj.shanghaiairport.com"
;
// baseUrl = "http://192.168.1.107:8090"; //lang
// baseUrl = "https://192.168.1.106:8090";
}
let
baseUrl
=
IP
;
const
service
=
{
webManage
:
`
${
baseUrl
}
/web-manage/manage`
,
webMall
:
`
${
baseUrl
}
/mall`
,
...
...
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