|
|
@ -1,6 +1,6 @@ |
|
|
|
import React, { useEffect, useState } from 'react' |
|
|
|
import Taro, { useRouter } from '@tarojs/taro' |
|
|
|
import { View, Text, Picker, } from '@tarojs/components' |
|
|
|
import { View, Text, Picker, Input } from '@tarojs/components' |
|
|
|
import { AtButton, AtIcon, } from 'taro-ui' |
|
|
|
import request from '@/services/request' |
|
|
|
import { roadSpotChange, roadUrl } from '@/services/api' |
|
|
@ -77,18 +77,23 @@ function Index() { |
|
|
|
[key]: value |
|
|
|
} |
|
|
|
|
|
|
|
let routeName = [] |
|
|
|
let routeCode = [] |
|
|
|
let sectionNo = [] |
|
|
|
let data = [...road] |
|
|
|
|
|
|
|
data.forEach(v => { |
|
|
|
if (v.routeName && !routeName.includes(v.routeName)) { |
|
|
|
routeName.push(v.routeName) |
|
|
|
if (key == 'routeName') { |
|
|
|
// routeName关键字筛选 |
|
|
|
let routeName = [] |
|
|
|
road.forEach(item => { |
|
|
|
if (item.routeName && !routeName.includes(item.routeName)) { |
|
|
|
routeName.push(item.routeName) |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
if (value) { |
|
|
|
routeName = routeName.filter(item => item.indexOf(value) > -1) |
|
|
|
} |
|
|
|
setNameList(routeName) |
|
|
|
|
|
|
|
if (key == 'routeName') { |
|
|
|
nextValue.routeCode = '' |
|
|
|
nextValue.sectionNo = '' |
|
|
|
data?.forEach(v => { |
|
|
@ -115,8 +120,6 @@ function Index() { |
|
|
|
setNoList(sectionNo) |
|
|
|
} |
|
|
|
|
|
|
|
setNameList(routeName) |
|
|
|
|
|
|
|
if (nextValue?.routeName) { |
|
|
|
setRouteCodeDisabled(false) |
|
|
|
} else { |
|
|
@ -181,16 +184,23 @@ function Index() { |
|
|
|
<View className='cell'> |
|
|
|
<View className='title'><Text className='star'>*</Text>路线名称</View> |
|
|
|
<View className='content'> |
|
|
|
<View className='picker'> |
|
|
|
|
|
|
|
<Input |
|
|
|
type='text' |
|
|
|
placeholder='输入关键字筛选' |
|
|
|
border={false} |
|
|
|
value={checked.routeName} |
|
|
|
onInput={e => handleCheckChange(e.detail.value, 'routeName')} |
|
|
|
/> |
|
|
|
<Picker |
|
|
|
mode='selector' |
|
|
|
range={nameList} |
|
|
|
onChange={e => handleCheckChange(nameList[e.detail.value], 'routeName')} |
|
|
|
> |
|
|
|
<View className='picker'> |
|
|
|
<View>{checked.routeName || '请选择'}</View> |
|
|
|
<AtIcon className='arrow' value='chevron-down' size='20' color='#999' /> |
|
|
|
</View> |
|
|
|
</Picker> |
|
|
|
</View> |
|
|
|
<AtIcon |
|
|
|
value='close-circle' |
|
|
|
size='20' |
|
|
|