| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <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.softwareName" />
- <CommonInfoRow label="著作权人" :value="form.applicant" />
- <CommonInfoRow label="所属单位" :value="form.organization" />
- <CommonInfoRow label="版本号" :value="form.version" />
- <CommonInfoRow label="开发完成日期" :value="form.developmentFinishDate ? formatDate(form.developmentFinishDate, 'YYYY-MM-DD') : '-'" />
- <CommonInfoRow label="首次发表日期" :value="form.firstPublishDate ? formatDate(form.firstPublishDate, 'YYYY-MM-DD') : '-'" />
- <CommonInfoRow label="成果权属" :value="getDictLabel('achievement_owner_unit', form.achievementOwnerUnit) || form.achievementOwnerUnit || '-'" />
- <CommonInfoRow label="权利范围" :value="getDictLabel('rights_scope', form.rightsScope) || form.rightsScope || '-'" />
- <CommonInfoRow label="权利取得方式" :value="getDictLabel('rights_acquire_method', form.rightsAcquireMethod) || form.rightsAcquireMethod || '-'" />
- <CommonInfoRow label="开发方式" :value="getDictLabel('development_method', form.developmentMethod) || form.developmentMethod || '-'" />
- <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 || '-'" />
- <CommonInfoRow v-if="form.developmentMethod === '20'" label="合作单位" :value="form.partnerUnit || '-'" />
- <CommonInfoRow label="佐证附件" isColumn>
- <view class="file-links">
- <view v-if="attachment" class="file-item" @click="handlePreview(attachment)">
- <text class="file-link">{{ attachment.fileName || '-' }}</text>
- </view>
- <text v-else>-</text>
- </view>
- </CommonInfoRow>
- <CommonInfoRow label="备注" :value="form.remark" isColumn />
- </CommonSection>
- <!-- 审批记录 -->
- <CommonSection title="审批记录" v-if="form.id">
- <FlowTable :id="form.id" :businessCode="String(form.id)" defCode="sci_achievement_software" />
- </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 { previewFile } from '@/utils/file';
- import to from 'await-to-js';
- 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('achievement_owner_unit', 'rights_scope', 'rights_acquire_method', 'development_method');
- const documentApi = useDocumentApi();
- const form = ref<any>(null);
- const loading = ref(false);
- 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 attachment = computed(() => {
- if (form.value?.fileUrl) {
- return {
- fileName: form.value.fileName || '佐证附件',
- fileUrl: form.value.fileUrl
- };
- }
- return null;
- });
- const handlePreview = (file: any) => {
- const url = file.fileUrl || file.url;
- const name = file.fileName || file.name;
- if (url) {
- previewFile(url, name);
- }
- };
- const fetchData = async () => {
- if (!props.code) return;
- loading.value = true;
- const [err, res] = await to(documentApi.getSoftwareAchievementById(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";
- .file-links {
- .file-item {
- padding: 6rpx 0;
- }
- .file-link {
- color: #2979ff;
- text-decoration: underline;
- word-break: break-all;
- }
- }
- </style>
|