<template>
  <view>
    <cu-custom bgImage="/static/bg.png" :isBack="false">
      <template v-slot:content>
        组织
      </template>
    </cu-custom>
	<view class="cu-bar search bg-white">
		<view class="search-form round">
			<text class="cuIcon-search"></text>
			<input type="search" placeholder="请输入姓名或者手机号搜索" />
		</view>
		<view class="action">
			<button class="cu-btn bg-green shadow-blur round" @tap="handleSearch">搜索</button>
		</view>
	</view>
    <view class="padding-left padding-right">
      <mix-tree :list="list" @treeItemClick="treeItemClick"></mix-tree>
    </view>
  </view>
</template>

<script setup lang="ts">
import CuCustom from '@/colorui/components/cu-custom.vue'
import MixTree from '@/components/mix-tree/mix-tree';
import {ref} from "vue";
import DeptApi from '@/api/DeptApi';
import UniEasyinput from "@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue";

const list = ref([]);
const keyword = ref('');

const handleSearch = () => {
  uni.navigateTo({
    url:`/pages/pub/users?keyword=${keyword.value}`
  })
}

DeptApi.list().then(res => {
  list.value = res.data
})
//点击树节点
const treeItemClick = (res: any) => {
  uni.navigateTo({
    url: '/pages/dept/users?id=' + res.id
  })
}
</script>

<style>

</style>
