<template>
	<!-- 考勤统计插件 -->
	<view class="p-4 flex justify-between items-center">
	  <text>{{ prveMonth }}月考勤数据统计</text>
	  <u-button size="mini" type="primary" class="m-0" @click="toLink">查看</u-button>
	</view>
</template>

<script setup>
	import { ref, computed } from 'vue';
	import { useStore } from 'vuex';
	import dayjs from 'dayjs';
	
	const props = defineProps({ task: { type: Object, default: () => {} } });
	
	const store = useStore();
	
	const prveMonth = computed(() => {
		const currMonth = dayjs(+props.task.planStart).format("M");
		return currMonth === 1 ? 12 : currMonth - 1;
	});
	
	function toLink() {
		uni.$storage.setStorageSync('pluginKey', 'checkWorkSummary');
		
		uni.navigateTo({
			url: "/pages/detail/detail"
		})
	}
</script>

<style>
</style>