SciAchievementSoftware.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.softwareName || '-' }}</text></view>
  8. <view class="info-row"><text class="label">著作权人</text><text class="value">{{ form.applicant || '-' }}</text></view>
  9. <view class="info-row"><text class="label">所属单位</text><text class="value">{{ form.organization || '-' }}</text></view>
  10. <view class="info-row"><text class="label">版本号</text><text class="value">{{ form.version || '-' }}</text></view>
  11. <view class="info-row"><text class="label">开发完成日期</text><text class="value">{{ form.developmentFinishDate ? formatDate(form.developmentFinishDate, 'YYYY-MM-DD') : '-' }}</text></view>
  12. <view class="info-row"><text class="label">首次发表日期</text><text class="value">{{ form.firstPublishDate ? formatDate(form.firstPublishDate, 'YYYY-MM-DD') : '-' }}</text></view>
  13. <view class="info-row">
  14. <text class="label">成果归属单位</text>
  15. <text class="value">{{ getDictLabel('achievement_owner_unit', form.achievementOwnerUnit) || form.achievementOwnerUnit || '-' }}</text>
  16. </view>
  17. <view class="info-row">
  18. <text class="label">权利范围</text>
  19. <text class="value">{{ getDictLabel('rights_scope', form.rightsScope) || form.rightsScope || '-' }}</text>
  20. </view>
  21. <view class="info-row">
  22. <text class="label">权利取得方式</text>
  23. <text class="value">{{ getDictLabel('rights_acquire_method', form.rightsAcquireMethod) || form.rightsAcquireMethod || '-' }}</text>
  24. </view>
  25. <view class="info-row">
  26. <text class="label">开发方式</text>
  27. <text class="value">{{ getDictLabel('development_method', form.developmentMethod) || form.developmentMethod || '-' }}</text>
  28. </view>
  29. <view class="info-row column">
  30. <text class="label">备注</text>
  31. <text class="value remark">{{ form.remark || '-' }}</text>
  32. </view>
  33. </view>
  34. <!-- 附件 -->
  35. <AttachmentList :file="attachment" title="佐证附件" />
  36. </template>
  37. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  38. </view>
  39. </template>
  40. <script setup lang="ts">
  41. import { ref, onMounted, watch, computed } from 'vue';
  42. import { useDict } from '@/hooks/useDict';
  43. import { useDocumentApi } from '@/api/document';
  44. import { formatDate } from '@/utils/date';
  45. import to from 'await-to-js';
  46. import AttachmentList from './AttachmentList.vue';
  47. const props = defineProps<{
  48. code: string;
  49. }>();
  50. const { getDictLabel } = useDict('achievement_owner_unit', 'rights_scope', 'rights_acquire_method', 'development_method');
  51. const documentApi = useDocumentApi();
  52. const form = ref<any>(null);
  53. const loading = ref(false);
  54. const attachment = computed(() => {
  55. if (form.value?.fileUrl) {
  56. return [{
  57. name: form.value.fileName || '佐证附件',
  58. url: form.value.fileUrl
  59. }];
  60. }
  61. return null;
  62. });
  63. const fetchData = async () => {
  64. if (!props.code) return;
  65. loading.value = true;
  66. const [err, res] = await to(documentApi.getSoftwareAchievementById(props.code));
  67. if (!err && res?.data) {
  68. form.value = res.data;
  69. }
  70. loading.value = false;
  71. };
  72. onMounted(() => {
  73. fetchData();
  74. });
  75. watch(() => props.code, () => {
  76. fetchData();
  77. });
  78. </script>
  79. <style lang="scss" scoped>
  80. @import "./common.scss";
  81. </style>