SciAchievementPaperPushClaim.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view class="document-form">
  3. <uv-loading-icon v-if="loading" mode="circle" text="正在加载论文认领详情..."></uv-loading-icon>
  4. <template v-else-if="form">
  5. <view class="common-section-card">
  6. <view class="section-title">基本信息</view>
  7. <view class="info-row"><text class="label">名称</text><text class="value">{{ form.paperName || '-' }}</text></view>
  8. <view class="info-row"><text class="label">DOI</text><text class="value">{{ form.doi || '-' }}</text></view>
  9. <view class="info-row"><text class="label">来源</text><text class="value">{{ form.source || '-' }}</text></view>
  10. <view class="info-row"><text class="label">期刊</text><text class="value">{{ form.publicationName || '-' }}</text></view>
  11. <view class="info-row"><text class="label">公开日期</text><text class="value">{{ form.publishDate ? formatDate(form.publishDate, 'YYYY-MM-DD') : '-' }}</text></view>
  12. <view class="info-row"><text class="label">归属年度</text><text class="value">{{ form.belongYear || '-' }}</text></view>
  13. <view class="info-row column"><text class="label">第一署名单位</text><text class="value remark">{{ form.firstSignUnits || '-' }}</text></view>
  14. <view class="info-row column"><text class="label">第二署名单位</text><text class="value remark">{{ form.secondSignUnits || '-' }}</text></view>
  15. <view class="info-row column"><text class="label">第一作者</text><text class="value remark">{{ form.firstAuthors || '-' }}</text></view>
  16. <view class="info-row column"><text class="label">关键词</text><text class="value remark">{{ form.keywords || '-' }}</text></view>
  17. <view class="info-row column">
  18. <text class="label">摘要</text>
  19. <text class="value remark">{{ form.abstract || '-' }}</text>
  20. </view>
  21. </view>
  22. </template>
  23. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  24. </view>
  25. </template>
  26. <script setup lang="ts">
  27. import { ref, onMounted, watch } from 'vue';
  28. import { useDocumentApi } from '@/api/document';
  29. import { formatDate } from '@/utils/date';
  30. import to from 'await-to-js';
  31. const props = defineProps<{
  32. code: string;
  33. }>();
  34. const documentApi = useDocumentApi();
  35. const form = ref<any>(null);
  36. const loading = ref(false);
  37. const fetchData = async () => {
  38. if (!props.code) return;
  39. loading.value = true;
  40. const [err, res] = await to(documentApi.getPaperPushById(props.code));
  41. if (!err && res?.data) {
  42. form.value = res.data;
  43. }
  44. loading.value = false;
  45. };
  46. onMounted(() => {
  47. fetchData();
  48. });
  49. watch(() => props.code, () => {
  50. fetchData();
  51. });
  52. </script>
  53. <style lang="scss" scoped>
  54. @import "./common.scss";
  55. </style>