<script setup lang="ts">
import { ref } from 'vue';
import layout from '/@/views/h5/layout/index.vue';
import uploadFile from "/@/components/Upload/index.vue";
import {getByProcessInstanceId} from "/@/api/h5/expert";
import {useRoute} from 'vue-router';
const route = useRoute();
const dataList = ref<any[]>([]);
const levelMap = {
	'national': '国家级',
	'provincial': '省部级',
	'city': '市级',
};

const data = (data: any[]) => {
	dataList.value = data;
};
// /h5/experts?processInstanceId=38931fd1-d740-11f0-8e1f-e86538668cc9&taskId=39c9cb24-d740-11f0-8e1f-e86538668cc9
const processInstanceId = ref(route.query.processInstanceId);
const taskId = ref(route.query.taskId);
getByProcessInstanceId(processInstanceId.value).then((res) => {
	data(res.data);
});
</script>

<template>
<layout :taskId="taskId" title="专家信息审核" @data="data" :process-instance-id="processInstanceId">
	<div class="experts-box">
		<el-row :span="24">
			<el-col :span="12">
				<div class="experts-table">
					<div class="experts-label">填报人：</div>
					<div class="experts-value">张三</div>
				</div>
			</el-col>
			<el-col :span="12">
				<div class="experts-table">
					<div class="experts-label">填报单位：</div>
					<div class="experts-value">xxx股份有责任公司</div>
				</div>
			</el-col>
		</el-row>
		<el-row :span="24">
			<el-col :span="12">
				<div class="experts-table">
					<div class="experts-label">日期：</div>
					<div class="experts-value">2025-12-10</div>
				</div>
			</el-col>
			<el-col :span="12">
				<div class="experts-table">
					<div class="experts-label">流水号：</div>
					<div class="experts-value">123123123</div>
				</div>
			</el-col>
		</el-row>
		<el-table :data="dataList" height="200" border style="margin-top: 5px">
			<el-table-column label="序号" width="80">
				<template #default="scope">
					<div>{{ scope.$index + 1 }}</div>
				</template>
			</el-table-column>
			<el-table-column prop="expertName" label="专家姓名" min-width="120"/>
			<el-table-column prop="contactInformation" label="联系方式" min-width="120"/>
			<el-table-column prop="technologyField" label="技术领域" min-width="120"/>
			<el-table-column prop="professionalTitle" label="职称" min-width="80"/>
			<el-table-column prop="workUnit" label="工作单位" min-width="120"/>
			<el-table-column label="附件" min-width="80">
				<template #default="{row}">
					<upload-file type="simple" v-model="row.attachmentUrl" disabled/>
				</template>
			</el-table-column>
			<el-table-column prop="testimonyMaterials" label="佐证材料" min-width="120">
				<template #default="{row}">
					<upload-file type="simple" v-model="row.testimonyMaterials" disabled/>
				</template>
			</el-table-column>
			<el-table-column label="级别" min-width="80">
				<template #default="{row}">
					<div>{{ levelMap[row.level] }}</div>
				</template>
			</el-table-column>
		</el-table>
	</div>
</layout>
</template>

<style scoped lang="scss">
.experts-box {
	height: 100%;
	width: 100%;
	font-size: 14px;
}
.experts-box .experts-table {
	width: 100%;
}
.experts-box .experts-table {
	width: 100%;
	margin: 5px 0;
}
.experts-box .experts-table .experts-label {
	width: 80px;
	color: #858585;
}
.experts-box .experts-table .experts-value {
}
</style>