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);