[update] 企标详情授权部门有值的话显示查看全部按钮

(cherry picked from commit f31c857f9c)
This commit is contained in:
lideqin
2024-01-13 21:24:50 +08:00
committed by 赵霄
parent 87968c4278
commit 6def378d7a
3 changed files with 60 additions and 3 deletions
@@ -47,6 +47,12 @@
<span></span>
</template>
</div>
<!-- 需要显示查看全部按钮 -->
<a-button v-else-if="showViewAllField.includes(formItem.dbFieldName) &&
(detailData[formItem.dbFieldName + '_dictText'] || detailData[formItem.dbFieldName])"
type="primary" ghost @click="viewAll('auth_dept')">
{{ $t('enterpriseStandardLibrary.standard.viewAll')}}
</a-button>
<span v-else-if="detailData[formItem.dbFieldName + '_dictText']">{{ detailData[formItem.dbFieldName + '_dictText'] }}</span>
<span v-else-if="detailData[formItem.dbFieldName]">{{ detailData[formItem.dbFieldName] }}</span>
<span v-else>—</span>
@@ -126,6 +132,7 @@
<img v-show="image" :src="imageUrl">
</div>
</div>
<text-content-modal ref="textContentModal"></text-content-modal>
</div>
</template>
@@ -144,6 +151,7 @@ import { getFileInfo } from '../../../../api/api'
import UserSelectModal from '@comp/selection/UserSelectModal'
import StandardResolutionSheetModal from '@views/standardRegulationLibrary/commonPage/modules/StandardResolutionSheetModal'
import { kkFilePreview } from '@/utils/kkFilePreview'
import TextContentModal from './module/TextContentModal'
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
@@ -152,7 +160,7 @@ const FILE_TYPE_PDF = 'pdf'
export default {
name: 'EnterpriseStandardDetail',
components: { StandardResolutionSheetModal, UserSelectModal, EnterpriseStandardEvaluateModal, SubmitQuestionModal, UpdateRecordModal },
components: { TextContentModal, StandardResolutionSheetModal, UserSelectModal, EnterpriseStandardEvaluateModal, SubmitQuestionModal, UpdateRecordModal },
data () {
return {
FieldType,
@@ -197,7 +205,8 @@ export default {
], // 稽查内容表格列参数
dataSource: [], // 稽查内容数据
image: false,
imageUrl: ''
imageUrl: '',
showViewAllField: ['auth_dept'] // 需要显示展示查看全部按钮的字段
}
},
created () {
@@ -326,6 +335,11 @@ export default {
previewStandardResolutionSheet (id) {
this.$refs.standardResolutionSheetModal.open(id)
},
// 查看全部
viewAll (fieldName) {
const data = this.detailData[fieldName + '_dictText'] || this.detailData[fieldName]
this.$refs.textContentModal.open(data)
}
}
}
</script>
@@ -0,0 +1,42 @@
<template>
<j-modal
:title="$t('view')"
:visible="visible"
:width="1000"
:footer="false"
switchFullscreen
@cancel="handleCancel">
<div class="text-content">{{ content }}</div>
</j-modal>
</template>
<script>
export default {
name: 'TextContentModal',
data () {
return {
visible: false,
content: null
}
},
methods: {
open (text) {
this.content = text
this.visible = true
},
handleCancel () {
this.visible = false
this.content = null
}
}
}
</script>
<style scoped lang="less">
.text-content {
max-height: calc(100vh - 200px - 55px);
overflow: auto;
margin: 0 -24px;
padding: 0 24px;
}
</style>