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
54f8f3f4
Commit
54f8f3f4
authored
Aug 03, 2018
by
yaxiLiuu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of git.mjitech.com:zhangxin/max_android_panel into dev
parents
7b38ac04
5697e6c6
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
116 additions
and
44 deletions
+116
-44
client/actions/getTroubles.js
+46
-1
client/components/CommonComponent/ImgToolComponent/CommonSmalContainer.jsx
+2
-4
client/components/CommonComponent/ImgToolComponent/index.css
+9
-12
client/components/CommonComponent/SwiperComponent/SwiperComponent.jsx
+9
-6
client/components/TroubleComponent/TroubleItemComponent/TroubleItemComponent.jsx
+1
-7
client/components/TroubleComponent/TroubleItemComponent/index.css
+5
-5
client/containers/PageContainer/PageContainer.jsx
+3
-3
client/containers/TroubleContainer/TroubleContainer.jsx
+39
-6
client/index.js
+2
-0
No files found.
client/actions/getTroubles.js
View file @
54f8f3f4
...
@@ -34,9 +34,54 @@ let json = {
...
@@ -34,9 +34,54 @@ let json = {
},
},
{
{
"id"
:
1
,
"id"
:
1
,
"errorCode"
:
null
,
"errorCode"
:
"ER00002"
,
"type"
:
"OP"
,
"type"
:
"OP"
,
"files"
:
[
"files"
:
[
{
"id"
:
17
,
"filePath"
:
"http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
},
{
"id"
:
18
,
"filePath"
:
"http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
},
{
"id"
:
19
,
"filePath"
:
"http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
},
],
"parentProblemName"
:
"机械故障"
,
"subProblemName"
:
"其他问题111"
},
{
"id"
:
1
,
"errorCode"
:
"ER00003"
,
"type"
:
"OP"
,
"files"
:
[
{
"id"
:
17
,
"filePath"
:
"http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
},
{
"id"
:
18
,
"filePath"
:
"http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
},
{
"id"
:
19
,
"filePath"
:
"http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
},
{
"id"
:
17
,
"filePath"
:
"http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
},
{
"id"
:
18
,
"filePath"
:
"http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
},
{
"id"
:
19
,
"filePath"
:
"http://static.mjitech.com/static/sku/0/0/427/1471329704482.jpg"
}
],
],
"parentProblemName"
:
"机械故障"
,
"parentProblemName"
:
"机械故障"
,
"subProblemName"
:
"其他问题111"
"subProblemName"
:
"其他问题111"
...
...
client/components/CommonComponent/ImgToolComponent/CommonSmalContainer.jsx
View file @
54f8f3f4
...
@@ -42,18 +42,16 @@ export default class ImgToolComponent extends React.Component{
...
@@ -42,18 +42,16 @@ export default class ImgToolComponent extends React.Component{
if
(
type
==
"add"
&&
disabled
){
if
(
type
==
"add"
&&
disabled
){
imgSrc
=
addIconDisabledSrc
;
imgSrc
=
addIconDisabledSrc
;
}
}
if
(
type
==
"refresh"
&&
disabled
){
if
(
type
==
=
"refresh"
&&
disabled
){
imgSrc
=
refreshIconDisabledSrc
;
imgSrc
=
refreshIconDisabledSrc
;
}
}
return
(
return
(
<
div
className=
{
"ImgToolComponent"
}
>
<
div
className=
{
"ImgToolComponent"
}
>
<
div
className=
{
"imgItem"
}
>
<
img
src=
{
imgSrc
}
data
-
src=
{
imgSrc
}
className=
{
"swiper-lazy"
}
alt=
""
onClick=
{
props
.
handleClikImgFunc
}
/>
<
img
src=
{
imgSrc
}
alt=
""
onClick=
{
props
.
handleClikImgFunc
}
/>
{
{
noCloseBtn
?
""
:(<
span
className=
{
"closeBtn"
}
onClick=
{
props
.
handleClikCloseFunc
}
>
×
</
span
>)
noCloseBtn
?
""
:(<
span
className=
{
"closeBtn"
}
onClick=
{
props
.
handleClikCloseFunc
}
>
×
</
span
>)
}
}
</
div
>
</
div
>
</
div
>
)
)
}
}
...
...
client/components/CommonComponent/ImgToolComponent/index.css
View file @
54f8f3f4
.ImgToolComponent
{
.ImgToolComponent
{
display
:
inline-block
;
display
:
inline-block
;
}
/*width: 90px;*/
.ImgToolComponent
.imgItem
{
/*height: 90px;*/
width
:
90px
;
/*box-sizing: border-box;*/
height
:
90px
;
display
:
inline-block
;
box-sizing
:
border-box
;
margin-right
:
25px
;
margin-right
:
25px
;
position
:
relative
;
position
:
relative
;
}
}
.ImgToolComponent
.uploadImgRight
{
.ImgToolComponent
>
img
{
float
:
left
;
}
.ImgToolComponent
.imgItem
img
{
width
:
90px
;
width
:
90px
;
height
:
90px
;
height
:
90px
;
border-radius
:
10px
;
border-radius
:
10px
;
}
}
.ImgToolComponent
.
imgItem
.
closeBtn
{
.ImgToolComponent
.closeBtn
{
width
:
32px
;
width
:
32px
;
height
:
32px
;
height
:
32px
;
display
:
inline-block
;
display
:
inline-block
;
...
@@ -41,7 +35,9 @@
...
@@ -41,7 +35,9 @@
height
:
732px
;
height
:
732px
;
width
:
976px
;
width
:
976px
;
text-align
:
center
;
text-align
:
center
;
line-height
:
732px
;
}
}
.showBigImg
>
img
{
.showBigImg
>
img
{
height
:
100%
;
max-height
:
100%
;
vertical-align
:
middle
;
}
}
\ No newline at end of file
client/components/CommonComponent/SwiperComponent/SwiperComponent.jsx
View file @
54f8f3f4
...
@@ -28,17 +28,20 @@ export default class SwiperComponent extends React.Component{
...
@@ -28,17 +28,20 @@ export default class SwiperComponent extends React.Component{
}
}
componentWillReceiveProps
(
nextProps
){
}
componentDidUpdate
(
prevProps
){
componentDidUpdate
(
prevProps
){
const
{
swiperCount
,
swiperContainer
,
initialSlide
,
initialSlideTime
}
=
this
.
props
;
const
{
swiperCount
,
swiperContainer
,
initialSlide
,
initialSlideTime
}
=
this
.
props
;
if
(
prevProps
.
swiperCount
!==
swiperCount
)
{
if
(
prevProps
.
swiperCount
!==
swiperCount
)
{
this
.
state
.
swiperList
[
swiperContainer
].
init
();
this
.
state
.
swiperList
[
swiperContainer
].
init
();
}
}
if
(
//
if(
initialSlideTime
&&
//
initialSlideTime &&
initialSlide
!==
prevProps
.
initialSlide
//
initialSlide !== prevProps.initialSlide
){
//
){
this
.
state
.
swiperList
[
swiperContainer
].
slideTo
(
initialSlide
,
0
);
//
this.state.swiperList[swiperContainer].slideTo(initialSlide,0);
}
//
}
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
...
...
client/components/TroubleComponent/TroubleItemComponent/TroubleItemComponent.jsx
View file @
54f8f3f4
...
@@ -126,14 +126,8 @@ export default class TroubleItemComponent extends React.Component{
...
@@ -126,14 +126,8 @@ export default class TroubleItemComponent extends React.Component{
</
div
>
</
div
>
<
div
className=
{
"itemControl rel"
}
>
<
div
className=
{
"itemControl rel"
}
>
{
/*<div className={"plusImg controlBox "} onClick={()=>props.showQrcode(item.errorCode)}>*/
}
{
/*<img src={UTILPATH.localImg.plusIcon} alt=""/>*/
}
{
/*</div>*/
}
{
/*<div className={"refreshImg controlBox "} onClick={()=>props.getRefreshImg(item.id,item.type)}>*/
}
{
/*<img src={UTILPATH.localImg.refreshIcon} alt=""/>*/
}
{
/*</div>*/
}
{
imgFiles
}
{
imgFiles
}
<
ImageComponent
type=
{
"add"
}
handleClikImgFunc
=
{
this
.
addImg
}
noCloseBtn
=
{
true
}
/>
<
ImageComponent
disabled=
{
!
(
item
.
isExistProblem
&&
parseInt
(
item
.
isExistProblem
)
===
1
)
}
type=
{
"add"
}
handleClikImgFunc
=
{
this
.
addImg
}
noCloseBtn
=
{
true
}
/>
<
ImageComponent
handleClikImgFunc
=
{
this
.
reRreshImg
}
type=
{
"refresh"
}
noCloseBtn
=
{
true
}
/>
<
ImageComponent
handleClikImgFunc
=
{
this
.
reRreshImg
}
type=
{
"refresh"
}
noCloseBtn
=
{
true
}
/>
</
div
>
</
div
>
...
...
client/components/TroubleComponent/TroubleItemComponent/index.css
View file @
54f8f3f4
.troubleItemComponent
{
.troubleItemComponent
{
width
:
1396px
;
width
:
1396px
;
height
:
608px
;
height
:
608px
;
border
:
1
px
solid
#e5e5e5
;
border
:
3
px
solid
#e5e5e5
;
background-color
:
#ffffff
;
background-color
:
#ffffff
;
border-radius
:
20px
;
border-radius
:
20px
;
overflow
:
hidden
;
overflow
:
hidden
;
...
@@ -91,9 +91,9 @@
...
@@ -91,9 +91,9 @@
right
:
46px
;
right
:
46px
;
}
}
.troubleItemComponent
.itemControl
{
.troubleItemComponent
.itemControl
{
display
:
flex
;
/*display: flex;*/
flex-direction
:
row
;
/*flex-direction: row;*/
flex-wrap
:
nowrap
;
/*flex-wrap: nowrap;*/
}
}
.troubleItemComponent
.itemControl
.controlBox
{
.troubleItemComponent
.itemControl
.controlBox
{
width
:
90px
;
width
:
90px
;
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
text-align
:
center
;
text-align
:
center
;
width
:
178px
;
width
:
178px
;
height
:
178px
;
height
:
178px
;
line-height
:
1
2
6px
;
line-height
:
1
0
6px
;
left
:
-89px
;
left
:
-89px
;
top
:
-89px
;
top
:
-89px
;
transform
:
rotate
(
45deg
);
transform
:
rotate
(
45deg
);
...
...
client/containers/PageContainer/PageContainer.jsx
View file @
54f8f3f4
...
@@ -37,7 +37,7 @@ const defaultPopupInfo = {
...
@@ -37,7 +37,7 @@ const defaultPopupInfo = {
popupButtons
:
[],
// 默认弹窗的按钮
popupButtons
:
[],
// 默认弹窗的按钮
classNames
:
''
//自定义类名
classNames
:
''
//自定义类名
};
};
const
initPage
=
showPage
[
7
]
;
const
initPage
=
7
;
const
errorType
=
{
const
errorType
=
{
1
:
1
,
//屏幕超时操作
1
:
1
,
//屏幕超时操作
...
@@ -49,7 +49,7 @@ class PageContainer extends React.Component {
...
@@ -49,7 +49,7 @@ class PageContainer extends React.Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
showPage
:
initPage
,
showPage
:
showPage
[
initPage
]
,
lastPage
:
''
,
lastPage
:
''
,
page
:
null
,
page
:
null
,
popupInfo
:
defaultPopupInfo
,
popupInfo
:
defaultPopupInfo
,
...
@@ -402,7 +402,7 @@ class PageContainer extends React.Component {
...
@@ -402,7 +402,7 @@ class PageContainer extends React.Component {
refreshImg
=
{
state
.
refreshImg
}
refreshImg
=
{
state
.
refreshImg
}
storeInfo=
{
state
.
storeInfo
}
storeInfo=
{
state
.
storeInfo
}
userInfo=
{
state
.
userInfo
}
userInfo=
{
state
.
userInfo
}
initTroubleList=
{
(
)
=>
dispatch
(
getTroubleList
(
))
}
initTroubleList=
{
(
info
)
=>
dispatch
(
getTroubleList
(
info
))
}
showTextArea=
{
(
text
)
=>
this
.
showTextArea
(
text
)
}
showTextArea=
{
(
text
)
=>
this
.
showTextArea
(
text
)
}
showPopup=
{
(
info
)
=>
this
.
showPopup
(
info
)
}
showPopup=
{
(
info
)
=>
this
.
showPopup
(
info
)
}
hidePopup=
{
()
=>
this
.
hidePopup
()
}
hidePopup=
{
()
=>
this
.
hidePopup
()
}
...
...
client/containers/TroubleContainer/TroubleContainer.jsx
View file @
54f8f3f4
...
@@ -24,7 +24,9 @@ export default class TroubleContainer extends React.Component{
...
@@ -24,7 +24,9 @@ export default class TroubleContainer extends React.Component{
tmpText
:
''
,
tmpText
:
''
,
tmpUrl
:
''
,
tmpUrl
:
''
,
showStatus
:
showDom
[
1
],
showStatus
:
showDom
[
1
],
style
:
{}
style
:
{},
initialSlide
:
0
,
tempinitialSlide
:
0
};
};
this
.
setItem
=
this
.
setItem
.
bind
(
this
);
this
.
setItem
=
this
.
setItem
.
bind
(
this
);
this
.
showText
=
this
.
showText
.
bind
(
this
);
this
.
showText
=
this
.
showText
.
bind
(
this
);
...
@@ -37,12 +39,13 @@ export default class TroubleContainer extends React.Component{
...
@@ -37,12 +39,13 @@ export default class TroubleContainer extends React.Component{
this
.
updateImg
=
this
.
updateImg
.
bind
(
this
);
this
.
updateImg
=
this
.
updateImg
.
bind
(
this
);
this
.
dealTrouble
=
this
.
dealTrouble
.
bind
(
this
);
this
.
dealTrouble
=
this
.
dealTrouble
.
bind
(
this
);
this
.
setStyle
=
this
.
setStyle
.
bind
(
this
);
this
.
setStyle
=
this
.
setStyle
.
bind
(
this
);
this
.
onSlideChangeEnd
=
this
.
onSlideChangeEnd
.
bind
(
this
);
}
}
componentWillMount
(){
componentWillMount
(){
let
{
troubleList
}
=
this
.
props
;
let
{
troubleList
,
initTroubleList
}
=
this
.
props
;
// initTroubleList();
// initTroubleList(
{storeId: 17, employeeId: 5, token: "966D5C0B-3CF2-420D-B9A3-313BA37DE092"}
);
this
.
setState
({
this
.
setState
({
troubleList
:
troubleList
troubleList
:
troubleList
})
})
...
@@ -71,7 +74,6 @@ export default class TroubleContainer extends React.Component{
...
@@ -71,7 +74,6 @@ export default class TroubleContainer extends React.Component{
this
.
updateImg
(
refreshImg
);
this
.
updateImg
(
refreshImg
);
}
}
}
}
updateImg
(
info
){
updateImg
(
info
){
...
@@ -90,12 +92,15 @@ export default class TroubleContainer extends React.Component{
...
@@ -90,12 +92,15 @@ export default class TroubleContainer extends React.Component{
let
troubleList
=
this
.
state
.
troubleList
;
let
troubleList
=
this
.
state
.
troubleList
;
let
details
=
troubleList
.
details
;
let
details
=
troubleList
.
details
;
let
indexInfo
=
details
.
find
(
d
=>
d
.
errorCode
===
errcode
);
let
indexInfo
=
details
.
find
(
d
=>
d
.
errorCode
===
errcode
);
let
index
=
details
.
findIndex
(
d
=>
d
.
errorCode
===
errcode
);
console
.
log
(
"showText index "
,
index
)
if
(
indexInfo
&&
indexInfo
.
id
){
if
(
indexInfo
&&
indexInfo
.
id
){
let
text
=
indexInfo
.
explanation
;
let
text
=
indexInfo
.
explanation
;
this
.
setState
({
this
.
setState
({
currentErrorCode
:
errcode
,
currentErrorCode
:
errcode
,
showStatus
:
showDom
[
2
],
showStatus
:
showDom
[
2
],
tmpText
:
text
,
tmpText
:
text
,
tempinitialSlide
:
index
})
})
}
}
}
}
...
@@ -104,11 +109,14 @@ export default class TroubleContainer extends React.Component{
...
@@ -104,11 +109,14 @@ export default class TroubleContainer extends React.Component{
let
troubleList
=
this
.
state
.
troubleList
;
let
troubleList
=
this
.
state
.
troubleList
;
let
details
=
troubleList
.
details
;
let
details
=
troubleList
.
details
;
let
indexInfo
=
details
.
find
(
d
=>
d
.
errorCode
===
errcode
);
let
indexInfo
=
details
.
find
(
d
=>
d
.
errorCode
===
errcode
);
let
index
=
details
.
findIndex
(
d
=>
d
.
errorCode
===
errcode
);
console
.
log
(
"showQrcode index "
,
index
)
if
(
indexInfo
&&
indexInfo
.
id
){
if
(
indexInfo
&&
indexInfo
.
id
){
this
.
setState
({
this
.
setState
({
currentErrorCode
:
errcode
,
currentErrorCode
:
errcode
,
showStatus
:
showDom
[
3
],
showStatus
:
showDom
[
3
],
tmpUrl
:
`
${
ENV
.
uploadImg
}
/
${
indexInfo
.
id
}
/
${
indexInfo
.
type
}
`
,
tmpUrl
:
`
${
ENV
.
uploadImg
}
/
${
indexInfo
.
id
}
/
${
indexInfo
.
type
}
`
,
tempinitialSlide
:
index
})
})
}
}
}
}
...
@@ -133,12 +141,14 @@ export default class TroubleContainer extends React.Component{
...
@@ -133,12 +141,14 @@ export default class TroubleContainer extends React.Component{
}
}
goBack
(){
goBack
(){
console
.
log
(
"goBack initialSlide "
,
this
.
state
.
initialSlide
)
this
.
setState
({
this
.
setState
({
currentErrorCode
:
0
,
currentErrorCode
:
0
,
showStatus
:
showDom
[
1
],
showStatus
:
showDom
[
1
],
tmpText
:
''
,
tmpText
:
''
,
tmpUrl
:
''
,
tmpUrl
:
''
,
style
:{}
style
:{},
initialSlide
:
this
.
state
.
tempinitialSlide
})
})
}
}
...
@@ -167,6 +177,9 @@ export default class TroubleContainer extends React.Component{
...
@@ -167,6 +177,9 @@ export default class TroubleContainer extends React.Component{
}
}
}
}
onSlideChangeEnd
(
swiper
){
}
getDefaultDom
(){
getDefaultDom
(){
let
{
userInfo
,
storeInfo
,
getRefreshImg
,
deleteImg
,
changePages
,
showPopup
,
hidePopup
}
=
this
.
props
;
let
{
userInfo
,
storeInfo
,
getRefreshImg
,
deleteImg
,
changePages
,
showPopup
,
hidePopup
}
=
this
.
props
;
let
troubleList
=
this
.
state
.
troubleList
;
let
troubleList
=
this
.
state
.
troubleList
;
...
@@ -182,13 +195,32 @@ export default class TroubleContainer extends React.Component{
...
@@ -182,13 +195,32 @@ export default class TroubleContainer extends React.Component{
/>;
/>;
});
});
let
initialSlide
=
this
.
state
.
initialSlide
;
let
swiperOptions
=
{
let
swiperOptions
=
{
width
:
1396
,
width
:
1396
,
spaceBetween
:
30
,
spaceBetween
:
30
,
freeMode
:
true
,
// freeMode:true,
// pagination: '.pagination',
// loop:false,
mode
:
'horizontal'
,
touchRatio
:
0.5
,
longSwipesRatio
:
0.1
,
threshold
:
50
,
lazyLoadingInPrevNext
:
true
,
lazyLoading
:
true
,
followFinger
:
false
,
observer
:
true
,
//修改swiper自己或子元素时,自动初始化swiper
observeParents
:
true
,
//修改swiper的父元素时,自动初始化swiper
lazyLoadingInPrevNextAmount
:
1
,
onSlideChangeEnd
:
this
.
onSlideChangeEnd
,
initialSlide
:
initialSlide
};
};
let
swiperContainer
=
CONFIG
.
swiperContainers
.
troubleSwiperContainer
;
let
swiperContainer
=
CONFIG
.
swiperContainers
.
troubleSwiperContainer
;
let
swiperCount
=
details
.
length
;
let
swiperCount
=
details
.
length
;
console
.
log
(
"render slide "
,
this
.
state
.
initialSlide
)
return
(
return
(
<
div
className=
{
"toubleContainer "
+
(
showTrouble
?
''
:
'hide'
)
}
>
<
div
className=
{
"toubleContainer "
+
(
showTrouble
?
''
:
'hide'
)
}
>
<
HeaderComponent
<
HeaderComponent
...
@@ -204,6 +236,7 @@ export default class TroubleContainer extends React.Component{
...
@@ -204,6 +236,7 @@ export default class TroubleContainer extends React.Component{
<
div
className=
{
"troubleBox"
}
>
<
div
className=
{
"troubleBox"
}
>
<
SwiperComponent
<
SwiperComponent
swiperContainer=
{
swiperContainer
}
swiperOptions=
{
swiperOptions
}
swiperCount=
{
swiperCount
}
swiperContainer=
{
swiperContainer
}
swiperOptions=
{
swiperOptions
}
swiperCount=
{
swiperCount
}
initialSlide=
{
initialSlide
}
>
>
{
dom
}
{
dom
}
</
SwiperComponent
>
</
SwiperComponent
>
...
...
client/index.js
View file @
54f8f3f4
...
@@ -31,5 +31,6 @@ let store = activateVendor();
...
@@ -31,5 +31,6 @@ let store = activateVendor();
// UTILPATH.socket.init(129,17);
// UTILPATH.socket.init(129,17);
UTILPATH
.
socket
.
testIp
(
209
);
UTILPATH
.
socket
.
testIp
(
209
);
// UTILPATH.socket.testIp(199);
renderPage
(
store
);
renderPage
(
store
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment