<template>
	<view>
		<uni-card :is-shadow="false">
			<uni-section title="台账信息" type="line">
				<uni-card :is-shadow="false">
					<button type="primary" @click="toTaizhang">人员台账</button>
				</uni-card>
				<uni-card :is-shadow="false">
					<button v-if="roleDetail" type="primary" @click="toSzcs">通过素质测试</button>
				</uni-card>
			</uni-section>
			<uni-section title="统计信息" type="line">
				<uni-card :is-shadow="false">
					<button type="primary" @click="toTongji">年龄段统计</button>
				</uni-card>

				<uni-card :is-shadow="false">
					<button type="primary" @click="toQtTongji">通用字段统计</button>
				</uni-card>
			</uni-section>
		</uni-card>
		<uni-popup ref="popup" type="bottom" background-color="#fff">
			<cxc-szcx-jsonDataViewer :username="username" :persionalKey="persionalKey"
				:type="type"></cxc-szcx-jsonDataViewer>
		</uni-popup>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';

	import {
		useStore
	} from '@/store';
	const store = useStore();
	const roleDetail = ref(store.userinfo.realname === '廖德云' || store.userinfo.realname === '马敬朝');

	// 定义要传入的参数
	const username = ref('');
	const persionalKey = ref('');
	const type = ref('');
	const popup = ref(null);

	function toSzcs() {
		username.value = 'liaody'
		persionalKey.value = 'szcsRy'
		type.value = '5'
		popup.value.open();
	}

	function toTaizhang() {
		uni.navigateTo({
			url: '/pages/views/renliziyuan/renyuanxinxi/taizhang'
		});
	}

	function toTongji() {
		uni.navigateTo({
			url: '/pages/views/renliziyuan/renyuanxinxi/tongji'
		});
	}

	function toQtTongji() {
		uni.navigateTo({
			url: '/pages/views/renliziyuan/renyuanxinxi/qttongji'
		});
	}
</script>

<style></style>