fix: 修改 asset 二级菜单复制时 信息不全的问题

This commit is contained in:
@changcode
2021-09-15 15:05:47 +08:00
parent bf5f6ac3f3
commit 1bab37695f
2 changed files with 20 additions and 4 deletions

View File

@@ -120,8 +120,16 @@ export default {
},
methods: {
duplicate (row) {
this.object = { ...row, id: '', name: `${row.name}-copy` }
this.rightBox.show = true
this.$get(`${this.url}/${row.id}`).then(response => {
if (response.code === 200) {
this.object = { ...response.data, id: '', name: `${row.name}-copy` }
if (this.object.name.length > 64) {
const length = this.object.name.length - 64
this.object.name = row.name.substring(0, row.name.length - length) + '-copy'
}
this.rightBox.show = true
}
})
},
getStateData () {
return new Promise(resolve => {