<template>
	<view :style="{backgroundColor:'#f7f7f7'}">
		<u-status-bar></u-status-bar>
		<div class="titleBar">通讯录</div>
		<div class="searchBar">
			<u-search 
				placeholder="请输入姓名或手机号" 
				shape="square"
				:showAction="false"
				v-model="keyword"
			></u-search>
			<div class="iconRow">
				<div class="iconBox">
					<u--image :src="'../../static/images/filter.png'" width="22px" height="22px"></u--image>
					<text class="icon_text">我的部门</text>
				</div>
				<div class="iconBox">
					<u--image :src="'../../static/images/filter.png'" width="22px" height="22px"></u--image>
					<text class="icon_text">关注人员</text>
				</div>
			</div>
		</div>
		<div class="mybody">
			<div class="breadcrumb">
				<text 
					v-for="(item,index) in treePath" 
					class="breadcrumb_item" 
					:style="{color:(treePath.length-1)===index?'#000000':'#3595F9'}"
					@click="breadcrumbClick(item,index)"
				>
					{{item.name}}
				</text>
			</div>
			<div :style="{height:'calc( 100vh - 280px)',overflow:'scroll'}">
				<div v-for="(item,index) in treeData">
					<div class="deptItem" @click="itemClick(item,index)">
						<u--image :src="'../../static/images/filter.png'" width="22px" height="22px"></u--image>
						<div class="deptItem_border">
							<text class="deptItem_name">{{item.departmentName}}</text>
							<text class="deptItem_num">{{item.count}}</text>
						</div>
					</div>
				</div>
				<div v-if="personList.length>0">
					<div :style="{display:'flex',alignItems:'center',height:'60px'}" v-for="(item,index) in personList">
						<u--image :style="{margin:'0 30px'}" :src="'../../static/images/filter.png'" width="22px" height="22px"></u--image>
						<div class="personItemRow_right">
							<div class="personItemRow_right_top">
								<div :style="{width:'120px'}"><text>{{item.userName}}</text></div>
								<div :style="{flex:'1'}"><text>{{item.phone}}</text></div>
							</div>
							<div class="personItemRow_right_bottom">
								<text :style="{fontSize:'12px',color:'rgba(0, 0, 0, 0.4)'}">{{item.duty}}</text>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword:'',
				show:'',
				treeData:[],
				treePath:[],
				personList:[],
			}
		},
		computed: {
			getItem() {
			},
		},
		created() {
			this.getData()
		},
		watch: {
			treePath(newData,oldData){
				const last = this.treePath[this.treePath.length-1]
				if(last.data.children === null){
					this.getPerson(last.code)
				}else{
					this.personList = []
				}
			}
		},
		methods: {
			async getPerson(code) {
				try{
					// const res = await uni.$http.get('/gunshiApp/xfflood/department/tree')
					const res = {
						data:{
							"code": 200,
							"description": "请求成功",
							"data": [
								{
									"userId": "1777177756395368450",
									"userName": "覃章坤",
									"departmentCode": "755CC12685F640A2870276365237A7C6",
									"duty": "党组书记",
									"phone": "18907266183",
									"tm": 1712505600000,
									"departmentName": "局领导",
									"isMyAttendee": false
								},
								{
									"userId": "1777177756395368451",
									"userName": "姜尚静",
									"departmentCode": "755CC12685F640A2870276365237A7C6",
									"duty": "局长",
									"phone": "18972435330",
									"tm": 1712505600000,
									"departmentName": "局领导",
									"isMyAttendee": false
								},
								{
									"userId": "1777177756395368452",
									"userName": "田珂全",
									"departmentCode": "755CC12685F640A2870276365237A7C6",
									"duty": "副局长",
									"phone": "18972402868",
									"tm": 1712505600000,
									"departmentName": "局领导",
									"isMyAttendee": false
								},
								{
									"userId": "1777177756395368453",
									"userName": "莫代雄",
									"departmentCode": "755CC12685F640A2870276365237A7C6",
									"duty": "总工程师",
									"phone": "19971790111",
									"tm": 1712505600000,
									"departmentName": "局领导",
									"isMyAttendee": false
								},
								{
									"userId": "1777177756395368454",
									"userName": "杨强",
									"departmentCode": "755CC12685F640A2870276365237A7C6",
									"duty": "水利事务服务中心主任",
									"phone": "18107189996",
									"tm": 1712505600000,
									"departmentName": "局领导",
									"isMyAttendee": false
								},
								{
									"userId": "1777177756395368455",
									"userName": "杨晨",
									"departmentCode": "755CC12685F640A2870276365237A7C6",
									"duty": "水利事务服务中心副主任",
									"phone": "15997707366",
									"tm": 1712505600000,
									"departmentName": "局领导",
									"isMyAttendee": false
								},
								{
									"userId": "1777177756395368456",
									"userName": "冯斌",
									"departmentCode": "755CC12685F640A2870276365237A7C6",
									"duty": "水利事务服务中心副主任",
									"phone": "13307266287",
									"tm": 1712505600000,
									"departmentName": "局领导",
									"isMyAttendee": false
								},
								{
									"userId": "1777177756395368457",
									"userName": "王洵",
									"departmentCode": "755CC12685F640A2870276365237A7C6",
									"duty": "水利事务服务中心副主任",
									"phone": "18727720690",
									"tm": 1712505600000,
									"departmentName": "局领导",
									"isMyAttendee": false
								},
								{
									"userId": "1777177756424728577",
									"userName": "李富强",
									"departmentCode": "755CC12685F640A2870276365237A7C6",
									"duty": "水利事务服务中心总工程师",
									"phone": "18872789559",
									"tm": 1712505600000,
									"departmentName": "局领导",
									"isMyAttendee": false
								}
							],
							"success": true
						},
					}
					this.personList = res.data.data
				}catch(e){
					this.personList = []
					//TODO handle the exception
				}
				console.log('人员电话号码',this.personList)
			},
			async getData() {
				try {
				  // const res = await uni.$http.get('/gunshiApp/xfflood/department/tree')
				  const res = {
    "data": {
  "code": 200,
  "description": "请求成功",
  "data": [
    {
      "departmentCode": "54326861FE9744CA8FCE46C5928946E1",
      "departmentName": "咸丰县",
      "parentCode": "/",
      "departmentOrder": null,
      "tm": null,
      "count": 240,
      "leaf": true,
      "children": [
        {
          "departmentCode": "646EF7FE6369470982D191B70E890C5A",
          "departmentName": "咸丰县水利局",
          "parentCode": "54326861FE9744CA8FCE46C5928946E1",
          "departmentOrder": null,
          "tm": null,
          "count": 70,
          "leaf": true,
          "children": [
            {
              "departmentCode": "755CC12685F640A2870276365237A7C6",
              "departmentName": "局领导",
              "parentCode": "646EF7FE6369470982D191B70E890C5A",
              "departmentOrder": null,
              "tm": null,
              "count": 9,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "5256AA447264438A976F31D5119E4E30",
              "departmentName": "各股室",
              "parentCode": "646EF7FE6369470982D191B70E890C5A",
              "departmentOrder": null,
              "tm": null,
              "count": 50,
              "leaf": true,
              "children": [
                {
                  "departmentCode": "0AFCF262424744299E5149D0015641DE",
                  "departmentName": "办公室",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 8,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "17781709F83A43DBB0DA56475044A631",
                  "departmentName": "财务室",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 4,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "33582CEC06394B08B9EC58044DCB11F3",
                  "departmentName": "河湖长办及执法大队",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 8,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "3629890BB80948CBBA4D48F36EA12B8D",
                  "departmentName": "规划水利股",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 2,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "510036C6714840038D375BFF35FC00EC",
                  "departmentName": "防汛办",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 4,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "B122B05FF12141CBB9BF641D7EEC37CA",
                  "departmentName": "质量安全股",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 2,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "2EC1D0AEB709455ABECA0ECC47D28658",
                  "departmentName": "水库工作办公室",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 2,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "5CEF107A7FDE4979995040DA83DCC65F",
                  "departmentName": "水利建设项目管理处",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 8,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "BE719C16A5C04D0BA203619732600F05",
                  "departmentName": "河道及农电工作办公室",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 2,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "7CD7DE1E27664262863175A37576130C",
                  "departmentName": "移民股",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 5,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "38C821C3542B4174B7A13776834F76B7",
                  "departmentName": "档案室",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 2,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "00AFB9D4E9E048E486F13580C95A844B",
                  "departmentName": "改非干部",
                  "parentCode": "5256AA447264438A976F31D5119E4E30",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 3,
                  "leaf": true,
                  "children": null
                }
              ]
            },
            {
              "departmentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
              "departmentName": "水管站",
              "parentCode": "646EF7FE6369470982D191B70E890C5A",
              "departmentOrder": null,
              "tm": null,
              "count": 11,
              "leaf": true,
              "children": [
                {
                  "departmentCode": "8819680ECD864C859CB37137359535B1",
                  "departmentName": "高乐山水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "1650057CF3B541D3859DC1D6DAA96ACA",
                  "departmentName": "清坪水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "EA146B0D246C4C57897C1C6C4AD0D66D",
                  "departmentName": "坪坝营水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "6ED66AB5915D4ADBAB3132C02701F4FD",
                  "departmentName": "忠堡水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "066F94226D9F4F9987C70F9988ED5535",
                  "departmentName": "朝阳寺水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "14CB4D4864DC4F16807996021C268863",
                  "departmentName": "唐崖水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "165B8B7B06534A8E88AA42263E1FC113",
                  "departmentName": "活龙坪水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "B4699E37E33D474588608F7BAF3F8750",
                  "departmentName": "小村水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "2BAE635B2FA548048D0402F87D9E8816",
                  "departmentName": "黄金洞水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "0B62AF86BB37418C8786E25B10D80C40",
                  "departmentName": "曲江水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "ABB1234499D445A7B6672670E436EBB3",
                  "departmentName": "大路坝水管站",
                  "parentCode": "72B52CCF7F0A424EB4E6A5F7BE2AF0E8",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 1,
                  "leaf": true,
                  "children": null
                }
              ]
            }
          ]
        },
        {
          "departmentCode": "C71BD642E51E4DC8BE40B733596B66BA",
          "departmentName": "咸丰县防汛抗旱指挥部",
          "parentCode": "54326861FE9744CA8FCE46C5928946E1",
          "departmentOrder": null,
          "tm": null,
          "count": 149,
          "leaf": true,
          "children": [
            {
              "departmentCode": "ADC147FCB249476AB020DDF23EC00B70",
              "departmentName": "县委",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "F8499718547946C09A23A5DC412A4AE6",
              "departmentName": "县政府",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 4,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "6357B716BD4E4B949E274A5E811A49A3",
              "departmentName": "县政务局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "6505F4AD9A764BEF98AB4C24E8B244AC",
              "departmentName": "县人社局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "CEFD0B9750CA4AECB223301A3C4E2827",
              "departmentName": "县委宣传部",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "FC87B9CCDF9F43578D9CC296C051D229",
              "departmentName": "县应急局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "0501BCD77D6D4DC29A65BBFE63CA3FDC",
              "departmentName": "县水利局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "F65DEFC9C0E64702B9E93BAFB0E1DDD3",
              "departmentName": "县发改局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "300460E551644F56B081A7991D7C6FE1",
              "departmentName": "县科经局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "9CBF3999152C47B5B4A4098272AA8502",
              "departmentName": "县公安局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 2,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "12C7EAE71DC648BE9BB955F627CE53CD",
              "departmentName": "县民政局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "D07C1B5A398D47469F236F586950747E",
              "departmentName": "县财政局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "FBE7D6E0080C41939845BA28BC4AB996",
              "departmentName": "县自然资源规划局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "7808BAF07AA2467F873E7473EB336E4A",
              "departmentName": "县城管执法局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "4663D42D58324569BEC0744962DA62D1",
              "departmentName": "县交通运输局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "7224A13E0C0245F696BF9C16F90E8BA9",
              "departmentName": "县农业农村局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "E84C0EB457A54465A819218ACAA8E859",
              "departmentName": "县卫健局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "E1DA9D6279254C37B1B8020C4A48BD3F",
              "departmentName": "县住建局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 2,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "75CB9BCBE853468286BFB1927592C757",
              "departmentName": "州生态环境局咸丰分局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "622E2A9498074571ACD2404B7D3BCDA8",
              "departmentName": "县教育局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "B7FA556DBF414AE69E606C2854140D72",
              "departmentName": "县文旅局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "9C21EF8360DD4742A9F5B1DA71FF15B6",
              "departmentName": "县融媒体中心",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "A0EA09A19073496EB809F069FCC5C019",
              "departmentName": "武警咸丰中队",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "65C387B2A3194F04AC2E7EA0CF83B49A",
              "departmentName": "县气象局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 3,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "DC01B09FB71A41598085CBBC58C575BF",
              "departmentName": "县水文局",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 2,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "7C5F77AB16F14B0DB104025325DED2D9",
              "departmentName": "县消防救援大队",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "280176175A3848DC8F2B45371DEA3A4A",
              "departmentName": "国网咸丰县供电公司",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "2C1EC30AD89241E99E998F181C8B1259",
              "departmentName": "中国电信咸丰县分公司",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "C1D818C95B47479F9ECE00733E4B9C29",
              "departmentName": "中国移动咸丰县分公司",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "313BE93072804B3E886CE1C0CD3418C3",
              "departmentName": "中国联通咸丰县分公司",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "BCFDFAAA9C0942738E2E1D97B0B236E8",
              "departmentName": "县供销联社",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "AF3261B55FBA45849BE831B1B162F8C7",
              "departmentName": "邮政咸丰县分公司",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "264DA83C1FB74FC8A42943BA1F91EEDE",
              "departmentName": "中石化咸丰分公司",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
              "departmentName": "乡镇防汛抗旱指挥部",
              "parentCode": "C71BD642E51E4DC8BE40B733596B66BA",
              "departmentOrder": null,
              "tm": null,
              "count": 76,
              "leaf": true,
              "children": [
                {
                  "departmentCode": "4F4DF1D07631440CAE8CB5C80F3376B3",
                  "departmentName": "高乐山镇",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 7,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "08E628991EF74AC68BEEA6DBC9F3666E",
                  "departmentName": "忠堡镇",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 11,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "BA2DA050C5B24EE592243F8D67380312",
                  "departmentName": "坪坝营镇",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 7,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "4A7A02D2370A4CB79FF2400E120C1086",
                  "departmentName": "朝阳寺镇",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 6,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "B04C082336014C6DBE9AA94EDC7ADC6D",
                  "departmentName": "清坪镇",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 6,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "D4A4E2BC80C44907A86B976FBB19FD9A",
                  "departmentName": "曲江镇",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 9,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "93EE65A61B2B4C5BAF9486B12F42CF1E",
                  "departmentName": "唐崖镇",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 7,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "5ACFF7C13B484720BA75AB89FEEE9EC8",
                  "departmentName": "活龙坪乡",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 6,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "A3AC6EB989BD47298AF422882137B07C",
                  "departmentName": "小村乡",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 6,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "5CDD4C138E1D4268A6810623AD662D73",
                  "departmentName": "黄金洞乡",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 5,
                  "leaf": true,
                  "children": null
                },
                {
                  "departmentCode": "C6DD673028854EF48B1E1E2EF1BC5551",
                  "departmentName": "大路坝区",
                  "parentCode": "3FB7EE546AAD46EE80A5767AEA876F19",
                  "departmentOrder": null,
                  "tm": null,
                  "count": 6,
                  "leaf": true,
                  "children": null
                }
              ]
            }
          ]
        },
        {
          "departmentCode": "1F256BAB06684F14A889F1F9EA630A3F",
          "departmentName": "其他单位",
          "parentCode": "54326861FE9744CA8FCE46C5928946E1",
          "departmentOrder": null,
          "tm": null,
          "count": 21,
          "leaf": true,
          "children": [
            {
              "departmentCode": "54251BE997374AA29896001701F3D33F",
              "departmentName": "巴西坝驻村工作队",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 2,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "C3DDCDFB648543D48DE337D857E93233",
              "departmentName": "风背岩驻村工作队",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 2,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "0F2D1D4EDEE540BD954815BFFFB68DB3",
              "departmentName": "水井槽驻村工作队",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "1498F69ED80847F388CBF81B9116EC84",
              "departmentName": "唐崖供粮所",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 2,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "D9B417F92BAD472083B444FA2D88BC2A",
              "departmentName": "朝阳寺供粮所",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 2,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "F2CF1D76DC114B7C8120538FA1E204D4",
              "departmentName": "借调新城指挥部",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "DFF90FD800614E598674A5C8F8C943E9",
              "departmentName": "清泉公司 6822966",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 2,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "5B52D38912744890919732967E3448BD",
              "departmentName": "改革办电话",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "37B57B9BE7A94C408CC67FFA5129051F",
              "departmentName": "文明办",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "17C8F92B15DA4D8B8C33EBFCB6F84694",
              "departmentName": "脱贫攻坚指挥部",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "CFFF54E4709C4B389B13792465C235C3",
              "departmentName": "扫黑办（司法局407）",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "A3BD8EB693CA40E99778AA64EF8C184D",
              "departmentName": "电政办",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "975552B90DB246F589CA998D709D6BE3",
              "departmentName": "州局",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "DD38BAF9CBD945D1AA61A273975EB095",
              "departmentName": "统筹办",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "0EF61C68AAC4409B81161A66A6FB33DF",
              "departmentName": "财政局行资股",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            },
            {
              "departmentCode": "E70E8AE42DE54B94BFC38A1628F37329",
              "departmentName": "州局传真号",
              "parentCode": "1F256BAB06684F14A889F1F9EA630A3F",
              "departmentOrder": null,
              "tm": null,
              "count": 1,
              "leaf": true,
              "children": null
            }
          ]
        }
      ]
    }
  ],
  "success": true
}
}
				  this.treeData = res.data.data[0].children
				  this.treePath = [...this.treePath,{
					  name:res.data.data[0].departmentName,
					  code:res.data.data[0].departmentCode,
					  data:res.data.data[0],
				  }]
				} catch (e) {
				  uni.$showMsg()
				}
			},
			itemClick(item,index) { 
				this.treeData = item.children,
				this.treePath = [...this.treePath,{
									  name:item.departmentName,
									  code:item.departmentCode,
									  data:item,
									},
								]
			},
			breadcrumbClick(item,index) {
				this.treeData = item.data.children,
				this.treePath = [...this.treePath].filter((item,index2)=>index2<=index)
			} 
		}
	}
