[update] 外标详情,废止状态下有被代替标准编号显示已有新版本,否则显示废止

This commit is contained in:
lideqin
2024-08-28 16:50:55 +08:00
parent 03f10f4077
commit 67b3246243
3 changed files with 24 additions and 3 deletions
@@ -36,7 +36,9 @@ module.exports = {
cancelCollection: 'Delete Collection', // 取消收藏
exportFileName: 'External Standard(s) and Regulation(s)',
exportZipName: 'External Standard(s) and Regulation(s) (With files)',
templateName: 'Import template for External Standard(s) and Regulation(s)'
templateName: 'Import template for External Standard(s) and Regulation(s)',
haveNewVersion: '(New version available)',
annul: '(repealed)'
},
// 动态消息
dynamicMessage: {
@@ -36,7 +36,9 @@ module.exports = {
cancelCollection: '取消收藏',
exportFileName: '外来标准法规',
exportZipName: '外来标准法规(带文件)',
templateName: '外来标准法规导入模板'
templateName: '外来标准法规导入模板',
haveNewVersion: '(已有新版本)',
annul: '(废止)'
},
// 动态消息
dynamicMessage: {
@@ -1,7 +1,8 @@
<template>
<div class="detail-page">
<a-spin :spinning="loading">
<div class="detail-page-title">{{ pageTitle }}{{ $t('details') }}</div>
<!-- 展示已有新版本或者废止废止状态并且被代替标准编号存在则显示已有新版本不存在被代替标准显示废止 -->
<div class="detail-page-title">{{ pageTitle }}{{ $t('details') }}<span class="title-red-span">{{ haveNewVersion }}</span></div>
<div class="detail-page-part" v-for="(part, index) in partList" :key="part + index">
<div class="detail-page-part-title">
@@ -211,6 +212,18 @@ export default {
operateApiFunc () {
const func = ForeignApi
return func
},
// 标题处显示已有新版本还是废止
haveNewVersion () {
if (this.detailData.standard_state === StandardStatus.ABOLISH.value && this.detailData.replaced_by_standard_number) {
// 是废止状态,并且被代替标准编号有值,显示已有新版本
return this.$t('standardRegulationLibrary.foreignStandard.haveNewVersion')
} else if (this.detailData.standard_state === StandardStatus.ABOLISH.value) {
// 是废止状态
return this.$t('standardRegulationLibrary.foreignStandard.annul')
} else {
return ''
}
}
},
async created () {
@@ -461,4 +474,8 @@ export default {
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
color: @primary-color;
}
.title-red-span {
color: #D52C26;
}
</style>