index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view>
  3. <cu-custom bgImage="/static/bg.png" :isBack="false">
  4. <template v-slot:content>
  5. <text class="text-black">组织</text>
  6. </template>
  7. </cu-custom>
  8. <view class="cu-bar search bg-white">
  9. <view class="search-form round">
  10. <text class="cuIcon-search"></text>
  11. <input type="search" placeholder="请输入姓名或者手机号搜索" />
  12. </view>
  13. <view class="action">
  14. <button class="cu-btn bg-green shadow-blur round" @tap="handleSearch">搜索</button>
  15. </view>
  16. </view>
  17. <view class="padding-left padding-right">
  18. <mix-tree :list="list" @treeItemClick="treeItemClick"></mix-tree>
  19. </view>
  20. </view>
  21. </template>
  22. <script setup lang="ts">
  23. import CuCustom from '@/colorui/components/cu-custom.vue'
  24. import MixTree from '@/components/mix-tree/mix-tree';
  25. import {ref} from "vue";
  26. import DeptApi from '@/api/DeptApi';
  27. import UniEasyinput from "@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue";
  28. const list = ref([]);
  29. const keyword = ref('');
  30. const handleSearch = () => {
  31. uni.navigateTo({
  32. url:`/pages/pub/users?keyword=${keyword.value}`
  33. })
  34. }
  35. DeptApi.list().then(res => {
  36. list.value = res.data
  37. })
  38. //点击树节点
  39. const treeItemClick = (res: any) => {
  40. uni.navigateTo({
  41. url: '/pages/dept/users?id=' + res.id
  42. })
  43. }
  44. </script>
  45. <style>
  46. </style>