|
@ -32,6 +32,8 @@ function Index () { |
|
|
const [systemInfo, setSystemInfo] = useState('') |
|
|
const [systemInfo, setSystemInfo] = useState('') |
|
|
const [page, setPage] = useState(0) |
|
|
const [page, setPage] = useState(0) |
|
|
const [num, setNum] = useState(Math.random()) |
|
|
const [num, setNum] = useState(Math.random()) |
|
|
|
|
|
const [typeSearchList, setTypeSearchList] = useState(['全部', '待处理', '不处理', '已处理']) |
|
|
|
|
|
const [typeSearch, setTypeSearch] = useState('全部') |
|
|
|
|
|
|
|
|
const limit = 10 |
|
|
const limit = 10 |
|
|
|
|
|
|
|
@ -54,7 +56,7 @@ function Index () { |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
setPage(0) |
|
|
setPage(0) |
|
|
setNum(Math.random()) |
|
|
setNum(Math.random()) |
|
|
}, [reportType, datePicker]) |
|
|
}, [reportType, datePicker, typeSearch]) |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
getList(page == 0 ? true : false) |
|
|
getList(page == 0 ? true : false) |
|
@ -70,6 +72,12 @@ function Index () { |
|
|
} |
|
|
} |
|
|
const getList = (isInit) => { |
|
|
const getList = (isInit) => { |
|
|
Taro.showLoading({ title: '加载中' }) |
|
|
Taro.showLoading({ title: '加载中' }) |
|
|
|
|
|
let handleState = '' |
|
|
|
|
|
if (typeSearch != '全部') { |
|
|
|
|
|
handleState = typeSearch |
|
|
|
|
|
} else { |
|
|
|
|
|
handleState = isWait ? '待处理' : ishandle ? '已处理' : '' |
|
|
|
|
|
} |
|
|
const data = { |
|
|
const data = { |
|
|
limit, |
|
|
limit, |
|
|
page, |
|
|
page, |
|
@ -78,7 +86,7 @@ function Index () { |
|
|
keyword: filterText, |
|
|
keyword: filterText, |
|
|
reportType: isWait || ishandle ? 'anomaly' : reportType, |
|
|
reportType: isWait || ishandle ? 'anomaly' : reportType, |
|
|
userId: filter === 'my' && !ishandle ? userInfo.id : '', |
|
|
userId: filter === 'my' && !ishandle ? userInfo.id : '', |
|
|
handleState: isWait ? '待处理' : ishandle ? '已处理' : '', |
|
|
handleState: handleState, |
|
|
performerId: isWait || ishandle ? userInfo.id : '' |
|
|
performerId: isWait || ishandle ? userInfo.id : '' |
|
|
} |
|
|
} |
|
|
request.get(getReportList(), data).then(res => { |
|
|
request.get(getReportList(), data).then(res => { |
|
@ -143,7 +151,9 @@ function Index () { |
|
|
const handleDetail = index => { |
|
|
const handleDetail = index => { |
|
|
Taro.navigateTo({ url: `/packages/patrol/index?type=view&id=${listData[index].id}&kind=${kind == 'wait' || kind == 'handle' ? 'anomaly' : kind}&wait=${kind == 'wait' ? 'wait' : ''}&handle=${kind == 'handle' ? 'handle' : ''}&videoShow=${kind == 'wait' || kind == 'handle' ? 'videoShow' : ''}` }) |
|
|
Taro.navigateTo({ url: `/packages/patrol/index?type=view&id=${listData[index].id}&kind=${kind == 'wait' || kind == 'handle' ? 'anomaly' : kind}&wait=${kind == 'wait' ? 'wait' : ''}&handle=${kind == 'handle' ? 'handle' : ''}&videoShow=${kind == 'wait' || kind == 'handle' ? 'videoShow' : ''}` }) |
|
|
} |
|
|
} |
|
|
|
|
|
const setType = (e) => { |
|
|
|
|
|
setTypeSearch(e.detail.value == 1 ? '待处理' : e.detail.value == 2 ? '不处理' : e.detail.value == 3 ? '已处理' : '全部') |
|
|
|
|
|
} |
|
|
return ( |
|
|
return ( |
|
|
<View> |
|
|
<View> |
|
|
{/* { |
|
|
{/* { |
|
@ -163,7 +173,7 @@ function Index () { |
|
|
} */} |
|
|
} */} |
|
|
|
|
|
|
|
|
<View className='filter-box' style={{ top: isPatrol && false ? "40px" : '0' }}> |
|
|
<View className='filter-box' style={{ top: isPatrol && false ? "40px" : '0' }}> |
|
|
<View className='filter-item'> |
|
|
<View className='filter-item' style={{ width: '270rpx' }}> |
|
|
<View style={{ float: 'left', marginLeft: '20rpx', color: '#333' }}>日期:</View> |
|
|
<View style={{ float: 'left', marginLeft: '20rpx', color: '#333' }}>日期:</View> |
|
|
<Picker |
|
|
<Picker |
|
|
className='picker' |
|
|
className='picker' |
|
@ -177,6 +187,15 @@ function Index () { |
|
|
<Image className='filter-img' src={chevronDown} /> |
|
|
<Image className='filter-img' src={chevronDown} /> |
|
|
</Picker> |
|
|
</Picker> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
{ |
|
|
|
|
|
kind == 'anomaly' ? <View style={{ display: 'flex', lineHeight: '98rpx', marginRight: '20rpx' }}> |
|
|
|
|
|
<View style={{ color: '#333' }}>状态:</View> |
|
|
|
|
|
<Picker range={typeSearchList} onChange={setType}> |
|
|
|
|
|
<View style={{ float: 'left' }}>{typeSearch}</View> |
|
|
|
|
|
<Image style={{ display: 'block', width: '14rpx', height: '8rpx', float: 'left', marginTop: '44rpx', marginLeft: '10rpx' }} src={chevronDown} /> |
|
|
|
|
|
</Picker> |
|
|
|
|
|
</View> : '' |
|
|
|
|
|
} |
|
|
<View class='head-search'> |
|
|
<View class='head-search'> |
|
|
<Image className='search-img' src={searchIcon} /> |
|
|
<Image className='search-img' src={searchIcon} /> |
|
|
<Input class='heard-search-input' value={filterText} placeholder={ |
|
|
<Input class='heard-search-input' value={filterText} placeholder={ |
|
|