<template>
	<wd-cell-group title="申请信息">
		<wd-cell title="发文字号" :value="info.fwzh" />
		<wd-cell>
			<template #title>
				<view>
					<view style="display: inline-block">发文标题</view>
				</view>
			</template>
			<view style="color: blue;" @click="onlinePreview(info.wjbt)">
			{{info.fwbt}}
			</view>
		</wd-cell>
		<wd-cell title="发文日期" :value="info.fwtime" />
		<wd-cell title="拟稿人" :value="info.ngr" />
		<wd-cell title="拟稿人电话" :value="info.ngrdh" />
		<wd-cell title="类别及代号" :value="info.wjlb" />
		<wd-cell title="密级" :value="info.mj_dictText" />
		<wd-cell title="主题词" :value="info.ztc" />
		<wd-cell title="文件描述" :value="info.wjms" />
		<wd-cell title="签发人" :value="info.qfr_dictText" />
	</wd-cell-group>
</template>

<script setup>
	import {
		queryDocumentByIdApi
	} from '@/api/bpm'

	const info = ref({})
	const props = defineProps({
		formData: {
			type: Object,
			default: () => {},
		}
	})

	// 申请信息
	const queryById = () => {
		queryDocumentByIdApi(props.formData.dataId).then((res) => {
			if (res.success) {
				info.value = res.result.records[0]
			}
		})
	}

	const onlinePreview = (e) => {
		uni.navigateTo({
			url: `/pages/onlinePreview/detail?data=${e}`
		})
	}

	onMounted(() => {
		queryById()
	})
</script>