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
6edfc099
Commit
6edfc099
authored
Dec 07, 2018
by
Zhang Xin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据后台ç»接口修改平板故障上报
parent
b021bb42
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
142 additions
and
255 deletions
+142
-255
client/actions/common.js
+34
-0
client/actions/getTroubles.js
+19
-16
client/components/CommonComponent/TextAreaContainer/TextAreaContainer.jsx
+1
-1
client/components/CommonComponent/TextAreaContainer/index.css
+1
-1
client/components/TroubleComponent/TroubleItemComponent/TroubleItemComponent.jsx
+0
-100
client/containers/PageContainer/PageContainer.jsx
+7
-4
client/containers/RightContainer/RightContainer.jsx
+2
-1
client/containers/TroubleContainer/TroubleContainer.jsx
+78
-132
No files found.
client/actions/common.js
View file @
6edfc099
...
...
@@ -63,6 +63,40 @@ const getUserinfo = (employeeId,storeId)=>{
};
let
mock
=
{
data
:
{
flatCommonVo
:
{
currentTaskName
:
"故障上报"
,
currentTaskNum
:
1
,
currentTaskType
:
"ER"
,
taskId
:
1040
,
totalTaskNum
:
3
,
},
skuFlatVo
:
{
detailList
:
[{
"id"
:
660
,
"storeId"
:
7
,
"errorCode"
:
"ER00021"
,
"type"
:
"KN"
,
"description"
:
"1:回零故障,2:直流电机回位错误或步进电机初始化错误(根据前一条故障代码判断)"
,
"taskId"
:
0
,
"isExistProblem"
:
0
,
"imagesFileId"
:
"3879,3878,3846,3843"
,
"superType"
:
1
,
"subType"
:
2
,
"parentProblemType"
:
0
,
"subProblemType"
:
0
,
"explanation"
:
null
,
"handler"
:
0
,
"parentProblemName"
:
null
,
"subProblemName"
:
null
,
"sellOrderNumber"
:
"0"
}]
}
}
}
//拉取工单
const
getTaskList
=
(
data
=
{})
=>
{
...
...
client/actions/getTroubles.js
View file @
6edfc099
...
...
@@ -2,7 +2,7 @@ import fetch from 'isomorphic-fetch';
import
actionTypes
from
'../actiontype/trouble'
import
userActionTypes
from
"../actiontype/user"
;
import
{
saveHeaderInfo
}
from
'./initHeader'
import
{
saveCommonInfo
}
from
"./common"
;
import
{
saveCommonInfo
,
getTaskList
}
from
"./common"
;
const
domain
=
ENV
.
domain
;
...
...
@@ -178,21 +178,24 @@ const getTroubleList = (info) => {
const
updateTroubleList
=
(
info
,
headerInfo
)
=>
{
let
{
taskInfo
=
{},
userInfo
=
{},
storeInfo
=
{}}
=
headerInfo
;
let
bodyData
=
Object
.
assign
({},
{
details
:
info
},
{
taskId
:
taskInfo
.
taskId
,
employeeId
:
storeInfo
.
employeeId
,
storeId
:
storeInfo
.
id
});
bodyData
=
Object
.
assign
({},
{
details
:
info
},
{
taskId
:
taskInfo
.
taskId
,
employeeId
:
""
,
storeId
:
""
});
return
(
dispatch
)
=>
{
fetch
(
domain
+
'machine_pad/save_all.action'
,
{
credentials
:
'include'
,
method
:
'POST'
,
mode
:
'cors'
,
headers
:
myHeaders
,
body
:
JSON
.
stringify
(
bodyData
)
}).
then
((
response
)
=>
response
.
json
())
.
then
(
json
=>
{
}).
catch
(
e
=>
{
console
.
error
(
e
)
})
}
let
bodyData
=
Object
.
assign
({},
{
details
:
info
},
{
taskId
:
taskInfo
.
taskId
,
employeeId
:
userInfo
.
employeeId
,
storeId
:
storeInfo
.
id
});
console
.
log
(
"updateTroubleList "
,
bodyData
);
//todo 更新故障处理,并且获取新的工单
// return (dispatch) => {
// fetch(domain + 'machine_pad/save_all.action', {
// credentials: 'include',
// method: 'POST',
// mode: 'cors',
// headers: myHeaders,
// body: JSON.stringify(bodyData)
// }).then((response) => response.json())
// .then(json => {
// getTaskList(headerInfo)
// }).catch(e => {
// console.error(e)
// })
// }
};
export
{
getTroubleList
,
updateTroubleList
}
...
...
client/components/CommonComponent/TextAreaContainer/TextAreaContainer.jsx
View file @
6edfc099
...
...
@@ -18,7 +18,7 @@ export default class TextAreaContainer extends React.Component{
componentWillMount
()
{
let
{
text
}
=
this
.
props
;
this
.
setState
({
text
:
text
,
text
:
text
?
text
:
''
,
originText
:
text
,
})
}
...
...
client/components/CommonComponent/TextAreaContainer/index.css
View file @
6edfc099
...
...
@@ -30,7 +30,7 @@
.textAreaContainer
.textAreaDiv
{
width
:
100%
;
background-color
:
#f
5f5f5
;
background-color
:
#f
ff
;
height
:
3.566666666666667rem
;
border
:
2px
solid
#e5e5e5
;
border-radius
:
0.08333333333333333rem
;
...
...
client/components/TroubleComponent/TroubleItemComponent/TroubleItemComponent.jsx
View file @
6edfc099
...
...
@@ -9,15 +9,7 @@ export default class TroubleItemComponent extends React.Component{
super
(
props
)
this
.
state
=
{
text
:
''
,
imgStyle
:{
'height'
:
'100%'
,
}
}
this
.
reRreshImg
=
this
.
reRreshImg
.
bind
(
this
)
this
.
deleteImgById
=
this
.
deleteImgById
.
bind
(
this
)
this
.
confirmDeleteImg
=
this
.
confirmDeleteImg
.
bind
(
this
)
this
.
addImg
=
this
.
addImg
.
bind
(
this
)
this
.
showImg
=
this
.
showImg
.
bind
(
this
)
}
getDes
(
item
){
...
...
@@ -33,98 +25,10 @@ export default class TroubleItemComponent extends React.Component{
return
des
;
}
reRreshImg
(){
let
props
=
this
.
props
;
let
item
=
props
.
item
;
props
.
getRefreshImg
(
item
.
id
,
item
.
type
)
}
addImg
(){
let
props
=
this
.
props
;
let
item
=
props
.
item
;
props
.
showQrcode
(
item
.
errorCode
)
}
deleteImgById
(
fileId
){
console
.
log
(
"deleteImgById :"
,
fileId
);
let
props
=
this
.
props
;
let
{
deleteImg
,
hidePopup
}
=
props
;
let
item
=
props
.
item
;
let
errorId
=
item
.
id
;
let
type
=
item
.
type
;
hidePopup
();
deleteImg
(
errorId
,
type
,
fileId
)
}
confirmDeleteImg
(
fileId
){
let
{
showPopup
,
hidePopup
}
=
this
.
props
;
let
btnWidth
=
UTILPATH
.
getRemByPx
(
260
);
let
btnMarginLeft
=
UTILPATH
.
getRemByPx
(
30
);
let
btnDom1
=
<
Button
key=
{
"confirmDeleteTroubleImg1"
}
style=
{
{
'width'
:
btnWidth
}
}
text=
{
"取消"
}
option=
{
hidePopup
}
/>
let
btnDom2
=
<
Button
key=
{
"confirmDeleteTroubleImg2"
}
style=
{
{
'width'
:
btnWidth
,
'marginLeft'
:
btnMarginLeft
}
}
text=
{
"确定"
}
option=
{
()
=>
this
.
deleteImgById
(
fileId
)
}
/>
let
popDom
=
<
PopModel
popupText=
{
"确定删除此照片吗"
}
popupButtons=
{
[
btnDom1
,
btnDom2
]
}
/>
showPopup
({
popupChild
:
popDom
});
// showPopup({
// popupText:'确定删除此照片吗',
// popupButtons:[btnDom1,btnDom2]
// })
}
showImg
(
imgSrc
){
let
{
showPopup
,
hidePopup
}
=
this
.
props
;
let
showImgDom
=
<
div
onClick=
{
()
=>
hidePopup
()
}
className=
{
"showBigImg"
}
>
<
img
src=
{
imgSrc
}
alt=
""
/>
</
div
>;
let
popDom
=
<
PopModel
popupTitle=
{
""
}
classContainer=
{
"troubleContainerPopup"
}
>
{
showImgDom
}
</
PopModel
>;
showPopup
({
popupChild
:
popDom
});
// showPopup({
// popupChild : showImgDom,
// showPopup : true
// });
}
render
(){
let
props
=
this
.
props
;
let
item
=
props
.
item
?
props
.
item
:
{};
let
description
=
this
.
getDes
(
item
);
let
imgFiles
=
Array
.
isArray
(
item
.
files
)
?
item
.
files
.
map
((
f
,
k
)
=>
{
return
<
ImageComponent
key=
{
"troubleItemImg"
+
k
}
noCloseBtn=
{
false
}
handleClikCloseFunc
=
{()=
>
this.confirmDeleteImg(f.id)}
handleClikImgFunc =
{
()
=>
{
this
.
showImg
(
f
.
filePath
)}
}
type=
{
"custom"
}
imgSrc =
{
f
.
filePath
}
/
>
}) : [];
let imgLength = imgFiles.length;
if(imgLength
<
9){
imgFiles
.
push
(<
ImageComponent
showSrc=
{
true
}
key=
{
"troubleItemImgadd"
+
imgLength
}
disabled=
{
!
(
item
.
isExistProblem
&&
parseInt
(
item
.
isExistProblem
)
===
1
)
}
type=
{
"add"
}
handleClikImgFunc
=
{
this
.
addImg
}
noCloseBtn
=
{
true
}
/>
);
imgLength++;
}
imgFiles.push(
<
ImageComponent
key=
{
"troubleItemImgrefresh"
+
imgLength
}
handleClikImgFunc
=
{
this
.
reRreshImg
}
type=
{
"refresh"
}
noCloseBtn
=
{
true
}
/>
);
let swiperOptions =
{
width
:
90
,
spaceBetween
:
20
,
// 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
:
11
,
}
;
let swiperContainer = CONFIG.swiperContainers.troubleSwiperImgContainer + item.errorCode;
let swiperCount = imgLength+1;
let
text
=
""
;
if
(
item
.
explanation
){
text
=
item
.
explanation
.
length
>
200
?
item
.
explanation
.
substring
(
0
,
200
)
+
'...'
:
item
.
explanation
...
...
@@ -162,10 +66,6 @@ export default class TroubleItemComponent extends React.Component{
</
div
>
</
div
>
<
div
className=
{
"itemControl rel"
}
>
{
imgFiles
}
</
div
>
</
div
>
)
}
...
...
client/containers/PageContainer/PageContainer.jsx
View file @
6edfc099
...
...
@@ -117,7 +117,7 @@ class PageContainer extends React.Component {
this
.
taskTypeOption
=
{
'
ER
'
:
this
.
showTroublePage
,
'
FIRST
'
:
this
.
showTroublePage
,
'SECOND'
:
this
.
showSecondTroubelPage
};
}
...
...
@@ -151,10 +151,10 @@ class PageContainer extends React.Component {
dispatch
(
getStoreInfo
(
data
.
storeId
));
// dispatch(saveCommonInfo({ip:"192.168.10.128"}));
// dispatch(getStoreInfo(
20
));
// dispatch(getStoreInfo(
13
));
// dispatch(saveCommonInfo({userInfo:{employeeId:9}}));
// dispatch(getUserinfo(9,
20
))
// dispatch(saveCommonInfo(Object.assign({},{taskInfo:{area:'
B
'}})))
// dispatch(getUserinfo(9,
13
))
// dispatch(saveCommonInfo(Object.assign({},{taskInfo:{area:'
A
'}})))
// dispatch(saveCommonInfo({userInfo:{employeeId:20}}));
// dispatch(getUserinfo(20,data.storeId));
});
...
...
@@ -739,6 +739,9 @@ class PageContainer extends React.Component {
case showPage[12]:
pages =
<
TroubleContainer
headerInfo=
{
commonInfo
}
showPopup=
{
(
info
)
=>
this
.
showPopup
(
info
)
}
hidePopup=
{
()
=>
this
.
hidePopup
()
}
updateTroubleList=
{
(
info
)
=>
dispatch
(
updateTroubleList
(
info
,
commonInfo
))
}
/>
break;
case showPage[131]:
...
...
client/containers/RightContainer/RightContainer.jsx
View file @
6edfc099
...
...
@@ -6,8 +6,9 @@ export default class RightContainer extends React.Component{
}
render
(){
let
{
style
=
{}}
=
this
.
props
;
return
(
<
div
className=
{
"rightContainer"
}
>
<
div
className=
{
"rightContainer"
}
style=
{
style
}
>
{
this
.
props
.
children
}
</
div
>
)
...
...
client/containers/TroubleContainer/TroubleContainer.jsx
View file @
6edfc099
...
...
@@ -29,38 +29,45 @@ export default class TroubleContainer extends React.Component{
showStatus
:
showDom
[
1
],
style
:
{},
initialSlide
:
0
,
tempinitialSlide
:
0
tempinitialSlide
:
0
,
btnClock
:
false
};
this
.
setItem
=
this
.
setItem
.
bind
(
this
);
this
.
showText
=
this
.
showText
.
bind
(
this
);
this
.
showQrcode
=
this
.
showQrcode
.
bind
(
this
);
this
.
goBack
=
this
.
goBack
.
bind
(
this
);
this
.
saveText
=
this
.
saveText
.
bind
(
this
);
this
.
getDefaultDom
=
this
.
getDefaultDom
.
bind
(
this
);
this
.
getDefaultDoms
=
this
.
getDefaultDoms
.
bind
(
this
);
this
.
getTextAreaDom
=
this
.
getTextAreaDom
.
bind
(
this
);
this
.
getQrcodeDom
=
this
.
getQrcodeDom
.
bind
(
this
);
this
.
updateImg
=
this
.
updateImg
.
bind
(
this
);
this
.
dealTrouble
=
this
.
dealTrouble
.
bind
(
this
);
this
.
setStyle
=
this
.
setStyle
.
bind
(
this
);
this
.
onSlideChangeEnd
=
this
.
onSlideChangeEnd
.
bind
(
this
);
this
.
abandonSaveText
=
this
.
abandonSaveText
.
bind
(
this
);
this
.
changeIsSend
=
this
.
changeIsSend
.
bind
(
this
);
}
componentWillMount
(){
let
{
troubleList
,
initTroubleList
}
=
this
.
props
;
// initTroubleList({storeId: 7, employeeId: 5, token: "966D5C0B-3CF2-420D-B9A3-313BA37DE092"})
;
let
{
headerInfo
}
=
this
.
props
;
let
{
taskList
=
{}}
=
headerInfo
;
this
.
setState
({
troubleList
:
troubleList
troubleList
:
taskList
})
}
componentWillUnmount
(){
this
.
setState
({
btnClock
:
false
})
}
componentWillReceiveProps
(
nextProps
){
let
troubleList
=
nextProps
.
troubleList
;
let
nowTroubleList
=
this
.
state
.
troubleList
;
let
troubleErrorCodeList
=
Array
.
isArray
(
troubleList
.
details
)
?
troubleList
.
details
.
map
(
i
=>
i
.
errorCode
)
:
[];
let
nowtroubleErrorCodeList
=
Array
.
isArray
(
nowTroubleList
.
details
)
?
nowTroubleList
.
details
.
map
(
i
=>
i
.
errorCode
)
:
[];
console
.
log
(
"componentWillReceiveProps "
,
nextProps
)
let
{
headerInfo
}
=
this
.
props
;
let
{
taskList
=
{}}
=
headerInfo
;
let
nextHeaderInfo
=
nextProps
.
headerInfo
;
let
nextTaskList
=
nextHeaderInfo
?
nextHeaderInfo
.
taskList
:
{};
let
troubleErrorCodeList
=
Array
.
isArray
(
taskList
.
detailList
)
?
taskList
.
detailList
.
map
(
i
=>
i
.
errorCode
)
:
[];
let
nowtroubleErrorCodeList
=
Array
.
isArray
(
nextTaskList
.
detailList
)
?
nextTaskList
.
detailList
.
map
(
i
=>
i
.
errorCode
)
:
[];
//上一次和这一次不一样
let
troubleErrorCodeListStr
=
troubleErrorCodeList
.
join
(
","
);
...
...
@@ -70,54 +77,17 @@ export default class TroubleContainer extends React.Component{
troubleErrorCodeListStr
!==
nowtroubleErrorCodeListStr
){
this
.
setState
({
troubleList
:
trouble
List
troubleList
:
nextTask
List
})
}
let
refreshImg
=
nextProps
.
refreshImg
;
if
(
refreshImg
&&
refreshImg
.
files
&&
refreshImg
.
errorId
&&
refreshImg
.
type
){
this
.
updateImg
(
refreshImg
);
}
// let lastRefreshImg = this.props.refreshImg;
// if(
// (
// !lastRefreshImg && (refreshImg && refreshImg.errorId && refreshImg.type && refreshImg.files)
// ) ||
// (
// lastRefreshImg && refreshImg && lastRefreshImg.errorId !== refreshImg.errorId
// ) ||
// (
// lastRefreshImg && refreshImg && lastRefreshImg.type !== refreshImg.type
// ) ||
// (
// lastRefreshImg && refreshImg && lastRefreshImg.files && refreshImg.files && refreshImg.files.length !== lastRefreshImg.files.length
// )
//
// ){
// this.updateImg(refreshImg);
// }
}
updateImg
(
info
){
let
{
emptyImg
}
=
this
.
props
;
let
id
=
info
.
errorId
;
let
type
=
info
.
type
;
let
files
=
info
.
files
;
let
troubleList
=
this
.
state
.
troubleList
;
let
details
=
troubleList
.
details
;
let
indexInfo
=
details
.
find
(
d
=>
d
.
id
===
id
&&
d
.
type
===
type
);
if
(
indexInfo
&&
indexInfo
.
id
){
this
.
setItem
(
indexInfo
.
errorCode
,
"files"
,
files
,()
=>
{
emptyImg
()
});
}
}
showText
(
errcode
){
let
troubleList
=
this
.
state
.
troubleList
;
let
details
=
troubleList
.
detail
s
;
let
details
=
troubleList
.
detail
List
;
let
indexInfo
=
details
.
find
(
d
=>
d
.
errorCode
===
errcode
);
let
index
=
details
.
findIndex
(
d
=>
d
.
errorCode
===
errcode
);
if
(
indexInfo
&&
indexInfo
.
id
){
...
...
@@ -131,40 +101,9 @@ export default class TroubleContainer extends React.Component{
}
}
showQrcode
(
errcode
){
let
troubleList
=
this
.
state
.
troubleList
;
let
details
=
troubleList
.
details
;
let
indexInfo
=
details
.
find
(
d
=>
d
.
errorCode
===
errcode
);
let
index
=
details
.
findIndex
(
d
=>
d
.
errorCode
===
errcode
);
if
(
indexInfo
&&
indexInfo
.
id
){
this
.
setState
({
currentErrorCode
:
errcode
,
showStatus
:
showDom
[
3
],
tmpUrl
:
`
${
ENV
.
uploadImg
}
/
${
indexInfo
.
id
}
/
${
indexInfo
.
type
}
`
,
tempinitialSlide
:
index
})
}
}
handleDeleteImg
(
errorId
,
type
,
fileId
){
let
{
deleteImg
}
=
this
.
props
;
let
troubleList
=
this
.
state
.
troubleList
;
let
details
=
troubleList
.
details
;
let
index
=
details
.
findIndex
(
d
=>
d
.
id
===
errorId
&&
d
.
type
===
type
);
if
(
index
>
-
1
){
this
.
setState
({
tempinitialSlide
:
index
,
initialSlide
:
index
,
},()
=>
{
deleteImg
(
errorId
,
type
,
fileId
)
})
}
}
setItem
(
errcode
,
option
,
info
,
callback
){
let
troubleList
=
this
.
state
.
troubleList
;
let
details
=
troubleList
.
detail
s
;
let
details
=
troubleList
.
detail
List
;
let
index
=
details
.
findIndex
(
d
=>
d
.
errorCode
===
errcode
);
if
(
index
>
-
1
){
details
[
index
][
option
]
=
info
;
...
...
@@ -217,50 +156,52 @@ export default class TroubleContainer extends React.Component{
}
dealTrouble
(){
let
{
showPopup
,
hidePopup
,
updateTroubleList
}
=
this
.
props
;
let
troubleList
=
this
.
state
.
troubleList
;
let
details
=
troubleList
.
details
;
let
arr
=
details
.
filter
(
d
=>
{
return
!
d
.
isExistProblem
||
(
d
.
isExistProblem
===
1
&&
!
d
.
explanation
)
});
let
btnWidth
=
UTILPATH
.
getRemByPx
(
260
);
let
btnDom
=
<
Button
btnContainer=
{
"btne5"
}
key=
{
"dealTrouble1"
}
style=
{
{
'width'
:
btnWidth
}
}
text=
{
"关闭"
}
option=
{
hidePopup
}
/>
if
(
arr
&&
arr
.
length
>
0
){
let
popDom
=
<
PopModel
popupText=
{
"请完成所有需要处理的故障的必填项"
}
popupButtons=
{
[
btnDom
]
}
/>
showPopup
({
popupChild
:
popDom
});
}
else
{
details
.
forEach
((
d
)
=>
{
d
.
imagesFileId
=
Array
.
isArray
(
d
.
files
)
?
d
.
files
.
map
(
f
=>
f
.
id
).
join
(
','
)
:
d
.
imagesFileId
;
});
updateTroubleList
(
details
);
if
(
!
this
.
state
.
btnClock
){
this
.
setState
({
showTrouble
:
false
btnClock
:
true
},()
=>
{
let
{
showPopup
,
hidePopup
,
updateTroubleList
}
=
this
.
props
;
let
troubleList
=
this
.
state
.
troubleList
;
let
details
=
troubleList
.
detailList
;
let
arr
=
details
.
filter
(
d
=>
{
return
!
d
.
isExistProblem
||
(
d
.
isExistProblem
===
1
&&
!
d
.
explanation
)
});
let
btnWidth
=
UTILPATH
.
getRemByPx
(
260
);
let
btnDom
=
<
Button
btnContainer=
{
"btne5"
}
key=
{
"dealTrouble1"
}
style=
{
{
'width'
:
btnWidth
}
}
text=
{
"关闭"
}
option=
{
hidePopup
}
/>
if
(
arr
&&
arr
.
length
>
0
){
let
popDom
=
<
PopModel
popupText=
{
"请完成所有需要处理的故障的必填项"
}
popupButtons=
{
[
btnDom
]
}
/>
showPopup
({
popupChild
:
popDom
});
this
.
setState
({
btnClock
:
false
})
}
else
{
this
.
setState
({
showTrouble
:
false
},()
=>
{
updateTroubleList
(
details
);
})
}
})
}
}
onSlideChangeEnd
(
swiper
){
}
getDefaultDom
(){
let
{
headerInfo
,
getRefreshImg
,
deleteImg
,
changePages
,
showPopup
,
hidePopup
}
=
this
.
props
;
let
{
showPopup
,
hidePopup
}
=
this
.
props
;
let
troubleList
=
this
.
state
.
troubleList
;
let
showTrouble
=
Array
.
isArray
(
troubleList
.
details
)
&&
troubleList
.
details
.
length
>
0
;
let
details
=
Array
.
isArray
(
troubleList
.
details
)
?
troubleList
.
details
:
[];
console
.
log
(
details
);
let
imgLength
=
details
.
map
(
d
=>
Array
.
isArray
(
d
.
files
)
?
d
.
files
.
length
:
0
).
reduce
((
pre
,
next
)
=>
{
return
pre
+
next
},
0
);
let
showTrouble
=
Array
.
isArray
(
troubleList
.
detailList
)
&&
troubleList
.
detailList
.
length
>
0
;
let
details
=
Array
.
isArray
(
troubleList
.
detailList
)
?
troubleList
.
detailList
:
[];
let
dom
=
details
.
map
((
i
,
k
)
=>
{
return
<
TroubleItem
key=
{
k
}
item=
{
i
}
num=
{
k
+
1
}
setItem=
{
this
.
setItem
}
showText=
{
this
.
showText
}
showQrcode=
{
this
.
showQrcode
}
getRefreshImg=
{
getRefreshImg
}
deleteImg=
{
(
errorId
,
type
,
fileId
)
=>
this
.
handleDeleteImg
(
errorId
,
type
,
fileId
)
}
showText=
{
this
.
showText
}
showPopup=
{
showPopup
}
hidePopup=
{
hidePopup
}
/>;
});
let
initialSlide
=
this
.
state
.
initialSlide
;
let
swiperCount
=
details
.
length
+
imgLength
;
let
swiperCount
=
details
.
length
;
let
swiperOptions
=
{
// width : 1396,
slidesPerView
:
"auto"
,
...
...
@@ -276,7 +217,6 @@ export default class TroubleContainer extends React.Component{
observer
:
true
,
//修改swiper自己或子元素时,自动初始化swiper
observeParents
:
true
,
//修改swiper的父元素时,自动初始化swiper
lazyLoadingInPrevNextAmount
:
1
,
onSlideChangeEnd
:
this
.
onSlideChangeEnd
,
initialSlide
:
initialSlide
};
let
swiperContainer
=
CONFIG
.
swiperContainers
.
troubleSwiperContainer
;
...
...
@@ -284,11 +224,6 @@ export default class TroubleContainer extends React.Component{
return
(
<
div
className=
{
"toubleContainer "
+
(
showTrouble
?
''
:
'hide'
)
}
>
{
/* <HeaderComponent
showHeader={CONFIG.headerStatus[1]}
headerInfo={headerInfo}
/> */
}
{
this
.
state
.
showTrouble
?
<
div
className=
{
"troubleContent "
+
(
this
.
state
.
showTrouble
?
''
:
'hide'
)
}
>
...
...
@@ -307,7 +242,7 @@ export default class TroubleContainer extends React.Component{
</
div
>
</
div
>
</
div
>
:
<
FinishTrouble
changePages=
{
changePages
}
/>
</
div
>
:
null
}
</
div
>
)
...
...
@@ -328,18 +263,34 @@ export default class TroubleContainer extends React.Component{
/>
}
getQrcodeDom
(){
return
<
Qrcode
goBack=
{
this
.
goBack
}
url=
{
this
.
state
.
tmpUrl
}
/>
getDefaultDoms
(){
let
props
=
this
.
props
;
let
{
headerInfo
=
{}}
=
props
;
return
(
<
div
>
<
HeaderComponent
showHeader=
{
CONFIG
.
headerStatus
[
1
]
}
headerInfo=
{
headerInfo
}
showLogoutPopup=
{
this
.
showLogoutPopup
}
/>
<
LeftContainer
leftInfo=
{
props
.
headerInfo
}
/>
<
RightContainer
style=
{
{
background
:
'transparent'
}
}
>
<
div
className=
{
"troubleContainers"
}
style=
{
this
.
state
.
style
}
>
{
this
.
getDefaultDom
()
}
</
div
>
</
RightContainer
>
</
div
>
)
}
getDom
(){
switch
(
this
.
state
.
showStatus
){
case
showDom
[
1
]:
return
this
.
getDefaultDom
();
return
this
.
getDefaultDom
s
();
case
showDom
[
2
]:
return
this
.
getTextAreaDom
();
case
showDom
[
3
]:
return
this
.
getQrcodeDom
();
default
:
return
null
;
}
...
...
@@ -349,14 +300,9 @@ export default class TroubleContainer extends React.Component{
render
(){
return
(
<
div
>
<
LeftContainer
leftInfo=
{
props
.
headerInfo
}
/>
<
RightContainer
>
<
div
className=
{
"troubleContainers "
+
(
this
.
state
.
showStatus
===
showDom
[
2
]
?
'backfff'
:
''
)
}
style=
{
this
.
state
.
style
}
>
{
this
.
getDom
()
}
</
div
>
</
RightContainer
>
{
this
.
getDom
()
}
</
div
>
)
}
...
...
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