From 7ef046949b62e27f867af3b48c081a2f92d0f235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E6=98=AD=E6=9C=9D?= <18394339404@163.com> Date: Mon, 24 Jun 2024 13:36:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/record/index.vue | 21 +++++++++++++++++++-- src/views/skill/datamatch/index.vue | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) 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 >