Browse Source

省市区新增删除逻辑

pull/1/head
yufei111 2 years ago
parent
commit
97a8bd6bd4
3 changed files with 21725 additions and 183 deletions
  1. +21710
    -175
      package-lock.json
  2. +0
    -1
      src/views/data/tenant/index.vue
  3. +15
    -7
      src/views/data/tenant/tenant-edit.vue

+ 21710
- 175
package-lock.json
File diff suppressed because it is too large
View File


+ 0
- 1
src/views/data/tenant/index.vue View File

:datasource="url" :datasource="url"
:columns="columns" :columns="columns"
:where="where" :where="where"
v-model:selection="selection"
:scroll="{x: 'max-content'}"> :scroll="{x: 'max-content'}">
<template #toolbar> <template #toolbar>
<a-space> <a-space>

+ 15
- 7
src/views/data/tenant/tenant-edit.vue View File

}, },
/* 选择省市区 */ /* 选择省市区 */
selectArea(value, type, name){ selectArea(value, type, name){
this.getListBycode(value, type, name)
if (type === 'province') { if (type === 'province') {
this.cityList = [] this.cityList = []
this.districtList = [] this.districtList = []
this.form.cityCode = null this.form.cityCode = null
this.form.cityName = null
this.form.districtCode = null this.form.districtCode = null
this.form.districtName = null
} }
if (type === 'city') { if (type === 'city') {
this.districtList = [] this.districtList = []
this.form.districtCode = null this.form.districtCode = null
this.form.districtName = null
} }
this.getListBycode(value, type, name)
}, },
/* 根据选择的选中的code返回子项列表 */ /* 根据选择的选中的code返回子项列表 */
getListBycode(code, name, childrenName) { getListBycode(code, name, childrenName) {
this[name + 'List'].forEach((item) => {
if (item.citycode == code) {
this[childrenName + 'List'] = item.itemList
this.form[name+'Name'] = item.name
}
})
if(code) {
this[name + 'List'].forEach((item) => {
if (item.citycode == code) {
this[childrenName + 'List'] = item.itemList
this.form[name+'Name'] = item.name
}
})
} else {
this[childrenName + 'List'] = []
this.form[name+'Name'] = null
}
}, },
/* 保存编辑 */ /* 保存编辑 */
save() { save() {

Loading…
Cancel
Save