Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
max_android_panel
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
Zhang Xin
max_android_panel
Commits
357b52a7
Commit
357b52a7
authored
Sep 14, 2018
by
wujiabao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 任务转中文 根据后台跳组件
parent
7ff102c5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
14 deletions
+97
-14
client/actions/common.js
+1
-1
client/components/CommonComponent/ButtonComponent/ButtonComponent.jsx
+1
-1
client/containers/HomePageContainer/HomePageContainer.jsx
+26
-7
client/containers/PageContainer/PageContainer.jsx
+14
-3
client/reducers/common.js
+55
-2
No files found.
client/actions/common.js
View file @
357b52a7
...
@@ -35,8 +35,8 @@ const getTaskInfo = (data)=>{
...
@@ -35,8 +35,8 @@ const getTaskInfo = (data)=>{
taskInfo
=
Object
.
assign
({},
json
.
data
)
taskInfo
=
Object
.
assign
({},
json
.
data
)
}
}
console
.
log
(
taskInfo
)
console
.
log
(
taskInfo
)
dispatch
(
startalljob
(
Object
.
assign
({},
taskInfo
)))
dispatch
(
saveCommonInfo
(
Object
.
assign
({},
taskInfo
)))
dispatch
(
saveCommonInfo
(
Object
.
assign
({},
taskInfo
)))
dispatch
(
startalljob
(
Object
.
assign
({},{
taskInfo
})))
}).
catch
(
e
=>
{
console
.
error
(
e
)})
}).
catch
(
e
=>
{
console
.
error
(
e
)})
}
}
...
...
client/components/CommonComponent/ButtonComponent/ButtonComponent.jsx
View file @
357b52a7
...
@@ -12,7 +12,7 @@ export default class ButtonComponent extends React.Component{
...
@@ -12,7 +12,7 @@ export default class ButtonComponent extends React.Component{
let
colorClass
=
props
.
classInfo
&&
props
.
classInfo
.
colorInfo
?
props
.
classInfo
.
colorInfo
:
"col333"
;
let
colorClass
=
props
.
classInfo
&&
props
.
classInfo
.
colorInfo
?
props
.
classInfo
.
colorInfo
:
"col333"
;
let
fontClass
=
props
.
classInfo
&&
props
.
classInfo
.
fontInfo
?
props
.
classInfo
.
fontInfo
:
"font32"
;
let
fontClass
=
props
.
classInfo
&&
props
.
classInfo
.
fontInfo
?
props
.
classInfo
.
fontInfo
:
"font32"
;
return
(
return
(
<
div
className=
{
`buttonComponent ${fontClass} ${colorClass} ${classInfo}`
}
style=
{
props
.
style
}
onClick=
{
()
=>
props
.
option
()
}
>
<
div
className=
{
`buttonComponent ${fontClass} ${colorClass} ${classInfo}`
}
style=
{
props
.
style
}
onClick=
{
()
=>
{
props
.
option
()}
}
>
{
props
.
text
}
{
props
.
text
}
</
div
>
</
div
>
)
)
...
...
client/containers/HomePageContainer/HomePageContainer.jsx
View file @
357b52a7
...
@@ -16,12 +16,6 @@ export default class HomePageContainer extends React.Component{
...
@@ -16,12 +16,6 @@ export default class HomePageContainer extends React.Component{
}
}
componentWillReceiveProps
(
nextProps
){
}
render
(){
render
(){
let
props
=
this
.
props
;
let
props
=
this
.
props
;
let
{
userInfo
,
storeInfo
,
headerInfo
}
=
props
;
let
{
userInfo
,
storeInfo
,
headerInfo
}
=
props
;
...
@@ -42,12 +36,37 @@ export default class HomePageContainer extends React.Component{
...
@@ -42,12 +36,37 @@ export default class HomePageContainer extends React.Component{
<
img
className=
{
"homeIcon"
}
src=
{
UTILPATH
.
localImg
.
homePage
}
alt=
""
/>
<
img
className=
{
"homeIcon"
}
src=
{
UTILPATH
.
localImg
.
homePage
}
alt=
""
/>
<
div
className=
{
'homeWelcom font30 clo333'
}
style=
{
{
marginTop
:
'50px'
}
}
>
欢迎来到
<
span
className=
"homeArea font50 colff775c"
style=
{
{
padding
:
'0 8px'
}
}
>
A
</
span
>
区
</
div
>
<
div
className=
{
'homeWelcom font30 clo333'
}
style=
{
{
marginTop
:
'50px'
}
}
>
欢迎来到
<
span
className=
"homeArea font50 colff775c"
style=
{
{
padding
:
'0 8px'
}
}
>
A
</
span
>
区
</
div
>
<
div
className=
{
"homeText font42"
}
style=
{
{
fontWeight
:
'800'
,
marginTop
:
'20px'
}
}
>
下午好, 你辛苦了!
</
div
>
<
div
className=
{
"homeText font42"
}
style=
{
{
fontWeight
:
'800'
,
marginTop
:
'20px'
}
}
>
下午好, 你辛苦了!
</
div
>
<
Button
text=
{
'开始工作'
}
classInfo=
{
classInfo
}
style=
{
buttonStyle
}
option=
{
props
.
startTask
}
/>
<
Button
text=
{
'开始工作'
}
classInfo=
{
classInfo
}
style=
{
buttonStyle
}
option=
{
this
.
start
.
bind
(
this
)
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
)
}
}
start
(){
let
props
=
this
.
props
;
props
.
startTask
();
}
componentWillReceiveProps
(
nextProps
){
let
props
=
this
.
props
;
if
(
nextProps
.
headerInfo
.
taskInfo
){
let
num
=
nextProps
.
headerInfo
.
taskInfo
.
currentTaskNum
;
switch
(
num
){
case
1
:
props
.
changePages
(
CONFIG
.
showPage
[
6
]);
break
;
case
1
:
props
.
changePages
(
CONFIG
.
showPage
[
6
]);
break
;
case
1
:
props
.
changePages
(
CONFIG
.
showPage
[
6
]);
break
;
case
1
:
props
.
changePages
(
CONFIG
.
showPage
[
6
]);
break
;
}
}
}
}
}
HomePageContainer
.
propTypes
=
{
HomePageContainer
.
propTypes
=
{
...
...
client/containers/PageContainer/PageContainer.jsx
View file @
357b52a7
...
@@ -88,6 +88,7 @@ class PageContainer extends React.Component {
...
@@ -88,6 +88,7 @@ class PageContainer extends React.Component {
/*以下是二期方法 start*/
/*以下是二期方法 start*/
this
.
showHomePage
=
this
.
showHomePage
.
bind
(
this
);
//二期显示首页
this
.
showHomePage
=
this
.
showHomePage
.
bind
(
this
);
//二期显示首页
this
.
triggerAllClassify
=
this
.
triggerAllClassify
.
bind
(
this
);
//二期显示菜单栏
this
.
triggerAllClassify
=
this
.
triggerAllClassify
.
bind
(
this
);
//二期显示菜单栏
this
.
showSecondTroubelPage
=
this
.
showSecondTroubelPage
.
bind
(
this
);
//根据用户的type判断显示的页面
/*以下是二期方法 end*/
/*以下是二期方法 end*/
...
@@ -99,6 +100,7 @@ class PageContainer extends React.Component {
...
@@ -99,6 +100,7 @@ class PageContainer extends React.Component {
this
.
taskTypeOption
=
{
this
.
taskTypeOption
=
{
'ER'
:
this
.
showTroublePage
,
'ER'
:
this
.
showTroublePage
,
'BH'
:
this
.
showSecondTroubelPage
};
};
}
}
...
@@ -249,7 +251,12 @@ class PageContainer extends React.Component {
...
@@ -249,7 +251,12 @@ class PageContainer extends React.Component {
this
.
beginCountBack
();
this
.
beginCountBack
();
});
});
}
}
showSecondTroubelPage
(
info
){
// let {dispatch} =this.props;
this
.
setState
({
showPage
:
showPage
[
13
]
})
}
changePages
(
page
){
changePages
(
page
){
console
.
log
(
"changePages : "
,
page
);
console
.
log
(
"changePages : "
,
page
);
this
.
setState
({
this
.
setState
({
...
@@ -466,7 +473,7 @@ class PageContainer extends React.Component {
...
@@ -466,7 +473,7 @@ class PageContainer extends React.Component {
pages
=
<
TroubleContainer
pages
=
<
TroubleContainer
troubleList=
{
state
.
troubleList
}
troubleList=
{
state
.
troubleList
}
refreshImg
=
{
state
.
refreshImg
}
refreshImg
=
{
state
.
refreshImg
}
storeInfo=
{
state
.
storeInfo
}
storeInfo=
{
state
.
commonInfo
.
storeInfo
}
userInfo=
{
state
.
userInfo
}
userInfo=
{
state
.
userInfo
}
initTroubleList=
{
(
info
)
=>
dispatch
(
getTroubleList
(
info
))
}
initTroubleList=
{
(
info
)
=>
dispatch
(
getTroubleList
(
info
))
}
showTextArea=
{
(
text
)
=>
this
.
showTextArea
(
text
)
}
showTextArea=
{
(
text
)
=>
this
.
showTextArea
(
text
)
}
...
@@ -553,7 +560,11 @@ class PageContainer extends React.Component {
...
@@ -553,7 +560,11 @@ class PageContainer extends React.Component {
break;
break;
/*以下是二期页面 start*/
/*以下是二期页面 start*/
case showPage[13]:
case showPage[13]:
pages =
<
HomePage
headerInfo=
{
state
.
commonInfo
}
startTask=
{
()
=>
{
dispatch
(
getTaskInfo
(
state
.
commonInfo
))}
}
/>
;
console.log(state.commonInfo,'12121212121212')
pages =
<
HomePage
headerInfo=
{
state
.
commonInfo
}
startTask=
{
()
=>
{
dispatch
(
getTaskInfo
(
state
.
commonInfo
))}
}
changePages=
{
(
data
)
=>
this
.
changePages
(
data
)
}
/>
;
break;
break;
case showPage[6]:
case showPage[6]:
pages =
<
TakeStokeContainer
headerInfo
=
{
state
.
commonInfo
}
/>
;
pages =
<
TakeStokeContainer
headerInfo
=
{
state
.
commonInfo
}
/>
;
...
...
client/reducers/common.js
View file @
357b52a7
...
@@ -22,8 +22,61 @@ const saveCommonInfo = (state,data)=>{
...
@@ -22,8 +22,61 @@ const saveCommonInfo = (state,data)=>{
const
emptyCommInfo
=
(
state
,
data
)
=>
{
const
emptyCommInfo
=
(
state
,
data
)
=>
{
return
Object
.
assign
({},
state
,
data
)
return
Object
.
assign
({},
state
,
data
)
}
}
// 传入一个对象 对象中包含currentTaskNum表示大任务
// childTaskNum 表示大任务下的小任务
const
NumChangeWord
=
(
obj
)
=>
{
let
arr
=
[
{
title
:
'散落商品检查'
,
children
:[
'1'
,
'2'
]
},
{
title
:
'核对数量'
,
children
:[
'1'
,
'2'
]
},
{
title
:
'回收区货品回收'
,
children
:[
'1'
,
'2'
]
},
{
title
:
'补货'
,
children
:[
'1'
,
'2'
]
}
]
let
name
=
obj
.
currentTaskNum
;
let
child
=
obj
.
childTaskNum
?
obj
.
childTaskNum
:
false
;
switch
(
name
){
case
1
:
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
if
(
child
){
obj
.
childTaskNum
=
arr
[
name
-
1
].
children
[
child
-
1
]
}
break
;
case
2
:
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
if
(
child
){
obj
.
childTaskNum
=
arr
[
name
-
1
].
children
[
child
-
1
]
}
break
;
case
3
:
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
if
(
child
){
obj
.
childTaskNum
=
arr
[
name
-
1
].
children
[
child
-
1
]
}
break
;
case
4
:
obj
.
currentTaskName
=
arr
[
name
-
1
].
title
;
if
(
child
){
obj
.
childTaskNum
=
arr
[
name
-
1
].
children
[
child
-
1
]
}
break
;
}
}
const
startalljob
=
(
state
,
data
)
=>
{
const
startalljob
=
(
state
,
data
)
=>
{
return
Object
.
assign
({},
state
,
data
)
let
info
=
saveCommonInfo
(
state
,
data
);
return
info
;
}
}
export
default
function
(
state
=
{},
action
)
{
export
default
function
(
state
=
{},
action
)
{
switch
(
action
.
type
)
{
switch
(
action
.
type
)
{
...
@@ -32,7 +85,7 @@ export default function(state={}, action) {
...
@@ -32,7 +85,7 @@ export default function(state={}, action) {
case
actionTypes
.
EMPTYCOMMONINFO
:
case
actionTypes
.
EMPTYCOMMONINFO
:
return
emptyCommInfo
(
state
);
return
emptyCommInfo
(
state
);
case
actionTypes
.
STARTALLJOB
:
case
actionTypes
.
STARTALLJOB
:
return
startalljob
(
state
);
return
startalljob
(
state
,
action
.
data
);
default
:
default
:
return
state
;
return
state
;
}
}
...
...
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