[update] 市场法规清单-历史版本

This commit is contained in:
lideqin
2024-07-03 14:18:02 +08:00
parent b6fec30026
commit 0d918c71dd
5 changed files with 41 additions and 37 deletions
@@ -1,5 +1,10 @@
<template>
<internal-detail-page :title="$route.query.title" :content-padding="0" :loading="loading">
<!-- 标题右侧按钮 -->
<template v-if="ids.length <= 1" v-slot:titleRightCustom>
<!-- 历史版本 -->
<a-button type="primary" ghost @click="clickHistoryVersion">{{ $t('standardRegulationLibrary.marketRegulationsList.historicalVersion') }}</a-button>
</template>
<div class="content-wrapper">
<a-row class="basic-info" v-if="ids.length <= 1">
<!-- 国家/地区 -->
@@ -98,12 +103,15 @@
</div>
<!-- table区域-end -->
</div>
<!-- 历史版本弹框 -->
<history-version-modal ref="historyVersionModal"/>
</internal-detail-page>
</template>
<script>
import InternalDetailPage from '../../../components/InternalDetailPage'
import FileEcho from '../../../components/FileEcho'
import HistoryVersionModal from './modules/HistoryVersionModal'
import { getMarketRegulationListById } from '../../../api/standardRegulationLibraryApi'
import JTable from '../../../components/jero/JTable'
import { StandardSource } from '../../../enums/commonEnums'
@@ -111,7 +119,7 @@ import { mapGetters } from 'vuex'
export default {
name: 'MarketRegulationsDetailPage',
components: { InternalDetailPage, FileEcho, JTable },
components: { InternalDetailPage, FileEcho, JTable, HistoryVersionModal },
computed: {
...mapGetters(['defaultHeight']),
yScrollHeight () {
@@ -292,12 +300,23 @@ export default {
ids: []
}
},
beforeRouteUpdate (to, from, next) {
if (to.query.manifestVersion !== from.query.manifestVersion) {
if (to.query.manifestVersion) {
this.filters.manifestVersion = to.query.manifestVersion
}
this.ids = to.query.ids.split(',')
this.initData(to.query.ids)
next()
} else {
next()
}
},
mounted () {
if (this.$route.query.versionNumber) {
this.filters.manifestVersion = this.$route.query.versionNumber
if (this.$route.query.manifestVersion) {
this.filters.manifestVersion = this.$route.query.manifestVersion
}
this.ids = this.$route.query.ids.split(',')
console.log('----ids', this.ids)
this.initData(this.$route.query.ids)
},
methods: {
@@ -359,6 +378,10 @@ export default {
id: record.standardId
}
})
},
// 点击历史版本
clickHistoryVersion () {
this.$refs.historyVersionModal.open(this.model)
}
}
}
@@ -1,7 +1,7 @@
<template>
<internal-detail-page :title="$route.query.title" :content-padding="0" :loading="loading">
<!-- 标题右侧按钮 -->
<template v-if="model.id" v-slot:titleRightCustom>
<template v-if="model.manifest.id" v-slot:titleRightCustom>
<!-- 历史版本 -->
<a-button type="primary" ghost @click="clickHistoryVersion">{{ $t('standardRegulationLibrary.marketRegulationsList.historicalVersion') }}</a-button>
</template>
@@ -526,7 +526,7 @@ export default {
},
// 点击历史版本
clickHistoryVersion () {
this.$refs.historyVersionModal.open(this.model.id)
this.$refs.historyVersionModal.open(this.model)
},
// 查询
searchQuery () {
@@ -113,14 +113,6 @@
</a-tooltip>
</template>
<!-- 清单版本 -->
<template v-slot:manifestVersion="{text}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? ('V' + text + '.0') : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? ('V' + text + '.0') : global.emptyLine }}</div>
</a-tooltip>
</template>
</j-table>
</div>
<!-- table区域-end -->
@@ -176,7 +168,7 @@ export default {
align: 'center',
width: 180,
dataIndex: 'manifestVersion',
scopedSlots: { customRender: 'manifestVersion' }
scopedSlots: { customRender: 'text' }
},
{ // 发布时间
title: this.$t('standardRegulationLibrary.marketRegulationsList.releaseTime'),
@@ -11,10 +11,11 @@
<a-table
ref="table"
rowKey="id"
rowKey="version"
:columns="columns"
:dataSource="dataSource"
:loading="loading"
:pagination="false"
:showHeader="false"
:scroll="{x: '100%', y: 'calc(100vh - 500px)'}">
@@ -32,7 +33,6 @@
</template>
<script>
import { marketRegulationListHistoryList } from '../../../../api/standardRegulationLibraryApi'
export default {
name: 'HistoryVersionModal',
@@ -50,24 +50,15 @@ export default {
scopedSlots: { customRender: 'toDetail' }
}
],
dataSource: [
{id: 1, version: 'V1.0'},
{id: 2, version: 'V2.0'},
{id: 3, version: 'V3.0'},
]
dataSource: []
}
},
methods: {
open (id) {
open (model) {
this.visible = true
this.model.id = id
// this.initData(id)
},
initData (id) {
marketRegulationListHistoryList({ id }).then(res => {
if (res.success) {
this.dataSource = res.result
}
this.model = Object.assign({}, model)
this.dataSource = this.model.historyVersions.map(item => {
return { version: item }
})
},
// 点击版本号
@@ -76,10 +67,11 @@ export default {
path: '/standardRegulationLibrary/marketRegulationsList/marketRegulationsDetailPage',
query: {
title: this.$t('view'),
ids: this.model.id,
versionNumber: record.version
ids: this.model.manifest.id,
manifestVersion: record.version
}
})
this.visible = false
},
handleCancel () {
this.visible = false