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

This commit is contained in:
lideqin
2024-07-08 11:24:56 +08:00
parent 8bceb86ae0
commit c3e83bad67
3 changed files with 17 additions and 9 deletions
@@ -295,7 +295,8 @@ export default {
url: {
list: '/laws/marketStandardDetail/page'
},
disableMixinCreated: true
disableMixinCreated: true,
historyVersions: [] // 历史版本数据
}
},
beforeRouteUpdate (to, from, next) {
@@ -306,6 +307,7 @@ export default {
this.ids = to.query.ids.split(',')
this.filters.manifestId = to.query.ids
this.initData(to.query.ids)
this.loadData()
next()
} else {
next()
@@ -332,6 +334,7 @@ export default {
getMarketRegulationListById(param).then(res => {
if (res.success) {
this.model = Object.assign({}, res.result.manifest)
this.historyVersions = JSON.parse(JSON.stringify(res.result.historyVersions))
}
}).finally(() => {
this.loading = false
@@ -348,7 +351,7 @@ export default {
},
// 点击历史版本
clickHistoryVersion () {
this.$refs.historyVersionModal.open(this.model)
this.$refs.historyVersionModal.open(this.model.id, this.historyVersions)
}
}
}
@@ -459,7 +459,8 @@ export default {
delete: '/laws/marketStandardDetail/delete'
},
disableMixinCreated: true,
importData: {}
importData: {},
historyVersions: [] // 历史版本
}
},
mounted () {
@@ -489,6 +490,7 @@ export default {
getMarketRegulationListById(param).then(res => {
if (res.success) {
this.model = Object.assign({}, res.result.manifest)
this.historyVersions = JSON.parse(JSON.stringify(res.result.historyVersions))
if (this.model.country) {
this.model.country = this.model.country.split(',').map(item => {
return { value: item }
@@ -504,7 +506,7 @@ export default {
},
// 点击历史版本
clickHistoryVersion () {
this.$refs.historyVersionModal.open(this.model)
this.$refs.historyVersionModal.open(this.model.id, this.historyVersions)
},
// 下一步或提交, 提交基础信息
handleNext () {
@@ -530,6 +532,9 @@ export default {
if (!this.model.id) {
// 没有id,是新增会返回id,用于下方表格处理
this.model.id = res.message
this.filters.manifestId = this.model.id
// 更新清单编号
this.initData(this.model.id)
}
this.showList = true
} else {
@@ -648,7 +653,7 @@ export default {
}
.content-wrapper {
height: calc(100% - 52px);
height: 100%;
box-sizing: border-box;
overflow: auto;
padding: 32px 20px;
@@ -54,10 +54,10 @@ export default {
}
},
methods: {
open (model) {
open (manifestId, historyVersions) {
this.visible = true
this.model = Object.assign({}, model)
this.dataSource = this.model.historyVersions.map(item => {
this.model.id = manifestId
this.dataSource = historyVersions.map(item => {
return { version: item }
})
},
@@ -67,7 +67,7 @@ export default {
path: '/standardRegulationLibrary/marketRegulationsList/marketRegulationsDetailPage',
query: {
title: this.$t('view'),
ids: this.model.manifest.id,
ids: this.model.id,
manifestVersion: record.version
}
})