</script>

<style lang="scss" scoped>
.titleBar{
	width: 100%;
	height: 40px;
	background-color: #007afd;
	text-align: center;
	line-height: 40px;
	font-size: 18px;
	color: #ffffff;
}
.searchBar{
	background-color: #ffffff;
	padding: 10px 10px 0 10px;
	border-bottom: 1px solid rgba(233, 233, 233, 1);
}
.iconRow{
	margin: 15px 0;
	display: flex;
	justify-content: space-evenly;
}
.iconBox{
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.icon_text{
	margin-top: 10px;
	font-size: 14px;
	color: #666666;
}
.mybody{
	background-color: #ffffff;
	margin-top: 10px;
	border-top: 1px solid rgba(233, 233, 233, 1);
	height: calc( 100vh - 233px);
	overflow: hidden;
}
.breadcrumb{
	padding: 10px;
	border-bottom: 1px solid #eee;
}
.breadcrumb_item{
	padding: 8px;
	font-size: 14px;
}
.deptItem{
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: space-evenly;
}
.deptItem_border{
	width: 80%;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
	border-bottom: 1px solid #eee;
}
.deptItem_num{
	margin-right: 20px;
}
.personItemRow_right{
	height: 100%;
	flex: 1;
	border-bottom: 1px solid #eee;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.personItemRow_right_top{
	margin-top: 5px;
	display: flex;
	justify-content: flex-start
}
</style>
