Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
frontend
Project
Project
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
Schedules
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
h5-communicate
frontend
Commits
8e10f9fb
Commit
8e10f9fb
authored
Jun 09, 2020
by
熊成伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
3fedbcb5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
310 additions
and
105 deletions
+310
-105
workspace.xml
.idea/workspace.xml
+0
-0
AddressUser.jsx
src/components/AddressList/AddressUser.jsx
+32
-0
index.jsx
src/components/AddressList/index.jsx
+4
-5
index.jsx
src/components/TopSearch/index.jsx
+1
-1
CardItem.jsx
src/components/WorkCard/CardItem.jsx
+2
-2
index.jsx
src/components/WorkCard/index.jsx
+2
-1
CommonLayout.jsx
src/layout/CommonLayout.jsx
+1
-1
Backlog.jsx
src/pages/Backlog/Backlog.jsx
+12
-5
AddressBook.jsx
src/pages/Communicate/AddressBook.jsx
+27
-0
Communicate.jsx
src/pages/Communicate/Communicate.jsx
+98
-68
Process.jsx
src/pages/EventProcessing/Process.jsx
+3
-1
index.jsx
src/pages/Login/index.jsx
+5
-4
Notice.jsx
src/pages/Notice/Notice.jsx
+17
-5
Work.jsx
src/pages/Work/Work.jsx
+17
-9
WorkDetail.jsx
src/pages/Work/WorkDetail.jsx
+78
-0
index.less
src/pages/Work/index.less
+6
-0
WorkDetail.jsx
src/pages/WorkDetail/WorkDetail.jsx
+0
-0
router.js
src/router.js
+3
-1
instance.js
src/utils/instance.js
+2
-2
No files found.
.idea/workspace.xml
View file @
8e10f9fb
This diff is collapsed.
Click to expand it.
src/components/AddressList/AddressUser.jsx
0 → 100644
View file @
8e10f9fb
import
React
from
'react'
;
import
'./index.less'
const
Index
=
(
props
)
=>
{
const
data
=
props
.
data
;
return
(
<
div
className=
"address-box"
>
{
data
.
map
((
item
,
index
)
=>
item
.
title
&&
(
<
div
key=
{
index
}
>
<
div
className=
"address-item"
>
1111111111
</
div
>
{
item
.
children
.
map
((
child
,
index2
)
=>
(
<
div
className=
"address-item"
key=
{
index2
}
>
<
div
>
<
img
alt=
""
src=
""
className=
""
/>
{
child
.
title
||
'11'
}
</
div
>
<
div
>
<
img
alt=
""
className=
'smallIco mr-5'
src=
'/img/tel.png'
/>
13488876526
</
div
>
</
div
>
))
}
</
div
>
))
}
</
div
>
);
};
export
default
Index
;
src/components/AddressList/index.jsx
View file @
8e10f9fb
import
React
from
'react'
;
import
React
from
'react'
;
import
'./index.less'
import
'./index.less'
const
Index
=
(
props
)
=>
{
const
data
=
[{},
{},
{},
{}]
const
data
=
props
.
data
;
const
Index
=
()
=>
{
return
(
return
(
<
div
className=
"address-box"
>
<
div
className=
"address-box"
>
{
data
.
map
((
item
,
index
)
=>
(
{
data
.
map
((
item
,
index
)
=>
item
.
title
&&
(
<
div
className=
"address-item"
>
<
div
className=
"address-item"
>
cccc
{
item
.
title
||
'11'
}
<
img
src=
"/img/rarrow.png"
alt=
""
className=
'icon18'
/>
<
img
src=
"/img/rarrow.png"
alt=
""
className=
'icon18'
/>
</
div
>
</
div
>
))
}
))
}
...
...
src/components/TopSearch/index.jsx
View file @
8e10f9fb
...
@@ -10,7 +10,7 @@ const Index = (props) => {
...
@@ -10,7 +10,7 @@ const Index = (props) => {
const
input
=
document
.
getElementsByClassName
(
"top-single-search"
);
const
input
=
document
.
getElementsByClassName
(
"top-single-search"
);
props
.
onSearch
(
input
[
0
].
value
);
props
.
onSearch
(
input
[
0
].
value
);
let
inputValue
=
input
[
0
].
value
;
let
inputValue
=
input
[
0
].
value
;
setStatus
(
inputValue
!=
null
&&
inputValue
!=
undefined
&&
inputValue
!
=
''
)
setStatus
(
inputValue
!=
null
&&
inputValue
!==
''
)
};
};
const
clear
=
()
=>
{
const
clear
=
()
=>
{
setStatus
(
false
)
setStatus
(
false
)
...
...
src/components/WorkCard/CardItem.jsx
View file @
8e10f9fb
...
@@ -3,7 +3,7 @@ import './index.less'
...
@@ -3,7 +3,7 @@ import './index.less'
const
CardItem
=
(
props
)
=>
{
const
CardItem
=
(
props
)
=>
{
const
{
data
,
addStatus
,
type
,
addCommon
,
iconAction
}
=
props
;
const
{
data
,
addStatus
,
type
,
addCommon
,
iconAction
,
workUrl
}
=
props
;
const
[
status
,
setStatus
]
=
useState
(
false
);
const
[
status
,
setStatus
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -11,7 +11,7 @@ const CardItem = (props) => {
...
@@ -11,7 +11,7 @@ const CardItem = (props) => {
},
[
addStatus
])
},
[
addStatus
])
const
contentCLick
=
()
=>
{
const
contentCLick
=
()
=>
{
!
status
&&
!
data
.
iconAdd
&&
console
.
log
(
data
.
text
);
!
status
&&
!
data
.
iconAdd
&&
workUrl
(
'/blank/work/1'
)
data
.
iconAdd
&&
addCommon
()
data
.
iconAdd
&&
addCommon
()
};
};
const
iconClick
=
()
=>
{
const
iconClick
=
()
=>
{
...
...
src/components/WorkCard/index.jsx
View file @
8e10f9fb
...
@@ -3,7 +3,7 @@ import './index.less'
...
@@ -3,7 +3,7 @@ import './index.less'
import
CardItem
from
'./CardItem'
import
CardItem
from
'./CardItem'
const
Index
=
(
props
)
=>
{
const
Index
=
(
props
)
=>
{
const
{
title
,
type
,
addStatus
,
addCommon
,
data
,
iconAction
}
=
props
;
const
{
title
,
type
,
addStatus
,
addCommon
,
data
,
iconAction
,
workUrl
}
=
props
;
const
emptyIcon
=
type
===
'edit'
?
{
const
emptyIcon
=
type
===
'edit'
?
{
text
:
addStatus
?
'完成添加'
:
'添加常用'
,
icon
:
addStatus
?
'/img/finish-work.png'
:
'/img/add-work.png'
,
iconAdd
:
true
text
:
addStatus
?
'完成添加'
:
'添加常用'
,
icon
:
addStatus
?
'/img/finish-work.png'
:
'/img/add-work.png'
,
iconAdd
:
true
}
:
{};
}
:
{};
...
@@ -23,6 +23,7 @@ const Index = (props) => {
...
@@ -23,6 +23,7 @@ const Index = (props) => {
type=
{
type
}
type=
{
type
}
key=
{
index
}
key=
{
index
}
data=
{
item
}
data=
{
item
}
workUrl=
{
workUrl
}
addStatus=
{
addStatus
}
addStatus=
{
addStatus
}
addCommon=
{
addCommon
}
addCommon=
{
addCommon
}
iconAction=
{
iconAction
}
iconAction=
{
iconAction
}
...
...
src/layout/CommonLayout.jsx
View file @
8e10f9fb
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
}
from
'react'
;
import
Footer
from
'./Footer'
import
Footer
from
'./Footer'
import
{
withRouter
}
from
'react-router-dom'
import
{
withRouter
}
from
'react-router-dom'
import
'./index.less'
import
'./index.less'
...
...
src/pages/Backlog/Backlog.jsx
View file @
8e10f9fb
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
WhiteSpace
,
WingBlank
,
ActivityIndicator
}
from
'antd-mobile'
import
{
WhiteSpace
,
WingBlank
,
ActivityIndicator
}
from
'antd-mobile'
import
TodoCard
from
'../../components/LogCard'
import
TodoCard
from
'../../components/LogCard'
import
TopSearch
from
'../../components/TopSearch'
import
TopSearch
from
'../../components/TopSearch'
;
import
axiosRequest
from
'../../utils/request'
;
const
Backlog
=
(
props
)
=>
{
const
Backlog
=
(
props
)
=>
{
const
[
current
,
setCurrent
]
=
useState
(
1
);
const
[
current
,
setCurrent
]
=
useState
(
1
);
...
@@ -15,11 +16,18 @@ const Backlog = (props) => {
...
@@ -15,11 +16,18 @@ const Backlog = (props) => {
props
.
history
.
push
(
`/blank/info/example/1`
)
props
.
history
.
push
(
`/blank/info/example/1`
)
};
};
const
getData
=
()
=>
{
const
getData
=
()
=>
{
setLoading
(
false
)
const
pageMap
=
{
searchWord
,
nowPage
:
current
,
pageSize
:
10
};
const
pageMap
=
{
searchWord
,
nowPage
:
current
,
pageSize
:
10
}
console
.
log
(
pageMap
)
setLoading
(
true
)
axiosRequest
({
method
:
'post'
,
url
:
'/dgbg/mobileGetOperates.view?userName=2012012099&clientFlag=123456'
,
}).
then
(
res
=>
{
setLoading
(
false
);
let
result
=
data
.
concat
([{},
{},
{},
{},
{},
{}])
let
result
=
data
.
concat
([{},
{},
{},
{},
{},
{}])
setData
(
result
)
setData
(
result
)
setCurrent
(
current
+
1
)
setCurrent
(
current
+
1
)
});
};
};
//下拉加载
//下拉加载
...
@@ -29,7 +37,6 @@ const Backlog = (props) => {
...
@@ -29,7 +37,6 @@ const Backlog = (props) => {
const
scrollHeight
=
event
.
scrollHeight
;
const
scrollHeight
=
event
.
scrollHeight
;
const
clientHeight
=
event
.
clientHeight
;
const
clientHeight
=
event
.
clientHeight
;
if
(
top
+
clientHeight
===
scrollHeight
)
{
if
(
top
+
clientHeight
===
scrollHeight
)
{
setLoading
(
true
);
getData
()
getData
()
}
}
};
};
...
@@ -38,6 +45,7 @@ const Backlog = (props) => {
...
@@ -38,6 +45,7 @@ const Backlog = (props) => {
return
()
=>
window
.
removeEventListener
(
'scroll'
,
handleScroll
,
true
);
return
()
=>
window
.
removeEventListener
(
'scroll'
,
handleScroll
,
true
);
},
[
data
]);
},
[
data
]);
//回到顶部
useEffect
(()
=>
{
useEffect
(()
=>
{
const
element
=
document
.
getElementById
(
'common-content'
)
const
element
=
document
.
getElementById
(
'common-content'
)
element
.
scrollTo
(
0
,
0
)
element
.
scrollTo
(
0
,
0
)
...
@@ -61,7 +69,6 @@ const Backlog = (props) => {
...
@@ -61,7 +69,6 @@ const Backlog = (props) => {
))
))
}
}
</
WingBlank
>
</
WingBlank
>
);
);
};
};
...
...
src/pages/Communicate/AddressBook.jsx
0 → 100644
View file @
8e10f9fb
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
AddressList
from
'../../components/AddressList'
;
import
AddressUser
from
'../../components/AddressList/AddressUser'
;
const
AddressBook
=
(
props
)
=>
{
return
(
<
div
>
<
div
className=
'breadBox'
>
<
span
className=
'currentLink'
>
科技创新委员会
</
span
>
<
span
className=
'symbol'
>
>
</
span
>
<
span
>
组织架构
</
span
>
<
span
className=
'symbol'
>
>
</
span
>
<
span
>
办公厅
</
span
>
</
div
>
<
div
className=
'adMainBox'
>
<
AddressList
data=
{
[{
title
:
'1'
},
{
title
:
2
},
{
title
:
3
}]
}
/>
<
AddressUser
data=
{
[{
title
:
'1'
,
children
:
[{},
{},
{}]},
{
title
:
2
,
children
:
[{},
{},
{}]},
{
title
:
3
,
children
:
[{},
{},
{}]}]
}
/>
</
div
>
</
div
>
);
};
export
default
AddressBook
;
src/pages/Communicate/Communicate.jsx
View file @
8e10f9fb
import
React
,
{
Component
}
from
'react'
;
// import React, {Component} from 'react';
import
'./index.less'
// import './index.less'
//
// class Communicate extends Component {
//
// render() {
// return (
// <div>
// <div className='breadBox'>
// <span className='currentLink'>科技创新委员会</span><span className='symbol'>></span><span>组织架构</span><span className='symbol'>></span><span>办公厅</span>
// </div>
// <div className='adMainBox'>
// <ul className='adListBox'>
// <li>
// <div className='itemBox'>
// <h4 className='titleBar'>市委办公厅审核员</h4>
// <div className='adContent'>
// <div className='peopleList'>
// <p className='subItem'>
// <span className='cicrleHead mr-5'>
// <img src='/img/head.png' className='imgRes' />
// </span>
// 王磊
// </p>
// <p className='subItem'>
// <img className='smallIco mr-5' src='/img/tel.png' />13488876526
// </p>
// </div>
// <div className='peopleList'>
// <p className='subItem'>
// <span className='cicrleHead mr-5 centerFont'>
// 王
// </span>
// 王磊
// </p>
// <p className='subItem'>
// <img className='smallIco mr-5' src='/img/tel.png' />13488876526
// </p>
// </div>
// </div>
// </div>
// </li>
// <li>
// <div className='itemBox'>
// <h4 className='titleBar'>市委办公厅审核员</h4>
// <div className='adContent'>
// <div className='peopleList'>
// <p className='subItem'>
// <span className='cicrleHead mr-5'>
// <img src='/img/head.png' className='imgRes' />
// </span>
// 王磊
// </p>
// <p className='subItem'>
// <img className='smallIco mr-5' src='/img/tel.png' />13488876526
// </p>
// </div>
// <div className='peopleList'>
// <p className='subItem'>
// <span className='cicrleHead mr-5 centerFont'>
// 王
// </span>
// 王磊
// </p>
// <p className='subItem'>
// <img className='smallIco mr-5' src='/img/tel.png' />13488876526
// </p>
// </div>
// </div>
// </div>
// </li>
// </ul>
// </div>
// </div>
// );
// }
// }
//
// export default Communicate;
class
Communicate
extends
Component
{
render
()
{
import
React
from
'react'
;
import
AddressList
from
'../../components/AddressList'
;
import
AddressUser
from
'../../components/AddressList/AddressUser'
;
const
AddressBook
=
(
props
)
=>
{
return
(
return
(
<
div
>
<
div
>
<
div
className=
'breadBox'
>
<
div
className=
'breadBox'
>
<
span
className=
'currentLink'
>
科技创新委员会
</
span
><
span
className=
'symbol'
>
>
</
span
><
span
>
组织架构
</
span
><
span
className=
'symbol'
>
>
</
span
><
span
>
办公厅
</
span
>
<
span
className=
'currentLink'
>
科技创新委员会
</
span
>
<
span
className=
'symbol'
>
>
</
span
>
<
span
>
组织架构
</
span
>
<
span
className=
'symbol'
>
>
</
span
>
<
span
>
办公厅
</
span
>
</
div
>
</
div
>
<
div
className=
'adMainBox'
>
<
div
className=
'adMainBox'
>
<
ul
className=
'adListBox'
>
<
AddressList
data=
{
[{
title
:
'1'
},
{
title
:
2
},
{
title
:
3
}]
}
/>
<
li
>
<
div
className=
'itemBox'
>
<
AddressUser
data=
{
[{
title
:
'1'
,
children
:
[{},
{},
{}]},
{
title
:
2
,
children
:
[{},
{},
{}]},
{
title
:
3
,
children
:
[{},
{},
{}]}]
}
/>
<
h4
className=
'titleBar'
>
市委办公厅审核员
</
h4
>
<
div
className=
'adContent'
>
<
div
className=
'peopleList'
>
<
p
className=
'subItem'
>
<
span
className=
'cicrleHead mr-5'
>
<
img
src=
'/img/head.png'
className=
'imgRes'
/>
</
span
>
王磊
</
p
>
<
p
className=
'subItem'
>
<
img
className=
'smallIco mr-5'
src=
'/img/tel.png'
/>
13488876526
</
p
>
</
div
>
<
div
className=
'peopleList'
>
<
p
className=
'subItem'
>
<
span
className=
'cicrleHead mr-5 centerFont'
>
王
</
span
>
王磊
</
p
>
<
p
className=
'subItem'
>
<
img
className=
'smallIco mr-5'
src=
'/img/tel.png'
/>
13488876526
</
p
>
</
div
>
</
div
>
</
div
>
</
li
>
<
li
>
<
div
className=
'itemBox'
>
<
h4
className=
'titleBar'
>
市委办公厅审核员
</
h4
>
<
div
className=
'adContent'
>
<
div
className=
'peopleList'
>
<
p
className=
'subItem'
>
<
span
className=
'cicrleHead mr-5'
>
<
img
src=
'/img/head.png'
className=
'imgRes'
/>
</
span
>
王磊
</
p
>
<
p
className=
'subItem'
>
<
img
className=
'smallIco mr-5'
src=
'/img/tel.png'
/>
13488876526
</
p
>
</
div
>
<
div
className=
'peopleList'
>
<
p
className=
'subItem'
>
<
span
className=
'cicrleHead mr-5 centerFont'
>
王
</
span
>
王磊
</
p
>
<
p
className=
'subItem'
>
<
img
className=
'smallIco mr-5'
src=
'/img/tel.png'
/>
13488876526
</
p
>
</
div
>
</
div
>
</
div
>
</
li
>
</
ul
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
}
};
}
export
default
AddressBook
;
export
default
Communicate
;
src/pages/EventProcessing/Process.jsx
View file @
8e10f9fb
...
@@ -20,13 +20,15 @@ const Pro = (props) => {
...
@@ -20,13 +20,15 @@ const Pro = (props) => {
setFootStatus
(
true
)
setFootStatus
(
true
)
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
setLoading
(
false
);
const
option
=
document
.
getElementsByClassName
(
"option-text"
)[
0
]
const
option
=
document
.
getElementsByClassName
(
"option-text"
)[
0
]
option
.
addEventListener
(
'focus'
,
optionBlur
,
true
);
option
.
addEventListener
(
'focus'
,
optionBlur
,
true
);
return
()
=>
option
.
removeEventListener
(
'focus'
,
optionBlur
,
true
);
return
()
=>
option
.
removeEventListener
(
'focus'
,
optionBlur
,
true
);
},
[]);
},
[]);
const
optionChange
=
val
=>
{
const
optionChange
=
val
=>
{
setDisabled
(
!
(
val
!=
null
&&
val
!=
undefined
&&
val
!
=
''
))
setDisabled
(
!
(
val
!=
null
&&
val
!==
''
))
};
};
const
[
current
,
setCurrent
]
=
useState
(
'basic'
);
const
[
current
,
setCurrent
]
=
useState
(
'basic'
);
...
...
src/pages/Login/index.jsx
View file @
8e10f9fb
import
React
,
{
useEffect
}
from
'react'
;
import
React
from
'react'
;
import
{
useRequest
}
from
"@umijs/hooks"
;
//
import { useRequest } from "@umijs/hooks";
import
axios
from
'axios'
;
//
import axios from 'axios';
import
{
withRouter
}
from
'react-router-dom'
import
{
withRouter
}
from
'react-router-dom'
import
axiosRequest
,
{
loading
}
from
'../../utils/request'
;
import
axiosRequest
from
'../../utils/request'
;
// import { postRequest } from '../../utils/request';
// import { postRequest } from '../../utils/request';
// import './index.less'
// import './index.less'
...
@@ -12,6 +12,7 @@ const Login = (props) => {
...
@@ -12,6 +12,7 @@ const Login = (props) => {
method
:
'post'
,
method
:
'post'
,
url
:
'/dgbg/mobileLogin.view?userName=2012012099&clientFlag=123456&password=1'
,
url
:
'/dgbg/mobileLogin.view?userName=2012012099&clientFlag=123456&password=1'
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
!
res
.
errorMessage
&&
props
.
history
.
push
(
`/bord/backlog`
)
// setOperates(res.operate || []);
// setOperates(res.operate || []);
});
});
...
...
src/pages/Notice/Notice.jsx
View file @
8e10f9fb
...
@@ -2,7 +2,7 @@ import React, {useEffect, useState} from 'react';
...
@@ -2,7 +2,7 @@ import React, {useEffect, useState} from 'react';
import
{
ActivityIndicator
,
WhiteSpace
,
WingBlank
}
from
'antd-mobile'
import
{
ActivityIndicator
,
WhiteSpace
,
WingBlank
}
from
'antd-mobile'
import
TodoCard
from
'../../components/LogCard'
import
TodoCard
from
'../../components/LogCard'
import
TopNotice
from
'../../components/NoticeTab'
import
TopNotice
from
'../../components/NoticeTab'
import
axiosRequest
from
'../../utils/request'
;
const
Notice
=
(
props
)
=>
{
const
Notice
=
(
props
)
=>
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
@@ -11,11 +11,18 @@ const Notice = (props) => {
...
@@ -11,11 +11,18 @@ const Notice = (props) => {
const
[
data
,
setData
]
=
useState
([{},{},{},{},{},{}]);
const
[
data
,
setData
]
=
useState
([{},{},{},{},{},{}]);
const
getData
=
()
=>
{
const
getData
=
()
=>
{
setLoading
(
false
)
const
pageMap
=
{
searchWord
,
nowPage
:
current
,
pageSize
:
10
};
const
pageMap
=
{
searchWord
,
nowPage
:
current
,
pageSize
:
10
}
console
.
log
(
pageMap
)
setLoading
(
true
)
axiosRequest
({
method
:
'post'
,
url
:
'/dgbg/mobileGetOperates.view?userName=2012012099&clientFlag=123456'
,
}).
then
(
res
=>
{
setLoading
(
false
);
let
result
=
data
.
concat
([{},
{},
{},
{},
{},
{}])
let
result
=
data
.
concat
([{},
{},
{},
{},
{},
{}])
setData
(
result
)
setData
(
result
)
setCurrent
(
current
+
1
)
setCurrent
(
current
+
1
)
});
};
};
//下拉加载
//下拉加载
...
@@ -25,7 +32,6 @@ const Notice = (props) => {
...
@@ -25,7 +32,6 @@ const Notice = (props) => {
const
scrollHeight
=
event
.
scrollHeight
;
const
scrollHeight
=
event
.
scrollHeight
;
const
clientHeight
=
event
.
clientHeight
;
const
clientHeight
=
event
.
clientHeight
;
if
(
top
+
clientHeight
===
scrollHeight
)
{
if
(
top
+
clientHeight
===
scrollHeight
)
{
setLoading
(
true
);
getData
()
getData
()
}
}
};
};
...
@@ -37,6 +43,12 @@ const Notice = (props) => {
...
@@ -37,6 +43,12 @@ const Notice = (props) => {
const
checkLog
=
()
=>
{
const
checkLog
=
()
=>
{
props
.
history
.
push
(
`/blank/info/example/1`
)
props
.
history
.
push
(
`/blank/info/example/1`
)
};
};
//回到顶部
useEffect
(()
=>
{
const
element
=
document
.
getElementById
(
'common-content'
)
element
.
scrollTo
(
0
,
0
)
},
[])
return
(
return
(
<
WingBlank
>
<
WingBlank
>
<
ActivityIndicator
<
ActivityIndicator
...
@@ -45,7 +57,7 @@ const Notice = (props) => {
...
@@ -45,7 +57,7 @@ const Notice = (props) => {
animating=
{
loading
}
animating=
{
loading
}
/>
/>
<
WhiteSpace
/>
<
WhiteSpace
/>
<
TopNotice
/>
<
TopNotice
onSearch=
{
setSearchWord
}
/>
{
{
data
.
map
((
item
,
index
)
=>
(
data
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
>
<
div
key=
{
index
}
>
...
...
src/pages/Work/Work.jsx
View file @
8e10f9fb
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
ActivityIndicator
,
WhiteSpace
,
WingBlank
}
from
"antd-mobile"
;
import
{
ActivityIndicator
,
WhiteSpace
,
WingBlank
}
from
"antd-mobile"
;
import
axiosRequest
,
{
loading
}
from
'../../utils/request'
;
import
axiosRequest
from
'../../utils/request'
;
import
TopSearch
from
'../../components/TopSearch'
import
TopSearch
from
'../../components/TopSearch'
import
WorkCard
from
'../../components/WorkCard'
import
WorkCard
from
'../../components/WorkCard'
;
const
Work
=
()
=>
{
const
Work
=
(
props
)
=>
{
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
addStatus
,
setAddStatus
]
=
useState
(
false
);
const
[
addStatus
,
setAddStatus
]
=
useState
(
false
);
const
[
operates
,
setOperates
]
=
useState
([]);
const
[
operates
,
setOperates
]
=
useState
([]);
...
@@ -14,10 +14,12 @@ const Work = () => {
...
@@ -14,10 +14,12 @@ const Work = () => {
},
[]);
},
[]);
const
loadOperates
=
()
=>
{
const
loadOperates
=
()
=>
{
setLoading
(
true
)
axiosRequest
({
axiosRequest
({
method
:
'post'
,
method
:
'post'
,
url
:
'/dgbg/mobileGetOperates.view?userName=2012012099&clientFlag=123456'
,
url
:
'/dgbg/mobileGetOperates.view?userName=2012012099&clientFlag=123456'
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
setLoading
(
false
)
setOperates
(
res
.
operate
||
[]);
setOperates
(
res
.
operate
||
[]);
});
});
}
}
...
@@ -35,10 +37,15 @@ const Work = () => {
...
@@ -35,10 +37,15 @@ const Work = () => {
// arr.splice(arr.length - 1, 0, item[0]);
// arr.splice(arr.length - 1, 0, item[0]);
};
};
const
itemSlice
=
(
id
,
arr
,
arr2
)
=>
{
// const itemSlice = (id, arr, arr2) => {
// const index = arr.findIndex(item => item.id == id);
// // const index = arr.findIndex(item => item.id == id);
// index > -1 && arr.splice(index, 1);
// // index > -1 && arr.splice(index, 1);
};
// };
const
workUrl
=
(
url
)
=>
{
props
.
history
.
push
(
url
)
}
return
(
return
(
<
WingBlank
>
<
WingBlank
>
<
ActivityIndicator
<
ActivityIndicator
...
@@ -50,10 +57,11 @@ const Work = () => {
...
@@ -50,10 +57,11 @@ const Work = () => {
<
TopSearch
onSearch=
{
workSearch
}
/>
<
TopSearch
onSearch=
{
workSearch
}
/>
<
WhiteSpace
/>
<
WhiteSpace
/>
<
WorkCard
<
WorkCard
title=
"
事物管理
"
title=
"
工作详情
"
addCommon=
{
commonEdit
}
addCommon=
{
commonEdit
}
addStatus=
{
addStatus
}
addStatus=
{
addStatus
}
data=
{
operates
.
map
(
item
=>
({
icon
:
''
,
text
:
item
.
NODENAME
}))
}
data=
{
operates
.
map
(
item
=>
({
icon
:
''
,
text
:
item
.
NODENAME
}))
}
workUrl=
{
workUrl
}
iconAction=
{
itemAdd
}
iconAction=
{
itemAdd
}
/>
/>
</
WingBlank
>
</
WingBlank
>
...
...
src/pages/Work/WorkDetail.jsx
0 → 100644
View file @
8e10f9fb
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
ActivityIndicator
,
WhiteSpace
,
WingBlank
}
from
'antd-mobile'
import
TodoCard
from
'../../components/LogCard'
import
TopNotice
from
'../../components/NoticeTab'
import
axiosRequest
from
'../../utils/request'
;
import
'./index.less'
const
WorkDetail
=
(
props
)
=>
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
current
,
setCurrent
]
=
useState
(
1
);
const
[
searchWord
,
setSearchWord
]
=
useState
()
const
[
data
,
setData
]
=
useState
([{},{},{},{},{},{}]);
const
getData
=
()
=>
{
const
pageMap
=
{
searchWord
,
nowPage
:
current
,
pageSize
:
10
};
console
.
log
(
pageMap
)
setLoading
(
true
)
axiosRequest
({
method
:
'post'
,
url
:
'/dgbg/mobileGetOperates.view?userName=2012012099&clientFlag=123456'
,
}).
then
(
res
=>
{
setLoading
(
false
);
let
result
=
data
.
concat
([{},
{},
{},
{},
{},
{}])
setData
(
result
)
setCurrent
(
current
+
1
)
});
};
//下拉加载
const
handleScroll
=
()
=>
{
const
event
=
document
.
getElementById
(
"work-content"
)
const
top
=
event
.
scrollTop
;
const
scrollHeight
=
event
.
scrollHeight
;
const
clientHeight
=
event
.
clientHeight
;
if
(
top
+
clientHeight
===
scrollHeight
)
{
getData
()
}
};
useEffect
(()
=>
{
window
.
addEventListener
(
'scroll'
,
handleScroll
,
true
);
return
()
=>
window
.
removeEventListener
(
'scroll'
,
handleScroll
,
true
);
},
[
data
]);
const
checkLog
=
()
=>
{
props
.
history
.
push
(
`/blank/info/example/1`
)
};
//回到顶部
useEffect
(()
=>
{
const
element
=
document
.
getElementById
(
'work-content'
)
element
.
scrollTo
(
0
,
0
)
},
[])
return
(
<
div
id=
"work-content"
className=
"work-content"
>
<
WingBlank
>
<
ActivityIndicator
toast
text=
"加载中..."
animating=
{
loading
}
/>
<
WhiteSpace
/>
<
TopNotice
onSearch=
{
setSearchWord
}
/>
{
data
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
>
<
WhiteSpace
/>
<
TodoCard
data=
{
item
}
onClick=
{
checkLog
}
/>
</
div
>
))
}
</
WingBlank
>
</
div
>
);
};
export
default
WorkDetail
;
src/pages/Work/index.less
0 → 100644
View file @
8e10f9fb
.work-content{
position: fixed;
top: 0;left: 0;right: 0;bottom: 0;
overflow: auto;
padding-bottom: 10px
}
src/pages/WorkDetail/WorkDetail.jsx
deleted
100644 → 0
View file @
3fedbcb5
src/router.js
View file @
8e10f9fb
...
@@ -5,6 +5,7 @@ import BlankLayout from './layout/BlankLayout';
...
@@ -5,6 +5,7 @@ import BlankLayout from './layout/BlankLayout';
import
CommonLayout
from
'./layout/CommonLayout'
;
import
CommonLayout
from
'./layout/CommonLayout'
;
import
Backlog
from
'./pages/Backlog/Backlog'
import
Backlog
from
'./pages/Backlog/Backlog'
import
Work
from
'./pages/Work/Work'
import
Work
from
'./pages/Work/Work'
import
WorkDetail
from
'./pages/Work/WorkDetail'
import
Notice
from
'./pages/Notice/Notice'
import
Notice
from
'./pages/Notice/Notice'
import
Communicate
from
'./pages/Communicate/Communicate'
;
import
Communicate
from
'./pages/Communicate/Communicate'
;
import
AddressList
from
'./pages/AddressList/AddressList'
;
import
AddressList
from
'./pages/AddressList/AddressList'
;
...
@@ -21,8 +22,8 @@ const ReactRouter = () => {
...
@@ -21,8 +22,8 @@ const ReactRouter = () => {
return
(
return
(
<
Router
>
<
Router
>
<
Switch
>
<
Switch
>
<
Route
exact
path
=
"/"
render
=
{()
=>
<
Redirect
to
=
"/login"
/>
}
/
>
<
Route
path
=
"/login"
component
=
{
Login
}
/
>
<
Route
path
=
"/login"
component
=
{
Login
}
/
>
<
Route
exact
path
=
"/"
render
=
{()
=>
<
Redirect
to
=
"/bord/backlog"
/>
}
/
>
<
Route
path
=
"/bord"
render
=
{
()
=>
<
Route
path
=
"/bord"
render
=
{
()
=>
<
CommonLayout
>
<
CommonLayout
>
<
Route
path
=
"/bord/backlog"
component
=
{
Backlog
}
/
>
<
Route
path
=
"/bord/backlog"
component
=
{
Backlog
}
/
>
...
@@ -34,6 +35,7 @@ const ReactRouter = () => {
...
@@ -34,6 +35,7 @@ const ReactRouter = () => {
}
/
>
}
/
>
<
Route
path
=
"/blank"
component
=
{()
=>
<
Route
path
=
"/blank"
component
=
{()
=>
<
BlankLayout
>
<
BlankLayout
>
<
Route
path
=
"/blank/work/:id"
component
=
{
WorkDetail
}
/
>
<
Route
path
=
"/blank/submit/:id"
component
=
{
SubmitDetail
}
/
>
<
Route
path
=
"/blank/submit/:id"
component
=
{
SubmitDetail
}
/
>
<
Route
path
=
"/blank/info/:name/:id"
component
=
{
Process
}
/
>
<
Route
path
=
"/blank/info/:name/:id"
component
=
{
Process
}
/
>
<
/BlankLayout
>
<
/BlankLayout
>
...
...
src/utils/instance.js
View file @
8e10f9fb
import
axios
from
'axios'
;
import
axios
from
'axios'
;
import
{
parse
,
stringify
}
from
'qs'
;
import
{
stringify
}
from
'qs'
;
import
{
Toast
}
from
'antd-mobile'
;
import
{
Toast
}
from
'antd-mobile'
;
const
instance
=
axios
.
create
();
const
instance
=
axios
.
create
();
...
@@ -69,7 +69,7 @@ export const createAPI = (baseURL) => {
...
@@ -69,7 +69,7 @@ export const createAPI = (baseURL) => {
})
})
.
catch
(
error
=>
{
.
catch
(
error
=>
{
if
(
error
.
response
)
{
if
(
error
.
response
)
{
const
{
status
,
statusText
,
url
}
=
error
.
response
;
const
{
status
,
statusText
}
=
error
.
response
;
const
errortext
=
codeMessage
[
status
]
||
statusText
;
const
errortext
=
codeMessage
[
status
]
||
statusText
;
if
(
status
===
401
)
{
if
(
status
===
401
)
{
...
...
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