fix 78429(国标、海外)

This commit is contained in:
赵霄
2024-02-02 11:52:03 +08:00
parent fbf328fc46
commit 9b7779feb6
3 changed files with 97 additions and 4 deletions
+7 -1
View File
@@ -96,6 +96,10 @@ const deleteProfileCenterTree = (params) => postAction('/laws/dataCenter/lawsDat
// 资料中心-获取树节点树
const getProfileCenterTree = (params) => getAction('/laws/dataCenter/lawsDataCenterFolder/getTreeList', params)
// 国标、海外、企标通用接口
// 通过标准号获取信息
const getStandardInfoByStandardNumber = (params) => getAction('/laws/standard/common/getInfoByStandardNo', params)
export {
// 国内标准
getDomesticStandardSearchForm,
@@ -149,5 +153,7 @@ export {
addChildrenFolder,
editProfileCenterTree,
deleteProfileCenterTree,
getProfileCenterTree
getProfileCenterTree,
getStandardInfoByStandardNumber
}
+22
View File
@@ -5,6 +5,7 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getFileInfo } from '@/api/api'
import { dealUrl, kkFilePreview } from './kkFilePreview'
import { previewPdf } from './previewPdf'
import { getStandardInfoByStandardNumber } from '../api/standardRegulationLibraryApi'
// import onlineCommons from '@/components/onlineForm/onlineForm'
//
@@ -715,3 +716,24 @@ export function previewFileCurrentWindowByFileId (fileId) {
})
})
}
/**
* 通过标准编号获取标准信息
* @param standardNumber
* @returns {Promise<unknown>}
*/
export function queryStandardInfoByStandardNumber (standardNumber) {
return new Promise(resolve => {
let result = false
getStandardInfoByStandardNumber({ standardNumber }).then(res => {
if (res.success && !!res.result) {
result = res.result
} else {
// 提示未找到对应标准
Vue.prototype.$message.warning('未找到对应标准信息')
}
}).finally(() => {
resolve(result)
})
})
}
@@ -26,8 +26,17 @@
<div class="detail-page-part-form" v-if="part !== '过程稿件' && part !== 'Process Manuscript'">
<div class="detail-page-part-form-item" v-for="formItem in form[part]" :key="formItem.id">
<label>{{ formItem.dbFieldTxt }}</label>
<!--标准需要跳转是标准字段且有内容的情况下在这处理-->
<template v-if="standardFields.includes(formItem.dbFieldName) && !!detailData[formItem.dbFieldName]">
<div class="div-form-content">
<template v-for="(standard, standardIndex) in detailData[formItem.dbFieldName].split(',')">
<div class="can-click" :key="'standardKey' + standardIndex" @click="toStandardDetailPage(standard)">{{ standard }}</div>
<div v-if="standardIndex!==detailData[formItem.dbFieldName].split(',').length - 1">,</div>
</template>
</div>
</template>
<!--文件需要显示预览-->
<span v-if="!fileField.includes(formItem.dbFieldName)">
<span v-else-if="!fileField.includes(formItem.dbFieldName)">
{{
detailData[needDictFieldList.includes(formItem.fieldShowType) ? formItem.dbFieldName + '_dictText' : formItem.dbFieldName] || global.emptyLine
}}
@@ -140,7 +149,7 @@ import { downloadFile, getFileAccessHttpUrl } from '../../../api/manage.js'
import { previewPdf } from '../../../utils/previewPdf.js'
import { Base64 } from 'js-base64'
import { kkFilePreview } from '../../../utils/kkFilePreview'
import { previewFileCurrentWindowByFileId } from '../../../utils/util'
import { previewFileCurrentWindowByFileId, queryStandardInfoByStandardNumber } from '../../../utils/util'
// 国内标准权限
const DomesticStandardPermission = {
@@ -196,7 +205,9 @@ export default {
// 需要数据字段翻译的属性类型
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
imageUrl: null,
// 标准字段,需要跳转标准详情
standardFields: ['substitute_standard_number', 'replaced_by_standard_number', 'reference_standard', 'referenced_standard', 'adopt_the_international_standard_number', 'associated_foreign_standards']
}
},
computed: {
@@ -424,6 +435,39 @@ export default {
*/
handleWatermarkedDownload (file) {
downloadFile(`/sys/common/download/${file.id}`, file.fileName)
},
async toStandardDetailPage (standardNumber) {
const standardInfo = await queryStandardInfoByStandardNumber(standardNumber)
if (!standardInfo) {
return
}
let path
// 根据来源跳转不同的详情页
switch (standardInfo.source) {
// 国内
case StandardSource.DOMESTIC.value:
path = '/standardRegulationLibrary/DomesticStandardDetail'
break
// 海外
case StandardSource.OVERSEAS.value:
path = '/standardRegulationLibrary/OverseasStandardDetail'
break
// 企标
case StandardSource.ENTERPRISE.value:
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
break
default:
break
}
if (!path) {
return
}
const query = {
id: standardInfo.id
}
this.$openPageNewSheet({
path, query
})
}
}
}
@@ -440,4 +484,25 @@ export default {
color: @primary-color;
font-size: 14px;
}
.div-form-content {
word-break: break-all;
white-space: pre-wrap;
font-size: 16px;
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
color: #1D2129;
-ms-flex: 1;
flex: 1;
width: 0;
}
.div-form-content > div {
display: inline-block;
}
.can-click {
display: inline-block;
color: @primary-color;
cursor: pointer;
}
</style>