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
144150e6
Commit
144150e6
authored
Jul 15, 2018
by
Zhang Xin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add storeinfo
parent
83bb3475
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
154 additions
and
10 deletions
+154
-10
client/actions/getStore.js
+27
-10
client/actions/getTroubles.js
+90
-0
client/actiontype/trouble.js
+5
-0
client/containers/PageContainer/PageContainer.jsx
+7
-0
client/reducers/index.js
+2
-0
client/reducers/store.js
+15
-0
client/reducers/trouble.js
+8
-0
No files found.
client/actions/getStore.js
View file @
144150e6
...
@@ -2,6 +2,22 @@ import fetch from 'isomorphic-fetch';
...
@@ -2,6 +2,22 @@ import fetch from 'isomorphic-fetch';
import
actionTypes
from
'../actiontype/store'
import
actionTypes
from
'../actiontype/store'
const
domain
=
ENV
.
domain
;
const
domain
=
ENV
.
domain
;
let
mock
=
{
"meta"
:
{
"code"
:
"200"
,
"message"
:
"成功"
,
"success"
:
true
},
"data"
:
{
"warehouse"
:
{
"id"
:
13
,
"name"
:
"华贸商业街"
,
"image"
:
"http://static.mjitech.com/static/tmp/2018-05-25/1527243213701.jpg"
,
"address"
:
"华贸商业街(新光天地与利兹卡尔顿酒店之间广场)"
}
}
}
const
saveStoreInfo
=
(
data
)
=>
{
const
saveStoreInfo
=
(
data
)
=>
{
return
{
return
{
type
:
actionTypes
.
SAVESTORE
,
type
:
actionTypes
.
SAVESTORE
,
...
@@ -11,16 +27,17 @@ const saveStoreInfo = (data)=>{
...
@@ -11,16 +27,17 @@ const saveStoreInfo = (data)=>{
const
getStoreInfo
=
()
=>
{
const
getStoreInfo
=
()
=>
{
return
(
dispatch
)
=>
{
return
(
dispatch
)
=>
{
fetch
(
domain
+
'/web/pad_warehouse/getMachineData.action'
,{
// fetch(domain + '/web/pad_warehouse/getMachineData.action',{
credentials
:
'include'
,
// credentials : 'include',
method
:
'POST'
,
// method : 'POST',
mode
:
'cors'
,
// mode : 'cors',
body
:
{}
// body : {}
//
}).
then
((
response
)
=>
response
.
json
())
// }).then((response)=>response.json())
.
then
(
json
=>
{
// .then(json=>{
console
.
log
(
json
);
// console.log(json);
}).
catch
(
e
=>
{
console
.
error
(
e
)})
// }).catch(e=>{console.error(e)})
dispatch
(
saveStoreInfo
(
mock
.
data
))
}
}
}
}
...
...
client/actions/getTroubles.js
0 → 100644
View file @
144150e6
import
fetch
from
'isomorphic-fetch'
;
import
actionTypes
from
'../actiontype/trouble'
const
domain
=
ENV
.
domain
;
let
mock
=
{
"meta"
:
{
"code"
:
"200"
,
"message"
:
"成功"
,
"success"
:
true
},
"data"
:
{
"details"
:
[
{
"id"
:
1634
,
"errorCode"
:
"ER00001"
,
"type"
:
"KN"
,
"description"
:
"2:左侧动作故障,4:机械手移动到放货位置出错()"
,
"files"
:
[
{
"id"
:
16
,
"filePath"
:
"/tmp/2016-08-16/1471329685902.jpg"
},
{
"id"
:
17
,
"filePath"
:
"/sku/0/0/427/1471329704482.jpg"
},
{
"id"
:
18
,
"filePath"
:
"/sku/0/0/426/1471330380712.jpg"
}
],
},
{
"id"
:
1
,
"errorCode"
:
null
,
"type"
:
"OP"
,
"files"
:
[
{
"id"
:
16
,
"filePath"
:
"/tmp/2016-08-16/1471329685902.jpg"
},
{
"id"
:
17
,
"filePath"
:
"/sku/0/0/427/1471329704482.jpg"
},
{
"id"
:
18
,
"filePath"
:
"/sku/0/0/426/1471330380712.jpg"
}
],
"parentProblemName"
:
"机械故障"
,
"subProblemName"
:
"其他问题111"
}
],
"employee"
:
{
"id"
:
5
,
"employeeName"
:
"机器库管员"
,
"headImageUrl"
:
"/static/coupon/gounian/banner_hongbaotupian-3-14.jpg"
},
"taskIds"
:
[
155
]
}
}
const
saveTroubleList
=
(
data
)
=>
{
return
{
type
:
actionTypes
.
SAVETROUBLELIST
,
data
}
};
const
getTroubleList
=
()
=>
{
return
(
dispatch
)
=>
{
// fetch(domain + '/web/pad_warehouse/getMachineData.action',{
// credentials : 'include',
// method : 'POST',
// mode : 'cors',
// body : {}
//
// }).then((response)=>response.json())
// .then(json=>{
// console.log(json);
// }).catch(e=>{console.error(e)})
dispatch
(
saveTroubleList
(
mock
.
data
))
}
}
export
{
getTroubleList
}
client/actiontype/trouble.js
0 → 100644
View file @
144150e6
const
actionTypes
=
{
SAVETROUBLELIST
:
'SAVETROUBLELIST'
,
}
export
default
actionTypes
\ No newline at end of file
client/containers/PageContainer/PageContainer.jsx
View file @
144150e6
'use strict'
;
'use strict'
;
import
React
from
'react'
import
React
from
'react'
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
getStoreInfo
}
from
"../../actions/getStore"
;
import
{
getTroubleList
}
from
"../../actions/getTroubles"
;
import
HeaderComponent
from
'../../components/CommonComponent/HeaderComponent/HeaderComponent'
import
HeaderComponent
from
'../../components/CommonComponent/HeaderComponent/HeaderComponent'
import
PopupComponent
from
'../../components/CommonComponent/PopupComponent/PopupComponent'
import
PopupComponent
from
'../../components/CommonComponent/PopupComponent/PopupComponent'
import
TroubleContainer
from
'../TroubleContainer/TroubleContainer'
import
TroubleContainer
from
'../TroubleContainer/TroubleContainer'
...
@@ -53,6 +57,9 @@ class PageContainer extends React.Component {
...
@@ -53,6 +57,9 @@ class PageContainer extends React.Component {
this
.
hidePopup
=
this
.
hidePopup
.
bind
(
this
);
this
.
hidePopup
=
this
.
hidePopup
.
bind
(
this
);
}
}
componentWillMount
()
{
componentWillMount
()
{
let
{
dispatch
}
=
this
.
props
;
dispatch
(
getStoreInfo
());
dispatch
(
getTroubleList
());
let
pages
=
this
.
getPages
();
let
pages
=
this
.
getPages
();
this
.
setState
({
this
.
setState
({
page
:
pages
page
:
pages
...
...
client/reducers/index.js
View file @
144150e6
import
{
combineReducers
}
from
'redux'
import
{
combineReducers
}
from
'redux'
import
trouble
from
'./trouble'
import
trouble
from
'./trouble'
import
storeInfo
from
'./store'
import
scanBarCodeContainer
from
'./scanBarCodeContainer'
import
scanBarCodeContainer
from
'./scanBarCodeContainer'
export
default
combineReducers
({
export
default
combineReducers
({
trouble
,
trouble
,
storeInfo
,
scanBarCodeContainer
scanBarCodeContainer
})
})
client/reducers/store.js
0 → 100755
View file @
144150e6
import
actionTypes
from
'../actiontype/store'
;
const
saveStore
=
(
content
,
data
)
=>
{
return
Object
.
assign
({},
content
,
data
);
}
export
default
function
(
state
=
{},
action
)
{
switch
(
action
.
type
)
{
case
actionTypes
.
SAVESTORE
:
return
saveStore
(
state
,
action
.
data
)
default
:
return
state
;
}
}
\ No newline at end of file
client/reducers/trouble.js
View file @
144150e6
import
actionTypes
from
'../actiontype/trouble'
;
const
saveStore
=
(
content
,
data
)
=>
{
return
Object
.
assign
({},
content
,
data
);
}
export
default
function
(
state
=
{},
action
)
{
export
default
function
(
state
=
{},
action
)
{
switch
(
action
.
type
)
{
switch
(
action
.
type
)
{
case
actionTypes
.
SAVETROUBLELIST
:
return
saveStore
(
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