|
|
@@ -82,13 +82,13 @@
|
|
|
<div class="search_content" ref="searchContentRef">
|
|
|
<div class="content_left">
|
|
|
<div class="simple_filter" v-if="isShowSimpleFilter">
|
|
|
- <el-select v-model="searchData.provinceCode" @change="SearchChange" v-if="searchList.provinceNode && searchList.provinceNode.length > 1">
|
|
|
+ <el-select v-model="searchData.provinceCode" @change="ChangeRegion('provinceCode')" v-if="searchList.provinceNode && searchList.provinceNode.length > 1">
|
|
|
<el-option v-for="item in searchList.provinceNode" :key="item.provinceCode" :value="item.provinceCode" :label="item.provinceName == '全部' ? '全部省份' : item.provinceName"></el-option>
|
|
|
</el-select>
|
|
|
- <el-select v-model="searchData.cityCode" @change="SearchChange" v-if="cityNode && cityNode.length > 1">
|
|
|
+ <el-select v-model="searchData.cityCode" @change="ChangeRegion('cityCode')" v-if="cityNode && cityNode.length > 1">
|
|
|
<el-option v-for="item in cityNode" :key="item.cityCode" :value="item.cityCode" :label="item.cityName == '全部' ? '全部城市' : item.cityName"></el-option>
|
|
|
</el-select>
|
|
|
- <el-select v-model="searchData.districtCode" @change="SearchChange" v-if="districtNode && districtNode.length > 1">
|
|
|
+ <el-select v-model="searchData.districtCode" @change="ChangeRegion('districtCode')" v-if="districtNode && districtNode.length > 1">
|
|
|
<el-option v-for="item in districtNode" :key="item.districtCode" :value="item.districtCode" :label="item.districtName == '全部' ? '全部区县' : item.districtName"></el-option>
|
|
|
</el-select>
|
|
|
<el-select v-model="searchData.userId" @change="SearchChange" v-if="searchList.userInfo && searchList.userInfo.length > 1">
|
|
|
@@ -311,6 +311,37 @@ const selectItem = (value: string, str: SearchDataKey, item: any) => {
|
|
|
|
|
|
// emit('FnSearch', searchData);
|
|
|
}
|
|
|
+const ChangeRegion = (str: SearchDataKey) => {
|
|
|
+ let arr = []
|
|
|
+ if(str == 'provinceCode') {
|
|
|
+ if(searchData.value.provinceCode && searchData.value.provinceCode != 'all') {
|
|
|
+ arr = [...searchList.value.provinceNode.find(item => item.provinceCode == searchData.value.provinceCode).children]
|
|
|
+ arr.splice(0, 0, { cityCode: "all", cityName: "全部" })
|
|
|
+ cityNode.value = arr
|
|
|
+ console.log(cityNode.value)
|
|
|
+ searchData.value.cityCode = 'all'
|
|
|
+ districtNode.value = []
|
|
|
+ searchData.value.districtCode = 'all'
|
|
|
+ } else {
|
|
|
+ cityNode.value = []
|
|
|
+ searchData.value.cityCode = 'all'
|
|
|
+ districtNode.value = []
|
|
|
+ searchData.value.districtCode = 'all'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(str == 'cityCode') {
|
|
|
+ if(searchData.value.cityCode && searchData.value.cityCode != 'all') {
|
|
|
+ arr = [...cityNode.value.find(item => item.cityCode == searchData.value.cityCode).children]
|
|
|
+ arr.splice(0, 0, { districtCode: "all", districtName: "全部" })
|
|
|
+ districtNode.value = arr
|
|
|
+ searchData.value.districtCode = 'all'
|
|
|
+ }else {
|
|
|
+ districtNode.value = []
|
|
|
+ searchData.value.districtCode = 'all'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ SearchChange()
|
|
|
+}
|
|
|
|
|
|
const GetSearchList = () => {
|
|
|
getSearchList().then((res: any) => {
|