<template>
	<view class="personnel-page">
		<scroll-view class="scroll-y" scroll-y="true">
			<tm-radio-group
        type="select"
			  :list="list"
				:defaultValue='defaultValue'
				@change="changeSelect"
        :openkeys="[0]"
				:setting="{
          pName: 'pName',
          child: 'childList',
				  value: 'value',
				  name: 'label'
			  }"
			/>
		</scroll-view>
		<view class="fixed-buttom-btn">
			<text class="btn-text">确定</text>
		</view>
	</view>
</template>

<script>
	// 人员架构
	export default {
		data(){
			return {
				defaultValue: 1,
				list: [
          {
            pValue: 1,
            pName: '门诊',
            childList: [
              {value: 1, label: 'PDCA1'},
					    {value: 2, label: 'PDCA2'},
				    	{value: 3, label: 'PDCA3'},
					    {value: 4, label: 'PDCA4'}
            ]
          },
          {
            pValue: 2,
            pName: '分诊',
            childList: [
              {value: 11, label: '许玮琛1'},
					    {value: 22, label: '许玮琛2'},
				    	{value: 33, label: '许玮琛3'},
					    {value: 44, label: '许玮琛4'}
            ]
          },

				]
			}
		},
		created() {
			uni.setNavigationBarTitle({
				title: '人员架构'
			});
    },
    methods: {
      changeSelect(selectVal) {
        this.defaultValue = selectVal
      }
    },
	}
</script>

<style lang="less">
	.personnel-page {
		height: 100%;

		.scroll-y {
			height: calc(100% - 87.5rpx);
			padding-top: 15rpx;
		}
	}
</style>
