| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <view class="document-form">
- <uv-loading-icon v-if="loading" mode="circle" text="正在加载学术会议详情..."></uv-loading-icon>
- <template v-else-if="form">
- <!-- 基本信息 -->
- <CommonSection title="基本信息" :isFirst="true">
- <CommonInfoRow label="会议名称" :value="form.codTitle" />
- <CommonInfoRow label="会议类型" :value="getLecTypeLabel(form.codType)" />
- <CommonInfoRow label="主办单位" :value="form.codOrganizer" />
- <CommonInfoRow label="会议日期" :value="formatDate(form.codStartTime) + '~~' + formatDate(form.codEndTime)" />
- <CommonInfoRow label="主讲人" :value="form.applicantName" />
- <CommonInfoRow label="会议地址" :value="form.codAddress" />
- <CommonInfoRow label="所属平台" isColumn>
- <view class="platform-tags">
- <template v-if="platformList.length > 0">
- <uv-tags v-for="(p, index) in platformList" :key="index" :text="p.platformName === '其他' ? '其他' : (p.platformType ? p.platformName + ' (' + p.platformType + ')' : p.platformName)" type="primary" plain size="mini" class="mr5"></uv-tags>
- </template>
- <text v-else>-</text>
- </view>
- </CommonInfoRow>
- <CommonInfoRow label="所属团队" :value="form.belongTeam || '-'" isColumn />
- <CommonInfoRow label="审批状态" :value="getApprovalStatusLabel(form.approvalStatus)" />
- <CommonInfoRow label="会议简介" :value="form.codBriefInfo" isColumn />
- </CommonSection>
- <!-- 学术贡献 -->
- <CommonSection title="学术贡献">
- <CommonInfoRow label="论文题目" :value="form.paperName" />
- <CommonInfoRow label="第一作者" :value="form.firstName" />
- <CommonInfoRow label="通讯作者" :value="form.phoneName" />
- <CommonInfoRow label="交流方式" :value="getDictLabel('sci_communicate_type', form.communicateType)" />
- <CommonInfoRow label="论文摘要" :value="form.paperSummary" isColumn />
- </CommonSection>
- <!-- 相关附件 -->
- <AttachmentList :list="uploadList" title="相关附件" />
- <!-- 审批信息 -->
- <CommonSection title="审批信息" v-if="form.id">
- <FlowTable :id="form.id" :businessCode="String(form.id)" defCode="sci_academic_conferences" />
- </CommonSection>
- </template>
- <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
- </view>
- </template>
- <script setup lang="ts">
- import { ref, onMounted, watch, computed } from 'vue';
- import { useDict } from '@/hooks/useDict';
- import { useDocumentApi } from '@/api/document';
- import { formatDate } from '@/utils/date';
- import to from 'await-to-js';
- import AttachmentList from './AttachmentList.vue';
- import FlowTable from '@/pages/project/components/detail/FlowTable.vue';
- import CommonSection from '@/components/ui/CommonSection.vue';
- import CommonInfoRow from '@/components/ui/CommonInfoRow.vue';
- const props = defineProps<{
- code: string;
- }>();
- const { getDictLabel } = useDict('sci_communicate_type');
- const documentApi = useDocumentApi();
- const form = ref<any>(null);
- const loading = ref(false);
- const LecTypeList = [
- { value: '50', label: '院内会议' },
- { value: '10', label: '学校会议' },
- { value: '20', label: '省级会议' },
- { value: '30', label: '国内学术会议' },
- { value: '40', label: '国际学术会议' }
- ];
- const getLecTypeLabel = (value: string | number) => {
- const item = LecTypeList.find(i => i.value === String(value));
- return item ? item.label : (value || '-');
- };
- const getApprovalStatusLabel = (status: string | number) => {
- const map: Record<string, string> = {
- '10': '待提交',
- '20': '审批中',
- '30': '审批通过',
- '40': '审批退回'
- };
- return map[String(status)] || '-';
- };
- const platformList = computed(() => {
- if (form.value?.belongPlatform) {
- try {
- const data = JSON.parse(form.value.belongPlatform);
- return Array.isArray(data) ? data : [];
- } catch (e) {
- if (form.value.belongPlatform === '其他') return [{ platformName: '其他' }];
- return [{ platformName: form.value.belongPlatform }];
- }
- }
- return [];
- });
- const uploadList = computed(() => {
- if (!form.value) return [];
- const list = [];
- try {
- if (form.value.codNotice) {
- const notice = JSON.parse(form.value.codNotice);
- if (notice && notice.url) {
- list.push({ ...notice, type: '会议通知' });
- }
- }
- if (form.value.codDocument) {
- const doc = JSON.parse(form.value.codDocument);
- if (doc && doc.url) {
- list.push({ ...doc, type: '相关文档' });
- }
- }
- } catch (e) {
- console.error('Failed to parse attachment JSON', e);
- }
- return list;
- });
- const fetchData = async () => {
- if (!props.code) return;
- loading.value = true;
- const [err, res] = await to(documentApi.getConferenceById(props.code));
- if (!err && res?.data) {
- form.value = res.data;
- }
- loading.value = false;
- };
- onMounted(() => {
- fetchData();
- });
- watch(() => props.code, () => {
- fetchData();
- });
- </script>
- <style lang="scss" scoped>
- @import "./common.scss";
- </style>
|