<template>
	<view>
		<u-popup :show="show" @close="_close" @open="_open" :round="10">
			<view>
				<luyj-tree v-slot:default="{item}" parent :trees="listData" :props="aprop" :isCheck="true" @sendValue="handleSendValue" :check-list="checkList">
					<!-- 内容插槽 -->
					<view>
						<view class="content-item">
							<view class="word">{{item.name}}</view>
						</view>
					</view>
				</luyj-tree>
			</view>
		</u-popup>
	</view>
</template>
<script>
	import {
		filterCustomerManager
	} from "@/utils/util";
	export default {
		data() {
			return {
				show: false,
				aprop: {
					id: 'id',
					label: 'label',
					children: 'children',
					multiple: true,
					checkStrictly: false, //不关联
					nodes: false, // nodes为false时，可以选择任意一级选项；nodes为true时只能选择叶子节点
				},
				listData : [],
				checkList : [],
			}
		},
		methods: {
			_show() {
				this.show = true;
			},
			_open() {
				// console.log('open');
			},
			_close() {
				this.show = false
				// console.log('close');
			},
			handleSendValue(value){
				console.log(value);
			},
		},
		created(){
			// 获取人员
			uni.$u.api.listDetpUser().then(res => {
				this.listData = filterCustomerManager(res.data);
				console.log(this.listData);
			})
		}
	}
</script>
