[update] 修改bug87521,标准详情页最新稿件字段的所有文件都可以查看

This commit is contained in:
lideqin
2024-07-30 14:34:58 +08:00
parent 603c46272c
commit 2a62d833e0
2 changed files with 15 additions and 19 deletions
@@ -64,19 +64,19 @@
<template v-if="detailData[formItem.dbFieldName]"> <template v-if="detailData[formItem.dbFieldName]">
<div class="detail-page-process-manuscript-file" v-for="file in detailData[formItem.dbFieldName + 'List']" :key="file.id"> <div class="detail-page-process-manuscript-file" v-for="file in detailData[formItem.dbFieldName + 'List']" :key="file.id">
<div class="detail-page-process-manuscript-file-info" <div class="detail-page-process-manuscript-file-info"
:class="newestManuScriptField.includes(formItem.dbFieldName) && file.id !== manuScriptNewestFileId ? 'disabled-file-info' : ''"> :class="newestManuScriptField.includes(formItem.dbFieldName) && formItem.dbFieldName !== manuScriptNewestFileField ? 'disabled-file-info' : ''">
<a-icon type="link" /> <a-icon type="link" />
<div class="detail-page-process-manuscript-file-name" @click="handlePreview(file, formItem)">{{ file.fileName }}</div> <div class="detail-page-process-manuscript-file-name" @click="handlePreview(file, formItem)">{{ file.fileName }}</div>
</div> </div>
<div class="detail-page-process-manuscript-file-operate"> <div class="detail-page-process-manuscript-file-operate">
<!-- 下载--> <!-- 下载-->
<a-button type="link" icon="download" @click="handleDownload(file)" v-has="'enterpriseStandard:detail:download'" <a-button type="link" icon="download" @click="handleDownload(file)" v-has="'enterpriseStandard:detail:download'"
:disabled="newestManuScriptField.includes(formItem.dbFieldName) && file.id !== manuScriptNewestFileId"> :disabled="newestManuScriptField.includes(formItem.dbFieldName) && formItem.dbFieldName !== manuScriptNewestFileField">
{{ $t('download') }} {{ $t('download') }}
</a-button> </a-button>
<!-- 无水印下载--> <!-- 无水印下载-->
<a-button type="link" @click="downloadDraftNoWater(file)" v-has="'enterpriseStandard:detail:noWaterDownload'" <a-button type="link" @click="downloadDraftNoWater(file)" v-has="'enterpriseStandard:detail:noWaterDownload'"
:disabled="newestManuScriptField.includes(formItem.dbFieldName) && file.id !== manuScriptNewestFileId"> :disabled="newestManuScriptField.includes(formItem.dbFieldName) && formItem.dbFieldName !== manuScriptNewestFileField">
<i class="iconfont icon-water-drop-slash"></i> <i class="iconfont icon-water-drop-slash"></i>
{{ $t('unwatermarkedDownload') }} {{ $t('unwatermarkedDownload') }}
</a-button> </a-button>
@@ -195,8 +195,8 @@ export default {
standardFields: ['substitute_standard_number', 'replaced_by_standard_number', 'reference_standard', 'referenced_standard'], standardFields: ['substitute_standard_number', 'replaced_by_standard_number', 'reference_standard', 'referenced_standard'],
// 参与只允许查看最新稿件排序的字段顺序(发布稿>征求意见稿) // 参与只允许查看最新稿件排序的字段顺序(发布稿>征求意见稿)
newestManuScriptField: ['publish_of_original', 'draft_for_comment'], newestManuScriptField: ['publish_of_original', 'draft_for_comment'],
// 过程稿件中可以查看的最新文件id // 过程稿件中可以查看的最新字段
manuScriptNewestFileId: '', manuScriptNewestFileField: '',
filePerm: { // 上传文件根据权限控制只能查看,没有权限的除了系统管理员外不可见不可下载 filePerm: { // 上传文件根据权限控制只能查看,没有权限的除了系统管理员外不可见不可下载
associated_file: 'enterpriseStandard:associatedFile:look' // 关联文件 associated_file: 'enterpriseStandard:associatedFile:look' // 关联文件
} }
@@ -284,9 +284,7 @@ export default {
if (this.detailData.standard_state !== EnterpriseStandardStatus.ABOLISH.value) { if (this.detailData.standard_state !== EnterpriseStandardStatus.ABOLISH.value) {
for (const item of this.newestManuScriptField) { for (const item of this.newestManuScriptField) {
if (this.detailData[item]) { if (this.detailData[item]) {
// 从文件列表里面获取 this.manuScriptNewestFileField = item
const sortFileIdArr = this.detailData[item].split(',').sort((a, b) => b - a) // 日期只精确到天,用id更能区分
this.manuScriptNewestFileId = sortFileIdArr[0]
break break
} }
} }
@@ -312,7 +310,7 @@ export default {
if (!file || !file.url) { if (!file || !file.url) {
return return
} }
if (formItem && this.newestManuScriptField.includes(formItem.dbFieldName) && file.id !== this.manuScriptNewestFileId) { if (formItem && this.newestManuScriptField.includes(formItem.dbFieldName) && formItem.dbFieldName !== this.manuScriptNewestFileField) {
// 参与最新稿件不预览的不是最新的稿件不能预览 // 参与最新稿件不预览的不是最新的稿件不能预览
return return
} }
@@ -85,19 +85,19 @@
v-for="file in detailData[formItem.dbFieldName + 'List']" v-for="file in detailData[formItem.dbFieldName + 'List']"
:key="file.id"> :key="file.id">
<div class="detail-page-process-manuscript-file-info" <div class="detail-page-process-manuscript-file-info"
:class="newestManuScriptField.includes(formItem.dbFieldName) && file.id !== manuScriptNewestFileId ? 'disabled-file-info' : ''"> :class="newestManuScriptField.includes(formItem.dbFieldName) && formItem.dbFieldName !== manuScriptNewestFileField ? 'disabled-file-info' : ''">
<a-icon type="link" /> <a-icon type="link" />
<div class="detail-page-process-manuscript-file-name" @click="handlePreview(file, formItem)">{{ file.fileName }}</div> <div class="detail-page-process-manuscript-file-name" @click="handlePreview(file, formItem)">{{ file.fileName }}</div>
</div> </div>
<div class="detail-page-process-manuscript-file-operate"> <div class="detail-page-process-manuscript-file-operate">
<!-- 下载--> <!-- 下载-->
<a-button type="link" icon="download" v-has="btnPermission.download" @click="handleWatermarkedDownload(file)" <a-button type="link" icon="download" v-has="btnPermission.download" @click="handleWatermarkedDownload(file)"
:disabled="newestManuScriptField.includes(formItem.dbFieldName) && file.id !== manuScriptNewestFileId"> :disabled="newestManuScriptField.includes(formItem.dbFieldName) && formItem.dbFieldName !== manuScriptNewestFileField">
{{ $t('download') }} {{ $t('download') }}
</a-button> </a-button>
<!-- 无水印下载--> <!-- 无水印下载-->
<a-button type="link" v-has="btnPermission.unwatermarkedDownload" @click="handleDownload(file)" <a-button type="link" v-has="btnPermission.unwatermarkedDownload" @click="handleDownload(file)"
:disabled="newestManuScriptField.includes(formItem.dbFieldName) && file.id !== manuScriptNewestFileId"> :disabled="newestManuScriptField.includes(formItem.dbFieldName) && formItem.dbFieldName !== manuScriptNewestFileField">
<i class="iconfont icon-water-drop-slash"></i> <i class="iconfont icon-water-drop-slash"></i>
{{ $t('unwatermarkedDownload') }} {{ $t('unwatermarkedDownload') }}
</a-button> </a-button>
@@ -175,8 +175,8 @@ export default {
showViewAllField: ['part_name'], // 需要显示展示查看全部按钮的字段 showViewAllField: ['part_name'], // 需要显示展示查看全部按钮的字段
// 参与只允许查看最新稿件排序的字段顺序(发布稿>TBT通报文件>报批稿>送审稿>征求意见稿>草案) // 参与只允许查看最新稿件排序的字段顺序(发布稿>TBT通报文件>报批稿>送审稿>征求意见稿>草案)
newestManuScriptField: ['publish_of_original', 'tbt_file', 'draft_for_review', 'draft_for_approval', 'draft_for_comment', 'draft'], newestManuScriptField: ['publish_of_original', 'tbt_file', 'draft_for_review', 'draft_for_approval', 'draft_for_comment', 'draft'],
// 过程稿件中可以查看的最新文件id // 过程稿件中可以查看的最新字段
manuScriptNewestFileId: '', manuScriptNewestFileField: '',
retractableFlag: {}, // 面板展开收起的标识 retractableFlag: {}, // 面板展开收起的标识
// 业务基本信息有几个部分 // 业务基本信息有几个部分
formPartList: [], formPartList: [],
@@ -248,13 +248,11 @@ export default {
this.$set(this.detailData, item + 'List', fileInfoList) this.$set(this.detailData, item + 'List', fileInfoList)
} }
}) })
// 不是废止状态的话,获取过程稿件中可以查看的最新文件id // 不是废止状态的话,获取过程稿件中有文件的第一个字段
if (this.detailData.standard_state !== StandardStatus.ABOLISH.value) { if (this.detailData.standard_state !== StandardStatus.ABOLISH.value) {
for (const item of this.newestManuScriptField) { for (const item of this.newestManuScriptField) {
if (this.detailData[item]) { if (this.detailData[item]) {
// 从文件列表里面获取 this.manuScriptNewestFileField = item
const sortFileIdArr = this.detailData[item].split(',').sort((a, b) => b - a) // 日期只精确到天,用id更能区分
this.manuScriptNewestFileId = sortFileIdArr[0]
break break
} }
} }
@@ -313,7 +311,7 @@ export default {
if (!file || !file.url) { if (!file || !file.url) {
return return
} }
if (formItem && this.newestManuScriptField.includes(formItem.dbFieldName) && file.id !== this.manuScriptNewestFileId) { if (formItem && this.newestManuScriptField.includes(formItem.dbFieldName) && formItem.dbFieldName !== this.manuScriptNewestFileField) {
// 参与最新稿件不预览的不是最新的稿件不能预览 // 参与最新稿件不预览的不是最新的稿件不能预览
return return
} }