diff --git a/src/views/record/index.vue b/src/views/record/index.vue index ee982bc..bf93d4e 100644 --- a/src/views/record/index.vue +++ b/src/views/record/index.vue @@ -18,6 +18,7 @@ v-model="selected[index]" :placeholder="category.categoryName" multiple + filterable :collapse-tags="collapse" clearable > @@ -993,6 +994,11 @@ export default { // 获取 区域 城市 列表 const result = await this.$API.select.reqGetRegionAndCity() this.regionAndCityList = result.data + // 初始化城市 + const cities = this.regionAndCityList.map(item => { + return item.cities.split(',') + }) + this.cityList = cities.flat() this.regionList = result.data.map(item => { return { value: item.region, label: item.region } }) }, // 初始化部门选项为不限 @@ -1132,8 +1138,16 @@ export default { return index + 1 + (page - 1) * limit }, handleRegion(region) { - const data = this.regionAndCityList.filter(item => item.region === region) - this.cityList = data[0].cities.split(',') + // 如果区域为空,就不做筛选,显示所有的城市 + if (region) { + const data = this.regionAndCityList.filter(item => item.region === region) + this.cityList = data[0].cities.split(',') + } else { + const data = this.regionAndCityList.map(item => { + return item.cities.split(',') + }) + this.cityList = data.flat() + } this.city = '' console.log(this.cityList) }, @@ -1279,6 +1293,9 @@ export default { // 重置部门选项 resetDepartmentSearch() { + this.region = '' + this.city = '' + this.selected = [] this.departmentId = '' this.getTableDataByDept() }, diff --git a/src/views/skill/datamatch/index.vue b/src/views/skill/datamatch/index.vue index bed2ef4..4938ec0 100644 --- a/src/views/skill/datamatch/index.vue +++ b/src/views/skill/datamatch/index.vue @@ -9,6 +9,7 @@ v-model="selected[index]" :placeholder="category.categoryName" multiple + filterable :collapse-tags="collapse" clearable >