From 718baede488867af36e682204b0f49ac64394117 Mon Sep 17 00:00:00 2001 From: liuminjian Date: Tue, 3 Aug 2021 09:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=95=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homestead/index.vue | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/views/homestead/index.vue b/src/views/homestead/index.vue index 99c4406a..f835be49 100644 --- a/src/views/homestead/index.vue +++ b/src/views/homestead/index.vue @@ -942,7 +942,7 @@ export default { villageValue: "", //选中村相关信息 villageDataObj: { - deptName: " ", //村名 + deptName: "  ", //村名 }, hcAreaInfoFieldName: { text: "label", @@ -1599,27 +1599,27 @@ export default { if (res.code == 200) { let content = res.data; this.hcAreaInfoOption = content; - let currDeptId = "169"; //; - // if (content[0].children && content[0].children.length != 0) { - // if ( - // content[0].children[0].children && - // content[0].children[0].children.length != 0 - // ) { - // if ( - // content[0].children[0].children[0].children && - // content[0].children[0].children[0].children.length != 0 - // ) { - // currDeptId = - // content[0].children[0].children[0].children[0].value; - // } else { - // currDeptId = content[0].children[0].children[0].value; - // } - // } else { - // currDeptId = content[0].children[0].value; - // } - // } else { - // currDeptId = content[0].value; - // } + let currDeptId; //;= "169" + if (content[0].children && content[0].children.length != 0) { + if ( + content[0].children[0].children && + content[0].children[0].children.length != 0 + ) { + if ( + content[0].children[0].children[0].children && + content[0].children[0].children[0].children.length != 0 + ) { + currDeptId = + content[0].children[0].children[0].children[0].value; + } else { + currDeptId = content[0].children[0].children[0].value; + } + } else { + currDeptId = content[0].children[0].value; + } + } else { + currDeptId = content[0].value; + } // console.log(currDeptId); //获取村详细信息 this.deptGetFun(currDeptId);