【更新】代码黄波浪警告消除

pull/22/head
小诺 2021-05-20 15:13:20 +08:00 committed by 小诺
parent d836eea89b
commit 9cba70f783
1 changed files with 7 additions and 7 deletions

View File

@ -80,7 +80,7 @@
getAreaList(this.queryParam).then((res) => { getAreaList(this.queryParam).then((res) => {
if (res.success) { if (res.success) {
this.data = res.data this.data = res.data
this.removeEmptyChildren(this.data); this.removeEmptyChildren(this.data)
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
@ -92,7 +92,7 @@
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
const item = data[i] const item = data[i]
// //
if (item.levelCode === 4 || (item.levelCode === 2 && item.name === "市辖区")) { if (item.levelCode === 4 || (item.levelCode === 2 && item.name === '市辖区')) {
item.children = null item.children = null
} }
} }
@ -101,19 +101,19 @@
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
}, },
onExpand(expanded, record) { onExpand(expanded, record) {
if(expanded) { if (expanded) {
// //
const index = this.expandedData.indexOf(record.id); const index = this.expandedData.indexOf(record.id)
// //
if(index === -1) { if (index === -1) {
this.queryParam.parentCode = record.areaCode this.queryParam.parentCode = record.areaCode
getAreaList(this.queryParam).then((res) => { getAreaList(this.queryParam).then((res) => {
if (res.success) { if (res.success) {
// //
record.children = res.data record.children = res.data
this.removeEmptyChildren(record.children); this.removeEmptyChildren(record.children)
// id // id
this.expandedData.push(record.id); this.expandedData.push(record.id)
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false