diff --git a/src/assets/less/common.less b/src/assets/less/common.less index 099382e..cc3665f 100644 --- a/src/assets/less/common.less +++ b/src/assets/less/common.less @@ -794,6 +794,10 @@ margin-left: 15px; } } + + .disabled-file-info { + color: rgba(0, 0, 0, 0.25); + } } /*详情样式end*/ diff --git a/src/views/standardRegulationLibrary/foreignStandard/detail/ForeignStandardDetailPage.vue b/src/views/standardRegulationLibrary/foreignStandard/detail/ForeignStandardDetailPage.vue index a52599e..d4f052d 100644 --- a/src/views/standardRegulationLibrary/foreignStandard/detail/ForeignStandardDetailPage.vue +++ b/src/views/standardRegulationLibrary/foreignStandard/detail/ForeignStandardDetailPage.vue @@ -79,17 +79,20 @@
-
+
-
{{ file.fileName }}
+
{{ file.fileName }}
- + {{ $t('download') }} - + {{ $t('unwatermarkedDownload') }} @@ -117,7 +120,7 @@ import { getForeignStandardDetail, getForeignStandardFormModal } from '@/api/standardRegulationLibraryApi' import StandardResolutionSheetModal from './modules/StandardResolutionSheetModal' import TextContentModal from '../../../enterpriseStandardLibrary/standard/detail/module/TextContentModal' -import { FieldType, StandardSource } from '../../../../enums/commonEnums' +import { FieldType, StandardSource, StandardStatus } from '../../../../enums/commonEnums' import { getFileInfo } from '../../../../api/api' import Vue from 'vue' import { ACCESS_TOKEN } from '../../../../store/mutation-types' @@ -156,13 +159,18 @@ export default { detailData: {}, // 文件的字段 fileField: [], + // 参与只允许查看 // 需要数据字段翻译的属性类型 needDictFieldList: [FieldType.USER_SINGLE.value, FieldType.ORGAN_SINGLE.value, FieldType.ORGAN_MORE.value, FieldType.OPTION_SINGLE.value, FieldType.OPTION_MORE.value, FieldType.TREE.value, FieldType.TREE_SINGLE.value], image: false, imageUrl: null, // 标准字段,需要跳转标准详情 standardFields: ['substitute_standard_number', 'replaced_by_standard_number', 'reference_standard', 'referenced_standard', 'adopt_the_international_standard_number', 'associated_foreign_standards'], - showViewAllField: ['auth_dept'] // 需要显示展示查看全部按钮的字段 + showViewAllField: [], // 需要显示展示查看全部按钮的字段 + // 参与只允许查看最新稿件排序的字段顺序(发布稿>TBT通报文件>报批稿>送审稿>征求意见稿>草案) + newestManuScriptField: ['publish_of_original', 'tbt_file', 'draft_for_review', 'draft_for_approval', 'draft_for_comment', 'draft'], + // 过程稿件中可以查看的最新文件id + manuScriptNewestFileId: '' } }, computed: { @@ -229,6 +237,17 @@ export default { this.$set(this.detailData, item + 'List', fileInfoList) } }) + // 不是废止状态的话,获取过程稿件中可以查看的最新文件id + if (this.detailData.standard_state !== StandardStatus.ABOLISH.value) { + for (const item of this.newestManuScriptField) { + if (this.detailData[item]) { + // 从文件列表里面获取 + const sortFileIdArr = this.detailData[item].split(',').sort((a, b) => b - a) // 日期只精确到天,用id更能区分 + this.manuScriptNewestFileId = sortFileIdArr[0] + break + } + } + } console.log(this.detailData) } else { this.$message.warn(res.message) @@ -260,10 +279,14 @@ export default { const data = this.detailData[fieldName + '_dictText'] || this.detailData[fieldName] this.$refs.textContentModal.open(data) }, - handlePreview (file) { + handlePreview (file, formItem) { if (!file || !file.url) { return } + if (this.newestManuScriptField.includes(formItem.dbFieldName) && file.id !== manuScriptNewestFileId) { + // 参与最新稿件不预览的不是最新的稿件不能预览 + return + } // 截取文件后缀名 const fileSuffix = file.fileName ? file.fileName.split('.')[file.fileName.split('.').length - 1] : '' const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt) diff --git a/src/views/standardRegulationLibrary/foreignStandard/modules/ForeignStandardModal.vue b/src/views/standardRegulationLibrary/foreignStandard/modules/ForeignStandardModal.vue index 91efb0d..11ccd48 100644 --- a/src/views/standardRegulationLibrary/foreignStandard/modules/ForeignStandardModal.vue +++ b/src/views/standardRegulationLibrary/foreignStandard/modules/ForeignStandardModal.vue @@ -138,6 +138,8 @@ export default { } -