detail.vue 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="achievement-detail">
  3. <AchPatentForm v-if="type === 'patent'" :code="code" />
  4. <SciAchievementSoftware v-else-if="type === 'software'" :code="id" />
  5. <SciAchievementOther v-else-if="type === 'other'" :code="id" />
  6. <SciAchievementStandard v-else-if="type === 'standard'" :code="id" />
  7. <AchDecisionForm v-else-if="type === 'decision'" :code="id" />
  8. <AchWorkForm v-else-if="type === 'work'" :code="code" />
  9. <AchAwardsForm v-else-if="type === 'awards'" :code="code" />
  10. <AchPaperForm v-else-if="type === 'paper'" :code="code" />
  11. <ConferenceForm v-else-if="type === 'conference'" :code="id" />
  12. <SpecialActivityForm v-else-if="type === 'special_activity'" :code="id" />
  13. <view v-else class="fallback-container">
  14. <uv-empty mode="data" text="该类型详情暂未完全适配移动端,请联系管理员"></uv-empty>
  15. <view class="debug-info" v-if="id">
  16. <text>类型: {{ type }}</text>
  17. <text>ID: {{ id }}</text>
  18. <text>编码: {{ code }}</text>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script setup lang="ts">
  24. import { ref } from 'vue';
  25. import { onLoad } from '@dcloudio/uni-app';
  26. import AchPatentForm from '../todo/components/document/AchPatentForm.vue';
  27. import SciAchievementSoftware from '../todo/components/document/SciAchievementSoftware.vue';
  28. import SciAchievementOther from '../todo/components/document/SciAchievementOther.vue';
  29. import SciAchievementStandard from '../todo/components/document/SciAchievementStandard.vue';
  30. import AchPaperForm from '../todo/components/document/AchPaperForm.vue';
  31. import AchAwardsForm from '../todo/components/document/AchAwardsForm.vue';
  32. import AchWorkForm from '../todo/components/document/AchWorkForm.vue';
  33. import ConferenceForm from '../todo/components/document/ConferenceForm.vue';
  34. import AchDecisionForm from '../todo/components/document/AchDecisionForm.vue';
  35. import SpecialActivityForm from '../todo/components/document/SpecialActivityForm.vue';
  36. const type = ref('');
  37. const id = ref('');
  38. const code = ref('');
  39. onLoad((options: any) => {
  40. type.value = options.type || '';
  41. id.value = options.id || '';
  42. code.value = options.code || '';
  43. if (type.value) {
  44. uni.setNavigationBarTitle({
  45. title: getTitleByType(type.value)
  46. });
  47. }
  48. });
  49. const getTitleByType = (t: string) => {
  50. const map: any = {
  51. patent: '专利详情',
  52. software: '软著详情',
  53. other: '其他成果详情',
  54. standard: '标准详情',
  55. decision: '决策咨询详情',
  56. work: '学术著作详情',
  57. awards: '奖项荣誉详情',
  58. paper: '学术论文详情',
  59. conference: '学术会议详情',
  60. special_activity: '科技专项活动详情'
  61. };
  62. return map[t] || '成果详情';
  63. };
  64. </script>
  65. <style lang="scss" scoped>
  66. .achievement-detail {
  67. min-height: 100vh;
  68. background-color: #f8fafc;
  69. padding: 20rpx 0;
  70. }
  71. .fallback-container {
  72. padding: 100rpx 40rpx;
  73. display: flex;
  74. flex-direction: column;
  75. align-items: center;
  76. .debug-info {
  77. margin-top: 40rpx;
  78. font-size: 24rpx;
  79. color: #999;
  80. display: flex;
  81. flex-direction: column;
  82. align-items: center;
  83. }
  84. }
  85. </style>