<route lang="json5" type="page">
	{
	layout: 'default',
	style: {
	navigationStyle: 'custom',
	navigationBarTitleText: '厂级制度详情',
	},
	}
</route>
<template>
	<PageLayout navTitle="制度详情">
		<view class="container">
			<wd-card title="制度">
				<view style="color: blue;"
					@click="onlinePreview(`/pages/onlinePreview/detail?data=${dataSource.sszd}`)">
					{{dataSource.zdmc}}
				</view>
			</wd-card>
			<wd-card title="解读材料">
				<view style="color: blue;"
					@click="onlinePreview(`/pages/onlinePreview/detail?data=${dataSource.jdwj}`)">
					{{getFilename(dataSource.jdwj)}}
				</view>
			</wd-card>
		</view>
	</PageLayout>
</template>

<script setup>
	import {
		useAppStore
	} from '@/store'
	import {
		queryDataById
	} from '@/api/pages/file'
	import {
		getFilename
	} from '@/utils'
	
	const appStore = useAppStore()
	const dataSource = ref({})

	const onlinePreview = (url) => {
		uni.navigateTo({
			url
		})
	}

	const getData = (e) => {
		queryDataById(e).then(res => {
			dataSource.value = res.result
		})
	}

	onLoad((options) => {
		getData(options.data)
	})
</script>

<style lang="scss" scoped>
	.container {
		padding: calc(10px + var(--status-bar-height, 0)) 5px 0 5px;
		min-height: 100vh;
		background-color: #f7f7f7;
	}
</style>