diff --git a/src/api/standardRegulationLibraryApi.js b/src/api/standardRegulationLibraryApi.js index 913359e8..d3602c3e 100644 --- a/src/api/standardRegulationLibraryApi.js +++ b/src/api/standardRegulationLibraryApi.js @@ -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 } diff --git a/src/utils/util.js b/src/utils/util.js index 107cbda6..6d0492c8 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -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} + */ +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) + }) + }) +} diff --git a/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue b/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue index 3ec7d6be..772601fe 100644 --- a/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue +++ b/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue @@ -26,8 +26,17 @@
+ + - + {{ 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; +}