CopyrightForm.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. <!-- 基本信息 -->
  6. <view class="common-section-card">
  7. <view class="section-title">基本信息</view>
  8. <view class="info-row">
  9. <text class="label">著作权编号</text>
  10. <text class="value">{{ form.copyrightCode || '-' }}</text>
  11. </view>
  12. <view class="info-row">
  13. <text class="label">著作权名称</text>
  14. <text class="value">{{ form.copyrightName || '-' }}</text>
  15. </view>
  16. <view class="info-row">
  17. <text class="label">登记号</text>
  18. <text class="value">{{ form.registerCode || '-' }}</text>
  19. </view>
  20. <view class="info-row">
  21. <text class="label">著作权类型</text>
  22. <text class="value">{{ getDictLabel('sci_copyright_type', form.copyrightType) }}</text>
  23. </view>
  24. <view class="info-row">
  25. <text class="label">学科门类</text>
  26. <text class="value">{{ getDictLabel('subj_category', form.subjCategory) }}</text>
  27. </view>
  28. <view class="info-row">
  29. <text class="label">一级学科</text>
  30. <text class="value">{{ form.disciplineName || '-' }}</text>
  31. </view>
  32. <view class="info-row">
  33. <text class="label">所属单位</text>
  34. <text class="value">{{ form.deptName || '-' }}</text>
  35. </view>
  36. <view class="info-row">
  37. <text class="label">出版日期</text>
  38. <text class="value">{{ formatDate(form.publicationDate, 'YYYY-MM-DD') }}</text>
  39. </view>
  40. <view class="info-row" v-if="form.fileName">
  41. <text class="label">审批附件</text>
  42. <text class="value primary-color" @click="previewFile(form.fileUrl, form.fileName)">{{ form.fileName }}</text>
  43. </view>
  44. <view class="info-row">
  45. <text class="label">备注</text>
  46. <text class="value">{{ form.remark || '-' }}</text>
  47. </view>
  48. </view>
  49. <!-- 作者信息 -->
  50. <view class="common-section-card mt20" v-if="form.memberList?.length">
  51. <view class="section-title">作者信息</view>
  52. <view class="member-list">
  53. <view class="member-item" v-for="(member, index) in form.memberList" :key="index">
  54. <view class="member-header">
  55. <text class="m-name">{{ member.memberName }}</text>
  56. <text class="m-tag">署名顺序: {{ member.signOrder }}</text>
  57. </view>
  58. <view class="m-body">
  59. <view class="m-line">
  60. <text class="l">作者类型:</text>
  61. <text class="v">{{ getDictLabel('sci_paper_author_type', member.memberType) }}</text>
  62. </view>
  63. <view class="m-line"><text class="l">职工号/学号:</text><text class="v">{{ member.memberCode || '-' }}</text></view>
  64. <view class="m-line">
  65. <text class="l">性别:</text>
  66. <text class="v">{{ member.gender === '10' ? '男' : member.gender === '20' ? '女' : '-' }}</text>
  67. </view>
  68. <view class="m-line">
  69. <text class="l">学历:</text>
  70. <text class="v">{{ getDictLabel('sci_academic_degree', member.educated) }}</text>
  71. </view>
  72. <view class="m-line">
  73. <text class="l">职称:</text>
  74. <text class="v">{{ getDictLabel('sci_discipline_job_title', member.technicalTitle) }}</text>
  75. </view>
  76. <view class="m-line"><text class="l">所属单位/学校:</text><text class="v">{{ member.deptName || '-' }}</text></view>
  77. <view class="m-line"><text class="l">贡献率:</text><text class="v">{{ member.contributionRate || 0 }}%</text></view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <uv-empty v-else mode="data" text="暂无数据"></uv-empty>
  84. </view>
  85. </template>
  86. <script setup lang="ts">
  87. import { ref, onMounted, watch } from 'vue';
  88. import { useDict } from '@/hooks/useDict';
  89. import { useDocumentApi } from '@/api/document';
  90. import { previewFile } from '@/utils/file';
  91. import { formatDate } from '@/utils/date';
  92. import to from 'await-to-js';
  93. const props = defineProps<{
  94. code: string;
  95. }>();
  96. const { getDictLabel } = useDict(
  97. 'sci_copyright_type',
  98. 'subj_category',
  99. 'sci_paper_author_type',
  100. 'sci_academic_degree',
  101. 'sci_discipline_job_title'
  102. );
  103. const documentApi = useDocumentApi();
  104. const form = ref<any>(null);
  105. const loading = ref(false);
  106. const fetchData = async () => {
  107. if (!props.code) return;
  108. loading.value = true;
  109. const [err, res] = await to(documentApi.getCopyrightByCode(props.code));
  110. if (!err && res?.data) {
  111. form.value = res.data;
  112. }
  113. loading.value = false;
  114. };
  115. onMounted(() => {
  116. fetchData();
  117. });
  118. watch(() => props.code, () => {
  119. fetchData();
  120. });
  121. </script>
  122. <style lang="scss" scoped>
  123. @import "./common.scss";
  124. .m-body {
  125. padding: 10rpx 0;
  126. .m-line {
  127. font-size: 26rpx;
  128. line-height: 1.6;
  129. display: flex;
  130. .l { color: #888; width: 180rpx; flex-shrink: 0; }
  131. .v { color: #333; }
  132. }
  133. }
  134. </style>